[WEB-989] chore: archived module and cycle sidebar details (#4191)

* chore: module and cycle archive

* fix: archived cycle sidebar details fetch

* fix: archived module sidebar details fetch

---------

Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
Anmol Singh Bhatia
2024-04-15 19:46:14 +05:30
committed by GitHub
parent 7a4ee509da
commit 54196aafc0
13 changed files with 562 additions and 150 deletions

View File

@@ -19,7 +19,7 @@ export const ModulePeekOverview: React.FC<Props> = observer(({ projectId, worksp
// refs
const ref = React.useRef(null);
// store hooks
const { fetchModuleDetails } = useModule();
const { fetchModuleDetails, fetchArchivedModuleDetails } = useModule();
const handleClose = () => {
delete router.query.peekModule;
@@ -30,10 +30,10 @@ export const ModulePeekOverview: React.FC<Props> = observer(({ projectId, worksp
};
useEffect(() => {
if (!peekModule || isArchived) return;
fetchModuleDetails(workspaceSlug, projectId, peekModule.toString());
}, [fetchModuleDetails, isArchived, peekModule, projectId, workspaceSlug]);
if (!peekModule) return;
if (isArchived) fetchArchivedModuleDetails(workspaceSlug, projectId, peekModule.toString());
else fetchModuleDetails(workspaceSlug, projectId, peekModule.toString());
}, [fetchArchivedModuleDetails, fetchModuleDetails, isArchived, peekModule, projectId, workspaceSlug]);
return (
<>