Skip to content

Commit 4e81cde

Browse files
committed
fix(FR-2817): unclip folder-status invitation badge and add /data invitation entry point
Resolves #7251(FR-2817) Two regressions surfaced after the storage-status widget moved to the dashboard: (1) the red `+N` badge over `초대된 폴더` was placed with a negative Y-offset that pushed it above the dashboard card body and got clipped, and (2) the `/data` page offered no in-page entry point to view, accept, or reject pending invitations — the user could only reach the invitation modal via the (clipped) badge. - StorageStatusPanelCard: drop the negative Y offset on the invitation Badge (`offset={[-token.sizeXS, 0]}`) so it overlays the title's top-right corner inside the card body bounds. - VFolderNodeListPage: add a `Pending invitations` button with a count badge next to `Create Folder` whenever `useVFolderInvitations()` reports any pending invitation. Clicking it sets `?invitation=true`, which the existing global `FolderInvitationResponseModalOpener` already binds to to open the accept/reject modal. - i18n: add `data.invitation.PendingInvitations` to all 21 locales. Verification: - Relay: PASS - Lint: PASS - Format: PASS - TypeScript: pre-existing failures only (unrelated)
1 parent 00572ee commit 4e81cde

23 files changed

Lines changed: 55 additions & 10 deletions

