From 9be6fa8f0b8dd68f44f0db83a6d87f59f6a2c66e Mon Sep 17 00:00:00 2001 From: meetul Date: Wed, 30 Oct 2024 21:02:31 +0530 Subject: [PATCH] more changes --- .../AddPeopleToTag/AddPeopleToTag.module.css | 3 +- .../AddPeopleToTag/AddPeopleToTag.test.tsx | 2 +- .../AddPeopleToTag/AddPeopleToTag.tsx | 2 +- src/components/TagActions/TagActions.test.tsx | 2 +- src/components/TagActions/TagActions.tsx | 7 +++-- src/components/TagActions/TagNode.tsx | 6 ++-- src/screens/ManageTag/EditUserTagModal.tsx | 9 +++++- src/screens/ManageTag/ManageTag.tsx | 2 +- src/screens/ManageTag/RemoveUserTagModal.tsx | 7 +++-- .../OrganizationTags.module.css | 1 + .../OrganizationTags/OrganizationTags.tsx | 4 +-- src/screens/SubTags/SubTags.tsx | 31 +++++++++---------- src/utils/organizationTagsUtils.ts | 8 +++++ 13 files changed, 52 insertions(+), 32 deletions(-) diff --git a/src/components/AddPeopleToTag/AddPeopleToTag.module.css b/src/components/AddPeopleToTag/AddPeopleToTag.module.css index c7c5c4582b..d025435c3a 100644 --- a/src/components/AddPeopleToTag/AddPeopleToTag.module.css +++ b/src/components/AddPeopleToTag/AddPeopleToTag.module.css @@ -30,7 +30,8 @@ .scrollContainer { max-height: 100px; overflow-y: auto; - margin-bottom: 1rem; + margin-top: 0.5rem; + margin-bottom: 1.7rem; } .memberBadge { diff --git a/src/components/AddPeopleToTag/AddPeopleToTag.test.tsx b/src/components/AddPeopleToTag/AddPeopleToTag.test.tsx index d6749ad23b..e21ccd1a52 100644 --- a/src/components/AddPeopleToTag/AddPeopleToTag.test.tsx +++ b/src/components/AddPeopleToTag/AddPeopleToTag.test.tsx @@ -74,7 +74,7 @@ const renderAddPeopleToTagModal = ( } /> diff --git a/src/components/AddPeopleToTag/AddPeopleToTag.tsx b/src/components/AddPeopleToTag/AddPeopleToTag.tsx index 2ff78d9121..915452c210 100644 --- a/src/components/AddPeopleToTag/AddPeopleToTag.tsx +++ b/src/components/AddPeopleToTag/AddPeopleToTag.tsx @@ -113,7 +113,7 @@ const AddPeopleToTag: React.FC = ({ const userTagMembersToAssignTo = userTagsMembersToAssignToData?.getUsersToAssignTo.usersToAssignTo.edges.map( (edge) => edge.node, - ); + ) ?? /* istanbul ignore next */ []; const handleAddOrRemoveMember = (member: InterfaceMemberData): void => { setAssignToMembers((prevMembers) => { diff --git a/src/components/TagActions/TagActions.test.tsx b/src/components/TagActions/TagActions.test.tsx index 03a955d9d0..140504d044 100644 --- a/src/components/TagActions/TagActions.test.tsx +++ b/src/components/TagActions/TagActions.test.tsx @@ -96,7 +96,7 @@ const renderTagActionsModal = ( } /> diff --git a/src/components/TagActions/TagActions.tsx b/src/components/TagActions/TagActions.tsx index 29f1105cf2..60099e855d 100644 --- a/src/components/TagActions/TagActions.tsx +++ b/src/components/TagActions/TagActions.tsx @@ -102,9 +102,10 @@ const TagActions: React.FC = ({ }); }; - const userTagsList = orgUserTagsData?.organizations[0]?.userTags.edges.map( - (edge) => edge.node, - ); + const userTagsList = + orgUserTagsData?.organizations[0]?.userTags.edges.map( + (edge) => edge.node, + ) ?? /* istanbul ignore next */ []; const [checkedTagId, setCheckedTagId] = useState(null); const [uncheckedTagId, setUncheckedTagId] = useState(null); diff --git a/src/components/TagActions/TagNode.tsx b/src/components/TagActions/TagNode.tsx index 38949dd01f..e05d572f30 100644 --- a/src/components/TagActions/TagNode.tsx +++ b/src/components/TagActions/TagNode.tsx @@ -92,9 +92,9 @@ const TagNode: React.FC = ({ ); } - const subTagsList = subTagsData?.getChildTags.childTags.edges.map( - (edge) => edge.node, - ); + const subTagsList = + subTagsData?.getChildTags.childTags.edges.map((edge) => edge.node) ?? + /* istanbul ignore next */ []; const handleTagClick = (): void => { setExpanded(!expanded); diff --git a/src/screens/ManageTag/EditUserTagModal.tsx b/src/screens/ManageTag/EditUserTagModal.tsx index e686375f49..5fa8ae2771 100644 --- a/src/screens/ManageTag/EditUserTagModal.tsx +++ b/src/screens/ManageTag/EditUserTagModal.tsx @@ -43,7 +43,14 @@ const EditUserTagModal: React.FC = ({ > {t('tagDetails')} -
+ ): void => { + e.preventDefault(); + if (newTagName.trim()) { + handleEditUserTag(e); + } + }} + > {t('tagName')} edge.node, - ); + ) ?? /* istanbul ignore next */ []; const orgUserTagAncestors = orgUserTagAncestorsData?.getUserTagAncestors; const redirectToSubTags = (tagId: string): void => { diff --git a/src/screens/ManageTag/RemoveUserTagModal.tsx b/src/screens/ManageTag/RemoveUserTagModal.tsx index eeb84e1abe..dc000f443c 100644 --- a/src/screens/ManageTag/RemoveUserTagModal.tsx +++ b/src/screens/ManageTag/RemoveUserTagModal.tsx @@ -26,6 +26,7 @@ const RemoveUserTagModal: React.FC = ({ = ({ centered > - + {t('removeUserTag')} - {t('removeUserTagMessage')} + + {t('removeUserTagMessage')} + - - +
@@ -392,7 +391,7 @@ function SubTags(): JSX.Element { className={styles.subTagsScrollableDiv} > `${styles.rowBackground}`} autoHeight rowHeight={65} - rows={userTagsList?.map((fund, index) => ({ + rows={subTagsList?.map((subTag, index) => ({ id: index + 1, - ...fund, + ...subTag, }))} columns={columns} isRowSelectable={() => false} diff --git a/src/utils/organizationTagsUtils.ts b/src/utils/organizationTagsUtils.ts index c58c09efe4..75c001816e 100644 --- a/src/utils/organizationTagsUtils.ts +++ b/src/utils/organizationTagsUtils.ts @@ -28,6 +28,14 @@ export const dataGridStyle = { '& .MuiDataGrid-main': { borderRadius: '0.1rem', }, + '& .MuiDataGrid-topContainer': { + position: 'fixed', + top: 259, + zIndex: 1, + }, + '& .MuiDataGrid-virtualScrollerContent': { + marginTop: 6.5, + }, }; // the data chunk size for tag related queries