Client:Components:EmptyViewContainer Fixed Bug 68961
This commit is contained in:
parent
358d599e3e
commit
018ebb9e89
@ -21,6 +21,5 @@
|
||||
"UploadFromPortalDescription": "Upload any type files from Documents or Rooms",
|
||||
"UploadFromPortalTitle": "Upload from {{productName}}",
|
||||
"UploadPDFFormOptionDescription": "Select a ready PDF form available in {{productName}} and upload it to the room.",
|
||||
"UserEmptyDescription": "Files and folders uploaded by admins will appeared here.",
|
||||
"UserEmptyTitle": "No docs here yet"
|
||||
"UserEmptyDescription": "Files and folders uploaded by admins will appeared here."
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ const EmptyFolderContainer = ({
|
||||
isFolder={!isRoom}
|
||||
folderId={folderId}
|
||||
parentRoomType={parentRoomType}
|
||||
isArchiveFolderRoot={isArchiveFolderRoot}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ export const getDescription = (
|
||||
isFolder: boolean,
|
||||
folderType: Nullable<FolderType>,
|
||||
parentRoomType: Nullable<FolderType>,
|
||||
isArchiveFolderRoot: boolean,
|
||||
): string => {
|
||||
const isCollaborator = access === ShareAccessRights.Collaborator;
|
||||
|
||||
@ -88,8 +89,13 @@ export const getDescription = (
|
||||
],
|
||||
() => t("Files:EmptyFormSubFolderHeaderText"),
|
||||
)
|
||||
.with([FolderType.FormRoom, null, P.when(() => isNotAdmin)], () =>
|
||||
t("EmptyView:FormFolderDefaultUserDescription"),
|
||||
.with(
|
||||
[
|
||||
FolderType.FormRoom,
|
||||
null,
|
||||
P.when(() => isNotAdmin || isArchiveFolderRoot),
|
||||
],
|
||||
() => t("EmptyView:FormFolderDefaultUserDescription"),
|
||||
)
|
||||
.with([FolderType.FormRoom, null, P._], () =>
|
||||
t("EmptyView:FormFolderDefaultDescription", {
|
||||
@ -99,7 +105,8 @@ export const getDescription = (
|
||||
.otherwise(() => "");
|
||||
}
|
||||
|
||||
if (isNotAdmin) return t("EmptyView:UserEmptyDescription");
|
||||
if (isNotAdmin || isArchiveFolderRoot)
|
||||
return t("EmptyView:UserEmptyDescription");
|
||||
|
||||
if (isCollaborator) return t("EmptyView:CollaboratorEmptyDesciprtion");
|
||||
|
||||
@ -113,6 +120,7 @@ export const getTitle = (
|
||||
isFolder: boolean,
|
||||
folderType: Nullable<FolderType>,
|
||||
parentRoomType: Nullable<FolderType>,
|
||||
isArchiveFolderRoot: boolean,
|
||||
): string => {
|
||||
const isCollaborator = access === ShareAccessRights.Collaborator;
|
||||
|
||||
@ -135,8 +143,13 @@ export const getTitle = (
|
||||
.with([P._, FolderType.SubFolderInProgress, P._], () =>
|
||||
t("Files:EmptyFormSubFolderProgressDescriptionText"),
|
||||
)
|
||||
.with([FolderType.FormRoom, null, P.when(() => isNotAdmin)], () =>
|
||||
t("EmptyView:FormFolderDefaultUserTitle"),
|
||||
.with(
|
||||
[
|
||||
FolderType.FormRoom,
|
||||
null,
|
||||
P.when(() => isNotAdmin || isArchiveFolderRoot),
|
||||
],
|
||||
() => t("EmptyView:FormFolderDefaultUserTitle"),
|
||||
)
|
||||
.with([FolderType.FormRoom, null, P._], () =>
|
||||
t("EmptyView:FormFolderDefaultTitle"),
|
||||
@ -146,7 +159,7 @@ export const getTitle = (
|
||||
|
||||
if (isCollaborator) return t("EmptyView:CollaboratorEmptyTitle");
|
||||
|
||||
if (isNotAdmin) return t("EmptyView:UserEmptyTitle");
|
||||
if (isNotAdmin || isArchiveFolderRoot) return t("Files:EmptyScreenFolder");
|
||||
|
||||
switch (type) {
|
||||
case RoomsType.FormRoom:
|
||||
@ -317,6 +330,7 @@ export const getOptions = (
|
||||
isFolder: boolean,
|
||||
folderType: Nullable<FolderType>,
|
||||
parentRoomType: Nullable<FolderType>,
|
||||
isArchiveFolderRoot: boolean,
|
||||
actions: OptionActions,
|
||||
): EmptyViewItemType[] => {
|
||||
const isFormFiller = access === ShareAccessRights.FormFilling;
|
||||
@ -417,6 +431,8 @@ export const getOptions = (
|
||||
],
|
||||
};
|
||||
|
||||
if (isArchiveFolderRoot) return [];
|
||||
|
||||
if (isFolder) {
|
||||
return match([parentRoomType, folderType, access])
|
||||
.with(
|
||||
|
@ -30,6 +30,7 @@ const EmptyViewContainer = observer(
|
||||
folderType,
|
||||
selectedFolder,
|
||||
parentRoomType,
|
||||
isArchiveFolderRoot,
|
||||
onClickInviteUsers,
|
||||
onCreateAndCopySharedLink,
|
||||
setSelectFileFormRoomDialogVisible,
|
||||
@ -95,6 +96,7 @@ const EmptyViewContainer = observer(
|
||||
isFolder,
|
||||
folderType,
|
||||
parentRoomType,
|
||||
isArchiveFolderRoot,
|
||||
);
|
||||
const title = getTitle(
|
||||
type,
|
||||
@ -103,6 +105,7 @@ const EmptyViewContainer = observer(
|
||||
isFolder,
|
||||
folderType,
|
||||
parentRoomType,
|
||||
isArchiveFolderRoot,
|
||||
);
|
||||
const icon = getIcon(
|
||||
type,
|
||||
@ -114,7 +117,16 @@ const EmptyViewContainer = observer(
|
||||
);
|
||||
|
||||
return { description, title, icon };
|
||||
}, [type, t, theme.isBase, access, isFolder, folderType, parentRoomType]);
|
||||
}, [
|
||||
type,
|
||||
t,
|
||||
theme.isBase,
|
||||
access,
|
||||
isFolder,
|
||||
folderType,
|
||||
parentRoomType,
|
||||
isArchiveFolderRoot,
|
||||
]);
|
||||
|
||||
const options = useMemo(
|
||||
() =>
|
||||
@ -126,6 +138,7 @@ const EmptyViewContainer = observer(
|
||||
isFolder,
|
||||
folderType,
|
||||
parentRoomType,
|
||||
isArchiveFolderRoot,
|
||||
{
|
||||
inviteUser,
|
||||
onCreate,
|
||||
@ -141,6 +154,7 @@ const EmptyViewContainer = observer(
|
||||
isFolder,
|
||||
folderType,
|
||||
parentRoomType,
|
||||
isArchiveFolderRoot,
|
||||
t,
|
||||
inviteUser,
|
||||
uploadFromDocspace,
|
||||
|
@ -28,6 +28,7 @@ export interface EmptyViewContainerProps {
|
||||
parentRoomType: Nullable<FolderType>;
|
||||
folderType: Nullable<FolderType>;
|
||||
isFolder: boolean;
|
||||
isArchiveFolderRoot: boolean;
|
||||
onClickInviteUsers?: (folderId: string | number, roomType: RoomsType) => void;
|
||||
setSelectFileFormRoomDialogVisible?: TStore["dialogsStore"]["setSelectFileFormRoomDialogVisible"];
|
||||
onCreateAndCopySharedLink?: TStore["contextOptionsStore"]["onCreateAndCopySharedLink"];
|
||||
|
Loading…
Reference in New Issue
Block a user