From a16d66b9e4e109e937ca81f711b059704529c8db Mon Sep 17 00:00:00 2001 From: Grady Ward Date: Wed, 24 Jan 2024 12:10:07 -0700 Subject: [PATCH] Removes User Profile Landing --- frontend/components/user/Toolbar.vue | 44 -------------- frontend/pages/admin/merge.vue | 4 +- frontend/pages/admin/users.vue | 2 +- frontend/pages/user/[id].vue | 1 - frontend/pages/user/[id]/edit.vue | 76 ------------------------ frontend/pages/user/[id]/index.vue | 86 ++++++++++++++++++++++++++-- 6 files changed, 83 insertions(+), 130 deletions(-) delete mode 100644 frontend/components/user/Toolbar.vue delete mode 100644 frontend/pages/user/[id]/edit.vue diff --git a/frontend/components/user/Toolbar.vue b/frontend/components/user/Toolbar.vue deleted file mode 100644 index 6743117..0000000 --- a/frontend/components/user/Toolbar.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/frontend/pages/admin/merge.vue b/frontend/pages/admin/merge.vue index 8a21107..1e8fe84 100644 --- a/frontend/pages/admin/merge.vue +++ b/frontend/pages/admin/merge.vue @@ -64,7 +64,7 @@ const reset = () => { @@ -82,7 +82,7 @@ const reset = () => { diff --git a/frontend/pages/admin/users.vue b/frontend/pages/admin/users.vue index 16140e3..a7a3f0d 100644 --- a/frontend/pages/admin/users.vue +++ b/frontend/pages/admin/users.vue @@ -125,7 +125,7 @@ const reset = () => { always /> - -import { userEditor } from '@/lib/editor' - -const pactaClient = usePACTA() -const { fromParams } = useURLParams() -const { loading: { withLoading } } = useModal() -const router = useRouter() -const localePath = useLocalePath() -const i18n = useI18n() - -const id = presentOrCheckURL(fromParams('id')) -const prefix = `user/[${id}]` - -const { data } = await useSimpleAsyncData(`${prefix}.getUser`, () => pactaClient.findUserById(id)) -const { - editorValues, - editorFields, - changes, - saveTooltip, - canSave, -} = userEditor(presentOrCheckURL(data.value, 'no user in response'), i18n) - -const deleteUser = () => withLoading( - () => pactaClient.deleteUser(id).then(() => router.push(localePath('/'))), - `${prefix}.deleteUser`, -) -const saveChanges = () => withLoading( - () => pactaClient.updateUser(id, changes.value) - .then(() => router.push(localePath(`/user/${id}`))), - `${prefix}.saveChanges`, -) - - - diff --git a/frontend/pages/user/[id]/index.vue b/frontend/pages/user/[id]/index.vue index 5f11d1b..eda9159 100644 --- a/frontend/pages/user/[id]/index.vue +++ b/frontend/pages/user/[id]/index.vue @@ -1,12 +1,86 @@ +import { userEditor } from '@/lib/editor' -