diff --git a/.betterer.results b/.betterer.results index e84c90caa42..01a8e96aa9f 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2897,10 +2897,7 @@ exports[`better eslint`] = { ], "public/app/features/variables/inspect/NetworkGraph.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"] + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/app/features/variables/inspect/VariablesUnknownTable.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], @@ -4131,6 +4128,15 @@ exports[`no undocumented stories`] = { "packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], + "packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/ColorPicker/ColorPickerInput.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/ColorPicker/SeriesColorPicker.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], "packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], @@ -4146,12 +4152,27 @@ exports[`no undocumented stories`] = { "packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], + "packages/grafana-ui/src/components/Dropdown/ButtonSelect.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/FormField/FormField.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/List/List.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], "packages/grafana-ui/src/components/PageLayout/PageToolbar.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], "packages/grafana-ui/src/components/QueryField/QueryField.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], + "packages/grafana-ui/src/components/SecretFormField/SecretFormField.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], "packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], @@ -4164,6 +4185,9 @@ exports[`no undocumented stories`] = { "packages/grafana-ui/src/components/Segment/SegmentInput.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], + "packages/grafana-ui/src/components/Select/SelectPerf.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], "packages/grafana-ui/src/components/Slider/RangeSlider.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], @@ -4173,9 +4197,21 @@ exports[`no undocumented stories`] = { "packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], + "packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/ThemeDemos/BorderRadius.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/components/ThemeDemos/EmotionPerfTest.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], "packages/grafana-ui/src/components/ThemeDemos/ThemeDemo.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], + "packages/grafana-ui/src/components/ThemeDemos/Typography.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], "packages/grafana-ui/src/components/UnitPicker/UnitPicker.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ], @@ -4187,6 +4223,9 @@ exports[`no undocumented stories`] = { ], "packages/grafana-ui/src/components/VizTooltip/SeriesTable.story.tsx:5381": [ [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] + ], + "packages/grafana-ui/src/utils/useDelayedSwitch.story.tsx:5381": [ + [0, 0, 0, "No undocumented stories are allowed, please add an .mdx file with some documentation", "5381"] ] }` }; diff --git a/.github/workflows/detect-breaking-changes-levitate.yml b/.github/workflows/detect-breaking-changes-levitate.yml index a4328970ff7..c738c18bbac 100644 --- a/.github/workflows/detect-breaking-changes-levitate.yml +++ b/.github/workflows/detect-breaking-changes-levitate.yml @@ -158,6 +158,7 @@ jobs: - id: 'auth' uses: 'google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f' + if: github.event.pull_request.head.repo.full_name == github.repository with: workload_identity_provider: projects/304398677251/locations/global/workloadIdentityPools/github/providers/github-provider service_account: github-plugins-data-levitate@grafanalabs-workload-identity.iam.gserviceaccount.com @@ -165,6 +166,7 @@ jobs: - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a' + if: github.event.pull_request.head.repo.full_name == github.repository with: version: '>= 363.0.0' project_id: 'grafanalabs-global' @@ -175,6 +177,7 @@ jobs: run: ./scripts/check-breaking-changes.sh env: FORCE_COLOR: 3 + IS_FORK: ${{ github.event.pull_request.head.repo.full_name != github.repository }} # used in check-breaking-changes.sh and levitate-parse-json-report.js - name: Persisting the check output run: | @@ -199,6 +202,7 @@ jobs: permissions: contents: read id-token: write + if: github.event.pull_request.head.repo.full_name == github.repository steps: - id: get-secrets diff --git a/apps/dashboard/kinds/v2alpha1/dashboard_spec.cue b/apps/dashboard/kinds/v2alpha1/dashboard_spec.cue index 180cc985669..95da187b1e5 100644 --- a/apps/dashboard/kinds/v2alpha1/dashboard_spec.cue +++ b/apps/dashboard/kinds/v2alpha1/dashboard_spec.cue @@ -394,7 +394,7 @@ AnnotationQuerySpec: { name: string builtIn?: bool | *false filter?: AnnotationPanelFilter - legacyOptions?: [string]: _ //Catch-all field for datasource-specific properties + legacyOptions?: [string]: _ // Catch-all field for datasource-specific properties. Should not be available in as code tooling. } AnnotationQueryKind: { diff --git a/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec.cue b/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec.cue index 50306a06aa0..8cc188b0909 100644 --- a/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec.cue +++ b/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec.cue @@ -398,7 +398,7 @@ AnnotationQuerySpec: { name: string builtIn?: bool | *false filter?: AnnotationPanelFilter - legacyOptions?: [string]: _ //Catch-all field for datasource-specific properties + legacyOptions?: [string]: _ // Catch-all field for datasource-specific properties. Should not be available in as code tooling. } AnnotationQueryKind: { diff --git a/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec_gen.go b/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec_gen.go index 79d77c4de74..f1acc3f273b 100644 --- a/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec_gen.go +++ b/apps/dashboard/pkg/apis/dashboard/v2alpha1/dashboard_spec_gen.go @@ -30,7 +30,7 @@ type DashboardAnnotationQuerySpec struct { Name string `json:"name"` BuiltIn *bool `json:"builtIn,omitempty"` Filter *DashboardAnnotationPanelFilter `json:"filter,omitempty"` - // Catch-all field for datasource-specific properties + // Catch-all field for datasource-specific properties. Should not be available in as code tooling. LegacyOptions map[string]interface{} `json:"legacyOptions,omitempty"` } diff --git a/apps/dashboard/pkg/apis/dashboard/v2alpha1/zz_generated.openapi.go b/apps/dashboard/pkg/apis/dashboard/v2alpha1/zz_generated.openapi.go index 4e55caae3c6..302f539a9ec 100644 --- a/apps/dashboard/pkg/apis/dashboard/v2alpha1/zz_generated.openapi.go +++ b/apps/dashboard/pkg/apis/dashboard/v2alpha1/zz_generated.openapi.go @@ -643,7 +643,7 @@ func schema_pkg_apis_dashboard_v2alpha1_DashboardAnnotationQuerySpec(ref common. }, "legacyOptions": { SchemaProps: spec.SchemaProps{ - Description: "Catch-all field for datasource-specific properties", + Description: "Catch-all field for datasource-specific properties. Should not be available in as code tooling.", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, diff --git a/conf/provisioning/sample/dashboard-v1-annotations.json b/conf/provisioning/sample/dashboard-v1-annotations.json new file mode 100644 index 00000000000..7e90452a2a5 --- /dev/null +++ b/conf/provisioning/sample/dashboard-v1-annotations.json @@ -0,0 +1,257 @@ +{ + "kind": "Dashboard", + "apiVersion": "dashboard.grafana.app/v1beta1", + "metadata": { + "name": "test-v1-annotations", + "annotations": { + "hello": "world" + }, + "labels": { + "region": "west" + } + }, + "spec": { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": false, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + }, + { + "datasource": { + "type": "grafana-testdata-datasource", + "uid": "PD8C576611E62080A" + }, + "enable": true, + "hide": false, + "iconColor": "blue", + "name": "testdata-annos", + "target": { + "lines": 10, + "refId": "Anno", + "scenarioId": "annotations" + } + }, + { + "enable": true, + "hide": false, + "iconColor": "blue", + "name": "no-ds-testdata-annos", + "target": { + "lines": 10, + "refId": "Anno", + "scenarioId": "annotations" + } + }, + { + "datasource": { + "type": "prometheus", + "uid": "gdev-prometheus" + }, + "enable": true, + "hide": false, + "iconColor": "yellow", + "name": "prom-annos", + "target": { + "expr": "{action=\"add_client\"}", + "interval": "", + "lines": 10, + "refId": "Anno", + "scenarioId": "annotations" + } + }, + { + "enable": true, + "hide": false, + "iconColor": "yellow", + "name": "no-ds-prom-annos", + "target": { + "expr": "{action=\"add_client\"}", + "interval": "", + "lines": 10, + "refId": "Anno", + "scenarioId": "annotations" + } + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "PBBCEC2D313BC06C3" + }, + "enable": true, + "hide": false, + "iconColor": "red", + "name": "postgress-annos", + "target": { + "editorMode": "builder", + "format": "table", + "lines": 10, + "rawSql": "", + "refId": "Anno", + "scenarioId": "annotations", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + { + "datasource": { + "type": "elasticsearch", + "uid": "gdev-elasticsearch" + }, + "enable": true, + "hide": false, + "iconColor": "red", + "name": "elastic - annos", + "tagsField": "asd", + "target": { + "lines": 10, + "query": "test query", + "refId": "Anno", + "scenarioId": "annotations" + }, + "textField": "asd", + "timeEndField": "asdas", + "timeField": "asd" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "datasource": { + "type": "grafana-testdata-datasource", + "uid": "PD8C576611E62080A" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.1.0-pre", + "targets": [ + { + "refId": "A" + } + ], + "title": "New panel", + "type": "timeseries" + } + ], + "preload": false, + "schemaVersion": 41, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Test: V1 dashboard with annotations", + "version": 8 + } +} diff --git a/e2e/storybook/verify.spec.ts b/e2e/storybook/verify.spec.ts index 2610b1d5bf6..f6210d890d1 100644 --- a/e2e/storybook/verify.spec.ts +++ b/e2e/storybook/verify.spec.ts @@ -3,7 +3,7 @@ // NOTE: storybook must already be running (`yarn storybook`) for this test to work describe('Verify storybook', () => { it('Loads the button story correctly', () => { - cy.visit('?path=/story/buttons-button--basic'); + cy.visit('?path=/story/inputs-button--basic'); getIframeBody().find('button:contains("Example button")').should('be.visible'); }); }); diff --git a/eslint.config.js b/eslint.config.js index 055bb6e4158..9f5bcc9da52 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -176,6 +176,13 @@ module.exports = [ 'react/react-in-jsx-scope': 'off', }, }, + { + name: 'grafana/story-rules', + files: ['packages/grafana-ui/src/**/*.story.tsx'], + rules: { + '@grafana/consistent-story-titles': 'error', + }, + }, { name: 'grafana/public-dashboards-overrides', files: ['public/dashboards/scripted*.js'], diff --git a/jest.config.js b/jest.config.js index 60d5a141652..0882834ab48 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,17 +5,22 @@ process.env.TZ = 'Pacific/Easter'; // UTC-06:00 or UTC-05:00 depending on daylig const esModules = [ '@glideapps/glide-data-grid', + '@wojtekmaj/date-utils', 'ol', 'd3', 'd3-color', 'd3-interpolate', 'delaunator', + 'get-user-locale', 'internmap', 'robust-predicates', 'leven', 'nanoid', 'marked', + 'memoize', + 'mimic-function', 'monaco-promql', + 'react-calendar', '@kusto/monaco-kusto', 'monaco-editor', '@msagl', diff --git a/package.json b/package.json index 5bc553728f6..c9d80186f8f 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "@types/jquery": "3.5.32", "@types/js-yaml": "^4.0.5", "@types/jsurl": "^1.2.28", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/logfmt": "^1.2.3", "@types/lucene": "^2", "@types/node": "22.15.0", @@ -156,7 +156,7 @@ "@types/slate-plain-serializer": "0.7.5", "@types/slate-react": "0.22.9", "@types/swagger-ui-react": "5.18.0", - "@types/systemjs": "6.15.1", + "@types/systemjs": "6.15.3", "@types/tinycolor2": "1.4.6", "@types/uuid": "10.0.0", "@types/webpack-assets-manifest": "^5", @@ -424,7 +424,8 @@ "type-fest": "^4.18.2", "uplot": "1.6.32", "uuid": "11.1.0", - "visjs-network": "4.25.0", + "vis-data": "^7.1.10", + "vis-network": "9.1.13", "whatwg-fetch": "3.6.20" }, "resolutions": { diff --git a/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts b/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts index cc4effa3d3e..acd8045d63e 100644 --- a/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts +++ b/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts @@ -51,7 +51,26 @@ type SlackIntegration = OverrideProperties< } >; -export type Integration = EmailIntegration | SlackIntegration | GenericIntegration; +// Based on https://github.com/grafana/alerting/blob/main/receivers/oncall/config.go#L14-L27 +type OnCallIntegration = OverrideProperties< + GenericIntegration, + { + type: 'OnCall'; + settings: { + url: string; + httpMethod?: 'POST' | 'PUT'; + maxAlerts?: number; + authorization_scheme?: string; + authorization_credentials?: string; + username?: string; + password?: string; + title?: string; + message?: string; + }; + } +>; + +export type Integration = EmailIntegration | SlackIntegration | OnCallIntegration | GenericIntegration; // Enhanced version of ContactPoint with typed integrations // ⚠️ MergeDeep does not check if the property you are overriding exists in the base type and there is no "DeepOverrideProperties" helper diff --git a/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.tsx b/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.tsx index 3107319a9ea..56dacd8dca5 100644 --- a/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.tsx +++ b/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.tsx @@ -3,7 +3,7 @@ import { chain } from 'lodash'; import { Combobox, ComboboxOption } from '@grafana/ui'; import type { ContactPoint } from '../../../api/v0alpha1/types'; -import { useListContactPointsv0alpha1 } from '../../hooks/useContactPoints'; +import { useListContactPoints } from '../../hooks/v0alpha1/useContactPoints'; import { getContactPointDescription } from '../../utils'; import { CustomComboBoxProps } from './ComboBox.types'; @@ -17,7 +17,7 @@ export type ContactPointSelectorProps = CustomComboBoxProps; * @TODO make ComboBox accept a ReactNode so we can use icons and such */ function ContactPointSelector(props: ContactPointSelectorProps) { - const { currentData: contactPoints, isLoading } = useListContactPointsv0alpha1(); + const { currentData: contactPoints, isLoading } = useListContactPoints(); // Create a mapping of options with their corresponding contact points const contactPointOptions = chain(contactPoints?.items) diff --git a/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx b/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx deleted file mode 100644 index ab0169f2891..00000000000 --- a/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { type TypedUseQueryHookResult, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; - -import { type ListReceiverApiArg, alertingAPI } from '../../api/v0alpha1/api.gen'; -import type { EnhancedListReceiverApiResponse } from '../../api/v0alpha1/types'; - -// this is a workaround for the fact that the generated types are not narrow enough -type EnhancedHookResult = TypedUseQueryHookResult< - EnhancedListReceiverApiResponse, - ListReceiverApiArg, - ReturnType ->; - -/** - * useListContactPoints is a hook that fetches a list of contact points - * - * This function wraps the alertingAPI.useListReceiverQuery with proper typing - * to ensure that the returned ContactPoints are correctly typed in the data.items array. - * - * It automatically uses the configured namespace for the query. - */ -function useListContactPointsv0alpha1() { - return alertingAPI.useListReceiverQuery({}); -} - -export { useListContactPointsv0alpha1 }; diff --git a/packages/grafana-alerting/src/grafana/contactPoints/hooks/v0alpha1/useContactPoints.tsx b/packages/grafana-alerting/src/grafana/contactPoints/hooks/v0alpha1/useContactPoints.tsx new file mode 100644 index 00000000000..25d1ab9a6bf --- /dev/null +++ b/packages/grafana-alerting/src/grafana/contactPoints/hooks/v0alpha1/useContactPoints.tsx @@ -0,0 +1,62 @@ +import { + type TypedUseMutationResult, + type TypedUseQueryHookResult, + fetchBaseQuery, +} from '@reduxjs/toolkit/query/react'; +import { OverrideProperties } from 'type-fest'; + +import { CreateReceiverApiArg, type ListReceiverApiArg, alertingAPI } from '../../../api/v0alpha1/api.gen'; +import type { ContactPoint, EnhancedListReceiverApiResponse } from '../../../api/v0alpha1/types'; + +// this is a workaround for the fact that the generated types are not narrow enough +type ListContactPointsHookResult = TypedUseQueryHookResult< + EnhancedListReceiverApiResponse, + ListReceiverApiArg, + ReturnType +>; + +/** + * useListContactPoints is a hook that fetches a list of contact points + * + * This function wraps the alertingAPI.useListReceiverQuery with proper typing + * to ensure that the returned ContactPoints are correctly typed in the data.items array. + * + * It automatically uses the configured namespace for the query. + */ +export function useListContactPoints() { + return alertingAPI.useListReceiverQuery({}); +} + +// type narrowing mutations requires us to define a few helper types +type CreateContactPointArgs = OverrideProperties< + CreateReceiverApiArg, + { receiver: Omit } +>; + +type CreateContactPointMutation = TypedUseMutationResult< + ContactPoint, + CreateContactPointArgs, + ReturnType +>; + +type UseCreateContactPointOptions = Parameters< + typeof alertingAPI.endpoints.createReceiver.useMutation +>[0]; + +/** + * useCreateContactPoint is a hook that creates a new contact point with one or more integrations + * + * This function wraps the alertingAPI.useCreateReceiverMutation with proper typing + * to ensure that the payload supports type narrowing. + */ +export function useCreateContactPoint(options?: UseCreateContactPointOptions) { + const [updateFn, result] = alertingAPI.endpoints.createReceiver.useMutation(options); + + const typedUpdateFn = (args: CreateContactPointArgs) => { + // @ts-expect-error this one is just impossible for me to figure out + const response = updateFn(args); + return response; + }; + + return [typedUpdateFn, result] as const; +} diff --git a/packages/grafana-alerting/src/unstable.ts b/packages/grafana-alerting/src/unstable.ts index f1e7ce62356..5c10dcbf3eb 100644 --- a/packages/grafana-alerting/src/unstable.ts +++ b/packages/grafana-alerting/src/unstable.ts @@ -4,14 +4,8 @@ // Contact Points export * from './grafana/api/v0alpha1/types'; -export { useListContactPointsv0alpha1 } from './grafana/contactPoints/hooks/useContactPoints'; +export { useListContactPoints } from './grafana/contactPoints/hooks/v0alpha1/useContactPoints'; export { ContactPointSelector } from './grafana/contactPoints/components/ContactPointSelector/ContactPointSelector'; // Low-level API hooks -export { alertingAPI as alertingAPIv0alpha1 } from './grafana/api/v0alpha1/api.gen'; - -// model factories / mocks -export * as mocksV0alpha1 from './grafana/api/v0alpha1/mocks/fakes/Receivers'; - -// MSW handlers -export * as handlersV0alpha1 from './grafana/api/v0alpha1/mocks/handlers'; +export { alertingAPI } from './grafana/api/v0alpha1/api.gen'; diff --git a/packages/grafana-alerting/tests/provider.tsx b/packages/grafana-alerting/tests/provider.tsx index 039015eb8bf..4331f7e6b8a 100644 --- a/packages/grafana-alerting/tests/provider.tsx +++ b/packages/grafana-alerting/tests/provider.tsx @@ -2,13 +2,13 @@ import { configureStore } from '@reduxjs/toolkit'; import { useEffect } from 'react'; import { Provider } from 'react-redux'; -import { alertingAPIv0alpha1 } from '../src/unstable'; +import { alertingAPI } from '../src/unstable'; // create an empty store export const store = configureStore({ - middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(alertingAPIv0alpha1.middleware), + middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(alertingAPI.middleware), reducer: { - [alertingAPIv0alpha1.reducerPath]: alertingAPIv0alpha1.reducer, + [alertingAPI.reducerPath]: alertingAPI.reducer, }, }); @@ -35,7 +35,7 @@ export const getDefaultWrapper = () => { function useResetQueryCacheAfterUnmount() { useEffect(() => { return () => { - store.dispatch(alertingAPIv0alpha1.util.resetApiState()); + store.dispatch(alertingAPI.util.resetApiState()); }; }, []); } diff --git a/packages/grafana-data/package.json b/packages/grafana-data/package.json index 56263ed62a2..aa2da7aef48 100644 --- a/packages/grafana-data/package.json +++ b/packages/grafana-data/package.json @@ -60,7 +60,7 @@ "@leeoniya/ufuzzy": "1.0.18", "@types/d3-interpolate": "^3.0.0", "@types/string-hash": "1.1.3", - "@types/systemjs": "6.15.1", + "@types/systemjs": "6.15.3", "d3-interpolate": "3.0.1", "date-fns": "4.1.0", "dompurify": "3.2.6", @@ -84,9 +84,9 @@ }, "devDependencies": { "@grafana/tsconfig": "^2.0.0", - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "@types/history": "4.7.11", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/node": "22.15.0", "@types/papaparse": "5.3.16", "@types/react": "18.3.18", diff --git a/packages/grafana-e2e-selectors/package.json b/packages/grafana-e2e-selectors/package.json index 02d669fe21e..aaa4a34e671 100644 --- a/packages/grafana-e2e-selectors/package.json +++ b/packages/grafana-e2e-selectors/package.json @@ -39,7 +39,7 @@ "postpack": "mv package.json.bak package.json" }, "devDependencies": { - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "@types/node": "22.15.0", "@types/semver": "7.7.0", "esbuild": "0.25.0", diff --git a/packages/grafana-eslint-rules/README.md b/packages/grafana-eslint-rules/README.md index 3fb9a053670..be49122b758 100644 --- a/packages/grafana-eslint-rules/README.md +++ b/packages/grafana-eslint-rules/README.md @@ -113,3 +113,30 @@ const getStyles = (theme: GrafanaTheme2) => ({ ### `theme-token-usage` Used to find all instances of `theme` tokens being used in the codebase and emit the counts as metrics. Should **not** be used as an actual lint rule! + +### `consistent-story-titles` + +Enforce consistent Storybook titles in `.story.tsx` files. + +Storybook titles should not contain more than one `/` for sections (resulting in maximum 2 parts), unless one of the sections is 'Deprecated'. This helps maintain a clean and organized Storybook structure. + +#### Examples + +```tsx +// Bad ❌ +export default { title: 'Components/Forms/Button' }; + +// Good ✅ +export default { title: 'Components/Button' }; + +// Good ✅ - Deprecated allows any number of sections +export default { title: 'Components/Deprecated/Forms/Button/Extra' }; + +// Good ✅ - Variable assignment pattern +const storyConfig = { title: 'Components/Button' }; +export default storyConfig; + +// Bad ❌ - Variable assignment with too many sections +const storyConfig = { title: 'Components/Forms/Button' }; +export default storyConfig; +``` diff --git a/packages/grafana-eslint-rules/index.cjs b/packages/grafana-eslint-rules/index.cjs index 2babd165372..438d88332bc 100644 --- a/packages/grafana-eslint-rules/index.cjs +++ b/packages/grafana-eslint-rules/index.cjs @@ -3,6 +3,7 @@ const noBorderRadiusLiteral = require('./rules/no-border-radius-literal.cjs'); const noUnreducedMotion = require('./rules/no-unreduced-motion.cjs'); const themeTokenUsage = require('./rules/theme-token-usage.cjs'); const noRestrictedImgSrcs = require('./rules/no-restricted-img-srcs.cjs'); +const consistentStoryTitles = require('./rules/consistent-story-titles.cjs'); module.exports = { rules: { @@ -11,5 +12,6 @@ module.exports = { 'no-border-radius-literal': noBorderRadiusLiteral, 'theme-token-usage': themeTokenUsage, 'no-restricted-img-srcs': noRestrictedImgSrcs, + 'consistent-story-titles': consistentStoryTitles, }, }; diff --git a/packages/grafana-eslint-rules/rules/consistent-story-titles.cjs b/packages/grafana-eslint-rules/rules/consistent-story-titles.cjs new file mode 100644 index 00000000000..9fe077d699b --- /dev/null +++ b/packages/grafana-eslint-rules/rules/consistent-story-titles.cjs @@ -0,0 +1,106 @@ +// @ts-check +const { ESLintUtils, AST_NODE_TYPES } = require('@typescript-eslint/utils'); + +const createRule = ESLintUtils.RuleCreator( + (name) => `https://github.com/grafana/grafana/blob/main/packages/grafana-eslint-rules/README.md#${name}` +); + +/** + * @param {string} title + * @returns {boolean} + */ +const isValidStorybookTitle = (title) => { + if (typeof title !== 'string') { + return true; // Skip non-string titles + } + + const sections = title.split('/'); + + // Allow up to 3 sections if one of them is 'Deprecated' + if (sections.some((section) => section.trim() === 'Deprecated')) { + return sections.length <= 3; + } + + // Otherwise, limit to maximum 2 sections (1 slash) + return sections.length <= 2; +}; + +/** + * @param {import('@typescript-eslint/utils').TSESTree.ObjectExpression} objectNode + * @param {import('@typescript-eslint/utils/ts-eslint').RuleContext<'invalidTitle', []>} context + */ +const checkObjectForTitle = (objectNode, context) => { + const titleProperty = objectNode.properties.find( + (prop) => + prop.type === AST_NODE_TYPES.Property && prop.key.type === AST_NODE_TYPES.Identifier && prop.key.name === 'title' + ); + + if ( + titleProperty && + titleProperty.type === AST_NODE_TYPES.Property && + titleProperty.value.type === AST_NODE_TYPES.Literal + ) { + const titleValue = titleProperty.value.value; + + if (typeof titleValue === 'string' && !isValidStorybookTitle(titleValue)) { + context.report({ + node: titleProperty.value, + messageId: 'invalidTitle', + data: { + title: titleValue, + }, + }); + } + } +}; + +const consistentStoryTitlesRule = createRule({ + create(context) { + return { + ExportDefaultDeclaration(node) { + // Only check .story.tsx files + const filename = context.filename; + if (!filename || !filename.endsWith('.story.tsx')) { + return; + } + + if (node.declaration.type === AST_NODE_TYPES.ObjectExpression) { + // Handle direct object export: export default { title: '...' } + checkObjectForTitle(node.declaration, context); + } else if (node.declaration.type === AST_NODE_TYPES.Identifier) { + // Handle variable reference export: export default storyConfig + const variableName = node.declaration.name; + const scope = context.sourceCode.getScope(node); + const variable = scope.set.get(variableName); + + if (variable) { + // Find the variable declaration + const declaration = variable.defs.find((def) => def.type === 'Variable'); + if ( + declaration && + declaration.node.init && + declaration.node.init.type === AST_NODE_TYPES.ObjectExpression + ) { + checkObjectForTitle(declaration.node.init, context); + } + } + } + }, + }; + }, + name: 'consistent-story-titles', + meta: { + type: 'problem', + docs: { + description: 'Enforce consistent Storybook titles with maximum two sections (1 slash) unless one is "Deprecated"', + }, + messages: { + invalidTitle: + 'Storybook title "{{ title }}" has too many sections. Use maximum 2 sections (1 slash) unless one section is "Deprecated".', + }, + schema: [], + }, + defaultOptions: [], +}); + +module.exports = consistentStoryTitlesRule; diff --git a/packages/grafana-eslint-rules/tests/consistent-stories.test.js b/packages/grafana-eslint-rules/tests/consistent-stories.test.js new file mode 100644 index 00000000000..004cd0aeeb3 --- /dev/null +++ b/packages/grafana-eslint-rules/tests/consistent-stories.test.js @@ -0,0 +1,117 @@ +import { RuleTester } from 'eslint'; + +import consistentStories from '../rules/consistent-story-titles.cjs'; + +RuleTester.setDefaultConfig({ + languageOptions: { + ecmaVersion: 2018, + sourceType: 'module', + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, +}); + +const ruleTester = new RuleTester(); + +ruleTester.run('eslint consistent-stories', consistentStories, { + valid: [ + { + name: 'simple title', + code: `export default { title: 'Button' };`, + filename: 'Button.story.tsx', + }, + { + name: 'one section', + code: `export default { title: 'Components/Button' };`, + filename: 'Button.story.tsx', + }, + { + name: 'deprecated can have 3 sections', + code: `export default { title: 'Components/Deprecated/Button' };`, + filename: 'Button.story.tsx', + }, + { + name: 'not a story file', + code: `export default { title: 'Components/Forms/Button/Extra/Section' };`, + filename: 'Button.tsx', + }, + { + name: 'non-string title', + code: `export default { title: 123 };`, + filename: 'Button.story.tsx', + }, + { + name: 'no title property', + code: `export default { component: Button };`, + filename: 'Button.story.tsx', + }, + { + name: 'variable assignment - simple title', + code: ` +const storyConfig = { title: 'Button' }; +export default storyConfig;`, + filename: 'Button.story.tsx', + }, + { + name: 'variable assignment - one section', + code: ` +const storyConfig = { title: 'Components/Button' }; +export default storyConfig;`, + filename: 'Button.story.tsx', + }, + { + name: 'variable assignment - with Deprecated', + code: ` +const storyConfig = { title: 'Components/Deprecated/Button' }; +export default storyConfig;`, + filename: 'Button.story.tsx', + }, + ], + invalid: [ + { + name: 'too many sections without Deprecated', + code: `export default { title: 'Components/Forms/Button' };`, + filename: 'Button.story.tsx', + errors: [ + { + messageId: 'invalidTitle', + }, + ], + }, + { + name: 'too many sections without Deprecated', + code: `export default { title: 'Components/Forms/Button/Extra' };`, + filename: 'Button.story.tsx', + errors: [ + { + messageId: 'invalidTitle', + }, + ], + }, + { + name: 'with spaces around sections', + code: `export default { title: 'Components / Forms / Button' };`, + filename: 'Button.story.tsx', + errors: [ + { + messageId: 'invalidTitle', + }, + ], + }, + { + name: 'variable assignment - too many sections', + code: ` +const storyConfig = { title: 'Components/Forms/Button' }; +export default storyConfig;`, + filename: 'Button.story.tsx', + errors: [ + { + messageId: 'invalidTitle', + }, + ], + }, + ], +}); diff --git a/packages/grafana-flamegraph/package.json b/packages/grafana-flamegraph/package.json index e8c0d1cfbf4..4e744fa3d8a 100644 --- a/packages/grafana-flamegraph/package.json +++ b/packages/grafana-flamegraph/package.json @@ -60,14 +60,14 @@ "@babel/preset-env": "7.26.9", "@babel/preset-react": "7.26.3", "@grafana/tsconfig": "^2.0.0", - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "@testing-library/dom": "10.4.0", "@testing-library/jest-dom": "^6.1.2", "@testing-library/react": "16.2.0", "@testing-library/user-event": "14.6.1", "@types/d3": "^7", "@types/jest": "^29.5.4", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/node": "22.15.0", "@types/react": "18.3.18", "@types/react-virtualized-auto-sizer": "1.0.4", diff --git a/packages/grafana-o11y-ds-frontend/package.json b/packages/grafana-o11y-ds-frontend/package.json index f69200d39e5..cf7da96e1c8 100644 --- a/packages/grafana-o11y-ds-frontend/package.json +++ b/packages/grafana-o11y-ds-frontend/package.json @@ -38,7 +38,7 @@ "@types/jest": "^29.5.4", "@types/node": "22.15.0", "@types/react": "18.3.18", - "@types/systemjs": "6.15.1", + "@types/systemjs": "6.15.3", "jest": "^29.6.4", "react": "18.3.1", "ts-jest": "29.2.5", diff --git a/packages/grafana-prometheus/package.json b/packages/grafana-prometheus/package.json index 091d6fab771..973cd50edaf 100644 --- a/packages/grafana-prometheus/package.json +++ b/packages/grafana-prometheus/package.json @@ -56,7 +56,7 @@ "@prometheus-io/lezer-promql": "0.304.2", "@reduxjs/toolkit": "2.5.1", "@types/debounce-promise": "3.1.9", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/react": "18.3.18", "@types/react-dom": "18.3.5", "@types/react-highlight-words": "0.20.0", @@ -82,7 +82,7 @@ "@rollup/plugin-dynamic-import-vars": "2.1.5", "@rollup/plugin-image": "3.0.3", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "@testing-library/jest-dom": "6.6.3", "@testing-library/react": "16.2.0", "@testing-library/user-event": "14.6.1", diff --git a/packages/grafana-prometheus/src/locales/cs-CZ/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/cs-CZ/grafana-prometheus.json index 97bd700ee53..3807aa13ec1 100644 --- a/packages/grafana-prometheus/src/locales/cs-CZ/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/cs-CZ/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Poskytnout zpětnou vazbu", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -276,6 +301,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formát", "label-min-step": "", @@ -290,6 +320,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Spustit dotaz", "label-explain": "", "run-queries": "", @@ -306,6 +338,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/de-DE/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/de-DE/grafana-prometheus.json index b2a62f0ced1..80d301b1e4e 100644 --- a/packages/grafana-prometheus/src/locales/de-DE/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/de-DE/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Feedback geben", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Format", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Starten Sie Ihre Abfrage", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/es-ES/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/es-ES/grafana-prometheus.json index 2cfb484899d..5fb2ff31407 100644 --- a/packages/grafana-prometheus/src/locales/es-ES/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/es-ES/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Enviar comentarios", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formato", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Inicie su consulta", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/fr-FR/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/fr-FR/grafana-prometheus.json index 3d8d947716d..18b2b45ccb6 100644 --- a/packages/grafana-prometheus/src/locales/fr-FR/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/fr-FR/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Publiez votre commentaire", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Format", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Lancer votre requête", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/hu-HU/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/hu-HU/grafana-prometheus.json index fb93de301a0..ad42c10c8f5 100644 --- a/packages/grafana-prometheus/src/locales/hu-HU/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/hu-HU/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Visszajelzés küldése", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formátum", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Előbeállításos lekérdezés", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/id-ID/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/id-ID/grafana-prometheus.json index efb21274cbd..fe28a159976 100644 --- a/packages/grafana-prometheus/src/locales/id-ID/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/id-ID/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Berikan umpan balik", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -273,6 +298,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Format", "label-min-step": "", @@ -287,6 +317,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Mulai kueri Anda", "label-explain": "", "run-queries": "", @@ -303,6 +335,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/it-IT/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/it-IT/grafana-prometheus.json index 43fb6ff60a7..899ef0de61e 100644 --- a/packages/grafana-prometheus/src/locales/it-IT/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/it-IT/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Lascia un feedback", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formato", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Avvia la query", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/ja-JP/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/ja-JP/grafana-prometheus.json index f9560e7c3a3..9403559fe59 100644 --- a/packages/grafana-prometheus/src/locales/ja-JP/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/ja-JP/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "フィードバックを送信", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -273,6 +298,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "形式", "label-min-step": "", @@ -287,6 +317,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "クエリを開始", "label-explain": "", "run-queries": "", @@ -303,6 +335,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/ko-KR/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/ko-KR/grafana-prometheus.json index c67caa63f50..d7d6b414cf3 100644 --- a/packages/grafana-prometheus/src/locales/ko-KR/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/ko-KR/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "피드백 제출하기", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -273,6 +298,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "형식", "label-min-step": "", @@ -287,6 +317,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "쿼리 시작하기", "label-explain": "", "run-queries": "", @@ -303,6 +335,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/nl-NL/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/nl-NL/grafana-prometheus.json index e25eaefff64..f0cd4f482ff 100644 --- a/packages/grafana-prometheus/src/locales/nl-NL/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/nl-NL/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Feedback geven", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formaat", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Start je query", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/pl-PL/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/pl-PL/grafana-prometheus.json index ad21fccdb5a..f31dab572ba 100644 --- a/packages/grafana-prometheus/src/locales/pl-PL/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/pl-PL/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Przekaż opinię", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -276,6 +301,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Format", "label-min-step": "", @@ -290,6 +320,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Uruchom zapytanie", "label-explain": "", "run-queries": "", @@ -306,6 +338,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/pt-BR/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/pt-BR/grafana-prometheus.json index 81801a8c07d..3328d384500 100644 --- a/packages/grafana-prometheus/src/locales/pt-BR/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/pt-BR/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Dar feedback", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formato", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Iniciar sua consulta", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/pt-PT/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/pt-PT/grafana-prometheus.json index fcfd4a81bc0..df5a4f369fb 100644 --- a/packages/grafana-prometheus/src/locales/pt-PT/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/pt-PT/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Dar feedback", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Formato", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Dê início à sua consulta", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/ru-RU/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/ru-RU/grafana-prometheus.json index 6524e3464eb..b39e794a2cb 100644 --- a/packages/grafana-prometheus/src/locales/ru-RU/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/ru-RU/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Отправить отзыв", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -276,6 +301,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Формат", "label-min-step": "", @@ -290,6 +320,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Запустить запрос", "label-explain": "", "run-queries": "", @@ -306,6 +338,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/sv-SE/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/sv-SE/grafana-prometheus.json index eff0092cdb4..77ba65213b5 100644 --- a/packages/grafana-prometheus/src/locales/sv-SE/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/sv-SE/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Ge feedback", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Format", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Kickstarta din fråga", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/tr-TR/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/tr-TR/grafana-prometheus.json index f1cc39bb7ef..651184ce148 100644 --- a/packages/grafana-prometheus/src/locales/tr-TR/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/tr-TR/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "Geri bildirim gönder", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -274,6 +299,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "Biçim", "label-min-step": "", @@ -288,6 +318,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "Sorgunuzu hızlı başlatın", "label-explain": "", "run-queries": "", @@ -304,6 +336,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/zh-Hans/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/zh-Hans/grafana-prometheus.json index d5194ff8a10..228bf7c54c6 100644 --- a/packages/grafana-prometheus/src/locales/zh-Hans/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/zh-Hans/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "提供反馈", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -273,6 +298,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "格式", "label-min-step": "", @@ -287,6 +317,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "启动您的查询", "label-explain": "", "run-queries": "", @@ -303,6 +335,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-prometheus/src/locales/zh-Hant/grafana-prometheus.json b/packages/grafana-prometheus/src/locales/zh-Hant/grafana-prometheus.json index 88d1bf2d1e5..c58d51a7708 100644 --- a/packages/grafana-prometheus/src/locales/zh-Hant/grafana-prometheus.json +++ b/packages/grafana-prometheus/src/locales/zh-Hant/grafana-prometheus.json @@ -157,6 +157,10 @@ "aria-label-prom-type-type": "", "aria-label-prometheus-type": "", "aria-label-select-http-method": "", + "editor-options": { + "label-builder": "", + "label-code": "" + }, "label-cache-level": "", "label-custom-query-parameters": "", "label-default-editor": "", @@ -195,6 +199,16 @@ "tooltip-use-series-endpoint": "" } }, + "prom-query-legend-editor": { + "get-legend-mode-options": { + "description-auto": "", + "description-custom": "", + "description-verbose": "", + "label-auto": "", + "label-custom": "", + "label-verbose": "" + } + }, "querybuilder": { "additional-settings": { "content-filter-metric-names-regex-search-using": "", @@ -204,6 +218,13 @@ "give-feedback": "提供意見回饋", "title-give-feedback": "" }, + "get-collapsed-info": { + "exemplars": "", + "format": "", + "legend": "", + "step": "", + "type": "" + }, "handle-function": { "text": { "query-parsing-is-ambiguous": "" @@ -219,6 +240,10 @@ "label-label-filters": "", "tooltip-label-filters": "" }, + "label-param-editor": { + "loadingMessage-loading-labels": "", + "noOptionsMessage-no-labels-found": "" + }, "metric-combobox": { "async-select": { "aria-label-open-metrics-explorer": "", @@ -273,6 +298,11 @@ "prom-query-builder-options": { "aria-label-lower-limit-parameter": "", "aria-label-select-resolution": "", + "format-options": { + "label-heatmap": "", + "label-table": "", + "label-time-series": "" + }, "label-exemplars": "", "label-format": "格式", "label-min-step": "", @@ -287,6 +317,8 @@ "tooltip-autocomplete-suggestions-limited": "" }, "prom-query-editor-selector": { + "body-syntax-error": "", + "confirmText-continue": "", "kick-start-your-query": "啟動您的查詢", "label-explain": "", "run-queries": "", @@ -303,6 +335,12 @@ "query-editor-hints": { "hint-details": "" }, + "query-editor-mode-toggle": { + "editor-modes": { + "label-builder": "", + "label-code": "" + } + }, "query-pattern": { "apply-query": "", "aria-label-apply-query-starter-button": "", diff --git a/packages/grafana-runtime/package.json b/packages/grafana-runtime/package.json index aa8375e5b7a..7eab5671779 100644 --- a/packages/grafana-runtime/package.json +++ b/packages/grafana-runtime/package.json @@ -58,7 +58,7 @@ "@grafana/faro-web-sdk": "^1.13.2", "@grafana/schema": "12.1.0-pre", "@grafana/ui": "12.1.0-pre", - "@types/systemjs": "6.15.1", + "@types/systemjs": "6.15.3", "history": "4.10.1", "lodash": "4.17.21", "react-loading-skeleton": "3.5.0", @@ -68,14 +68,14 @@ }, "devDependencies": { "@grafana/tsconfig": "^2.0.0", - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "@rollup/plugin-terser": "0.4.4", "@testing-library/dom": "10.4.0", "@testing-library/react": "16.2.0", "@testing-library/user-event": "14.6.1", "@types/history": "4.7.11", "@types/jest": "29.5.14", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/react": "18.3.18", "@types/react-dom": "18.3.5", "esbuild": "0.25.0", diff --git a/packages/grafana-schema/package.json b/packages/grafana-schema/package.json index 059974d9982..466b6adcbfc 100644 --- a/packages/grafana-schema/package.json +++ b/packages/grafana-schema/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@grafana/tsconfig": "^2.0.0", - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "esbuild": "0.25.0", "glob": "^11.0.0", "rimraf": "6.0.1", diff --git a/packages/grafana-schema/src/schema/dashboard/v2alpha1/types.spec.gen.ts b/packages/grafana-schema/src/schema/dashboard/v2alpha1/types.spec.gen.ts index 0075a197ffa..61b29e2ee2e 100644 --- a/packages/grafana-schema/src/schema/dashboard/v2alpha1/types.spec.gen.ts +++ b/packages/grafana-schema/src/schema/dashboard/v2alpha1/types.spec.gen.ts @@ -18,7 +18,7 @@ export interface AnnotationQuerySpec { name: string; builtIn?: boolean; filter?: AnnotationPanelFilter; - // Catch-all field for datasource-specific properties + // Catch-all field for datasource-specific properties. Should not be available in as code tooling. legacyOptions?: Record; } diff --git a/packages/grafana-sql/package.json b/packages/grafana-sql/package.json index 126c5845fdd..303af8c1f7a 100644 --- a/packages/grafana-sql/package.json +++ b/packages/grafana-sql/package.json @@ -42,12 +42,12 @@ "@testing-library/react": "16.2.0", "@testing-library/user-event": "14.6.1", "@types/jest": "^29.5.4", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/node": "22.15.0", "@types/react": "18.3.18", "@types/react-dom": "18.3.5", "@types/react-virtualized-auto-sizer": "1.0.4", - "@types/systemjs": "6.15.1", + "@types/systemjs": "6.15.3", "@types/uuid": "10.0.0", "i18next-parser": "9.3.0", "jest": "^29.6.4", diff --git a/packages/grafana-sql/src/locales/cs-CZ/grafana-sql.json b/packages/grafana-sql/src/locales/cs-CZ/grafana-sql.json index 52ab74544e9..ee03668f7c7 100644 --- a/packages/grafana-sql/src/locales/cs-CZ/grafana-sql.json +++ b/packages/grafana-sql/src/locales/cs-CZ/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtrovat", "label-format": "Formát", diff --git a/packages/grafana-sql/src/locales/de-DE/grafana-sql.json b/packages/grafana-sql/src/locales/de-DE/grafana-sql.json index 895927b7c1f..5f921f12dba 100644 --- a/packages/grafana-sql/src/locales/de-DE/grafana-sql.json +++ b/packages/grafana-sql/src/locales/de-DE/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filter", "label-format": "Format", diff --git a/packages/grafana-sql/src/locales/es-ES/grafana-sql.json b/packages/grafana-sql/src/locales/es-ES/grafana-sql.json index fbfe5c8bbfa..6fcd133d0fa 100644 --- a/packages/grafana-sql/src/locales/es-ES/grafana-sql.json +++ b/packages/grafana-sql/src/locales/es-ES/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtro", "label-format": "Formato", diff --git a/packages/grafana-sql/src/locales/fr-FR/grafana-sql.json b/packages/grafana-sql/src/locales/fr-FR/grafana-sql.json index ec35e126c7d..c970cbbd845 100644 --- a/packages/grafana-sql/src/locales/fr-FR/grafana-sql.json +++ b/packages/grafana-sql/src/locales/fr-FR/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtrer", "label-format": "Format", diff --git a/packages/grafana-sql/src/locales/hu-HU/grafana-sql.json b/packages/grafana-sql/src/locales/hu-HU/grafana-sql.json index f0d9ad1eed5..0c1803084cb 100644 --- a/packages/grafana-sql/src/locales/hu-HU/grafana-sql.json +++ b/packages/grafana-sql/src/locales/hu-HU/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Szűrő", "label-format": "Formátum", diff --git a/packages/grafana-sql/src/locales/id-ID/grafana-sql.json b/packages/grafana-sql/src/locales/id-ID/grafana-sql.json index 5733382d722..e6c977bca22 100644 --- a/packages/grafana-sql/src/locales/id-ID/grafana-sql.json +++ b/packages/grafana-sql/src/locales/id-ID/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filter", "label-format": "Format", diff --git a/packages/grafana-sql/src/locales/it-IT/grafana-sql.json b/packages/grafana-sql/src/locales/it-IT/grafana-sql.json index c155ef2a4dc..b7194050d6f 100644 --- a/packages/grafana-sql/src/locales/it-IT/grafana-sql.json +++ b/packages/grafana-sql/src/locales/it-IT/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtro", "label-format": "Formato", diff --git a/packages/grafana-sql/src/locales/ja-JP/grafana-sql.json b/packages/grafana-sql/src/locales/ja-JP/grafana-sql.json index 4c74bb5be58..4340b874c6e 100644 --- a/packages/grafana-sql/src/locales/ja-JP/grafana-sql.json +++ b/packages/grafana-sql/src/locales/ja-JP/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "フィルタリング", "label-format": "形式", diff --git a/packages/grafana-sql/src/locales/ko-KR/grafana-sql.json b/packages/grafana-sql/src/locales/ko-KR/grafana-sql.json index f9778c0e23c..ab01d9e61a0 100644 --- a/packages/grafana-sql/src/locales/ko-KR/grafana-sql.json +++ b/packages/grafana-sql/src/locales/ko-KR/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "필터", "label-format": "형식", diff --git a/packages/grafana-sql/src/locales/nl-NL/grafana-sql.json b/packages/grafana-sql/src/locales/nl-NL/grafana-sql.json index f1e27ce05a5..2f7d4aed633 100644 --- a/packages/grafana-sql/src/locales/nl-NL/grafana-sql.json +++ b/packages/grafana-sql/src/locales/nl-NL/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filter", "label-format": "Formaat", diff --git a/packages/grafana-sql/src/locales/pl-PL/grafana-sql.json b/packages/grafana-sql/src/locales/pl-PL/grafana-sql.json index 0752f5afddc..47e1140a92a 100644 --- a/packages/grafana-sql/src/locales/pl-PL/grafana-sql.json +++ b/packages/grafana-sql/src/locales/pl-PL/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtr", "label-format": "Format", diff --git a/packages/grafana-sql/src/locales/pt-BR/grafana-sql.json b/packages/grafana-sql/src/locales/pt-BR/grafana-sql.json index a0f9d14750b..8bb192f0a01 100644 --- a/packages/grafana-sql/src/locales/pt-BR/grafana-sql.json +++ b/packages/grafana-sql/src/locales/pt-BR/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtro", "label-format": "Formato", diff --git a/packages/grafana-sql/src/locales/pt-PT/grafana-sql.json b/packages/grafana-sql/src/locales/pt-PT/grafana-sql.json index 8561b05941b..4a5f9824264 100644 --- a/packages/grafana-sql/src/locales/pt-PT/grafana-sql.json +++ b/packages/grafana-sql/src/locales/pt-PT/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtro", "label-format": "Formato", diff --git a/packages/grafana-sql/src/locales/ru-RU/grafana-sql.json b/packages/grafana-sql/src/locales/ru-RU/grafana-sql.json index 2e0134da629..12440aa0ddc 100644 --- a/packages/grafana-sql/src/locales/ru-RU/grafana-sql.json +++ b/packages/grafana-sql/src/locales/ru-RU/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Фильтр", "label-format": "Формат", diff --git a/packages/grafana-sql/src/locales/sv-SE/grafana-sql.json b/packages/grafana-sql/src/locales/sv-SE/grafana-sql.json index 0d7dbeaf9a2..4dd442d92a4 100644 --- a/packages/grafana-sql/src/locales/sv-SE/grafana-sql.json +++ b/packages/grafana-sql/src/locales/sv-SE/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtrera", "label-format": "Format", diff --git a/packages/grafana-sql/src/locales/tr-TR/grafana-sql.json b/packages/grafana-sql/src/locales/tr-TR/grafana-sql.json index da83339c08f..06248f27ef1 100644 --- a/packages/grafana-sql/src/locales/tr-TR/grafana-sql.json +++ b/packages/grafana-sql/src/locales/tr-TR/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "Filtreleyin", "label-format": "Biçim", diff --git a/packages/grafana-sql/src/locales/zh-Hans/grafana-sql.json b/packages/grafana-sql/src/locales/zh-Hans/grafana-sql.json index d22700fa3ac..43a461149b3 100644 --- a/packages/grafana-sql/src/locales/zh-Hans/grafana-sql.json +++ b/packages/grafana-sql/src/locales/zh-Hans/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "筛选条件", "label-format": "格式", diff --git a/packages/grafana-sql/src/locales/zh-Hant/grafana-sql.json b/packages/grafana-sql/src/locales/zh-Hant/grafana-sql.json index 87c106d7b4d..0eea18e6fb2 100644 --- a/packages/grafana-sql/src/locales/zh-Hant/grafana-sql.json +++ b/packages/grafana-sql/src/locales/zh-Hant/grafana-sql.json @@ -55,6 +55,10 @@ }, "query-header": { "content-invalid-query": "", + "editor-modes": { + "label-builder": "", + "label-code": "" + }, "label-dataset": "", "label-filter": "篩選", "label-format": "格式", diff --git a/packages/grafana-ui/.storybook/main.ts b/packages/grafana-ui/.storybook/main.ts index 1c75daef688..29258c4a228 100644 --- a/packages/grafana-ui/.storybook/main.ts +++ b/packages/grafana-ui/.storybook/main.ts @@ -2,13 +2,7 @@ import path, { dirname, join } from 'node:path'; import type { StorybookConfig } from '@storybook/react-webpack5'; import { copyAssetsSync } from './copyAssets'; -// Internal stories should only be visible during development -const coreComponentsGlobs: StorybookConfig['stories'] = [ - '../src/Intro.mdx', - process.env.NODE_ENV === 'production' - ? '../src/components/**/!(*.internal).story.tsx' - : '../src/components/**/*.story.tsx', -]; +const coreComponentsGlobs: StorybookConfig['stories'] = ['../src/Intro.mdx', '../src/**/*.story.tsx']; const alertingComponentsGlobs: StorybookConfig['stories'] = [ { diff --git a/packages/grafana-ui/.storybook/preview.ts b/packages/grafana-ui/.storybook/preview.ts index 93892fae443..803d45315e3 100644 --- a/packages/grafana-ui/.storybook/preview.ts +++ b/packages/grafana-ui/.storybook/preview.ts @@ -71,20 +71,84 @@ const preview: Preview = { // Sort stories first by Docs Overview, then alphabetically // We should be able to use the builtin alphabetical sort, but is broken in SB 7.0 // https://github.com/storybookjs/storybook/issues/22470 + + // Story sorting is weird - All stories are sorted as a single 1D list, but then grouped in the UI. + // Story titles are generally in the format of [Category]/[Component]/[Story]. However, some categories + // will have an additional `Deprecated` sub folder before the [Component] + // + // We want to have multi-level sorting where: + // - The top level category has an explicit order + // - Components are sorted alphabetically within their category + // - Except the Deprecated folder, which is sorted to the bottom + // - Stories per component use the default file sort order storySort: (a, b) => { - // Skip sorting for stories with nosort tag - if (a.tags.includes('nosort') || b.tags.includes('nosort')) { - return 0; + const CATEGORY_ORDER = [ + // Should all be lowercase + 'docs overview', + 'foundations', + 'iconography', + 'layout', + + 'forms', + 'inputs', + 'pickers', + 'date time pickers', + + 'information', + 'overlays', + 'utilities', + 'navigation', + + 'plugins', + 'alerting', + 'developers', + ]; + + const aTitle = a.title.toLowerCase(); + const bTitle = b.title.toLowerCase(); + const [aCategory, aComponent] = aTitle.split('/'); + const [bCategory, bComponent] = bTitle.split('/'); + + // + // Sort by category order first + const aCategoryIndex = CATEGORY_ORDER.indexOf(aCategory); + const bCategoryIndex = CATEGORY_ORDER.indexOf(bCategory); + + if (aCategoryIndex === -1 || bCategoryIndex === -1) { + const category = aCategoryIndex === -1 ? aCategory : bCategory; + throw new Error( + `Category ${category} not found in CATEGORY_ORDER. Prefer reusing the existing categories, or add to CATEGORY_ORDER.` + ); } - if (a.title.startsWith('Docs Overview')) { - if (b.title.startsWith('Docs Overview')) { - return 0; - } + + if (aCategoryIndex !== bCategoryIndex) { + return aCategoryIndex - bCategoryIndex; + } + + // + // Sort 'Deprecated' subfolders to the bottom + if (aTitle.includes('deprecated') && !bTitle.includes('deprecated')) { + return 1; + } else if (bTitle.includes('deprecated') && !aTitle.includes('deprecated')) { return -1; - } else if (b.title.startsWith('Docs Overview')) { + } + + // + // Sort Docs to the top + if (a.type === 'docs' && b.type !== 'docs') { + return -1; + } else if (a.type !== 'docs' && b.type === 'docs') { return 1; } - return a.id === b.id ? 0 : a.id.localeCompare(b.id, undefined, { numeric: true }); + + // + // If sorting different components, sort alphabetically + if (aComponent !== bComponent) { + return aComponent.localeCompare(bComponent, undefined, { numeric: true }); + } + + // Otherwise, sort stories within componmments according to source order + return 0; }, }, }, diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index 9dface55147..f0e1b8692d1 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -80,7 +80,7 @@ "@react-aria/utils": "3.29.1", "@tanstack/react-virtual": "^3.5.1", "@types/jquery": "3.5.32", - "@types/lodash": "4.17.15", + "@types/lodash": "4.17.20", "@types/react-table": "7.7.20", "calculate-size": "1.1.1", "classnames": "2.5.1", @@ -104,7 +104,7 @@ "rc-picker": "4.11.3", "rc-slider": "11.1.8", "rc-tooltip": "6.4.0", - "react-calendar": "^5.1.0", + "react-calendar": "^6.0.0", "react-colorful": "5.6.1", "react-custom-scrollbars-2": "4.5.0", "react-data-grid": "grafana/react-data-grid#de920f0105cb2b7d774444e7443a675f3b568ad6", @@ -135,7 +135,7 @@ "@babel/core": "7.26.10", "@faker-js/faker": "^9.0.0", "@grafana/tsconfig": "^2.0.0", - "@rollup/plugin-node-resolve": "16.0.0", + "@rollup/plugin-node-resolve": "16.0.1", "@storybook/addon-a11y": "^8.6.2", "@storybook/addon-actions": "^8.6.2", "@storybook/addon-docs": "^8.6.2", diff --git a/packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx b/packages/grafana-ui/src/components/Alert/Alert.story.tsx similarity index 87% rename from packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx rename to packages/grafana-ui/src/components/Alert/Alert.story.tsx index 61d573d0f1f..2c5ffba4f06 100644 --- a/packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx +++ b/packages/grafana-ui/src/components/Alert/Alert.story.tsx @@ -10,7 +10,7 @@ import mdx from './Alert.mdx'; const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; const meta: Meta = { - title: 'Overlays/Alert/InlineBanner', + title: 'Information/Alert', component: Alert, parameters: { docs: { @@ -78,4 +78,15 @@ export const Examples: StoryFn = () => { ); }; +export const Toast: StoryFn = (args) => { + return To use as a toast, set the elevated and onRemove props.; +}; + +Toast.args = { + title: 'Toast', + severity: 'error', + onRemove: action('Remove button clicked'), + elevated: true, +}; + export default meta; diff --git a/packages/grafana-ui/src/components/Alert/Toast.story.tsx b/packages/grafana-ui/src/components/Alert/Toast.story.tsx deleted file mode 100644 index 12991adcb03..00000000000 --- a/packages/grafana-ui/src/components/Alert/Toast.story.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { action } from '@storybook/addon-actions'; -import { StoryFn, Meta } from '@storybook/react'; - -import { StoryExample } from '../../utils/storybook/StoryExample'; -import { Stack } from '../Layout/Stack/Stack'; - -import { Alert, AlertVariant } from './Alert'; -import mdx from './Alert.mdx'; - -const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; - -const meta: Meta = { - title: 'Overlays/Alert/Toast', - component: Alert, - parameters: { - docs: { - page: mdx, - }, - controls: { exclude: ['onRemove'] }, - }, - argTypes: { - severity: { control: { type: 'select', options: severities } }, - }, - args: { - title: 'Toast', - severity: 'error', - onRemove: action('Remove button clicked'), - }, -}; - -export const Basic: StoryFn = (args) => { - return ( - - Child content that includes some alert details, like maybe what actually happened. - - ); -}; - -export function Examples() { - return ( - - - - {severities.map((severity) => ( - - ))} - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam metus urna, aliquam eu scelerisque non, - facilisis eget est. Morbi eleifend egestas massa id vulputate. Fusce dignissim magna lacus, ut molestie odio - feugiat sed. Cras fringilla justo sit amet turpis scelerisque, a volutpat purus iaculis. Nunc sagittis - molestie faucibus. Curabitur at neque luctus, pellentesque urna eget, posuere urna. Nunc malesuada elit in - ipsum dictum egestas. Praesent convallis mauris massa, porta mattis ex gravida ut. Proin consectetur ultrices - tortor sit amet efficitur. Suspendisse nec turpis dapibus mauris venenatis maximus quis eget orci. Ut semper - enim magna, ullamcorper elementum sapien pharetra vitae. Vivamus at nulla ut metus bibendum ornare et ut leo. - Proin ante turpis, ornare a malesuada et, rutrum nec lorem. Maecenas vestibulum orci vel nibh convallis - eleifend. Quisque vitae consectetur massa, vitae elementum mauris. Pellentesque sit amet ligula lorem. Fusce - sit amet lorem non augue rutrum varius. Donec sed imperdiet libero, eget venenatis elit. Fusce porttitor - dapibus urna. Duis fringilla ante vel tempor tincidunt. In euismod vestibulum odio sit amet iaculis. Donec vel - dapibus libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lacinia commodo lectus. Aenean - in magna eget lectus luctus suscipit et vitae erat. Pellentesque quis ligula id lorem egestas sollicitudin sit - amet sed sem. Nullam et nibh a odio rhoncus efficitur sed nec est. Sed commodo lacus vitae sem congue, - accumsan dignissim metus iaculis. Praesent in dignissim nisl. Aliquam facilisis, sapien eget porttitor - ultrices, massa libero bibendum odio, at ornare diam arcu ac massa. Vestibulum egestas leo eget lorem congue - condimentum. Praesent egestas, neque id gravida vehicula, augue ex scelerisque lectus, finibus pellentesque - enim dolor vel ante. Cras convallis, sem at malesuada tincidunt, diam urna auctor leo, sed laoreet est ex in - libero. Ut condimentum ante eget ex gravida, id tempus metus ultricies. Pellentesque placerat, massa id - laoreet molestie, justo nisl varius metus, maximus vehicula erat libero vitae nulla. Mauris rhoncus ligula - vitae volutpat auctor. Suspendisse potenti. Quisque quis orci faucibus, ullamcorper dolor eget, mollis massa. - Etiam eu molestie ipsum. Sed laoreet diam metus, luctus maximus erat viverra quis. Ut eu felis dictum, - tincidunt erat sit amet, scelerisque neque. Orci varius natoque penatibus et magnis dis parturient montes, - nascetur ridiculus mus. Phasellus sit amet est tristique, fermentum massa ut, viverra metus. Interdum et - malesuada fames ac ante ipsum primis in faucibus. Nunc iaculis nunc elit, ut feugiat ipsum egestas eget. - Vestibulum pulvinar ligula mi, quis lacinia diam suscipit eget. Etiam consectetur vel nunc at hendrerit. - Pellentesque blandit eleifend aliquam. Etiam et malesuada purus, et bibendum sapien. Phasellus tincidunt - consequat eros consequat sodales. Vestibulum quis viverra neque. Integer sit amet lacinia nunc. Ut cursus, - elit id faucibus elementum, elit nunc dapibus tellus, non ornare nisi sapien et eros. Nunc sit amet suscipit - arcu. Nulla ut nunc tempor, auctor massa sed, consectetur orci. Pellentesque erat ante, placerat eget dictum - elementum, dapibus et ipsum. Nunc sit amet nulla gravida, finibus felis vel, tempus sem. In urna purus, - accumsan quis aliquam et, condimentum ac urna. Nullam volutpat ullamcorper sapien, quis ultricies purus - dignissim aliquam. Mauris quis enim ante. Etiam vulputate faucibus placerat. Ut pellentesque, purus vitae - euismod cursus, lacus enim vulputate sapien, in porttitor erat dui eu lectus. Duis eleifend, massa vel - vehicula gravida, magna urna rutrum ligula, vitae mollis ipsum neque id enim. Donec varius tristique nisi, et - vestibulum dolor efficitur eget. Cras mauris leo, bibendum eget pretium a, tincidunt faucibus massa. - Vestibulum hendrerit arcu magna, vel consequat est euismod nec. Vestibulum non lacus porttitor, congue tortor - ut, venenatis elit. Duis at lectus arcu. Nunc quis sapien eu ipsum rutrum accumsan. Orci varius natoque - penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus quis sapien luctus, volutpat nulla - eget, gravida nunc. Aenean placerat a felis quis imperdiet. Sed sapien tellus, ultrices non ipsum eget, - pretium rhoncus quam. Aliquam erat volutpat. Maecenas at interdum turpis, eu mattis ligula. Class aptent - taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In lobortis felis a leo - ultricies, venenatis mollis felis lobortis. Suspendisse placerat vel ante vel euismod. Aenean sit amet - ullamcorper mauris, id consectetur est. Ut ultricies enim non quam condimentum, et congue arcu commodo. - Praesent convallis eleifend turpis, vitae feugiat turpis imperdiet sit amet. Class aptent taciti sociosqu ad - litora torquent per conubia nostra, per inceptos himenaeos. Quisque vulputate porttitor mattis. Pellentesque - sed ullamcorper lectus. Suspendisse velit tortor, viverra eget facilisis condimentum, accumsan sit amet felis. - Cras lobortis mi fermentum ligula consectetur, vitae tincidunt mauris scelerisque. Aenean ac condimentum erat, - quis lacinia lacus. Ut magna nibh, tempor et ligula suscipit, placerat laoreet ipsum. In semper semper nisl. - Donec risus lorem, tempor sed sollicitudin vitae, fringilla et mi. Vivamus pulvinar quam nisl, et tincidunt - justo tempus quis. Duis semper magna nunc, vitae faucibus lectus facilisis sed. Phasellus consequat arcu vel - interdum fermentum. In condimentum euismod neque, sed aliquet mauris posuere nec. Etiam metus eros, - pellentesque eget scelerisque id, porttitor at ligula. Curabitur eget nibh maximus enim lobortis sodales. - Etiam vulputate ligula lobortis vestibulum pulvinar. Curabitur eros justo, accumsan sed elit ac, mattis - lacinia nisi. Suspendisse ullamcorper lectus sit amet tellus condimentum porttitor. Duis cursus, neque et - aliquam congue, odio lectus porta elit, id lacinia dolor justo non leo. Aliquam vehicula at tellus ullamcorper - tincidunt. Phasellus neque nibh, convallis sit amet arcu sit amet, convallis egestas tortor. Etiam sit amet - vehicula quam. Praesent id consequat lacus, ac facilisis quam. Integer tristique lorem eros, id consequat - lorem lobortis vitae. Aliquam luctus purus eget sem molestie iaculis. Duis nisl risus, sodales sit amet nunc - vitae, volutpat cursus augue. Pellentesque congue massa eu metus pellentesque consectetur at vel neque. Donec - bibendum hendrerit erat, vitae dictum enim lobortis a. Quisque ac dapibus tellus, sit amet facilisis orci. - Cras pretium tortor non condimentum semper. Phasellus mollis condimentum blandit. Pellentesque at arcu risus. - Vivamus sit amet dui semper, suscipit est nec, elementum arcu. Praesent ante turpis, convallis ac leo eget, - - - - ); -} - -export default meta; diff --git a/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx b/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx index 1f033fcf69c..eb6cb427eba 100644 --- a/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx +++ b/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx @@ -12,7 +12,7 @@ import { AutoSaveField } from './AutoSaveField'; import mdx from './AutoSaveField.mdx'; const meta: Meta = { - title: 'Forms/AutoSaveField', + title: 'Inputs/AutoSaveField', component: AutoSaveField, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/Badge/Badge.story.tsx b/packages/grafana-ui/src/components/Badge/Badge.story.tsx index 173ba2ab36d..69ee4c37d94 100644 --- a/packages/grafana-ui/src/components/Badge/Badge.story.tsx +++ b/packages/grafana-ui/src/components/Badge/Badge.story.tsx @@ -6,7 +6,7 @@ import { Badge } from './Badge'; import mdx from './Badge.mdx'; const meta: Meta = { - title: 'Data Display/Badge', + title: 'Information/Badge', component: Badge, parameters: { docs: { page: mdx }, diff --git a/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx b/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx index 4c5575563d0..f5f42236828 100644 --- a/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx +++ b/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx @@ -9,7 +9,7 @@ import { BarGauge, Props } from './BarGauge'; import mdx from './BarGauge.mdx'; const meta: Meta = { - title: 'Visualizations/BarGauge', + title: 'Plugins/BarGauge', component: BarGauge, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx b/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx index 816a377b25a..48c45f9843c 100644 --- a/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx +++ b/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx @@ -15,7 +15,7 @@ import { import mdx from './BigValue.mdx'; const meta: Meta = { - title: 'Visualizations/BigValue', + title: 'Plugins/BigValue', component: BigValue, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/Button/Button.story.tsx b/packages/grafana-ui/src/components/Button/Button.story.tsx index c87d6709567..5f26875852e 100644 --- a/packages/grafana-ui/src/components/Button/Button.story.tsx +++ b/packages/grafana-ui/src/components/Button/Button.story.tsx @@ -12,7 +12,7 @@ import { ButtonGroup } from './ButtonGroup'; const sizes: ComponentSize[] = ['lg', 'md', 'sm']; export default { - title: 'Buttons/Button', + title: 'Inputs/Button', component: Button, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx b/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx index edb861bbfad..b9870ad11b2 100644 --- a/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx +++ b/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx @@ -3,7 +3,7 @@ import { StoryFn, Meta } from '@storybook/react'; import { ButtonCascader } from './ButtonCascader'; const meta: Meta = { - title: 'Forms/Cascader/ButtonCascader', + title: 'Inputs/ButtonCascader', component: ButtonCascader, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.internal.story.tsx b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.story.tsx similarity index 96% rename from packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.internal.story.tsx rename to packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.story.tsx index 5d42373e1cc..8c107a20129 100644 --- a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.internal.story.tsx +++ b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.story.tsx @@ -6,7 +6,7 @@ import { Button } from '../Button/Button'; import { CallToActionCard, CallToActionCardProps } from './CallToActionCard'; const meta: Meta = { - title: 'Layout/CallToActionCard', + title: 'Information/Deprecated/CallToActionCard', component: CallToActionCard, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.tsx b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.tsx index e71c688f3e7..ca3348c2b54 100644 --- a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.tsx +++ b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.tsx @@ -11,6 +11,7 @@ export interface CallToActionCardProps { className?: string; } +/** @deprecated Use instead */ export const CallToActionCard = ({ message, callToActionElement, footer, className }: CallToActionCardProps) => { const css = useStyles2(getStyles); diff --git a/packages/grafana-ui/src/components/Card/Card.story.tsx b/packages/grafana-ui/src/components/Card/Card.story.tsx index 8f2a9668dd2..34b25d96a05 100644 --- a/packages/grafana-ui/src/components/Card/Card.story.tsx +++ b/packages/grafana-ui/src/components/Card/Card.story.tsx @@ -9,10 +9,9 @@ import { Card } from './Card'; const logo = 'https://grafana.com/static/assets/img/apple-touch-icon.png'; const meta: Meta = { - title: 'General/Card', + title: 'Layout/Card', component: Card, - // nosort is a custom tag used so the stories shown in docs keep the order they are defined in the file - tags: ['autodocs', 'nosort'], + tags: ['autodocs'], parameters: { controls: { exclude: ['onClick', 'href', 'heading', 'description', 'className', 'noMargin'], diff --git a/packages/grafana-ui/src/components/Carousel/Carousel.story.tsx b/packages/grafana-ui/src/components/Carousel/Carousel.story.tsx index ffed8b27098..33a2c762582 100644 --- a/packages/grafana-ui/src/components/Carousel/Carousel.story.tsx +++ b/packages/grafana-ui/src/components/Carousel/Carousel.story.tsx @@ -15,7 +15,7 @@ const sampleImages = [ ]; const meta: Meta = { - title: 'Data Display/Carousel', + title: 'Overlays/Carousel', component: Carousel, parameters: { docs: { page: mdx }, diff --git a/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx b/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx index 43d8c337589..761235d5a22 100644 --- a/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx +++ b/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx @@ -31,7 +31,7 @@ const options = [ ]; const meta: Meta = { - title: 'Forms/Cascader', + title: 'Inputs/Cascader', component: Cascader, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx b/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx index c2fc4d41a24..53f56e7d128 100644 --- a/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx +++ b/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx @@ -5,7 +5,7 @@ import { ClickOutsideWrapper } from './ClickOutsideWrapper'; import mdx from './ClickOutsideWrapper.mdx'; const meta: Meta = { - title: 'Layout/ClickOutsideWrapper', + title: 'Utilities/ClickOutsideWrapper', component: ClickOutsideWrapper, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.story.tsx b/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.story.tsx index 5089786ae97..64c0489590a 100644 --- a/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.story.tsx +++ b/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.story.tsx @@ -7,7 +7,7 @@ import { ClipboardButton as ClipboardButtonImpl, Props } from './ClipboardButton import mdx from './ClipboardButton.mdx'; const meta: Meta = { - title: 'Buttons/ClipboardButton', + title: 'Inputs/ClipboardButton', component: ClipboardButtonImpl, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx index 196c8d65c97..c3967136503 100644 --- a/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx @@ -5,12 +5,11 @@ import { Meta, StoryFn } from '@storybook/react'; import { useStyles2 } from '../../themes/ThemeContext'; import { clearButtonStyles } from '../Button/Button'; -import { ColorPicker, SeriesColorPicker } from './ColorPicker'; +import { ColorPicker } from './ColorPicker'; import mdx from './ColorPicker.mdx'; -import { ColorPickerInput } from './ColorPickerInput'; const meta: Meta = { - title: 'Pickers and Editors/ColorPicker', + title: 'Pickers/ColorPicker', component: ColorPicker, parameters: { docs: { @@ -43,24 +42,6 @@ export const Basic: StoryFn = ({ color, enableNamedColors }) ); }; -export const SeriesPicker: StoryFn = ({ color, enableNamedColors }) => { - const [, updateArgs] = useArgs(); - return ( -
- {}} - color={color} - onChange={(color) => { - action('Color changed')(color); - updateArgs({ color }); - }} - /> -
- ); -}; - export const CustomTrigger: StoryFn = ({ color, enableNamedColors }) => { const [, updateArgs] = useArgs(); const clearButton = useStyles2(clearButtonStyles); @@ -89,19 +70,4 @@ export const CustomTrigger: StoryFn = ({ color, enableNamedC ); }; -export const Input: StoryFn = ({ color }) => { - const [, updateArgs] = useArgs(); - return ( -
- { - action('Color changed')(color); - updateArgs({ color }); - }} - /> -
- ); -}; - export default meta; diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPickerInput.story.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPickerInput.story.tsx new file mode 100644 index 00000000000..0be0684ca33 --- /dev/null +++ b/packages/grafana-ui/src/components/ColorPicker/ColorPickerInput.story.tsx @@ -0,0 +1,32 @@ +import { action } from '@storybook/addon-actions'; +import { useArgs } from '@storybook/preview-api'; +import { Meta, StoryFn } from '@storybook/react'; + +import { ColorPickerInput } from './ColorPickerInput'; + +const meta: Meta = { + title: 'Pickers/ColorPickerInput', + component: ColorPickerInput, + parameters: { + controls: { + exclude: ['onChange', 'onColorChange'], + }, + }, +}; + +export const Basic: StoryFn = ({ color }) => { + const [, updateArgs] = useArgs(); + return ( +
+ { + action('Color changed')(color); + updateArgs({ color }); + }} + /> +
+ ); +}; + +export default meta; diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx deleted file mode 100644 index a8ffbc6d129..00000000000 --- a/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Meta } from '@storybook/react'; -import { useState } from 'react'; - -import { useTheme2 } from '../../themes/ThemeContext'; - -import mdx from './ColorPicker.mdx'; -import { ColorPickerPopover } from './ColorPickerPopover'; -import { SeriesColorPickerPopover } from './SeriesColorPickerPopover'; - -const meta: Meta = { - title: 'Pickers and Editors/ColorPicker/Popovers', - component: ColorPickerPopover, - parameters: { - docs: { - page: mdx, - }, - }, -}; - -export const Basic = () => { - return ( -
- { - console.log(color); - }} - /> -
- ); -}; - -export const SeriesColorPickerPopoverExample = () => { - const theme = useTheme2(); - const [yAxis, setYAxis] = useState(0); - - return ( -
- (yAxis ? setYAxis(0) : setYAxis(2))} - color="#BC67E6" - onChange={(color: string) => { - console.log(color); - }} - /> -
- ); -}; - -export default meta; diff --git a/packages/grafana-ui/src/components/ColorPicker/Palettes.story.tsx b/packages/grafana-ui/src/components/ColorPicker/Palettes.story.tsx deleted file mode 100644 index 06042a9a30d..00000000000 --- a/packages/grafana-ui/src/components/ColorPicker/Palettes.story.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { action } from '@storybook/addon-actions'; -import { useArgs } from '@storybook/preview-api'; -import { Meta, StoryFn } from '@storybook/react'; -import { useState } from 'react'; - -import mdx from './ColorPicker.mdx'; -import { NamedColorsPalette } from './NamedColorsPalette'; -import SpectrumPalette from './SpectrumPalette'; - -const meta: Meta = { - title: 'Pickers and Editors/ColorPicker/Palettes', - parameters: { - docs: { - page: mdx, - }, - controls: { - exclude: ['theme', 'color'], - }, - }, - args: { - color: 'green', - }, -}; - -export const NamedColors: StoryFn = ({ color }) => { - const [colorVal, setColor] = useState(color); - return ; -}; - -export const Spectrum: StoryFn = ({ color }) => { - const [, updateArgs] = useArgs(); - return ( - { - action('Color changed')(color); - updateArgs({ color }); - }} - /> - ); -}; - -export default meta; diff --git a/packages/grafana-ui/src/components/ColorPicker/SeriesColorPicker.story.tsx b/packages/grafana-ui/src/components/ColorPicker/SeriesColorPicker.story.tsx new file mode 100644 index 00000000000..a66b0b951dd --- /dev/null +++ b/packages/grafana-ui/src/components/ColorPicker/SeriesColorPicker.story.tsx @@ -0,0 +1,39 @@ +import { action } from '@storybook/addon-actions'; +import { useArgs } from '@storybook/preview-api'; +import { Meta, StoryFn } from '@storybook/react'; + +import { SeriesColorPicker } from './ColorPicker'; + +const meta: Meta = { + title: 'Pickers/SeriesColorPicker', + component: SeriesColorPicker, + parameters: { + controls: { + exclude: ['onChange', 'onColorChange'], + }, + }, + args: { + enableNamedColors: false, + color: '#00ff00', + }, +}; + +export const Basic: StoryFn = ({ color, enableNamedColors }) => { + const [, updateArgs] = useArgs(); + return ( +
+ {}} + color={color} + onChange={(color) => { + action('Color changed')(color); + updateArgs({ color }); + }} + /> +
+ ); +}; + +export default meta; diff --git a/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx b/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx index d8dc2ff2b7c..eea67016ada 100644 --- a/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx +++ b/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx @@ -16,7 +16,7 @@ type PropsAndCustomArgs = ComboboxProps & type Story = StoryObj>; const meta: Meta = { - title: 'Forms/Combobox', + title: 'Inputs/Combobox', component: Combobox, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/Combobox/MultiCombobox.story.tsx b/packages/grafana-ui/src/components/Combobox/MultiCombobox.story.tsx index 6c99190c64a..9456242aa8f 100644 --- a/packages/grafana-ui/src/components/Combobox/MultiCombobox.story.tsx +++ b/packages/grafana-ui/src/components/Combobox/MultiCombobox.story.tsx @@ -11,7 +11,7 @@ import { generateOptions, fakeSearchAPI, generateGroupingOptions } from './story import { ComboboxOption } from './types'; const meta: Meta = { - title: 'Forms/MultiCombobox', + title: 'Inputs/MultiCombobox', component: MultiCombobox, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx index 6d138a7cb90..106dfc19af6 100644 --- a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx +++ b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx @@ -8,7 +8,7 @@ import mdx from './ConfirmButton.mdx'; import { DeleteButton } from './DeleteButton'; const meta: Meta = { - title: 'Buttons/ConfirmButton', + title: 'Inputs/ConfirmButton', component: ConfirmButton, // SB7 has broken subcomponent types due to dropping support for the feature // https://github.com/storybookjs/storybook/issues/20782 diff --git a/packages/grafana-ui/src/components/ContextMenu/ContextMenu.mdx b/packages/grafana-ui/src/components/ContextMenu/ContextMenu.mdx index 353636c7a21..a50659a3f0e 100644 --- a/packages/grafana-ui/src/components/ContextMenu/ContextMenu.mdx +++ b/packages/grafana-ui/src/components/ContextMenu/ContextMenu.mdx @@ -6,6 +6,8 @@ import { WithContextMenu } from './WithContextMenu'; A menu displaying additional options when it's not possible to show them at all times due to a space constraint. +`ContextMenu` wraps `Menu` to supply options as a list, and display at absolute coordinates. + ### Usage There are controlled and uncontrolled versions of the component available. With the controlled component (`ContextMenu`) the open/close logic needs to be handled separately. Uncontrolled component (`WithContextMenu`) handles this logic internally. diff --git a/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx b/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx index 3834bccbedf..ebafcf95e03 100644 --- a/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx +++ b/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx @@ -10,7 +10,7 @@ import { renderMenuItems } from './ContextMenuStoryHelper'; import { WithContextMenu, WithContextMenuProps } from './WithContextMenu'; const meta: Meta = { - title: 'General/ContextMenu', + title: 'Overlays/ContextMenu', component: ContextMenu, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.story.tsx b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.story.tsx index 3557ef84dd6..b198f976280 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.story.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.story.tsx @@ -36,7 +36,7 @@ const settingsMock: HttpSettingsProps['dataSourceConfig'] = { }; const meta: Meta = { - title: 'Data Source/DataSourceHttpSettings', + title: 'Plugins/DataSourceHttpSettings', component: DataSourceHttpSettings, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx index 29b10d03148..3f12563318a 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx @@ -7,7 +7,7 @@ import { DatePicker, DatePickerProps } from './DatePicker'; import mdx from './DatePicker.mdx'; const meta: Meta = { - title: 'Pickers and Editors/TimePickers/Pickers And Editors/DatePicker', + title: 'Date time pickers/DatePicker', component: DatePicker, argTypes: { minDate: { control: 'date' }, diff --git a/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx index 66b067846dd..158aa681b2d 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx @@ -13,7 +13,7 @@ const minimumDate = new Date(); minimumDate.setMonth(minimumDate.getMonth() - 1); const meta: Meta = { - title: 'Pickers and Editors/TimePickers/DatePickerWithInput', + title: 'Date time pickers/DatePickerWithInput', component: DatePickerWithInput, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx index a7a8d87961f..19acd203c0a 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx @@ -15,7 +15,7 @@ const minimumDate = new Date(); minimumDate.setDate(minimumDate.getDate() - 7); const meta: Meta = { - title: 'Pickers and Editors/TimePickers/DateTimePicker', + title: 'Date time pickers/DateTimePicker', component: DateTimePicker, argTypes: { date: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx index a6a0813e210..cacf19faf92 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx @@ -5,7 +5,7 @@ import { Meta, StoryFn } from '@storybook/react'; import { RelativeTimeRangePicker } from './RelativeTimeRangePicker'; const meta: Meta = { - title: 'Pickers and Editors/TimePickers/RelativeTimeRangePicker', + title: 'Date time pickers/RelativeTimeRangePicker', component: RelativeTimeRangePicker, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx index abd37242483..d3678e8dc84 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx @@ -7,7 +7,7 @@ import { dateTime } from '@grafana/data'; import { TimeOfDayPicker } from './TimeOfDayPicker'; const meta: Meta = { - title: 'Pickers and Editors/TimePickers/TimeOfDayPicker', + title: 'Date time pickers/TimeOfDayPicker', component: TimeOfDayPicker, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx index ef2ce7d2923..c70656bc070 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx @@ -30,7 +30,7 @@ const nullRange = { }; const meta: Meta = { - title: 'Pickers and Editors/TimePickers/TimeRangeInput', + title: 'Date time pickers/TimeRangeInput', component: TimeRangeInput, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx index f7ae73b010c..dadb184d716 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx @@ -10,7 +10,7 @@ const to = dateTime(); const from = to.subtract(6, 'h'); const meta: Meta = { - title: 'Pickers and Editors/TimePickers/TimeRangePicker', + title: 'Date time pickers/TimeRangePicker', component: TimeRangePicker, args: { value: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx index ee1b5e7e9d5..da95bb70c81 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx @@ -5,7 +5,7 @@ import { Meta, StoryFn } from '@storybook/react'; import { TimeZonePicker } from './TimeZonePicker'; const meta: Meta = { - title: 'Pickers and Editors/TimePickers/TimeZonePicker', + title: 'Date time pickers/TimeZonePicker', component: TimeZonePicker, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx index cf80764789c..cc41f958d7b 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx @@ -5,7 +5,7 @@ import { Meta, StoryFn } from '@storybook/react'; import { WeekStartPicker } from './WeekStartPicker'; const meta: Meta = { - title: 'Pickers and Editors/TimePickers/WeekStartPicker', + title: 'Date time pickers/WeekStartPicker', component: WeekStartPicker, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/Divider/Divider.story.tsx b/packages/grafana-ui/src/components/Divider/Divider.story.tsx index f7757d80d4f..37317a0ee05 100644 --- a/packages/grafana-ui/src/components/Divider/Divider.story.tsx +++ b/packages/grafana-ui/src/components/Divider/Divider.story.tsx @@ -4,7 +4,7 @@ import { Divider } from './Divider'; import mdx from './Divider.mdx'; const meta: Meta = { - title: 'General/Divider', + title: 'Layout/Divider', component: Divider, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx b/packages/grafana-ui/src/components/Dropdown/ButtonSelect.story.tsx similarity index 95% rename from packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx rename to packages/grafana-ui/src/components/Dropdown/ButtonSelect.story.tsx index edc03ecf4a4..a943ab93b73 100644 --- a/packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx +++ b/packages/grafana-ui/src/components/Dropdown/ButtonSelect.story.tsx @@ -5,7 +5,7 @@ import { Meta, StoryFn } from '@storybook/react'; import { ButtonSelect } from './ButtonSelect'; const meta: Meta = { - title: 'Forms/Select/ButtonSelect', + title: 'Inputs/Deprecated/ButtonSelect', component: ButtonSelect, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/Dropdown/ButtonSelect.tsx b/packages/grafana-ui/src/components/Dropdown/ButtonSelect.tsx index 7268565239e..3db07bcfcea 100644 --- a/packages/grafana-ui/src/components/Dropdown/ButtonSelect.tsx +++ b/packages/grafana-ui/src/components/Dropdown/ButtonSelect.tsx @@ -33,8 +33,7 @@ export interface Props extends HTMLAttributes { } /** - * @internal - * A temporary component until we have a proper dropdown component + * @deprecated Use Combobox or Dropdown instead */ const ButtonSelectComponent = (props: Props) => { const { className, options, value, onChange, narrow, variant, ...restProps } = props; diff --git a/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx b/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx index c44444597e0..c32e91e9777 100644 --- a/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx +++ b/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx @@ -4,7 +4,7 @@ import { EmptySearchResult } from './EmptySearchResult'; import mdx from './EmptySearchResult.mdx'; const meta: Meta = { - title: 'Visualizations/EmptySearchResult', + title: 'Information/Deprecated/EmptySearchResult', component: EmptySearchResult, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.tsx b/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.tsx index 23a794908bf..2ddafbf865b 100644 --- a/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.tsx +++ b/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.tsx @@ -8,6 +8,7 @@ export interface Props { children: JSX.Element | string; } +/** @deprecated Use instead */ const EmptySearchResult = ({ children }: Props) => { const styles = useStyles2(getStyles); return
{children}
; diff --git a/packages/grafana-ui/src/components/EmptyState/EmptyState.story.tsx b/packages/grafana-ui/src/components/EmptyState/EmptyState.story.tsx index c483f4ed4a4..d9d5b67f526 100644 --- a/packages/grafana-ui/src/components/EmptyState/EmptyState.story.tsx +++ b/packages/grafana-ui/src/components/EmptyState/EmptyState.story.tsx @@ -6,7 +6,7 @@ import { EmptyState } from './EmptyState'; import mdx from './EmptyState.mdx'; const meta: Meta = { - title: 'General/EmptyState', + title: 'Information/EmptyState', component: EmptyState, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx b/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx index 474cfc400fb..b4dce6ba569 100644 --- a/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx +++ b/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx @@ -9,7 +9,7 @@ import mdx from './ErrorBoundary.mdx'; import { ErrorWithStack } from './ErrorWithStack'; const meta: Meta = { - title: 'General/ErrorBoundary', + title: 'Utilities/ErrorBoundary', component: ErrorBoundary, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/FeatureBadge/FeatureBadge.story.tsx b/packages/grafana-ui/src/components/FeatureBadge/FeatureBadge.story.tsx index e3e24bf77a9..e2a8d70dc0d 100644 --- a/packages/grafana-ui/src/components/FeatureBadge/FeatureBadge.story.tsx +++ b/packages/grafana-ui/src/components/FeatureBadge/FeatureBadge.story.tsx @@ -6,7 +6,7 @@ import { FeatureBadge } from './FeatureBadge'; import mdx from './FeatureBadge.mdx'; const meta: Meta = { - title: 'Data Display/FeatureBadge', + title: 'Information/FeatureBadge', component: FeatureBadge, parameters: { docs: { page: mdx }, diff --git a/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx b/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx index de3ef47612e..ac9b70eb14c 100644 --- a/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx +++ b/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx @@ -4,7 +4,7 @@ import { FileDropzone } from './FileDropzone'; import mdx from './FileDropzone.mdx'; const meta: Meta = { - title: 'Forms/FileDropzone', + title: 'Inputs/FileDropzone', component: FileDropzone, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx b/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx index 3e10caf11f4..1b5d2eed5d2 100644 --- a/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx +++ b/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx @@ -4,7 +4,7 @@ import { FileListItem as FileListItemComponent, FileListItemProps } from './File import mdx from './FileListItem.mdx'; const meta: Meta = { - title: 'Forms/FileListItem', + title: 'Inputs/FileListItem', component: FileListItemComponent, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx b/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx index f6e7025553a..bdd445316ae 100644 --- a/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx +++ b/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx @@ -4,7 +4,7 @@ import { FileUpload } from './FileUpload'; import mdx from './FileUpload.mdx'; const meta: Meta = { - title: 'Forms/FileUpload', + title: 'Inputs/FileUpload', component: FileUpload, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx b/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx index 54dec2ec7ea..eb4c48deae9 100644 --- a/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx +++ b/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx @@ -8,7 +8,7 @@ import { FilterPill } from './FilterPill'; import mdx from './FilterPill.mdx'; const meta: Meta = { - title: 'General/FilterPill', + title: 'Inputs/FilterPill', component: FilterPill, argTypes: { icon: { control: { type: 'select', options: getAvailableIcons() } }, diff --git a/packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx b/packages/grafana-ui/src/components/FormField/FormField.story.tsx similarity index 95% rename from packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx rename to packages/grafana-ui/src/components/FormField/FormField.story.tsx index efddb8d7f3c..845001dcacc 100644 --- a/packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx +++ b/packages/grafana-ui/src/components/FormField/FormField.story.tsx @@ -3,7 +3,7 @@ import { Meta, StoryFn } from '@storybook/react'; import { FormField } from './FormField'; const meta: Meta = { - title: 'Forms/Legacy/FormField', + title: 'Forms/Deprecated/FormField', component: FormField, parameters: { controls: { diff --git a/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx b/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx index 3358a90f179..5f7cad8d3ec 100644 --- a/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx +++ b/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx @@ -4,7 +4,7 @@ import { FormattedValueDisplay } from './FormattedValueDisplay'; import mdx from './FormattedValueDisplay.mdx'; const meta: Meta = { - title: 'Visualizations/FormattedValueDisplay', + title: 'Plugins/FormattedValueDisplay', component: FormattedValueDisplay, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/Forms/Checkbox.story.tsx b/packages/grafana-ui/src/components/Forms/Checkbox.story.tsx index 8cdf3daa56d..fa4d1fb1d8e 100644 --- a/packages/grafana-ui/src/components/Forms/Checkbox.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Checkbox.story.tsx @@ -9,7 +9,7 @@ import mdx from './Checkbox.mdx'; import { Field } from './Field'; const meta: Meta = { - title: 'Forms/Checkbox', + title: 'Inputs/Checkbox', component: Checkbox, parameters: { docs: { diff --git a/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx b/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx deleted file mode 100644 index a837949c744..00000000000 --- a/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { Meta, StoryFn } from '@storybook/react'; -import { zip, fromPairs } from 'lodash'; -import { useState } from 'react'; - -import { EventsWithValidation } from '../../../../utils/validate'; - -import { Input } from './Input'; - -const meta: Meta = { - title: 'Forms/Legacy/Input', - component: Input, - parameters: { - controls: { - exclude: ['inputRef', 'onBlur', 'onFocus', 'onChange'], - }, - }, - argTypes: { - validationEvents: { - control: { - type: 'select', - options: fromPairs(zip(Object.keys(EventsWithValidation), Object.values(EventsWithValidation))), - }, - }, - validation: { name: 'Validation regex (will do a partial match if you do not anchor it)' }, - }, -}; - -const Wrapper: StoryFn = (args) => { - const [value, setValue] = useState(''); - const validations = { - [args.validationEvents]: [ - { - rule: (value: string) => { - return !!value.match(args.validation); - }, - errorMessage: args.validationErrorMessage, - }, - ], - }; - return ( - setValue(e.currentTarget.value)} - validationEvents={validations} - hideErrorMessage={args.hideErrorMessage} - /> - ); -}; - -export const Basic = Wrapper.bind({}); -Basic.args = { - validation: '', - validationErrorMessage: 'Input not valid', - validationEvents: EventsWithValidation.onBlur, - hideErrorMessage: false, -}; - -export default meta; diff --git a/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx b/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx deleted file mode 100644 index 5e156ab8f9c..00000000000 --- a/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import { action } from '@storybook/addon-actions'; -import { useArgs } from '@storybook/preview-api'; -import { Meta, StoryFn } from '@storybook/react'; -import { useCallback } from 'react'; - -import { SelectableValue } from '@grafana/data'; - -import { Select, AsyncSelect as AsyncSelectComponent } from './Select'; - -const meta: Meta = { - title: 'Forms/Legacy/Select', - component: Select, - parameters: { - controls: { - exclude: [ - 'className', - 'menuPlacement', - 'menuPosition', - 'maxMenuHeight', - 'minMenuHeight', - 'maxVisibleValues', - 'prefix', - 'renderControl', - 'value', - 'tooltipContent', - 'components', - 'inputValue', - 'id', - 'inputId', - 'defaultValue', - 'aria-label', - 'noOptionsMessage', - 'onChange', - 'onBlur', - 'onKeyDown', - 'filterOption', - 'formatCreateLabel', - 'getOptionLabel', - 'getOptionValue', - 'onCloseMenu', - 'onCreateOption', - 'onInputChange', - 'onOpenMenu', - 'isOptionDisabled', - ], - }, - }, - argTypes: { - width: { control: { type: 'range', min: 5, max: 30 } }, - }, -}; - -const initialValue: SelectableValue = { label: 'A label', value: 'A value' }; - -const options = [ - initialValue, - { label: 'Another label', value: 'Another value 1' }, - { label: 'Another label', value: 'Another value 2' }, - { label: 'Another label', value: 'Another value 3' }, - { label: 'Another label', value: 'Another value 4' }, - { label: 'Another label', value: 'Another value 5' }, - { label: 'Another label', value: 'Another value ' }, -]; - -export const Basic: StoryFn = (args) => { - const [, updateArgs] = useArgs(); - return ( -