react/src/components/StorageStatusPanelCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const StorageStatusPanelCard: React.FC<StorageStatusPanelProps> = ({
208208
>
209209
<Badge
210210
count={`+${invitationCount}`}
211-
offset={[-`${token.sizeXS}`, -`${token.sizeXS}`]}
211+
offset={[-token.sizeXS, 0]}
212212
>
213213
<Typography.Text
214214
style={{ fontSize: token.fontSizeHeading5 }}

react/src/pages/VFolderNodeListPage.tsx

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ import { graphql, useLazyLoadQuery } from 'react-relay';
3939
import { useBAIPaginationOptionStateOnSearchParamLegacy } from 'src/hooks/reactPaginationQueryOptions';
4040
import { useBAISettingUserState } from 'src/hooks/useBAISetting';
4141
import { useVFolderInvitations } from 'src/hooks/useVFolderInvitations';
42-
import { StringParam, useQueryParams, withDefault } from 'use-query-params';
42+
import {
43+
StringParam,
44+
useQueryParam,
45+
useQueryParams,
46+
withDefault,
47+
} from 'use-query-params';
4348

4449
export const isDeletedCategory = (status?: string | null) => {
4550
return _.includes(
@@ -93,6 +98,7 @@ const VFolderNodeListPage: React.FC<VFolderNodeListPageProps> = ({
9398
const currentProject = useCurrentProjectValue();
9499
const baiClient = useSuspendedBackendaiClient();
95100
const [invitations] = useVFolderInvitations();
101+
const [, setInvitationOpen] = useQueryParam('invitation', StringParam);
96102

97103
const [columnOverrides, setColumnOverrides] = useBAISettingUserState(
98104
'table_column_overrides.VFolderNodeListPage',
@@ -255,14 +261,32 @@ const VFolderNodeListPage: React.FC<VFolderNodeListPageProps> = ({
255261
variant="borderless"
256262
title={t('data.Folders')}
257263
extra={
258-
<BAIButton
259-
type="primary"
260-
onClick={() => {
261-
toggleCreateModal();
262-
}}
263-
>
264-
{t('data.CreateFolder')}
265-
</BAIButton>
264+
<BAIFlex gap="xs" align="center">
265+
{invitations.length > 0 && (
266+
<Badge
267+
count={invitations.length}
268+
color={token.colorWarning}
269+
size="small"
270+
offset={[-token.sizeXS, token.sizeXS]}
271+
>
272+
<BAIButton
273+
onClick={() => {
274+
setInvitationOpen('true', 'replaceIn');
275+
}}
276+
>
277+
{t('data.invitation.PendingInvitations')}
278+
</BAIButton>
279+
</Badge>
280+
)}
281+
<BAIButton
282+
type="primary"
283+
onClick={() => {
284+
toggleCreateModal();
285+
}}
286+
>
287+
{t('data.CreateFolder')}
288+
</BAIButton>
289+
</BAIFlex>
266290
}
267291
styles={{
268292
header: {

resources/i18n/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "Niemand eingeladen, da Einladung bereits existiert",
825825
"NoOneWasShared": "Fehler beim Freigeben des Gruppenordners",
826826
"NoValidEmails": "Es wurden keine gültigen E-Mails eingegeben",
827+
"PendingInvitations": "Ausstehende Einladungen",
827828
"Shared": "Gruppenordner erfolgreich freigegeben",
828829
"SharingError": "Die Freigabe ist fehlgeschlagen. Der Benutzer ist möglicherweise bereits freigegeben oder gehört nicht zu dem entsprechenden Projekt.",
829830
"SuccessfullyAcceptedInvitation": "Erfolgreich akzeptierte Einladung",

resources/i18n/el.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "Κανείς δεν έχει προσκληθεί αφού υπάρχει ήδη πρόσκληση",
825825
"NoOneWasShared": "Αποτυχία κοινοποίησης του φακέλου ομάδας",
826826
"NoValidEmails": "Δεν καταχωρήθηκαν έγκυρα μηνύματα ηλεκτρονικού ταχυδρομείου",
827+
"PendingInvitations": "Εκκρεμείς προσκλήσεις",
827828
"Shared": "Κοινοποιήθηκε επιτυχώς ο φάκελος της ομάδας",
828829
"SharingError": "Η κοινή χρήση απέτυχε. Ο χρήστης ενδέχεται να έχει ήδη κοινοποιηθεί ή δεν ανήκει σε κατάλληλο έργο.",
829830
"SuccessfullyAcceptedInvitation": "Επιτυχώς αποδεκτή πρόσκληση",

resources/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@
825825
"NoOneWasInvited": "No one invited since invitation already exists",
826826
"NoOneWasShared": "Failed to share the group folder",
827827
"NoValidEmails": "No valid emails were entered",
828+
"PendingInvitations": "Pending invitations",
828829
"Shared": "Successfully shared the group folder",
829830
"SharingError": "Sharing failed. User may already be shared or does not belong to appropriate project.",
830831
"SuccessfullyAcceptedInvitation": "Successfully accepted invitation",

resources/i18n/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "No se invita a nadie puesto que la invitación ya existe",
825825
"NoOneWasShared": "Error al compartir la carpeta de grupo",
826826
"NoValidEmails": "No se han introducido correos electrónicos válidos",
827+
"PendingInvitations": "Invitaciones pendientes",
827828
"Shared": "Compartida con éxito la carpeta de grupo",
828829
"SharingError": "Error al compartir. Es posible que el usuario ya esté compartido o que no pertenezca al proyecto adecuado.",
829830
"SuccessfullyAcceptedInvitation": "Invitación aceptada con éxito",

resources/i18n/fi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "Ketään ei ole kutsuttu, koska kutsu on jo olemassa",
825825
"NoOneWasShared": "Ryhmäkansion jakaminen epäonnistui",
826826
"NoValidEmails": "Kelvollisia sähköposteja ei ole syötetty",
827+
"PendingInvitations": "Odottavat kutsut",
827828
"Shared": "Ryhmäkansion jakaminen onnistui",
828829
"SharingError": "Jakaminen epäonnistui. Käyttäjä on ehkä jo jaettu tai ei kuulu asianmukaiseen projektiin.",
829830
"SuccessfullyAcceptedInvitation": "Onnistuneesti hyväksytty kutsu",

resources/i18n/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "Personne n'a été invité car l'invitation existe déjà",
825825
"NoOneWasShared": "Échec du partage du dossier de groupe",
826826
"NoValidEmails": "Aucun e-mail valide n'a été saisi",
827+
"PendingInvitations": "Invitations en attente",
827828
"Shared": "Le dossier de groupe a été partagé avec succès",
828829
"SharingError": "Le partage a échoué. L'utilisateur est peut-être déjà partagé ou n'appartient pas au projet approprié.",
829830
"SuccessfullyAcceptedInvitation": "Invitation acceptée avec succès",

resources/i18n/id.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "Tidak ada yang diundang karena undangan sudah ada",
825825
"NoOneWasShared": "Gagal membagikan folder grup",
826826
"NoValidEmails": "Tidak ada email valid yang dimasukkan",
827+
"PendingInvitations": "Undangan tertunda",
827828
"Shared": "Folder grup berhasil dibagikan",
828829
"SharingError": "Gagal berbagi. Pengguna mungkin sudah dibagikan atau tidak ada dalamm proyek yang sesuai.",
829830
"SuccessfullyAcceptedInvitation": "Undangan yang berhasil diterima",

resources/i18n/it.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@
824824
"NoOneWasInvited": "Nessuno invitato poiché l'invito esiste già",
825825
"NoOneWasShared": "Impossibile condividere la cartella del gruppo",
826826
"NoValidEmails": "Non sono state inserite email valide",
827+
"PendingInvitations": "Inviti in sospeso",
827828
"Shared": "Condivisione riuscita della cartella del gruppo",
828829
"SharingError": "Condivisione non riuscita. L'utente potrebbe essere già condiviso o non appartenere al progetto appropriato.",
829830
"SuccessfullyAcceptedInvitation": "Invito accettato con successo",

0 commit comments

Comments
 (0)