Skip to content

Conversation

@faisalsiddique4400
Copy link
Contributor

@faisalsiddique4400 faisalsiddique4400 commented Jan 2, 2026

feat(admin-ui): update Config API configuration screen with recent changes (#2550)

Summary

This PR updates the Config API configuration screen in the Admin UI to align with the latest backend changes.

Fix Summary

  • Updated the Config API configuration fields to match recent backend updates.
  • Synced UI behavior and payload structure with the latest Config API expectations.
  • Ensured compatibility with recent changes introduced in Janssen.
  • Verified correct rendering and saving of updated configuration values.
  • Typescript version issues.

Reference

Closes

Closes: #2550

Summary by CodeRabbit

  • New Features

    • Per-field read-only support with disabled UI, improved disabled styling, and hidden actions when fields are disabled.
    • Enhanced inline input and multi-select behavior with more reliable defaults, selection handling, and patch application.
  • Bug Fixes

    • Corrected navigation tab null-handling to prevent potential runtime errors.
  • Improvements

    • More reliable rendering and value extraction across configuration forms.
    • Improved submit/audit flow, loading state handling, and clearer user-facing error messages.
    • Consolidated utility helpers and exports for safer behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Warning

Rate limit exceeded

@faisalsiddique4400 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 3 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0a279c9 and 50cf5bd.

📒 Files selected for processing (1)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
📝 Walkthrough

Walkthrough

Adds typed props and disabled/read-only support, refactors ConfigApiConfiguration components to use React hooks/memoization and shared type-guard utilities, restructures utils exports, updates GluuInlineInput with memoized handlers and JsonPatch-based patching, and adjusts GluuTabs null-check logic.

Changes

Cohort / File(s) Summary
Inline Input
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
Added GluuInlineInputProps and ThemeContextValue; introduced useCallback/useEffect/useMemo for state sync; memoized handlers; JsonPatch-based patching; added disabled styling/behavior and disabled-aware controls.
Tabs UI
admin-ui/app/routes/Apps/Gluu/GluuTabs.tsx
Changed isNavigationTab evaluation order by removing an initial truthiness guard (risk of null property access).
Config API Form / Page
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx, admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx
Widened schema property typing; introduced CONFIG_API_RESOURCE_ID and memoized operations array; per-property disabled handling via READ_ONLY_FIELDS; ConfigApiPage converted to arrow function; submit wrapped in useCallback with audit logging and improved loading/error handling.
Json Property Builder
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx
Converted to arrow function; added disabled prop propagation; replaced inline type helpers with utils; memoized path/ids and callbacks; swapped Accordion subcomponent usage and propagated disabled to nested children.
Utils & Type Guards
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts, .../utils/constants.ts, .../utils/index.ts
Added runtime type guards and value getters (isNumber, isBoolean, isString, isStringArray, shouldRenderAs*, get*Value); added READ_ONLY_FIELDS; new utils barrel re-exporting constants, hooks, and typeGuards.
Hooks Barrel
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/hooks/index.ts
Removed re-export: export * from './useConfigApiActions'.
Types
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts
Added optional disabled to JsonPropertyBuilderConfigApiProps and new AccordionWithSubComponents type.
Dev deps
admin-ui/package.json
Upgraded devDependencies: @typescript-eslint/eslint-plugin and @typescript-eslint/parser to 8.51.0.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Page as ConfigApiPage
  participant PatchSvc as patchConfigMutation
  participant Audit as logConfigApiUpdate
  participant Toast

  Note over Page,PatchSvc: Submit flow (useCallback)
  User->>Page: click "Submit"
  Page->>PatchSvc: mutateAsync(patches)
  alt mutation succeeds
    PatchSvc-->>Page: result
    Page->>Audit: logConfigApiUpdate(result)
    alt audit succeeds
      Audit-->>Page: audit ok
      Page->>Toast: show success
    else audit warns/fails
      Audit-->>Page: warning/error
      Page->>Toast: show warning
    end
  else mutation fails
    PatchSvc-->>Page: throw error
    Page->>Toast: show error
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • syntrydy
  • duttarnab
  • moabu

Poem

🐰 I nibble lines of code at night,
Props set true and typings tight,
Disabled flags tucked out of sight,
Patches hop and logs take flight,
A carrot-click for tests that bite. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Out of Scope Changes check ❓ Inconclusive Most changes are in-scope, focused on the Config API configuration screen. However, the GluuTabs.tsx change introduces a potential null-safety regression unrelated to the PR objectives, and the TypeScript ESLint package version upgrades appear tangential to the main Config API alignment work. Review the GluuTabs.tsx null-safety regression to determine if it was intentional, and clarify whether TypeScript ESLint upgrades are necessary for addressing the stated TypeScript typing issues in issue #2550.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely describes the main change: updating the Config API configuration screen in the Admin UI to align with recent changes, which is the primary objective of this changeset.
Linked Issues check ✅ Passed The pull request successfully implements all objectives from issue #2550: updates Config API configuration fields to match backend schema changes, syncs UI behavior with Config API expectations, ensures correct rendering and persistence of configuration values, and addresses TypeScript typing issues.

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.

@mo-auto mo-auto added comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Jan 2, 2026
Copy link
Contributor

@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: 10

Caution

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

⚠️ Outside diff range comments (2)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx (1)

54-66: Consider extracting error message logic to a utility.

The error message extraction (lines 55-58) is correct but verbose. This pattern likely exists elsewhere in the codebase and could be centralized.

🔎 Suggested utility extraction
// In a shared utils file
function getErrorMessage(error: unknown): string {
  if (typeof error === 'object' && error !== null && 'message' in error) {
    return String((error as { message: unknown }).message)
  }
  return String(error)
}

Then in the component:

   if (error !== null && error !== undefined) {
-    const errorText =
-      typeof error === 'object' && error !== null && 'message' in error
-        ? String((error as { message: string | number | boolean | null }).message || error)
-        : String(error)
+    const errorText = getErrorMessage(error)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx (1)

21-29: Incorrect type for schema properties.

The properties type Record<string, string | number | boolean | null | undefined> doesn't match the expected OpenAPI schema structure. Schema properties are objects describing field metadata (e.g., { type: 'string', items: {...} }), not primitive values.

🔎 Proposed fix
 interface SpecSchema {
   components: {
     schemas: {
       ApiAppConfiguration: {
-        properties: Record<string, string | number | boolean | null | undefined>
+        properties: Record<string, { type?: string; items?: { type?: string; enum?: string[] } }>
       }
     }
   }
 }
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b9b6af and 8b97ae7.

📒 Files selected for processing (11)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
  • admin-ui/app/routes/Apps/Gluu/GluuTabs.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/hooks/index.ts
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/constants.ts
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/index.ts
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/useConfigApiActions.ts
💤 Files with no reviewable changes (1)
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/hooks/index.ts
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:43-149
Timestamp: 2025-11-07T12:17:39.857Z
Learning: In the Cedarling configuration UI PR (#2378), the `configApiPolicyStoreUrl` field is intentionally out of scope. It relates to config API configuration and will be covered in a separate PR. The current PR focuses on the Admin UI policy store URL (`auiPolicyStoreUrl`).
📚 Learning: 2025-11-07T12:17:39.857Z
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:43-149
Timestamp: 2025-11-07T12:17:39.857Z
Learning: In the Cedarling configuration UI PR (#2378), the `configApiPolicyStoreUrl` field is intentionally out of scope. It relates to config API configuration and will be covered in a separate PR. The current PR focuses on the Admin UI policy store URL (`auiPolicyStoreUrl`).

Applied to files:

  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx
📚 Learning: 2025-11-05T19:57:35.143Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2415
File: admin-ui/plugins/auth-server/components/Ssa/SsaAddPage.tsx:148-153
Timestamp: 2025-11-05T19:57:35.143Z
Learning: In the SSA Add page (admin-ui/plugins/auth-server/components/Ssa/SsaAddPage.tsx), the Back button should fall back to '/auth-server/config/ssa' when browser history is unavailable, not '/home/dashboard', as this keeps users in the SSA management context.

Applied to files:

  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx
📚 Learning: 2025-12-05T18:24:41.713Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2498
File: admin-ui/plugins/saml/components/SamlConfigurationForm.tsx:30-30
Timestamp: 2025-12-05T18:24:41.713Z
Learning: In the GluuFederation/flex admin-ui codebase, `SetTitle` (imported from 'Utils/SetTitle') is a custom React hook that should be called at the component's top level, not inside `useEffect` or other hooks, because it internally manages side effects for setting page titles.

Applied to files:

  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx
🧬 Code graph analysis (5)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts (1)
admin-ui/app/components/index.tsx (1)
  • Accordion (107-107)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
admin-ui/plugins/auth-server/components/Configuration/DefaultAcrInput.js (4)
  • correctValue (27-27)
  • onValueChanged (34-46)
  • onAccept (47-58)
  • onCancel (59-62)
admin-ui/app/components/index.tsx (3)
  • Col (60-60)
  • FormGroup (70-70)
  • Button (40-40)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (2)
admin-ui/plugins/auth-server/components/Configuration/ConfigPage.js (1)
  • schema (58-58)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts (1)
  • SchemaProperty (4-10)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx (3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts (2)
  • JsonPropertyBuilderConfigApiProps (12-24)
  • AccordionWithSubComponents (26-29)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (3)
  • isBoolean (7-9)
  • isString (11-13)
  • isNumber (3-5)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx (3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/useConfigApiActions.ts (1)
  • useConfigApiActions (11-36)
admin-ui/plugins/auth-server/components/Configuration/ConfigPage.js (2)
  • handleSubmit (115-128)
  • patches (53-53)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
🔇 Additional comments (14)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (1)

3-5: LGTM!

The isNumber guard is correctly implemented as a pure runtime check.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts (1)

23-28: LGTM!

The addition of the disabled prop and AccordionWithSubComponents type properly supports the new read-only field functionality. The compound component typing pattern is appropriate for Accordion with subcomponents.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/constants.ts (1)

1-14: LGTM!

The read-only fields constant is well-structured with proper readonly typing. These security-sensitive fields (API credentials, authentication URLs) are appropriate candidates for read-only protection in the UI.

admin-ui/app/routes/Apps/Gluu/GluuTabs.tsx (1)

56-65: LGTM!

The type guard improvements are sound. The tab && check at the beginning correctly short-circuits before typeof tab === 'object' is evaluated, so null values are properly handled. The additional validation for tab.path being a non-empty string adds robustness.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/index.ts (1)

1-3: LGTM!

Clean barrel export pattern that consolidates the utils module's public API. This simplifies imports for consumers of the ConfigApiConfiguration utilities.

admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (1)

142-220: LGTM!

The render logic properly handles disabled states across all input variants (text, boolean, array). The memoized filtered values and conditional action button rendering are well-implemented.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ConfigApiPage.tsx (2)

25-52: LGTM!

The handleSubmit implementation is well-structured with:

  • Proper separation of mutation and audit logging concerns
  • Graceful handling of audit failures (warning toast instead of error)
  • Comprehensive error handling with localized messages
  • Correct useCallback dependencies

13-23: LGTM!

The component structure is clean with proper hook placement. Based on learnings, SetTitle is correctly called at the component's top level. The combined loading state simplifies the loader condition.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx (2)

90-106: LGTM - Read-only field handling is well implemented.

The iteration over configuration keys with disabled state derived from READ_ONLY_FIELDS is clean. The isDisabled check and propagation to JsonPropertyBuilderConfigApi via the disabled prop follows a good pattern.


49-56: The type assertion on patch.value cannot be removed; only patch.path assertion is unnecessary.

JsonPatch operations define value as unknown (per RFC 6902), while GluuCommitDialogOperation requires it to be JsonValue. The assertion on patch.path is redundant since both are typed as string, but the assertion on patch.value is necessary to narrow unknown to the specific JsonValue type.

If removing the path assertion:

  const operations: GluuCommitDialogOperation[] = useMemo(
    () =>
      patches.map((patch) => ({
-       path: patch.path as string,
+       path: patch.path,
        value: patch.value as JsonValue,
      })),
    [patches],
  )

Likely an incorrect or invalid review comment.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx (4)

12-24: LGTM - Clean component signature with proper default for disabled.

The destructured props with disabled = false default and the explicit return type annotation improve readability and type safety.


28-35: LGTM - Good use of useMemo for derived values.

The memoization of path and uniqueId is appropriate since these are computed from props and used in multiple places including the dependency arrays of other hooks.


50-66: LGTM - Consistent disabled prop propagation across all input types.

The disabled prop is correctly passed to GluuInlineInput in all four primitive/array type branches (boolean, string, number, string array), ensuring read-only fields are properly disabled throughout the form.

Also applies to: 69-85, 87-104, 106-124


146-161: LGTM - Recursive disabled propagation to nested components.

The disabled prop is correctly passed down to nested JsonPropertyBuilderConfigApi instances in both object array (line 158) and object (line 233) branches, ensuring the read-only state is preserved through the entire component tree.

Also applies to: 213-236

Copy link
Contributor

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (1)

166-175: Add type safety for boolean values when isBoolean is true.

Line 172 casts value as boolean, but the prop type allows string | number | boolean | string[]. While most call sites respect the implicit contract of passing boolean values when isBoolean={true}, this isn't enforced by the type system and could lead to unexpected behavior (e.g., if falsy non-boolean values like 0 or "" are passed to GluuToogle, which uses value || false).

Consider a discriminated union type to enforce this relationship at compile time:

type GluuInlineInputProps =
  | { isBoolean: true; value: boolean; /* other props */ }
  | { isBoolean: false; value: string | number | string[]; /* other props */ }

Alternatively, add runtime validation:

{isBoolean && (
  <GluuToogle
    id={name}
    data-testid={name}
    name={name}
    handler={onValueChanged}
    value={typeof value === 'boolean' ? value : false}
    disabled={disabled}
  />
)}
♻️ Duplicate comments (6)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx (2)

34-36: Plain constant for configApiScopes is correct.

The code correctly uses a plain constant instead of useMemo since CONFIG_API_RESOURCE_ID is a module-level constant that never changes.


63-70: Patch deduplication correctly implemented.

The patchHandler now filters out existing patches with the same path before appending the new patch, preventing duplicate or conflicting patches. This addresses the previous concern about patch accumulation.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx (2)

25-27: Accordion aliases eliminate duplication.

Extracting AccordionWithSub, AccordionHeader, and AccordionBody at the module level eliminates the repeated casting and destructuring in the isObjectArray and isObject branches, improving code clarity.


178-254: Remove button correctly handles disabled state.

The remove button now includes:

  • Visual styling changes when disabled (gray background, not-allowed cursor, reduced opacity)
  • disabled attribute to prevent clicks
  • aria-disabled attribute for accessibility

The disabled prop is also correctly propagated to child JsonPropertyBuilderConfigApi instances.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (1)

3-17: Type guards correctly separated from schema-based checks.

The type guards now perform pure runtime type checks without mixing in schema-based logic, which addresses previous concerns about incorrect type assertions. Specifically:

  • isStringArray uses .every() which correctly handles empty arrays (returns true for [])
  • Schema-based rendering decisions are delegated to separate shouldRenderAs* functions

This separation of concerns is the correct pattern for type-safe code.

admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (1)

110-121: Empty path fallback still allows unintended root-level patches.

This issue from the previous review remains unresolved. Line 116 defaults path to an empty string when undefined. In JSON Patch specification, an empty path "" targets the document root, which would replace the entire configuration instead of a specific field, potentially causing data corruption.

🔎 Proposed fix
   const onAccept = useCallback(() => {
     if (disabled) {
       return
     }
+    if (!path) {
+      console.error('Cannot apply patch: path is required')
+      return
+    }
     const patch: JsonPatch = {
       op: 'replace',
-      path: path || '',
+      path: path,
       value: isArray ? correctValue : data,
     } as JsonPatch
     handler(patch)
     setShow((prev) => !prev)
-  }, [disabled, path, isArray, correctValue, data, handler])
+  }, [disabled, path, isArray, correctValue, data, handler])
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b97ae7 and 223e64b.

📒 Files selected for processing (5)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
  • admin-ui/package.json
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-26T12:25:34.923Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2475
File: admin-ui/plugins/auth-server/components/Clients/ClientDetailPage.js:111-216
Timestamp: 2025-11-26T12:25:34.923Z
Learning: In the admin-ui codebase, avoid suggesting comments for small functionalities or straightforward layout decisions in smaller components. Comments should be reserved for more complex or non-obvious logic.

Applied to files:

  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx
📚 Learning: 2025-11-07T12:17:39.857Z
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:43-149
Timestamp: 2025-11-07T12:17:39.857Z
Learning: In the Cedarling configuration UI PR (#2378), the `configApiPolicyStoreUrl` field is intentionally out of scope. It relates to config API configuration and will be covered in a separate PR. The current PR focuses on the Admin UI policy store URL (`auiPolicyStoreUrl`).

Applied to files:

  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx
📚 Learning: 2025-11-07T12:55:26.241Z
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:93-104
Timestamp: 2025-11-07T12:55:26.241Z
Learning: In the Cedarling configuration feature (admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx), the sync role to scopes mappings operation depends on the `auiPolicyStoreUrl`. The backend fetches content from this URL and syncs roles based on the response. Therefore, the audit log for the sync operation should include the `auiPolicyStoreUrl` in its payload to provide proper audit context.

Applied to files:

  • admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx
🧬 Code graph analysis (4)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (5)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
admin-ui/plugins/auth-server/components/Configuration/DefaultAcrInput.js (4)
  • correctValue (27-27)
  • onValueChanged (34-46)
  • onAccept (47-58)
  • onCancel (59-62)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (1)
  • isBoolean (7-9)
admin-ui/plugins/admin/__tests__/components/CustomScripts/CustomScriptDetailPage.test.js (1)
  • name (18-18)
admin-ui/app/components/index.tsx (3)
  • Col (60-60)
  • FormGroup (70-70)
  • Button (40-40)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx (4)
admin-ui/plugins/auth-server/components/Configuration/ConfigPage.js (4)
  • useAppNavigation (29-29)
  • modal (52-52)
  • operations (54-54)
  • configuration (30-30)
admin-ui/app/helpers/navigation.ts (2)
  • useAppNavigation (173-202)
  • ROUTES (204-204)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (2)
  • JsonPatch (3-3)
  • ApiAppConfiguration (3-3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/constants.ts (1)
  • READ_ONLY_FIELDS (1-14)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx (3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts (1)
  • AccordionWithSubComponents (26-29)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (12)
  • isBoolean (7-9)
  • shouldRenderAsBoolean (19-21)
  • getBooleanValue (35-43)
  • isString (11-13)
  • shouldRenderAsString (23-25)
  • getStringValue (45-53)
  • isNumber (3-5)
  • shouldRenderAsNumber (31-33)
  • getNumberValue (55-63)
  • isStringArray (15-17)
  • shouldRenderAsStringArray (27-29)
  • getStringArrayValue (65-73)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (1)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/componentTypes.ts (1)
  • SchemaProperty (4-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: label PR
🔇 Additional comments (24)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/ApiConfigForm.tsx (5)

13-14: LGTM!

The new imports support the disabled field logic and typed operations array, which are essential for the Config API configuration updates.


25-25: LGTM!

The widened properties type appropriately reflects the dynamic nature of API configuration properties parsed from the YAML spec.


43-46: LGTM!

The memoization of canWriteConfigApi and operations is appropriate for optimizing re-renders and deriving the commit dialog operations from patches.

Also applies to: 48-54


88-90: LGTM!

Memoizing handleBack prevents unnecessary re-creation of the callback on each render.


94-110: LGTM!

The disabled field logic correctly identifies read-only fields from READ_ONLY_FIELDS and propagates the disabled prop to JsonPropertyBuilderConfigApi, ensuring read-only fields cannot be modified in the UI.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/JsonPropertyBuilderConfigApi.tsx (9)

1-1: LGTM!

The expanded imports for useMemo, useCallback, and the utility functions (isNumber, isBoolean, etc.) support the refactored type-checking and value-extraction logic throughout the component.

Also applies to: 10-23


29-41: LGTM!

The function signature correctly includes the disabled prop with a default value of false, enabling read-only field support while maintaining backward compatibility.


45-50: LGTM!

Memoizing path and uniqueId avoids unnecessary recomputation of these derived values on every render.

Also applies to: 52-52


54-62: LGTM!

The memoized removeHandler correctly creates the remove patch and updates the show state. The disabled state is handled via the button's disabled attribute rather than in the handler, which is the correct approach.


64-80: LGTM!

The boolean rendering logic correctly uses isBoolean/shouldRenderAsBoolean for type detection and getBooleanValue for value extraction, while properly propagating the disabled prop to the input.


83-99: LGTM!

The string rendering logic correctly uses the type guards and value extractor, with proper disabled propagation.


101-118: LGTM!

The number rendering logic correctly handles both runtime type checks and schema-based rendering decisions. The disabled prop is properly propagated to the input.


120-138: LGTM!

The string array rendering correctly uses getStringArrayValue for both the value and options (when no enum is defined in the schema), with proper disabled propagation.


140-176: LGTM!

The object array rendering uses the extracted Accordion aliases and correctly propagates the disabled prop to child JsonPropertyBuilderConfigApi instances, ensuring consistent read-only behavior throughout nested structures.

admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (2)

19-33: LGTM!

The shouldRenderAs* helper functions correctly handle schema-based rendering decisions, properly separated from runtime type guards. The null-safe optional chaining ensures safe access to schema properties.


65-73: LGTM!

getStringArrayValue appropriately returns an empty array [] as the default instead of undefined, which aligns with the expected usage in array-handling contexts.

admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (7)

1-9: LGTM: Imports properly support the component refactor.

The addition of React hooks (useCallback, useEffect, useMemo) and the JsonPatch type import align well with the component's refactoring to improve performance and type safety.


11-34: LGTM: Well-defined TypeScript interfaces.

The interfaces provide strong typing for component props and context, improving type safety and developer experience. The value prop union type correctly accommodates both primitive and array values for different input modes.


52-62: LGTM: Array guard resolves previous type mismatch concern.

The useEffect now includes !Array.isArray(value) guard (line 59), which properly prevents array values from being assigned to the data state. This addresses the previous review comment about type mismatch between the data state type and the value prop type.


64-77: LGTM: Properly memoized and disabled-aware callback.

The onValueChanged callback correctly uses useCallback for optimization, includes a disabled guard, and properly handles both boolean and text input changes with appropriate typing.


79-108: LGTM: Memoized callback with proper type guards.

The callback correctly uses useCallback, includes disabled guard, and properly filters and processes both string and object selections. The special handling for tokenEndpointAuthMethodsSupported (lines 91-102) accommodates specific API field structure requirements.


123-141: LGTM: Clean callback and memoized helper values.

The onCancel callback, disabledStyle, filteredValue, and filteredOptions are all properly implemented with correct memoization and dependencies. The filtering logic prevents potential rendering issues with null/undefined values.


176-220: LGTM: Well-structured JSX with proper disabled state handling.

The Typeahead configuration correctly uses filtered values and options, and the action buttons are properly hidden when disabled (line 194). The self-closing icon tag (line 202) is a minor code quality improvement.

admin-ui/package.json (1)

81-82: No action required. The @typescript-eslint upgrade to v8.51.0 is fully compatible with TypeScript 5.3.3 and ESLint 8.37.0. The project's .eslintrc.js configuration is already compliant and does not use any deprecated rules from the v7→v8 migration (prefer-ts-expect-error, no-var-requires, no-throw-literal).

Copy link
Contributor

@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

♻️ Duplicate comments (1)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (1)

110-121: Unresolved: Empty path fallback could cause root-level patches.

Line 116 still defaults path to an empty string when undefined. In JSON Patch, an empty path targets the document root, which would replace the entire configuration instead of a specific field. This was flagged in a previous review but hasn't been addressed.

🔎 Proposed fix
   const onAccept = useCallback(() => {
     if (disabled) {
       return
     }
+    if (!path) {
+      console.error('GluuInlineInput: Cannot apply patch without a valid path')
+      return
+    }
     const patch: JsonPatch = {
       op: 'replace',
-      path: path || '',
+      path: path,
       value: isArray ? correctValue : data,
     } as JsonPatch
     handler(patch)
     setShow((prev) => !prev)
-  }, [disabled, path, isArray, correctValue, data, handler])
+  }, [disabled, path, isArray, correctValue, data, handler])
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 223e64b and 80239a9.

📒 Files selected for processing (1)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-26T12:25:34.923Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2475
File: admin-ui/plugins/auth-server/components/Clients/ClientDetailPage.js:111-216
Timestamp: 2025-11-26T12:25:34.923Z
Learning: In the admin-ui codebase, avoid suggesting comments for small functionalities or straightforward layout decisions in smaller components. Comments should be reserved for more complex or non-obvious logic.

Applied to files:

  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧬 Code graph analysis (1)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (1)
  • isBoolean (7-9)
admin-ui/app/components/index.tsx (3)
  • Col (60-60)
  • FormGroup (70-70)
  • Button (40-40)
🔇 Additional comments (5)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (5)

1-1: Good addition of hooks and strongly-typed interfaces.

The imports of React hooks and JsonPatch type, along with the new GluuInlineInputProps and ThemeContextValue interfaces, improve type safety and enable proper memoization. The narrowing of the type prop (line 14) to a specific union addresses the previous review concern about accepting any string.

Also applies to: 9-9, 11-34


58-62: Good array guard in useEffect.

The array guard on line 59 properly prevents array values from being assigned to the data state, addressing part of the previous review concern. This ensures type safety for updates after the initial render.


64-77: Well-implemented event handlers with consistent disabled guards.

Both onValueChanged and handleTypeAheadChange properly use useCallback for memoization and consistently check the disabled state before processing changes. The logic correctly handles boolean toggles, string/number inputs, and complex typeahead selections with mixed object/string inputs.

Also applies to: 79-108


128-141: Effective use of useMemo for performance and data sanitization.

The memoized disabledStyle, filteredValue, and filteredOptions improve performance and prevent null/undefined values from causing issues in the Typeahead component. Dependencies are correctly specified for all three memos.


154-220: Render logic properly implements disabled state and uses memoized values.

The render logic consistently applies the disabled state and styling across all input types (regular inputs, boolean toggles, and typeahead arrays). The use of memoized filteredValue and filteredOptions prevents rendering issues with null/undefined values, and action buttons are correctly hidden when disabled.

duttarnab
duttarnab previously approved these changes Jan 2, 2026
Copy link
Contributor

@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

♻️ Duplicate comments (1)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (1)

112-123: Empty path fallback could cause unintended root-level patches.

Line 118 defaults path to an empty string when undefined. In JSON Patch, an empty path targets the document root, which would replace the entire configuration instead of a specific field. This issue was previously flagged and remains unresolved.

🔎 Proposed fix
 const onAccept = useCallback(() => {
   if (disabled) {
     return
   }
+  if (!path) {
+    console.error('Cannot apply patch: path is required')
+    return
+  }
   const patch: JsonPatch = {
     op: 'replace',
-    path: path || '',
+    path: path,
     value: isArray ? correctValue : data,
   } as JsonPatch
   handler(patch)
   setShow((prev) => !prev)
-}, [disabled, path, isArray, correctValue, data, handler])
+}, [disabled, path, isArray, correctValue, data, handler])
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80239a9 and 94dc763.

📒 Files selected for processing (1)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:43-149
Timestamp: 2025-11-07T12:17:39.857Z
Learning: In the Cedarling configuration UI PR (#2378), the `configApiPolicyStoreUrl` field is intentionally out of scope. It relates to config API configuration and will be covered in a separate PR. The current PR focuses on the Admin UI policy store URL (`auiPolicyStoreUrl`).
📚 Learning: 2025-11-26T12:25:34.923Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2475
File: admin-ui/plugins/auth-server/components/Clients/ClientDetailPage.js:111-216
Timestamp: 2025-11-26T12:25:34.923Z
Learning: In the admin-ui codebase, avoid suggesting comments for small functionalities or straightforward layout decisions in smaller components. Comments should be reserved for more complex or non-obvious logic.

Applied to files:

  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)

Copy link
Contributor

@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

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94dc763 and dfec8a8.

📒 Files selected for processing (1)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:43-149
Timestamp: 2025-11-07T12:17:39.857Z
Learning: In the Cedarling configuration UI PR (#2378), the `configApiPolicyStoreUrl` field is intentionally out of scope. It relates to config API configuration and will be covered in a separate PR. The current PR focuses on the Admin UI policy store URL (`auiPolicyStoreUrl`).
📚 Learning: 2025-11-26T12:25:34.923Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2475
File: admin-ui/plugins/auth-server/components/Clients/ClientDetailPage.js:111-216
Timestamp: 2025-11-26T12:25:34.923Z
Learning: In the admin-ui codebase, avoid suggesting comments for small functionalities or straightforward layout decisions in smaller components. Comments should be reserved for more complex or non-obvious logic.

Applied to files:

  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧬 Code graph analysis (1)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (2)
admin-ui/plugins/auth-server/components/Configuration/DefaultAcrInput.js (4)
  • correctValue (27-27)
  • onValueChanged (34-46)
  • onAccept (47-58)
  • onCancel (59-62)
admin-ui/app/components/index.tsx (3)
  • Col (60-60)
  • FormGroup (70-70)
  • Button (40-40)
🔇 Additional comments (9)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (9)

11-28: LGTM! Well-typed props interface.

The interface properly defines all component props with appropriate types. The type prop is now correctly restricted to valid HTML input types, and the handler is properly typed to accept JsonPatch, addressing previous type safety concerns.


56-58: Good fix for falsy value handling.

The state initialization now correctly handles falsy primitives (like false or 0) by checking value !== undefined instead of the previous truthy check. This ensures the actual value is preserved rather than defaulting to an empty string.


60-64: Proper value synchronization.

The effect correctly synchronizes the internal state with prop changes while maintaining type safety by excluding array values.


66-79: Clean event handler with proper disabled guard.

The callback correctly prevents updates when disabled and appropriately handles both boolean and text input changes.


81-110: Type-safe Typeahead handler with proper guards.

The callback correctly:

  • Guards against disabled state
  • Uses type predicates to separate object and string selections
  • Validates string types before aggregating values
  • Handles the tokenEndpointAuthMethodsSupported field's special structure

The implementation is appropriate for this reusable component.


125-143: Good use of React optimization hooks.

The memoized values efficiently filter null/undefined entries and compute disabled styling only when dependencies change. The cancel callback is clean and properly resets state.


156-167: Correct input handling with disabled support.

The String(data) conversion safely handles both string and number values, and the disabled state is properly applied to both the input's native disabled prop and visual styling.


168-191: Boolean and array branches properly handle disabled state.

The type casts are safe given the isBoolean and isArray guards, and both GluuToogle and Typeahead correctly receive the disabled prop along with filtered values to prevent null/undefined issues.


196-218: Action buttons correctly hidden when disabled.

The condition properly prevents the save/cancel UI from rendering when the component is disabled, maintaining consistent disabled behavior throughout.

Copy link
Contributor

@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

Caution

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

⚠️ Outside diff range comments (2)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (2)

204-215: Inconsistent icon tag style.

Line 204 uses a self-closing <i /> tag while line 215 uses <i></i>. Both are functionally identical, but consistency would improve code style.

🔎 Suggested fix
-              <i className="fa fa-times me-2"></i>
+              <i className="fa fa-times me-2" />

156-167: Change Input to use value prop instead of defaultValue for proper re-render handling.

The Input component at line 162 uses defaultValue={String(data)}, which only applies the initial value. When the value prop changes from the parent, the useEffect (lines 60-64) correctly updates the data state, but the Input won't visually reflect this change because defaultValue is ignored on re-renders. This creates a mismatch where the internal state and DOM become out of sync.

Use value={String(data)} instead to make this a fully controlled component that updates when data changes.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfec8a8 and 0a279c9.

📒 Files selected for processing (1)
  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:43-149
Timestamp: 2025-11-07T12:17:39.857Z
Learning: In the Cedarling configuration UI PR (#2378), the `configApiPolicyStoreUrl` field is intentionally out of scope. It relates to config API configuration and will be covered in a separate PR. The current PR focuses on the Admin UI policy store URL (`auiPolicyStoreUrl`).
📚 Learning: 2025-11-26T12:25:34.923Z
Learnt from: faisalsiddique4400
Repo: GluuFederation/flex PR: 2475
File: admin-ui/plugins/auth-server/components/Clients/ClientDetailPage.js:111-216
Timestamp: 2025-11-26T12:25:34.923Z
Learning: In the admin-ui codebase, avoid suggesting comments for small functionalities or straightforward layout decisions in smaller components. Comments should be reserved for more complex or non-obvious logic.

Applied to files:

  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
📚 Learning: 2025-11-10T14:18:58.310Z
Learnt from: kdhttps
Repo: GluuFederation/flex PR: 2378
File: admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx:107-109
Timestamp: 2025-11-10T14:18:58.310Z
Learning: In the Cedarling configuration page (admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx), console.error calls should be kept in catch blocks when there are multiple operations in the try block, as they help print the whole error object with details for debugging unexpected errors.

Applied to files:

  • admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx
🧬 Code graph analysis (1)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (3)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/types/configApiTypes.ts (1)
  • JsonPatch (3-3)
admin-ui/plugins/auth-server/components/Configuration/DefaultAcrInput.js (4)
  • correctValue (27-27)
  • onValueChanged (34-46)
  • onAccept (47-58)
  • onCancel (59-62)
admin-ui/plugins/auth-server/components/Configuration/ConfigApiConfiguration/utils/typeGuards.ts (1)
  • isBoolean (7-9)
🔇 Additional comments (6)
admin-ui/app/routes/Apps/Gluu/GluuInlineInput.tsx (6)

1-9: LGTM: TypeScript and React hooks properly imported.

The additions of useCallback, useEffect, useMemo hooks and the JsonPatch type align well with the refactoring to add type safety and performance optimizations.


11-34: LGTM: Strong typing with proper prop interfaces.

The GluuInlineInputProps interface provides comprehensive type safety with appropriate types for each prop. The type prop is correctly restricted to valid HTML input types, and the new disabled prop supports the enable/disable semantics mentioned in the PR objectives.


56-64: LGTM: Proper state initialization and synchronization.

The state initialization correctly guards against array values and handles falsy primitives (false, 0) appropriately. The useEffect properly synchronizes the local data state with external value prop changes.


66-79: LGTM: Proper event handler with disabled guard.

The onValueChanged callback is correctly memoized and includes appropriate disabled state handling. The logic properly distinguishes between boolean (checkbox) and text input value extraction.


81-110: LGTM: Robust Typeahead handler with type safety.

The callback properly handles mixed arrays of strings and objects using type guards. The disabled guard prevents changes when the component is disabled. The special handling for tokenEndpointAuthMethodsSupported is appropriate for the field's unique structure.


125-143: LGTM: Proper memoization for callbacks and computed values.

The onCancel callback and memoized values (disabledStyle, filteredValue, filteredOptions) are correctly implemented. The null filtering in filteredValue and filteredOptions prevents potential runtime issues with null/undefined array items.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 2, 2026

@moabu moabu merged commit b156764 into main Jan 2, 2026
8 checks passed
@moabu moabu deleted the admin-ui-issue-2550 branch January 2, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(admin-ui): update config-api configuration screen with recent changes

4 participants