mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary
Backport of #8245 to cloud/1.37.
Add team workspace member management and invite system.
- Add members panel with role management (owner/admin/member) and member
removal
- Add invite system with email invites, pending invite display, and
revoke functionality
- Add invite URL loading for accepting invites
- Add subscription panel updates for member management
- Add i18n translations for member and invite features
## Conflict Resolution
- `src/components/dialog/GlobalDialog.vue`: Added missing
`DialogPassThroughOptions` import
- `src/locales/en/main.json`: Kept "nightly" section from main (was
present before PR)
- `src/platform/cloud/subscription/utils/subscriptionCheckoutUtil.ts`:
Deleted (file doesn't exist in cloud/1.37, only contains unrelated
method rename)
(cherry picked from commit 4771565486)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8301-backport-cloud-1-37-Workspaces-4-members-invites-2f36d73d36508119a388dac9d290efbd)
by [Unito](https://www.unito.io)
80 lines
2.3 KiB
Vue
80 lines
2.3 KiB
Vue
<template>
|
|
<div
|
|
class="flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background"
|
|
>
|
|
<!-- Header -->
|
|
<div
|
|
class="flex h-12 items-center justify-between border-b border-border-default px-4"
|
|
>
|
|
<h2 class="m-0 text-sm font-normal text-base-foreground">
|
|
{{ $t('workspacePanel.revokeInviteDialog.title') }}
|
|
</h2>
|
|
<button
|
|
class="cursor-pointer rounded border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-secondary-foreground"
|
|
:aria-label="$t('g.close')"
|
|
@click="onCancel"
|
|
>
|
|
<i class="pi pi-times size-4" />
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Body -->
|
|
<div class="px-4 py-4">
|
|
<p class="m-0 text-sm text-muted-foreground">
|
|
{{ $t('workspacePanel.revokeInviteDialog.message') }}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="flex items-center justify-end gap-4 px-4 py-4">
|
|
<Button variant="muted-textonly" @click="onCancel">
|
|
{{ $t('g.cancel') }}
|
|
</Button>
|
|
<Button variant="destructive" size="lg" :loading @click="onRevoke">
|
|
{{ $t('workspacePanel.revokeInviteDialog.revoke') }}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useToast } from 'primevue/usetoast'
|
|
import { ref } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import Button from '@/components/ui/button/Button.vue'
|
|
import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
|
|
import { useDialogStore } from '@/stores/dialogStore'
|
|
|
|
const { inviteId } = defineProps<{
|
|
inviteId: string
|
|
}>()
|
|
|
|
const dialogStore = useDialogStore()
|
|
const workspaceStore = useTeamWorkspaceStore()
|
|
const toast = useToast()
|
|
const { t } = useI18n()
|
|
const loading = ref(false)
|
|
|
|
function onCancel() {
|
|
dialogStore.closeDialog({ key: 'revoke-invite' })
|
|
}
|
|
|
|
async function onRevoke() {
|
|
loading.value = true
|
|
try {
|
|
await workspaceStore.revokeInvite(inviteId)
|
|
dialogStore.closeDialog({ key: 'revoke-invite' })
|
|
} catch (error) {
|
|
toast.add({
|
|
severity: 'error',
|
|
summary: t('g.error'),
|
|
detail: error instanceof Error ? error.message : undefined,
|
|
life: 3000
|
|
})
|
|
} finally {
|
|
loading.value = false
|
|
}
|
|
}
|
|
</script>
|