Skip to content

AGENT-1466: fix validations for NTP and Proxy in above sea level ABI flow#3464

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
ElayAharoni:Implement-Conditional-Mandatory-Validation-in-SaaS-UI-for-Proxy-and-NTP-Configurations
Mar 19, 2026
Merged

AGENT-1466: fix validations for NTP and Proxy in above sea level ABI flow#3464
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
ElayAharoni:Implement-Conditional-Mandatory-Validation-in-SaaS-UI-for-Proxy-and-NTP-Configurations

Conversation

@ElayAharoni
Copy link
Contributor

@ElayAharoni ElayAharoni commented Mar 18, 2026

https://redhat.atlassian.net/browse/AGENT-1466

Summary by CodeRabbit

  • New Features

    • Added English label for "Additional NTP sources" and surface it in relevant UI.
  • Improvements

    • Proxy inputs: HTTP/HTTPS marked required only when proxy is enabled and the counterpart is empty.
    • NTP sources: trimming and stricter validation; only sent when NTP sources are enabled.
    • Text areas: external onChange handlers now invoked.
    • Disabling proxy/NTP clears related fields, resets validation state, and revalidates.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 18, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 18, 2026

@ElayAharoni: This pull request references AGENT-1466 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1466

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from LiorSoffer and jgyselov March 18, 2026 15:18
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 907c08fd-f456-43c4-8aa0-e953519cb319

📥 Commits

Reviewing files that changed from the base of the PR and between bb0a789 and a05a626.

📒 Files selected for processing (7)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/config/constants.ts
  • libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
✅ Files skipped from review due to trivial changes (2)
  • libs/ui-lib/lib/common/config/constants.ts
  • libs/locales/lib/en/translation.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx

📝 Walkthrough

Walkthrough

Adds a new translation key and label for "Additional NTP sources"; tightens NTP validation (trim + optional allowEmpty); makes proxy and NTP validations conditional on toggles, clears fields/errors when toggles disable; forwards TextArea onChange to consumer; adjusts payload building to include proxy/NTP only if enabled and non-empty.

Changes

Cohort / File(s) Summary
Localization & Config
libs/locales/lib/en/translation.json, libs/ui-lib/lib/common/config/constants.ts
Added ai:Additional NTP sources translation and exposed additionalNtpSources label in clusterFieldLabels.
NTP Validation
libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx
Introduced allowEmpty parameter to ntpSourceValidationSchema, use .trim() for emptiness checks, validate trimmed comma-separated parts, and conditionally require values.
Proxy Fields
libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
Compute trimmed presence of httpProxy/httpsProxy and make each field required only if proxy enabled and the peer field is empty.
TextArea Formik
libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
TextArea onChange now forwards event to an optional external onChange after calling Formik's handler.
Additional NTP Dialog
libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
Switch validation call to ntpSourceValidationSchema(t, false) (use allowEmpty=false) instead of adding an explicit .required(...).
Disconnected Wizard Step
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
Make proxy/NTP validations conditional on toggles; trim values before including in payload; clear fields/errors/touched and revalidate when toggles are turned off; use Formik setters and validators accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as OptionalConfigurationsForm
  participant Val as ntpValidationSchema
  participant Builder as buildInfraEnvParams
  participant API as InfraEnv API

  User->>UI: toggle enableProxy/enableNtpSources
  UI->>UI: clear fields/errors/touched if toggled off
  User->>UI: enter proxy / additionalNtpSources
  UI->>Val: validate additionalNtpSources (allowEmpty depends on toggle)
  Val-->>UI: validation result
  User->>UI: submit form
  UI->>Builder: build payload (include proxy/NTP only if enabled & trimmed non-empty)
  Builder->>API: send infraEnv params
  API-->>Builder: response
  Builder-->>UI: submission result
  UI-->>User: show success/error
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #3337: Overlaps NTP UI, validation, and translation changes (additionalNtpSources).
  • #3383: Modifies OptionalConfigurationsStep validations and payload handling for proxy/NTP.
  • #3446: Touches TextAreaField behavior (onChange/error helpers) and is related to form event propagation.

Suggested labels

lgtm

Suggested reviewers

  • LiorSoffer
  • jgyselov

Poem

🐰 I trimmed the spaces, nudged each field just right,
Cleared sleepy toggles in the soft moonlight.
Validators hummed and payloads flew,
NTPs aligned — I hopped and chewed.
Hooray, small changes, big delight.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing validations for NTP and Proxy fields in the ABI flow, which is precisely what the changeset accomplishes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 18, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 18, 2026

@ElayAharoni: This pull request references AGENT-1466 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1466

