diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f80844..b97f4d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ - Add plugin e2e tests and remove cypress (#281, #283) - Update context parameters in Examples (#282) - Add Business Charts video tutorial (#291) +- Provisioning for events updated (#289) +- Update panel options (#289) +- Update Code suggestions (#293) ## 6.0.0 (2024-03-24) diff --git a/src/constants/editor.ts b/src/constants/editor.ts index b004e9f..784a105 100644 --- a/src/constants/editor.ts +++ b/src/constants/editor.ts @@ -1,4 +1,4 @@ -import { CodeEditorSuggestionItem, CodeEditorSuggestionItemKind } from '@grafana/ui'; +import { CodeEditorSuggestionItem } from '@grafana/ui'; import { codeParameters, visualCodeParameters } from '../utils'; @@ -52,65 +52,9 @@ export const FORMAT_OPTIONS = [ ]; /** - * Suggestions + * Code Suggestions */ -export const CODE_EDITOR_SUGGESTIONS: CodeEditorSuggestionItem[] = [ - { - label: 'data', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'Result set of panel queries.', - }, - { - label: 'theme', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'Theme object.', - }, - { - label: 'echartsInstance', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'Instance of the ECharts.', - }, - { - label: 'echarts', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'ECharts library.', - }, - { - label: 'ecStat', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'A statistical and data mining tool.', - }, - { - label: 'locationService', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'Browser location and history.', - }, - { - label: 'eventBus', - kind: CodeEditorSuggestionItemKind.Property, - detail: 'Event bus for application events.', - }, - { - label: 'replaceVariables', - kind: CodeEditorSuggestionItemKind.Method, - detail: 'Interpolate variables.', - }, - { - label: 'notifySuccess', - kind: CodeEditorSuggestionItemKind.Method, - detail: 'Display successful notification.', - }, - { - label: 'notifyError', - kind: CodeEditorSuggestionItemKind.Method, - detail: 'Display error notification.', - }, - - /** - * Context - */ - ...codeParameters.suggestions, -]; +export const CODE_EDITOR_SUGGESTIONS: CodeEditorSuggestionItem[] = codeParameters.suggestions; /** * Visual Code Editor Suggestions diff --git a/src/utils/code-parameters.ts b/src/utils/code-parameters.ts index 7da5e32..5317439 100644 --- a/src/utils/code-parameters.ts +++ b/src/utils/code-parameters.ts @@ -3,6 +3,7 @@ import { LocationService } from '@grafana/runtime'; import { CodeEditorSuggestionItemKind } from '@grafana/ui'; import { CodeParameterItem, CodeParametersBuilder } from '@volkovlabs/components'; import { ECharts } from 'echarts'; +import echartsStat from 'echarts-stat'; import { SeriesItem } from '../types'; @@ -28,7 +29,7 @@ const baseParametersConfig = { 'Interpolate variables.', CodeEditorSuggestionItemKind.Method ), - theme: new CodeParameterItem('Location service.'), + theme: new CodeParameterItem('Theme object.'), notifySuccess: new CodeParameterItem<(payload: AlertPayload) => void>( 'Display successful notification.', CodeEditorSuggestionItemKind.Method @@ -37,9 +38,11 @@ const baseParametersConfig = { 'Display error notification.', CodeEditorSuggestionItemKind.Method ), - refresh: new CodeParameterItem<() => void>('Refresh dashboard.', CodeEditorSuggestionItemKind.Method), + refresh: new CodeParameterItem<() => void>('Refresh dashboard panels using application events.', CodeEditorSuggestionItemKind.Method), }, }, + echarts: new CodeParameterItem('Apache ECharts library.'), + ecStat: new CodeParameterItem('A statistical and data mining tool for Apache ECharts.'), }, }; @@ -58,8 +61,8 @@ export const visualCodeParameters = new CodeParametersBuilder({ editor: { detail: 'Editor properties.', items: { - dataset: new CodeParameterItem<{ source: [string[], ...unknown[]] }>('Echarts dataset.'), - series: new CodeParameterItem('Echarts series.'), + dataset: new CodeParameterItem<{ source: [string[], ...unknown[]] }>('ECharts dataset.'), + series: new CodeParameterItem('ECharts series.'), }, }, },