Skip to content

feat: add policy detail/preview to assignment components - #3000

Merged
tada5hi merged 2 commits into
masterfrom
2989-policy-preview
Apr 16, 2026
Merged

tada5hi merged 2 commits into
masterfrom
2989-policy-preview

Conversation

@tada5hi

@tada5hi tada5hi commented Apr 16, 2026 •

Copy link
Copy Markdown
Collaborator

closes #2989

Summary by CodeRabbit

Release Notes

  • New Features
    • Added ability to view detailed policy summaries in modal dialogs with back navigation.
    • Introduced visual policy type badges for better policy identification.
    • Enhanced policy lists with inline information display including type indicators and detail navigation buttons.
    • Improved modal dismissal handling with multi-path closing options (backdrop, buttons, Escape key).

Copilot AI review requested due to automatic review settings April 16, 2026 09:24
@coderabbitai

coderabbitai Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

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

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 42 minutes and 56 seconds.

⌛ 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c46fc3c4-3477-4e4f-b69a-e6a0d26355a3

📥 Commits

Reviewing files that changed from the base of the PR and between 8c7eb8c and 846608e.

📒 Files selected for processing (4)
  • packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts
  • packages/client-web-kit/src/components/entities/permission-policy/APermissionPolicyAssignments.ts
  • packages/client-web-kit/src/components/entities/policy/APolicyDetailNav.ts
  • packages/client-web-kit/src/components/entities/policy/APolicyInlineInfo.ts
📝 Walkthrough

Walkthrough

This PR adds policy detail viewing capability to assignment components. New components (APolicyDetailNav, APolicySummary, APolicyTypeBadge, APolicyInlineInfo) enable inline policy metadata display. Two existing assignment components now support a two-step modal UI flow: browsing policies or viewing the selected policy's summary.

Changes

Cohort / File(s) Summary
New Policy UI Components
APolicyDetailNav.ts, APolicyTypeBadge.ts, APolicySummary.ts, APolicyInlineInfo.ts
Added four new Vue components: APolicyDetailNav (eye icon button emitting policy ID), APolicyTypeBadge (type badge with human-readable labels), APolicySummary (full policy detail display with labeled rows), and APolicyInlineInfo (compact inline policy metadata with badge and nav button).
Policy Assignment Modal Integration
APermissionPolicyBindingButton.ts, APermissionPolicyAssignments.ts
Introduced detailPolicy ref state enabling two-step modal flow. Modal conditionally renders policy list or policy summary. Escape key, backdrop, and close button actions now handle dismissing detail view before closing modal. Added APolicyDetailNav integration for policy selection and custom item rendering with type badges.
Component Exports
policy/index.ts
Added named exports for new components: APolicyDetailNav, APolicyInlineInfo, APolicySummary, APolicyTypeBadge.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 In the warren of permissions deep,
Where policy secrets were once hard to keep,
A curious rabbit found a way,
To peek at what policies say! 👀
Now badges glow and summaries shine,
A detail view so fine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding policy detail/preview functionality to assignment components as implemented across multiple new components and modifications.
Linked Issues check ✅ Passed The pull request implements the core requirements from issue #2989: policy type badges (APolicyTypeBadge), policy summary modal (APolicySummary), and detail navigation (APolicyDetailNav) for both permission-policy and permission-policy-binding assignment contexts.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the objectives: new policy detail components (APolicyDetailNav, APolicySummary, APolicyTypeBadge, APolicyInlineInfo) and integration into assignment flows for permissions and bindings.

✏️ 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 2989-policy-preview

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds policy preview/detail affordances to policy assignment UIs so users can see basic policy metadata (type/invert/etc.) and open a quick details view from assignment contexts.

Changes:

  • Introduces reusable policy UI helpers (type badge, summary, detail trigger, inline info).
  • Enhances permission → policy assignment list to show type/invert badges and open a modal preview.
  • Enhances junction-policy assignment modal to show type/invert badges and support an in-modal preview state.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/client-web-kit/src/components/entities/policy/index.ts Re-exports newly added policy UI components.