Summary by CodeRabbit

  • Bug Fixes

  • Improved form validation feedback for proxy and NTP configuration fields.

  • Form validation state now updates in real-time as users type, not just on field blur.

  • Proxy and NTP sources fields now properly handle enablement/disablement with automatic cleanup.

  • New Features

  • Proxy fields now have conditional validation based on proxy enablement status.

  • NTP sources field validation adjusts based on enablement state.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx (1)

311-318: ⚠️ Potential issue | 🔴 Critical

onNext does not trigger Formik form submission — the InfraEnv create/update will be bypassed.

The onNext={moveNext} prop passes only a navigation function to the footer, skipping the Formik onSubmit handler that creates or updates the InfraEnv (lines 204–253). Wrap moveNext to call submitForm() first, or use the form's id="wizard-cluster-optional-configurations__form" to submit the form before navigating.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`
around lines 311 - 318, The ClusterWizardFooter currently receives
onNext={moveNext}, which navigates without triggering the Formik onSubmit (so
InfraEnv create/update is bypassed); change the prop to call the form submission
before navigating — either wrap moveNext in a function that calls Formik's
submitForm() (or triggers the form with id
"wizard-cluster-optional-configurations__form") and awaits
completion/validation, then calls moveNext, or replace onNext with a handler
that programmatically submits that form and only calls moveNext after submit
succeeds; update references around ClusterWizardFooter, moveNext, and the form
id to implement this.
🧹 Nitpick comments (1)
libs/locales/lib/en/translation.json (1)

75-76: Consider consolidating duplicate translation keys with casing differences.

There are now two translation keys that differ only in casing:

  • Line 75: ai:Additional NTP sources (lowercase 's')
  • Line 76: ai:Additional NTP Sources (uppercase 'S')

Both map to the same value. While this works, it creates potential confusion and maintenance overhead. Consider standardizing on one key across the codebase to avoid drift.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/locales/lib/en/translation.json` around lines 75 - 76, Two duplicate
translation keys differ only by casing ("ai:Additional NTP sources" vs
"ai:Additional NTP Sources") which creates maintenance overhead; pick a single
canonical key (e.g., "ai:Additional NTP sources") and remove the other entry,
then update any code references that use the removed key to the chosen canonical
key by searching for both symbols in the repository and replacing occurrences to
keep translations consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`:
- Around line 311-318: The ClusterWizardFooter currently receives
onNext={moveNext}, which navigates without triggering the Formik onSubmit (so
InfraEnv create/update is bypassed); change the prop to call the form submission
before navigating — either wrap moveNext in a function that calls Formik's
submitForm() (or triggers the form with id
"wizard-cluster-optional-configurations__form") and awaits
completion/validation, then calls moveNext, or replace onNext with a handler
that programmatically submits that form and only calls moveNext after submit
succeeds; update references around ClusterWizardFooter, moveNext, and the form
id to implement this.

---

Nitpick comments:
In `@libs/locales/lib/en/translation.json`:
- Around line 75-76: Two duplicate translation keys differ only by casing
("ai:Additional NTP sources" vs "ai:Additional NTP Sources") which creates
maintenance overhead; pick a single canonical key (e.g., "ai:Additional NTP
sources") and remove the other entry, then update any code references that use
the removed key to the chosen canonical key by searching for both symbols in the
repository and replacing occurrences to keep translations consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3180ecb9-8465-4f10-99a3-0624d01309ba

📥 Commits

Reviewing files that changed from the base of the PR and between a57bb7a and f099967.

📒 Files selected for processing (8)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
  • libs/ui-lib/lib/common/components/ui/formik/AdditionalNTPSourcesField.tsx
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/config/constants.ts
  • libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 18, 2026
@ElayAharoni ElayAharoni force-pushed the Implement-Conditional-Mandatory-Validation-in-SaaS-UI-for-Proxy-and-NTP-Configurations branch from f099967 to 357aa65 Compare March 19, 2026 10:31
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2026

@ElayAharoni: This pull request references AGENT-1466 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1466

Summary by CodeRabbit

  • New Features

  • Added localization support for "Additional NTP sources" configuration field label.

  • Improvements

  • Enhanced proxy field validation with conditional mutual requirements between HTTP and HTTPS fields.

  • Improved NTP sources configuration with better validation and optional behavior based on feature enablement.

  • Fixed TextArea field to properly handle external onChange callbacks.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
libs/locales/lib/en/translation.json (1)

75-76: Consolidate duplicated i18n key casing for “Additional NTP sources”.

Having both ai:Additional NTP sources and ai:Additional NTP Sources creates key drift across call sites/locales. Prefer one canonical key, migrate usages, then remove the duplicate.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/locales/lib/en/translation.json` around lines 75 - 76, Duplicate i18n
keys exist: "ai:Additional NTP sources" and "ai:Additional NTP Sources"; choose
one canonical key (use "ai:Additional NTP sources"), update all call sites to
use that exact key, remove the duplicate entry from
libs/locales/lib/en/translation.json, and mirror the same consolidation across
other locale files and tests (run i18n lint or search/replace to ensure no
remaining usages of "ai:Additional NTP Sources").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`:
- Around line 268-278: The Next button currently calls moveNext() directly via
WizardFooter, bypassing Formik submission in OptionalConfigurationsStep and
skipping the onSubmit logic that persists infra-env changes; fix by restoring
Formik's submit mechanism: include submitForm in the render props destructure
(add submitForm to the list returned by Formik) and either (a) call await
submitForm() before calling moveNext() in the WizardFooter onClick handler, or
(b) change the WizardFooter Next control to be a form submit (type="submit") and
ensure the step content is wrapped in Formik's <form> so onSubmit (the infra-env
create/update logic) runs before navigation. Ensure moveNext is only invoked
after a successful submit/validation.

