almeidajeff opened a new pull request, #4219:
URL: https://github.com/apache/ambari/pull/4219

   ## What changes were proposed in this pull request?
   This PR fixes three separate defects in the Add Service / Install wizard of 
the React "latest" UI:
   
   1. Add Service wizard "Next" button silently failing past Step 1. The 
addService-specific forward-navigation branches in Step4.tsx, Step5.tsx, 
Step6.tsx and Step7/index.tsx all call jumpToStep(nextStep) without the 
isImperitiveJump flag. useStepWizard's canJumpFromCurrentStep() unconditionally 
rejects any forward jump (targetStep > activeStep) unless that flag is set, so 
clicking Next did nothing — no error, no navigation — on every step of the Add 
Service wizard. Fixed by passing jumpToStep(nextStep, true) in all four steps.
   
   2. Select Version step showing duplicate tabs. /api/v1/version_definitions 
returns two VersionDefinition entries per stack line once a repository_version 
is registered — a generic default entry (stack_default: true) and a more 
specific alias (stack_default: false), both carrying the identical 
repository_version. Step1.tsx rendered a tab per item with no deduplication. 
Fixed by grouping definitions.items by repository_version before sorting, 
keeping the stack_default entry when both are present.
   
   3. MISC > Notifications fields blocking the wizard. 
data/configs/alert_notifications.ts already declares isRequired: false on every 
notification field (SMTP Host/Port/FROM Email/etc.), but 
addAlertNotificationProperties() in Step7/index.tsx never propagated that flag 
into propertyAttributes.empty_value_valid, so validateInput() treated every 
empty field as required and blocked wizard progress. Fixed by mapping 
empty_value_valid: !isRequired for each field.
   
   Also adds regression tests for the jumpToStep root cause 
(useStepWizard.test.tsx) and for the Step5 Add Service Next flow 
(Step5.test.tsx).
   
   ## How was this patch tested?
   
   - npx vitest run across the touched suites (Step5.test.tsx, 
Step7/index.test.tsx, ConfigUtils.theme.test.ts, useStepWizard.test.tsx): 49 
passed, 0 failed.
   - npx tsc -b: no type errors.
   - Confirmed the new useStepWizard test fails without the fix (forward jump 
silently no-ops) and passes with it.
   - Confirmed the new Step5.test.tsx addService test fails if 
jumpToStep(nextStep, true) is reverted to jumpToStep(nextStep).
   - Manual walkthrough still pending on my side for: Step4/Step6 Next-button 
behavior (no automated test coverage — Table/AssignMasters mocks in the 
existing test files made simulating the click non-trivial without larger test 
restructuring) and the Select Version dedupe (no existing test file for 
Step1.tsx). Recommend exercising the full Add Service wizard end-to-end and the 
Select Version step on a live cluster before merge.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to