Refactor scopes to use Intl for labels and descriptions (#1570)

* Refactor scope labels for applications and pats

* move scopes to composables

* Refactor pages to use intl

* Fix merge error

* Extract messages
This commit is contained in:
Carter
2024-01-12 12:55:51 -08:00
committed by GitHub
parent 1cbe99a0d8
commit 0adb7685f6
7 changed files with 959 additions and 361 deletions

View File

@@ -61,7 +61,7 @@
<Checkbox
v-for="scope in scopeList"
:key="scope"
:label="getScopeLabel(scope)"
:label="scopesToLabels(getScopeValue(scope)).join(', ')"
:model-value="hasScope(scopesVal, scope)"
@update:model-value="() => (scopesVal = toggleScope(scopesVal, scope))"
/>
@@ -230,7 +230,14 @@ import {
ConfirmModal,
} from 'omorphia'
import Modal from '~/components/ui/Modal.vue'
import { scopeList, hasScope, toggleScope, getScopeLabel } from '~/utils/auth/scopes.ts'
import {
scopeList,
hasScope,
toggleScope,
useScopes,
getScopeValue,
} from '~/composables/auth/scopes.ts'
definePageMeta({
middleware: 'auth',
@@ -241,6 +248,7 @@ useHead({
})
const data = useNuxtApp()
const { scopesToLabels } = useScopes()
const appModal = ref()