From 2eda3f86527fa9a4ddbd7e1316093c85c99f249b Mon Sep 17 00:00:00 2001 From: Suchit Sahoo Date: Thu, 12 Dec 2024 22:31:22 +0000 Subject: [PATCH] Add missing data-test-subj tags for data plugin Signed-off-by: Suchit Sahoo --- .../language_service/lib/query_result.tsx | 8 ++++- .../language_service/lib/recent_query.tsx | 1 + .../ui/dataset_selector/configurator.tsx | 2 +- .../ui/dataset_selector/dataset_explorer.tsx | 28 ++++++++++++--- .../ui/dataset_selector/dataset_selector.tsx | 13 +++++-- .../ui/dataset_selector/dataset_table.tsx | 4 +-- .../data/public/ui/filter_bar/filter_bar.tsx | 12 +++++-- .../ui/filter_bar/filter_editor/index.tsx | 2 +- .../editors/default_editor/index.tsx | 7 ++-- .../public/ui/query_editor/editors/shared.tsx | 7 ++-- .../ui/query_editor/language_selector.tsx | 1 + .../public/ui/query_editor/query_editor.tsx | 35 +++++++++++++++---- .../ui/query_editor/query_editor_top_row.tsx | 8 ++++- .../query_string_input/query_bar_top_row.tsx | 3 +- .../query_string_input/query_string_input.tsx | 1 + .../saved_query_flyouts/saved_query_card.tsx | 8 +++-- .../saved_query_list_item.tsx | 2 +- .../saved_query_management_component.tsx | 16 +++++++-- .../data/public/ui/search_bar/search_bar.tsx | 1 + .../shard_failure_description.tsx | 1 + .../shard_failure_description_header.tsx | 6 +++- .../ui/typeahead/suggestion_component.tsx | 6 ++-- 22 files changed, 137 insertions(+), 35 deletions(-) diff --git a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx index dff7faea36e3..f761c896e851 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx +++ b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx @@ -129,7 +129,12 @@ export function QueryResult(props: { queryStatus: QueryStatus }) { className="editor__footerItem" color="danger" > - + {i18n.translate('data.query.languageService.queryResults.error', { defaultMessage: `Error`, })} @@ -146,6 +151,7 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {

diff --git a/src/plugins/data/public/query/query_string/language_service/lib/recent_query.tsx b/src/plugins/data/public/query/query_string/language_service/lib/recent_query.tsx index 0b58f0413966..49f8b0647226 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/recent_query.tsx +++ b/src/plugins/data/public/query/query_string/language_service/lib/recent_query.tsx @@ -96,6 +96,7 @@ export function RecentQueriesTable({ rowProps={getRowProps} cellProps={getCellProps} className="recentQuery__table" + data-test-subj="recentQueryTable" tableLayout="fixed" compressed /> diff --git a/src/plugins/data/public/ui/dataset_selector/configurator.tsx b/src/plugins/data/public/ui/dataset_selector/configurator.tsx index 4906bec2ef84..56ec77efe784 100644 --- a/src/plugins/data/public/ui/dataset_selector/configurator.tsx +++ b/src/plugins/data/public/ui/dataset_selector/configurator.tsx @@ -187,7 +187,7 @@ export const Configurator = ({ - + - +

{current.columnHeader}

{current.multiSelect ? ( @@ -210,6 +214,7 @@ export const DatasetExplorer = ({ })} height="full" className="datasetExplorer__selectable" + data-test-subj="datasetExplorerSelectable" > {(list, search) => ( <> @@ -252,16 +257,29 @@ export const DatasetExplorer = ({ }; const EmptyColumn = () => ( -
+
); const LoadingEmptyColumn = ({ isLoading }: { isLoading: boolean }) => isLoading ? ( -
- +
+

...

- + {(list) => <>{list}}
diff --git a/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx b/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx index a88aea528e7e..02a65dbe3897 100644 --- a/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx +++ b/src/plugins/data/public/ui/dataset_selector/dataset_selector.tsx @@ -221,7 +221,11 @@ export const DatasetSelector = ({ iconSide="right" onClick={togglePopover} > - + {datasetTitle} @@ -234,6 +238,7 @@ export const DatasetSelector = ({ > )} - + = (props) => { }; return ( -
+
(searchRef.current = node)} @@ -93,7 +93,7 @@ export const DatasetTable: React.FC = (props) => { /> {paginationToken && ( -
+
onTableChange({ paginationToken, search: searchRef.current?.value })} > diff --git a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx index 26fb97606001..a1004758858e 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx @@ -190,10 +190,15 @@ function FilterBarUI(props: Props) { gutterSize="none" alignItems="flexStart" responsive={false} + data-test-subj="globalFilterGroup" > {useNewHeader ? ( - + {filterBarPrefixText}: ) : ( @@ -205,7 +210,10 @@ function FilterBarUI(props: Props) { /> )} - + { -
+
{this.renderIndexPatternInput()} 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 1eaf373f2c8e..55b19894d41e 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 @@ -33,7 +33,7 @@ export const DefaultInput: React.FC = ({ }) => { return (
-
+
= ({ }} triggerSuggestOnFocus={true} /> -
+
{footerItems && ( {footerItems.start?.map((item, idx) => ( {item} @@ -92,6 +94,7 @@ export const DefaultInput: React.FC = ({ key={`defaultEditor__footerItem-end-${idx}`} grow={false} className="defaultEditor__footerItem" + data-test-subj="defaultEditorFooterEndItem" > {item} 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 fb5df10c65c9..a7caa780f631 100644 --- a/src/plugins/data/public/ui/query_editor/editors/shared.tsx +++ b/src/plugins/data/public/ui/query_editor/editors/shared.tsx @@ -96,7 +96,10 @@ export const SingleLineInput: React.FC = ({ ); return ( -
+
{prepend}
= ({ triggerSuggestOnFocus={true} /> {editorIsFocused && ( -
+
{footerItems && ( {footerItems.start?.map((item) => ( 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 0177ede6f7fb..e1168849b9fa 100644 --- a/src/plugins/data/public/ui/query_editor/language_selector.tsx +++ b/src/plugins/data/public/ui/query_editor/language_selector.tsx @@ -117,6 +117,7 @@ export const QueryLanguageSelector = (props: QueryLanguageSelectorProps) => { handleLanguageChange(language.value)} > 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 20650cca6acc..af9d67ad62ae 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -309,7 +309,12 @@ export const QueryEditorUI: React.FC = (props) => { }, footerItems: { start: [ - + {`${lineCount} ${lineCount === 1 ? 'line' : 'lines'}`} , = (props) => { size="xs" onClick={toggleRecentQueries} className="queryEditor__footerItem" + data-test-subj="queryEditorFooterToggleRecentQueriesButton" > {'Recent queries'} @@ -362,10 +368,20 @@ export const QueryEditorUI: React.FC = (props) => { prepend: props.prepend, footerItems: { start: [ - + {`${lineCount ?? 1} ${lineCount === 1 || !lineCount ? 'line' : 'lines'}`} , - + {query.dataset?.timeFieldName || ''} , , @@ -378,6 +394,7 @@ export const QueryEditorUI: React.FC = (props) => { size="xs" onClick={toggleRecentQueries} className="queryEditor__footerItem" + data-test-subj="queryEditorFooterToggleRecentQueriesButton" flush="both" > @@ -409,16 +426,20 @@ export const QueryEditorUI: React.FC = (props) => { ref={bannerRef} className={classNames('osdQueryEditor__banner', props.bannerClassName)} /> -
-
+
+
{isCollapsed ? languageEditor.TopBar.Collapsed() : languageEditor.TopBar.Expanded && languageEditor.TopBar.Expanded()}
{languageSelector} -
+
-
+
{renderQueryControls(languageEditor.TopBar.Controls)} {!languageEditor.TopBar.Expanded && renderToggleIcon()} {props.savedQueryManagement} 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 ad22750207ed..24d79a277e75 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 @@ -199,6 +199,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { onSubmit={onInputSubmit} persistedLog={persistedLog} className="osdQueryEditor" + data-test-subj="osdQueryEditor" dataTestSubj={props.dataTestSubj} filterBar={props.filterBar} savedQueryManagement={props.savedQueryManagement} @@ -357,6 +358,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { dateFormat={uiSettings!.get('dateFormat')} isAutoRefreshOnly={props.showAutoRefreshOnly} className="osdQueryEditor__datePicker" + data-test-subj="osdQueryEditorDatePicker" compressed={true} /> @@ -369,7 +371,11 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { const datePicker = ( - + {renderUpdateButton()} diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx index 45e718fd52ba..63cd290273bb 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx @@ -321,6 +321,7 @@ export default function QueryBarTopRow(props: QueryBarTopRowProps) { dateFormat={uiSettings!.get('dateFormat')} isAutoRefreshOnly={props.showAutoRefreshOnly} className="osdQueryBar__datePicker" + data-test-subj="osdQueryBarDatePicker" compressed={true} /> @@ -402,7 +403,7 @@ export default function QueryBarTopRow(props: QueryBarTopRowProps) { > {renderQueryInput()} {renderSharingMetaFields()} - + {shouldUseDatePickerRef ? createPortal(renderUpdateButton(), props.datePickerRef!.current!) : renderUpdateButton()} diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx index b94c38d0f15e..0bfb22db75ba 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx @@ -638,6 +638,7 @@ export default class QueryStringInputUI extends Component {
-
+
{shouldTruncate && (
- + {i18n.translate('data.saved_query.view_more_label', { defaultMessage: '{viewMoreLabel}', values: { diff --git a/src/plugins/data/public/ui/saved_query_management/saved_query_list_item.tsx b/src/plugins/data/public/ui/saved_query_management/saved_query_list_item.tsx index 8e015adf1eb5..ccc801ce60e1 100644 --- a/src/plugins/data/public/ui/saved_query_management/saved_query_list_item.tsx +++ b/src/plugins/data/public/ui/saved_query_management/saved_query_list_item.tsx @@ -76,7 +76,7 @@ export const SavedQueryListItem = ({ }); const label = ( - + {savedQuery.attributes.title}{' '} {savedQuery.attributes.description && ( {savedQueries.length > 0 ? ( - +

{savedQueryDescriptionText}

{savedQueryRows()} @@ -288,6 +294,7 @@ export function SavedQueryManagementComponent({
) : ( - +

{noSavedQueriesDescriptionText}

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 251a0dc86fa0..325f475d1f57 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.tsx @@ -489,6 +489,7 @@ class SearchBarUI extends Component { > diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description_header.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description_header.tsx index 461571975b7c..5dd6bb9b64bc 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description_header.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description_header.tsx @@ -62,7 +62,11 @@ export function getFailureSummaryDetailsText(failure: ShardFailure): string { export function ShardFailureDescriptionHeader(props: ShardFailure) { const failureDetails = getFailurePropsForSummary(props).map((kv) => ( - + {kv.key} {kv.value} )); diff --git a/src/plugins/data/public/ui/typeahead/suggestion_component.tsx b/src/plugins/data/public/ui/typeahead/suggestion_component.tsx index 67243df6415a..b3e1f75dc2b4 100644 --- a/src/plugins/data/public/ui/typeahead/suggestion_component.tsx +++ b/src/plugins/data/public/ui/typeahead/suggestion_component.tsx @@ -87,14 +87,16 @@ export function SuggestionComponent(props: Props) { }-${props.suggestion.text.replace(/\s/g, '-')}`} >
-
+
{props.suggestion.text}
{props.shouldDisplayDescription && ( -
{props.suggestion.description}
+
+ {props.suggestion.description} +
)}