Skip to content

Commit bb9cac1

Browse files
authored
[Discover] [Unified Doc Viewer] Remove toasts when toggling columns (elastic#269587)
## Summary This PR removes the success toasts shown when columns are added or removed from the Unified Doc Viewer flyout in Discover, since it was unnecessary. The flyout now passes the existing add/remove column handlers through directly instead of wrapping them with success-toast notifications. Resolves elastic#269570. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
1 parent c18bfee commit bb9cac1

5 files changed

Lines changed: 4 additions & 38 deletions

File tree

src/platform/plugins/shared/unified_doc_viewer/public/components/doc_viewer_flyout/doc_viewer_flyout.tsx

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -193,32 +193,6 @@ export function UnifiedDocViewerFlyout({
193193
[activePage, onClose, setPage]
194194
);
195195

196-
const addColumn = useCallback(
197-
(columnName: string) => {
198-
onAddColumn(columnName);
199-
services.toastNotifications?.addSuccess(
200-
i18n.translate('unifiedDocViewer.flyout.toastColumnAdded', {
201-
defaultMessage: `Column ''{columnName}'' was added`,
202-
values: { columnName },
203-
})
204-
);
205-
},
206-
[onAddColumn, services.toastNotifications]
207-
);
208-
209-
const removeColumn = useCallback(
210-
(columnName: string) => {
211-
onRemoveColumn(columnName);
212-
services.toastNotifications?.addSuccess(
213-
i18n.translate('unifiedDocViewer.flyout.toastColumnRemoved', {
214-
defaultMessage: `Column ''{columnName}'' was removed`,
215-
values: { columnName },
216-
})
217-
);
218-
},
219-
[onRemoveColumn, services.toastNotifications]
220-
);
221-
222196
const docViewRenderProps = useMemo<DocViewRenderProps>(
223197
() => ({
224198
hit: actualHit,
@@ -227,8 +201,8 @@ export function UnifiedDocViewerFlyout({
227201
columnsMeta,
228202
textBasedHits: isEsqlQuery ? hits : undefined,
229203
filter: onFilter,
230-
onAddColumn: addColumn,
231-
onRemoveColumn: removeColumn,
204+
onAddColumn,
205+
onRemoveColumn,
232206
docViewsRegistry,
233207
decreaseAvailableHeightBy: isProjectStyle
234208
? euiTheme.base + PROJECT_VIEW_MARGIN_BOTTOM
@@ -243,8 +217,8 @@ export function UnifiedDocViewerFlyout({
243217
isEsqlQuery,
244218
hits,
245219
onFilter,
246-
addColumn,
247-
removeColumn,
220+
onAddColumn,
221+
onRemoveColumn,
248222
docViewsRegistry,
249223
isProjectStyle,
250224
euiTheme.base,

x-pack/platform/plugins/private/translations/translations/de-DE.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8868,8 +8868,6 @@
88688868
"unifiedDocViewer.flyout.docViewerDetailHeading": "Dokument",
88698869
"unifiedDocViewer.flyout.docViewerEsqlDetailHeading": "Ergebnis",
88708870
"unifiedDocViewer.flyout.screenReaderDescription": "Sie befinden sich in einem nicht-modalen Dialogfenster. Um den Dialog zu schließen, drücken Sie die Escape-Taste.",
8871-
"unifiedDocViewer.flyout.toastColumnAdded": "Spalte „{columnName}“ wurde hinzugefügt",
8872-
"unifiedDocViewer.flyout.toastColumnRemoved": "Spalte „{columnName}“ wurde entfernt",
88738871
"unifiedDocViewer.fullScreenWaterfall.logDocument.error": "Beim Abrufen des Log-Dokuments ist ein Fehler aufgetreten.",
88748872
"unifiedDocViewer.fullScreenWaterfall.spanDocument.error": "Beim Abrufen des Span-Dokuments ist ein Fehler aufgetreten.",
88758873
"unifiedDocViewer.hideNullValues.switchLabel": "Null-Felder ausblenden",

x-pack/platform/plugins/private/translations/translations/fr-FR.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8869,8 +8869,6 @@
88698869
"unifiedDocViewer.flyout.docViewerDetailHeading": "Document",
88708870
"unifiedDocViewer.flyout.docViewerEsqlDetailHeading": "Résultat",
88718871
"unifiedDocViewer.flyout.screenReaderDescription": "Vous êtes dans une boîte de dialogue non modale. Pour fermer la boîte de dialogue, appuyez sur Échap.",
8872-
"unifiedDocViewer.flyout.toastColumnAdded": "La colonne \"{columnName}\" a été ajoutée",
8873-
"unifiedDocViewer.flyout.toastColumnRemoved": "La colonne \"{columnName}\" a été supprimée",
88748872
"unifiedDocViewer.fullScreenWaterfall.logDocument.error": "Une erreur s'est produite lors de la récupération du document log",
88758873
"unifiedDocViewer.fullScreenWaterfall.spanDocument.error": "Une erreur s'est produite lors de la récupération du document Span",
88768874
"unifiedDocViewer.hideNullValues.switchLabel": "Masquer les champs nuls",

x-pack/platform/plugins/private/translations/translations/ja-JP.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8896,8 +8896,6 @@
88968896
"unifiedDocViewer.flyout.docViewerDetailHeading": "ドキュメント",
88978897
"unifiedDocViewer.flyout.docViewerEsqlDetailHeading": "結果",
88988898
"unifiedDocViewer.flyout.screenReaderDescription": "非モーダルダイアログで操作しています。ダイアログを閉じるには、Escapeを押します。",
8899-
"unifiedDocViewer.flyout.toastColumnAdded": "列''{columnName}''が追加されました",
8900-
"unifiedDocViewer.flyout.toastColumnRemoved": "列''{columnName}''が削除されました",
89018899
"unifiedDocViewer.fullScreenWaterfall.logDocument.error": "ログドキュメントの取得中にエラーが発生しました",
89028900
"unifiedDocViewer.fullScreenWaterfall.spanDocument.error": "スパンドキュメントの取得中にエラーが発生しまし",
89038901
"unifiedDocViewer.hideNullValues.switchLabel": "Nullフィールドを非表示",

x-pack/platform/plugins/private/translations/translations/zh-CN.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8893,8 +8893,6 @@
88938893
"unifiedDocViewer.flyout.docViewerDetailHeading": "文档",
88948894
"unifiedDocViewer.flyout.docViewerEsqlDetailHeading": "结果",
88958895
"unifiedDocViewer.flyout.screenReaderDescription": "您位于非模式对话框中。要关闭对话框,请按 Esc 键。",
8896-
"unifiedDocViewer.flyout.toastColumnAdded": "已添加列“{columnName}”",
8897-
"unifiedDocViewer.flyout.toastColumnRemoved": "已移除列“{columnName}”",
88988896
"unifiedDocViewer.fullScreenWaterfall.logDocument.error": "在获取日志文档时发生错误",
88998897
"unifiedDocViewer.fullScreenWaterfall.spanDocument.error": "在获取跨度文档时发生错误",
89008898
"unifiedDocViewer.hideNullValues.switchLabel": "隐藏 null 字段",

0 commit comments

Comments
 (0)