From 1392c16f121fb125e413d00fa738aa291a8b54e0 Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 11 Jan 2024 16:13:03 -0800 Subject: [PATCH] Refactor scope labels for applications and pats (#1560) --- pages/settings/applications.vue | 9 +- pages/settings/pats.vue | 56 +---- utils/auth/scopes.ts | 357 ++++++++++++++++++++++++-------- 3 files changed, 285 insertions(+), 137 deletions(-) diff --git a/pages/settings/applications.vue b/pages/settings/applications.vue index 48333034b..a9df727ee 100644 --- a/pages/settings/applications.vue +++ b/pages/settings/applications.vue @@ -61,7 +61,7 @@ @@ -230,7 +230,7 @@ import { ConfirmModal, } from 'omorphia' import Modal from '~/components/ui/Modal.vue' -import { scopeList, hasScope, toggleScope } from '~/utils/auth/scopes.ts' +import { scopeList, hasScope, toggleScope, getScopeLabel } from '~/utils/auth/scopes.ts' definePageMeta({ middleware: 'auth', @@ -470,11 +470,6 @@ async function removeApp() { } stopLoading() } - -const constCaseToSentenceCase = (str) => { - str = str.replace(/_/g, ' ') - return str[0].toUpperCase() + str.slice(1).toLowerCase() -}