Skip to content

Commit

Permalink
Merge branch 'type-imports-eslint-ro-3' of https://github.com/georgia…
Browse files Browse the repository at this point in the history
…naonoleata1904/kibana into type-imports-eslint-ro-3
  • Loading branch information
georgianaonoleata1904 committed Mar 3, 2025
2 parents f8f0c77 + da41282 commit 8ab563e
Show file tree
Hide file tree
Showing 21 changed files with 50 additions and 1,302 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/comment-on-asciidoc-changes.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: docs-build

on:
push:
branches:
- main
pull_request_target:
types:
- opened
- reopened
- synchronize

jobs:
docs-preview:
uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
with:
path-pattern: docs/**
permissions:
deployments: write
id-token: write
contents: read
pull-requests: read
14 changes: 14 additions & 0 deletions .github/workflows/docs-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: docs-cleanup

on:
pull_request_target:
types:
- closed

jobs:
docs-preview:
uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
permissions:
contents: none
id-token: write
deployments: write
1 change: 0 additions & 1 deletion src/platform/packages/shared/kbn-esql-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export {
isESQLColumnSortable,
isESQLColumnGroupable,
isESQLFieldGroupable,
TextBasedLanguages,
sanitazeESQLInput,
queryCannotBeSampled,
mapVariableToColumn,
Expand Down
1 change: 0 additions & 1 deletion src/platform/packages/shared/kbn-esql-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export { TextBasedLanguages } from './types';
export { getESQLAdHocDataview, getIndexForESQLQuery } from './utils/get_esql_adhoc_dataview';
export { getInitialESQLQuery } from './utils/get_initial_esql_query';
export { getESQLWithSafeLimit } from './utils/get_esql_with_safe_limit';
Expand Down
12 changes: 0 additions & 12 deletions src/platform/packages/shared/kbn-esql-utils/src/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,10 @@ describe('autocomplete', () => {
{ filterText: '_source', text: '_source, ', command: TRIGGER_SUGGESTION_COMMAND },
]);
// no comma if there are no more fields
testSuggestions('FROM a METADATA _id, _ignored, _index, _source, _index_mode, _version/', [
{ filterText: '_version', text: '_version | ', command: TRIGGER_SUGGESTION_COMMAND },
]);
testSuggestions(
'FROM a METADATA _id, _ignored, _index, _source, _index_mode, _score, _version/',
[{ filterText: '_version', text: '_version | ', command: TRIGGER_SUGGESTION_COMMAND }]
);
});

describe.each(['KEEP', 'DROP'])('%s <field>', (commandName) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ export const SINGLE_TICK_REGEX = /`/g;
export const DOUBLE_BACKTICK = '``';
export const SINGLE_BACKTICK = '`';

export const METADATA_FIELDS = ['_version', '_id', '_index', '_source', '_ignored', '_index_mode'];
export const METADATA_FIELDS = [
'_version',
'_id',
'_index',
'_source',
'_ignored',
'_index_mode',
'_score',
];

export const FULL_TEXT_SEARCH_FUNCTIONS = ['match', 'match_operator', 'qstr', 'kql'];
export const UNSUPPORTED_COMMANDS_BEFORE_QSTR = new Set([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { DataViewType } from '@kbn/data-views-plugin/public';
import type { DataViewPickerProps } from '@kbn/unified-search-plugin/public';
import { ENABLE_ESQL } from '@kbn/esql-utils';
import { TextBasedLanguages } from '@kbn/esql-utils';
import { DiscoverFlyouts, dismissAllFlyoutsExceptFor } from '@kbn/discover-utils';
import { useSavedSearchInitial } from '../../state_management/discover_state_provider';
import { ESQL_TRANSITION_MODAL_KEY } from '../../../../../common/constants';
Expand Down Expand Up @@ -49,8 +47,7 @@ export const DiscoverTopNav = ({
onCancelClick,
}: DiscoverTopNavProps) => {
const services = useDiscoverServices();
const { dataViewEditor, navigation, dataViewFieldEditor, data, uiSettings, setHeaderActionMenu } =
services;
const { dataViewEditor, navigation, dataViewFieldEditor, data, setHeaderActionMenu } = services;
const query = useAppStateSelector((state) => state.query);
const { savedDataViews, managedDataViews, adHocDataViews } =
useInternalStateSelector(selectDataViewsForPicker);
Expand Down Expand Up @@ -174,9 +171,6 @@ export const DiscoverTopNav = ({
);

const dataViewPickerProps: DataViewPickerProps = useMemo(() => {
const isESQLModeEnabled = uiSettings.get(ENABLE_ESQL);
const supportedTextBasedLanguages = isESQLModeEnabled ? [TextBasedLanguages.ESQL] : [];

return {
trigger: {
label: dataView?.getName() || '',
Expand All @@ -188,7 +182,6 @@ export const DiscoverTopNav = ({
onDataViewCreated: createNewDataView,
onCreateDefaultAdHocDataView: stateContainer.actions.createAndAppendAdHocDataView,
onChangeDataView: stateContainer.actions.onChangeDataView,
textBasedLanguages: supportedTextBasedLanguages,
adHocDataViews,
managedDataViews,
savedDataViews,
Expand All @@ -202,7 +195,6 @@ export const DiscoverTopNav = ({
managedDataViews,
savedDataViews,
stateContainer,
uiSettings,
]);

const onESQLDocsFlyoutVisibilityChanged = useCallback((isOpen: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
} as SearchBarProps)
)
Expand All @@ -595,7 +594,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
query: { esql: 'from dataview | project field1, field2' },
} as unknown as SearchBarProps<Query>)
Expand All @@ -612,7 +610,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
query: {
esql: 'from dataview | project field1, field2, field 3, field 4, field 5 | where field5 > 5 | stats var = avg(field3)',
Expand All @@ -631,7 +628,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
textBasedLanguageModeErrors: [
new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import React from 'react';
import type { EuiButtonProps, EuiSelectableProps } from '@elastic/eui';
import type { DataView, DataViewListItem, DataViewSpec } from '@kbn/data-views-plugin/public';
import { TextBasedLanguages } from '@kbn/esql-utils';
import { ChangeDataView } from './change_dataview';

export type ChangeDataViewTriggerProps = EuiButtonProps & {
Expand Down Expand Up @@ -69,12 +68,6 @@ export interface DataViewPickerProps {
onDataViewCreated?: () => void;

onCreateDefaultAdHocDataView?: (dataViewSpec: DataViewSpec) => void;
/**
* List of the supported text based languages (SQL, ESQL) etc.
* Defined per application, if not provided, no text based languages
* will be available.
*/
textBasedLanguages?: TextBasedLanguages[];
/**
* Makes the picker disabled by disabling the popover trigger
*/
Expand All @@ -93,7 +86,6 @@ export const DataViewPicker = ({
onDataViewCreated,
trigger,
selectableProps,
textBasedLanguages,
onCreateDefaultAdHocDataView,
isDisabled,
}: DataViewPickerProps) => {
Expand All @@ -111,7 +103,6 @@ export const DataViewPicker = ({
managedDataViews={managedDataViews}
savedDataViews={savedDataViews}
selectableProps={selectableProps}
textBasedLanguages={textBasedLanguages}
isDisabled={isDisabled}
/>
);
Expand Down
Loading

0 comments on commit 8ab563e

Please sign in to comment.