Dashboard settings: Refactor delete modals (#90279)
* refactor: add translatable elements and confirmation text * refactor: add translatable element * refactor: add translatable element * refactor: run i18n extraction * refactor: add translatable elements
This commit is contained in:
@@ -3170,15 +3170,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/components/DashboardSettings/index.ts:5381": [
|
||||
[0, 0, 0, "Do not re-export imported variable (\`./DashboardSettings\`)", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "5"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "6"]
|
||||
],
|
||||
"public/app/features/dashboard/components/GenAI/GenAIHistory.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||
|
||||
@@ -70,7 +70,7 @@ export const DeleteModal = ({ onConfirm, onDismiss, selectedItems, ...props }: P
|
||||
) : null}
|
||||
</>
|
||||
}
|
||||
confirmationText="Delete"
|
||||
confirmationText={t('browse-dashboards.action.confirmation-text', 'Delete')}
|
||||
confirmText={
|
||||
isDeleting
|
||||
? t('browse-dashboards.action.deleting', 'Deleting...')
|
||||
|
||||
@@ -3,11 +3,13 @@ import { connect, ConnectedProps } from 'react-redux';
|
||||
import useAsyncFn from 'react-use/lib/useAsyncFn';
|
||||
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { Modal, ConfirmModal, Button } from '@grafana/ui';
|
||||
import { Modal, ConfirmModal, Button, Text, Space, TextLink } from '@grafana/ui';
|
||||
import { DashboardModel } from 'app/features/dashboard/state';
|
||||
import { cleanUpDashboardAndVariables } from 'app/features/dashboard/state/actions';
|
||||
import { deleteDashboard } from 'app/features/manage-dashboards/state/actions';
|
||||
|
||||
import { Trans, t } from '../../../../core/internationalization';
|
||||
|
||||
type DeleteDashboardModalProps = {
|
||||
hideModal(): void;
|
||||
dashboard: DashboardModel;
|
||||
@@ -40,15 +42,22 @@ const DeleteDashboardModalUnconnected = ({ hideModal, cleanUpDashboardAndVariabl
|
||||
isOpen={true}
|
||||
body={
|
||||
<>
|
||||
<p>Do you want to delete this dashboard?</p>
|
||||
<p>{dashboard.title}</p>
|
||||
<Text element="p">
|
||||
<Trans i18nKey="dashboard-settings.dashboard-delete-modal.text">
|
||||
Do you want to delete this dashboard?
|
||||
</Trans>
|
||||
</Text>
|
||||
<Space v={1} />
|
||||
<Text element="p">{dashboard.title}</Text>
|
||||
<Space v={2} />
|
||||
</>
|
||||
}
|
||||
onConfirm={onConfirm}
|
||||
onDismiss={hideModal}
|
||||
title="Delete"
|
||||
title={t('dashboard-settings.dashboard-delete-modal.title', 'Delete')}
|
||||
icon="trash-alt"
|
||||
confirmText="Delete"
|
||||
confirmText={t('dashboard-settings.dashboard-delete-modal.delete-button', 'Delete')}
|
||||
confirmationText={t('dashboard-settings.dashboard-delete-modal.confirmation-text', 'Delete')}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -56,36 +65,35 @@ const DeleteDashboardModalUnconnected = ({ hideModal, cleanUpDashboardAndVariabl
|
||||
const ProvisionedDeleteModal = ({ hideModal, provisionedId }: { hideModal(): void; provisionedId: string }) => (
|
||||
<Modal
|
||||
isOpen={true}
|
||||
title="Cannot delete provisioned dashboard"
|
||||
title={t('dashboard-settings.provisioned-delete-modal.title', 'Cannot delete provisioned dashboard')}
|
||||
icon="trash-alt"
|
||||
onDismiss={hideModal}
|
||||
className={css({
|
||||
width: '500px',
|
||||
})}
|
||||
>
|
||||
<p>
|
||||
This dashboard is managed by Grafana provisioning and cannot be deleted. Remove the dashboard from the config file
|
||||
to delete it.
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
See{' '}
|
||||
<a
|
||||
className="external-link"
|
||||
href="https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
documentation
|
||||
</a>{' '}
|
||||
for more information about provisioning.
|
||||
</i>
|
||||
<br />
|
||||
File path: {provisionedId}
|
||||
</p>
|
||||
<Text element="p">
|
||||
<Trans i18nKey="dashboard-settings.provisioned-delete-modal.text-1">
|
||||
This dashboard is managed by Grafana provisioning and cannot be deleted. Remove the dashboard from the config
|
||||
file to delete it.
|
||||
</Trans>
|
||||
</Text>
|
||||
<Space v={1} />
|
||||
<Text element="p">
|
||||
<Trans i18nKey="dashboard-settings.provisioned-delete-modal.text-2">
|
||||
See grafana documentation for more information about provisioning.
|
||||
</Trans>
|
||||
<TextLink href="https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards" external>
|
||||
{t('dashboard-settings.provisioned-delete-modal.text-link', 'Go to docs page')}
|
||||
</TextLink>
|
||||
</Text>
|
||||
<Space v={2} />
|
||||
<Text element="p">
|
||||
<Trans i18nKey="dashboard-settings.provisioned-delete-modal.text-3">File path: {{ provisionedId }}</Trans>
|
||||
</Text>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="primary" onClick={hideModal}>
|
||||
OK
|
||||
<Trans i18nKey="dashboard-settings.provisioned-delete-modal.confirm-button">OK</Trans>
|
||||
</Button>
|
||||
</Modal.ButtonRow>
|
||||
</Modal>
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
"action": {
|
||||
"cancel-button": "Cancel",
|
||||
"cannot-move-folders": "Folders cannot be moved",
|
||||
"confirmation-text": "Delete",
|
||||
"delete-button": "Delete",
|
||||
"delete-modal-invalid-text": "One or more folders contain library panels or alert rules. Delete these first in order to proceed.",
|
||||
"delete-modal-invalid-title": "Cannot delete folder",
|
||||
@@ -476,6 +477,12 @@
|
||||
"title": "Annotations"
|
||||
},
|
||||
"dashboard-delete-button": "Delete dashboard",
|
||||
"dashboard-delete-modal": {
|
||||
"confirmation-text": "Delete",
|
||||
"delete-button": "Delete",
|
||||
"text": "Do you want to delete this dashboard?",
|
||||
"title": "Delete"
|
||||
},
|
||||
"general": {
|
||||
"auto-refresh-description": "Define the auto refresh intervals that should be available in the auto refresh list. Use the format '5s' for seconds, '1m' for minutes, '1h' for hours, and '1d' for days (e.g.: '5s,10s,30s,1m,5m,15m,30m,1h,2h,1d').",
|
||||
"auto-refresh-label": "Auto refresh",
|
||||
@@ -503,6 +510,14 @@
|
||||
"permissions": {
|
||||
"title": "Permissions"
|
||||
},
|
||||
"provisioned-delete-modal": {
|
||||
"confirm-button": "OK",
|
||||
"text-1": "This dashboard is managed by Grafana provisioning and cannot be deleted. Remove the dashboard from the config file to delete it.",
|
||||
"text-2": "See grafana documentation for more information about provisioning. ",
|
||||
"text-3": "File path: {{provisionedId}}",
|
||||
"text-link": "Go to docs page",
|
||||
"title": "Cannot delete provisioned dashboard"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings"
|
||||
},
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
"action": {
|
||||
"cancel-button": "Cäʼnčęľ",
|
||||
"cannot-move-folders": "Főľđęřş čäʼnʼnőŧ þę mővęđ",
|
||||
"confirmation-text": "Đęľęŧę",
|
||||
"delete-button": "Đęľęŧę",
|
||||
"delete-modal-invalid-text": "Øʼnę őř mőřę ƒőľđęřş čőʼnŧäįʼn ľįþřäřy päʼnęľş őř äľęřŧ řūľęş. Đęľęŧę ŧĥęşę ƒįřşŧ įʼn őřđęř ŧő přőčęęđ.",
|
||||
"delete-modal-invalid-title": "Cäʼnʼnőŧ đęľęŧę ƒőľđęř",
|
||||
@@ -476,6 +477,12 @@
|
||||
"title": "Åʼnʼnőŧäŧįőʼnş"
|
||||
},
|
||||
"dashboard-delete-button": "Đęľęŧę đäşĥþőäřđ",
|
||||
"dashboard-delete-modal": {
|
||||
"confirmation-text": "Đęľęŧę",
|
||||
"delete-button": "Đęľęŧę",
|
||||
"text": "Đő yőū ŵäʼnŧ ŧő đęľęŧę ŧĥįş đäşĥþőäřđ?",
|
||||
"title": "Đęľęŧę"
|
||||
},
|
||||
"general": {
|
||||
"auto-refresh-description": "Đęƒįʼnę ŧĥę äūŧő řęƒřęşĥ įʼnŧęřväľş ŧĥäŧ şĥőūľđ þę äväįľäþľę įʼn ŧĥę äūŧő řęƒřęşĥ ľįşŧ. Ůşę ŧĥę ƒőřmäŧ '5ş' ƒőř şęčőʼnđş, '1m' ƒőř mįʼnūŧęş, '1ĥ' ƒőř ĥőūřş, äʼnđ '1đ' ƒőř đäyş (ę.ģ.: '5ş,10ş,30ş,1m,5m,15m,30m,1ĥ,2ĥ,1đ').",
|
||||
"auto-refresh-label": "Åūŧő řęƒřęşĥ",
|
||||
@@ -503,6 +510,14 @@
|
||||
"permissions": {
|
||||
"title": "Pęřmįşşįőʼnş"
|
||||
},
|
||||
"provisioned-delete-modal": {
|
||||
"confirm-button": "ØĶ",
|
||||
"text-1": "Ŧĥįş đäşĥþőäřđ įş mäʼnäģęđ þy Ğřäƒäʼnä přővįşįőʼnįʼnģ äʼnđ čäʼnʼnőŧ þę đęľęŧęđ. Ŗęmővę ŧĥę đäşĥþőäřđ ƒřőm ŧĥę čőʼnƒįģ ƒįľę ŧő đęľęŧę įŧ.",
|
||||
"text-2": "Ŝęę ģřäƒäʼnä đőčūmęʼnŧäŧįőʼn ƒőř mőřę įʼnƒőřmäŧįőʼn äþőūŧ přővįşįőʼnįʼnģ. ",
|
||||
"text-3": "Fįľę päŧĥ: {{provisionedId}}",
|
||||
"text-link": "Ğő ŧő đőčş päģę",
|
||||
"title": "Cäʼnʼnőŧ đęľęŧę přővįşįőʼnęđ đäşĥþőäřđ"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Ŝęŧŧįʼnģş"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user