[Unified search] Improve the saved query terminology (#154517)

## Summary

Introduces the changes that are mentioned here
https://github.com/elastic/kibana/issues/153809#issuecomment-1498015527

<img width="481" alt="image"
src="https://user-images.githubusercontent.com/17003240/230306087-6e82bca8-a5c0-4a13-b7d1-b04fca8ac374.png">
<img width="460" alt="image"
src="https://user-images.githubusercontent.com/17003240/230306169-ece13204-da76-495e-b258-4bfea0877118.png">
<img width="315" alt="image"
src="https://user-images.githubusercontent.com/17003240/230306267-955161c4-a5cf-4427-beef-b768dea38c00.png">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Stratoula Kalafateli 2023-04-11 09:15:50 +03:00 committed by GitHub
parent a04b90017a
commit c23eceaa2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 26 deletions

View file

@ -63,11 +63,11 @@ export const strings = {
}),
getLoadOtherFilterSetLabel: () =>
i18n.translate('unifiedSearch.filter.options.loadOtherFilterSetLabel', {
defaultMessage: 'Load other saved query',
defaultMessage: 'Load a different query',
}),
getLoadCurrentFilterSetLabel: () =>
i18n.translate('unifiedSearch.filter.options.loadCurrentFilterSetLabel', {
defaultMessage: 'Load saved query',
defaultMessage: 'Load query',
}),
getSaveAsNewFilterSetLabel: () =>
i18n.translate('unifiedSearch.filter.options.saveAsNewFilterSetLabel', {
@ -75,16 +75,12 @@ export const strings = {
}),
getSaveFilterSetLabel: () =>
i18n.translate('unifiedSearch.filter.options.saveFilterSetLabel', {
defaultMessage: 'Save saved query',
defaultMessage: 'Save query',
}),
getClearllFiltersButtonLabel: () =>
i18n.translate('unifiedSearch.filter.options.clearllFiltersButtonLabel', {
defaultMessage: 'Clear all',
}),
getSavedQueryLabel: () =>
i18n.translate('unifiedSearch.search.searchBar.savedQuery', {
defaultMessage: 'Saved query',
}),
getSavedQueryPopoverSaveChangesButtonAriaLabel: (title?: string) =>
i18n.translate('unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonAriaLabel', {
defaultMessage: 'Save changes to {title}',
@ -96,7 +92,7 @@ export const strings = {
}),
getSavedQueryPopoverSaveAsNewButtonAriaLabel: () =>
i18n.translate('unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel', {
defaultMessage: 'Save as new saved query',
defaultMessage: 'Save as new query',
}),
getSavedQueryPopoverSaveAsNewButtonText: () =>
i18n.translate('unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonText', {
@ -104,7 +100,7 @@ export const strings = {
}),
getSaveCurrentFilterSetLabel: () =>
i18n.translate('unifiedSearch.filter.options.saveCurrentFilterSetLabel', {
defaultMessage: 'Save current saved query',
defaultMessage: 'Save current query',
}),
getApplyAllFiltersButtonLabel: () =>
i18n.translate('unifiedSearch.filter.options.applyAllFiltersButtonLabel', {
@ -403,7 +399,7 @@ export function QueryBarMenuPanels({
let panels = [
{
id: 0,
title: (
title: savedQuery?.attributes.title ? (
<>
<EuiFlexGroup direction="column" gutterSize="s">
<EuiFlexItem grow={false}>
@ -412,9 +408,7 @@ export function QueryBarMenuPanels({
size="s"
data-test-subj="savedQueryTitle"
>
<strong>
{savedQuery ? savedQuery.attributes.title : strings.getSavedQueryLabel()}
</strong>
<strong>{savedQuery.attributes.title}</strong>
</EuiText>
</EuiFlexItem>
{savedQuery && savedQueryHasChanged && Boolean(showSaveQuery) && hasFiltersOrQuery && (
@ -455,7 +449,7 @@ export function QueryBarMenuPanels({
)}
</EuiFlexGroup>
</>
),
) : undefined,
items,
},
{

View file

@ -53,7 +53,7 @@ export function SaveQueryForm({
const titleConflictErrorText = i18n.translate(
'unifiedSearch.search.searchBar.savedQueryForm.titleConflictText',
{
defaultMessage: 'Name conflicts with an existing saved query',
defaultMessage: 'Name conflicts with an existing query',
}
);
@ -203,7 +203,7 @@ export function SaveQueryForm({
disabled={hasErrors}
>
{i18n.translate('unifiedSearch.search.searchBar.savedQueryFormSaveButtonText', {
defaultMessage: 'Save saved query',
defaultMessage: 'Save query',
})}
</EuiButton>
</EuiFormRow>

View file

@ -136,7 +136,7 @@ describe('Saved query management list component', () => {
.find('[data-test-subj="saved-query-management-apply-changes-button"]')
.first()
.text()
).toBe('Apply saved query');
).toBe('Apply query');
const newProps = {
...props,
@ -149,7 +149,7 @@ describe('Saved query management list component', () => {
.find('[data-test-subj="saved-query-management-apply-changes-button"]')
.first()
.text()
).toBe('Replace with selected saved query');
).toBe('Load query');
});
it('should render the modal on delete', async () => {

View file

@ -275,7 +275,7 @@ export function SavedQueryManagementList({
placeholder: i18n.translate(
'unifiedSearch.query.queryBar.indexPattern.findFilterSet',
{
defaultMessage: 'Find a saved query',
defaultMessage: 'Find a query',
}
),
}}
@ -333,7 +333,7 @@ export function SavedQueryManagementList({
aria-label={i18n.translate(
'unifiedSearch.search.searchBar.savedQueryPopoverApplyFilterSetLabel',
{
defaultMessage: 'Apply saved query',
defaultMessage: 'Apply query',
}
)}
data-test-subj="saved-query-management-apply-changes-button"
@ -342,13 +342,13 @@ export function SavedQueryManagementList({
? i18n.translate(
'unifiedSearch.search.searchBar.savedQueryPopoverReplaceFilterSetLabel',
{
defaultMessage: 'Replace with selected saved query',
defaultMessage: 'Load query',
}
)
: i18n.translate(
'unifiedSearch.search.searchBar.savedQueryPopoverApplyFilterSetLabel',
{
defaultMessage: 'Apply saved query',
defaultMessage: 'Apply query',
}
)}
</EuiButton>

View file

@ -49,7 +49,7 @@ export const useSavedQuery = (props: UseSavedQueriesProps): UseSavedQueriesRetur
// notify of saving error
props.notifications.toasts.addWarning({
title: i18n.translate('unifiedSearch.search.unableToGetSavedQueryToastTitle', {
defaultMessage: 'Unable to load saved query {savedQueryId}',
defaultMessage: 'Unable to load query {savedQueryId}',
values: { savedQueryId },
}),
text: `${error.message}`,

View file

@ -5807,7 +5807,6 @@
"unifiedSearch.queryBarTopRow.submitButton.refresh": "Actualiser la requête",
"unifiedSearch.queryBarTopRow.submitButton.run": "Exécuter la requête",
"unifiedSearch.queryBarTopRow.submitButton.update": "Nécessite une mise à jour",
"unifiedSearch.search.searchBar.savedQuery": "Requête enregistrée",
"unifiedSearch.search.searchBar.savedQueryDescriptionText": "Enregistrez le texte et les filtres de la requête que vous souhaitez réutiliser.",
"unifiedSearch.search.searchBar.savedQueryForm.titleConflictText": "Ce nom est en conflit avec une requête enregistrée existante.",
"unifiedSearch.search.searchBar.savedQueryForm.titleExistsText": "Un nom est requis.",

View file

@ -5808,7 +5808,6 @@
"unifiedSearch.queryBarTopRow.submitButton.refresh": "クエリの更新",
"unifiedSearch.queryBarTopRow.submitButton.run": "クエリを実行",
"unifiedSearch.queryBarTopRow.submitButton.update": "更新が必要です",
"unifiedSearch.search.searchBar.savedQuery": "保存されたクエリ",
"unifiedSearch.search.searchBar.savedQueryDescriptionText": "再度使用するクエリテキストとフィルターを保存します。",
"unifiedSearch.search.searchBar.savedQueryForm.titleConflictText": "タイトルがすでに保存されているクエリに使用されています",
"unifiedSearch.search.searchBar.savedQueryForm.titleExistsText": "名前が必要です。",

View file

@ -5808,7 +5808,6 @@
"unifiedSearch.queryBarTopRow.submitButton.refresh": "刷新查询",
"unifiedSearch.queryBarTopRow.submitButton.run": "运行查询",
"unifiedSearch.queryBarTopRow.submitButton.update": "需要更新",
"unifiedSearch.search.searchBar.savedQuery": "已保存查询",
"unifiedSearch.search.searchBar.savedQueryDescriptionText": "保存想要再次使用的查询文本和筛选。",
"unifiedSearch.search.searchBar.savedQueryForm.titleConflictText": "标题与现有已保存查询有冲突",
"unifiedSearch.search.searchBar.savedQueryForm.titleExistsText": "“名称”必填。",