Skip to content

Commit

Permalink
remove read only flag
Browse files Browse the repository at this point in the history
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla committed Jul 17, 2024
1 parent 87ccfee commit 749d6f8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"start": "scripts/use_node scripts/opensearch_dashboards --dev",
"start:docker": "scripts/use_node scripts/opensearch_dashboards --dev --opensearch.hosts=$OPENSEARCH_HOSTS --opensearch.ignoreVersionMismatch=true --server.host=$SERVER_HOST",
"start:security": "scripts/use_node scripts/opensearch_dashboards --dev --security",
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --data_source.enabled=true --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['query:dataSource:readOnly']=false",
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --data_source.enabled=true --uiSettings.overrides['query:enhancements:enabled']=true",
"debug": "scripts/use_node --nolazy --inspect scripts/opensearch_dashboards --dev",
"debug-break": "scripts/use_node --nolazy --inspect-brk scripts/opensearch_dashboards --dev",
"lint": "yarn run lint:es && yarn run lint:style",
Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,5 @@ export const UI_SETTINGS = {
FILTERS_EDITOR_SUGGEST_VALUES: 'filterEditor:suggestValues',
QUERY_ENHANCEMENTS_ENABLED: 'query:enhancements:enabled',
QUERY_DATAFRAME_HYDRATION_STRATEGY: 'query:dataframe:hydrationStrategy',
QUERY_DATA_SOURCE_READONLY: 'query:dataSource:readOnly',
SEARCH_QUERY_LANGUAGE_BLOCKLIST: 'search:queryLanguageBlocklist',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
const opensearchDashboards = useOpenSearchDashboards<IDataPluginServices>();
const { uiSettings, storage, appName } = opensearchDashboards.services;

const isDataSourceReadOnly = uiSettings.get(UI_SETTINGS.QUERY_DATA_SOURCE_READONLY);

const queryLanguage = props.query && props.query.language;
const queryUiEnhancement =
(queryLanguage &&
Expand Down Expand Up @@ -197,7 +195,6 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
return (
!Array.isArray(props.indexPatterns!) ||
compact(props.indexPatterns!).length === 0 ||
!isDataSourceReadOnly ||
fromUser(query!.query).includes(
typeof props.indexPatterns[0] === 'string'
? props.indexPatterns[0]
Expand Down
13 changes: 0 additions & 13 deletions src/plugins/data/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,19 +750,6 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
category: ['search'],
schema: schema.string(),
},
[UI_SETTINGS.QUERY_DATA_SOURCE_READONLY]: {
name: i18n.translate('data.advancedSettings.query.dataSource.readOnlyTitle', {
defaultMessage: 'Read-only data source in query editor',
}),
value: true,
description: i18n.translate('data.advancedSettings.query.dataSource.readOnlyText', {
defaultMessage:
'When enabled, the search bar prevents modifying the data source in the query input. ' +
'<strong>Experimental</strong>: Requires query enhancements enabled.',
}),
category: ['search'],
schema: schema.boolean(),
},
[UI_SETTINGS.SEARCH_QUERY_LANGUAGE_BLOCKLIST]: {
name: i18n.translate('data.advancedSettings.searchQueryLanguageBlocklistTitle', {
defaultMessage: 'Additional query languages blocklist',
Expand Down

0 comments on commit 749d6f8

Please sign in to comment.