mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
refactor: removed dead code, added i18n vaues, misc improvements
This commit is contained in:
@@ -156,9 +156,7 @@ const inviteTooltip = computed(() => {
|
|||||||
|
|
||||||
function handleInviteMember() {
|
function handleInviteMember() {
|
||||||
if (isInviteLimitReached.value) return
|
if (isInviteLimitReached.value) return
|
||||||
showInviteMemberDialog((_email: string) => {
|
showInviteMemberDialog()
|
||||||
// TODO: Implement actual invite member API call
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const menuItems = computed(() => {
|
const menuItems = computed(() => {
|
||||||
|
|||||||
@@ -115,17 +115,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useToast } from 'primevue/usetoast'
|
import { useToast } from 'primevue/usetoast'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import Button from '@/components/ui/button/Button.vue'
|
import Button from '@/components/ui/button/Button.vue'
|
||||||
import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
|
import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
|
||||||
import { useDialogStore } from '@/stores/dialogStore'
|
import { useDialogStore } from '@/stores/dialogStore'
|
||||||
|
|
||||||
const { onConfirm } = defineProps<{
|
|
||||||
onConfirm: (email: string) => void | Promise<void>
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const dialogStore = useDialogStore()
|
const dialogStore = useDialogStore()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
const { t } = useI18n()
|
||||||
const workspaceStore = useTeamWorkspaceStore()
|
const workspaceStore = useTeamWorkspaceStore()
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
@@ -148,7 +146,6 @@ async function onCreateLink() {
|
|||||||
try {
|
try {
|
||||||
generatedLink.value = await workspaceStore.createInviteLink(email.value)
|
generatedLink.value = await workspaceStore.createInviteLink(email.value)
|
||||||
step.value = 'link'
|
step.value = 'link'
|
||||||
await onConfirm(email.value)
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
@@ -159,13 +156,13 @@ async function onCopyLink() {
|
|||||||
await navigator.clipboard.writeText(generatedLink.value)
|
await navigator.clipboard.writeText(generatedLink.value)
|
||||||
toast.add({
|
toast.add({
|
||||||
severity: 'success',
|
severity: 'success',
|
||||||
summary: 'Copied',
|
summary: t('workspacePanel.inviteMemberDialog.linkCopied'),
|
||||||
life: 2000
|
life: 2000
|
||||||
})
|
})
|
||||||
} catch {
|
} catch {
|
||||||
toast.add({
|
toast.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Failed to copy link',
|
summary: t('workspacePanel.inviteMemberDialog.linkCopyFailed'),
|
||||||
life: 3000
|
life: 3000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,8 +267,9 @@ const workspaceTierName = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const canUpgrade = computed(() => {
|
const canUpgrade = computed(() => {
|
||||||
// For workspace-based subscriptions, can upgrade if not on highest tier
|
// PRO is currently the only/highest tier, so no upgrades available
|
||||||
return isWorkspaceSubscribed.value && subscriptionPlan.value !== null
|
// This will need updating when additional tiers are added
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
const showPlansAndPricing = computed(
|
const showPlansAndPricing = computed(
|
||||||
|
|||||||
@@ -2177,7 +2177,9 @@
|
|||||||
"message": "Make sure their account uses this email.",
|
"message": "Make sure their account uses this email.",
|
||||||
"copyLink": "Copy Link",
|
"copyLink": "Copy Link",
|
||||||
"done": "Done"
|
"done": "Done"
|
||||||
}
|
},
|
||||||
|
"linkCopied": "Copied",
|
||||||
|
"linkCopyFailed": "Failed to copy link"
|
||||||
},
|
},
|
||||||
"createWorkspaceDialog": {
|
"createWorkspaceDialog": {
|
||||||
"title": "Create a new workspace",
|
"title": "Create a new workspace",
|
||||||
|
|||||||
@@ -576,15 +576,12 @@ export const useDialogService = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function showInviteMemberDialog(
|
async function showInviteMemberDialog() {
|
||||||
onConfirm: (email: string) => void | Promise<void>
|
|
||||||
) {
|
|
||||||
const { default: component } =
|
const { default: component } =
|
||||||
await import('@/components/dialog/content/workspace/InviteMemberDialogContent.vue')
|
await import('@/components/dialog/content/workspace/InviteMemberDialogContent.vue')
|
||||||
return dialogStore.showDialog({
|
return dialogStore.showDialog({
|
||||||
key: 'invite-member',
|
key: 'invite-member',
|
||||||
component,
|
component,
|
||||||
props: { onConfirm },
|
|
||||||
dialogComponentProps: {
|
dialogComponentProps: {
|
||||||
...workspaceDialogPt,
|
...workspaceDialogPt,
|
||||||
pt: {
|
pt: {
|
||||||
|
|||||||
Reference in New Issue
Block a user