Skip to content

Commit a3b06fa

Browse files
normalise spacing for lists and help text across various modals (#25663)
For #24992 Normalises the padding around lists, list headers, and help text across various modals. **manage automation modal:** ![image](https://github.com/user-attachments/assets/bd5fa4cc-7ef0-4030-92fe-3d4914c2fa8c) **calander events modal:** ![image](https://github.com/user-attachments/assets/9f284a5a-ec8a-46fb-acf8-b205eb31fc60) **install software policy modal:** ![image](https://github.com/user-attachments/assets/eaf961a3-87c4-4e45-b3f8-5b2d64eb346d) **Run script policy modal** ![image](https://github.com/user-attachments/assets/6b2d75de-5a6c-4c0f-b82b-5f8006fc9ab0) - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. - [x] Manual QA for all new/changed functionality
1 parent b00da33 commit a3b06fa

File tree

9 files changed

+93
-83
lines changed

9 files changed

+93
-83
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- normalise padding spacing for list headers, lists, and help text across various modals.

frontend/pages/policies/ManagePoliciesPage/ManagePoliciesPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useQuery } from "react-query";
44
import { InjectedRouter } from "react-router/lib/Router";
55
import PATHS from "router/paths";
66
import { isEqual } from "lodash";
7-
import { formatDistanceToNowStrict } from "date-fns";
87

98
import { getNextLocationPath, wait } from "utilities/helpers";
109

frontend/pages/policies/ManagePoliciesPage/_styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
border: 1px solid $ui-fleet-black-10;
236236
// negate ul padding
237237
padding-left: 0;
238+
margin: 0;
238239

239240
.policy-row {
240241
display: flex;

frontend/pages/policies/ManagePoliciesPage/components/CalendarEventsModal/CalendarEventsModal.tsx

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -190,48 +190,50 @@ const CalendarEventsModal = ({
190190
return (
191191
<div className="form-field">
192192
<div className="form-field__label">Policies:</div>
193-
<ul className="automated-policies-section">
194-
{formData.policies.map((policy) => {
195-
const { isChecked, name, id } = policy;
196-
return (
197-
<li className="policy-row" id={`policy-row--${id}`} key={id}>
198-
<Checkbox
199-
value={isChecked}
200-
name={name}
201-
// can't use parseTarget as value needs to be set to !currentValue
202-
onChange={() => {
203-
onPolicyEnabledChange({ name, value: !isChecked });
204-
}}
205-
disabled={!formData.enabled}
206-
>
207-
<TooltipTruncatedText value={name} />
208-
</Checkbox>
209-
<Button
210-
variant="text-icon"
211-
onClick={() => {
212-
setSelectedPolicyToPreview(
213-
policies.find((p) => p.id === id)
214-
);
215-
togglePreviewCalendarEvent();
216-
}}
217-
className="policy-row__preview-button"
218-
>
219-
<Icon name="eye" /> Preview
220-
</Button>
221-
</li>
222-
);
223-
})}
224-
</ul>
225-
<span className="form-field__help-text">
226-
A calendar event will be created for end users if one of their hosts
227-
fail any of these policies.{" "}
228-
<CustomLink
229-
url="https://www.fleetdm.com/learn-more-about/calendar-events"
230-
text="Learn more"
231-
newTab
232-
disableKeyboardNavigation={!formData.enabled}
233-
/>
234-
</span>
193+
<div>
194+
<ul className="automated-policies-section">
195+
{formData.policies.map((policy) => {
196+
const { isChecked, name, id } = policy;
197+
return (
198+
<li className="policy-row" id={`policy-row--${id}`} key={id}>
199+
<Checkbox
200+
value={isChecked}
201+
name={name}
202+
// can't use parseTarget as value needs to be set to !currentValue
203+
onChange={() => {
204+
onPolicyEnabledChange({ name, value: !isChecked });
205+
}}
206+
disabled={!formData.enabled}
207+
>
208+
<TooltipTruncatedText value={name} />
209+
</Checkbox>
210+
<Button
211+
variant="text-icon"
212+
onClick={() => {
213+
setSelectedPolicyToPreview(
214+
policies.find((p) => p.id === id)
215+
);
216+
togglePreviewCalendarEvent();
217+
}}
218+
className="policy-row__preview-button"
219+
>
220+
<Icon name="eye" /> Preview
221+
</Button>
222+
</li>
223+
);
224+
})}
225+
</ul>
226+
<p className="form-field__help-text">
227+
A calendar event will be created for end users if one of their hosts
228+
fail any of these policies.{" "}
229+
<CustomLink
230+
url="https://www.fleetdm.com/learn-more-about/calendar-events"
231+
text="Learn more"
232+
newTab
233+
disableKeyboardNavigation={!formData.enabled}
234+
/>
235+
</p>
236+
</div>
235237
</div>
236238
);
237239
};
@@ -302,7 +304,6 @@ const CalendarEventsModal = ({
302304
onClick={() => {
303305
setShowExamplePayload(!showExamplePayload);
304306
}}
305-
// disabled={!formData.enabled}
306307
/>
307308
<Button
308309
type="button"

frontend/pages/policies/ManagePoliciesPage/components/CalendarEventsModal/_styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
box-sizing: border-box;
3333
margin: 0;
3434
}
35+
36+
.form-field__help-text {
37+
margin-top: $pad-large;
38+
}
3539
}
3640

3741
.calendar-event-preview {

frontend/pages/policies/ManagePoliciesPage/components/InstallSoftwareModal/InstallSoftwareModal.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
InstallableSoftwareSource,
3030
ISoftwareTitle,
3131
} from "interfaces/software";
32-
import TooltipWrapper from "components/TooltipWrapper";
3332

3433
const SOFTWARE_TITLE_LIST_LENGTH = 1000;
3534

@@ -308,21 +307,23 @@ const InstallSoftwareModal = ({
308307
<div className={`${baseClass} form`}>
309308
<div className="form-field">
310309
<div className="form-field__label">Policies:</div>
311-
<ul className="automated-policies-section">
312-
{formData.map((policyData) =>
313-
renderPolicySwInstallOption(policyData)
314-
)}
315-
</ul>
316-
<span className="form-field__help-text">
317-
If compatible with the host, the selected software will be installed
318-
when hosts fail the policy. Host counts will reset when new software
319-
is selected.{" "}
320-
<CustomLink
321-
url="https://fleetdm.com/learn-more-about/policy-automation-install-software"
322-
text="Learn more"
323-
newTab
324-
/>
325-
</span>
310+
<div>
311+
<ul className="automated-policies-section">
312+
{formData.map((policyData) =>
313+
renderPolicySwInstallOption(policyData)
314+
)}
315+
</ul>
316+
<p className="form-field__help-text">
317+
If compatible with the host, the selected software will be
318+
installed when hosts fail the policy. Host counts will reset when
319+
new software is selected.{" "}
320+
<CustomLink
321+
url="https://fleetdm.com/learn-more-about/policy-automation-install-software"
322+
text="Learn more"
323+
newTab
324+
/>
325+
</p>
326+
</div>
326327
</div>
327328
<div className="modal-cta-wrap">
328329
<Button

frontend/pages/policies/ManagePoliciesPage/components/InstallSoftwareModal/_styles.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.form-field__help-text {
44
font-size: 14px;
55
line-height: 21px;
6+
margin-top: $pad-large;
67
}
78

89
.form-field--dropdown {
@@ -33,7 +34,7 @@
3334
gap: $pad-small;
3435
justify-content: center;
3536
font-size: $small;
36-
37+
3738
div {
3839
color: $ui-fleet-black-75;
3940
font-size: $xx-small;

frontend/pages/policies/ManagePoliciesPage/components/PolicyRunScriptModal/PolicyRunScriptModal.tsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -204,26 +204,28 @@ const PolicyRunScriptModal = ({
204204
<div className={`${baseClass} form`}>
205205
<div className="form-field">
206206
<div className="form-field__label">Policies:</div>
207-
<ul className="automated-policies-section">
208-
{formData.map((policyData) =>
209-
renderPolicyRunScriptOption(policyData)
210-
)}
211-
</ul>
212-
<span className="form-field__help-text">
213-
If{" "}
214-
<TooltipWrapper tipContent={compatibleTipContent}>
215-
compatible
216-
</TooltipWrapper>{" "}
217-
with the host, the selected script will run when hosts fail the
218-
policy. The script will not run on hosts with scripts disabled, or
219-
on hosts with too many pending scripts. Host counts will reset when
220-
new scripts are selected.{" "}
221-
<CustomLink
222-
url="https://fleetdm.com/learn-more-about/policy-automation-run-script"
223-
text="Learn more"
224-
newTab
225-
/>
226-
</span>
207+
<div>
208+
<ul className="automated-policies-section">
209+
{formData.map((policyData) =>
210+
renderPolicyRunScriptOption(policyData)
211+
)}
212+
</ul>
213+
<p className="form-field__help-text">
214+
If{" "}
215+
<TooltipWrapper tipContent={compatibleTipContent}>
216+
compatible
217+
</TooltipWrapper>{" "}
218+
with the host, the selected script will run when hosts fail the
219+
policy. The script will not run on hosts with scripts disabled, or
220+
on hosts with too many pending scripts. Host counts will reset
221+
when new scripts are selected.{" "}
222+
<CustomLink
223+
url="https://fleetdm.com/learn-more-about/policy-automation-run-script"
224+
text="Learn more"
225+
newTab
226+
/>
227+
</p>
228+
</div>
227229
</div>
228230
<div className="modal-cta-wrap">
229231
<Button

frontend/pages/policies/ManagePoliciesPage/components/PolicyRunScriptModal/_styles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.form-field__help-text {
44
font-size: 14px;
55
line-height: 21px;
6+
margin-top: $pad-large;
67
}
78

89
.form-field--dropdown {
@@ -33,7 +34,7 @@
3334
gap: $pad-small;
3435
justify-content: center;
3536
font-size: $small;
36-
37+
3738
div {
3839
color: $ui-fleet-black-75;
3940
font-size: $xx-small;
@@ -47,4 +48,3 @@
4748
}
4849
}
4950
}
50-

0 commit comments

Comments
 (0)