From f3b88b87cd90b9291d99b4e00043516c2712cff7 Mon Sep 17 00:00:00 2001 From: Sayali Joshi Date: Tue, 25 Jun 2024 15:03:28 +0530 Subject: [PATCH 1/3] [CMG-127] - Empty Project dashboard | Search field should not be displayed --- ui/src/components/ProjectsHeader/index.tsx | 52 ++++++++-------------- ui/src/pages/Projects/index.scss | 6 ++- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/ui/src/components/ProjectsHeader/index.tsx b/ui/src/components/ProjectsHeader/index.tsx index 493867fc6..808f6a035 100644 --- a/ui/src/components/ProjectsHeader/index.tsx +++ b/ui/src/components/ProjectsHeader/index.tsx @@ -24,39 +24,25 @@ const ProjectsHeader = ({ const SearchProject = ( <> - {allProject && allProject?.length > 0 ? ( -
- - search.replace(/\s/g, '').length - ? setSearchText(search?.trim()) - : setSearchText(search) - } - width="large" - onClear={true} - onClick={setFocus} - value={searchText} - debounceSearch={true} - id="search-project-input" - /> -
- ) : ( - searchText?.length > 0 && ( -
- setSearchText(search)} - onClear={true} - onClick={setFocus} - value={searchText} - debounceSearch={true} - id="search-project-input" - /> -
- ) - )} +
+ + search.replace(/\s/g, '').length + ? setSearchText(search?.trim()) + : setSearchText(search) + } + width="large" + onClear={true} + onClick={setFocus} + value={searchText} + debounceSearch={true} + id="search-project-input" + version="v2" + disabled={allProject && allProject?.length <= 0} + /> +
); diff --git a/ui/src/pages/Projects/index.scss b/ui/src/pages/Projects/index.scss index 926d50365..8ca4b3d61 100644 --- a/ui/src/pages/Projects/index.scss +++ b/ui/src/pages/Projects/index.scss @@ -1,8 +1,10 @@ @import '../../scss/variables'; .project-search-wrapper { - margin-top: 2px; - margin-left: 8px; + margin-left: $px-12; + .Search { + height: 2.5rem; + } .Search__input { border: 1px solid $color-base-gray-40; } From 3d5695be323799482608702698c4f2e7c2bcc97b Mon Sep 17 00:00:00 2001 From: Sayali Joshi Date: Tue, 25 Jun 2024 17:02:03 +0530 Subject: [PATCH 2/3] [CMG-146] - Search | When enter space multiple times and then search for existing Project name, it doesnt show result --- ui/src/components/ProjectsHeader/index.tsx | 40 +++++++++++++++++++--- ui/src/pages/Projects/index.scss | 4 +-- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/ui/src/components/ProjectsHeader/index.tsx b/ui/src/components/ProjectsHeader/index.tsx index 808f6a035..e52a4a05c 100644 --- a/ui/src/components/ProjectsHeader/index.tsx +++ b/ui/src/components/ProjectsHeader/index.tsx @@ -10,7 +10,6 @@ const ProjectsHeader = ({ setSearchText, searchPlaceholder, cta, - restore_cta: restoreCta, allProject, handleModal }: ProjectsHeaderType) => { @@ -29,9 +28,7 @@ const ProjectsHeader = ({ placeholder={searchPlaceholder} type="secondary" onChange={(search: string) => - search.replace(/\s/g, '').length - ? setSearchText(search?.trim()) - : setSearchText(search) + setSearchText(search?.trim()) } width="large" onClear={true} @@ -40,9 +37,42 @@ const ProjectsHeader = ({ debounceSearch={true} id="search-project-input" version="v2" - disabled={allProject && allProject?.length <= 0} + disabled={allProject && allProject?.length <= 0 && searchText?.length <= 0} /> + {/* {allProject && allProject?.length > 0 ? ( +
+ + search.replace(/\s/g, '').length + ? setSearchText(search?.trim()) + : setSearchText(search) + } + width="large" + onClear={true} + onClick={setFocus} + value={searchText} + debounceSearch={true} + id="search-project-input" + /> +
+ ) : ( + searchText?.length > 0 && ( +
+ setSearchText(search)} + onClear={true} + onClick={setFocus} + value={searchText} + debounceSearch={true} + id="search-project-input" + /> +
+ ) + )} */} ); diff --git a/ui/src/pages/Projects/index.scss b/ui/src/pages/Projects/index.scss index 8ca4b3d61..7e135b6b5 100644 --- a/ui/src/pages/Projects/index.scss +++ b/ui/src/pages/Projects/index.scss @@ -3,11 +3,9 @@ .project-search-wrapper { margin-left: $px-12; .Search { + background-color: $color-brand-white-base; height: 2.5rem; } - .Search__input { - border: 1px solid $color-base-gray-40; - } ::placeholder { font-size: $px-16; color: $color-stepper-title !important; From 9c72ef928388d108546c07a9ac171c4413a08ada Mon Sep 17 00:00:00 2001 From: Sayali Joshi Date: Wed, 26 Jun 2024 13:30:18 +0530 Subject: [PATCH 3/3] Content type mapping save API fixes --- ui/src/components/ContentMapper/index.tsx | 79 +---------------------- 1 file changed, 3 insertions(+), 76 deletions(-) diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index 331d68d0b..a941fe24d 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -18,8 +18,6 @@ import { ModalFooter, Dropdown } from '@contentstack/venus-components'; -import { jsonToHtml } from '@contentstack/json-rte-serializer'; -import HTMLReactParser from 'html-react-parser'; // Services import { getCMSDataFromFile } from '../../cmsData/cmsSelector'; @@ -29,7 +27,6 @@ import { getExistingContentTypes, updateContentType, resetToInitialMapping, - createTestStack, fetchExistingContentType } from '../../services/api/migration.service'; import { getStackStatus } from '../../services/api/stacks.service'; @@ -512,6 +509,7 @@ const ContentMapper = () => { return row; }); setTableData(updatedRows); + setSelectedEntries(updatedRows); }; const handleDropDownChange = (value: FieldTypes) => { @@ -630,6 +628,7 @@ const ContentMapper = () => { }); setTableData(updatedRows as FieldMapType[]); + setSelectedEntries(updatedRows as FieldMapType[]); }; const SelectAccessorOfColumn = (data: FieldMapType) => { @@ -1104,7 +1103,7 @@ const ContentMapper = () => {
- - - - {/* {actionCta && validateArray(actionCta) && ( - -
-
- {currentIndex > 0 && ( - - - {prevButtonLabel} - - )} -
-
-
- - -
-
- {currentIndex < contentTypes.length - 1 && ( - - {nextButtonLabel} - - - )} -
-
-
-
- )} */} - - {/* {cta?.title && ( -
- -
- )} */} ); };