Skip to content

Commit 2418bce

Browse files
authored
Merge pull request #875 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents eca8959 + 71dc451 commit 2418bce

6 files changed

Lines changed: 305 additions & 122 deletions

File tree

src/components/CippComponents/CippApiResults.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export const CippApiResults = (props) => {
244244

245245
const hasVisibleResults = finalResults.some((r) => r.visible);
246246
return (
247-
<Stack spacing={2}>
247+
<Stack spacing={2} sx={{ minWidth: 0 }}>
248248
{/* Loading alert */}
249249
{!errorsOnly && (
250250
<Collapse in={fetchingVisible} unmountOnExit>

src/layouts/config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,18 @@ export const nativeMenuItems = [
347347
},
348348
{
349349
title: "Reports",
350-
permissions: ["Tenant.DeviceCompliance.*"],
350+
permissions: ["Tenant.DeviceCompliance.*", "Security.Defender.*"],
351351
items: [
352352
{
353353
title: "Device Compliance",
354354
path: "/security/reports/list-device-compliance",
355355
permissions: ["Tenant.DeviceCompliance.*"],
356356
},
357+
{
358+
title: "MDE Onboarding",
359+
path: "/security/reports/mde-onboarding",
360+
permissions: ["Security.Defender.*"],
361+
},
357362
],
358363
},
359364
{
@@ -903,7 +908,6 @@ export const nativeMenuItems = [
903908
path: "/cipp/scheduler",
904909
roles: ["editor", "admin", "superadmin"],
905910
permissions: ["CIPP.Scheduler.*"],
906-
scope: "global",
907911
},
908912
],
909913
},

src/pages/cipp/scheduler/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ const Page = () => {
6666
<CippSchedulerDrawer buttonText="Add Task" />
6767
</>
6868
}
69-
tenantInTitle={false}
7069
title="Scheduled Tasks"
7170
apiUrl={
7271
showHiddenJobs ? `/api/ListScheduledItems?ShowHidden=true` : `/api/ListScheduledItems`

src/pages/endpoint/applications/list/index.js

Lines changed: 62 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -62,47 +62,59 @@ const Page = () => {
6262
},
6363
];
6464

65+
// Builds a customDataformatter that handles both single-row and bulk (array) inputs.
66+
const makeAssignFormatter = (getRowData) => (row, action, formData) => {
67+
const formatRow = (singleRow) => {
68+
const tenantFilterValue =
69+
tenant === "AllTenants" && singleRow?.Tenant ? singleRow.Tenant : tenant;
70+
return {
71+
tenantFilter: tenantFilterValue,
72+
ID: singleRow?.id,
73+
AppType: getAppAssignmentSettingsType(singleRow?.["@odata.type"]),
74+
AssignmentFilterName: formData?.assignmentFilter?.value || null,
75+
AssignmentFilterType: formData?.assignmentFilter?.value
76+
? formData?.assignmentFilterType || "include"
77+
: null,
78+
...getRowData(singleRow, formData),
79+
};
80+
};
81+
return Array.isArray(row) ? row.map(formatRow) : formatRow(row);
82+
};
83+
84+
const assignmentFields = [
85+
{
86+
type: "radio",
87+
name: "Intent",
88+
label: "Assignment intent",
89+
options: assignmentIntentOptions,
90+
defaultValue: "Required",
91+
validators: { required: "Select an assignment intent" },
92+
helperText:
93+
"Available assigns to Company Portal, Required installs automatically, Uninstall removes the app, Available without enrollment exposes it without device enrollment.",
94+
},
95+
{
96+
type: "radio",
97+
name: "assignmentMode",
98+
label: "Assignment mode",
99+
options: assignmentModeOptions,
100+
defaultValue: "replace",
101+
helperText:
102+
"Replace will overwrite existing assignments. Append keeps current assignments and adds/overwrites only for the selected groups/intents.",
103+
},
104+
...getAssignmentFilterFields(),
105+
];
106+
65107
const actions = [
66108
{
67109
label: "Assign to All Users",
68110
type: "POST",
69111
url: "/api/ExecAssignApp",
70-
fields: [
71-
{
72-
type: "radio",
73-
name: "Intent",
74-
label: "Assignment intent",
75-
options: assignmentIntentOptions,
76-
defaultValue: "Required",
77-
validators: { required: "Select an assignment intent" },
78-
helperText:
79-
"Available assigns to Company Portal, Required installs automatically, Uninstall removes the app, Available without enrollment exposes it without device enrollment.",
80-
},
81-
{
82-
type: "radio",
83-
name: "assignmentMode",
84-
label: "Assignment mode",
85-
options: assignmentModeOptions,
86-
defaultValue: "replace",
87-
helperText:
88-
"Replace will overwrite existing assignments. Append keeps current assignments and adds/overwrites only for the selected groups/intents.",
89-
},
90-
...getAssignmentFilterFields(),
91-
],
92-
customDataformatter: (row, action, formData) => {
93-
const tenantFilterValue = tenant === "AllTenants" && row?.Tenant ? row.Tenant : tenant;
94-
return {
95-
tenantFilter: tenantFilterValue,
96-
ID: row?.id,
97-
AssignTo: "AllUsers",
98-
Intent: formData?.Intent || "Required",
99-
assignmentMode: formData?.assignmentMode || "replace",
100-
AssignmentFilterName: formData?.assignmentFilter?.value || null,
101-
AssignmentFilterType: formData?.assignmentFilter?.value
102-
? formData?.assignmentFilterType || "include"
103-
: null,
104-
};
105-
},
112+
fields: assignmentFields,
113+
customDataformatter: makeAssignFormatter((_singleRow, formData) => ({
114+
AssignTo: "AllUsers",
115+
Intent: formData?.Intent || "Required",
116+
assignmentMode: formData?.assignmentMode || "replace",
117+
})),
106118
confirmText: 'Are you sure you want to assign "[displayName]" to all users?',
107119
icon: <UserIcon />,
108120
color: "info",
@@ -111,42 +123,12 @@ const Page = () => {
111123
label: "Assign to All Devices",
112124
type: "POST",
113125
url: "/api/ExecAssignApp",
114-
fields: [
115-
{
116-
type: "radio",
117-
name: "Intent",
118-
label: "Assignment intent",
119-
options: assignmentIntentOptions,
120-
defaultValue: "Required",
121-
validators: { required: "Select an assignment intent" },
122-
helperText:
123-
"Available assigns to Company Portal, Required installs automatically, Uninstall removes the app, Available without enrollment exposes it without device enrollment.",
124-
},
125-
{
126-
type: "radio",
127-
name: "assignmentMode",
128-
label: "Assignment mode",
129-
options: assignmentModeOptions,
130-
defaultValue: "replace",
131-
helperText:
132-
"Replace will overwrite existing assignments. Append keeps current assignments and adds/overwrites only for the selected groups/intents.",
133-
},
134-
...getAssignmentFilterFields(),
135-
],
136-
customDataformatter: (row, action, formData) => {
137-
const tenantFilterValue = tenant === "AllTenants" && row?.Tenant ? row.Tenant : tenant;
138-
return {
139-
tenantFilter: tenantFilterValue,
140-
ID: row?.id,
141-
AssignTo: "AllDevices",
142-
Intent: formData?.Intent || "Required",
143-
assignmentMode: formData?.assignmentMode || "replace",
144-
AssignmentFilterName: formData?.assignmentFilter?.value || null,
145-
AssignmentFilterType: formData?.assignmentFilter?.value
146-
? formData?.assignmentFilterType || "include"
147-
: null,
148-
};
149-
},
126+
fields: assignmentFields,
127+
customDataformatter: makeAssignFormatter((_singleRow, formData) => ({
128+
AssignTo: "AllDevices",
129+
Intent: formData?.Intent || "Required",
130+
assignmentMode: formData?.assignmentMode || "replace",
131+
})),
150132
confirmText: 'Are you sure you want to assign "[displayName]" to all devices?',
151133
icon: <LaptopMac />,
152134
color: "info",
@@ -155,42 +137,12 @@ const Page = () => {
155137
label: "Assign Globally (All Users / All Devices)",
156138
type: "POST",
157139
url: "/api/ExecAssignApp",
158-
fields: [
159-
{
160-
type: "radio",
161-
name: "Intent",
162-
label: "Assignment intent",
163-
options: assignmentIntentOptions,
164-
defaultValue: "Required",
165-
validators: { required: "Select an assignment intent" },
166-
helperText:
167-
"Available assigns to Company Portal, Required installs automatically, Uninstall removes the app, Available without enrollment exposes it without device enrollment.",
168-
},
169-
{
170-
type: "radio",
171-
name: "assignmentMode",
172-
label: "Assignment mode",
173-
options: assignmentModeOptions,
174-
defaultValue: "replace",
175-
helperText:
176-
"Replace will overwrite existing assignments. Append keeps current assignments and adds/overwrites only for the selected groups/intents.",
177-
},
178-
...getAssignmentFilterFields(),
179-
],
180-
customDataformatter: (row, action, formData) => {
181-
const tenantFilterValue = tenant === "AllTenants" && row?.Tenant ? row.Tenant : tenant;
182-
return {
183-
tenantFilter: tenantFilterValue,
184-
ID: row?.id,
185-
AssignTo: "AllDevicesAndUsers",
186-
Intent: formData?.Intent || "Required",
187-
assignmentMode: formData?.assignmentMode || "replace",
188-
AssignmentFilterName: formData?.assignmentFilter?.value || null,
189-
AssignmentFilterType: formData?.assignmentFilter?.value
190-
? formData?.assignmentFilterType || "include"
191-
: null,
192-
};
193-
},
140+
fields: assignmentFields,
141+
customDataformatter: makeAssignFormatter((_singleRow, formData) => ({
142+
AssignTo: "AllDevicesAndUsers",
143+
Intent: formData?.Intent || "Required",
144+
assignmentMode: formData?.assignmentMode || "replace",
145+
})),
194146
confirmText: 'Are you sure you want to assign "[displayName]" to all users and devices?',
195147
icon: <GlobeAltIcon />,
196148
color: "info",
@@ -252,23 +204,15 @@ const Page = () => {
252204
},
253205
...getAssignmentFilterFields(),
254206
],
255-
customDataformatter: (row, action, formData) => {
207+
customDataformatter: makeAssignFormatter((_singleRow, formData) => {
256208
const selectedGroups = Array.isArray(formData?.groupTargets) ? formData.groupTargets : [];
257-
const tenantFilterValue = tenant === "AllTenants" && row?.Tenant ? row.Tenant : tenant;
258209
return {
259-
tenantFilter: tenantFilterValue,
260-
ID: row?.id,
261210
GroupIds: selectedGroups.map((group) => group.value).filter(Boolean),
262211
GroupNames: selectedGroups.map((group) => group.label).filter(Boolean),
263212
Intent: formData?.assignmentIntent || "Required",
264213
AssignmentMode: formData?.assignmentMode || "replace",
265-
AppType: getAppAssignmentSettingsType(row?.["@odata.type"]),
266-
AssignmentFilterName: formData?.assignmentFilter?.value || null,
267-
AssignmentFilterType: formData?.assignmentFilter?.value
268-
? formData?.assignmentFilterType || "include"
269-
: null,
270214
};
271-
},
215+
}),
272216
},
273217
{
274218
label: "Delete Application",

src/pages/identity/administration/group-templates/edit.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const Page = () => {
4646
allowExternal: templateData.allowExternal,
4747
tenantFilter: userSettingsDefaults.currentTenant,
4848
});
49+
formControl.trigger();
4950
}
5051
}
5152
}, [template, formControl, userSettingsDefaults.currentTenant]);

0 commit comments

Comments
 (0)