feat: minor ui improvements on invite flow
This commit is contained in:
@@ -1,7 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<SmartModal v-if="show" :title="$t('team.invite')" @close="hideModal">
|
<SmartModal v-if="show" :title="$t('team.invite')" @close="hideModal">
|
||||||
<template #body>
|
<template #body>
|
||||||
<div class="flex flex-col px-2">
|
<div v-if="sendInvitesResult.length" class="flex flex-col px-4">
|
||||||
|
<div class="flex flex-col max-w-md justify-center items-center">
|
||||||
|
<SmartIcon class="h-6 text-accent w-6" name="users" />
|
||||||
|
<h3 class="my-2 text-center text-lg">
|
||||||
|
{{ $t("team.we_sent_invite_link") }}
|
||||||
|
</h3>
|
||||||
|
<p class="text-center">
|
||||||
|
{{ $t("team.we_sent_invite_link_description") }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex space-y-2 px-4 pt-8 flex-col">
|
||||||
|
<div
|
||||||
|
v-for="(invitee, index) in sendInvitesResult"
|
||||||
|
:key="`invitee-${index}`"
|
||||||
|
class="flex items-center"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="material-icons mr-4"
|
||||||
|
:class="
|
||||||
|
invitee.status === 'error' ? 'text-red-500' : 'text-green-500'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ invitee.status === "error" ? "error" : "check_circle" }}
|
||||||
|
</i>
|
||||||
|
<span class="flex truncate">{{ invitee.email }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="flex flex-col px-2">
|
||||||
<div class="flex flex-1 justify-between items-center">
|
<div class="flex flex-1 justify-between items-center">
|
||||||
<label for="memberList" class="pb-4 px-4">
|
<label for="memberList" class="pb-4 px-4">
|
||||||
{{ $t("team.pending_invites") }}
|
{{ $t("team.pending_invites") }}
|
||||||
@@ -121,7 +149,7 @@
|
|||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
<tippy
|
<tippy
|
||||||
:ref="`newMemberOptions-${index}`"
|
ref="newInviteeOptions"
|
||||||
interactive
|
interactive
|
||||||
trigger="click"
|
trigger="click"
|
||||||
theme="popover"
|
theme="popover"
|
||||||
@@ -150,15 +178,30 @@
|
|||||||
</template>
|
</template>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
label="OWNER"
|
label="OWNER"
|
||||||
@click.native="updateNewInviteeRole(index, 'OWNER')"
|
@click.native="
|
||||||
|
() => {
|
||||||
|
updateNewInviteeRole(index, 'OWNER')
|
||||||
|
newInviteeOptions[index].tippy().hide()
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
label="EDITOR"
|
label="EDITOR"
|
||||||
@click.native="updateNewInviteeRole(index, 'EDITOR')"
|
@click.native="
|
||||||
|
() => {
|
||||||
|
updateNewInviteeRole(index, 'EDITOR')
|
||||||
|
newInviteeOptions[index].tippy().hide()
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<SmartItem
|
<SmartItem
|
||||||
label="VIEWER"
|
label="VIEWER"
|
||||||
@click.native="updateNewInviteeRole(index, 'VIEWER')"
|
@click.native="
|
||||||
|
() => {
|
||||||
|
updateNewInviteeRole(index, 'VIEWER')
|
||||||
|
newInviteeOptions[index].tippy().hide()
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</tippy>
|
</tippy>
|
||||||
</span>
|
</span>
|
||||||
@@ -197,7 +240,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span>
|
<p
|
||||||
|
v-if="sendInvitesResult.length"
|
||||||
|
class="flex flex-1 text-secondaryLight justify-between"
|
||||||
|
>
|
||||||
|
<SmartAnchor
|
||||||
|
class="link"
|
||||||
|
:label="`← \xA0 ${$t('team.invite_more')}`"
|
||||||
|
@click.native="
|
||||||
|
() => {
|
||||||
|
sendInvitesResult = []
|
||||||
|
newInvites = []
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<SmartAnchor
|
||||||
|
class="link"
|
||||||
|
:label="`${$t('action.dismiss')}`"
|
||||||
|
@click.native="hideModal"
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
<span v-else>
|
||||||
<ButtonPrimary :label="$t('team.invite')" @click.native="sendInvites" />
|
<ButtonPrimary :label="$t('team.invite')" @click.native="sendInvites" />
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
:label="$t('action.cancel')"
|
:label="$t('action.cancel')"
|
||||||
@@ -234,6 +297,8 @@ const {
|
|||||||
} = useContext()
|
} = useContext()
|
||||||
const t = i18n.t.bind(i18n)
|
const t = i18n.t.bind(i18n)
|
||||||
|
|
||||||
|
const newInviteeOptions = ref<any | null>(null)
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
editingteamID: { type: String, default: null },
|
editingteamID: { type: String, default: null },
|
||||||
@@ -303,7 +368,7 @@ const removeNewInvitee = (id: number) => {
|
|||||||
newInvites.value.splice(id, 1)
|
newInvites.value.splice(id, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = ref<
|
const sendInvitesResult = ref<
|
||||||
Array<{
|
Array<{
|
||||||
email: Email
|
email: Email
|
||||||
status: "error" | "success"
|
status: "error" | "success"
|
||||||
@@ -335,7 +400,7 @@ const sendInvites = async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
result.value = await pipe(
|
sendInvitesResult.value = await pipe(
|
||||||
A.sequence(T.task)(validationResult.value),
|
A.sequence(T.task)(validationResult.value),
|
||||||
T.chain(
|
T.chain(
|
||||||
flow(
|
flow(
|
||||||
@@ -361,6 +426,8 @@ const sendInvites = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const hideModal = () => {
|
const hideModal = () => {
|
||||||
|
sendInvitesResult.value = []
|
||||||
|
newInvites.value = []
|
||||||
emit("hide-modal")
|
emit("hide-modal")
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -479,6 +479,7 @@
|
|||||||
"invalid_email_format": "Email format is invalid",
|
"invalid_email_format": "Email format is invalid",
|
||||||
"invalid_member_permission": "Please provide a valid permission to the team member",
|
"invalid_member_permission": "Please provide a valid permission to the team member",
|
||||||
"invite": "Invite",
|
"invite": "Invite",
|
||||||
|
"invite_more": "Invite more",
|
||||||
"invite_tooltip": "Invite people to this workspace",
|
"invite_tooltip": "Invite people to this workspace",
|
||||||
"invited_to_team": "{owner} invited you to join {team}",
|
"invited_to_team": "{owner} invited you to join {team}",
|
||||||
"join_beta": "Join the beta program to access teams.",
|
"join_beta": "Join the beta program to access teams.",
|
||||||
@@ -496,7 +497,9 @@
|
|||||||
"permissions": "Permissions",
|
"permissions": "Permissions",
|
||||||
"saved": "Team saved",
|
"saved": "Team saved",
|
||||||
"select_a_team": "Select a team",
|
"select_a_team": "Select a team",
|
||||||
"title": "Teams"
|
"title": "Teams",
|
||||||
|
"we_sent_invite_link": "We sent an invite link to all invitees!",
|
||||||
|
"we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the team."
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"failed": "test failed",
|
"failed": "test failed",
|
||||||
|
|||||||
Reference in New Issue
Block a user