Skip to content

Commit 9319c9b

Browse files
authored
Merge pull request #123 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents d0c9231 + 1af58f9 commit 9319c9b

File tree

5 files changed

+68
-14
lines changed

5 files changed

+68
-14
lines changed

src/components/CippComponents/CippApiDialog.jsx

+12-10
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,21 @@ export const CippApiDialog = (props) => {
274274
};
275275

276276
// Handling link navigation
277-
if (api.link) {
278-
const linkWithRowData = api.link.replace(/\[([^\]]+)\]/g, (_, key) => {
279-
return getNestedValue(row, key) || `[${key}]`;
280-
});
277+
useEffect(() => {
278+
if (api.link && createDialog.open) {
279+
const linkWithRowData = api.link.replace(/\[([^\]]+)\]/g, (_, key) => {
280+
return getNestedValue(row, key) || `[${key}]`;
281+
});
281282

282-
if (linkWithRowData.startsWith("/")) {
283-
router.push(linkWithRowData, undefined, { shallow: true });
284-
} else {
285-
window.open(linkWithRowData, api.target || "_blank");
283+
if (linkWithRowData.startsWith("/")) {
284+
router.push(linkWithRowData, undefined, { shallow: true });
285+
} else {
286+
window.open(linkWithRowData, api.target || "_blank");
287+
}
288+
createDialog.handleClose();
286289
}
290+
}, [api.link, createDialog.open]);
287291

288-
return null;
289-
}
290292
useEffect(() => {
291293
if (api.noConfirm) {
292294
formHook.handleSubmit(onSubmit)(); // Submits the form on mount

src/data/standards.json

+29-1
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,33 @@
909909
"powershellEquivalent": "Graph API",
910910
"recommendedBy": []
911911
},
912+
{
913+
"name": "standards.UserPreferredLanguage",
914+
"cat": "Entra (AAD) Standards",
915+
"tag": [],
916+
"helpText": "Sets the preferred language property for all users in the tenant. This will override the user's language settings.",
917+
"docsDescription": "Sets the preferred language property for all users in the tenant. This will override the user's language settings.",
918+
"addedComponent": [
919+
{
920+
"type": "autoComplete",
921+
"multiple": false,
922+
"creatable": false,
923+
"name": "standards.UserPreferredLanguage.preferredLanguage",
924+
"label": "Preferred Language",
925+
"api": {
926+
"url": "/languageList.json",
927+
"labelField": "language",
928+
"valueField": "tag"
929+
}
930+
}
931+
],
932+
"label": "Preferred language for all users",
933+
"impact": "High Impact",
934+
"impactColour": "info",
935+
"addedDate": "2025-02-26",
936+
"powershellEquivalent": "Update-MgUser -UserId [email protected] -BodyParameter @{preferredLanguage='en-US'}",
937+
"recommendedBy": []
938+
},
912939
{
913940
"name": "standards.OutBoundSpamAlert",
914941
"cat": "Exchange Standards",
@@ -3206,7 +3233,8 @@
32063233
{
32073234
"type": "textField",
32083235
"name": "standards.AutopilotStatusPage.ErrorMessage",
3209-
"label": "Custom Error Message"
3236+
"label": "Custom Error Message",
3237+
"required": false
32103238
},
32113239
{
32123240
"type": "switch",

src/pages/cipp/preferences.js

+20
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@ import { useSettings } from "../../hooks/use-settings";
99
import countryList from "../../data/countryList.json";
1010
import { CippSettingsSideBar } from "../../components/CippComponents/CippSettingsSideBar";
1111
import CippDevOptions from "/src/components/CippComponents/CippDevOptions";
12+
import { ApiGetCall } from "../../api/ApiCall";
13+
import { getCippFormatting } from "../../utils/get-cipp-formatting";
1214

1315
const Page = () => {
1416
const settings = useSettings();
1517
const formcontrol = useForm({ mode: "onChange", defaultValues: settings });
1618

19+
const auth = ApiGetCall({
20+
url: "/.auth/me",
21+
queryKey: "authmecipp",
22+
staleTime: 120000,
23+
refetchOnWindowFocus: true,
24+
});
25+
1726
const addedAttributes = [
1827
{ value: "consentProvidedForMinor", label: "consentProvidedForMinor" },
1928
{ value: "employeeId", label: "employeeId" },
@@ -281,6 +290,17 @@ const Page = () => {
281290
</Grid>
282291
<Grid size={{ xs: 12, lg: 4 }}>
283292
<Stack spacing={3}>
293+
<CippPropertyListCard
294+
title={`CIPP Roles for ${auth?.data?.clientPrincipal?.userDetails}`}
295+
propertyItems={(auth?.data?.clientPrincipal?.userRoles ?? [])
296+
.filter((role) => !['anonymous', 'authenticated'].includes(role))
297+
.map((role) => ({
298+
label: "",
299+
value: getCippFormatting(role,"role"),
300+
}))}
301+
showDivider={false}
302+
/>
303+
284304
<CippSettingsSideBar formcontrol={formcontrol} />
285305
<CippDevOptions />
286306
</Stack>

src/pages/cipp/settings/tenants.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const Page = () => {
2121
data: { value: "customerId" },
2222
confirmText: "Are you sure you want to exclude these tenants?",
2323
multiPost: false,
24+
condition: (row) => row.displayName !== '*Partner Tenant',
2425
},
2526
{
2627
label: "Include Tenants",
@@ -30,13 +31,14 @@ const Page = () => {
3031
data: { value: "customerId" },
3132
confirmText: "Are you sure you want to include these tenants?",
3233
multiPost: false,
34+
condition: (row) => row.displayName !== '*Partner Tenant',
3335
},
3436
{
3537
label: "Refresh CPV Permissions",
3638
type: "POST",
3739
url: `/api/ExecCPVPermissions`,
3840
icon: <PlayArrow />,
39-
data: { TenantFilter: "customerId" },
41+
data: { tenantFilter: "customerId" },
4042
confirmText: "Are you sure you want to refresh the CPV permissions for these tenants?",
4143
multiPost: false,
4244
},
@@ -45,10 +47,11 @@ const Page = () => {
4547
type: "POST",
4648
url: `/api/ExecCPVPermissions?&ResetSP=true`,
4749
icon: <RestartAlt />,
48-
data: { TenantFilter: "customerId" },
50+
data: { tenantFilter: "customerId" },
4951
confirmText:
5052
"Are you sure you want to reset the CPV permissions for these tenants? (This will delete the Service Principal and re-add it.)",
5153
multiPost: false,
54+
condition: (row) => row.displayName !== '*Partner Tenant',
5255
},
5356
{
5457
label: "Remove Tenant",
@@ -58,6 +61,7 @@ const Page = () => {
5861
data: { TenantID: "customerId" },
5962
confirmText: "Are you sure you want to remove this tenant?",
6063
multiPost: false,
64+
condition: (row) => row.displayName !== '*Partner Tenant',
6165
},
6266
];
6367

src/utils/get-cipp-formatting.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export const getCippFormatting = (data, cellName, type, canReceive) => {
219219
}
220220
}
221221

222-
if (cellName === "ClientId") {
222+
if (cellName === "ClientId" || cellName === "role") {
223223
return isText ? data : <CippCopyToClipBoard text={data} type="chip" />;
224224
}
225225

0 commit comments

Comments
 (0)