Browse Source

feat(api): show password rest/invite url based on the user

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
7a4bedce53
  1. 3
      packages/nc-gui/components/admin/Token.vue
  2. 9
      packages/nc-gui/components/admin/User.vue
  3. 1
      packages/nc-gui/lang/en.json

3
packages/nc-gui/components/admin/Token.vue

@ -99,7 +99,7 @@ const copyToken = (token: string | undefined) => {
<div class="max-w-[900px] mx-auto p-4">
<div class="py-2 flex gap-4 items-center">
<div class="flex-grow"></div>
<MdiReload @click="loadTokens" class="cursor-pointer"/>
<MdiReload class="cursor-pointer" @click="loadTokens" />
<a-button size="small" @click="showNewTokenModal = true">
<div class="flex items-center gap-1">
<MdiAdd />
@ -136,7 +136,6 @@ const copyToken = (token: string | undefined) => {
</template>
</a-table-column>
<!-- Token -->
<a-table-column key="token" :title="$t('labels.token')" data-index="token">
<template #default="{ text, record }">

9
packages/nc-gui/components/admin/User.vue

@ -146,7 +146,7 @@ const copyPasswordResetUrl = async (user: User) => {
>
</a-input-search>
<div class="flex-grow"></div>
<MdiReload @click="loadUsers" class="cursor-pointer" />
<MdiReload class="cursor-pointer" @click="loadUsers" />
<a-button size="small" @click="showUserModal = true">
<div class="flex items-center gap-1">
<MdiAdd />
@ -221,8 +221,7 @@ const copyPasswordResetUrl = async (user: User) => {
<div v-if="!record.roles.includes('super')" class="flex items-center gap-2">
<MdiDeleteOutline 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">
<a-button type="text" class="!px-0">
<div class="flex flex-row items-center h-[1.2rem]">
@ -233,6 +232,7 @@ const copyPasswordResetUrl = async (user: User) => {
<template #overlay>
<a-menu>
<template v-if="record.invite_token">
<a-menu-item>
<!-- Resend invite Email -->
<div class="flex flex-row items-center py-3" @click="resendInvite(record)">
@ -246,7 +246,8 @@ const copyPasswordResetUrl = async (user: User) => {
<div class="text-xs pl-2">{{ $t('activity.copyInviteURL') }}</div>
</div>
</a-menu-item>
<a-menu-item>
</template>
<a-menu-item v-else>
<div class="flex flex-row items-center py-3" @click="copyPasswordResetUrl(record)">
<MdiContentCopy class="flex h-[1rem] text-gray-500" />
<div class="text-xs pl-2">{{ $t('activity.copyPasswordResetURL') }}</div>

1
packages/nc-gui/lang/en.json

@ -351,6 +351,7 @@
"deleteUser": "Remove user from project",
"resendInvite": "Resend invite E-mail",
"copyInviteURL": "Copy invite URL",
"copyPasswordResetURL": "Copy password reset URL",
"newRole": "New role",
"reloadRoles": "Reload roles",
"nextPage": "Next page",

Loading…
Cancel
Save