pawarprasad123 commented on code in PR #362: URL: https://github.com/apache/atlas/pull/362#discussion_r2122954603
########## dashboard/src/views/Glossary/AssignCategory.tsx: ########## @@ -182,6 +182,7 @@ const AssignCategory = ({ return { id: obj?.name, Review Comment: add default value which is setto null or undefined ########## dashboard/src/views/DetailPage/DetailPageAttributes.tsx: ########## @@ -140,14 +145,17 @@ const DetailPageAttribute = ({ if (!isEmpty(tagName)) { setTagModal(true); } + if (!isEmpty(guid) && gtypeParams == "glossary") { Review Comment: Use switch case instead of if, as conditions in if are common, and an or condition can be used ina switch ########## dashboard/src/views/DetailPage/DetailPageAttributes.tsx: ########## @@ -138,16 +184,24 @@ const DetailPageAttribute = ({ size="small" onClick={() => { if (!isEmpty(tagName)) { - setTagModal(true); - } - if (!isEmpty(guid) && gtypeParams == "term") { - setEditTermModal(true); - } - if (!isEmpty(guid) && gtypeParams == "category") { - setEditCategoryModal(true); + handleModal("tag", true); + } else if (!isEmpty(guid)) { Review Comment: instead of else if, only if condition can work here. ########## dashboard/src/components/DialogShowMoreLess.tsx: ########## @@ -429,9 +423,11 @@ const DialogShowMoreLess = ({ setTagModal(true); } else if (colName == "Term") { setTermModal(true); - } else if (colName == "Category") { - setCategoryModal(true); - } else if (colName == "Attribute") { + } Review Comment: use switch case instead of else if ########## dashboard/src/views/SideBar/SideBarTree/GlossaryTree.tsx: ########## @@ -159,6 +159,7 @@ const GlossaryTree = ({ sideBarOpen, searchTerm }: Props) => { return { id: obj?.name, label: obj?.name, Review Comment: add default value which can be null or undefined ########## dashboard/src/views/Glossary/AssignTerm.tsx: ########## @@ -275,6 +275,7 @@ const AssignTerm = ({ return (serviceTypeData: ServiceTypeInterface[]) => serviceTypeData.map((entity: any) => ({ id: entity[Object.keys(entity)[0]].name, + text: entity[Object.keys(entity)[0]].name, Review Comment: Use variable to store this value entity[Object.keys(entity)[0]], as this is repeated in all the keys values. ########## dashboard/src/views/SideBar/SideBarTree/GlossaryTree.tsx: ########## @@ -181,6 +182,7 @@ const GlossaryTree = ({ sideBarOpen, searchTerm }: Props) => { serviceTypeData.map((entity: any) => ({ id: entity[Object.keys(entity)[0]].name, label: entity[Object.keys(entity)[0]].name, + text: entity[Object.keys(entity)[0]].name ?? null, Review Comment: Use variable to store this value entity[Object.keys(entity)[0]], as this is repeated in all the keys values. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@atlas.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org