Fixed Bug 68940 - Rooms.FormRoom. When you click the Back button inside a Form room on the Start filling panel, a list of all rooms is displayed, including rooms from the Archive.

This commit is contained in:
Timofey Boyko 2024-07-02 13:43:06 +03:00
parent 254e4d24e3
commit 72d9b4a0df
3 changed files with 12 additions and 2 deletions

View File

@ -135,6 +135,7 @@ export type UseFilesHelpersProps = {
setIsFirstLoad: (value: boolean) => void;
withCreate: boolean;
setSelectedItemId: (value: number | string) => void;
setSelectedItemType: (value?: "rooms" | "files") => void;
};
export type TUseInputItemHelper = {

View File

@ -82,6 +82,7 @@ const useFilesHelper = ({
setIsFirstLoad,
withCreate,
setSelectedItemId,
setSelectedItemType,
}: UseFilesHelpersProps) => {
const { t } = useTranslation(["Common"]);
@ -341,14 +342,20 @@ const useFilesHelper = ({
hotkey: "f",
onCreateClick: () => addInputItem(t("NewFolder"), FolderSvgUrl),
onBackClick: () => {
setSelectedItemId(current.parentId);
let isRooms;
setBreadCrumbs((val) => {
const newVal = [...val];
newVal.pop();
const item = newVal.pop();
isRooms = !!item?.roomType;
return newVal;
});
if (isRooms) setSelectedItemType("rooms");
setSelectedItemId(current.parentId);
},
});
} else {
@ -430,6 +437,7 @@ const useFilesHelper = ({
t,
setSelectedItemId,
rootThirdPartyId,
setSelectedItemType,
],
);

View File

@ -240,6 +240,7 @@ const FilesSelector = ({
setIsInit,
withCreate,
setSelectedItemId,
setSelectedItemType,
});
const onClickBreadCrumb = React.useCallback(