diff --git a/changelogs/fragments/7756.yml b/changelogs/fragments/7756.yml new file mode 100644 index 000000000000..6ebd99148086 --- /dev/null +++ b/changelogs/fragments/7756.yml @@ -0,0 +1,2 @@ +feat: +- Created language manager inside query string service ([#7756](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7756)) \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 076fae33b9a2..3ed9373ed310 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -13,7 +13,7 @@ import { getTokenPosition } from '../shared/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; import { DQLParserVisitor } from './.generated/DQLParserVisitor'; -import { getUiService } from '../../services'; +import { getQueryService } from '../../services'; const findCursorIndex = ( tokenStream: TokenStream, @@ -132,7 +132,9 @@ export const getSuggestions = async ({ if ( !services || !services.appName || - !getUiService().Settings.supportsEnhancementsEnabled(services.appName) || + !getQueryService() + .queryString.getLanguageManager() + .supportsEnhancementsEnabled(services.appName) || !indexPattern ) { return []; diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 948bebed11ba..795a491c33ba 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -62,6 +62,7 @@ import { } from '../common'; import { FilterLabel } from './ui'; +export { createEditor, DefaultInput, DQLBody, SingleLineInput } from './ui'; import { generateFilters, diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 09bdd96d58e2..9f7cd0c2590e 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -119,7 +119,7 @@ export class DataPublicPlugin constructor(initializerContext: PluginInitializerContext) { this.searchService = new SearchService(initializerContext); this.uiService = new UiService(initializerContext); - this.queryService = new QueryService(); + this.queryService = new QueryService(initializerContext); this.fieldFormatsService = new FieldFormatsService(); this.autocomplete = new AutocompleteService(initializerContext); this.storage = createStorage({ engine: window.localStorage, prefix: 'opensearch_dashboards.' }); @@ -176,7 +176,8 @@ export class DataPublicPlugin query: queryService, __enhance: (enhancements: DataPublicPluginEnhancements) => { if (enhancements.search) searchService.__enhance(enhancements.search); - if (enhancements.ui) uiService.__enhance(enhancements.ui); + if (enhancements.ui) + queryService.queryString.getLanguageManager().__enhance(enhancements.ui); }, }; } diff --git a/src/plugins/data/public/query/query_service.ts b/src/plugins/data/public/query/query_service.ts index 17a7773567f3..28a8e4bae6a0 100644 --- a/src/plugins/data/public/query/query_service.ts +++ b/src/plugins/data/public/query/query_service.ts @@ -29,7 +29,11 @@ */ import { share } from 'rxjs/operators'; -import { IUiSettingsClient, SavedObjectsClientContract } from 'src/core/public'; +import { + IUiSettingsClient, + PluginInitializerContext, + SavedObjectsClientContract, +} from 'src/core/public'; import { FilterManager } from './filter_manager'; import { createAddToQueryLog } from './lib'; import { TimefilterService, TimefilterSetup } from './timefilter'; @@ -45,6 +49,7 @@ import { } from '../../common'; import { getUiSettings } from '../services'; import { IndexPattern } from '..'; +import { ConfigSchema } from '../../config'; /** * Query Service @@ -71,6 +76,8 @@ export class QueryService { state$!: ReturnType; + constructor(private initializerContext: PluginInitializerContext) {} + public setup({ storage, uiSettings }: QueryServiceSetupDependencies) { this.filterManager = new FilterManager(uiSettings); @@ -80,7 +87,9 @@ export class QueryService { storage, }); - this.queryStringManager = new QueryStringManager(storage, uiSettings); + const { enhancements: supportedAppNames } = this.initializerContext.config.get(); + + this.queryStringManager = new QueryStringManager(storage, uiSettings, supportedAppNames); this.dataSetManager = new DataSetManager(uiSettings); this.state$ = createQueryStateObservable({ diff --git a/src/plugins/data/public/ui/settings/settings.ts b/src/plugins/data/public/query/query_string/language_manager/language_manager.ts similarity index 71% rename from src/plugins/data/public/ui/settings/settings.ts rename to src/plugins/data/public/query/query_string/language_manager/language_manager.ts index 7fc758712ad2..8d7ee0f85efd 100644 --- a/src/plugins/data/public/ui/settings/settings.ts +++ b/src/plugins/data/public/query/query_string/language_manager/language_manager.ts @@ -4,11 +4,10 @@ */ import { BehaviorSubject } from 'rxjs'; -import { DataStorage, setOverrides as setFieldOverrides } from '../../../common'; -import { ConfigSchema } from '../../../config'; -import { ISearchStart } from '../../search'; -import { QueryEditorExtensionConfig } from '../query_editor/query_editor_extensions'; -import { QueryEnhancement } from '../types'; +import { QueryEnhancement, UiEnhancements } from '../../../ui/types'; +import { createEditor, DQLBody, QueryEditorExtensionConfig, SingleLineInput } from '../../../ui'; +import { ConfigSchema } from '../../../../config'; +import { DataStorage, setOverrides as setFieldOverrides } from '../../../../common'; export interface DataSettings { userQueryLanguage: string; @@ -22,21 +21,49 @@ export interface DataSettings { }; } -export class Settings { +export class LanguageManager { private isEnabled = false; private enabledQueryEnhancementsUpdated$ = new BehaviorSubject(this.isEnabled); private enhancedAppNames: string[] = []; + private queryEnhancements: Map; + private queryEditorExtensionMap: Record; constructor( private readonly config: ConfigSchema['enhancements'], - private readonly search: ISearchStart, - private readonly storage: DataStorage, - private readonly queryEnhancements: Map, - private readonly queryEditorExtensionMap: Record + private readonly storage: DataStorage ) { this.isEnabled = true; this.setUserQueryEnhancementsEnabled(this.isEnabled); this.enhancedAppNames = this.isEnabled ? this.config.supportedAppNames : []; + this.queryEnhancements = new Map(); + this.queryEditorExtensionMap = {}; + } + + public createDefaultQueryEditor() { + return createEditor(SingleLineInput, SingleLineInput, DQLBody); + } + + public __enhance = (enhancements: UiEnhancements) => { + if (!enhancements) return; + if (enhancements.query && enhancements.query.language) { + this.queryEnhancements.set(enhancements.query.language, enhancements.query); + } + if (enhancements.queryEditorExtension) { + this.queryEditorExtensionMap[enhancements.queryEditorExtension.id] = + enhancements.queryEditorExtension; + } + }; + + public getAllQueryEnhancements() { + return this.queryEnhancements; + } + + public getQueryEnhancements(language: string) { + return this.queryEnhancements.get(language); + } + + public getQueryEditorExtensionMap() { + return this.queryEditorExtensionMap; } supportsEnhancementsEnabled(appName: string) { @@ -58,18 +85,6 @@ export class Settings { return true; } - getAllQueryEnhancements() { - return this.queryEnhancements; - } - - getQueryEnhancements(language: string) { - return this.queryEnhancements.get(language); - } - - getQueryEditorExtensionMap() { - return this.queryEditorExtensionMap; - } - getUserQueryLanguageBlocklist() { return this.storage.get('userQueryLanguageBlocklist') || []; } @@ -87,18 +102,8 @@ export class Settings { } setUserQueryLanguage(language: string) { - if (language !== this.getUserQueryLanguage()) { - this.search.df.clear(); - } this.storage.set('userQueryLanguage', language); - const queryEnhancement = this.queryEnhancements.get(language); - this.search.__enhance({ - searchInterceptor: queryEnhancement - ? queryEnhancement.search - : this.search.getDefaultSearchInterceptor(), - }); this.setUiOverridesByUserQueryLanguage(language); - return true; } @@ -129,10 +134,10 @@ export class Settings { setUiOverridesByUserQueryLanguage(language: string) { const queryEnhancement = this.queryEnhancements.get(language); if (queryEnhancement) { - const { fields = {}, showDocLinks } = queryEnhancement; - this.setUiOverrides({ fields, showDocLinks }); + const { fields = {} } = queryEnhancement; + this.setUiOverrides({ fields }); } else { - this.setUiOverrides({ fields: undefined, showDocLinks: undefined }); + this.setUiOverrides({ fields: undefined }); } } @@ -167,20 +172,4 @@ export class Settings { } } -interface Deps { - config: ConfigSchema['enhancements']; - search: ISearchStart; - storage: DataStorage; - queryEnhancements: Map; - queryEditorExtensionMap: Record; -} - -export function createSettings({ - config, - search, - storage, - queryEnhancements, - queryEditorExtensionMap, -}: Deps) { - return new Settings(config, search, storage, queryEnhancements, queryEditorExtensionMap); -} +export type LanguageContract = PublicMethodsOf; diff --git a/src/plugins/data/public/query/query_string/query_string_manager.ts b/src/plugins/data/public/query/query_string/query_string_manager.ts index 98a348b58254..74598534394a 100644 --- a/src/plugins/data/public/query/query_string/query_string_manager.ts +++ b/src/plugins/data/public/query/query_string/query_string_manager.ts @@ -33,17 +33,22 @@ import { skip } from 'rxjs/operators'; import { CoreStart } from 'opensearch-dashboards/public'; import { DataStorage, Query, SimpleDataSet, TimeRange, UI_SETTINGS } from '../../../common'; import { createHistory, QueryHistory } from './query_history'; +import { LanguageManager } from './language_manager/language_manager'; +import { ConfigSchema } from '../../../config'; export class QueryStringManager { private query$: BehaviorSubject; private queryHistory: QueryHistory; + public languageManager: LanguageManager; constructor( private readonly storage: DataStorage, - private readonly uiSettings: CoreStart['uiSettings'] + private readonly uiSettings: CoreStart['uiSettings'], + private readonly supportedAppNames: ConfigSchema['enhancements'] ) { this.query$ = new BehaviorSubject(this.getDefaultQuery()); this.queryHistory = createHistory({ storage }); + this.languageManager = new LanguageManager(this.supportedAppNames, this.storage); } private getDefaultQueryString() { @@ -121,6 +126,10 @@ export class QueryStringManager { public changeQueryHistory(listener: (reqs: any[]) => void) { return this.queryHistory.change(listener); } + + public getLanguageManager() { + return this.languageManager; + } } export type QueryStringContract = PublicMethodsOf; diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index 5516b4abc79d..ea2c985d8493 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -64,7 +64,7 @@ import { createDataFrameCache, dataFrameToSpec, } from '../../common/data_frames'; -import { getQueryService, getUiService } from '../services'; +import { getQueryService } from '../services'; import { UI_SETTINGS } from '../../common'; /** @internal */ @@ -135,10 +135,10 @@ export class SearchService implements Plugin { { fieldFormats, indexPatterns }: SearchServiceStartDependencies ): ISearchStart { const search = ((request, options) => { + const queryString = getQueryService().queryString; const selectedLanguage = getQueryService().queryString.getQuery().language; - const uiService = getUiService(); - const enhancement = uiService.Settings.getQueryEnhancements(selectedLanguage); - uiService.Settings.setUiOverridesByUserQueryLanguage(selectedLanguage); + const enhancement = queryString.getLanguageManager().getQueryEnhancements(selectedLanguage); + queryString.getLanguageManager().setUiOverridesByUserQueryLanguage(selectedLanguage); const isEnhancedEnabled = uiSettings.get(UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED); if (enhancement) { diff --git a/src/plugins/data/public/ui/dataset_navigator/dataset_navigator.tsx b/src/plugins/data/public/ui/dataset_navigator/dataset_navigator.tsx index 4912abd92614..c8cbca9660fb 100644 --- a/src/plugins/data/public/ui/dataset_navigator/dataset_navigator.tsx +++ b/src/plugins/data/public/ui/dataset_navigator/dataset_navigator.tsx @@ -61,6 +61,7 @@ export const DataSetNavigator: React.FC = ({ }) => { const searchService = getSearchService(); const queryService = getQueryService(); + const languageManager = queryService.queryString.getLanguageManager(); const uiService = getUiService(); const indexPatternsService = getIndexPatterns(); const notifications = getNotifications(); @@ -107,14 +108,14 @@ export const DataSetNavigator: React.FC = ({ const selectedDataSet = ds ?? selectedDataSetState; if (!selectedDataSet || !selectedDataSet.id) return; - const language = uiService.Settings.getUserQueryLanguage(); - const queryEnhancements = uiService.Settings.getQueryEnhancements(language); + const language = languageManager.getUserQueryLanguage(); + const queryEnhancements = languageManager.getQueryEnhancements(language); const initialInput = queryEnhancements?.searchBar?.queryStringInput?.initialValue; const query = initialInput ? initialInput.replace('', selectedDataSet.title!) : ''; - uiService.Settings.setUserQueryString(query); + languageManager.setUserQueryString(query); queryService.queryString.setQuery({ query, language }); queryService.dataSetManager.setDataSet(selectedDataSet); @@ -143,7 +144,7 @@ export const DataSetNavigator: React.FC = ({ closePopover(); }, - [queryService, setSelectedDataSetState, selectedDataSetState, uiService.Settings] + [queryService, setSelectedDataSetState, selectedDataSetState, languageManager] ); useEffect(() => { diff --git a/src/plugins/data/public/ui/index.ts b/src/plugins/data/public/ui/index.ts index 400887e51d57..9df26c6bb8b4 100644 --- a/src/plugins/data/public/ui/index.ts +++ b/src/plugins/data/public/ui/index.ts @@ -28,14 +28,7 @@ * under the License. */ -export { - UiEnhancements, - IUiStart, - IUiSetup, - createSettings, - Settings, - DataSettings, -} from './types'; +export { UiEnhancements, IUiStart, IUiSetup } from './types'; export { IndexPatternSelectProps } from './index_pattern_select'; export { FilterLabel } from './filter_bar'; export { QueryStringInput, QueryStringInputProps } from './query_string_input'; @@ -46,6 +39,10 @@ export { QueryEditorExtensions, QueryEditorExtensionDependencies, QueryEditorExtensionConfig, + createEditor, + DefaultInput, + DQLBody, + SingleLineInput, } from './query_editor'; export { SearchBar, SearchBarProps, StatefulSearchBarProps } from './search_bar'; export { SuggestionsComponent } from './typeahead'; diff --git a/src/plugins/data/public/ui/query_editor/editors/default_editor/index.tsx b/src/plugins/data/public/ui/query_editor/editors/default_editor/index.tsx index 121049d36f13..e837b0e393f8 100644 --- a/src/plugins/data/public/ui/query_editor/editors/default_editor/index.tsx +++ b/src/plugins/data/public/ui/query_editor/editors/default_editor/index.tsx @@ -27,7 +27,7 @@ interface DefaultInputProps extends React.JSX.IntrinsicAttributes { provideCompletionItems: monaco.languages.CompletionItemProvider['provideCompletionItems']; } -const DefaultInput: React.FC = ({ +export const DefaultInput: React.FC = ({ languageId, value, onChange, @@ -95,5 +95,3 @@ const FooterItem: React.FC<{ item: FooterItem | string }> = ({ item }) => { ); }; - -export const createDefaultEditor = createEditor(SingleLineInput, null, DefaultInput); diff --git a/src/plugins/data/public/ui/query_editor/editors/dql_editor/index.tsx b/src/plugins/data/public/ui/query_editor/editors/dql_editor/index.tsx index b60ca7ee413b..721eb6fb67e9 100644 --- a/src/plugins/data/public/ui/query_editor/editors/dql_editor/index.tsx +++ b/src/plugins/data/public/ui/query_editor/editors/dql_editor/index.tsx @@ -4,12 +4,9 @@ */ import React from 'react'; -import { createEditor, SingleLineInput } from '../shared'; interface DQLBodyProps extends React.JSX.IntrinsicAttributes { filterBar?: any; } -const DQLBody: React.FC = ({ filterBar }) =>
{filterBar}
; - -export const createDQLEditor = createEditor(SingleLineInput, SingleLineInput, DQLBody); +export const DQLBody: React.FC = ({ filterBar }) =>
{filterBar}
; diff --git a/src/plugins/data/public/ui/query_editor/editors/shared.tsx b/src/plugins/data/public/ui/query_editor/editors/shared.tsx index ac41add330ee..23b46c22a48c 100644 --- a/src/plugins/data/public/ui/query_editor/editors/shared.tsx +++ b/src/plugins/data/public/ui/query_editor/editors/shared.tsx @@ -27,7 +27,7 @@ export interface Editor { Body: BodyComponent; } -interface EditorInstance { +export interface EditorInstance { TopBar: { Collapsed: () => React.ReactElement; Expanded: (() => React.ReactElement) | null; diff --git a/src/plugins/data/public/ui/query_editor/index.tsx b/src/plugins/data/public/ui/query_editor/index.tsx index 96584ebc9d8f..e852c8633550 100644 --- a/src/plugins/data/public/ui/query_editor/index.tsx +++ b/src/plugins/data/public/ui/query_editor/index.tsx @@ -30,3 +30,5 @@ export { QueryEditorExtensionDependencies, QueryEditorExtensionConfig, } from './query_editor_extensions'; + +export { createEditor, DefaultInput, DQLBody, SingleLineInput } from './editors'; diff --git a/src/plugins/data/public/ui/query_editor/language_selector.tsx b/src/plugins/data/public/ui/query_editor/language_selector.tsx index 455540d28df2..18a967c1f7c5 100644 --- a/src/plugins/data/public/ui/query_editor/language_selector.tsx +++ b/src/plugins/data/public/ui/query_editor/language_selector.tsx @@ -12,7 +12,7 @@ import { } from '@elastic/eui'; import { i18n } from '@osd/i18n'; import React, { useState } from 'react'; -import { getUiService } from '../../services'; +import { getQueryService } from '../../services'; export interface QueryLanguageSelectorProps { language: string; @@ -53,17 +53,16 @@ export const QueryLanguageSelector = (props: QueryLanguageSelectorProps) => { }, ]; - const uiService = getUiService(); + const queryService = getQueryService(); + const languageManager = queryService.queryString.getLanguageManager(); - const queryEnhancements = uiService.Settings.getAllQueryEnhancements(); + const queryEnhancements = languageManager.getAllQueryEnhancements(); queryEnhancements.forEach((enhancement) => { if ( (enhancement.supportedAppNames && props.appName && !enhancement.supportedAppNames.includes(props.appName)) || - uiService.Settings.getUserQueryLanguageBlocklist().includes( - enhancement.language.toLowerCase() - ) + languageManager.getUserQueryLanguageBlocklist().includes(enhancement.language.toLowerCase()) ) return; languageOptions.unshift(mapExternalLanguageToOptions(enhancement.language)); @@ -78,10 +77,10 @@ export const QueryLanguageSelector = (props: QueryLanguageSelectorProps) => { const handleLanguageChange = (newLanguage: string) => { props.onSelectLanguage(newLanguage); - uiService.Settings.setUserQueryLanguage(newLanguage); + languageManager.setUserQueryLanguage(newLanguage); }; - uiService.Settings.setUserQueryLanguage(props.language); + languageManager.setUserQueryLanguage(props.language); const languageOptionsMenu = languageOptions .sort((a, b) => { diff --git a/src/plugins/data/public/ui/query_editor/no_data_popover.tsx b/src/plugins/data/public/ui/query_editor/no_data_popover.tsx index 49490e258bf5..fb8e30ad180b 100644 --- a/src/plugins/data/public/ui/query_editor/no_data_popover.tsx +++ b/src/plugins/data/public/ui/query_editor/no_data_popover.tsx @@ -6,8 +6,8 @@ import { ReactElement, useEffect, useState } from 'react'; import React from 'react'; import { EuiButtonEmpty, EuiText, EuiTourStep } from '@elastic/eui'; -import { IStorageWrapper } from 'src/plugins/opensearch_dashboards_utils/public'; import { i18n } from '@osd/i18n'; +import { DataStorage } from 'src/plugins/data/common'; const NO_DATA_POPOVER_STORAGE_KEY = 'data.noDataPopover'; @@ -17,7 +17,7 @@ export function NoDataPopover({ children, }: { showNoDataPopover?: boolean; - storage: IStorageWrapper; + storage: DataStorage; children: ReactElement; }) { const [noDataPopoverDismissed, setNoDataPopoverDismissed] = useState(() => diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index 2238abbc5b1b..21b10589b8f2 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -8,19 +8,17 @@ import classNames from 'classnames'; import { isEqual } from 'lodash'; import React, { Component, createRef, RefObject } from 'react'; import { monaco } from '@osd/monaco'; -import { Settings } from '..'; import { IDataPluginServices, IFieldType, IIndexPattern, Query, TimeRange } from '../..'; import { OpenSearchDashboardsReactContextValue } from '../../../../opensearch_dashboards_react/public'; import { QuerySuggestion } from '../../autocomplete'; import { fromUser, getQueryLog, PersistedLog, toUser } from '../../query'; import { SuggestionsListSize } from '../typeahead/suggestions_component'; -import { DataSettings } from '../types'; import { QueryLanguageSelector } from './language_selector'; import { QueryEditorExtensions } from './query_editor_extensions'; import { QueryEditorBtnCollapse } from './query_editor_btn_collapse'; import { SimpleDataSet } from '../../../common'; -import { createDQLEditor, createDefaultEditor } from './editors'; import { getQueryService, getIndexPatterns } from '../../services'; +import { DataSettings } from '../../query/query_string/language_manager/language_manager'; const LANGUAGE_ID_SQL = 'SQL'; monaco.languages.register({ id: LANGUAGE_ID_SQL }); @@ -32,7 +30,6 @@ export interface QueryEditorProps { dataSet?: SimpleDataSet; query: Query; dataSetContainerRef?: React.RefCallback; - settings: Settings; disableAutoFocus?: boolean; screenTitle?: string; queryActions?: any; @@ -99,13 +96,14 @@ export default class QueryEditorUI extends Component { public inputRef: monaco.editor.IStandaloneCodeEditor | null = null; private queryService = getQueryService(); + private languageManager = this.queryService.queryString.getLanguageManager(); private persistedLog: PersistedLog | undefined; private abortController?: AbortController; private services = this.props.opensearchDashboards.services; private headerRef: RefObject = createRef(); private bannerRef: RefObject = createRef(); - private extensionMap = this.props.settings?.getQueryEditorExtensionMap(); + private extensionMap = this.languageManager.getQueryEditorExtensionMap(); private getQueryString = () => { if (!this.props.query.query) { @@ -198,24 +196,25 @@ export default class QueryEditorUI extends Component { language, }; - const enhancement = this.props.settings.getQueryEnhancements(newQuery.language); + const enhancement = this.languageManager.getQueryEnhancements(newQuery.language); const fields = enhancement?.fields; const newSettings: DataSettings = { userQueryLanguage: newQuery.language, userQueryString: newQuery.query, ...(fields && { uiOverrides: { fields } }), }; - this.props.settings?.updateSettings(newSettings); - - const dateRangeEnhancement = enhancement?.searchBar?.dateRange; - const dateRange = dateRangeEnhancement - ? { - from: dateRangeEnhancement.initialFrom!, - to: dateRangeEnhancement.initialTo!, - } - : undefined; - this.onChange(newQuery, dateRange); - this.onSubmit(newQuery, dateRange); + this.languageManager.updateSettings(newSettings); + + // TODO: confirm if this is needed + // const dateRangeEnhancement = enhancement?.searchBar?.dateRange; + // const dateRange = dateRangeEnhancement + // ? { + // from: dateRangeEnhancement.initialFrom!, + // to: dateRangeEnhancement.initialTo!, + // } + // : undefined; + this.onChange(newQuery); + this.onSubmit(newQuery); }; private initPersistedLog = () => { @@ -304,9 +303,6 @@ export default class QueryEditorUI extends Component { public render() { const className = classNames(this.props.className); - const useQueryEditor = - this.props.query.language !== 'kuery' && this.props.query.language !== 'lucene'; - const languageSelector = ( { provideCompletionItems: this.provideCompletionItems, }; - const languageEditor = useQueryEditor - ? createDefaultEditor(singleLineInputProps, {}, defaultInputProps) - : createDQLEditor(singleLineInputProps, singleLineInputProps, { + const languageEditor = this.languageManager.getQueryEnhancements(this.props.query.language) + ?.editor; + + const defaultLanguageEditor = this.languageManager.createDefaultQueryEditor(); + + // const languageEditor = useQueryEditor + // ? createDefaultEditor(singleLineInputProps, {}, defaultInputProps) + // : createDQLEditor(singleLineInputProps, singleLineInputProps, { + // filterBar: this.props.filterBar, + // }); + + const TopBar = languageEditor + ? languageEditor(singleLineInputProps, {}, defaultInputProps).TopBar + : defaultLanguageEditor(singleLineInputProps, singleLineInputProps, { filterBar: this.props.filterBar, - }); + }).TopBar; + + const Body = languageEditor + ? languageEditor(singleLineInputProps, {}, defaultInputProps).Body + : defaultLanguageEditor(singleLineInputProps, singleLineInputProps, { + filterBar: this.props.filterBar, + }).Body; return (
{ className, 'osdQueryEditor', this.state.isCollapsed ? 'collapsed' : 'expanded', - !languageEditor.TopBar.Expanded && 'emptyExpanded' + !TopBar.Expanded && 'emptyExpanded' )} >
{ />
- {this.state.isCollapsed - ? languageEditor.TopBar.Collapsed() - : languageEditor.TopBar.Expanded && languageEditor.TopBar.Expanded()} + {this.state.isCollapsed ? TopBar.Collapsed() : TopBar.Expanded && TopBar.Expanded()}
{languageSelector} {this.props.queryActions} @@ -406,173 +417,7 @@ export default class QueryEditorUI extends Component { ref={this.headerRef} className={classNames('osdQueryEditor__header', this.props.headerClassName)} /> - {!this.state.isCollapsed && ( -
{languageEditor.Body()}
- )} - - {/* - - - - this.setState({ isCollapsed: !this.state.isCollapsed })} - isCollapsed={!this.state.isCollapsed} - /> - - -
- - - - {(this.state.isCollapsed || !useQueryEditor) && ( - -
- -
-
- )} - {!useQueryEditor && ( - - - - )} -
-
- - {this.props.prepend} - - - - - - {!this.state.isCollapsed && useQueryEditor && ( - - )} - -
- - {languageSelector} - - - {this.state.lineCount} {this.state.lineCount === 1 ? 'line' : 'lines'} - - - {typeof this.props.indexPatterns?.[0] !== 'string' && - '@' + this.props.indexPatterns?.[0].timeFieldName} - - -
-
- - {!this.state.isCollapsed && ( - -
{this.props.filterBar}
-
- )} - */} + {!this.state.isCollapsed &&
{Body()}
} {this.renderQueryEditorExtensions()}
); diff --git a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx index 4621944ecce3..de22f76e4c67 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_top_row.tsx @@ -23,7 +23,6 @@ import { } from '../../../../opensearch_dashboards_react/public'; import { UI_SETTINGS } from '../../../common'; import { getQueryLog, PersistedLog } from '../../query'; -import { Settings } from '../types'; import { NoDataPopover } from './no_data_popover'; import QueryEditorUI from './query_editor'; import { useDataSetManager } from '../search_bar/lib/use_dataset_manager'; @@ -34,7 +33,6 @@ const QueryEditor = withOpenSearchDashboards(QueryEditorUI); export interface QueryEditorTopRowProps { query?: Query; dataSetContainerRef?: React.RefCallback; - settings?: Settings; onSubmit: (payload: { dateRange: TimeRange; query?: Query }) => void; onChange: (payload: { dateRange: TimeRange; query?: Query }) => void; onRefresh?: (payload: { dateRange: TimeRange }) => void; @@ -71,7 +69,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { storage, appName, data: { - query: { dataSetManager: dataSetManager }, + query: { dataSetManager: dataSetManager, queryString }, }, } = opensearchDashboards.services; const { dataSet } = useDataSetManager({ dataSetManager: dataSetManager! }); @@ -79,8 +77,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { const queryLanguage = props.query && props.query.language; const queryUiEnhancement = (queryLanguage && - props.settings && - props.settings.getQueryEnhancements(queryLanguage)?.searchBar) || + queryString.getLanguageManager().getQueryEnhancements(queryLanguage)?.searchBar) || null; const parsedQuery = !queryUiEnhancement || isValidQuery(props.query) @@ -196,9 +193,8 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { } function getQueryStringInitialValue(language: string) { - const { settings } = props; - const input = settings?.getQueryEnhancements(language)?.searchBar?.queryStringInput - ?.initialValue; + const input = queryString.getLanguageManager().getQueryEnhancements(language)?.searchBar + ?.queryStringInput?.initialValue; if (!input) return ''; @@ -215,7 +211,6 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { queryActions={props.prepend} query={parsedQuery} dataSetContainerRef={props.dataSetContainerRef} - settings={props.settings!} screenTitle={props.screenTitle} onChange={onQueryChange} onChangeQueryEditorFocus={onChangeQueryEditorFocus} @@ -255,7 +250,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { } function shouldRenderQueryEditor(): boolean { - return Boolean(props.showQueryEditor && props.settings && props.query && storage); + return Boolean(props.showQueryEditor && props.query && storage); } function renderUpdateButton() { diff --git a/src/plugins/data/public/ui/search_bar/create_search_bar.tsx b/src/plugins/data/public/ui/search_bar/create_search_bar.tsx index 675f6cdc5791..3a3d2e1871a2 100644 --- a/src/plugins/data/public/ui/search_bar/create_search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/create_search_bar.tsx @@ -40,13 +40,11 @@ import { useSavedQuery } from './lib/use_saved_query'; import { DataPublicPluginStart } from '../../types'; import { DataStorage, Filter, Query, TimeRange } from '../../../common'; import { useQueryStringManager } from './lib/use_query_string_manager'; -import { Settings } from '../types'; interface StatefulSearchBarDeps { core: CoreStart; data: Omit; storage: DataStorage; - settings: Settings; setDataSetContainerRef: (ref: HTMLDivElement | null) => void; } @@ -136,7 +134,6 @@ export function createSearchBar({ core, storage, data, - settings, setDataSetContainerRef, }: StatefulSearchBarDeps) { // App name should come from the core application service. @@ -217,7 +214,6 @@ export function createSearchBar({ isRefreshPaused={refreshInterval.pause} filters={filters} query={query} - settings={settings} dataSetContainerRef={dataSetContainerRef} onFiltersUpdated={defaultFiltersUpdated(data.query)} onRefreshChange={defaultOnRefreshChange(data.query)} diff --git a/src/plugins/data/public/ui/search_bar/search_bar.tsx b/src/plugins/data/public/ui/search_bar/search_bar.tsx index fd8ff3dc21c1..9432afcdceb2 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.tsx @@ -44,7 +44,6 @@ import { FilterBar } from '../filter_bar/filter_bar'; import { QueryEditorTopRow } from '../query_editor'; import QueryBarTopRow from '../query_string_input/query_bar_top_row'; import { SavedQueryMeta, SaveQueryForm } from '../saved_query_form'; -import { Settings } from '../types'; import { FilterOptions } from '../filter_bar/filter_options'; interface SearchBarInjectedDeps { @@ -78,7 +77,6 @@ export interface SearchBarOwnProps { datePickerRef?: React.RefObject; // Query bar - should be in SearchBarInjectedDeps query?: Query; - settings?: Settings; dataSetContainerRef?: React.RefCallback; // Show when user has privileges to save showSaveQuery?: boolean; @@ -208,7 +206,9 @@ class SearchBarUI extends Component { }; private supportsEnhancements() { - return this.props.settings?.supportsEnhancementsEnabled(this.services.appName); + return this.queryStringService + .getLanguageManager() + .supportsEnhancementsEnabled(this.services.appName); } private shouldRenderQueryEditor(isEnhancementsEnabledOverride: boolean) { @@ -238,8 +238,9 @@ class SearchBarUI extends Component { (!this.useNewHeader || this.props.filters.length > 0) && this.props.indexPatterns && compact(this.props.indexPatterns).length > 0 && - (this.props.settings?.getQueryEnhancements(this.state.query?.language!)?.searchBar - ?.showFilterBar ?? + (this.queryStringService + .getLanguageManager() + .getQueryEnhancements(this.state.query?.language!)?.searchBar?.showFilterBar ?? true) ); } @@ -250,12 +251,36 @@ class SearchBarUI extends Component { */ private shouldRenderTimeFilterInSavedQueryForm() { const { dateRangeFrom, dateRangeTo, showDatePicker } = this.props; + const enhancement = this.queryStringService + .getLanguageManager() + .getQueryEnhancements(this.state.query?.language!); + + // if it is an enhanced language, check the filterable field + if (enhancement) { + return enhancement.fields?.filterable; + } + + // otherwise, check if showDatePicker is enabled return ( showDatePicker || (!showDatePicker && dateRangeFrom !== undefined && dateRangeTo !== undefined) ); } + private shouldRenderFilterInSavedQueryForm() { + const enhancement = this.queryStringService + .getLanguageManager() + .getQueryEnhancements(this.state.query?.language!); + + // if it is an enhanced language, check the filterable field + if (enhancement) { + return enhancement.fields?.filterable; + } + + // otherwise, check if filters are enabled + return this.props.showFilterBar; + } + public setFilterBarHeight = () => { requestAnimationFrame(() => { const height = @@ -418,10 +443,14 @@ class SearchBarUI extends Component { this.supportsEnhancements() && this.services.uiSettings.get(UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED); - this.props.settings?.setUserQueryLanguageBlocklist( - this.services.uiSettings.get(UI_SETTINGS.SEARCH_QUERY_LANGUAGE_BLOCKLIST) - ); - this.props.settings?.setUserQueryEnhancementsEnabled(isEnhancementsEnabledOverride); + this.queryStringService + .getLanguageManager() + .setUserQueryLanguageBlocklist( + this.services.uiSettings.get(UI_SETTINGS.SEARCH_QUERY_LANGUAGE_BLOCKLIST) + ); + this.queryStringService + .getLanguageManager() + .setUserQueryEnhancementsEnabled(isEnhancementsEnabledOverride); const searchBarMenu = (useSaveQueryMenu: boolean = false) => { return ( @@ -513,7 +542,6 @@ class SearchBarUI extends Component { { savedQueryService={this.savedQueryService} onSave={this.onSave} onClose={() => this.setState({ showSaveQueryModal: false })} - showFilterOption={this.props.showFilterBar} + showFilterOption={this.shouldRenderFilterInSavedQueryForm()} showTimeFilterOption={this.shouldRenderTimeFilterInSavedQueryForm()} /> ) : null} @@ -565,7 +593,7 @@ class SearchBarUI extends Component { savedQueryService={this.savedQueryService} onSave={(savedQueryMeta) => this.onSave(savedQueryMeta, true)} onClose={() => this.setState({ showSaveNewQueryModal: false })} - showFilterOption={this.props.showFilterBar} + showFilterOption={this.shouldRenderFilterInSavedQueryForm()} showTimeFilterOption={this.shouldRenderTimeFilterInSavedQueryForm()} /> ) : null} diff --git a/src/plugins/data/public/ui/settings/index.ts b/src/plugins/data/public/ui/settings/index.ts deleted file mode 100644 index cb6d9d1c8925..000000000000 --- a/src/plugins/data/public/ui/settings/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -export { Settings, DataSettings, createSettings } from './settings'; diff --git a/src/plugins/data/public/ui/settings/mocks.ts b/src/plugins/data/public/ui/settings/mocks.ts deleted file mode 100644 index 353fa29f90b6..000000000000 --- a/src/plugins/data/public/ui/settings/mocks.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { Settings } from './settings'; - -export class SettingsMock extends Settings { - getUserQueryLanguage = jest.fn(); - setUserQueryLanguage = jest.fn(); - getUserQueryString = jest.fn(); - setUserQueryString = jest.fn(); - getUiOverrides = jest.fn(); - setUiOverrides = jest.fn(); - setUiOverridesByUserQueryLanguage = jest.fn(); - toJSON = jest.fn(); - updateSettings = jest.fn(); -} diff --git a/src/plugins/data/public/ui/types.ts b/src/plugins/data/public/ui/types.ts index 268e274c199d..6c4b94aa9bad 100644 --- a/src/plugins/data/public/ui/types.ts +++ b/src/plugins/data/public/ui/types.ts @@ -9,39 +9,27 @@ import { DataSetNavigatorProps } from './dataset_navigator'; import { IndexPatternSelectProps } from './index_pattern_select'; import { StatefulSearchBarProps } from './search_bar'; import { QueryEditorExtensionConfig } from './query_editor/query_editor_extensions'; -import { Settings } from './settings'; import { SuggestionsComponentProps } from './typeahead/suggestions_component'; - -export * from './settings'; +import { EditorInstance } from './query_editor/editors'; export interface QueryEnhancement { - // TODO: MQL do want to default have supported all data_sources? - // or should data connect have a record of query enhancements that are supported language: string; search: SearchInterceptor; - // Leave blank to support all data sources - // supportedDataSourceTypes?: Record; - searchBar?: { - showDataSetsSelector?: boolean; - showDataSourcesSelector?: boolean; - showQueryInput?: boolean; - showFilterBar?: boolean; - showDatePicker?: boolean; - showAutoRefreshOnly?: boolean; - queryStringInput?: { + editor: ( + collapsedProps: any, + expandedProps: any, + bodyProps: any + ) => EditorInstance; + meta?: { + queryStringInput: { // will replace '' with the data source name - initialValue?: string; - }; - dateRange?: { - initialFrom?: string; - initialTo?: string; + initialValue: string; }; }; fields?: { - filterable?: boolean; visualizable?: boolean; + filterable?: boolean; }; - showDocLinks?: boolean; // List of supported app names that this enhancement should be enabled for, // if not provided it will be enabled for all apps supportedAppNames?: string[]; @@ -71,9 +59,5 @@ export interface IUiStart { DataSetNavigator: React.ComponentType; SearchBar: React.ComponentType; SuggestionsComponent: React.ComponentType; - /** - * @experimental - Subject to change - */ - Settings: Settings; dataSetContainer$: Observable; } diff --git a/src/plugins/data/public/ui/ui_service.ts b/src/plugins/data/public/ui/ui_service.ts index 1802e3b79320..8be08227aaac 100644 --- a/src/plugins/data/public/ui/ui_service.ts +++ b/src/plugins/data/public/ui/ui_service.ts @@ -9,11 +9,9 @@ import { ConfigSchema } from '../../config'; import { DataPublicPluginStart } from '../types'; import { createDataSetNavigator } from './dataset_navigator'; import { createIndexPatternSelect } from './index_pattern_select'; -import { QueryEditorExtensionConfig } from './query_editor'; import { createSearchBar } from './search_bar/create_search_bar'; -import { createSettings } from './settings'; import { SuggestionsComponent } from './typeahead'; -import { IUiSetup, IUiStart, QueryEnhancement, UiEnhancements } from './types'; +import { IUiSetup, IUiStart } from './types'; import { DataStorage } from '../../common'; /** @internal */ @@ -28,8 +26,6 @@ export interface UiServiceStartDependencies { export class UiService implements Plugin { enhancementsConfig: ConfigSchema['enhancements']; - private queryEnhancements: Map = new Map(); - private queryEditorExtensionMap: Record = {}; private dataSetContainer$ = new BehaviorSubject(null); constructor(initializerContext: PluginInitializerContext) { @@ -38,30 +34,9 @@ export class UiService implements Plugin { this.enhancementsConfig = enhancements; } - public setup(core: CoreSetup, {}: UiServiceSetupDependencies): IUiSetup { - return { - __enhance: (enhancements?: UiEnhancements) => { - if (!enhancements) return; - if (enhancements.query && enhancements.query.language) { - this.queryEnhancements.set(enhancements.query.language, enhancements.query); - } - if (enhancements.queryEditorExtension) { - this.queryEditorExtensionMap[enhancements.queryEditorExtension.id] = - enhancements.queryEditorExtension; - } - }, - }; - } + public setup(core: CoreSetup, {}: UiServiceSetupDependencies): any {} public start(core: CoreStart, { dataServices, storage }: UiServiceStartDependencies): IUiStart { - const Settings = createSettings({ - config: this.enhancementsConfig, - search: dataServices.search, - storage, - queryEnhancements: this.queryEnhancements, - queryEditorExtensionMap: this.queryEditorExtensionMap, - }); - const setDataSetContainerRef = (ref: HTMLDivElement | null) => { this.dataSetContainer$.next(ref); }; @@ -70,7 +45,6 @@ export class UiService implements Plugin { core, data: dataServices, storage, - settings: Settings, setDataSetContainerRef, }); @@ -83,7 +57,6 @@ export class UiService implements Plugin { ), SearchBar, SuggestionsComponent, - Settings, dataSetContainer$: this.dataSetContainer$, }; } diff --git a/src/plugins/data_explorer/public/components/sidebar/index.tsx b/src/plugins/data_explorer/public/components/sidebar/index.tsx index 616be16e9f56..e1303fcf9bb5 100644 --- a/src/plugins/data_explorer/public/components/sidebar/index.tsx +++ b/src/plugins/data_explorer/public/components/sidebar/index.tsx @@ -24,7 +24,12 @@ export const Sidebar: FC = ({ children }) => { const { services: { - data: { indexPatterns, dataSources, ui }, + data: { + indexPatterns, + dataSources, + ui, + query: { queryString }, + }, notifications: { toasts }, application, }, @@ -33,16 +38,17 @@ export const Sidebar: FC = ({ children }) => { const { DataSetNavigator } = ui; useEffect(() => { - const subscriptions = ui.Settings.getEnabledQueryEnhancementsUpdated$().subscribe( - (enabledQueryEnhancements) => { + const subscriptions = queryString + .getLanguageManager() + .getEnabledQueryEnhancementsUpdated$() + .subscribe((enabledQueryEnhancements) => { setIsEnhancementsEnabled(enabledQueryEnhancements); - } - ); + }); return () => { subscriptions.unsubscribe(); }; - }, [ui.Settings]); + }, [queryString]); const setContainerRef = useCallback((uiContainerRef) => { uiContainerRef.appendChild(containerRef.current); diff --git a/src/plugins/query_enhancements/public/plugin.tsx b/src/plugins/query_enhancements/public/plugin.tsx index ccc00822c1a1..06f1cd0d9000 100644 --- a/src/plugins/query_enhancements/public/plugin.tsx +++ b/src/plugins/query_enhancements/public/plugin.tsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import moment from 'moment'; import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '../../../core/public'; import { IStorageWrapper, Storage } from '../../opensearch_dashboards_utils/public'; import { ConfigSchema } from '../common/config'; @@ -17,6 +16,7 @@ import { QueryEnhancementsPluginStartDependencies, } from './types'; import { UI_SETTINGS } from '../common'; +import { createEditor, DefaultInput, SingleLineInput } from '../../data/public'; export class QueryEnhancementsPlugin implements @@ -67,26 +67,21 @@ export class QueryEnhancementsPlugin usageCollector: data.search.usageCollector, }); + const enhancedQueryEditor = createEditor(SingleLineInput, null, DefaultInput); + data.__enhance({ ui: { query: { language: 'PPL', search: pplSearchInterceptor, - searchBar: { + editor: enhancedQueryEditor, + meta: { queryStringInput: { initialValue: 'source=' }, - dateRange: { - initialFrom: moment().subtract(2, 'days').toISOString(), - initialTo: moment().add(2, 'days').toISOString(), - }, - showFilterBar: false, - showDataSetsSelector: true, - showDataSourcesSelector: true, }, fields: { - filterable: false, visualizable: false, + filterable: false, }, - showDocLinks: false, supportedAppNames: ['discover'], }, }, @@ -97,18 +92,14 @@ export class QueryEnhancementsPlugin query: { language: 'SQL', search: sqlSearchInterceptor, - searchBar: { - showDatePicker: false, - showFilterBar: false, - showDataSetsSelector: true, - showDataSourcesSelector: true, + editor: enhancedQueryEditor, + meta: { queryStringInput: { initialValue: 'SELECT * FROM LIMIT 10' }, }, fields: { - filterable: false, visualizable: false, + filterable: false, }, - showDocLinks: false, supportedAppNames: ['discover'], }, }, diff --git a/yarn.lock b/yarn.lock index e3cacd0f1623..a8d9af23c63e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15986,7 +15986,7 @@ string-similarity@^4.0.1: resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b" integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16021,15 +16021,6 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -16108,7 +16099,7 @@ stringify-entities@^3.0.1: character-entities-legacy "^1.0.0" xtend "^4.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -16150,13 +16141,6 @@ strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -18300,7 +18284,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18326,15 +18310,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"