From b9b98bb9ed875127ce5788a8efe33604d608c02c Mon Sep 17 00:00:00 2001 From: Kevin Schiffer Date: Mon, 16 Oct 2023 18:15:09 +0900 Subject: [PATCH] console,account: Remove and rewrite all message duplicates --- .../components/oauth-client-form/messages.js | 3 - .../containers/authorizations-table/index.js | 10 +- .../account/containers/clients-table/index.js | 3 +- .../containers/collaborators-table/index.js | 9 +- .../containers/profile-settings-form/index.js | 2 +- .../profile-settings-form/messages.js | 2 - .../containers/sessions-table/index.js | 3 +- .../account/containers/tokens-table/index.js | 6 +- pkg/webui/account/views/code/index.js | 2 - .../account/views/front-not-found/index.js | 10 +- pkg/webui/account/views/login/index.js | 6 +- .../account/views/oauth-client-add/index.js | 9 +- .../account/views/profile-settings/index.js | 6 +- pkg/webui/account/views/token-login/index.js | 3 +- pkg/webui/components/file-input/index.js | 1 - pkg/webui/components/qr-modal-button/index.js | 3 +- pkg/webui/components/qr/require-permission.js | 1 - .../components/device-import-form/index.js | 3 +- .../components/downlink-form/downlink-form.js | 7 +- .../console/components/events/messages.js | 4 +- .../gateway-visibility-form/index.js | 3 +- .../components/mac-settings-section/index.js | 45 +-- .../payload-formatters-form/index.js | 3 +- .../console/components/pubsub-form/index.js | 4 +- .../components/pubsub-form/messages.js | 6 - .../components/routing-policy-form/index.js | 4 +- .../components/routing-policy/sheet.js | 4 +- .../console/components/webhook-form/index.js | 9 +- .../components/webhook-template-info/index.js | 1 - .../containers/account-select/index.js | 3 +- .../containers/api-keys-table/index.js | 3 +- .../containers/applications-form/index.js | 3 +- .../containers/collaborators-table/index.js | 8 +- .../containers/dev-eui-component/index.js | 7 +- .../device-onboarding-form/index.js | 3 +- .../device-onboarding-form/messages.js | 17 +- .../qr-scan-form-section/index.js | 2 +- .../advanced-settings-section.js | 34 +- .../brand-select/brand-select.js | 3 +- .../model-select/model-select.js | 6 +- .../containers/freq-plans-select/index.js | 5 +- .../index.js | 6 +- .../containers/invite-user-form/index.js | 3 +- .../containers/lora-cloud-das-form/index.js | 1 - .../containers/lora-cloud-gls-form/index.js | 1 - .../containers/pubsub-formats-select/index.js | 5 +- .../console/containers/pubsubs-table/index.js | 3 +- .../console/containers/user-data-form/add.js | 36 +- .../console/containers/user-data-form/edit.js | 34 +- .../console/containers/webhook-edit/index.js | 15 +- .../webhook-formats-select/index.js | 1 - .../containers/webhooks-table/index.js | 4 +- pkg/webui/console/lib/events/definitions.js | 116 +++--- .../console/lib/packet-broker/messages.js | 23 -- .../views/admin-packet-broker/messages.js | 2 - .../admin-panel-network-information/index.js | 14 +- pkg/webui/console/views/admin-panel/index.js | 5 +- .../console/views/application-data/index.js | 9 +- .../index.js | 5 +- .../index.js | 14 +- .../views/device-general-settings/messages.js | 4 - .../network-server-form/index.js | 2 +- .../console/views/device-overview/index.js | 3 +- .../views/gateway-general-settings/index.js | 2 +- .../gateway-general-settings/messages.js | 1 - .../containers/collaborator-select/index.js | 14 +- .../lib/components/full-view-error/error.js | 2 +- pkg/webui/lib/errors/error-messages.js | 1 - pkg/webui/lib/errors/status-code-messages.js | 34 +- pkg/webui/lib/field-description-messages.js | 98 +----- pkg/webui/lib/payload-formatter-messages.js | 6 +- pkg/webui/lib/shared-messages.js | 189 ++++++---- pkg/webui/locales/en.json | 327 +++++++---------- pkg/webui/locales/ja.json | 329 +++++++----------- 74 files changed, 619 insertions(+), 956 deletions(-) diff --git a/pkg/webui/account/components/oauth-client-form/messages.js b/pkg/webui/account/components/oauth-client-form/messages.js index 2b204a8fb71..bfbc36f2e70 100644 --- a/pkg/webui/account/components/oauth-client-form/messages.js +++ b/pkg/webui/account/components/oauth-client-form/messages.js @@ -21,7 +21,6 @@ export default defineMessages({ clientDescDescription: 'The description is displayed to the user when authorizing the client. Use it to explain the purpose of your client.', createClient: 'Create OAuth client', - deleteTitle: 'Are you sure you want to delete this account?', deleteWarning: 'This will PERMANENTLY DELETE THIS OAUTH CLIENT and LOCK THE OAUTH ID. Make sure you assign new collaborators to such entities if you plan to continue using them.', purgeWarning: @@ -41,9 +40,7 @@ export default defineMessages({ 'If set, the authorization page will visually indicate endorsement to improve trust', grants: 'Grant types', grantsDesc: 'OAuth flows that can be used for the client to get a token', - grantAuthorizationLabel: 'Authorization code', grantRefreshTokenLabel: 'Refresh token', - grantPasswordLabel: 'Password', deleteClient: 'Delete OAuth client', urlsPlaceholder: 'https://example.com/oauth/callback', rightsWarning: diff --git a/pkg/webui/account/containers/authorizations-table/index.js b/pkg/webui/account/containers/authorizations-table/index.js index f7ac141a724..6f9fad70077 100644 --- a/pkg/webui/account/containers/authorizations-table/index.js +++ b/pkg/webui/account/containers/authorizations-table/index.js @@ -14,7 +14,6 @@ import React from 'react' import { useSelector } from 'react-redux' -import { defineMessages } from 'react-intl' import { createSelector } from 'reselect' import FetchTable from '@ttn-lw/containers/fetch-table' @@ -32,11 +31,6 @@ import { } from '@account/store/selectors/authorizations' import { selectUserId } from '@account/store/selectors/user' -const m = defineMessages({ - clientId: 'Client ID', - tableTitle: 'OAuth client authorizations', -}) - const getItemPathPrefix = item => `${item.client_ids.client_id}` const OAuthClientAuthorizationsTable = () => { @@ -46,7 +40,7 @@ const OAuthClientAuthorizationsTable = () => { const baseHeaders = [ { name: 'client_ids.client_id', - displayName: m.clientId, + displayName: sharedMessages.clientId, width: 20, }, { @@ -84,7 +78,7 @@ const OAuthClientAuthorizationsTable = () => { getItemsAction={getItems} baseDataSelector={baseDataSelector} getItemPathPrefix={getItemPathPrefix} - tableTitle={} + tableTitle={} clickable /> ) diff --git a/pkg/webui/account/containers/clients-table/index.js b/pkg/webui/account/containers/clients-table/index.js index fefbb8dd9f9..36d2c5f33c8 100644 --- a/pkg/webui/account/containers/clients-table/index.js +++ b/pkg/webui/account/containers/clients-table/index.js @@ -44,7 +44,6 @@ const m = defineMessages({ restoreFail: 'There was an error and OAuth client could not be restored', purgeSuccess: 'OAuth client purged', purgeFail: 'There was an error and the OAuth client could not be purged', - addClient: 'Add OAuth client', }) const OWNED_TAB = 'owned' @@ -200,7 +199,7 @@ const ClientsTable = () => { { @@ -87,7 +84,7 @@ const CollaboratorsTable = props => { const baseHeaders = [ { name: 'ids', - displayName: m.id, + displayName: sharedMessages.userOrgId, render: ids => { const isUser = 'user_ids' in ids const collaboratorId = getCollaboratorId({ ids }) @@ -144,7 +141,7 @@ const CollaboratorsTable = props => {