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