|
|
@ -1,20 +1,20 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
|
|
|
|
import type { UserType } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
|
|
|
|
Form, |
|
|
|
computed, |
|
|
|
computed, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
Form, |
|
|
|
|
|
|
|
isEmail, |
|
|
|
isEmail, |
|
|
|
message, |
|
|
|
message, |
|
|
|
onMounted, |
|
|
|
onMounted, |
|
|
|
projectRoles, |
|
|
|
|
|
|
|
projectRoleTagColors, |
|
|
|
projectRoleTagColors, |
|
|
|
|
|
|
|
projectRoles, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
useCopy, |
|
|
|
useCopy, |
|
|
|
useDashboard, |
|
|
|
useDashboard, |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
|
useNuxtApp, |
|
|
|
useNuxtApp, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
import { UserType } from 'nocodb-sdk' |
|
|
|
|
|
|
|
import type { User } from '~/lib' |
|
|
|
import type { User } from '~/lib' |
|
|
|
import { ProjectRole, Role } from '~/lib' |
|
|
|
import { ProjectRole, Role } from '~/lib' |
|
|
|
|
|
|
|
|
|
|
@ -75,7 +75,6 @@ const saveUser = async () => { |
|
|
|
await formRef.value?.validateFields() |
|
|
|
await formRef.value?.validateFields() |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
// todo: update sdk(swagger.json) |
|
|
|
// todo: update sdk(swagger.json) |
|
|
|
const res = await $api.orgUsers.add({ |
|
|
|
const res = await $api.orgUsers.add({ |
|
|
|
roles: usersData.role, |
|
|
|
roles: usersData.role, |
|
|
@ -126,8 +125,7 @@ const clickInviteMore = () => { |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="flex flex-col"> |
|
|
|
<div class="flex flex-col"> |
|
|
|
<div class="flex flex-row justify-between items-center pb-1.5 mb-2 border-b-1 w-full"> |
|
|
|
<div class="flex flex-row justify-between items-center pb-1.5 mb-2 border-b-1 w-full"> |
|
|
|
<a-typography-title class="select-none" :level="4"> {{ $t('activity.inviteUser') }} |
|
|
|
<a-typography-title class="select-none" :level="4"> {{ $t('activity.inviteUser') }} </a-typography-title> |
|
|
|
</a-typography-title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-button type="text" class="!rounded-md mr-1 -mt-1.5" @click="emit('closed')"> |
|
|
|
<a-button type="text" class="!rounded-md mr-1 -mt-1.5" @click="emit('closed')"> |
|
|
|
<template #icon> |
|
|
|
<template #icon> |
|
|
@ -180,8 +178,7 @@ const clickInviteMore = () => { |
|
|
|
<div v-else class="flex flex-col pb-4"> |
|
|
|
<div v-else class="flex flex-col pb-4"> |
|
|
|
<div class="flex flex-row items-center pl-2 pb-1 h-[1rem]"> |
|
|
|
<div class="flex flex-row items-center pl-2 pb-1 h-[1rem]"> |
|
|
|
<MdiAccountOutline /> |
|
|
|
<MdiAccountOutline /> |
|
|
|
<div class="text-xs ml-0.5 mt-0.5">{{$t('activity.inviteUser') }} |
|
|
|
<div class="text-xs ml-0.5 mt-0.5">{{ $t('activity.inviteUser') }}</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="border-1 py-3 px-4 rounded-md mt-1"> |
|
|
|
<div class="border-1 py-3 px-4 rounded-md mt-1"> |
|
|
@ -202,30 +199,23 @@ const clickInviteMore = () => { |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="ml-1 mb-1 text-xs text-gray-500">{{ $t('datatype.Email') }}:</div> |
|
|
|
<div class="ml-1 mb-1 text-xs text-gray-500">{{ $t('datatype.Email') }}:</div> |
|
|
|
|
|
|
|
|
|
|
|
<a-input |
|
|
|
<a-input v-model:value="usersData.emails" validate-trigger="onBlur" :placeholder="$t('labels.email')" /> |
|
|
|
v-model:value="usersData.emails" |
|
|
|
|
|
|
|
validate-trigger="onBlur" |
|
|
|
|
|
|
|
:placeholder="$t('labels.email')" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col w-1/4"> |
|
|
|
<div class="flex flex-col w-2/4"> |
|
|
|
<a-form-item name="role" :rules="[{ required: true, message: 'Role required' }]"> |
|
|
|
<a-form-item name="role" :rules="[{ required: true, message: 'Role required' }]"> |
|
|
|
<div class="ml-1 mb-1 text-xs text-gray-500">{{ $t('labels.selectUserRole') }}</div> |
|
|
|
<div class="ml-1 mb-1 text-xs text-gray-500">{{ $t('labels.selectUserRole') }}</div> |
|
|
|
|
|
|
|
|
|
|
|
<a-select v-model:value="usersData.role" class="nc-user-roles" |
|
|
|
<a-select v-model:value="usersData.role" class="nc-user-roles" dropdown-class-name="nc-dropdown-user-role"> |
|
|
|
dropdown-class-name="nc-dropdown-user-role"> |
|
|
|
<a-select-option :value="Role.OrgLevelCreator" :label="$t(`objects.roleType.orgLevelCreator`)"> |
|
|
|
<a-select-option v-for="(role, index) in [Role.OrgLevelViewer, Role.OrgLevelCreator]" :key="index" :value="role" |
|
|
|
<div>{{ $t(`objects.roleType.orgLevelCreator`) }}</div> |
|
|
|
class="nc-role-option"> |
|
|
|
<span class="text-gray-500 text-xs whitespace-normal ">Creator can create new projects and access any invited project.</span> |
|
|
|
<div class="flex flex-row h-full justify-start items-center"> |
|
|
|
</a-select-option> |
|
|
|
<div |
|
|
|
|
|
|
|
class="px-2 py-1 flex rounded-full text-xs" |
|
|
|
<a-select-option :value="Role.OrgLevelViewer" :label="$t(`objects.roleType.orgLevelViewer`)"> |
|
|
|
:style="{ backgroundColor: projectRoleTagColors[role] }" |
|
|
|
<div>{{ $t(`objects.roleType.orgLevelViewer`) }}</div> |
|
|
|
> |
|
|
|
<span class="text-gray-500 text-xs whitespace-normal">Viewer is not allowed to create new projects but they can access any invited project.</span> |
|
|
|
{{ role }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
@ -234,7 +224,6 @@ const clickInviteMore = () => { |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-row justify-center"> |
|
|
|
<div class="flex flex-row justify-center"> |
|
|
|
<a-button type="primary" html-type="submit"> |
|
|
|
<a-button type="primary" html-type="submit"> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-row justify-center items-center space-x-1.5"> |
|
|
|
<div class="flex flex-row justify-center items-center space-x-1.5"> |
|
|
|
<MaterialSymbolsSendOutline class="flex h-[0.8rem]" /> |
|
|
|
<MaterialSymbolsSendOutline class="flex h-[0.8rem]" /> |
|
|
|
<div>{{ $t('activity.invite') }}</div> |
|
|
|
<div>{{ $t('activity.invite') }}</div> |
|
|
|