Skip to content

Commit a6222ca

Browse files
authored
Fixed some UX and React reconciliation errors on Tags page (#15098)
1 parent 653e5a5 commit a6222ca

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

datahub-frontend/test/app/ApplicationTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,12 @@ public void testHappyPathOidc() throws ParseException {
940940
assertEquals(TEST_USER, data.get("actor"));
941941
// Default expiration is 24h, so should always be less than current time + 1 day since it stamps
942942
// the time before this executes. Use a more generous tolerance to account for timezone
943-
// differences
944-
// and test execution time variations.
943+
// differences, DST transitions, and test execution time variations.
944+
// Increased tolerance to 22-26 hours to handle DST transitions (which can cause 1-hour shifts)
945945
Date maxExpectedExpiration =
946-
new Date(System.currentTimeMillis() + (25 * 60 * 60 * 1000)); // 25 hours
946+
new Date(System.currentTimeMillis() + (26 * 60 * 60 * 1000)); // 26 hours
947947
Date minExpectedExpiration =
948-
new Date(System.currentTimeMillis() + (23 * 60 * 60 * 1000)); // 23 hours
948+
new Date(System.currentTimeMillis() + (22 * 60 * 60 * 1000)); // 22 hours
949949
Date actualExpiration = claims.getExpirationTime();
950950

951951
assertTrue(

datahub-web-react/src/alchemy-components/components/Table/Table.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,9 @@ export const Table = <T,>({
195195
const canExpand = expandable?.rowExpandable?.(row); // Check if row is expandable
196196
const key = `row-${index}-${sortColumn ?? 'none'}-${sortOrder ?? 'none'}`;
197197
return (
198-
<>
198+
<React.Fragment key={key}>
199199
{/* Render the main row */}
200200
<TableRow
201-
key={key}
202201
canExpand={canExpand}
203202
onClick={(e) => {
204203
if (focusedRowIndex === index) {
@@ -298,7 +297,7 @@ export const Table = <T,>({
298297
</TableCell>
299298
</TableRow>
300299
)}
301-
</>
300+
</React.Fragment>
302301
);
303302
})}
304303
{footer}

datahub-web-react/src/app/homeV2/layout/navBarRedesign/NavBarMenu.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export default function NavBarMenu({ menu, selectedKey, isCollapsed, iconSize, s
7272

7373
return (
7474
<StyledMenu selectedKeys={selectedKey ? [selectedKey] : []} style={style} data-testid="nav-menu-links">
75-
{menu.items.map((item) => renderMenuItem(item))}
75+
{menu.items.map((item) => (
76+
<React.Fragment key={item.key}>{renderMenuItem(item)}</React.Fragment>
77+
))}
7678
</StyledMenu>
7779
);
7880
}

datahub-web-react/src/app/ingestV2/source/__tests__/tests_utils.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ describe('formatTimezone', () => {
567567
expect(['EST', 'EDT']).toContain(nycAbbr);
568568

569569
const londonAbbr = formatTimezone('Europe/London');
570-
expect(['GMT+1', 'BST', 'GMT']).toContain(londonAbbr);
570+
expect(['GMT', 'BST']).toContain(londonAbbr);
571571

572572
// Tokyo doesn't observe DST, so it's always GMT+9
573573
expect(formatTimezone('Asia/Tokyo')).toBe('GMT+9');

datahub-web-react/src/app/tags/CreateNewTagModal/CreateNewTagModal.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const CreateNewTagModal: React.FC<CreateNewTagModalProps> = ({ onClose, open })
103103
setSelectedOwnerUrns([]);
104104
} catch (e: any) {
105105
message.destroy();
106-
message.error('Failed to create tag. An unexpected error occurred');
106+
message.error(`Failed to create tag. ${e.message}`);
107107
} finally {
108108
setIsLoading(false);
109109
}
@@ -136,7 +136,15 @@ const CreateNewTagModal: React.FC<CreateNewTagModalProps> = ({ onClose, open })
136136
];
137137

138138
return (
139-
<Modal title="Create New Tag" onCancel={onClose} buttons={buttons} open={open} centered width={500}>
139+
<Modal
140+
title="Create New Tag"
141+
onCancel={onClose}
142+
buttons={buttons}
143+
open={open}
144+
centered
145+
width={500}
146+
dataTestId="create-tag-modal"
147+
>
140148
{/* Tag Details Section */}
141149
<TagDetailsSection
142150
tagName={tagName}

smoke-test/tests/cypress/cypress/e2e/manage_tagsV2/helpers/tags_page_helper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ export default class TagsPageHelper {
1818
cy.clickOptionWithTestId("create-tag-modal-create-button");
1919

2020
if (shouldBeSuccessfullyCreated) {
21-
cy.waitTextVisible(`Tag "${name}" successfully created`);
21+
// Wait for modal to close - check that add button is available again
22+
cy.getWithTestId("add-tag-button").should("be.visible");
2223
} else {
23-
cy.waitTextVisible("Failed to create tag. An unexpected error occurred");
24+
// Wait for any error message that starts with "Failed to create tag."
25+
cy.contains(/Failed to create tag\./).should("be.visible");
2426
cy.clickOptionWithTestId("create-tag-modal-cancel-button");
2527
}
2628
}

0 commit comments

Comments
 (0)