From d8ae9057580a913f6e47d246bfc0bec5d8398ddd Mon Sep 17 00:00:00 2001
From: Lucy Chen <140550297+lucychen-grafana@users.noreply.github.com>
Date: Thu, 15 Aug 2024 13:09:01 -0400
Subject: [PATCH] Change Public Dashboard text in Enterprise Users section
(#91816)
* update text
* update tooltip
* add conditionals
* add conditions
* add conditionals
* fix conditionals
---
public/app/features/admin/UserListPage.tsx | 6 +++-
.../DashboardsListModalButton.tsx | 31 ++++++++++++++-----
.../DeleteUserModalButton.tsx | 22 +++++++++----
.../UserListPublicDashboardPage.tsx | 2 +-
public/locales/en-US/grafana.json | 13 ++++++--
public/locales/pseudo-LOCALE/grafana.json | 13 ++++++--
6 files changed, 66 insertions(+), 21 deletions(-)
diff --git a/public/app/features/admin/UserListPage.tsx b/public/app/features/admin/UserListPage.tsx
index ffcf5a54944..34756aae9fb 100644
--- a/public/app/features/admin/UserListPage.tsx
+++ b/public/app/features/admin/UserListPage.tsx
@@ -29,7 +29,11 @@ const selectors = e2eSelectors.pages.UserListPage;
const PublicDashboardsTab = ({ view, setView }: { view: TabView | null; setView: (v: TabView | null) => void }) => (
setView(TabView.PUBLIC_DASHBOARDS)}
data-testid={selectors.tabs.publicDashboardsUsers}
diff --git a/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx b/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx
index 3507d3bef02..9cbcc10c5e7 100644
--- a/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx
+++ b/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx
@@ -2,6 +2,7 @@ import { css, cx } from '@emotion/css';
import { GrafanaTheme2 } from '@grafana/data/src';
import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src';
+import { config } from '@grafana/runtime';
import { Button, LoadingPlaceholder, Modal, ModalsController, useStyles2 } from '@grafana/ui/src';
import { Trans, t } from 'app/core/internationalization';
import {
@@ -21,7 +22,11 @@ export const DashboardsListModal = ({ email, onDismiss }: { email: string; onDis
{isLoading ? (
@@ -42,9 +47,15 @@ export const DashboardsListModal = ({ email, onDismiss }: { email: string; onDis
href={generatePublicDashboardUrl(dash.publicDashboardAccessToken)}
onClick={onDismiss}
>
-
- Public dashboard URL
-
+ {config.featureToggles.newDashboardSharingComponent ? (
+
+ External link
+
+ ) : (
+
+ Public dashboard URL
+
+ )}
•
-
- Public dashboard settings
-
+ {config.featureToggles.newDashboardSharingComponent ? (
+
+ Sharing settings
+
+ ) : (
+
+ Public dashboard settings
+
+ )}
diff --git a/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx b/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx
index 98d427d5569..fd978a9ba4a 100644
--- a/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx
+++ b/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx
@@ -1,6 +1,7 @@
import { css } from '@emotion/css';
import { GrafanaTheme2 } from '@grafana/data/src';
+import { config } from '@grafana/runtime';
import { Button, Modal, ModalsController, useStyles2 } from '@grafana/ui/src';
import { Trans, t } from 'app/core/internationalization';
import { SessionUser } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils';
@@ -29,12 +30,21 @@ const DeleteUserModal = ({ user, hideModal }: { user: SessionUser; hideModal: ()
-
- This action will immediately revoke {{ email: user.email }}'s access to all public dashboards.
-
+ {config.featureToggles.newDashboardSharingComponent ? (
+
+ This action will immediately revoke {{ email: user.email }}'s access to all shared dashboards.
+
+ ) : (
+
+ This action will immediately revoke {{ email: user.email }}'s access to all public dashboards.
+
+ )}
diff --git a/public/app/features/admin/UserListPublicDashboardPage/UserListPublicDashboardPage.tsx b/public/app/features/admin/UserListPublicDashboardPage/UserListPublicDashboardPage.tsx
index e2971cb1fbf..8e4da1a16ab 100644
--- a/public/app/features/admin/UserListPublicDashboardPage/UserListPublicDashboardPage.tsx
+++ b/public/app/features/admin/UserListPublicDashboardPage/UserListPublicDashboardPage.tsx
@@ -32,7 +32,7 @@ export const UserListPublicDashboardPage = () => {
'Earliest time user has been an active user to a dashboard'
)}
>
-
+
diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json
index 8c7211f6943..3e4f748773d 100644
--- a/public/locales/en-US/grafana.json
+++ b/public/locales/en-US/grafana.json
@@ -1870,10 +1870,12 @@
},
"public-dashboard-users-access-list": {
"dashboard-modal": {
+ "external-link": "External link",
"loading-text": "Loading...",
"open-dashboard-list-text": "Open dashboards list",
"public-dashboard-link": "Public dashboard URL",
- "public-dashboard-setting": "Public dashboard settings"
+ "public-dashboard-setting": "Public dashboard settings",
+ "sharing-setting": "Sharing settings"
},
"delete-user-modal": {
"delete-user-button-text": "Delete user",
@@ -1883,8 +1885,12 @@
"revoke-user-access-modal-desc-line1": "Are you sure you want to revoke access for {{email}}?",
"revoke-user-access-modal-desc-line2": "This action will immediately revoke {{email}}'s access to all public dashboards."
},
+ "delete-user-shared-dashboards-modal": {
+ "revoke-user-access-modal-desc-line2": "This action will immediately revoke {{email}}'s access to all shared dashboards."
+ },
"modal": {
- "dashboard-modal-title": "Public dashboards"
+ "dashboard-modal-title": "Public dashboards",
+ "shared-dashboard-modal-title": "Shared dashboards"
},
"table-header": {
"activated-label": "Activated",
@@ -2381,7 +2387,8 @@
},
"users-access-list": {
"tabs": {
- "public-dashboard-users-tab-title": "Public dashboard users"
+ "public-dashboard-users-tab-title": "Public dashboard users",
+ "shared-dashboard-users-tab-title": "Shared dashboard users"
}
},
"variable": {
diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json
index 7420889142b..23147c23364 100644
--- a/public/locales/pseudo-LOCALE/grafana.json
+++ b/public/locales/pseudo-LOCALE/grafana.json
@@ -1870,10 +1870,12 @@
},
"public-dashboard-users-access-list": {
"dashboard-modal": {
+ "external-link": "Ēχŧęřʼnäľ ľįʼnĸ",
"loading-text": "Ŀőäđįʼnģ...",
"open-dashboard-list-text": "Øpęʼn đäşĥþőäřđş ľįşŧ",
"public-dashboard-link": "Pūþľįč đäşĥþőäřđ ŮŖĿ",
- "public-dashboard-setting": "Pūþľįč đäşĥþőäřđ şęŧŧįʼnģş"
+ "public-dashboard-setting": "Pūþľįč đäşĥþőäřđ şęŧŧįʼnģş",
+ "sharing-setting": "Ŝĥäřįʼnģ şęŧŧįʼnģş"
},
"delete-user-modal": {
"delete-user-button-text": "Đęľęŧę ūşęř",
@@ -1883,8 +1885,12 @@
"revoke-user-access-modal-desc-line1": "Åřę yőū şūřę yőū ŵäʼnŧ ŧő řęvőĸę äččęşş ƒőř {{email}}?",
"revoke-user-access-modal-desc-line2": "Ŧĥįş äčŧįőʼn ŵįľľ įmmęđįäŧęľy řęvőĸę {{email}}&äpőş;ş äččęşş ŧő äľľ pūþľįč đäşĥþőäřđş."
},
+ "delete-user-shared-dashboards-modal": {
+ "revoke-user-access-modal-desc-line2": "Ŧĥįş äčŧįőʼn ŵįľľ įmmęđįäŧęľy řęvőĸę {{email}}&äpőş;ş äččęşş ŧő äľľ şĥäřęđ đäşĥþőäřđş."
+ },
"modal": {
- "dashboard-modal-title": "Pūþľįč đäşĥþőäřđş"
+ "dashboard-modal-title": "Pūþľįč đäşĥþőäřđş",
+ "shared-dashboard-modal-title": "Ŝĥäřęđ đäşĥþőäřđş"
},
"table-header": {
"activated-label": "Åčŧįväŧęđ",
@@ -2381,7 +2387,8 @@
},
"users-access-list": {
"tabs": {
- "public-dashboard-users-tab-title": "Pūþľįč đäşĥþőäřđ ūşęřş"
+ "public-dashboard-users-tab-title": "Pūþľįč đäşĥþőäřđ ūşęřş",
+ "shared-dashboard-users-tab-title": "Ŝĥäřęđ đäşĥþőäřđ ūşęřş"
}
},
"variable": {