Skip to content

Commit 8259aa9

Browse files
authored
Merge pull request #148 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 2399aca + 3bc9b04 commit 8259aa9

File tree

4 files changed

+70
-18
lines changed

4 files changed

+70
-18
lines changed

src/components/CippComponents/CippFormCondition.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const CippFormCondition = (props) => {
1212
formControl,
1313
disabled = false,
1414
} = props;
15-
1615
if (
1716
field === undefined ||
1817
compareValue === undefined ||

src/components/CippTable/CIPPTableToptoolbar.js

+8
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,14 @@ export const CIPPTableToptoolbar = ({
429429
<DeveloperMode />
430430
</IconButton>
431431
</Tooltip>
432+
{
433+
//add a little icon with how many rows are selected
434+
(table.getIsAllRowsSelected() || table.getIsSomeRowsSelected()) && (
435+
<Typography variant="body2" sx={{ alignSelf: "center" }}>
436+
{table.getSelectedRowModel().rows.length} rows selected
437+
</Typography>
438+
)
439+
}
432440
<CippOffCanvas
433441
size="xl"
434442
title="API Response"

src/pages/tenant/administration/alert-configuration/alert.jsx

+54-16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SvgIcon,
1313
IconButton,
1414
Skeleton,
15+
Divider,
1516
} from "@mui/material";
1617
import { ArrowLeftIcon } from "@mui/x-date-pickers";
1718
import { useRouter } from "next/router";
@@ -218,6 +219,7 @@ const AlertWizard = () => {
218219
const postObject = {
219220
RowKey: router.query.clone ? undefined : router.query.id ? router.query.id : undefined,
220221
tenantFilter: values.tenantFilter?.value,
222+
excludedTenants: values.excludedTenants,
221223
Name: `${values.tenantFilter.value}: ${values.command.label}`,
222224
Command: { value: `Get-CIPPAlert${values.command.value.name}` },
223225
Parameters: getInputParams(),
@@ -297,14 +299,32 @@ const AlertWizard = () => {
297299
<Grid container spacing={4} justifyContent="space-around">
298300
<Grid item xs={12} md={12}>
299301
<CippButtonCard title="Tenant Selector" sx={{ mb: 3 }}>
300-
<Typography>
301-
Select the tenants you want to include in this Alert.
302-
</Typography>
303-
<CippFormTenantSelector
304-
multiple={true}
305-
formControl={formControl}
306-
allTenants={true}
307-
/>
302+
<Grid container spacing={3}>
303+
<Grid item xs={12}>
304+
<CippFormTenantSelector
305+
multiple={true}
306+
formControl={formControl}
307+
allTenants={true}
308+
label="Included Tenants for alert"
309+
/>
310+
</Grid>
311+
<CippFormCondition
312+
field="tenantFilter"
313+
formControl={formControl}
314+
compareType="valueContains"
315+
compareValue="AllTenants"
316+
>
317+
<Grid item xs={12}>
318+
<CippFormTenantSelector
319+
multiple={true}
320+
label="Excluded Tenants for alert"
321+
formControl={formControl}
322+
allTenants={false}
323+
name="excludedTenants"
324+
/>
325+
</Grid>
326+
</CippFormCondition>
327+
</Grid>
308328
</CippButtonCard>
309329
</Grid>
310330

@@ -469,14 +489,32 @@ const AlertWizard = () => {
469489
<Grid container spacing={3}>
470490
<Grid item xs={12} md={12}>
471491
<CippButtonCard title="Tenant Selector">
472-
<Typography>
473-
Select the tenants you want to include in this Alert.
474-
</Typography>
475-
<CippFormTenantSelector
476-
allTenants={true}
477-
multiple={false}
478-
formControl={formControl}
479-
/>
492+
<Grid container spacing={3}>
493+
<Grid item xs={12}>
494+
<CippFormTenantSelector
495+
allTenants={true}
496+
multiple={false}
497+
formControl={formControl}
498+
label="Included Tenants for alert"
499+
/>
500+
</Grid>
501+
<CippFormCondition
502+
field="tenantFilter"
503+
formControl={formControl}
504+
compareType="is"
505+
compareValue="AllTenants"
506+
>
507+
<Grid item xs={12}>
508+
<CippFormTenantSelector
509+
multiple={true}
510+
label="Excluded Tenants for alert"
511+
formControl={formControl}
512+
allTenants={false}
513+
name="excludedTenants"
514+
/>
515+
</Grid>
516+
</CippFormCondition>
517+
</Grid>
480518
</CippButtonCard>
481519
</Grid>
482520

src/pages/tenant/administration/alert-configuration/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ const Page = () => {
5252
</Button>
5353
}
5454
actions={actions}
55-
simpleColumns={["Tenants", "EventType", "Conditions", "RepeatsEvery", "Actions"]}
55+
simpleColumns={[
56+
"Tenants",
57+
"EventType",
58+
"Conditions",
59+
"RepeatsEvery",
60+
"Actions",
61+
"excludedTenants",
62+
]}
5663
queryKey="ListAlertsQueue"
5764
/>
5865
);

0 commit comments

Comments
 (0)