Skip to content

Commit 9224956

Browse files
opensearch-trigger-bot[bot]github-actions[bot]opensearch-changeset-bot[bot]
authored andcommitted
[Discover-next] remove plugin config toggle for data enhancements (#7291) (#7293)
* [Discover-next] remove plugin config toggle for data enhancements Remove the data config toggle for enhancements and rely on the UI settings for being enabled. (cherry picked from commit 5761207) Signed-off-by: Kawika Avilla <kavilla414@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent fac8667 commit 9224956

File tree

14 files changed

+12
-40
lines changed

14 files changed

+12
-40
lines changed

.github/workflows/cypress_workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env:
3232
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
3333
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
3434
FTR_PATH: 'ftr'
35-
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false'
35+
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false'
3636
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
3737
CYPRESS_BROWSER: 'chromium'
3838
CYPRESS_VISBUILDER_ENABLED: true

changelogs/fragments/7291.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deprecate:
2+
- Remove data enhancements config and readonly flag. Removes dead url link, ([#7291](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7291))

changelogs/fragments/7314.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fix:
2+
- Unused config setting and remove data sources as a required plugin. ([#7314](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7314))

config/opensearch_dashboards.yml

-3
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@
359359
# This publishes the Application Usage and UI Metrics into the saved object, which can be accessed by /api/stats?extended=true&legacy=true&exclude_usage=false
360360
# usageCollection.uiMetric.enabled: false
361361

362-
# Set the value to true to enable enhancements for the data plugin
363-
# data.enhancements.enabled: false
364-
365362
# Set the backend roles in groups or users, whoever has the backend roles or exactly match the user ids defined in this config will be regard as dashboard admin.
366363
# Dashboard admin will have the access to all the workspaces(workspace.enabled: true) and objects inside OpenSearch Dashboards.
367364
# opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"start": "scripts/use_node scripts/opensearch_dashboards --dev",
6464
"start:docker": "scripts/use_node scripts/opensearch_dashboards --dev --opensearch.hosts=$OPENSEARCH_HOSTS --opensearch.ignoreVersionMismatch=true --server.host=$SERVER_HOST",
6565
"start:security": "scripts/use_node scripts/opensearch_dashboards --dev --security",
66-
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --data.enhancements.enabled=true --data_source.enabled=true --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['query:dataSource:readOnly']=false",
66+
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true",
6767
"debug": "scripts/use_node --nolazy --inspect scripts/opensearch_dashboards --dev",
6868
"debug-break": "scripts/use_node --nolazy --inspect-brk scripts/opensearch_dashboards --dev",
6969
"lint": "yarn run lint:es && yarn run lint:style",

src/core/server/rendering/views/template.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ export const Template: FunctionComponent<Props> = ({
6767
* ToDo: Custom branded favicons will not work correctly across all browsers with
6868
* these `link` elements and single type. Try to guess the image and use only one.
6969
*
70-
* Favicons (generated from https://realfavicongenerator.net/)
71-
*
7270
* For user customized favicon using yml file:
7371
* If user inputs a valid URL, we guarantee basic favicon customization, such as
7472
* browser favicon(Chrome, Firefox, Safari, and Edge), apple touch icon, safari

src/plugins/data/common/constants.ts

-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,5 @@ export const UI_SETTINGS = {
6262
FILTERS_EDITOR_SUGGEST_VALUES: 'filterEditor:suggestValues',
6363
QUERY_ENHANCEMENTS_ENABLED: 'query:enhancements:enabled',
6464
QUERY_DATAFRAME_HYDRATION_STRATEGY: 'query:dataframe:hydrationStrategy',
65-
QUERY_DATA_SOURCE_READONLY: 'query:dataSource:readOnly',
6665
SEARCH_QUERY_LANGUAGE_BLOCKLIST: 'search:queryLanguageBlocklist',
6766
} as const;

src/plugins/data/config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { schema, TypeOf } from '@osd/config-schema';
3232

3333
export const configSchema = schema.object({
3434
enhancements: schema.object({
35-
enabled: schema.boolean({ defaultValue: false }),
3635
supportedAppNames: schema.arrayOf(schema.string(), {
3736
defaultValue: ['discover'],
3837
}),

src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx

+1-13
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
7575
const opensearchDashboards = useOpenSearchDashboards<IDataPluginServices>();
7676
const { uiSettings, storage, appName } = opensearchDashboards.services;
7777

78-
const isDataSourceReadOnly = uiSettings.get(UI_SETTINGS.QUERY_DATA_SOURCE_READONLY);
79-
8078
const queryLanguage = props.query && props.query.language;
8179
const queryUiEnhancement =
8280
(queryLanguage &&
@@ -193,17 +191,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
193191
}
194192

195193
function isValidQuery(query: Query | undefined) {
196-
if (!query || !query.query) return false;
197-
return (
198-
!Array.isArray(props.indexPatterns!) ||
199-
compact(props.indexPatterns!).length === 0 ||
200-
!isDataSourceReadOnly ||
201-
fromUser(query!.query).includes(
202-
typeof props.indexPatterns[0] === 'string'
203-
? props.indexPatterns[0]
204-
: props.indexPatterns[0].title
205-
)
206-
);
194+
if (query && query.query) return true;
207195
}
208196

209197
function getQueryStringInitialValue(language: string) {

src/plugins/data/public/ui/settings/settings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class Settings {
3535
private readonly queryEnhancements: Map<string, QueryEnhancement>,
3636
private readonly queryEditorExtensionMap: Record<string, QueryEditorExtensionConfig>
3737
) {
38-
this.isEnabled = this.config.enabled;
38+
this.isEnabled = true;
3939
this.setUserQueryEnhancementsEnabled(this.isEnabled);
4040
this.enhancedAppNames = this.isEnabled ? this.config.supportedAppNames : [];
4141
}

src/plugins/data/public/ui/ui_service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export class UiService implements Plugin<IUiSetup, IUiStart> {
4242
return {
4343
__enhance: (enhancements?: UiEnhancements) => {
4444
if (!enhancements) return;
45-
if (!this.enhancementsConfig.enabled) return;
4645
if (enhancements.query && enhancements.query.language) {
4746
this.queryEnhancements.set(enhancements.query.language, enhancements.query);
4847
}

src/plugins/data/server/ui_settings.ts

+1-14
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
709709
name: i18n.translate('data.advancedSettings.query.enhancements.enableTitle', {
710710
defaultMessage: 'Enable query enhancements',
711711
}),
712-
value: false,
712+
value: true,
713713
description: i18n.translate('data.advancedSettings.query.enhancements.enableText', {
714714
defaultMessage: `
715715
<strong>Experimental</strong>:
@@ -750,19 +750,6 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
750750
category: ['search'],
751751
schema: schema.string(),
752752
},
753-
[UI_SETTINGS.QUERY_DATA_SOURCE_READONLY]: {
754-
name: i18n.translate('data.advancedSettings.query.dataSource.readOnlyTitle', {
755-
defaultMessage: 'Read-only data source in query editor',
756-
}),
757-
value: true,
758-
description: i18n.translate('data.advancedSettings.query.dataSource.readOnlyText', {
759-
defaultMessage:
760-
'When enabled, the search bar prevents modifying the data source in the query input. ' +
761-
'<strong>Experimental</strong>: Requires query enhancements enabled.',
762-
}),
763-
category: ['search'],
764-
schema: schema.boolean(),
765-
},
766753
[UI_SETTINGS.SEARCH_QUERY_LANGUAGE_BLOCKLIST]: {
767754
name: i18n.translate('data.advancedSettings.searchQueryLanguageBlocklistTitle', {
768755
defaultMessage: 'Additional query languages blocklist',

src/plugins/query_enhancements/opensearch_dashboards.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "opensearchDashboards",
44
"server": true,
55
"ui": true,
6-
"requiredPlugins": ["data", "opensearchDashboardsReact", "opensearchDashboardsUtils", "dataSource", "dataSourceManagement", "savedObjects", "uiActions"],
7-
"optionalPlugins": []
6+
"requiredPlugins": ["data", "opensearchDashboardsReact", "opensearchDashboardsUtils", "dataSourceManagement", "savedObjects", "uiActions"],
7+
"optionalPlugins": ["dataSource"]
88
}
99

test/common/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default function () {
7979
`--opensearchDashboards.branding.mark.defaultUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_default.svg`,
8080
`--opensearchDashboards.branding.mark.darkModeUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_darkmode.svg`,
8181
`--opensearchDashboards.branding.applicationTitle=OpenSearch`,
82+
`--uiSettings.overrides['query:enhancements:enabled']=false`,
8283
],
8384
},
8485
services,

0 commit comments

Comments
 (0)