From 81ef3c0a3c5d8af2691cdbe9c22fc8b56b0b23d0 Mon Sep 17 00:00:00 2001 From: Kevin Schiffer Date: Thu, 1 Feb 2024 18:46:40 +0900 Subject: [PATCH] console: Make notification titles more concise --- .../notifications/templates/api-key-changed.js | 2 +- .../notifications/templates/api-key-created.js | 2 +- .../notifications/templates/client-requested.js | 2 +- .../templates/collaborator-changed.js | 2 +- .../templates/entity-state-changed.js | 2 +- .../notifications/templates/password-changed.js | 2 +- .../notifications/templates/user-requested.js | 2 +- pkg/webui/console/store/reducers/index.js | 10 +--------- pkg/webui/lib/selectors/id.js | 2 -- pkg/webui/locales/en.json | 14 +++++++------- 10 files changed, 15 insertions(+), 25 deletions(-) diff --git a/pkg/webui/console/components/notifications/templates/api-key-changed.js b/pkg/webui/console/components/notifications/templates/api-key-changed.js index 5f56e0c3fff..e214e2b612a 100644 --- a/pkg/webui/console/components/notifications/templates/api-key-changed.js +++ b/pkg/webui/console/components/notifications/templates/api-key-changed.js @@ -28,7 +28,7 @@ import { getEntity } from '../utils' import ContentTemplate from './template' const m = defineMessages({ - title: 'An API key of your {entityType} on your network has been changed', + title: 'API key of {entityType} has been changed', body: 'An API key of your {entityType} {id} on your network has been changed.', preview: 'An API key of your {entityType} "{id}" on your network has been changed. API Key ID: {apiKeyId}', diff --git a/pkg/webui/console/components/notifications/templates/api-key-created.js b/pkg/webui/console/components/notifications/templates/api-key-created.js index 0addf822428..31c9166146c 100644 --- a/pkg/webui/console/components/notifications/templates/api-key-created.js +++ b/pkg/webui/console/components/notifications/templates/api-key-created.js @@ -28,7 +28,7 @@ import { getEntity } from '../utils' import ContentTemplate from './template' const m = defineMessages({ - title: 'A new API key has just been created for your {entityType}', + title: 'New API key created for {entityType}', body: 'A new API key has just been created for your {entityType} {id} on your network.', preview: 'A new API key has just been created for your {entityType} {id} on your network. API Key ID: {apiKeyId}', diff --git a/pkg/webui/console/components/notifications/templates/client-requested.js b/pkg/webui/console/components/notifications/templates/client-requested.js index 78a6c425fcd..22764c6a8d5 100644 --- a/pkg/webui/console/components/notifications/templates/client-requested.js +++ b/pkg/webui/console/components/notifications/templates/client-requested.js @@ -28,7 +28,7 @@ import selectAccountUrl from '@console/lib/selectors/app-config' import ContentTemplate from './template' const m = defineMessages({ - title: 'Your review is required for a newly registered OAuth client', + title: 'Review is required for a new OAuth client', body: '{senderType} {id} just registered a new OAuth client under {collaboratorType} {collaboratorId} on your network.{lineBreak}Since {senderTypeMiddle} {id} is not an admin, you need to approve this client before it can be used.', clientId: 'Client ID: {clientId}', link: 'You can approve (or reject) the OAuth client here.', diff --git a/pkg/webui/console/components/notifications/templates/collaborator-changed.js b/pkg/webui/console/components/notifications/templates/collaborator-changed.js index dd12ce94eff..5ef4ac42e51 100644 --- a/pkg/webui/console/components/notifications/templates/collaborator-changed.js +++ b/pkg/webui/console/components/notifications/templates/collaborator-changed.js @@ -27,7 +27,7 @@ import { getEntity } from '../utils' import ContentTemplate from './template' const m = defineMessages({ - title: 'A collaborator of your {entityType} has been added or updated', + title: 'Collaborator of {entityType} added or updated', body: 'A collaborator of your {entityType} {entityId} on your network has been added or updated.', collaborator: 'Collaborator: {collaboratorType} {collaboratorId}', link: 'You can view and edit this collaborator here.', diff --git a/pkg/webui/console/components/notifications/templates/entity-state-changed.js b/pkg/webui/console/components/notifications/templates/entity-state-changed.js index d9d9eb68bc1..569406e9414 100644 --- a/pkg/webui/console/components/notifications/templates/entity-state-changed.js +++ b/pkg/webui/console/components/notifications/templates/entity-state-changed.js @@ -28,7 +28,7 @@ import { getEntity } from '../utils' import ContentTemplate from './template' const m = defineMessages({ - title: 'The state of your {entityType} has been changed.', + title: 'State of {entityType} changed', body: 'The state of the {entityType} {entityId} on your network has been changed to "{state}".', link: 'You can view this here.', }) diff --git a/pkg/webui/console/components/notifications/templates/password-changed.js b/pkg/webui/console/components/notifications/templates/password-changed.js index 9adb5a14cd6..ceeefbb036e 100644 --- a/pkg/webui/console/components/notifications/templates/password-changed.js +++ b/pkg/webui/console/components/notifications/templates/password-changed.js @@ -26,7 +26,7 @@ import { getEntity } from '../utils' import ContentTemplate from './template' const m = defineMessages({ - title: 'The password of your user "{entityIds}" has just been changed.', + title: 'Password of user "{entityIds}" changed', body: 'The password of your user {entityId} on your network has just been changed.', closing: 'If this was not done by you, please contact your administrators as soon as possible.', }) diff --git a/pkg/webui/console/components/notifications/templates/user-requested.js b/pkg/webui/console/components/notifications/templates/user-requested.js index b01f3003f22..a420d108e0a 100644 --- a/pkg/webui/console/components/notifications/templates/user-requested.js +++ b/pkg/webui/console/components/notifications/templates/user-requested.js @@ -25,7 +25,7 @@ import PropTypes from '@ttn-lw/lib/prop-types' import ContentTemplate from './template' const m = defineMessages({ - title: 'Your review is required for a newly registered user', + title: 'Review required for new user', body: 'A new user just registered on your network.{lineBreak}Since user registration requires admin approval, you need to approve this user before they can login.', closing: 'You can review this user here.', user: 'User ID: {userId}{lineBreak}Name: {userName}{lineBreak}Description: {userDescription}{lineBreak}Email Address: {userPrimaryEmailAddress}', diff --git a/pkg/webui/console/store/reducers/index.js b/pkg/webui/console/store/reducers/index.js index 70969d65398..ff7187ff6ab 100644 --- a/pkg/webui/console/store/reducers/index.js +++ b/pkg/webui/console/store/reducers/index.js @@ -14,14 +14,7 @@ import { combineReducers } from 'redux' -import { - APPLICATION, - END_DEVICE, - GATEWAY, - USER, - ORGANIZATION, - NOTIFICATION, -} from '@console/constants/entities' +import { APPLICATION, END_DEVICE, GATEWAY, USER, ORGANIZATION } from '@console/constants/entities' import { getUserId, @@ -32,7 +25,6 @@ import { getApiKeyId, getCollaboratorId, getPacketBrokerNetworkId, - getNotificationId, } from '@ttn-lw/lib/selectors/id' import { createNamedPaginationReducer } from '@ttn-lw/lib/store/reducers/pagination' import fetching from '@ttn-lw/lib/store/reducers/ui/fetching' diff --git a/pkg/webui/lib/selectors/id.js b/pkg/webui/lib/selectors/id.js index 23997df9c7f..f4ca2890148 100644 --- a/pkg/webui/lib/selectors/id.js +++ b/pkg/webui/lib/selectors/id.js @@ -112,5 +112,3 @@ export const getPacketBrokerHomeNewtorkId = (policy = {}) => combinePacketBrokerIds(policy.home_network_id) export const getClientId = (client = {}) => getByPath(client, 'ids.client_id') - -export const getNotificationId = (notification = {}) => notification.id diff --git a/pkg/webui/locales/en.json b/pkg/webui/locales/en.json index 7a1b2cf74cc..7da761aec49 100644 --- a/pkg/webui/locales/en.json +++ b/pkg/webui/locales/en.json @@ -294,29 +294,29 @@ "console.components.mac-settings-section.index.adrAckValue": "{count, plural, one {every message} other {every {count} messages}}", "console.components.mac-settings-section.index.statusCountPeriodicity": "Status count periodicity", "console.components.mac-settings-section.index.statusTimePeriodicity": "Status time periodicity", - "console.components.notifications.templates.api-key-changed.title": "An API key of your {entityType} on your network has been changed", + "console.components.notifications.templates.api-key-changed.title": "API key of {entityType} has been changed", "console.components.notifications.templates.api-key-changed.body": "An API key of your {entityType} {id} on your network has been changed.", "console.components.notifications.templates.api-key-changed.preview": "An API key of your {entityType} \"{id}\" on your network has been changed. API Key ID: {apiKeyId}", - "console.components.notifications.templates.api-key-created.title": "A new API key has just been created for your {entityType}", + "console.components.notifications.templates.api-key-created.title": "New API key created for {entityType}", "console.components.notifications.templates.api-key-created.body": "A new API key has just been created for your {entityType} {id} on your network.", "console.components.notifications.templates.api-key-created.preview": "A new API key has just been created for your {entityType} {id} on your network. API Key ID: {apiKeyId}", - "console.components.notifications.templates.client-requested.title": "Your review is required for a newly registered OAuth client", + "console.components.notifications.templates.client-requested.title": "Review is required for a new OAuth client", "console.components.notifications.templates.client-requested.body": "{senderType} {id} just registered a new OAuth client under {collaboratorType} {collaboratorId} on your network.{lineBreak}Since {senderTypeMiddle} {id} is not an admin, you need to approve this client before it can be used.", "console.components.notifications.templates.client-requested.clientId": "Client ID: {clientId}", "console.components.notifications.templates.client-requested.link": "You can approve (or reject) the OAuth client here.", "console.components.notifications.templates.client-requested.preview": "{senderType} {id} just registered a new OAuth client under {collaboratorType} {collaboratorId} on your network. Since {senderTypeMiddle} {id} is not an admin, you need to approve this client before it can be used. Client ID: {clientId}", - "console.components.notifications.templates.collaborator-changed.title": "A collaborator of your {entityType} has been added or updated", + "console.components.notifications.templates.collaborator-changed.title": "Collaborator of {entityType} added or updated", "console.components.notifications.templates.collaborator-changed.body": "A collaborator of your {entityType} {entityId} on your network has been added or updated.", "console.components.notifications.templates.collaborator-changed.collaborator": "Collaborator: {collaboratorType} {collaboratorId}", "console.components.notifications.templates.collaborator-changed.link": "You can view and edit this collaborator here.", "console.components.notifications.templates.collaborator-changed.preview": "A collaborator of your {entityType} {entityId} on your network has been added or updated. Collaborator: {collaboratorType} {collaboratorId}", - "console.components.notifications.templates.entity-state-changed.title": "The state of your {entityType} has been changed.", + "console.components.notifications.templates.entity-state-changed.title": "State of {entityType} changed", "console.components.notifications.templates.entity-state-changed.body": "The state of the {entityType} {entityId} on your network has been changed to \"{state}\".", "console.components.notifications.templates.entity-state-changed.link": "You can view this here.", - "console.components.notifications.templates.password-changed.title": "The password of your user \"{entityIds}\" has just been changed.", + "console.components.notifications.templates.password-changed.title": "Password of user \"{entityIds}\" changed.", "console.components.notifications.templates.password-changed.body": "The password of your user {entityId} on your network has just been changed.", "console.components.notifications.templates.password-changed.closing": "If this was not done by you, please contact your administrators as soon as possible.", - "console.components.notifications.templates.user-requested.title": "Your review is required for a newly registered user", + "console.components.notifications.templates.user-requested.title": "Review required for new user", "console.components.notifications.templates.user-requested.body": "A new user just registered on your network.{lineBreak}Since user registration requires admin approval, you need to approve this user before they can login.", "console.components.notifications.templates.user-requested.closing": "You can review this user here.", "console.components.notifications.templates.user-requested.user": "User ID: {userId}{lineBreak}Name: {userName}{lineBreak}Description: {userDescription}{lineBreak}Email Address: {userPrimaryEmailAddress}",