Skip to content

Commit b289a0a

Browse files
authored
Merge pull request #709 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 3fca58a + aa27f33 commit b289a0a

File tree

4 files changed

+57
-7
lines changed

4 files changed

+57
-7
lines changed

.github/agents/CIPP-Alert-Agent.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: CIPP Frontend Alert Registrar
3+
description: >
4+
Adds new alert entries to src/data/alerts.json in the CIPP frontend.
5+
The agent must never modify any other file or perform any other change.
6+
---
7+
8+
# CIPP Frontend Alert Registrar
9+
10+
## Mission
11+
12+
You are a **frontend alert registrar** responsible for updating the `src/data/alerts.json` file to include new alerts.
13+
14+
Your role is **strictly limited** to adding a new JSON entry describing the alert’s metadata.
15+
You do not touch or inspect any other part of the codebase.
16+
17+
---
18+
19+
## Scope of Work
20+
21+
This agent is used when a new alert must be surfaced to the frontend — for example, after a new backend `Get-CIPPAlert*.ps1` alert has been added.
22+
23+
Tasks include:
24+
25+
- Opening `src/data/alerts.json`
26+
- Appending one new JSON object describing the new alert
27+
- Preserving JSON structure, indentation, and trailing commas exactly as in the existing file
28+
- Validating that the resulting JSON is syntactically correct
29+
30+
31+
## Alert Format
32+
33+
Each alert entry in `src/data/alerts.json` is a JSON object with the following structure:
34+
35+
```json
36+
{
37+
"name": "<alertName>",
38+
"label": "A nice label for the alert",
39+
"requiresInput": true,
40+
"inputType": "switch",
41+
"inputLabel": "Exclude disabled users?",
42+
"inputName": "InactiveLicensedUsersExcludeDisabled",
43+
"recommendedRunInterval": "1d"
44+
}
45+
```

src/components/CippComponents/CippTenantSelector.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,14 @@ export const CippTenantSelector = (props) => {
342342
onChange={(nv) => setSelectedTenant(nv)}
343343
options={
344344
tenantList.isSuccess && tenantList.data && tenantList.data.length > 0
345-
? tenantList.data.map(({ customerId, displayName, defaultDomainName }) => ({
345+
? tenantList.data.map(({ customerId, displayName, defaultDomainName, initialDomainName }) => ({
346346
value: defaultDomainName,
347347
label: `${displayName} (${defaultDomainName})`,
348-
addedField: {
349-
defaultDomainName: "defaultDomainName",
350-
displayName: "displayName",
351-
customerId: "customerId",
348+
addedFields: {
349+
defaultDomainName: defaultDomainName,
350+
displayName: displayName,
351+
customerId: customerId,
352+
initialDomainName: initialDomainName,
352353
},
353354
}))
354355
: []

src/components/CippFormPages/CippAddEditUser.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ const CippAddEditUser = (props) => {
609609
groupType: tenantGroup.groupType,
610610
},
611611
}))}
612+
creatable={false}
612613
formControl={formControl}
613614
/>
614615
</Grid>
@@ -627,6 +628,7 @@ const CippAddEditUser = (props) => {
627628
groupType: userGroups.groupType,
628629
},
629630
}))}
631+
creatable={false}
630632
formControl={formControl}
631633
/>
632634
</Grid>

src/pages/tenant/manage/applied-standards.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ const Page = () => {
145145
Object.entries(selectedTemplate.standards).forEach(([standardKey, standardConfig]) => {
146146
if (standardKey === "IntuneTemplate" && Array.isArray(standardConfig)) {
147147
standardConfig.forEach((templateItem, index) => {
148+
if (!templateItem) return; // Skip null items
148149
console.log("Processing IntuneTemplate item:", templateItem);
149150
if (
150151
templateItem["TemplateList-Tags"]?.value &&
@@ -214,7 +215,7 @@ const Page = () => {
214215
standardId,
215216
standardName: `Intune Template: ${
216217
expandedTemplate.displayName || expandedTemplate.name || itemTemplateId
217-
} (via ${templateItem["TemplateList-Tags"].value})`,
218+
} (via ${templateItem["TemplateList-Tags"]?.value})`,
218219
currentTenantValue:
219220
standardObject !== undefined
220221
? {
@@ -367,6 +368,7 @@ const Page = () => {
367368
) {
368369
// Process each ConditionalAccessTemplate item separately
369370
standardConfig.forEach((templateItem, index) => {
371+
if (!templateItem) return; // Skip null items
370372
// Check if this item has TemplateList-Tags and expand them
371373
if (
372374
templateItem["TemplateList-Tags"]?.value &&
@@ -423,7 +425,7 @@ const Page = () => {
423425
standardId,
424426
standardName: `Conditional Access Template: ${
425427
expandedTemplate.displayName || expandedTemplate.name || itemTemplateId
426-
} (via ${templateItem["TemplateList-Tags"].value})`,
428+
} (via ${templateItem["TemplateList-Tags"]?.value})`,
427429
currentTenantValue:
428430
standardObject !== undefined
429431
? {

0 commit comments

Comments
 (0)