Brijesh619 commented on code in PR #697:
URL: https://github.com/apache/atlas/pull/697#discussion_r3782953262


##########
dashboard/src/views/DetailPage/EntityDetailPage.tsx:
##########
@@ -408,20 +409,22 @@ const EntityDetailPage: React.FC = () => {
                   >
                     Classifications
                   </Typography>
-                  <LightTooltip title={"Add Classifications"}>
-                    <IconButton
-                      component="label"
-                      role={undefined}
-                      tabIndex={-1}
-                      size="small"
-                      color="primary"
-                      onClick={() => {
-                        setOpenAddTagModal(true);
-                      }}
-                    >
-                      <AddCircleOutlineIcon className="mr-0" fontSize="small" 
/>{" "}
-                    </IconButton>
-                  </LightTooltip>
+                  {entity?.status !== EntityStatus.DELETED && (

Review Comment:
   Resolved. Added a unit test to enforce the detailPageData === null skeleton 
guard, and included !loading checks on the Add action buttons to prevent button 
flashes during the initial load.



##########
dashboard/src/views/__tests__/EntityDetailPage.test.tsx:
##########
@@ -287,6 +287,22 @@ describe('EntityDetailPage', () => {
                }
        });
 
+       it('should hide Add Classification and Add Term buttons for DELETED 
entities', () => {

Review Comment:
   Resolved. Updated the Add button test selectors to reliably use 
document.querySelector('[data-title="..."]') to accurately assert their 
presence, and fixed the mock data to properly test modal triggers.



##########
dashboard/src/utils/EntityStatus.ts:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export enum EntityStatus {

Review Comment:
   Resolved. Added EntityStatus.test.ts with comprehensive unit tests for 
isEntityModificationAllowed, verifying behavior across ACTIVE, DELETED, PURGED, 
and undefined states.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to