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']
MdiDeleteOutline: typeof import('~icons/mdi/delete-outline')['default']
MdiDiscord: typeof import('~icons/mdi/discord')['default']
MdiDotsHorizontal: typeof import('~icons/mdi/dots-horizontal')['default']
MdiDotsVertical: typeof import('~icons/mdi/dots-vertical')['default']
MdiDownload: typeof import('~icons/mdi/download')['default']
MdiDownloadOutline: typeof import('~icons/mdi/download-outline')['default']

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

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

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

@ -124,7 +124,7 @@ const copyPasswordResetUrl = async (user: User) => {
<template>
<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" />
<div class="max-w-[900px] mx-auto p-4">
<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">
<template #default="{ text, record }">
<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">
<div class="flex flex-row items-center">
<a-button type="text" class="!px-0">
<div class="flex flex-row items-center h-[1.2rem]">
<IcBaselineMoreVert />
<MdiDotsHorizontal/>
</div>
</a-button>
</div>
@ -255,6 +253,12 @@ const copyPasswordResetUrl = async (user: User) => {
<div class="text-xs pl-2">{{ $t('activity.copyPasswordResetURL') }}</div>
</div>
</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>
</template>
</a-dropdown>
@ -268,5 +272,3 @@ const copyPasswordResetUrl = async (user: User) => {
</div>
</div>
</template>
<style scoped></style>

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

@ -1,5 +1,5 @@
<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 />
</div>
</template>

Loading…
Cancel
Save