Skip to content

Commit

Permalink
[Data Views] Unify delete data view modal (elastic#206466)
Browse files Browse the repository at this point in the history
## Summary
This PR makes delete data view modal both to look the same.
Closes: elastic#204174
  • Loading branch information
kowalczyk-krzysztof authored Jan 14, 2025
1 parent 41cbc6a commit c964c58
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
EuiLink,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { DataViewType, RuntimeField, DataView } from '@kbn/data-views-plugin/public';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { SavedObjectRelation } from '@kbn/saved-objects-management-plugin/public';
Expand Down Expand Up @@ -76,6 +75,7 @@ import {
defaultIndexSelector,
fieldsSelector,
} from '../../management_app/data_view_mgmt_selectors';
import { deleteModalMsg } from '../index_pattern_table/delete_modal_msg';

export const EditIndexPattern = withRouter(
({ indexPattern, history, location }: EditIndexPatternProps) => {
Expand Down Expand Up @@ -186,26 +186,6 @@ export const EditIndexPattern = withRouter(

const userEditPermission = dataViews.getCanSaveSync();

const warning =
(indexPattern.namespaces && indexPattern.namespaces.length > 1) ||
indexPattern.namespaces.includes('*') ? (
<FormattedMessage
id="indexPatternManagement.editDataView.deleteWarningWithNamespaces"
defaultMessage="Delete the data view {dataViewName} from every space it is shared in. You can't undo this action."
values={{
dataViewName: <EuiCode>{indexPattern.getName()}</EuiCode>,
}}
/>
) : (
<FormattedMessage
id="indexPatternManagement.editDataView.deleteWarning"
defaultMessage="The data view {dataViewName} will be deleted. You can't undo this action."
values={{
dataViewName: <EuiCode>{indexPattern.getName()}</EuiCode>,
}}
/>
);

return (
<div data-test-subj="editIndexPattern" role="region" aria-label={headingAriaLabel}>
{dataView && (
Expand All @@ -214,7 +194,10 @@ export const EditIndexPattern = withRouter(
setDefault={() => dataViewMgmtService.setDefaultDataView()}
editIndexPatternClick={editPattern}
deleteIndexPatternClick={() =>
removeHandler([indexPattern as RemoveDataViewProps], <div>{warning}</div>)
removeHandler(
[dataView as RemoveDataViewProps],
deleteModalMsg([dataView as RemoveDataViewProps], Boolean(dataView.namespaces))
)
}
defaultIndex={defaultIndex}
canSave={userEditPermission}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4935,8 +4935,6 @@
"indexPatternManagement.disabledCallOutHeader": "Scripts désactivés",
"indexPatternManagement.disabledCallOutLabel": "Tous les scripts en ligne ont été désactivés dans Elasticsearch. Vous devez activer les scripts en ligne pour au moins un langage afin d'utiliser des champs scriptés dans Kibana.",
"indexPatternManagement.editDataView.deleteHeader": "Supprimer la vue de données",
"indexPatternManagement.editDataView.deleteWarning": "La vue de données {dataViewName} va être supprimée. Vous ne pouvez pas annuler cette action.",
"indexPatternManagement.editDataView.deleteWarningWithNamespaces": "Supprimer la vue de données {dataViewName} de tous les espaces dans lesquels elle est partagée. Vous ne pouvez pas annuler cette action.",
"indexPatternManagement.editDataView.detailsAria": "Détails de la vue de données",
"indexPatternManagement.editDataView.editAria": "Modifier la vue de données.",
"indexPatternManagement.editDataView.editTooltip": "Modifier",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4930,8 +4930,6 @@
"indexPatternManagement.disabledCallOutHeader": "スクリプティングが無効です",
"indexPatternManagement.disabledCallOutLabel": "Elasticsearchでのすべてのインラインスクリプティングが無効になっています。Kibanaでスクリプトフィールドを使用するには、インラインスクリプティングを有効にする必要があります。",
"indexPatternManagement.editDataView.deleteHeader": "データビューを削除",
"indexPatternManagement.editDataView.deleteWarning": "データビュー{dataViewName}は削除されます。この操作は元に戻すことができません。",
"indexPatternManagement.editDataView.deleteWarningWithNamespaces": "共有されているすべてのスペースからデータビュー{dataViewName}を削除します。この操作は元に戻すことができません。",
"indexPatternManagement.editDataView.detailsAria": "データビュー詳細",
"indexPatternManagement.editDataView.editAria": "データビューフィールドを編集します。",
"indexPatternManagement.editDataView.editTooltip": "編集",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4899,8 +4899,6 @@
"indexPatternManagement.disabledCallOutHeader": "脚本已禁用",
"indexPatternManagement.disabledCallOutLabel": "所有内联脚本在 Elasticsearch 中已禁用。必须至少为一种语言启用内联脚本,才能在 Kibana 中使用脚本字段。",
"indexPatternManagement.editDataView.deleteHeader": "删除数据视图",
"indexPatternManagement.editDataView.deleteWarning": "将删除数据视图 {dataViewName}。此操作无法撤消。",
"indexPatternManagement.editDataView.deleteWarningWithNamespaces": "从共享数据视图的每个工作区中删除数据视图 {dataViewName}。此操作无法撤消。",
"indexPatternManagement.editDataView.detailsAria": "数据视图详情",
"indexPatternManagement.editDataView.editAria": "编辑数据视图。",
"indexPatternManagement.editDataView.editTooltip": "编辑",
Expand Down

0 comments on commit c964c58

Please sign in to comment.