---

Nitpick comments:
In `@libs/locales/lib/en/translation.json`:
- Around line 75-76: Duplicate i18n keys exist: "ai:Additional NTP sources" and
"ai:Additional NTP Sources"; choose one canonical key (use "ai:Additional NTP
sources"), update all call sites to use that exact key, remove the duplicate
entry from libs/locales/lib/en/translation.json, and mirror the same
consolidation across other locale files and tests (run i18n lint or
search/replace to ensure no remaining usages of "ai:Additional NTP Sources").

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 153e691c-c4e6-4d40-826c-3268bdfa5052

📥 Commits

Reviewing files that changed from the base of the PR and between f099967 and 357aa65.

📒 Files selected for processing (7)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/config/constants.ts
  • libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
✅ Files skipped from review due to trivial changes (1)
  • libs/ui-lib/lib/common/config/constants.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx

@ElayAharoni ElayAharoni force-pushed the Implement-Conditional-Mandatory-Validation-in-SaaS-UI-for-Proxy-and-NTP-Configurations branch from 357aa65 to 25f5c12 Compare March 19, 2026 12:06
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 19, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2026

@ElayAharoni: This pull request references AGENT-1466 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1466

Summary by CodeRabbit

  • New Features

  • Added localization for the "Additional NTP sources" field label.

  • Improvements

  • Proxy inputs: improved conditional validation — HTTP/HTTPS required only when the other is empty and proxy is enabled.

  • NTP sources: stricter validation, trimming, and only submitted when NTP sources are enabled.

  • TextArea: external onChange handlers are now honored.

  • Disabling proxy/NTP options clears related fields and revalidates.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx (1)

6-15: ⚠️ Potential issue | 🟠 Major

Potential silent behavior change for legacy two-arg callers

Line 14 removes the explicit second parameter, so any legacy call like ntpSourceValidationSchema(t, false) will ignore false at runtime and default to allowEmpty=true. That can unintentionally disable required validation.

💡 Suggested compatibility-safe change
-type NtpSourceValidationOptions = { t: TFunction; allowEmpty?: boolean } | TFunction;
+type NtpSourceValidationOptions = { t: TFunction; allowEmpty?: boolean } | TFunction;

-const parseOptions = (options: NtpSourceValidationOptions) => {
-  const t = typeof options === 'function' ? options : options.t;
-  const allowEmpty = typeof options === 'function' ? true : options.allowEmpty ?? true;
+const parseOptions = (optionsOrT: NtpSourceValidationOptions, allowEmptyArg?: boolean) => {
+  const t = typeof optionsOrT === 'function' ? optionsOrT : optionsOrT.t;
+  const allowEmpty =
+    typeof optionsOrT === 'function' ? allowEmptyArg ?? true : optionsOrT.allowEmpty ?? true;
   return { t, allowEmpty };
 };

-export const ntpSourceValidationSchema = (options: NtpSourceValidationOptions) => {
-  const { t, allowEmpty } = parseOptions(options);
+export const ntpSourceValidationSchema = (
+  optionsOrT: NtpSourceValidationOptions,
+  allowEmptyArg?: boolean,
+) => {
+  const { t, allowEmpty } = parseOptions(optionsOrT, allowEmptyArg);
#!/bin/bash
# Verify that no legacy two-argument calls remain.
# Expected: no matches.
ast-grep --pattern 'ntpSourceValidationSchema($A, $B)'

# Fallback contextual grep for manual inspection.
rg -nP -C2 '\bntpSourceValidationSchema\s*\([^)]*,[^)]*\)' -g '!**/node_modules/**'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx` around lines 6 -
15, The refactor removed the explicit second parameter, breaking legacy calls
like ntpSourceValidationSchema(t, false); restore compatibility by updating
ntpSourceValidationSchema to accept a second optional boolean (e.g.,
ntpSourceValidationSchema(options: NtpSourceValidationOptions | TFunction,
allowEmpty?: boolean)), or add a function overload, and change parseOptions to
prefer an explicitly passed allowEmpty when defined (use the second arg or
arguments[1] if needed) before falling back to options.allowEmpty or true;
update type NtpSourceValidationOptions or overloads accordingly so calls to
ntpSourceValidationSchema(t, false) honor false.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx`:
- Around line 6-15: The refactor removed the explicit second parameter, breaking
legacy calls like ntpSourceValidationSchema(t, false); restore compatibility by
updating ntpSourceValidationSchema to accept a second optional boolean (e.g.,
ntpSourceValidationSchema(options: NtpSourceValidationOptions | TFunction,
allowEmpty?: boolean)), or add a function overload, and change parseOptions to
prefer an explicitly passed allowEmpty when defined (use the second arg or
arguments[1] if needed) before falling back to options.allowEmpty or true;
update type NtpSourceValidationOptions or overloads accordingly so calls to
ntpSourceValidationSchema(t, false) honor false.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e48a3b76-dc44-4771-b3b3-3b2068fa1452

📥 Commits

Reviewing files that changed from the base of the PR and between 357aa65 and 25f5c12.

📒 Files selected for processing (7)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/config/constants.ts
  • libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
✅ Files skipped from review due to trivial changes (2)
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/config/constants.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx

@ElayAharoni ElayAharoni requested a review from rawagner March 19, 2026 12:30
@ElayAharoni ElayAharoni force-pushed the Implement-Conditional-Mandatory-Validation-in-SaaS-UI-for-Proxy-and-NTP-Configurations branch from 25f5c12 to bb0a789 Compare March 19, 2026 12:56
@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 19, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2026

@ElayAharoni: This pull request references AGENT-1466 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1466

Summary by CodeRabbit

  • New Features

  • Added English localization entry for the "Additional NTP sources" label.

  • Improvements

  • Proxy inputs: conditional requiredness — HTTP/HTTPS required only when the other is empty and proxy is enabled.

  • NTP sources: stricter trimming and validation, only submitted when enabled.

  • TextArea: external onChange handlers are now honored.

  • Disabling proxy/NTP clears related fields, resets errors/touched state, and revalidates.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@ElayAharoni ElayAharoni force-pushed the Implement-Conditional-Mandatory-Validation-in-SaaS-UI-for-Proxy-and-NTP-Configurations branch from bb0a789 to a05a626 Compare March 19, 2026 13:03
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@libs/ui-lib/lib/common/config/constants.ts`:
- Line 74: The translation key for the "Additional NTP Sources" label is
inconsistent between constants.ts (additionalNtpSources: t('ai:Additional NTP
sources')) and AdditionalNTPSourcesDialog.tsx (t('ai:Additional NTP Sources'));
pick one canonical key and make both use it—either change the string in
libs/ui-lib/lib/common/config/constants.ts to t('ai:Additional NTP Sources') or
update AdditionalNTPSourcesDialog.tsx to consume the
constants.additionalNtpSources value so both reference the exact same i18n key.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 23813519-babf-480b-9572-3dacec6a1162

📥 Commits

Reviewing files that changed from the base of the PR and between 25f5c12 and bb0a789.

📒 Files selected for processing (7)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/config/constants.ts
  • libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
✅ Files skipped from review due to trivial changes (2)
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/locales/lib/en/translation.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
  • libs/ui-lib/lib/common/validationSchemas/ntpValidation.tsx

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2026

@ElayAharoni: This pull request references AGENT-1466 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1466

Summary by CodeRabbit

  • New Features

  • Added English label for "Additional NTP sources" and surface it in relevant UI.

  • Improvements

  • Proxy inputs: HTTP/HTTPS marked required only when proxy is enabled and the counterpart is empty.

  • NTP sources: trimming and stricter validation; only sent when NTP sources are enabled.

  • Text areas: external onChange handlers now invoked.

  • Disabling proxy/NTP clears related fields, resets validation state, and revalidates.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ElayAharoni, rawagner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit e189939 into openshift-assisted:master Mar 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants