Skip to content

Updated policy details page - #47437

Merged
juan-fdz-hawa merged 3 commits into
38670-policy-status-pagefrom
46909-policy-status-page---ui-policy-details-changes
Jun 15, 2026
Merged

Updated policy details page#47437
juan-fdz-hawa merged 3 commits into
38670-policy-status-pagefrom
46909-policy-status-page---ui-policy-details-changes

Conversation

@juan-fdz-hawa

Copy link
Copy Markdown
Contributor

Related issue: Closes #46909

Screen.Recording.2026-06-11.at.1.07.54.PM.mov
  • Show labels and automation fields as 'single' values.
  • Change layout of policy fields.
  • Show all labels and all automations using modals.

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • QA'd all new/changed functionality manually

@juan-fdz-hawa juan-fdz-hawa linked an issue Jun 11, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.13636% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.19%. Comparing base (0380582) to head (b671d97).

Files with missing lines Patch % Lines
...es/details/PolicyDetailsPage/PolicyDetailsPage.tsx 24.56% 43 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           38670-policy-status-page   #47437      +/-   ##
============================================================
- Coverage                     67.23%   67.19%   -0.04%     
============================================================
  Files                          2954     2957       +3     
  Lines                        227530   227715     +185     
  Branches                      11683    11768      +85     
============================================================
+ Hits                         152982   153021      +39     
- Misses                        60712    60858     +146     
  Partials                      13836    13836              
Flag Coverage Δ
frontend 57.68% <51.13%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@juan-fdz-hawa
juan-fdz-hawa force-pushed the 46909-policy-status-page---ui-policy-details-changes branch from 579a265 to 536b30a Compare June 11, 2026 17:22
@juan-fdz-hawa
juan-fdz-hawa marked this pull request as ready for review June 11, 2026 17:27
@juan-fdz-hawa
juan-fdz-hawa requested a review from a team as a code owner June 11, 2026 17:27
Closes #46909

- Show labels and automation fields as 'single' values.
- Change layout of policy fields.
- Show all labels and all automations using modals.
@juan-fdz-hawa
juan-fdz-hawa force-pushed the 46909-policy-status-page---ui-policy-details-changes branch from 85d4bc6 to 9c4ee00 Compare June 12, 2026 14:48

@nulmete nulmete left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! I have some suggestions to follow our FE patterns, let me know what you think

@@ -0,0 +1,2 @@
.policy-automations-modal {

@nulmete nulmete Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I'd remove if no styles are needed, unless there's a follow-up where we fill this


await user.click(screen.getByRole("button", { name: "Done" }));

expect(onClose).toHaveBeenCalled();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
expect(onClose).toHaveBeenCalled();
expect(onClose).toHaveBeenCalledTimes(1);

(so that we also make sure it's called only once)

Comment on lines +19 to +43
const renderLabelList = (
labels: ILabelPolicy[],
scopeLabel: string,
description: string,
onLabelClick?: (labelId: number) => void
) => (
<div className={`${baseClass}__section`}>
<span className={`${baseClass}__scope-description`}>
{description} <b>{scopeLabel}</b> of these labels:
</span>
<ul className={`${baseClass}__label-list`}>
{labels.map((label) => (
<li key={label.id} className={`${baseClass}__label-item`}>
{onLabelClick ? (
<Button variant="link" onClick={() => onLabelClick(label.id)}>
{label.name}
</Button>
) : (
<span>{label.name}</span>
)}
</li>
))}
</ul>
</div>
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a blocker, but I'd say let's have this declared as a react component instead of a plain JS function and have it at the bottom of the file (below the main component).

For reference, we agreed on introducing this pattern on this PR #46213 on the FE sync. (It hasn't been merged yet, so if you change this, you'll need to have an eslint exception rule at the top of the file.)

))}
</ul>
</div>
<Button variant="link" onClick={() => openLabelModal()}>

@nulmete nulmete Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
<Button variant="link" onClick={() => openLabelModal()}>
<Button variant="link" onClick={openLabelModal}>

Comment on lines +1 to +7
.policy-label-modal {
&__label-list {
list-style: none;
padding: 0;

margin-top: $pad-small;
margin-bottom: $pad-large;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should follow this pattern and remove margin-top and margin-bottom:

Image

Therefore I'd use flex columns + gaps on both .policy-label-modal (to have spacing between the two sections) + on each of the sections if need to have some space between each of the descriptions and the label list.

Comment on lines +69 to +73
): {
includeLabels?: ILabelPolicy[];
includeScopeLabel?: string;
excludeLabels?: ILabelPolicy[];
excludeScopeLabel?: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: we could Pick these props from the modal props.

)}
{showLabelModal && storedPolicy && (
<PolicyLabelModal
{...getLabelModalData(storedPolicy)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I'd explicitly pass the props (though it would require to perform the getLabelModalData(storedPolicy) call above the return statement). Anyways I'd still do that single call and you could reuse the same result for renderLabels as well (instead of calling it within that closure).

Ideally, renderLabels would be replaced by a child PolicyDetailLabels or just Labels component at the bottom of the file. Then PolicyDetailsPage would just call getLabelModalData(storedPolicy) once and pass the result to whichever components need it (PolicyLabelModal and PolicyDetailLabels / Labels).

@juan-fdz-hawa
juan-fdz-hawa merged commit 0c4bb0c into 38670-policy-status-page Jun 15, 2026
16 checks passed
@juan-fdz-hawa
juan-fdz-hawa deleted the 46909-policy-status-page---ui-policy-details-changes branch June 15, 2026 13:39
juan-fdz-hawa added a commit that referenced this pull request Jun 17, 2026
**Related issue:** Closes #46909

- Show labels and automation fields as 'single' values.
- Change layout of policy fields.
- Show all labels and all automations using modals.
juan-fdz-hawa added a commit that referenced this pull request Jun 19, 2026
**Related issue:** Closes #46909

- Show labels and automation fields as 'single' values.
- Change layout of policy fields.
- Show all labels and all automations using modals.
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.

Policy status page - UI policy details changes

2 participants