From 5106d04ae6f43afc2049584fbf37e954f3589e1d Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Wed, 24 Apr 2024 09:45:24 +0530 Subject: [PATCH 1/2] make language array of lsf unique --- src/ui/pages/container/Label-Studio/LSF.jsx | 4 ++-- src/ui/pages/container/Label-Studio/ReviewLSF.jsx | 4 ++-- src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ui/pages/container/Label-Studio/LSF.jsx b/src/ui/pages/container/Label-Studio/LSF.jsx index f2fddc6b..000d3457 100644 --- a/src/ui/pages/container/Label-Studio/LSF.jsx +++ b/src/ui/pages/container/Label-Studio/LSF.jsx @@ -991,8 +991,8 @@ const LabelStudioWrapper = ({ if(Array.isArray(taskData?.data?.language)){ taskData?.data?.language?.map((lang)=>{ selectedLanguages.current?.push(lang); - const newLanguages = [...selectedL, ...taskData?.data?.language]; - setSelectedL(newLanguages); + const newLanguages = new Set([...selectedL, ...taskData?.data?.language]); + setSelectedL(Array.from(newLanguages)); }); } if(typeof taskData?.data?.language === 'string' && taskData?.data?.ocr_domain !== ""){ diff --git a/src/ui/pages/container/Label-Studio/ReviewLSF.jsx b/src/ui/pages/container/Label-Studio/ReviewLSF.jsx index d512c6fc..5562ef68 100644 --- a/src/ui/pages/container/Label-Studio/ReviewLSF.jsx +++ b/src/ui/pages/container/Label-Studio/ReviewLSF.jsx @@ -1199,8 +1199,8 @@ useEffect(() => { if(Array.isArray(taskData?.data?.language)){ taskData?.data?.language?.map((lang)=>{ selectedLanguages.current?.push(lang); - const newLanguages = [...selectedL, ...taskData?.data?.language]; - setSelectedL(newLanguages); + const newLanguages = new Set([...selectedL, ...taskData?.data?.language]); + setSelectedL(Array.from(newLanguages)); }); } if(typeof taskData?.data?.language === 'string' && taskData?.data?.ocr_domain !== ""){ diff --git a/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx b/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx index 5948314f..29cdb96d 100644 --- a/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx +++ b/src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx @@ -911,8 +911,8 @@ useEffect(() => { if(Array.isArray(taskData?.data?.language)){ taskData?.data?.language?.map((lang)=>{ selectedLanguages.current?.push(lang); - const newLanguages = [...selectedL, ...taskData?.data?.language]; - setSelectedL(newLanguages); + const newLanguages = new Set([...selectedL, ...taskData?.data?.language]); + setSelectedL(Array.from(newLanguages)); }); } if(typeof taskData?.data?.language === 'string' && taskData?.data?.ocr_domain !== ""){ From 1c9f64c5d1160e6d29bd760cabcf223d052eab34 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Wed, 24 Apr 2024 16:52:31 +0530 Subject: [PATCH 2/2] disable clear button for indictransliterate --- src/ui/pages/container/Transliteration/Transliteration.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/pages/container/Transliteration/Transliteration.jsx b/src/ui/pages/container/Transliteration/Transliteration.jsx index 799e9f6c..29d922f7 100644 --- a/src/ui/pages/container/Transliteration/Transliteration.jsx +++ b/src/ui/pages/container/Transliteration/Transliteration.jsx @@ -221,7 +221,7 @@ const Transliteration = (props) => { getOptionLabel={(el) => el.DisplayName} sx={{ width: window.innerWidth * 0.15 }} renderInput={(params) => } - + disableClearable={true} />