ShareDrawer: Change alert texts (#93184)

This commit is contained in:
Juan Cabanas 2024-09-10 17:11:54 -03:00 committed by GitHub
parent 00ace4678c
commit afe457306a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 48 additions and 22 deletions

View File

@ -1,22 +1,34 @@
import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src';
import { config } from '@grafana/runtime';
import { Alert } from '@grafana/ui/src';
import { Trans, t } from 'app/core/internationalization';
const selectors = e2eSelectors.pages.ShareDashboardModal.PublicDashboard;
export const NoUpsertPermissionsAlert = ({ mode }: { mode: 'create' | 'edit' }) => (
<Alert
severity="warning"
title={t(
'public-dashboard.modal-alerts.no-upsert-perm-alert-title',
'You dont have permission to {{ mode }} a public dashboard',
{ mode }
)}
data-testid={selectors.NoUpsertPermissionsWarningAlert}
bottomSpacing={0}
>
<Trans i18nKey="public-dashboard.modal-alerts.no-upsert-perm-alert-desc">
Contact your admin to get permission to {{ mode }} public dashboards
</Trans>
</Alert>
);
export const NoUpsertPermissionsAlert = ({ mode }: { mode: 'create' | 'edit' }) => {
const title = config.featureToggles.newDashboardSharingComponent
? t(
'public-dashboard.share-externally.no-upsert-perm-alert-title',
'You dont have permission to {{ mode }} a shared dashboard',
{ mode }
)
: t(
'public-dashboard.modal-alerts.no-upsert-perm-alert-title',
'You dont have permission to {{ mode }} a public dashboard',
{ mode }
);
return (
<Alert severity="warning" title={title} data-testid={selectors.NoUpsertPermissionsWarningAlert} bottomSpacing={0}>
{config.featureToggles.newDashboardSharingComponent ? (
<Trans i18nKey="public-dashboard.share-externally.no-upsert-perm-alert-desc">
Contact your admin to get permission to {{ mode }} shared dashboards
</Trans>
) : (
<Trans i18nKey="public-dashboard.modal-alerts.no-upsert-perm-alert-desc">
Contact your admin to get permission to {{ mode }} public dashboards
</Trans>
)}
</Alert>
);
};

View File

@ -3,6 +3,7 @@ import cx from 'classnames';
import { GrafanaTheme2 } from '@grafana/data/src';
import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src';
import { config } from '@grafana/runtime';
import { Alert, useStyles2 } from '@grafana/ui/src';
import { Trans, t } from 'app/core/internationalization';
@ -19,10 +20,17 @@ export const UnsupportedDataSourcesAlert = ({ unsupportedDataSources }: { unsupp
bottomSpacing={0}
>
<p className={styles.unsupportedDataSourceDescription}>
<Trans i18nKey="public-dashboard.modal-alerts.unsupported-data-source-alert-desc">
There are data sources in this dashboard that are unsupported for public dashboards. Panels that use these
data sources may not function properly: {{ unsupportedDataSources }}.
</Trans>
{config.featureToggles.newDashboardSharingComponent ? (
<Trans i18nKey="public-dashboard.share-externally.unsupported-data-source-alert-desc">
There are data sources in this dashboard that are unsupported for shared dashboards. Panels that use these
data sources may not function properly: {{ unsupportedDataSources }}.
</Trans>
) : (
<Trans i18nKey="public-dashboard.modal-alerts.unsupported-data-source-alert-desc">
There are data sources in this dashboard that are unsupported for public dashboards. Panels that use these
data sources may not function properly: {{ unsupportedDataSources }}.
</Trans>
)}
</p>
<a
href="https://grafana.com/docs/grafana/next/dashboards/dashboard-public/"

View File

@ -2044,13 +2044,16 @@
"copy-link-button": "Copy external link",
"email-share-type-option-description": "Only people with the link can access dashboard",
"email-share-type-option-label": "Only specific people",
"no-upsert-perm-alert-desc": "Contact your admin to get permission to {{mode}} shared dashboards",
"no-upsert-perm-alert-title": "You dont have permission to {{ mode }} a shared dashboard",
"pause-access-button": "Pause access",
"pause-access-tooltip": "Pausing will temporarily disable access to this dashboard for all users",
"public-share-type-option-description": "Anyone with the link can access dashboard",
"public-share-type-option-label": "Anyone with the link",
"resume-access-button": "Resume access",
"revoke-access-button": "Revoke access",
"revoke-access-description": "Are you sure you want to revoke this access? The dashboard can no longer be shared."
"revoke-access-description": "Are you sure you want to revoke this access? The dashboard can no longer be shared.",
"unsupported-data-source-alert-desc": "There are data sources in this dashboard that are unsupported for shared dashboards. Panels that use these data sources may not function properly: {{unsupportedDataSources}}."
},
"sharing": {
"success-creation": "Dashboard is public!"

View File

@ -2044,13 +2044,16 @@
"copy-link-button": "Cőpy ęχŧęřʼnäľ ľįʼnĸ",
"email-share-type-option-description": "Øʼnľy pęőpľę ŵįŧĥ ŧĥę ľįʼnĸ čäʼn äččęşş đäşĥþőäřđ",
"email-share-type-option-label": "Øʼnľy şpęčįƒįč pęőpľę",
"no-upsert-perm-alert-desc": "Cőʼnŧäčŧ yőūř äđmįʼn ŧő ģęŧ pęřmįşşįőʼn ŧő {{mode}} şĥäřęđ đäşĥþőäřđş",
"no-upsert-perm-alert-title": "Ÿőū đőʼn’ŧ ĥävę pęřmįşşįőʼn ŧő {{ mode }} ä şĥäřęđ đäşĥþőäřđ",
"pause-access-button": "Päūşę äččęşş",
"pause-access-tooltip": "Päūşįʼnģ ŵįľľ ŧęmpőřäřįľy đįşäþľę äččęşş ŧő ŧĥįş đäşĥþőäřđ ƒőř äľľ ūşęřş",
"public-share-type-option-description": "Åʼnyőʼnę ŵįŧĥ ŧĥę ľįʼnĸ čäʼn äččęşş đäşĥþőäřđ",
"public-share-type-option-label": "Åʼnyőʼnę ŵįŧĥ ŧĥę ľįʼnĸ",
"resume-access-button": "Ŗęşūmę äččęşş",
"revoke-access-button": "Ŗęvőĸę äččęşş",
"revoke-access-description": "Åřę yőū şūřę yőū ŵäʼnŧ ŧő řęvőĸę ŧĥįş äččęşş? Ŧĥę đäşĥþőäřđ čäʼn ʼnő ľőʼnģęř þę şĥäřęđ."
"revoke-access-description": "Åřę yőū şūřę yőū ŵäʼnŧ ŧő řęvőĸę ŧĥįş äččęşş? Ŧĥę đäşĥþőäřđ čäʼn ʼnő ľőʼnģęř þę şĥäřęđ.",
"unsupported-data-source-alert-desc": "Ŧĥęřę äřę đäŧä şőūřčęş įʼn ŧĥįş đäşĥþőäřđ ŧĥäŧ äřę ūʼnşūppőřŧęđ ƒőř şĥäřęđ đäşĥþőäřđş. Päʼnęľş ŧĥäŧ ūşę ŧĥęşę đäŧä şőūřčęş mäy ʼnőŧ ƒūʼnčŧįőʼn přőpęřľy: {{unsupportedDataSources}}."
},
"sharing": {
"success-creation": "Đäşĥþőäřđ įş pūþľįč!"