Skip to content

ATLAS-5339: Atlas React UI: Clicking Create Entity while on an Entity Detail Page opens the Edit Form instead of Create Form#693

Open
Brijesh619 wants to merge 1 commit into
apache:masterfrom
Brijesh619:ATLAS-5339
Open

ATLAS-5339: Atlas React UI: Clicking Create Entity while on an Entity Detail Page opens the Edit Form instead of Create Form#693
Brijesh619 wants to merge 1 commit into
apache:masterfrom
Brijesh619:ATLAS-5339

Conversation

@Brijesh619

@Brijesh619 Brijesh619 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?
ATLAS-5339: Fix issue where clicking "Create Entity" from the header dropdown while on an Entity Detail page incorrectly opens the Edit form instead of the Create form.

Root Cause:
When a user is on an Entity Detail page, the URL contains a guid parameter. The EntityForm component automatically reads this guid from the URL parameters (useParams) and assumes the user wants to edit that specific entity.

Fix:

  • Added an isAdd boolean prop to the EntityForm component.
  • Updated the CreateDropdown component to explicitly pass isAdd={true} when opening the entity form.
  • Modified EntityForm to check for isAdd. If isAdd is true, it explicitly ignores the guid from the URL parameters (const guid = isAdd ? undefined : urlGuid;), forcing the form to open in Create mode instead of Edit mode.
  • Added unit tests in CreateDropdown.test.tsx to verify the isAdd prop is passed correctly.

How was this patch tested?

  • Unit Tests: Added unit tests to CreateDropdown.test.tsx to verify the isAdd state is accurately passed to the EntityForm.
  • Test Suite: Ran the full Jest test suite (npm run test:coverage). Verified that all 4,630 tests pass successfully with 0 failures and overall coverage is well above the 50% threshold.
  • Manual UI Testing: Navigated to an existing Entity Detail page (where the URL contains a guid), clicked the "Create Entity" button from the header, and verified that a blank Create Form opens instead of the pre-filled Edit Form for the current entity.

@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-07-08 18-14-25

@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-07-09 12-29-30

@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-07-09 12-08-08

Comment thread dashboard/src/views/Entity/EntityForm.tsx
… Detail Page opens the Edit Form instead of Create Form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants