Skip to content

Commit 75ae791

Browse files
Merge pull request #4468 from kris6673/deploy-button
Feat: Enhance tenant selection and add Deploy Policy button
2 parents 704b2ec + 2598bee commit 75ae791

File tree

17 files changed

+361
-313
lines changed

17 files changed

+361
-313
lines changed

src/pages/email/administration/contacts-template/deploy.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const Page = () => {
3131
name="selectedTenants"
3232
type="multiple"
3333
allTenants={true}
34+
preselectedEnabled={true}
3435
validators={{ required: "At least one tenant must be selected" }}
3536
/>
3637
</Grid>

src/pages/email/spamfilter/list-connectionfilter/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/email/spamfilter/list-quarantine-policies/add.jsx

Lines changed: 61 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const AddPolicy = () => {
4747
name="selectedTenants"
4848
type="multiple"
4949
allTenants={true}
50+
preselectedEnabled={true}
5051
validators={{ required: "At least one tenant must be selected" }}
5152
/>
5253
</Grid>
@@ -72,73 +73,67 @@ const AddPolicy = () => {
7273
</Grid> */}
7374

7475
<Divider sx={{ my: 2, width: "100%" }} />
75-
<Grid xs={6} >
76-
<CippFormComponent
77-
type="textField"
78-
label="Policy Name"
79-
name="Name"
80-
placeholder="Enter policy name"
81-
formControl={formControl}
82-
required={true}
83-
/>
84-
<Divider sx={{ my: 2, width: "100%" }} />
85-
<CippFormComponent
86-
type="autoComplete"
87-
label="Release Action Preference"
88-
name="ReleaseActionPreference"
89-
placeholder="Select release action preference"
90-
formControl={formControl}
91-
required={true}
92-
multiple={false}
93-
options={[
94-
{ label: "Release", value: "Release" },
95-
{ label: "Request Release", value: "RequestRelease" },
96-
]}
97-
/>
98-
</Grid>
76+
<Grid xs={6}>
77+
<CippFormComponent
78+
type="textField"
79+
label="Policy Name"
80+
name="Name"
81+
placeholder="Enter policy name"
82+
formControl={formControl}
83+
required={true}
84+
/>
85+
<Divider sx={{ my: 2, width: "100%" }} />
86+
<CippFormComponent
87+
type="autoComplete"
88+
label="Release Action Preference"
89+
name="ReleaseActionPreference"
90+
placeholder="Select release action preference"
91+
formControl={formControl}
92+
required={true}
93+
multiple={false}
94+
options={[
95+
{ label: "Release", value: "Release" },
96+
{ label: "Request Release", value: "RequestRelease" },
97+
]}
98+
/>
99+
</Grid>
99100

100-
<Grid xs={2}>
101-
102-
<CippFormComponent
103-
type="switch"
104-
label="Delete"
105-
name="Delete"
106-
formControl={formControl}
107-
/>
108-
<CippFormComponent
109-
type="switch"
110-
label="Preview"
111-
name="Preview"
112-
formControl={formControl}
113-
/>
114-
<CippFormComponent
115-
type="switch"
116-
label="Block Sender"
117-
name="BlockSender"
118-
formControl={formControl}
119-
/>
120-
<CippFormComponent
121-
type="switch"
122-
label="Allow Sender"
123-
name="AllowSender"
124-
formControl={formControl}
125-
/>
126-
</Grid>
127-
<Grid xs={4}>
128-
<CippFormComponent
129-
type="switch"
130-
label="Quarantine Notification"
131-
name="QuarantineNotification"
132-
formControl={formControl}
133-
/>
134-
<CippFormComponent
135-
type="switch"
136-
label="Include Messages From Blocked Sender Address"
137-
name="IncludeMessagesFromBlockedSenderAddress"
138-
formControl={formControl}
139-
disabled={!quarantineNotification}
140-
/>
141-
</Grid>
101+
<Grid xs={2}>
102+
<CippFormComponent type="switch" label="Delete" name="Delete" formControl={formControl} />
103+
<CippFormComponent
104+
type="switch"
105+
label="Preview"
106+
name="Preview"
107+
formControl={formControl}
108+
/>
109+
<CippFormComponent
110+
type="switch"
111+
label="Block Sender"
112+
name="BlockSender"
113+
formControl={formControl}
114+
/>
115+
<CippFormComponent
116+
type="switch"
117+
label="Allow Sender"
118+
name="AllowSender"
119+
formControl={formControl}
120+
/>
121+
</Grid>
122+
<Grid xs={4}>
123+
<CippFormComponent
124+
type="switch"
125+
label="Quarantine Notification"
126+
name="QuarantineNotification"
127+
formControl={formControl}
128+
/>
129+
<CippFormComponent
130+
type="switch"
131+
label="Include Messages From Blocked Sender Address"
132+
name="IncludeMessagesFromBlockedSenderAddress"
133+
formControl={formControl}
134+
disabled={!quarantineNotification}
135+
/>
136+
</Grid>
142137
</Grid>
143138
</CippFormPage>
144139
);

src/pages/email/spamfilter/list-spamfilter/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/email/transport/list-connectors/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/email/transport/list-rules/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/endpoint/MEM/add-policy/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Page = () => {
1010
title: "Step 1",
1111
description: "Tenant Selection",
1212
component: CippTenantStep,
13-
componentProps: { type: "multiple", valueField: "customerId" },
13+
componentProps: { type: "multiple" },
1414
},
1515
{
1616
title: "Step 2",

src/pages/endpoint/MEM/list-appprotection-policies/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { Layout as DashboardLayout } from "/src/layouts/index.js";
22
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
3-
import { Book } from "@mui/icons-material";
3+
import { Book, RocketLaunch } from "@mui/icons-material";
44
import { TrashIcon } from "@heroicons/react/24/outline";
5+
import { PermissionButton } from "/src/utils/permissions.js";
6+
import Link from "next/link";
57

68
const Page = () => {
79
const pageTitle = "App Protection & Configuration Policies";
10+
const cardButtonPermissions = ["Endpoint.MEM.ReadWrite"];
811

912
const actions = [
1013
{
@@ -58,6 +61,16 @@ const Page = () => {
5861
actions={actions}
5962
offCanvas={offCanvas}
6063
simpleColumns={simpleColumns}
64+
cardButton={
65+
<PermissionButton
66+
requiredPermissions={cardButtonPermissions}
67+
component={Link}
68+
href="/endpoint/MEM/add-policy"
69+
startIcon={<RocketLaunch />}
70+
>
71+
Deploy Policy
72+
</PermissionButton>
73+
}
6174
/>
6275
);
6376
};

src/pages/endpoint/MEM/list-compliance-policies/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { Layout as DashboardLayout } from "/src/layouts/index.js";
22
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
3-
import { Book, LaptopChromebook } from "@mui/icons-material";
3+
import { Book, LaptopChromebook, RocketLaunch } from "@mui/icons-material";
44
import { GlobeAltIcon, TrashIcon, UserIcon } from "@heroicons/react/24/outline";
5+
import { PermissionButton } from "/src/utils/permissions.js";
6+
import Link from "next/link";
57

68
const Page = () => {
79
const pageTitle = "Intune Compliance Policies";
10+
const cardButtonPermissions = ["Endpoint.MEM.ReadWrite"];
811

912
const actions = [
1013
{
@@ -99,6 +102,16 @@ const Page = () => {
99102
actions={actions}
100103
offCanvas={offCanvas}
101104
simpleColumns={simpleColumns}
105+
cardButton={
106+
<PermissionButton
107+
requiredPermissions={cardButtonPermissions}
108+
component={Link}
109+
href="/endpoint/MEM/add-policy"
110+
startIcon={<RocketLaunch />}
111+
>
112+
Deploy Policy
113+
</PermissionButton>
114+
}
102115
/>
103116
);
104117
};

src/pages/endpoint/MEM/list-policies/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { Layout as DashboardLayout } from "/src/layouts/index.js";
22
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
3-
import { Book, LaptopChromebook } from "@mui/icons-material";
3+
import { Book, LaptopChromebook, RocketLaunch } from "@mui/icons-material";
44
import { GlobeAltIcon, TrashIcon, UserIcon } from "@heroicons/react/24/outline";
5+
import { PermissionButton } from "/src/utils/permissions.js";
6+
import Link from "next/link";
57

68
const Page = () => {
79
const pageTitle = "Configuration Policies";
10+
const cardButtonPermissions = ["Endpoint.MEM.ReadWrite"];
811

912
const actions = [
1013
{
@@ -98,6 +101,16 @@ const Page = () => {
98101
actions={actions}
99102
offCanvas={offCanvas}
100103
simpleColumns={simpleColumns}
104+
cardButton={
105+
<PermissionButton
106+
requiredPermissions={cardButtonPermissions}
107+
component={Link}
108+
href="/endpoint/MEM/add-policy"
109+
startIcon={<RocketLaunch />}
110+
>
111+
Deploy Policy
112+
</PermissionButton>
113+
}
101114
/>
102115
);
103116
};

0 commit comments

Comments
 (0)