From 7d2250cdd27fda564c82ce677d4efb9583f0cf73 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Tue, 2 Apr 2024 11:58:44 +0530 Subject: [PATCH] fix LSF sidebar disapperaing after sometime --- src/ui/pages/container/Label-Studio/AllTaskLSF.jsx | 14 +++++++------- src/ui/pages/container/Label-Studio/LSF.jsx | 13 +++++++------ src/ui/pages/container/Label-Studio/ReviewLSF.jsx | 13 +++++++------ .../container/Label-Studio/SuperCheckerLSF.jsx | 13 +++++++------ 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/ui/pages/container/Label-Studio/AllTaskLSF.jsx b/src/ui/pages/container/Label-Studio/AllTaskLSF.jsx index fedf4ecd..22a2b0dc 100644 --- a/src/ui/pages/container/Label-Studio/AllTaskLSF.jsx +++ b/src/ui/pages/container/Label-Studio/AllTaskLSF.jsx @@ -69,10 +69,12 @@ const LabelStudioWrapper = ({annotationNotesRef, loader, showLoader, hideLoader, // debugger useEffect(() => { - let sidePanel = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let showLabelsOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let selectAfterCreateOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let continousLabelingOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); + getProjectsandTasks(projectId, taskId).then( + ([labelConfig, taskData, annotations, predictions]) => { + let sidePanel = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let showLabelsOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let selectAfterCreateOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let continousLabelingOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); localStorage.setItem( "labelStudio:settings", JSON.stringify({ @@ -91,9 +93,7 @@ useEffect(() => { showLineNumbers: false, showPredictionsPanel: true, sidePanelMode: "SIDEPANEL_MODE_REGIONS", - }) - ); - }, []); + }));});}, []); useEffect(() => { const showAssignedUsers = async () => { diff --git a/src/ui/pages/container/Label-Studio/LSF.jsx b/src/ui/pages/container/Label-Studio/LSF.jsx index c240a139..ef64c066 100644 --- a/src/ui/pages/container/Label-Studio/LSF.jsx +++ b/src/ui/pages/container/Label-Studio/LSF.jsx @@ -218,10 +218,12 @@ const LabelStudioWrapper = ({ }, [userData]); */ useEffect(() => { - let sidePanel = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let showLabelsOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let selectAfterCreateOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let continousLabelingOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); + getProjectsandTasks(projectId, taskId).then( + ([labelConfig, taskData, annotations, predictions]) => { + let sidePanel = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let showLabelsOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let selectAfterCreateOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let continousLabelingOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); localStorage.setItem( "labelStudio:settings", JSON.stringify({ @@ -240,8 +242,7 @@ const LabelStudioWrapper = ({ showLineNumbers: false, showPredictionsPanel: true, sidePanelMode: "SIDEPANEL_MODE_REGIONS", - }) - ); + }));}); }, []); const tasksComplete = (id) => { diff --git a/src/ui/pages/container/Label-Studio/ReviewLSF.jsx b/src/ui/pages/container/Label-Studio/ReviewLSF.jsx index 4cc6b9c7..23df8575 100644 --- a/src/ui/pages/container/Label-Studio/ReviewLSF.jsx +++ b/src/ui/pages/container/Label-Studio/ReviewLSF.jsx @@ -277,10 +277,12 @@ const LabelStudioWrapper = ({ }, [userData]); */ useEffect(() => { - let sidePanel = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let showLabelsOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let selectAfterCreateOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let continousLabelingOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); + getProjectsandTasks(projectId, taskId).then( + ([labelConfig, taskData, annotations, predictions]) => { + let sidePanel = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let showLabelsOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let selectAfterCreateOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let continousLabelingOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); localStorage.setItem( "labelStudio:settings", JSON.stringify({ @@ -300,8 +302,7 @@ useEffect(() => { showPredictionsPanel: true, sidePanelMode: "SIDEPANEL_MODE_REGIONS", }) - ); - }, []); + );});}, []); const tasksComplete = (id) => { if (id) { diff --git a/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx b/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx index 5ada8e81..425022da 100644 --- a/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx +++ b/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx @@ -198,10 +198,12 @@ const LabelStudioWrapper = ({ }, [userData]); */ useEffect(() => { - let sidePanel = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let showLabelsOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let selectAfterCreateOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); - let continousLabelingOnly = ProjectDetails?.project_type?.includes("OCRSegmentCategorization"); + getProjectsandTasks(projectId, taskId).then( + ([labelConfig, taskData, annotations, predictions]) => { + let sidePanel = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let showLabelsOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let selectAfterCreateOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); + let continousLabelingOnly = labelConfig?.project_type?.includes("OCRSegmentCategorization"); localStorage.setItem( "labelStudio:settings", JSON.stringify({ @@ -221,8 +223,7 @@ useEffect(() => { showPredictionsPanel: true, sidePanelMode: "SIDEPANEL_MODE_REGIONS", }) - ); - }, []); + );});},[]); const tasksComplete = (id) => { if (id) {