mirror of https://github.com/grafana/grafana.git
				
				
				
			Actions: Remove `vizActions` feature toggle (#100309)
This commit is contained in:
		
							parent
							
								
									4c021aac7a
								
							
						
					
					
						commit
						2b0029267c
					
				|  | @ -130,7 +130,6 @@ Experimental features might be changed or removed without prior notice. | |||
| | `lokiExperimentalStreaming`                 | Support new streaming approach for loki (prototype, needs special loki build)                                                                                                                                                                                                     | | ||||
| | `storage`                                   | Configurable storage for dashboards, datasources, and resources                                                                                                                                                                                                                   | | ||||
| | `canvasPanelNesting`                        | Allow elements nesting                                                                                                                                                                                                                                                            | | ||||
| | `vizActions`                                | Allow actions in visualizations                                                                                                                                                                                                                                                   | | ||||
| | `disableSecretsCompatibility`               | Disable duplicated secret storage in legacy tables                                                                                                                                                                                                                                | | ||||
| | `logRequestsInstrumentedAsUnknown`          | Logs the path for requests that are instrumented as unknown                                                                                                                                                                                                                       | | ||||
| | `showDashboardValidationWarnings`           | Show warnings when dashboards do not validate against the schema                                                                                                                                                                                                                  | | ||||
|  |  | |||
|  | @ -36,7 +36,6 @@ export interface FeatureToggles { | |||
|   autoMigrateStatPanel?: boolean; | ||||
|   disableAngular?: boolean; | ||||
|   canvasPanelNesting?: boolean; | ||||
|   vizActions?: boolean; | ||||
|   disableSecretsCompatibility?: boolean; | ||||
|   logRequestsInstrumentedAsUnknown?: boolean; | ||||
|   grpcServer?: boolean; | ||||
|  |  | |||
|  | @ -150,14 +150,6 @@ var ( | |||
| 			Owner:             grafanaDatavizSquad, | ||||
| 			HideFromAdminPage: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Name:              "vizActions", | ||||
| 			Description:       "Allow actions in visualizations", | ||||
| 			Stage:             FeatureStageExperimental, | ||||
| 			FrontendOnly:      true, | ||||
| 			Owner:             grafanaDatavizSquad, | ||||
| 			HideFromAdminPage: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Name:            "disableSecretsCompatibility", | ||||
| 			Description:     "Disable duplicated secret storage in legacy tables", | ||||
|  |  | |||
|  | @ -17,7 +17,6 @@ autoMigrateWorldmapPanel,preview,@grafana/dataviz-squad,false,false,true | |||
| autoMigrateStatPanel,preview,@grafana/dataviz-squad,false,false,true | ||||
| disableAngular,preview,@grafana/dataviz-squad,false,false,true | ||||
| canvasPanelNesting,experimental,@grafana/dataviz-squad,false,false,true | ||||
| vizActions,experimental,@grafana/dataviz-squad,false,false,true | ||||
| disableSecretsCompatibility,experimental,@grafana/hosted-grafana-team,false,true,false | ||||
| logRequestsInstrumentedAsUnknown,experimental,@grafana/hosted-grafana-team,false,false,false | ||||
| grpcServer,preview,@grafana/search-and-storage,false,false,false | ||||
|  |  | |||
| 
 | 
|  | @ -79,10 +79,6 @@ const ( | |||
| 	// Allow elements nesting
 | ||||
| 	FlagCanvasPanelNesting = "canvasPanelNesting" | ||||
| 
 | ||||
| 	// FlagVizActions
 | ||||
| 	// Allow actions in visualizations
 | ||||
| 	FlagVizActions = "vizActions" | ||||
| 
 | ||||
| 	// FlagDisableSecretsCompatibility
 | ||||
| 	// Disable duplicated secret storage in legacy tables
 | ||||
| 	FlagDisableSecretsCompatibility = "disableSecretsCompatibility" | ||||
|  |  | |||
|  | @ -4202,7 +4202,8 @@ | |||
|       "metadata": { | ||||
|         "name": "vizActions", | ||||
|         "resourceVersion": "1722461779830", | ||||
|         "creationTimestamp": "2024-09-09T14:11:55Z" | ||||
|         "creationTimestamp": "2024-09-09T14:11:55Z", | ||||
|         "deletionTimestamp": "2025-02-07T18:50:26Z" | ||||
|       }, | ||||
|       "spec": { | ||||
|         "description": "Allow actions in visualizations", | ||||
|  |  | |||
|  | @ -30,7 +30,6 @@ import { | |||
|   DataLinksFieldConfigSettings, | ||||
| } from '@grafana/data'; | ||||
| import { actionsOverrideProcessor } from '@grafana/data/src/field/overrides/processors'; | ||||
| import { config } from '@grafana/runtime'; | ||||
| import { FieldConfig } from '@grafana/schema'; | ||||
| import { RadioButtonGroup, TimeZonePicker, Switch } from '@grafana/ui'; | ||||
| import { FieldNamePicker } from '@grafana/ui/src/components/MatchersUI/FieldNamePicker'; | ||||
|  | @ -349,7 +348,7 @@ export const getAllStandardFieldConfigs = () => { | |||
|     category, | ||||
|   }; | ||||
| 
 | ||||
|   const dataLinksCategory = config.featureToggles.vizActions ? 'Data links and actions' : 'Data links'; | ||||
|   const dataLinksCategory = 'Data links and actions'; | ||||
| 
 | ||||
|   const links: FieldConfigPropertyItem<FieldConfig, DataLink[], DataLinksFieldConfigSettings> = { | ||||
|     id: 'links', | ||||
|  | @ -379,7 +378,6 @@ export const getAllStandardFieldConfigs = () => { | |||
|     shouldApply: () => true, | ||||
|     category: [dataLinksCategory], | ||||
|     getItemsCount: (value) => (value ? value.length : 0), | ||||
|     showIf: () => config.featureToggles.vizActions, | ||||
|     hideFromDefaults: true, | ||||
|   }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,7 +2,6 @@ import { css } from '@emotion/css'; | |||
| import { memo } from 'react'; | ||||
| 
 | ||||
| import { Action, GrafanaTheme2, httpMethodOptions, HttpRequestMethod, VariableSuggestion } from '@grafana/data'; | ||||
| import { config } from '@grafana/runtime'; | ||||
| import { Switch } from '@grafana/ui/'; | ||||
| import { Field } from '@grafana/ui/src/components/Forms/Field'; | ||||
| import { InlineField } from '@grafana/ui/src/components/Forms/InlineField'; | ||||
|  | @ -108,8 +107,6 @@ export const ActionEditor = memo(({ index, value, onChange, suggestions, showOne | |||
|     value.fetch.method !== HttpRequestMethod.GET && | ||||
|     value.fetch.headers?.some(([name, value]) => name === 'Content-Type' && value === 'application/json'); | ||||
| 
 | ||||
|   const action = config.featureToggles.vizActions ? 'or action' : ''; | ||||
| 
 | ||||
|   return ( | ||||
|     <div className={styles.listItem}> | ||||
|       <Field label={t('grafana-ui.action-editor.modal.action-title', 'Title')} className={styles.inputField}> | ||||
|  | @ -147,8 +144,7 @@ export const ActionEditor = memo(({ index, value, onChange, suggestions, showOne | |||
|           label={t('grafana-ui.data-link-inline-editor.one-click', 'One click')} | ||||
|           description={t( | ||||
|             'grafana-ui.action-editor.modal.one-click-description', | ||||
|             'Only one link {{ action }} can have one click enabled at a time', | ||||
|             { action } | ||||
|             'Only one link or action can have one click enabled at a time' | ||||
|           )} | ||||
|         > | ||||
|           <Switch value={value.oneClick || false} onChange={onOneClickChanged} /> | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| import { get as lodashGet } from 'lodash'; | ||||
| 
 | ||||
| import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; | ||||
| import { config } from '@grafana/runtime'; | ||||
| import { CanvasElementOptions } from 'app/features/canvas/element'; | ||||
| import { | ||||
|   canvasElementRegistry, | ||||
|  | @ -67,8 +66,6 @@ export function getElementEditor(opts: CanvasEditorOptions): NestedPanelOptions< | |||
|       const current = options?.type ? options.type : DEFAULT_CANVAS_ELEMENT_CONFIG.type; | ||||
|       const layerTypes = getElementTypes(opts.scene.shouldShowAdvancedTypes, current).options; | ||||
| 
 | ||||
|       const actionsEnabled = config.featureToggles.vizActions; | ||||
| 
 | ||||
|       const isUnsupported = | ||||
|         !opts.scene.shouldShowAdvancedTypes && !defaultElementItems.filter((item) => item.id === options?.type).length; | ||||
| 
 | ||||
|  | @ -123,9 +120,7 @@ export function getElementEditor(opts: CanvasEditorOptions): NestedPanelOptions< | |||
|       } | ||||
| 
 | ||||
|       optionBuilder.addDataLinks(builder, ctx); | ||||
|       if (actionsEnabled) { | ||||
|         optionBuilder.addActions(builder, ctx); | ||||
|       } | ||||
|       optionBuilder.addActions(builder, ctx); | ||||
|     }, | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -2,7 +2,6 @@ import { capitalize } from 'lodash'; | |||
| 
 | ||||
| import { FieldType } from '@grafana/data'; | ||||
| import { PanelOptionsSupplier } from '@grafana/data/src/panel/PanelPlugin'; | ||||
| import { config } from '@grafana/runtime'; | ||||
| import { ConnectionDirection } from 'app/features/canvas/element'; | ||||
| import { SVGElements } from 'app/features/canvas/runtime/element'; | ||||
| import { ColorDimensionEditor, ResourceDimensionEditor, ScaleDimensionEditor } from 'app/features/dimensions/editors'; | ||||
|  | @ -213,7 +212,7 @@ export const optionBuilder: OptionSuppliers = { | |||
| 
 | ||||
|   addDataLinks: (builder, context) => { | ||||
|     builder.addCustomEditor({ | ||||
|       category: config.featureToggles.vizActions ? ['Data links and actions'] : ['Data links'], | ||||
|       category: ['Data links and actions'], | ||||
|       id: 'dataLinks', | ||||
|       path: 'links', | ||||
|       name: 'Links', | ||||
|  | @ -230,7 +229,6 @@ export const optionBuilder: OptionSuppliers = { | |||
|       name: 'Actions', | ||||
|       editor: ActionsEditor, | ||||
|       settings: context.options, | ||||
|       showIf: () => config.featureToggles.vizActions, | ||||
|     }); | ||||
|   }, | ||||
| }; | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| import { ActionModel, Field, InterpolateFunction, LinkModel } from '@grafana/data'; | ||||
| import { DataFrame } from '@grafana/data/'; | ||||
| import { config } from '@grafana/runtime'; | ||||
| import { getActions } from 'app/features/actions/utils'; | ||||
| 
 | ||||
| export const getDataLinks = (field: Field, rowIdx: number) => { | ||||
|  | @ -32,10 +31,6 @@ export const getFieldActions = ( | |||
|   replaceVars: InterpolateFunction, | ||||
|   rowIndex: number | ||||
| ) => { | ||||
|   if (!config.featureToggles?.vizActions) { | ||||
|     return []; | ||||
|   } | ||||
| 
 | ||||
|   const actions: Array<ActionModel<Field>> = []; | ||||
|   const actionLookup = new Set<string>(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -3,7 +3,6 @@ import { merge } from 'lodash'; | |||
| import { useState } from 'react'; | ||||
| 
 | ||||
| import { GrafanaTheme2, SelectableValue } from '@grafana/data'; | ||||
| import { config } from '@grafana/runtime'; | ||||
| import { TableCellOptions } from '@grafana/schema'; | ||||
| import { Field, Select, TableCellDisplayMode, useStyles2 } from '@grafana/ui'; | ||||
| 
 | ||||
|  | @ -91,15 +90,9 @@ let cellDisplayModeOptions: Array<SelectableValue<TableCellOptions>> = [ | |||
|   { value: { type: TableCellDisplayMode.DataLinks }, label: 'Data links' }, | ||||
|   { value: { type: TableCellDisplayMode.JSONView }, label: 'JSON View' }, | ||||
|   { value: { type: TableCellDisplayMode.Image }, label: 'Image' }, | ||||
|   { value: { type: TableCellDisplayMode.Actions }, label: 'Actions' }, | ||||
| ]; | ||||
| 
 | ||||
| if (config.featureToggles.vizActions) { | ||||
|   cellDisplayModeOptions = [ | ||||
|     ...cellDisplayModeOptions, | ||||
|     { value: { type: TableCellDisplayMode.Actions }, label: 'Actions' }, | ||||
|   ]; | ||||
| } | ||||
| 
 | ||||
| const getStyles = (theme: GrafanaTheme2) => ({ | ||||
|   fixBottomMargin: css({ | ||||
|     marginBottom: theme.spacing(-2), | ||||
|  |  | |||
|  | @ -152,10 +152,6 @@ const getCellActions = ( | |||
|   rowIndex: number, | ||||
|   replaceVariables: InterpolateFunction | undefined | ||||
| ) => { | ||||
|   if (!config.featureToggles?.vizActions) { | ||||
|     return []; | ||||
|   } | ||||
| 
 | ||||
|   const actions: Array<ActionModel<Field>> = []; | ||||
|   const actionLookup = new Set<string>(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -1703,7 +1703,7 @@ | |||
|         "action-query-params": "Query parameters", | ||||
|         "action-title": "Title", | ||||
|         "action-title-placeholder": "Action title", | ||||
|         "one-click-description": "Only one link {{ action }} can have one click enabled at a time" | ||||
|         "one-click-description": "Only one link or action can have one click enabled at a time" | ||||
|       } | ||||
|     }, | ||||
|     "alert": { | ||||
|  |  | |||
|  | @ -1703,7 +1703,7 @@ | |||
|         "action-query-params": "Qūęřy päřämęŧęřş", | ||||
|         "action-title": "Ŧįŧľę", | ||||
|         "action-title-placeholder": "Åčŧįőʼn ŧįŧľę", | ||||
|         "one-click-description": "Øʼnľy őʼnę ľįʼnĸ {{ action }} čäʼn ĥävę őʼnę čľįčĸ ęʼnäþľęđ äŧ ä ŧįmę" | ||||
|         "one-click-description": "Øʼnľy őʼnę ľįʼnĸ őř äčŧįőʼn čäʼn ĥävę őʼnę čľįčĸ ęʼnäþľęđ äŧ ä ŧįmę" | ||||
|       } | ||||
|     }, | ||||
|     "alert": { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue