|
|
@ -1,14 +1,20 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { Form, message } from 'ant-design-vue' |
|
|
|
import { Form, message } from 'ant-design-vue' |
|
|
|
import { useClipboard } from '@vueuse/core' |
|
|
|
|
|
|
|
import ShareBase from './ShareBase.vue' |
|
|
|
import ShareBase from './ShareBase.vue' |
|
|
|
import SendIcon from '~icons/material-symbols/send-outline' |
|
|
|
import { |
|
|
|
import CloseIcon from '~icons/material-symbols/close-rounded' |
|
|
|
computed, |
|
|
|
import MidAccountIcon from '~icons/mdi/account-outline' |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
import ContentCopyIcon from '~icons/mdi/content-copy' |
|
|
|
isEmail, |
|
|
|
import type { User } from '~/lib/types' |
|
|
|
onMounted, |
|
|
|
import { ProjectRole } from '~/lib/enums' |
|
|
|
projectRoles, |
|
|
|
import { extractSdkResponseErrorMsg, isEmail, projectRoleTagColors, projectRoles } from '~/utils' |
|
|
|
ref, |
|
|
|
|
|
|
|
useClipboard, |
|
|
|
|
|
|
|
useDashboard, |
|
|
|
|
|
|
|
useNuxtApp, |
|
|
|
|
|
|
|
useProject, |
|
|
|
|
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
import type { User } from '~/lib' |
|
|
|
|
|
|
|
import { ProjectRole } from '~/lib' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
show: boolean |
|
|
|
show: boolean |
|
|
@ -22,6 +28,7 @@ interface Users { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { show, selectedUser } = defineProps<Props>() |
|
|
|
const { show, selectedUser } = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['closed', 'reload']) |
|
|
|
const emit = defineEmits(['closed', 'reload']) |
|
|
|
|
|
|
|
|
|
|
|
const { project } = useProject() |
|
|
|
const { project } = useProject() |
|
|
@ -96,14 +103,13 @@ const saveUser = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const inviteUrl = $computed(() => |
|
|
|
const inviteUrl = $computed(() => (usersData.invitationToken ? `${dashboardUrl}/signup/${usersData.invitationToken}` : null)) |
|
|
|
usersData.invitationToken ? `${dashboardUrl}/user/authentication/signup/${usersData.invitationToken}` : null, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const copyUrl = async () => { |
|
|
|
const copyUrl = async () => { |
|
|
|
if (!inviteUrl) return |
|
|
|
if (!inviteUrl) return |
|
|
|
|
|
|
|
|
|
|
|
copy(inviteUrl) |
|
|
|
await copy(inviteUrl) |
|
|
|
|
|
|
|
|
|
|
|
message.success('Copied shareable base url to clipboard!') |
|
|
|
message.success('Copied shareable base url to clipboard!') |
|
|
|
|
|
|
|
|
|
|
|
$e('c:shared-base:copy-url') |
|
|
|
$e('c:shared-base:copy-url') |
|
|
@ -124,7 +130,7 @@ const clickInviteMore = () => { |
|
|
|
<a-typography-title class="select-none" :level="4"> {{ $t('activity.share') }}: {{ project.title }} </a-typography-title> |
|
|
|
<a-typography-title class="select-none" :level="4"> {{ $t('activity.share') }}: {{ project.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> |
|
|
|
<CloseIcon class="flex mx-auto" /> |
|
|
|
<MaterialSymbolsCloseRounded class="flex mx-auto" /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -133,7 +139,7 @@ const clickInviteMore = () => { |
|
|
|
<template v-if="usersData.invitationToken"> |
|
|
|
<template v-if="usersData.invitationToken"> |
|
|
|
<div class="flex flex-col mt-1 border-b-1 pb-5"> |
|
|
|
<div class="flex flex-col mt-1 border-b-1 pb-5"> |
|
|
|
<div class="flex flex-row items-center pl-1.5 pb-1 h-[1.1rem]"> |
|
|
|
<div class="flex flex-row items-center pl-1.5 pb-1 h-[1.1rem]"> |
|
|
|
<MidAccountIcon /> |
|
|
|
<MdiAccountOutline /> |
|
|
|
<div class="text-xs ml-0.5 mt-0.5">Copy Invite Token</div> |
|
|
|
<div class="text-xs ml-0.5 mt-0.5">Copy Invite Token</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -145,7 +151,7 @@ const clickInviteMore = () => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<a-button type="text" class="!rounded-md -mt-0.5" @click="copyUrl"> |
|
|
|
<a-button type="text" class="!rounded-md -mt-0.5" @click="copyUrl"> |
|
|
|
<template #icon> |
|
|
|
<template #icon> |
|
|
|
<ContentCopyIcon class="flex mx-auto text-green-700 h-[1rem]" /> |
|
|
|
<MdiContentCopy class="flex mx-auto text-green-700 h-[1rem]" /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -159,7 +165,7 @@ const clickInviteMore = () => { |
|
|
|
<div class="flex flex-row justify-start mt-4 ml-2"> |
|
|
|
<div class="flex flex-row justify-start mt-4 ml-2"> |
|
|
|
<a-button size="small" outlined @click="clickInviteMore"> |
|
|
|
<a-button size="small" outlined @click="clickInviteMore"> |
|
|
|
<div class="flex flex-row justify-center items-center space-x-0.5"> |
|
|
|
<div class="flex flex-row justify-center items-center space-x-0.5"> |
|
|
|
<SendIcon class="flex mx-auto text-gray-600 h-[0.8rem]" /> |
|
|
|
<MaterialSymbolsSendOutline class="flex mx-auto text-gray-600 h-[0.8rem]" /> |
|
|
|
<div class="text-xs text-gray-600">{{ $t('activity.inviteMore') }}</div> |
|
|
|
<div class="text-xs text-gray-600">{{ $t('activity.inviteMore') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
@ -168,7 +174,7 @@ const clickInviteMore = () => { |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<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]"> |
|
|
|
<MidAccountIcon /> |
|
|
|
<MdiAccountOutline /> |
|
|
|
<div class="text-xs ml-0.5 mt-0.5">{{ selectedUser ? 'Edit User' : 'Invite Team' }}</div> |
|
|
|
<div class="text-xs ml-0.5 mt-0.5">{{ selectedUser ? 'Edit User' : 'Invite Team' }}</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"> |
|
|
@ -218,7 +224,7 @@ const clickInviteMore = () => { |
|
|
|
<a-button type="primary" html-type="submit"> |
|
|
|
<a-button type="primary" html-type="submit"> |
|
|
|
<div v-if="selectedUser">{{ $t('general.save') }}</div> |
|
|
|
<div v-if="selectedUser">{{ $t('general.save') }}</div> |
|
|
|
<div v-else class="flex flex-row justify-center items-center space-x-1.5"> |
|
|
|
<div v-else class="flex flex-row justify-center items-center space-x-1.5"> |
|
|
|
<SendIcon class="flex h-[0.8rem]" /> |
|
|
|
<MaterialSymbolsSendOutline class="flex h-[0.8rem]" /> |
|
|
|
<div>{{ $t('activity.invite') }}</div> |
|
|
|
<div>{{ $t('activity.invite') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|