feat(tenant): enhance tenant information update with description field and add global invitation bell component

Updated the tenant information API to allow editing of both name and description fields, improving user experience in managing tenant details. Introduced a new GlobalInvitationBell component to display pending invitations in the UI, ensuring users can easily access their invitations without navigating away from their current context. Additionally, updated internationalization files to support new description-related messages.

Refs: #1303
This commit is contained in:
wizardchen
2026-05-18 10:59:12 +08:00
committed by lyingbug
parent ce67ba0310
commit b0b05b49c5
11 changed files with 291 additions and 142 deletions
-71
View File
@@ -24,19 +24,6 @@
<div class="user-email">{{ userEmail }}</div>
</template>
</div>
<!-- Pending-invitations bell. Sits in the trailing-icon slot
of the avatar row (visually similar to a "升级/store" CTA
icon in other products). Only renders when there is at
least one pending invitation so the row stays minimal in
the common empty-inbox case. Click-stop so the dropdown
doesn't open along with the navigation. -->
<t-badge v-if="pendingInvitationCount > 0" :count="pendingInvitationCount" :max-count="99" :offset="[6, 4]"
class="user-inbox-badge-wrap">
<button type="button" class="user-inbox-btn" :title="$t('tenantInvitation.inboxTooltip')"
@click.stop="goToInvitations">
<t-icon name="notification" size="18px" />
</button>
</t-badge>
<t-icon :name="menuVisible ? 'chevron-up' : 'chevron-down'" class="dropdown-icon" />
</template>
</div>
@@ -231,7 +218,6 @@
<!-- 创建工作区弹窗 -->
<CreateTenantDialog v-model:visible="createTenantDialogVisible" @created="onTenantCreated" />
<MyInvitationsDialog v-model:visible="invitationsDialogVisible" />
</div>
</template>
@@ -245,7 +231,6 @@ import { getCurrentUser, logout as logoutApi } from '@/api/auth'
import { useI18n } from 'vue-i18n'
import IMChannelsOverviewPanel from '@/components/IMChannelsOverviewPanel.vue'
import CreateTenantDialog from '@/components/CreateTenantDialog.vue'
import MyInvitationsDialog from '@/components/MyInvitationsDialog.vue'
import { listAllIMChannels, type IMChannelOverview } from '@/api/agent'
import { navigateAfterTenantSwitch } from '@/utils/tenantSwitch'
import type { TenantInfo } from '@/api/tenant'
@@ -327,25 +312,6 @@ const toggleMenu = () => {
menuVisible.value = !menuVisible.value
}
// Pending invitation count surfaced as the trailing bell on the
// avatar row. Reads directly from the auth store so the App.vue
// poller and any local accept/decline updates flow through here
// without a separate fetch. The visual badge cap (99+) is handled
// by t-badge's max-count, so we just expose the raw count.
const pendingInvitationCount = computed(() => authStore.pendingInvitationCount)
// Clicking the bell opens the invitations dialog inline. Previously
// this navigated to /platform/invitations, but the inbox is short-
// lived ("see what's pending, accept or decline, dismiss") and a
// dialog keeps the user in whatever context they came from. We
// also close the avatar dropdown if it's open so the modal doesn't
// fight with a stale hover panel.
const invitationsDialogVisible = ref(false)
const goToInvitations = () => {
menuVisible.value = false
invitationsDialogVisible.value = true
}
// 快捷导航到设置的特定部分
const handleQuickNav = (section: string) => {
menuVisible.value = false
@@ -853,43 +819,6 @@ onUnmounted(() => {
transition: transform 0.2s;
}
/* Pending-invitations bell, sits between user-info and the chevron.
The button itself is a transparent 28x28 click target sized to
match the avatar row's other trailing affordances; t-badge wraps
it and positions its own counter pill in the top-right via the
:offset prop, so we don't try to recreate badge positioning here. */
.user-inbox-badge-wrap {
display: inline-flex;
align-items: center;
margin: 0 2px;
flex-shrink: 0;
}
.user-inbox-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: none;
border-radius: 8px;
background: transparent;
color: var(--td-text-color-secondary);
cursor: pointer;
transition: background-color 0.18s ease, color 0.18s ease;
&:hover {
background-color: var(--td-bg-color-secondarycontainer);
color: var(--td-brand-color);
}
&:focus-visible {
outline: 2px solid var(--td-brand-color-focus);
outline-offset: 1px;
}
}
.user-dropdown {
position: absolute;
bottom: 100%;