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
Open
Conversation
Contributor
Author
Contributor
Author
Contributor
Author
… Detail Page opens the Edit Form instead of Create Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
guidparameter. TheEntityFormcomponent automatically reads thisguidfrom the URL parameters (useParams) and assumes the user wants to edit that specific entity.Fix:
isAddboolean prop to theEntityFormcomponent.CreateDropdowncomponent to explicitly passisAdd={true}when opening the entity form.EntityFormto check forisAdd. IfisAddis true, it explicitly ignores theguidfrom the URL parameters (const guid = isAdd ? undefined : urlGuid;), forcing the form to open in Create mode instead of Edit mode.CreateDropdown.test.tsxto verify theisAddprop is passed correctly.How was this patch tested?
CreateDropdown.test.tsxto verify theisAddstate is accurately passed to theEntityForm.npm run test:coverage). Verified that all 4,630 tests pass successfully with 0 failures and overall coverage is well above the 50% threshold.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.