From d4e99566b8c61178c9a6fbbb1887d06adbf46f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Thu, 5 Jan 2023 09:47:58 +0100 Subject: [PATCH] feat: notifications settings page (#782) --- components/common/CommonCheckbox.vue | 5 +- components/common/CommonRadio.vue | 4 +- ...ificationEnablePushNotification.client.vue | 28 +++--- .../NotificationPreferences.client.vue | 73 ++++++++-------- ...ficationSubscribePushNotificationError.vue | 6 +- components/settings/SettingsItem.vue | 4 + locales/ar-EG.json | 73 +++++++++------- locales/en-GB.json | 85 +++++++++--------- locales/en-US.json | 85 +++++++++--------- locales/es-ES.json | 86 ++++++++++--------- locales/fr-FR.json | 85 +++++++++--------- locales/nl-NL.json | 85 +++++++++--------- locales/zh-CN.json | 76 +++++++++------- locales/zh-TW.json | 73 +++++++++------- pages/notifications.vue | 19 ++-- pages/settings.vue | 7 ++ pages/settings/notifications/index.vue | 35 ++++++++ .../settings/notifications/notifications.vue | 27 ++++++ .../notifications/push-notifications.vue | 25 ++++++ 19 files changed, 519 insertions(+), 362 deletions(-) create mode 100644 pages/settings/notifications/index.vue create mode 100644 pages/settings/notifications/notifications.vue create mode 100644 pages/settings/notifications/push-notifications.vue diff --git a/components/common/CommonCheckbox.vue b/components/common/CommonCheckbox.vue index a7ebd035..11150bbc 100644 --- a/components/common/CommonCheckbox.vue +++ b/components/common/CommonCheckbox.vue @@ -11,11 +11,13 @@ const { modelValue } = defineModel<{ diff --git a/components/common/CommonRadio.vue b/components/common/CommonRadio.vue index 05b0dd57..5f0c175a 100644 --- a/components/common/CommonRadio.vue +++ b/components/common/CommonRadio.vue @@ -12,9 +12,10 @@ const { modelValue } = defineModel<{ diff --git a/components/notification/NotificationEnablePushNotification.client.vue b/components/notification/NotificationEnablePushNotification.client.vue index 4bedd0b9..175b33d7 100644 --- a/components/notification/NotificationEnablePushNotification.client.vue +++ b/components/notification/NotificationEnablePushNotification.client.vue @@ -1,7 +1,6 @@ diff --git a/components/notification/NotificationPreferences.client.vue b/components/notification/NotificationPreferences.client.vue index c608bc35..0210e7d0 100644 --- a/components/notification/NotificationPreferences.client.vue +++ b/components/notification/NotificationPreferences.client.vue @@ -2,7 +2,7 @@ import NotificationSubscribePushNotificationError from '~/components/notification/NotificationSubscribePushNotificationError.vue' -defineProps<{ show: boolean }>() +defineProps<{ show?: boolean }>() const { pushNotificationData, @@ -71,12 +71,12 @@ const doSubscribe = async () => { try { const result = await subscribe() if (result !== 'subscribed') { - subscribeError = t(`notification.settings.subscription_error.${result === 'notification-denied' ? 'permission_denied' : 'request_error'}`) + subscribeError = t(`settings.notifications.push_notifications.subscription_error.${result === 'notification-denied' ? 'permission_denied' : 'request_error'}`) showSubscribeError = true } } catch { - subscribeError = t('notification.settings.subscription_error.request_error') + subscribeError = t('settings.notifications.push_notifications.subscription_error.request_error') showSubscribeError = true } finally { @@ -103,40 +103,41 @@ onActivated(() => (busy = false)) - + diff --git a/components/notification/NotificationSubscribePushNotificationError.vue b/components/notification/NotificationSubscribePushNotificationError.vue index e7118fe3..367c2b99 100644 --- a/components/notification/NotificationSubscribePushNotificationError.vue +++ b/components/notification/NotificationSubscribePushNotificationError.vue @@ -22,13 +22,13 @@ const { modelValue } = defineModel<{
- +