Skip to content

feat(admin-ui): revamp Jans Lock module as per Figma #2706

Merged
moabu merged 21 commits intomainfrom
admin-ui-issue-2637
Mar 19, 2026
Merged

feat(admin-ui): revamp Jans Lock module as per Figma #2706
moabu merged 21 commits intomainfrom
admin-ui-issue-2637

Conversation

@faisalsiddique4400
Copy link
Contributor

@faisalsiddique4400 faisalsiddique4400 commented Mar 18, 2026

feat(admin-ui): revamp Jans Lock module as per Figma (#2637)

Summary

This PR revamps the Jans Lock module in the Admin UI to align with the latest Figma designs as part of the ongoing Admin UI redesign initiative.

Changes Included

  • Updated layout and visual styling according to Figma specifications.
  • Improved structure and information hierarchy.
  • Standardized spacing, typography, and alignment with the updated design system.
  • Enhanced usability for Jans Lock configuration workflows.
  • Ensured consistent UI behavior and responsiveness.

Result

  • Modernized and visually consistent Jans Lock module.
  • Improved clarity and usability for administrators managing lock configurations.
  • Better alignment with the overall Admin UI redesign effort.

Parent Initiative

This work is part of the following parent feature:
feat(admin-ui): Revamp the existing design of the admin-ui according to the new design

🔗 Ticket

Closes: #2637

Summary by CodeRabbit

  • New Features

    • Dynamic, theme-aware Jans Lock UI with permission-aware read/write controls and improved form validation/fields.
    • Toast messaging now normalizes different message shapes for clearer user feedback.
  • Tests

    • Large expansion of unit and integration tests covering Cedarling, Lock UI, helpers, validations, and form renderers.
  • Documentation

    • Added many translation keys for validation prompts and placeholders (en/es/fr/pt).
  • Style

    • New theming and detailed styles for the Lock configuration pages.

faisalsiddique4400 and others added 15 commits March 16, 2026 16:43
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
@coderabbitai
Copy link
Contributor

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
📝 Walkthrough

Walkthrough

Adds many new tests (Cedarling, Jans-Lock, plugins), refactors Jans‑Lock into a renderer-driven form with theme styles and new validation/patch logic, expands localization keys across languages, migrates schema → user-claims imports/tests, tightens toast/Redux typing, and updates various mocks and minor type/signature tweaks.

Changes

Cohort / File(s) Summary
Cedarling tests
admin-ui/app/cedarling/__tests__/client/CedarlingClient.test.ts, admin-ui/app/cedarling/__tests__/constants/resourceScopes.test.ts, admin-ui/app/cedarling/__tests__/enums/CedarlingLogType.test.ts, admin-ui/app/cedarling/__tests__/hooks/useCedarling.test.ts, admin-ui/app/cedarling/__tests__/utility/resources.test.ts
Adds five test suites covering cedarling client init/authorize, resource scope consistency, log enum values, useCedarling hook behaviors (permission caching, authorize flows), and resource utilities.
Jans‑Lock UI & styles
admin-ui/plugins/jans-lock/components/JansLock.tsx, .../JansLockConfiguration.tsx, .../JansLockFieldRenderer.tsx, .../constants.ts, .../styles/JansLockFormPage.style.ts
Replaces static form with dynamic field-renderer pattern, introduces themed styles/useStyles, permission checks (canRead/canWrite), memoized handlers, and exports memoized components and config constants.
Jans‑Lock helpers & types
admin-ui/plugins/jans-lock/helper/utils.ts, .../validations.ts, .../index.ts, .../types/jans-lock-types.ts
Refactors validations into getLockValidationSchema(t), extends transform/patch logic to handle cedarling policy sources, adds buildLockChangedFieldOperations export, and updates JansLock form types and FieldConfig types.
Jans‑Lock tests
admin-ui/plugins/jans-lock/__tests__/components/*.test.ts[x]
Large set of unit tests for JansLock components, field renderer, constants, helpers, validations, and utilities.
Localization
admin-ui/app/locales/en/translation.json, .../es/translation.json, .../fr/translation.json, .../pt/translation.json
Adds lock validation and enter_* placeholder keys plus attribute_deleted across English, Spanish, French, Portuguese; minor JSON formatting fixes.
User‑claims migration & tests
admin-ui/plugins/user-claims/..., admin-ui/plugins/user-claims/__tests__/cedarTestHelpers.ts, .../components/UserClaims*.tsx
Moves schema-related imports to user-claims plugin paths, adds cedarTestHelpers for test constants, updates tests/mocks to the new plugin layout, and refactors related components to use GluuDetailGrid and simplified permission deps.
Toast & Redux typing
admin-ui/app/redux/types/index.ts, admin-ui/app/redux/features/toastSlice.ts, admin-ui/app/routes/Apps/Gluu/GluuToast.tsx
Introduces ToastMessage union and extras types, UpdateToastPayload, types ToastState.message accordingly, annotates toastSlice, and normalizes toast UI to handle string/object messages.
Plugin path & mocks consolidation
Multiple test files under plugins (smtp, admin, scripts, admin asset tests)
Adjusts import paths (smtp-management → smtp, schema → user-claims, CustomScripts paths), and expands/aligns ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES in many test mocks.
Detail grid & types
admin-ui/app/components/GluuDetailGrid/*
Adds optional fullWidth field to GluuDetailGridField, new detailItemFullWidth style, and applies class when field.fullWidth is true.
Misc types/formatting
admin-ui/app/utilities.tsx, admin-ui/app/routes/Apps/Gluu/GluuTabs.tsx, admin-ui/plugins/saml/..., admin-ui/plugins/admin/..., admin-ui/plugins/user-management/...
Minor TypeScript/type formatting changes, require.context signature punctuation, removal of an explicit null-check in GluuTabs type guard, SAML showError behavior updates, and multiple small import/path adjustments.

Sequence Diagram(s)

sequenceDiagram
    participant UI as JansLock UI
    participant Hook as useCedarling / Auth
    participant API as Lock API
    participant Commit as Patch Builder

    UI->>Hook: request authorization (authorize)
    Hook-->>UI: decision (read/write)
    UI->>UI: build form values (transformToFormValues)
    UI->>Commit: compute patch operations (buildLockChangedFieldOperations)
    Commit-->>UI: operations (add/replace/remove)
    UI->>API: submit patchMutation (operations)
    API-->>UI: response (success/error)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • duttarnab

Poem

🐰 I hopped through tests and fields today,

Cedar checks pass and Jans‑Lock lights the way;
Translations sprout in languages four,
Types aligned and mocks add more;
A tiny rabbit cheers: code ready — hooray!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive While the PR includes several out-of-scope changes (translation updates for multiple languages, import path corrections for SMTP and user-claims plugins, toast message type system upgrades), these appear to be supporting refactorings and standardizations rather than unrelated features. Clarify whether translation updates, plugin path reorganizations, and toast type system changes were necessary for the Jans Lock redesign or represent separate initiatives.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(admin-ui): revamp Jans Lock module as per Figma' directly and clearly describes the main change: a redesign of the Jans Lock module to align with Figma specifications.
Linked Issues check ✅ Passed The PR successfully implements the objective from issue #2637: to revamp the Jans Lock module UI to follow Figma designs, evidenced by comprehensive styling updates, component refactoring, new test suites, form field restructuring, and translation additions.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch admin-ui-issue-2637
📝 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.

@mo-auto mo-auto added the comp-admin-ui Component affected by issue or PR label Mar 18, 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: 12

Caution

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

⚠️ Outside diff range comments (1)
admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx (1)

17-27: 🧹 Nitpick | 🔵 Trivial

Keep Cedarling mocks consistent across import paths.

lock was added in @/cedarling, but @/cedarling/constants/resourceScopes still omits it. Keeping both mocks aligned avoids future false positives if import usage shifts.

Suggested alignment
 jest.mock('@/cedarling/constants/resourceScopes', () => ({
-  CEDAR_RESOURCE_SCOPES: { Attributes: [], webhooks: [] },
+  CEDAR_RESOURCE_SCOPES: { Attributes: [], webhooks: [], lock: [] },
 }))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx`
around lines 17 - 27, The two Jest mocks are inconsistent: ADMIN_UI_RESOURCES
and CEDAR_RESOURCE_SCOPES in the '@/cedarling' mock include a "Lock"/"lock"
entry but the '@/cedarling/constants/resourceScopes' mock omits it; update the
'@/cedarling/constants/resourceScopes' mock so CEDAR_RESOURCE_SCOPES also
contains lock: [] (matching the other mock) and ensure both mocks share the same
keys and value shapes for ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES to avoid
future false positives.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@admin-ui/app/cedarling/__tests__/hooks/useCedarling.test.ts`:
- Around line 157-201: Clear and/or reset the token_authorize mock at the start
of each test (e.g. token_authorize.mockClear() or mockReset()) and in the
"returns cached decision without calling API" test add an assertion that
token_authorize was not called (expect(token_authorize).not.toHaveBeenCalled()
or token_authorize.mock.calls.length === 0) after calling
useCedarling().authorize; for the "deduplicates entries with same resourceId and
action" test remove the preloaded cedarState permission (do not seed
'Dashboard::read') so the authorizeHelper path actually triggers the API, then
assert token_authorize was called exactly once to confirm deduplication
(expect(token_authorize).toHaveBeenCalledTimes(1)) while keeping the existing
checks on results.

In `@admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx`:
- Around line 105-121: The test currently only checks document.body and should
assert specific UI behavior when permissions are missing: update the test that
mocks useCedarling (hasCedarReadPermission/hasCedarWritePermission) for the
JansLock component to assert expected outcomes—e.g., use render with Wrapper and
then assert that an "access denied" message is present (getByText or findByText)
or that the lock control elements (queryByTestId for the lock toggle/button or
text like "Lock" or "Unlock") are not rendered; keep mocks on useCedarling and
replace the weak expect(document.body).toBeTruthy() with one or two targeted
assertions verifying absence/presence of the appropriate UI elements for
no-permission users.

In
`@admin-ui/plugins/jans-lock/__tests__/components/JansLockConfiguration.test.tsx`:
- Around line 69-85: The test's mock object mockConfig contains an extra field
cedarlingConfiguration that isn't part of the form type
JansLockConfigFormValues; update the mock to match the form shape by removing
cedarlingConfiguration (or if you intentionally want to simulate extra API
fields, add an inline comment near mockConfig explaining that extra fields are
included to mirror real API responses) so the fixture aligns with
JansLockConfigurationProps['lockConfig'] and JansLockConfigFormValues used in
JansLockConfiguration.test.tsx.

In
`@admin-ui/plugins/jans-lock/__tests__/components/JansLockFieldRenderer.test.tsx`:
- Around line 20-25: The mocks in JansLockFieldRenderer.test.tsx use
non-canonical casing 'Lock' for ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES;
update the mocked values for ADMIN_UI_RESOURCES (key Lock) and
CEDAR_RESOURCE_SCOPES (key Lock) to use the canonical lowercase 'lock' to match
production constants so permission checks in JansLockFieldRenderer and related
tests aren't masked by casing differences.

In `@admin-ui/plugins/jans-lock/components/JansLock.tsx`:
- Around line 30-45: The component currently calls useGetLockProperties
regardless of permissions; refactor so the query hook is only invoked when read
permission is confirmed by canReadLock: create or move the child component that
calls useGetLockProperties (and renders the lock details) behind a conditional
render guarded by canReadLock so the hook does not run when unauthorized; ensure
useMemo dependencies include lockResourceId for canReadLock and canWriteLock and
update the useEffect dependency array to include lockScopes and authorizeHelper;
apply the same conditional-mount pattern to the other block referenced (lines
~82-98) so no lock-fetching hooks run unless canReadLock is true.

In `@admin-ui/plugins/jans-lock/components/JansLockConfiguration.tsx`:
- Around line 85-88: The commit dialog is built from untrimmed formik.values
while createPatchOperations diffs trimObjectStrings(formik.values), causing
spurious listed changes for whitespace-only edits; fix by trimming the values
before building commitOperations: compute const trimmedValues =
trimObjectStrings(formik.values) (or call trimObjectStrings inline) and pass
trimmedValues to buildLockChangedFieldOperations(initialFormValues,
trimmedValues, t), and update the useMemo dependency array to watch
trimmedValues (or formik.values if you memoize the trimmed result) so the
confirmation list matches createPatchOperations.

In `@admin-ui/plugins/jans-lock/helper/utils.ts`:
- Around line 147-168: The code always writes two blank policy source objects
because policySources is unconditionally populated with possibly-empty entries;
change construction of policySources so it only includes entries that are
actually configured (e.g., only push the JSON entry when policiesJsonUris or
jsonSourceChanged and policiesJsonUris is non-empty, and only push the ZIP entry
when policiesZipUris or zipSourceChanged and policiesZipUris is non-empty), or
filter out entries with empty policyStoreUri before assigning to
updatedCedarling; update where policySources is built (referenced by the
variable policySources) and then use that filtered array when creating
updatedCedarling and the differences entry for path '/cedarlingConfiguration' so
you don’t persist blank { authorizationToken: '', policyStoreUri: '' } objects.
- Line 42: The code unconditionally writes disableExternalLoggerConfiguration by
calling toBooleanValue(config.disableExternalLoggerConfiguration), which causes
untouched configs to gain a false value; update the mapping in utils.ts to only
add the disableExternalLoggerConfiguration key when the incoming config actually
contains it (e.g., check
config.hasOwnProperty('disableExternalLoggerConfiguration') or typeof
config.disableExternalLoggerConfiguration !== 'undefined') and only then set
disableExternalLoggerConfiguration:
toBooleanValue(config.disableExternalLoggerConfiguration); apply the same
conditional pattern for the other occurrence noted (line ~83).
- Around line 35-37: The form flattens tokenChannels to a comma-separated string
but createPatchOperations compares/returns that string, causing array-valued API
data to be overwritten; update createPatchOperations to detect when the original
config's tokenChannels was an array and, before diffing/patching, convert the
form value (the string) back into an array by splitting on commas and trimming
entries so the API receives the original array shape; apply the same
normalization logic where tokenChannels is handled elsewhere (the second
occurrence around the similar block at lines 78-79) so both code paths preserve
array-vs-string shape.

In `@admin-ui/plugins/jans-lock/helper/validations.ts`:
- Around line 19-25: The cleanServiceInterval Yup schema is confusing because it
calls .nullable() then .required() (with emptyStringToNull transforming '' to
null); remove the .nullable() call so the chain reads
transform(emptyStringToNull) -> .integer(...) -> .min(...) -> .required(...) ->
.typeError(...), ensuring nulls are rejected for the required
cleanServiceInterval field and preserving the empty-string-to-null transform
behavior.

In `@admin-ui/plugins/jans-lock/types/jans-lock-types.ts`:
- Around line 45-51: The lockConfig prop in JansLockConfigurationProps is too
loosely typed as Record<string, unknown>; replace it with a concrete type that
matches the API model (either the existing JansConfigApi type for lock config or
a new interface describing the expected fields), update the import and the type
reference in JansLockConfigurationProps (keep symbol names
JansLockConfigurationProps and lockConfig), and run typechecks to ensure
consumers (components using onUpdate and PatchOperation[]) still compile against
the stricter lockConfig type.

In `@admin-ui/plugins/schema/components/Person/UserClaimsListPage.tsx`:
- Around line 149-159: Replace the hardcoded English fallback used as the
default audit message in deleteAttributeMutation.mutateAsync — currently
`Deleted attribute ${...}` — with a translated string via the component's i18n
function (t), e.g. call t('userClaims.deletedAttribute', { name:
itemToDelete?.name ?? itemToDelete?.inum }) when message is empty; update the
locale resource to include the new key (userClaims.deletedAttribute) alongside
the other new strings so the fallback is localized, and ensure the component
imports/uses the existing t(...) function where
deleteAttributeMutation.mutateAsync is invoked.

---

Outside diff comments:
In `@admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx`:
- Around line 17-27: The two Jest mocks are inconsistent: ADMIN_UI_RESOURCES and
CEDAR_RESOURCE_SCOPES in the '@/cedarling' mock include a "Lock"/"lock" entry
but the '@/cedarling/constants/resourceScopes' mock omits it; update the
'@/cedarling/constants/resourceScopes' mock so CEDAR_RESOURCE_SCOPES also
contains lock: [] (matching the other mock) and ensure both mocks share the same
keys and value shapes for ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES to avoid
future false positives.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c147303-1f6f-4db1-8739-4ee485c25d83

📥 Commits

Reviewing files that changed from the base of the PR and between 4e394b5 and 3986e98.

📒 Files selected for processing (41)
  • admin-ui/app/cedarling/__tests__/client/CedarlingClient.test.ts
  • admin-ui/app/cedarling/__tests__/constants/resourceScopes.test.ts
  • admin-ui/app/cedarling/__tests__/enums/CedarlingLogType.test.ts
  • admin-ui/app/cedarling/__tests__/hooks/useCedarling.test.ts
  • admin-ui/app/cedarling/__tests__/utility/resources.test.ts
  • admin-ui/app/locales/en/translation.json
  • admin-ui/app/locales/es/translation.json
  • admin-ui/app/locales/fr/translation.json
  • admin-ui/app/locales/pt/translation.json
  • admin-ui/app/redux/types/index.ts
  • admin-ui/app/routes/Apps/Gluu/GluuTabs.tsx
  • admin-ui/app/utilities.tsx
  • admin-ui/plugins/admin/components/Assets/types/FormTypes.ts
  • admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/JansLockConfiguration.test.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/JansLockFieldRenderer.test.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/constants.test.ts
  • admin-ui/plugins/jans-lock/__tests__/components/helperConstants.test.ts
  • admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts
  • admin-ui/plugins/jans-lock/__tests__/components/validations.test.ts
  • admin-ui/plugins/jans-lock/components/JansLock.tsx
  • admin-ui/plugins/jans-lock/components/JansLockConfiguration.tsx
  • admin-ui/plugins/jans-lock/components/JansLockFieldRenderer.tsx
  • admin-ui/plugins/jans-lock/components/constants.ts
  • admin-ui/plugins/jans-lock/components/styles/JansLockFormPage.style.ts
  • admin-ui/plugins/jans-lock/helper/index.ts
  • admin-ui/plugins/jans-lock/helper/utils.ts
  • admin-ui/plugins/jans-lock/helper/validations.ts
  • admin-ui/plugins/jans-lock/types/jans-lock-types.ts
  • admin-ui/plugins/saml/components/WebsiteSsoIdentityProviderForm.tsx
  • admin-ui/plugins/saml/components/WebsiteSsoServiceProviderForm.tsx
  • admin-ui/plugins/saml/components/hooks/useSamlApi.ts
  • admin-ui/plugins/schema/__tests__/components/UserClaimsAddPage.test.tsx
  • admin-ui/plugins/schema/__tests__/components/UserClaimsEditPage.test.tsx
  • admin-ui/plugins/schema/__tests__/components/UserClaimsForm.test.tsx
  • admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx
  • admin-ui/plugins/schema/components/Person/UserClaimsEditPage.tsx
  • admin-ui/plugins/schema/components/Person/UserClaimsListPage.tsx
  • admin-ui/plugins/schema/components/Person/UserClaimsViewPage.tsx
  • admin-ui/plugins/schema/hooks/useAttributeApi.ts
  • admin-ui/plugins/user-management/utils/attributeTransformUtils.ts

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
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: 8

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

Inline comments:
In `@admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx`:
- Around line 128-140: The test currently stubs useGetLockProperties to return
isLoading: true but only asserts the form exists; update the JansLock test to
also assert the loading indicator is rendered when isLoading is true by checking
for the GluuLoader element (e.g., query by its test id, role, aria-label,
visible text like "Loading", or its CSS class) after rendering JansLock; keep
the existing mock of useGetLockProperties and add a single assertion that the
loader is present (e.g., expect(...).toBeInTheDocument()) so the test verifies
the blocking loading state.

In `@admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts`:
- Around line 139-154: The test for transformToFormValues relies on an implicit
positional mapping of cedarlingConfiguration.policySources (policySources[0] =>
JSON, [1] => ZIP), which is fragile; update the test to select policy sources
explicitly (e.g., locate the source by policyStoreUri or authorizationToken and
assert those values) or add a clear comment documenting the positional contract;
reference the transformToFormValues function, the LockApiConfig type, and
cedarlingConfiguration.policySources when making the change so the mapping is
unambiguous.

In `@admin-ui/plugins/jans-lock/helper/utils.ts`:
- Around line 22-25: The getPolicySource helper relies on a positional
convention (index 0 = JSON, index 1 = ZIP) which is fragile and undocumented;
update this by adding a clear JSDoc comment on getPolicySource and
cedarlingConfiguration.policySources describing the positional contract,
introduce named constants (e.g. JSON_POLICY_SOURCE_INDEX and
ZIP_POLICY_SOURCE_INDEX) and replace any literal indices with those constants,
and add a runtime sanity check inside getPolicySource that warns or throws if
the expected source type/name is not found at the given index to detect
API/order changes early; reference getPolicySource, cedarlingConfiguration, and
policySources when making these changes.

In `@admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx`:
- Around line 17-18: The mock uses incorrect casing for resource keys/values
which can hide bugs; update the test mocks so ADMIN_UI_RESOURCES uses Lock:
'Lock' (capitalized value) and CEDAR_RESOURCE_SCOPES uses the capitalized key
Lock with the appropriate array value, and make the same casing corrections for
the other occurrences referenced (lines 22 and 26) so all mocks match the real
constants ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES.

In `@admin-ui/plugins/schema/components/Person/UserClaimsListPage.tsx`:
- Around line 152-169: The handleDeleteConfirm useCallback references the i18n
function t but omits it from the dependency array; update the dependency list
for handleDeleteConfirm to include t (alongside deleteAttributeMutation and
itemToDelete) so the callback updates when translations change—look for the
handleDeleteConfirm declaration and add t to its dependency array.

In `@admin-ui/plugins/user-management/__tests__/api/Users.test.ts`:
- Around line 1-5: Replace the trivially passing placeholder test in the
Users.test.ts describe block ("User Management CRUD Tests (Placeholder - Needs
Rewrite for React Query)") with a pending test using Jest's it.todo;
specifically remove or replace the it('placeholder test', () =>
expect(true).toBe(true)) with it.todo('implement User Management CRUD tests
using React Query') so the test is marked pending rather than counted as a
passing assertion.

In
`@admin-ui/plugins/user-management/__tests__/components/userManagementTestUtils.tsx`:
- Around line 28-39: The CEDAR_RESOURCE_SCOPES mock uses lowercase keys while
ADMIN_UI_RESOURCES uses PascalCase; update the CEDAR_RESOURCE_SCOPES mock so its
keys match production PascalCase (Users, Lock, Attributes, Webhooks) to be
consistent with ADMIN_UI_RESOURCES; modify the jest.mock call that defines
CEDAR_RESOURCE_SCOPES to use { Users: [], Lock: [], Attributes: [], Webhooks: []
} so code referencing CEDAR_RESOURCE_SCOPES by PascalCase names resolves
correctly.
- Around line 19-25: The mock definitions in userManagementTestUtils.tsx use
lowercase strings and keys that don't match production; update
ADMIN_UI_RESOURCES to use the exact PascalCase values (e.g., 'Users', 'Lock',
'Attributes', 'Webhooks') and change the keys in CEDAR_RESOURCE_SCOPES to the
matching PascalCase keys (Users, Lock, Attributes, Webhooks) so the test mocks
align with the production constants in
admin-ui/app/cedarling/utility/resources.ts; ensure any consumers in the test
file use the updated key names.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0ab8c14f-02e3-474e-ac60-54939e0b9fe8

📥 Commits

Reviewing files that changed from the base of the PR and between 3986e98 and e2f7cfc.

📒 Files selected for processing (19)
  • admin-ui/app/cedarling/__tests__/hooks/useCedarling.test.ts
  • admin-ui/app/components/GluuDetailGrid/GluuDetailGrid.style.ts
  • admin-ui/app/components/GluuDetailGrid/GluuDetailGrid.tsx
  • admin-ui/app/components/GluuDetailGrid/types.ts
  • admin-ui/app/locales/en/translation.json
  • admin-ui/app/locales/es/translation.json
  • admin-ui/app/locales/fr/translation.json
  • admin-ui/app/locales/pt/translation.json
  • admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts
  • admin-ui/plugins/jans-lock/components/JansLockConfiguration.tsx
  • admin-ui/plugins/jans-lock/helper/utils.ts
  • admin-ui/plugins/jans-lock/helper/validations.ts
  • admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx
  • admin-ui/plugins/schema/components/Person/UserClaimsListPage.tsx
  • admin-ui/plugins/user-management/__tests__/api/Users.test.js
  • admin-ui/plugins/user-management/__tests__/api/Users.test.ts
  • admin-ui/plugins/user-management/__tests__/components/UserList.test.tsx
  • admin-ui/plugins/user-management/__tests__/components/userManagementTestUtils.tsx
💤 Files with no reviewable changes (1)
  • admin-ui/plugins/user-management/tests/api/Users.test.js

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
@faisalsiddique4400 faisalsiddique4400 changed the title eat(admin-ui): revamp Jans Lock module as per Figma feat(admin-ui): revamp Jans Lock module as per Figma Mar 18, 2026
@mo-auto mo-auto added the kind-feature Issue or PR is a new feature request label Mar 18, 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: 3

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

Inline comments:
In `@admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx`:
- Around line 11-27: The test defines redundant mocks for sub-paths that
JansLock.tsx never imports; remove the extra jest.mock calls for
'@/cedarling/utility' and '@/cedarling/constants/resourceScopes' and keep only
the single mock for '@/cedarling' which already provides useCedarling,
ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES used by JansLock.tsx; update the
test file to delete the jest.mock blocks that reference those two unused modules
so the mock setup only targets '@/cedarling' (leave the useCedarling mock and
the ADMIN_UI_RESOURCES/CEDAR_RESOURCE_SCOPES values intact).

In `@admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts`:
- Around line 340-358: The tests for buildLockChangedFieldOperations only assert
ops[0].value; update the three tests ("detects changed string field", "detects
changed boolean field", "detects changed numeric field") to also assert the
ops[0].path matches the expected label key for the changed field (e.g., the i18n
key used for loggingLevel, disableJdkLogger, cleanServiceInterval), using the
same t fallback expectations; locate these tests where baseValues, modified, t,
and ops are used and add an expect(ops[0].path).toBe(...) assertion in each to
make the mapping explicit.

In `@admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx`:
- Around line 17-18: Tests duplicate the ADMIN_UI_RESOURCES and
CEDAR_RESOURCE_SCOPES constants causing drift; extract them into a single shared
test helper and update tests to import it. Create a new test helper module
(e.g., cedarTestHelpers) that exports ADMIN_UI_RESOURCES and
CEDAR_RESOURCE_SCOPES, replace the inline definitions in
UserClaimsListPage.test.tsx and the other schema tests (the other occurrences
mentioned) to import those exports, and update any references in tests to use
the imported symbols so casing/shape is consistent across suites.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7b5b03c7-12e0-463e-9d03-7d70afa17a7e

📥 Commits

Reviewing files that changed from the base of the PR and between e2f7cfc and f77f6fc.

📒 Files selected for processing (5)
  • admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts
  • admin-ui/plugins/schema/__tests__/components/UserClaimsListPage.test.tsx
  • admin-ui/plugins/user-management/__tests__/api/Users.test.ts
  • admin-ui/plugins/user-management/__tests__/components/userManagementTestUtils.tsx

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
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: 8

Caution

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

⚠️ Outside diff range comments (1)
admin-ui/plugins/user-claims/__tests__/components/UserClaimsListPage.test.tsx (1)

63-77: 🧹 Nitpick | 🔵 Trivial

Store includes cedarPermissions reducer (differs from Add/Edit tests).

This store correctly includes the cedarPermissions reducer, which the other two test files (UserClaimsAddPage.test.tsx, UserClaimsEditPage.test.tsx) omit. If all three components share similar permission-checking behavior, consider aligning the store configurations for consistency, or document why the ListPage requires it while others don't.

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

In
`@admin-ui/plugins/user-claims/__tests__/components/UserClaimsListPage.test.tsx`
around lines 63 - 77, The test store in UserClaimsListPage.test.tsx includes a
cedarPermissions reducer while the corresponding stores in
UserClaimsAddPage.test.tsx and UserClaimsEditPage.test.tsx do not; either add a
matching cedarPermissions stub reducer (e.g., cedarPermissions: (state = {
permissions: [] }) => state) to the Add/Edit test stores or remove/justify it in
the List test so all three tests align; update the test files
UserClaimsAddPage.test.tsx and UserClaimsEditPage.test.tsx to include the same
reducer if they rely on permission checks, or add a short comment in
UserClaimsListPage.test.tsx explaining why cedarPermissions is required.
♻️ Duplicate comments (1)
admin-ui/plugins/user-claims/components/Person/UserClaimsListPage.tsx (1)

152-169: ⚠️ Potential issue | 🟡 Minor

Include t in handleDeleteConfirm dependencies.

Line 161 uses t(...) for the localized fallback message, but line 168 omits t from the dependency array. This could cause stale translations if the locale changes while the component is mounted.

🔧 Suggested fix
   const handleDeleteConfirm = useCallback(
     async (message: string, inum?: string) => {
       if (!inum) return
       try {
         await deleteAttributeMutation.mutateAsync({
           inum,
           name: itemToDelete?.name,
           userMessage:
             message ||
             t('messages.attribute_deleted', { name: itemToDelete?.name ?? itemToDelete?.inum }),
         })
       } finally {
         setModal(false)
         setItemToDelete(null)
       }
     },
-    [deleteAttributeMutation, itemToDelete],
+    [deleteAttributeMutation, itemToDelete, t],
   )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@admin-ui/plugins/user-claims/components/Person/UserClaimsListPage.tsx` around
lines 152 - 169, The handleDeleteConfirm callback uses the i18n function t(...)
for a fallback message but does not include t in its dependency array, which can
cause stale translations; update the dependency array of handleDeleteConfirm to
include t (in addition to deleteAttributeMutation and itemToDelete) so the
callback is re-created when the translation function changes, ensuring correct
localized messages; ensure references to setModal and setItemToDelete remain
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@admin-ui/app/routes/Apps/Gluu/GluuToast.tsx`:
- Around line 16-27: The JSX in GluuToast.tsx uses loose equality for string
comparisons; update all string comparisons to strict equality (e.g., change
occurrences like type == 'success' and normalizedMessage == '' to use ===) so
normalizedMessage and the toast type are checked with strict equality; locate
the normalizedMessage variable and the conditional rendering that references
type and normalizedMessage to make these replacements.

In `@admin-ui/plugins/admin/__tests__/components/Asset/assetTestUtils.tsx`:
- Around line 21-29: Extract the repeated ADMIN_UI_RESOURCES and
CEDAR_RESOURCE_SCOPES objects into a single shared constant and reuse it across
the mocks instead of duplicating them; define the shared constants (e.g., const
SHARED_CEDAR_CONSTANTS = { ADMIN_UI_RESOURCES: {...}, CEDAR_RESOURCE_SCOPES:
{...} }) at module scope or in a test-utils/shared file, export or import them
as needed, and replace the inline ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES
occurrences in assetTestUtils.tsx (and the other two mock files referenced) with
references to the shared constants so future edits stay synchronized.

In
`@admin-ui/plugins/admin/__tests__/components/Asset/JansAssetListPage.test.tsx`:
- Around line 23-30: Extract the duplicated mock constants ADMIN_UI_RESOURCES
and CEDAR_RESOURCE_SCOPES into a single shared constant declared once at the top
of the test file (or a shared test-utils file) and replace the three repeated
inline declarations in the mock blocks inside JansAssetListPage.test.tsx with
references to those shared constants; update the mocks that currently redeclare
ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES so they import/consume the single
source of truth and remove the duplicated objects in the other mock blocks.

In `@admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx`:
- Around line 60-68: The test creates a new QueryClient on every render because
createQueryClient() is called inside Wrapper; move/memoize the QueryClient so
the same instance is reused across renders (e.g., create a single queryClient
variable outside Wrapper or initialize it once with useRef) and keep using
QueryClientProvider in Wrapper; additionally, clear the query cache in
beforeEach by calling queryClient.clear() to reset state between tests. Ensure
you update references to createQueryClient, Wrapper, QueryClientProvider, and
queryClient.clear() accordingly.

In `@admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts`:
- Around line 274-280: The test title is misleading: it actually verifies that
an empty tokenChannels string (which becomes undefined after split/filter) does
not create an add operation; update the it(...) description to something clearer
(e.g., "does not create add operation for empty tokenChannels" or "skips empty
tokenChannels resulting in no add op") so the behavior tested by
createPatchOperations with baseFormValues and configWithout (and the tokenPatch
lookup on '/tokenChannels') is explicit.

In `@admin-ui/plugins/smtp/__tests__/components/SmtpManagement/SmtpForm.test.tsx`:
- Around line 15-16: The mock CEDAR_RESOURCE_SCOPES in SmtpForm.test.tsx
currently uses empty arrays for SMTP and Webhooks; update the mocked
CEDAR_RESOURCE_SCOPES constant so SMTP and Webhooks include the same scope
strings used in production (e.g., READ, WRITE, DELETE or 'read','write','delete'
to match your app constants), keeping the ADMIN_UI_RESOURCES mapping intact;
this aligns the test fixture with the real resourceScopes (refer to the
CEDAR_RESOURCE_SCOPES symbol) and prevents masking future scope-based
authorization test failures even though
hasCedarReadPermission/hasCedarWritePermission are currently stubbed.

In `@admin-ui/plugins/user-claims/__tests__/cedarTestHelpers.ts`:
- Around line 1-13: The test helper CEDAR_RESOURCE_SCOPES currently uses empty
arrays which prevents testing permission-denied or scope-dependent behavior;
update the helper by adding a realistic alternative export (e.g.,
CEDAR_RESOURCE_SCOPES_WITH_PERMISSIONS) that populates each key in
CEDAR_RESOURCE_SCOPES (Attributes, Webhooks, Lock) with representative
ResourceScopeEntry objects (permission/resourceId pairs) so tests like
UserClaimsForm.test.tsx can opt into scope-aware scenarios, or add a short
comment next to ADMIN_UI_RESOURCES/CEDAR_RESOURCE_SCOPES documenting that the
default is empty and tests should import the new *_WITH_PERMISSIONS variant when
they need scope-based assertions.

In `@admin-ui/plugins/user-claims/__tests__/components/UserClaimsForm.test.tsx`:
- Line 293: The test's hideButtons value is inconsistent with the component
usage: update the test in UserClaimsForm.test.tsx to set hideButtons to { save:
true, back: false } so it matches how UserClaimsViewPage passes hideButtons
(hiding save but showing back); locate the test variable named hideButtons and
replace its value accordingly to mirror the component's configuration.

---

Outside diff comments:
In
`@admin-ui/plugins/user-claims/__tests__/components/UserClaimsListPage.test.tsx`:
- Around line 63-77: The test store in UserClaimsListPage.test.tsx includes a
cedarPermissions reducer while the corresponding stores in
UserClaimsAddPage.test.tsx and UserClaimsEditPage.test.tsx do not; either add a
matching cedarPermissions stub reducer (e.g., cedarPermissions: (state = {
permissions: [] }) => state) to the Add/Edit test stores or remove/justify it in
the List test so all three tests align; update the test files
UserClaimsAddPage.test.tsx and UserClaimsEditPage.test.tsx to include the same
reducer if they rely on permission checks, or add a short comment in
UserClaimsListPage.test.tsx explaining why cedarPermissions is required.

---

Duplicate comments:
In `@admin-ui/plugins/user-claims/components/Person/UserClaimsListPage.tsx`:
- Around line 152-169: The handleDeleteConfirm callback uses the i18n function
t(...) for a fallback message but does not include t in its dependency array,
which can cause stale translations; update the dependency array of
handleDeleteConfirm to include t (in addition to deleteAttributeMutation and
itemToDelete) so the callback is re-created when the translation function
changes, ensuring correct localized messages; ensure references to setModal and
setItemToDelete remain unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e5e9e16f-3546-4943-be24-b595c00b770d

📥 Commits

Reviewing files that changed from the base of the PR and between f77f6fc and 02a5d19.

📒 Files selected for processing (52)
  • admin-ui/app/redux/features/toastSlice.ts
  • admin-ui/app/redux/types/index.ts
  • admin-ui/app/routes/Apps/Gluu/GluuToast.tsx
  • admin-ui/plugins.config.json
  • admin-ui/plugins/admin/__tests__/components/Asset/JansAssetListPage.test.tsx
  • admin-ui/plugins/admin/__tests__/components/Asset/assetTestUtils.tsx
  • admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx
  • admin-ui/plugins/admin/components/Mapping/hooks/useMappingApi.ts
  • admin-ui/plugins/admin/components/Settings/SettingsPage.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/JansLock.test.tsx
  • admin-ui/plugins/jans-lock/__tests__/components/utils.test.ts
  • admin-ui/plugins/smtp/__tests__/components/SmtpManagement/SmtpEditPage.test.tsx
  • admin-ui/plugins/smtp/__tests__/components/SmtpManagement/SmtpForm.test.tsx
  • admin-ui/plugins/smtp/components/SmtpManagement/SmtpEditPage.tsx
  • admin-ui/plugins/smtp/components/SmtpManagement/SmtpForm.tsx
  • admin-ui/plugins/smtp/components/SmtpManagement/styles/SmtpFormPage.style.ts
  • admin-ui/plugins/smtp/helper/constants.ts
  • admin-ui/plugins/smtp/helper/index.ts
  • admin-ui/plugins/smtp/helper/utils.ts
  • admin-ui/plugins/smtp/helper/validations.ts
  • admin-ui/plugins/smtp/plugin-metadata.ts
  • admin-ui/plugins/smtp/types/index.ts
  • admin-ui/plugins/smtp/types/smtp-types.ts
  • admin-ui/plugins/user-claims/__tests__/cedarTestHelpers.ts
  • admin-ui/plugins/user-claims/__tests__/components/UserClaimsAddPage.test.tsx
  • admin-ui/plugins/user-claims/__tests__/components/UserClaimsEditPage.test.tsx
  • admin-ui/plugins/user-claims/__tests__/components/UserClaimsForm.test.tsx
  • admin-ui/plugins/user-claims/__tests__/components/UserClaimsListPage.test.tsx
  • admin-ui/plugins/user-claims/components/Person/UserClaimsAddPage.tsx
  • admin-ui/plugins/user-claims/components/Person/UserClaimsDetailPage.tsx
  • admin-ui/plugins/user-claims/components/Person/UserClaimsEditPage.tsx
  • admin-ui/plugins/user-claims/components/Person/UserClaimsForm.tsx
  • admin-ui/plugins/user-claims/components/Person/UserClaimsListPage.tsx
  • admin-ui/plugins/user-claims/components/Person/UserClaimsViewPage.tsx
  • admin-ui/plugins/user-claims/components/Person/styles/UserClaimsFormPage.style.ts
  • admin-ui/plugins/user-claims/components/Person/styles/UserClaimsListPage.style.ts
  • admin-ui/plugins/user-claims/components/types/UserClaimsListPage.types.ts
  • admin-ui/plugins/user-claims/constants/index.ts
  • admin-ui/plugins/user-claims/helper/index.ts
  • admin-ui/plugins/user-claims/helper/utils.ts
  • admin-ui/plugins/user-claims/hooks/index.ts
  • admin-ui/plugins/user-claims/hooks/useAttributeApi.ts
  • admin-ui/plugins/user-claims/hooks/useMutationEffects.ts
  • admin-ui/plugins/user-claims/hooks/useSchemaAuditLogger.ts
  • admin-ui/plugins/user-claims/hooks/useSchemaWebhook.ts
  • admin-ui/plugins/user-claims/plugin-metadata.ts
  • admin-ui/plugins/user-claims/types/shared.ts
  • admin-ui/plugins/user-claims/utils/attributes.ts
  • admin-ui/plugins/user-claims/utils/errorHandler.ts
  • admin-ui/plugins/user-claims/utils/formHelpers.ts
  • admin-ui/plugins/user-claims/utils/index.ts
  • admin-ui/plugins/user-claims/utils/validation.ts

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
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: 3

Caution

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

⚠️ Outside diff range comments (1)
admin-ui/plugins/admin/__tests__/components/Webhook/WebhookListPage.test.tsx (1)

25-31: ⚠️ Potential issue | 🟡 Minor

Inconsistent casing in mock values.

The mock values use lowercase 'webhooks' but the real implementation at admin-ui/app/cedarling/utility/resources.ts exports Webhooks: 'Webhooks' (PascalCase). Similarly, CEDAR_RESOURCE_SCOPES uses [ADMIN_UI_RESOURCES.Webhooks] as the key, which resolves to 'Webhooks'.

This inconsistency could cause issues if any code performs exact string comparisons. The test currently passes because the assertion at line 80 uses case-insensitive regex.

🔧 Proposed fix to align with real implementation
 jest.mock('@/cedarling/utility', () => ({
-  ADMIN_UI_RESOURCES: { Webhooks: 'webhooks' },
+  ADMIN_UI_RESOURCES: { Webhooks: 'Webhooks' },
 }))

 jest.mock('@/cedarling/constants/resourceScopes', () => ({
-  CEDAR_RESOURCE_SCOPES: { webhooks: [] },
+  CEDAR_RESOURCE_SCOPES: { Webhooks: [] },
 }))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@admin-ui/plugins/admin/__tests__/components/Webhook/WebhookListPage.test.tsx`
around lines 25 - 31, Tests mock ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES
with lowercase 'webhooks', which mismatches the real exports where
ADMIN_UI_RESOURCES.Webhooks === 'Webhooks'; update the mock to use PascalCase
'Webhooks' for ADMIN_UI_RESOURCES and use that same key in the
CEDAR_RESOURCE_SCOPES mock so keys match the real implementation (ensure the
mocked symbols ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES in the test refer to
'Webhooks' exactly).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@admin-ui/plugins/scripts/__tests__/components/CustomScriptAddPage.test.tsx`:
- Around line 15-23: Update the test mocks so the cedar resource map matches
production constants: add a Scripts entry to ADMIN_UI_RESOURCES and to
CEDAR_RESOURCE_SCOPES, and make resource keys consistent with the rest of the
file (use the same casing used elsewhere — e.g., if other mocks use lowercase
like "scripts" convert all resource keys to that naming convention or vice
versa). Locate and modify the ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES
definitions in CustomScriptAddPage.test.tsx to include Scripts/scripts and
ensure the scopes object contains the corresponding empty array entry so the
mock shape matches production.

In `@admin-ui/plugins/scripts/__tests__/components/CustomScriptEditPage.test.tsx`:
- Around line 19-27: The test's mock resources use an inconsistent shape and
omit the Scripts key, causing mismatch with the '@/cedarling' mock; update the
mock objects (ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES) in
CustomScriptEditPage.test.tsx to match the cedarling mock's shape and casing and
include a Scripts entry in both places (with appropriate scope array in
CEDAR_RESOURCE_SCOPES and display label in ADMIN_UI_RESOURCES) so
permission-scope paths are represented consistently.

In `@admin-ui/plugins/scripts/__tests__/components/CustomScriptForm.test.tsx`:
- Around line 32-40: The mocked resource constants ADMIN_UI_RESOURCES and
CEDAR_RESOURCE_SCOPES in the test are not matching the production contract
(missing the "Scripts" key and using inconsistent casing for "Webhooks"); update
the test mock so ADMIN_UI_RESOURCES includes "Scripts": 'Scripts' and other
entries use the same PascalCase values as production (e.g., 'Webhooks'), and
ensure CEDAR_RESOURCE_SCOPES includes corresponding keys (Scripts, Webhooks,
Security, Lock, Users, Attributes) so permission/scope behavior in
CustomScriptForm.test.tsx mirrors runtime behavior.

---

Outside diff comments:
In
`@admin-ui/plugins/admin/__tests__/components/Webhook/WebhookListPage.test.tsx`:
- Around line 25-31: Tests mock ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES
with lowercase 'webhooks', which mismatches the real exports where
ADMIN_UI_RESOURCES.Webhooks === 'Webhooks'; update the mock to use PascalCase
'Webhooks' for ADMIN_UI_RESOURCES and use that same key in the
CEDAR_RESOURCE_SCOPES mock so keys match the real implementation (ensure the
mocked symbols ADMIN_UI_RESOURCES and CEDAR_RESOURCE_SCOPES in the test refer to
'Webhooks' exactly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 69c4b81c-c34f-4ebe-82ba-d5ad60125ad4

📥 Commits

Reviewing files that changed from the base of the PR and between 02a5d19 and d29301a.

📒 Files selected for processing (28)
  • admin-ui/plugins/admin/__tests__/components/Cedarling/CedarlingConfigPage.test.tsx
  • admin-ui/plugins/admin/__tests__/components/Webhook/WebhookListPage.test.tsx
  • admin-ui/plugins/auth-server/components/AuthN/AuthNListPage.tsx
  • admin-ui/plugins/scripts/__tests__/components/CustomScriptAddPage.test.tsx
  • admin-ui/plugins/scripts/__tests__/components/CustomScriptEditPage.test.tsx
  • admin-ui/plugins/scripts/__tests__/components/CustomScriptForm.test.tsx
  • admin-ui/plugins/scripts/components/CustomScriptAddPage.tsx
  • admin-ui/plugins/scripts/components/CustomScriptEditPage.tsx
  • admin-ui/plugins/scripts/components/CustomScriptForm.tsx
  • admin-ui/plugins/scripts/components/CustomScriptListPage.tsx
  • admin-ui/plugins/scripts/components/PersonAuthenticationFields.tsx
  • admin-ui/plugins/scripts/components/ScriptListPage.tsx
  • admin-ui/plugins/scripts/components/constants.ts
  • admin-ui/plugins/scripts/components/helper/auditUtils.ts
  • admin-ui/plugins/scripts/components/helper/index.ts
  • admin-ui/plugins/scripts/components/helper/utils.ts
  • admin-ui/plugins/scripts/components/helper/validations.ts
  • admin-ui/plugins/scripts/components/hooks/index.ts
  • admin-ui/plugins/scripts/components/hooks/useCustomScriptActions.ts
  • admin-ui/plugins/scripts/components/hooks/useCustomScriptApi.ts
  • admin-ui/plugins/scripts/components/hooks/useMutationEffects.ts
  • admin-ui/plugins/scripts/components/styles/CustomScriptFormPage.style.ts
  • admin-ui/plugins/scripts/components/styles/CustomScriptListPage.style.ts
  • admin-ui/plugins/scripts/components/types/actions.ts
  • admin-ui/plugins/scripts/components/types/customScript.ts
  • admin-ui/plugins/scripts/components/types/forms.ts
  • admin-ui/plugins/scripts/components/types/index.ts
  • admin-ui/plugins/scripts/plugin-metadata.ts

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
Copy link
Contributor

@duttarnab duttarnab left a comment

Choose a reason for hiding this comment

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

  1. Metric Channel field is not saving.
  2. PDP Type field is missing.
Image

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
@sonarqubecloud
Copy link

@moabu moabu merged commit 0629759 into main Mar 19, 2026
8 checks passed
@moabu moabu deleted the admin-ui-issue-2637 branch March 19, 2026 09:42
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) revamp the Jans-lock module as per Figma

4 participants