packages/client-web-kit/src/components/entities/policy/APolicyTypeBadge.ts Adds a small badge component to display a human-friendly policy type label.
packages/client-web-kit/src/components/entities/policy/APolicySummary.ts Adds a simple policy metadata summary used in preview modals.
packages/client-web-kit/src/components/entities/policy/APolicyInlineInfo.ts Adds an inline “badges + detail trigger” helper component (currently not integrated).
packages/client-web-kit/src/components/entities/policy/APolicyDetailNav.ts Adds an eye-button component intended to trigger policy “details” behavior.
packages/client-web-kit/src/components/entities/permission-policy/APermissionPolicyAssignments.ts Updates permission-policy assignment list items to include badges + preview modal.
packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts Updates junction-policy modal to include badges + nested preview state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +28
},
emits: ['click'],
setup(props, { emit }) {
return () => h('button', {
class: 'btn btn-xs btn-outline-info',
title: 'View policy details',
onClick(e: Event) {
e.preventDefault();
emit('click', props.policyId);
},
}, [
h('i', { class: 'fa fa-eye' }),
]);

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

The component name APolicyDetailNav implies it performs navigation, but it currently only emits a click event and doesn’t provide any default navigation target (e.g. /policies/:id). Either rename it to reflect its behavior (button/trigger), or add an explicit to/href API (or router-link integration) so it can actually navigate when used as-is.

Suggested change
},
emits: ['click'],
setup(props, { emit }) {
return () => h('button', {
class: 'btn btn-xs btn-outline-info',
title: 'View policy details',
onClick(e: Event) {
e.preventDefault();
emit('click', props.policyId);
},
}, [
h('i', { class: 'fa fa-eye' }),
]);
to: {
type: String,
required: false,
default: undefined,
},
href: {
type: String,
required: false,
default: undefined,
},
},
emits: ['click'],
setup(props, { emit }) {
return () => {
const href = props.href || props.to;
const tag = href ? 'a' : 'button';
return h(tag, {
class: 'btn btn-xs btn-outline-info',
title: 'View policy details',
href,
type: tag === 'button' ? 'button' : undefined,
onClick(e: Event) {
if (!href) {
e.preventDefault();
}
emit('click', props.policyId);
},
}, [
h('i', { class: 'fa fa-eye' }),
]);
};

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +48
const rows = [
renderRow('Name', props.entity.name),
renderRow('Type', h(APolicyTypeBadge, { type: props.entity.type })),
];

if (props.entity.display_name) {
rows.push(renderRow('Display Name', props.entity.display_name));
}

if (props.entity.description) {
rows.push(renderRow('Description', props.entity.description));
}

if (props.entity.invert) {
rows.push(renderRow('Invert', h('span', { class: 'badge bg-warning' }, 'Yes')));
}

if (props.entity.built_in) {
rows.push(renderRow('Built-in', h('span', { class: 'badge bg-secondary' }, 'Yes')));
}

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

APolicySummary currently only shows general metadata (name/type/display_name/description/invert/built_in) but doesn’t surface any policy configuration (e.g. composite children count, decision_strategy, attribute conditions, etc.). If this PR is meant to close #2989 (“view what an assigned policy actually does”), consider extending the summary with type-specific fields (and/or a link to the full policy details page).

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

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

⚠️ Outside diff range comments (1)
packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts (1)

116-255: ⚠️ Potential issue | 🟠 Major

This modal has the same keyboard-accessibility gap as the assignment modal.

Focus is never moved into the dialog, trapped while open, or restored to the trigger afterward. As written, keyboard users can tab behind the overlay and lose context inside the two-step flow.

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

In
`@packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts`
around lines 116 - 255, The modal currently rendered inside
APermissionPolicyBindingButton (when modalOpen.value is true, creating backdrop
+ modal via Teleport and using modalTitleId, detailPolicy.value,
handlePolicySelect) lacks focus management: focus is not moved into the dialog,
not trapped, and not restored to the trigger. Fix by adding focus management
logic in the component: when opening (modalOpen.value set true) save
document.activeElement, programmatically focus the first focusable element
inside the modal (use the modal container you create for Teleport), add keyboard
handlers on the modal for Tab/Shift+Tab to trap focus within modal and Escape to
close (delegating to the existing detailPolicy.value/ modalOpen.value toggles
and handlePolicySelect as appropriate), and on close restore focus to the saved
trigger element; ensure the modal element has aria-modal="true" and modalTitleId
is used as aria-labelledby for accessibility.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts`:
- Around line 170-192: The button only shows icons and lacks accessible text;
update the button element rendered in APermissionPolicyBindingButton to include
a dynamic title and aria-label (e.g., when isSelected true use "Remove policy"
otherwise "Assign policy"), and mark the inner <i> icon as aria-hidden="true" so
screen readers read the button label; keep existing onClick and use
handlePolicySelect, busy, and slotProps.data.id as-is so behavior is unchanged.

In
`@packages/client-web-kit/src/components/entities/permission-policy/APermissionPolicyAssignments.ts`:
- Around line 81-135: The custom modal created when detailPolicy.value is set
(variables: modalTitleId, backdrop, modal, Teleport, APolicySummary) lacks focus
management—move keyboard focus into the modal when opened (e.g., to the modal
container or first focusable element), implement a focus trap to keep
Tab/Shift+Tab cycling within the modal, restore focus to the previously focused
element when detailPolicy.value is cleared, and prevent background content from
being focusable (use inert/aria-hidden on the rest of the document or use the
app's shared modal abstraction if available); also handle Escape to close the
modal and ensure backdrop and modal onClick handlers don’t block keyboard focus
behavior.

In `@packages/client-web-kit/src/components/entities/policy/APolicyDetailNav.ts`:
- Around line 17-24: The component APolicyDetailNav currently only emits a local
'click' with props.policyId and doesn't provide a real navigation target; change
the render in setup (the onClick handler / button) to produce a real link target
(either render an <a> with href={`/policies/${props.policyId}`} or use the
router API like router-link/router.push) so consumers can navigate from
assignment contexts; keep or still emit the click if needed, but ensure the
element exposes a real href/route (referencing APolicyDetailNav, setup, onClick,
props.policyId) so clicking navigates to /policies/[id] rather than only
updating local state.
- Around line 19-27: The icon-only button in the render returned by the
component (the h('button', { ... }) block in APolicyDetailNav) lacks an
accessible name; update that button props to include type: 'button' and an
explicit accessible name such as aria-label: `View policy details` (or add
visually hidden text) so assistive tech can identify the control, keeping the
existing onClick handler that emits 'click' with props.policyId.

In `@packages/client-web-kit/src/components/entities/policy/APolicyInlineInfo.ts`:
- Around line 21-33: The APolicyInlineInfo setup function doesn't forward the
click emitted by APolicyDetailNav; update the setup signature to accept the emit
context (change setup(props) to setup(props, { emit })) and, when creating the
APolicyDetailNav vnode (the one using props.entity.id), add a listener prop that
calls emit('click', props.entity.id) (e.g., onClick: () => emit('click',
props.entity.id)) so APolicyInlineInfo re-emits the click with the policyId.

In `@packages/client-web-kit/src/components/entities/policy/APolicySummary.ts`:
- Around line 29-50: APolicySummary currently only renders generic fields via
renderRow and omits policy-specific configuration; update the component to also
render composite children, decisionStrategy, attribute rules,
realm/realmMatching and any type-specific config from props.entity so users can
inspect the full policy. In APolicySummary (and where renderRow is used) add
conditional rows for props.entity.children (or compositeChildren) listing child
IDs/names, props.entity.decision_strategy (or decisionStrategy),
props.entity.rules/attributeRules with a compact readable rendering,
props.entity.realm or realmMatching settings, and switch on props.entity.type to
output type-specific fields; reuse renderRow and small helper renderers to keep
markup consistent and ensure badges/labels match existing style.

---

Outside diff comments:
In
`@packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts`:
- Around line 116-255: The modal currently rendered inside
APermissionPolicyBindingButton (when modalOpen.value is true, creating backdrop
+ modal via Teleport and using modalTitleId, detailPolicy.value,
handlePolicySelect) lacks focus management: focus is not moved into the dialog,
not trapped, and not restored to the trigger. Fix by adding focus management
logic in the component: when opening (modalOpen.value set true) save
document.activeElement, programmatically focus the first focusable element
inside the modal (use the modal container you create for Teleport), add keyboard
handlers on the modal for Tab/Shift+Tab to trap focus within modal and Escape to
close (delegating to the existing detailPolicy.value/ modalOpen.value toggles
and handlePolicySelect as appropriate), and on close restore focus to the saved
trigger element; ensure the modal element has aria-modal="true" and modalTitleId
is used as aria-labelledby for accessibility.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea5459fe-a250-421e-b736-bffe25695368

📥 Commits

Reviewing files that changed from the base of the PR and between 60358ae and 8c7eb8c.

📒 Files selected for processing (7)
  • packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts
  • packages/client-web-kit/src/components/entities/permission-policy/APermissionPolicyAssignments.ts
  • packages/client-web-kit/src/components/entities/policy/APolicyDetailNav.ts
  • packages/client-web-kit/src/components/entities/policy/APolicyInlineInfo.ts
  • packages/client-web-kit/src/components/entities/policy/APolicySummary.ts
  • packages/client-web-kit/src/components/entities/policy/APolicyTypeBadge.ts
  • packages/client-web-kit/src/components/entities/policy/index.ts

Comment on lines +170 to +192
h('button', {
class: ['btn btn-xs', {
'btn-dark': busy.value,
'btn-success': !busy.value && isSelected,
'btn-secondary': !busy.value && !isSelected,
}],
disabled: busy.value,
onClick(e: Event) {
e.preventDefault();
if (isSelected) {
handlePolicySelect(null);
} else {
handlePolicySelect(slotProps.data.id);
}
},
}, [
h('i', {
class: ['fa', {
'fa-check': isSelected,
'fa-plus': !isSelected,
}],
}),
]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Label the assign/remove toggle.

This button only exposes a plus/check icon, but no text, title, or aria-label. Screen-reader users cannot tell whether the action will assign or remove the junction policy.

Suggested patch
                                     h('button', {
+                                        type: 'button',
                                         class: ['btn btn-xs', {
                                             'btn-dark': busy.value,
                                             'btn-success': !busy.value && isSelected,
                                             'btn-secondary': !busy.value && !isSelected,
                                         }],
+                                        title: isSelected ? 'Remove policy' : 'Assign policy',
+                                        'aria-label': isSelected ? 'Remove policy' : 'Assign policy',
                                         disabled: busy.value,
                                         onClick(e: Event) {
                                             e.preventDefault();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
h('button', {
class: ['btn btn-xs', {
'btn-dark': busy.value,
'btn-success': !busy.value && isSelected,
'btn-secondary': !busy.value && !isSelected,
}],
disabled: busy.value,
onClick(e: Event) {
e.preventDefault();
if (isSelected) {
handlePolicySelect(null);
} else {
handlePolicySelect(slotProps.data.id);
}
},
}, [
h('i', {
class: ['fa', {
'fa-check': isSelected,
'fa-plus': !isSelected,
}],
}),
]),
h('button', {
type: 'button',
class: ['btn btn-xs', {
'btn-dark': busy.value,
'btn-success': !busy.value && isSelected,
'btn-secondary': !busy.value && !isSelected,
}],
title: isSelected ? 'Remove policy' : 'Assign policy',
'aria-label': isSelected ? 'Remove policy' : 'Assign policy',
disabled: busy.value,
onClick(e: Event) {
e.preventDefault();
if (isSelected) {
handlePolicySelect(null);
} else {
handlePolicySelect(slotProps.data.id);
}
},
}, [
h('i', {
class: ['fa', {
'fa-check': isSelected,
'fa-plus': !isSelected,
}],
}),
]),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/client-web-kit/src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts`
around lines 170 - 192, The button only shows icons and lacks accessible text;
update the button element rendered in APermissionPolicyBindingButton to include
a dynamic title and aria-label (e.g., when isSelected true use "Remove policy"
otherwise "Assign policy"), and mark the inner <i> icon as aria-hidden="true" so
screen readers read the button label; keep existing onClick and use
handlePolicySelect, busy, and slotProps.data.id as-is so behavior is unchanged.

Comment on lines +81 to +135
if (detailPolicy.value) {
const policy = detailPolicy.value;
const modalTitleId = `policy-detail-modal-${policy.id}`;

const backdrop = h('div', {
class: 'modal-backdrop fade show',
onClick() {
detailPolicy.value = null;
},
});

const modal = h('div', {
class: 'modal fade show d-block',
tabindex: '-1',
role: 'dialog',
'aria-modal': 'true',
'aria-labelledby': modalTitleId,
}, [
h('div', {
class: 'modal-dialog',
role: 'document',
onClick(e: Event) {
e.stopPropagation();
},
}, [
h('div', { class: 'modal-content' }, [
h('div', { class: 'modal-header' }, [
h('h5', { class: 'modal-title', id: modalTitleId }, policy.name),
h('button', {
type: 'button',
class: 'btn-close',
'aria-label': 'Close',
onClick() {
detailPolicy.value = null;
},
}),
]),
h('div', { class: 'modal-body' }, [
h(APolicySummary, { entity: policy }),
]),
h('div', { class: 'modal-footer' }, [
h('button', {
type: 'button',
class: 'btn btn-secondary btn-xs',
onClick() {
detailPolicy.value = null;
},
}, 'Close'),
]),
]),
]),
]);

children.push(h(Teleport, { to: 'body' }, [backdrop, modal]));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This custom modal is missing basic focus management.

aria-modal="true" alone is not enough here: focus is never moved into the dialog, trapped while it is open, or restored on close. Keyboard users can tab into the page behind the modal, which breaks the assignment flow. Please use a shared modal abstraction if one exists, or add explicit focus management before shipping this.

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

In
`@packages/client-web-kit/src/components/entities/permission-policy/APermissionPolicyAssignments.ts`
around lines 81 - 135, The custom modal created when detailPolicy.value is set
(variables: modalTitleId, backdrop, modal, Teleport, APolicySummary) lacks focus
management—move keyboard focus into the modal when opened (e.g., to the modal
container or first focusable element), implement a focus trap to keep
Tab/Shift+Tab cycling within the modal, restore focus to the previously focused
element when detailPolicy.value is cleared, and prevent background content from
being focusable (use inert/aria-hidden on the rest of the document or use the
app's shared modal abstraction if available); also handle Escape to close the
modal and ensure backdrop and modal onClick handlers don’t block keyboard focus
behavior.

Comment on lines +17 to +24
emits: ['click'],
setup(props, { emit }) {
return () => h('button', {
class: 'btn btn-xs btn-outline-info',
title: 'View policy details',
onClick(e: Event) {
e.preventDefault();
emit('click', props.policyId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This control still doesn't navigate to the policy page.

It only emits a local click with policyId, so callers can open a preview, but they still cannot navigate to /policies/[id] from assignment contexts as required by the issue. Please expose a real route/href here, or render the link directly instead of limiting this component to local state changes.

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

In `@packages/client-web-kit/src/components/entities/policy/APolicyDetailNav.ts`
around lines 17 - 24, The component APolicyDetailNav currently only emits a
local 'click' with props.policyId and doesn't provide a real navigation target;
change the render in setup (the onClick handler / button) to produce a real link
target (either render an <a> with href={`/policies/${props.policyId}`} or use
the router API like router-link/router.push) so consumers can navigate from
assignment contexts; keep or still emit the click if needed, but ensure the
element exposes a real href/route (referencing APolicyDetailNav, setup, onClick,
props.policyId) so clicking navigates to /policies/[id] rather than only
updating local state.

Comment on lines +29 to +50
const rows = [
renderRow('Name', props.entity.name),
renderRow('Type', h(APolicyTypeBadge, { type: props.entity.type })),
];

if (props.entity.display_name) {
rows.push(renderRow('Display Name', props.entity.display_name));
}

if (props.entity.description) {
rows.push(renderRow('Description', props.entity.description));
}

if (props.entity.invert) {
rows.push(renderRow('Invert', h('span', { class: 'badge bg-warning' }, 'Yes')));
}

if (props.entity.built_in) {
rows.push(renderRow('Built-in', h('span', { class: 'badge bg-secondary' }, 'Yes')));
}

return h('div', rows);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The detail view still hides the actual policy configuration.

This summary only shows generic fields. Composite children, decision strategy, attribute rules, realm matching, and other type-specific config are still invisible, so the original inspection problem remains unresolved for the policies users most need to review.

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

In `@packages/client-web-kit/src/components/entities/policy/APolicySummary.ts`
around lines 29 - 50, APolicySummary currently only renders generic fields via
renderRow and omits policy-specific configuration; update the component to also
render composite children, decisionStrategy, attribute rules,
realm/realmMatching and any type-specific config from props.entity so users can
inspect the full policy. In APolicySummary (and where renderRow is used) add
conditional rows for props.entity.children (or compositeChildren) listing child
IDs/names, props.entity.decision_strategy (or decisionStrategy),
props.entity.rules/attributeRules with a compact readable rendering,
props.entity.realm or realmMatching settings, and switch on props.entity.type to
output type-specific fields; reuse renderRow and small helper renderers to keep
markup consistent and ensure badges/labels match existing style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add policy detail/preview to assignment components

2 participants