From b546f4e79341bc3ed7bfdbdbf30611a5436328e8 Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Mon, 15 Jan 2024 17:26:28 +0100 Subject: [PATCH 01/12] Begin Work --- locales/en-US/index.json | 3 +++ pages/auth/authorize.vue | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/locales/en-US/index.json b/locales/en-US/index.json index 805adae294..2c318dc9d6 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -1,4 +1,7 @@ { + "auth.authorize.error.not-location-found": { + "message": "No redirect location found in response" + }, "button.cancel": { "message": "Cancel" }, diff --git a/pages/auth/authorize.vue b/pages/auth/authorize.vue index e0f30aea0c..d2b5048d0d 100644 --- a/pages/auth/authorize.vue +++ b/pages/auth/authorize.vue @@ -68,6 +68,15 @@ import { useAuth } from '@/composables/auth.js' import { useScopes } from '@/composables/auth/scopes.ts' +const { formatMessage } = useVIntl() + +const messages = defineMessages({ + noLocationFoundError: { + id: 'auth.authorize.error.not-location-found', + defaultMessage: 'No redirect location found in response', + }, +}) + const data = useNuxtApp() const router = useRoute() @@ -143,11 +152,11 @@ const onAuthorize = async () => { return } - throw new Error('No redirect location found in response') + throw new Error(formatMessage(messages.noLocationFoundError)) } catch (error) { data.$notify({ group: 'main', - title: 'An error occurred', + title: formatMessage(commonMessages.errorNotificationTitle), text: err.data ? err.data.description : err, type: 'error', }) @@ -170,11 +179,11 @@ const onReject = async () => { return } - throw new Error('No redirect location found in response') + throw new Error(formatMessage(messages.noLocationFoundError)) } catch (error) { data.$notify({ group: 'main', - title: 'An error occurred', + title: formatMessage(commonMessages.errorNotificationTitle), text: err.data ? err.data.description : err, type: 'error', }) From 99e3df31e073569e1343f27188d0d8913b61b69c Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Mon, 15 Jan 2024 17:39:53 +0100 Subject: [PATCH 02/12] Error label --- locales/en-US/index.json | 3 +++ pages/auth/authorize.vue | 2 +- utils/common-messages.ts | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/locales/en-US/index.json b/locales/en-US/index.json index 2c318dc9d6..e1b1f760b5 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -35,6 +35,9 @@ "input.view.list": { "message": "List view" }, + "label.error": { + "message": "Error" + }, "notification.error.title": { "message": "An error occurred" }, diff --git a/pages/auth/authorize.vue b/pages/auth/authorize.vue index d2b5048d0d..ec6781db09 100644 --- a/pages/auth/authorize.vue +++ b/pages/auth/authorize.vue @@ -2,7 +2,7 @@
-

Error

+

{{ formatMessage(commonMessages.errorLabel) }}

{{ error.data.error }}: diff --git a/utils/common-messages.ts b/utils/common-messages.ts index 965175a299..bb14c9ed5c 100644 --- a/utils/common-messages.ts +++ b/utils/common-messages.ts @@ -15,6 +15,10 @@ export const commonMessages = defineMessages({ id: 'button.edit', defaultMessage: 'Edit', }, + errorLabel: { + id: 'label.error', + defaultMessage: 'Error', + }, galleryInputView: { id: 'input.view.gallery', defaultMessage: 'Gallery view', From 3a085a2e726e03e59400719c9425cebaaa18a739 Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Tue, 16 Jan 2024 10:18:50 +0100 Subject: [PATCH 03/12] WIP --- locales/en-US/index.json | 3 +++ pages/auth/authorize.vue | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/locales/en-US/index.json b/locales/en-US/index.json index e1b1f760b5..801d62fbd5 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -1,4 +1,7 @@ { + "auth.authorize.button.authorize": { + "message": "Authorize" + }, "auth.authorize.error.not-location-found": { "message": "No redirect location found in response" }, diff --git a/pages/auth/authorize.vue b/pages/auth/authorize.vue index ec6781db09..8718016a1a 100644 --- a/pages/auth/authorize.vue +++ b/pages/auth/authorize.vue @@ -48,7 +48,7 @@

@@ -71,6 +71,10 @@ import { useScopes } from '@/composables/auth/scopes.ts' const { formatMessage } = useVIntl() const messages = defineMessages({ + authorizeButton: { + id: 'auth.authorize.button.authorize', + defaultMessage: 'Authorize', + }, noLocationFoundError: { id: 'auth.authorize.error.not-location-found', defaultMessage: 'No redirect location found in response', From e062d0645eac1dceae673861e13007a82487b68a Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Tue, 16 Jan 2024 10:27:10 +0100 Subject: [PATCH 04/12] Finish button & add authorize label --- locales/en-US/index.json | 6 ++++++ pages/auth/authorize.vue | 8 ++++++-- utils/common-messages.ts | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/locales/en-US/index.json b/locales/en-US/index.json index 801d62fbd5..fccdd481a6 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -5,9 +5,15 @@ "auth.authorize.error.not-location-found": { "message": "No redirect location found in response" }, + "auth.authorize.label.authorize-app-name": { + "message": "Authorize {app_name}" + }, "button.cancel": { "message": "Cancel" }, + "button.decline": { + "message": "Decline" + }, "button.edit": { "message": "Edit" }, diff --git a/pages/auth/authorize.vue b/pages/auth/authorize.vue index 8718016a1a..c6df2ee6d0 100644 --- a/pages/auth/authorize.vue +++ b/pages/auth/authorize.vue @@ -20,7 +20,7 @@
-

Authorize {{ app.name }}

+

{{ formatMessage(messages.authorizeAppNameLabel, { app_name: app.name }) }}

@@ -44,7 +44,7 @@

- You will be redirected to - {{ redirectUri }} + + +

@@ -83,6 +91,10 @@ const messages = defineMessages({ id: 'auth.authorize.error.not-location-found', defaultMessage: 'No redirect location found in response', }, + redirectUrlLabel: { + id: 'auth.authorize.label.redirect-url', + defaultMessage: 'You will be redirected to {url}', + }, }) const data = useNuxtApp() From 781ff5958d24b25eb297c9720817c961cb4e9f3d Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Fri, 19 Jan 2024 15:34:04 +0100 Subject: [PATCH 06/12] Reorganize --- locales/en-US/index.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locales/en-US/index.json b/locales/en-US/index.json index ee4b9fc33f..34bddf11d2 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -29,12 +29,12 @@ "button.cancel": { "message": "Cancel" }, - "button.decline": { - "message": "Decline" - }, "button.continue": { "message": "Continue" }, + "button.decline": { + "message": "Decline" + }, "button.edit": { "message": "Edit" }, From 506e1a162459fbc16972149589588385b749fb9c Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Sat, 20 Jan 2024 17:11:09 +0100 Subject: [PATCH 07/12] Finish work --- locales/en-US/index.json | 3 +++ pages/auth/authorize.vue | 27 ++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/locales/en-US/index.json b/locales/en-US/index.json index 34bddf11d2..1567229379 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -5,6 +5,9 @@ "auth.authorize.error.not-location-found": { "message": "No redirect location found in response" }, + "auth.authorize.label.app-info": { + "message": "{app_name} by {creator_username} will be able to:" + }, "auth.authorize.label.authorize-app-name": { "message": "Authorize {app_name}" }, diff --git a/pages/auth/authorize.vue b/pages/auth/authorize.vue index 2da51b53e0..6f79d8b642 100644 --- a/pages/auth/authorize.vue +++ b/pages/auth/authorize.vue @@ -24,11 +24,24 @@
- {{ app.name }} by - {{ - createdBy.username - }} - will be able to: + + + +
@@ -79,6 +92,10 @@ import { useScopes } from '@/composables/auth/scopes.ts' const { formatMessage } = useVIntl() const messages = defineMessages({ + appInfoLabel: { + id: 'auth.authorize.label.app-info', + defaultMessage: '{app_name} by {creator_username} will be able to:', + }, authorizeAppNameLabel: { id: 'auth.authorize.label.authorize-app-name', defaultMessage: 'Authorize {app_name}', From 0ab922939346a090eae7c02067520695fecbe851 Mon Sep 17 00:00:00 2001 From: Mysterious-Dev Date: Sat, 20 Jan 2024 17:12:02 +0100 Subject: [PATCH 08/12] Fix lint error --- pages/auth/authorize.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pages/auth/authorize.vue b/pages/auth/authorize.vue index 6f79d8b642..b944683616 100644 --- a/pages/auth/authorize.vue +++ b/pages/auth/authorize.vue @@ -24,9 +24,9 @@
- - +