Skip to content

Commit

Permalink
console: Make notification titles more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiffer committed Feb 1, 2024
1 parent 4682926 commit 81ef3c0
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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} <code>{id}</code> on your network has been changed.',
preview:
'An API key of your {entityType} "{id}" on your network has been changed. API Key ID: {apiKeyId}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} <code>{id}</code> on your network.',
preview:
'A new API key has just been created for your {entityType} {id} on your network. API Key ID: {apiKeyId}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} <code>{id}</code> just registered a new OAuth client under {collaboratorType} <code>{collaboratorId}</code> on your network.{lineBreak}Since {senderTypeMiddle} <code>{id}</code> is not an admin, you need to approve this client before it can be used.',
clientId: '<b>Client ID:</b> <code>{clientId}</code>',
link: 'You can approve (or reject) the OAuth client <Link>here</Link>.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} <code>{entityId}</code> on your network has been added or updated.',
collaborator: '<b>Collaborator:</b> {collaboratorType} <code>{collaboratorId}</code>',
link: 'You can view and edit this collaborator <Link>here</Link>.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} <code>{entityId}</code> on your network has been changed to "{state}".',
link: 'You can view this <Link>here</Link>.',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>{entityId}</code> on your network has just been changed.',
closing: 'If this was not done by you, please contact your administrators as soon as possible.',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Link>here</Link>.',
user: '<b>User ID:</b> <code>{userId}</code>{lineBreak}<b>Name:</b> {userName}{lineBreak}<b>Description:</b> {userDescription}{lineBreak}<b>Email Address:</b> {userPrimaryEmailAddress}',
Expand Down
10 changes: 1 addition & 9 deletions pkg/webui/console/store/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions pkg/webui/lib/selectors/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions pkg/webui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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} <code>{id}</code> 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} <code>{id}</code> 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} <code>{id}</code> just registered a new OAuth client under {collaboratorType} <code>{collaboratorId}</code> on your network.{lineBreak}Since {senderTypeMiddle} <code>{id}</code> is not an admin, you need to approve this client before it can be used.",
"console.components.notifications.templates.client-requested.clientId": "<b>Client ID:</b> <code>{clientId}</code>",
"console.components.notifications.templates.client-requested.link": "You can approve (or reject) the OAuth client <Link>here</Link>.",
"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} <code>{entityId}</code> on your network has been added or updated.",
"console.components.notifications.templates.collaborator-changed.collaborator": "<b>Collaborator:</b> {collaboratorType} <code>{collaboratorId}</code>",
"console.components.notifications.templates.collaborator-changed.link": "You can view and edit this collaborator <Link>here</Link>.",
"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} <code>{entityId}</code> on your network has been changed to \"{state}\".",
"console.components.notifications.templates.entity-state-changed.link": "You can view this <Link>here</Link>.",
"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 <code>{entityId}</code> 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 <Link>here</Link>.",
"console.components.notifications.templates.user-requested.user": "<b>User ID:</b> <code>{userId}</code>{lineBreak}<b>Name:</b> {userName}{lineBreak}<b>Description:</b> {userDescription}{lineBreak}<b>Email Address:</b> {userPrimaryEmailAddress}",
Expand Down

0 comments on commit 81ef3c0

Please sign in to comment.