Browse Source

refactor(gui): move delete under menu

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
2086e5f6ad
  1. 1
      packages/nc-gui/components.d.ts
  2. 2
      packages/nc-gui/components/account/SignupSettings.vue
  3. 14
      packages/nc-gui/components/account/UserList.vue
  4. 2
      packages/nc-gui/pages/account/index/users.vue

1
packages/nc-gui/components.d.ts vendored

@ -151,6 +151,7 @@ declare module '@vue/runtime-core' {
MdiDelete: typeof import('~icons/mdi/delete')['default'] MdiDelete: typeof import('~icons/mdi/delete')['default']
MdiDeleteOutline: typeof import('~icons/mdi/delete-outline')['default'] MdiDeleteOutline: typeof import('~icons/mdi/delete-outline')['default']
MdiDiscord: typeof import('~icons/mdi/discord')['default'] MdiDiscord: typeof import('~icons/mdi/discord')['default']
MdiDotsHorizontal: typeof import('~icons/mdi/dots-horizontal')['default']
MdiDotsVertical: typeof import('~icons/mdi/dots-vertical')['default'] MdiDotsVertical: typeof import('~icons/mdi/dots-vertical')['default']
MdiDownload: typeof import('~icons/mdi/download')['default'] MdiDownload: typeof import('~icons/mdi/download')['default']
MdiDownloadOutline: typeof import('~icons/mdi/download-outline')['default'] MdiDownloadOutline: typeof import('~icons/mdi/download-outline')['default']

2
packages/nc-gui/components/account/SignupSettings.vue

@ -31,7 +31,7 @@ loadSettings()
<template> <template>
<div> <div>
<div class="text-xl">Settings</div> <div class="text-xl mt-4">Settings</div>
<a-divider class="!my-3" /> <a-divider class="!my-3" />
<div class="-ml-6"> <div class="-ml-6">
<a-form-item> <a-form-item>

14
packages/nc-gui/components/account/UserList.vue

@ -124,7 +124,7 @@ const copyPasswordResetUrl = async (user: User) => {
<template> <template>
<div data-cy="nc-super-user-list"> <div data-cy="nc-super-user-list">
<div class="text-xl">User Management</div> <div class="text-xl mt-4">User Management</div>
<a-divider class="!my-3" /> <a-divider class="!my-3" />
<div class="max-w-[900px] mx-auto p-4"> <div class="max-w-[900px] mx-auto p-4">
<div class="py-2 flex gap-4 items-center"> <div class="py-2 flex gap-4 items-center">
@ -221,13 +221,11 @@ const copyPasswordResetUrl = async (user: User) => {
<a-table-column key="id" :title="$t('labels.actions')" data-index="id"> <a-table-column key="id" :title="$t('labels.actions')" data-index="id">
<template #default="{ text, record }"> <template #default="{ text, record }">
<div v-if="!record.roles.includes('super')" class="flex items-center gap-2"> <div v-if="!record.roles.includes('super')" class="flex items-center gap-2">
<MdiDeleteOutline data-cy="nc-super-user-delete" class="nc-action-btn cursor-pointer" @click="deleteUser(text)" />
<a-dropdown :trigger="['click']" class="flex" placement="bottomRight" overlay-class-name="nc-dropdown-user-mgmt"> <a-dropdown :trigger="['click']" class="flex" placement="bottomRight" overlay-class-name="nc-dropdown-user-mgmt">
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
<a-button type="text" class="!px-0"> <a-button type="text" class="!px-0">
<div class="flex flex-row items-center h-[1.2rem]"> <div class="flex flex-row items-center h-[1.2rem]">
<IcBaselineMoreVert /> <MdiDotsHorizontal/>
</div> </div>
</a-button> </a-button>
</div> </div>
@ -255,6 +253,12 @@ const copyPasswordResetUrl = async (user: User) => {
<div class="text-xs pl-2">{{ $t('activity.copyPasswordResetURL') }}</div> <div class="text-xs pl-2">{{ $t('activity.copyPasswordResetURL') }}</div>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item>
<div class="flex flex-row items-center py-3" @click="deleteUser(text)">
<MdiDeleteOutline data-cy="nc-super-user-delete" class="flex h-[1rem] text-gray-500" />
<div class="text-xs pl-2">{{ $t('general.delete') }}</div>
</div>
</a-menu-item>
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>
@ -268,5 +272,3 @@ const copyPasswordResetUrl = async (user: User) => {
</div> </div>
</div> </div>
</template> </template>
<style scoped></style>

2
packages/nc-gui/pages/account/index/users.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="h-full overflow-y-scroll scrollbar-thin-dull pt-4"> <div class="h-full overflow-y-scroll scrollbar-thin-dull pt-2">
<NuxtPage /> <NuxtPage />
</div> </div>
</template> </template>

Loading…
Cancel
Save