Skip to content

Commit 844f51c

Browse files
authored
Merge branch 'dev' into standards
Signed-off-by: John Duprey <[email protected]>
2 parents 8602d02 + e499247 commit 844f51c

File tree

35 files changed

+370
-155
lines changed

35 files changed

+370
-155
lines changed

.github/workflows/cipp_dev_build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ jobs:
1818
uses: actions/[email protected]
1919

2020
# Set up Node.js
21+
- name: Get Node version
22+
id: get_node_version
23+
run: |
24+
node_raw_version=$(node -p "require('./package.json').engines.node")
25+
node_sanitized_version=$(echo $node_raw_version | sed -E 's/[^0-9.]+//g')
26+
echo "node_version=$node_sanitized_version" >> $GITHUB_OUTPUT
27+
2128
- name: Set up Node.js
2229
uses: actions/[email protected]
2330
with:
24-
node-version: '20.18.1'
31+
node-version: ${{ steps.get_node_version.outputs.node_version }}
2532

2633
# Install dependencies
2734
- name: Install Dependencies

.github/workflows/cipp_frontend_build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ jobs:
1818
uses: actions/[email protected]
1919

2020
# Set up Node.js
21+
- name: Get Node version
22+
id: get_node_version
23+
run: |
24+
node_raw_version=$(node -p "require('./package.json').engines.node")
25+
node_sanitized_version=$(echo $node_raw_version | sed -E 's/[^0-9.]+//g')
26+
echo "node_version=$node_sanitized_version" >> $GITHUB_OUTPUT
27+
2128
- name: Set up Node.js
2229
uses: actions/[email protected]
2330
with:
24-
node-version: '20.18.1'
31+
node-version: ${{ steps.get_node_version.outputs.node_version }}
2532

2633
# Install dependencies
2734
- name: Install Dependencies

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"license": "AGPL-3.0",
1010
"engines": {
11-
"node": "^20.18.1"
11+
"node": "^22.13.0"
1212
},
1313
"repository": {
1414
"type": "git",

src/components/CippComponents/CippFormComponent.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const CippFormComponent = (props) => {
4343
name, // The name that may have bracket notation
4444
label,
4545
labelLocation = "behind", // Default location for switches
46+
defaultValue,
4647
...other
4748
} = props;
4849
const { errors } = useFormState({ control: formControl.control });
@@ -121,6 +122,7 @@ export const CippFormComponent = (props) => {
121122
{...other}
122123
{...formControl.register(convertedName, { ...validators })}
123124
label={label}
125+
defaultValue={defaultValue}
124126
/>
125127
</div>
126128
<Typography variant="subtitle3" color="error">
@@ -156,6 +158,7 @@ export const CippFormComponent = (props) => {
156158
{...other}
157159
{...formControl.register(convertedName, { ...validators })}
158160
label={label}
161+
defaultValue={defaultValue}
159162
/>
160163
</div>
161164
<Typography variant="subtitle3" color="error">
@@ -171,6 +174,7 @@ export const CippFormComponent = (props) => {
171174
<Controller
172175
name={convertedName}
173176
control={formControl.control}
177+
defaultValue={defaultValue}
174178
render={({ field }) =>
175179
renderSwitchWithLabel(
176180
<Switch

src/components/CippComponents/CippUserActions.jsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const CippUserActions = () => {
5353
//tested
5454

5555
label: "Create Temporary Access Password",
56-
type: "GET",
56+
type: "POST",
5757
icon: <Password />,
5858
url: "/api/ExecCreateTAP",
5959
data: { ID: "userPrincipalName" },
@@ -63,7 +63,7 @@ export const CippUserActions = () => {
6363
{
6464
//tested
6565
label: "Re-require MFA registration",
66-
type: "GET",
66+
type: "POST",
6767
icon: <PhonelinkSetup />,
6868
url: "/api/ExecResetMFA",
6969
data: { ID: "userPrincipalName" },
@@ -107,26 +107,26 @@ export const CippUserActions = () => {
107107
{
108108
//tested
109109
label: "Convert to Shared Mailbox",
110-
type: "GET",
110+
type: "POST",
111111
icon: <Email />,
112-
url: "/api/ExecConvertToSharedMailbox",
113-
data: { ID: "userPrincipalName" },
112+
url: "/api/ExecConvertMailbox",
113+
data: { ID: "userPrincipalName", MailboxType: "!Shared" },
114114
confirmText: "Are you sure you want to convert this user to a shared mailbox?",
115115
multiPost: false,
116116
},
117117
{
118118
label: "Convert to User Mailbox",
119-
type: "GET",
119+
type: "POST",
120120
icon: <Email />,
121-
url: "/api/ExecConvertToSharedMailbox",
122-
data: { ID: "userPrincipalName", ConvertToUser: true },
121+
url: "/api/ExecConvertMailbox",
122+
data: { ID: "userPrincipalName", MailboxType: "!Regular" },
123123
confirmText: "Are you sure you want to convert this user to a user mailbox?",
124124
multiPost: false,
125125
},
126126
{
127127
//tested
128128
label: "Enable Online Archive",
129-
type: "GET",
129+
type: "POST",
130130
icon: <Archive />,
131131
url: "/api/ExecEnableArchive",
132132
data: { ID: "userPrincipalName" },
@@ -237,7 +237,7 @@ export const CippUserActions = () => {
237237
},
238238
{
239239
label: "Block Sign In",
240-
type: "GET",
240+
type: "POST",
241241
icon: <Block />,
242242
url: "/api/ExecDisableUser",
243243
data: { ID: "id" },
@@ -247,7 +247,7 @@ export const CippUserActions = () => {
247247
},
248248
{
249249
label: "Unblock Sign In",
250-
type: "GET",
250+
type: "POST",
251251
icon: <LockOpen />,
252252
url: "/api/ExecDisableUser",
253253
data: { ID: "id", Enable: true },
@@ -257,7 +257,7 @@ export const CippUserActions = () => {
257257
},
258258
{
259259
label: "Reset Password (Must Change)",
260-
type: "GET",
260+
type: "POST",
261261
icon: <LockReset />,
262262
url: "/api/ExecResetPass",
263263
data: {
@@ -271,7 +271,7 @@ export const CippUserActions = () => {
271271
},
272272
{
273273
label: "Reset Password",
274-
type: "GET",
274+
type: "POST",
275275
icon: <LockReset />,
276276
url: "/api/ExecResetPass",
277277
data: {
@@ -296,7 +296,7 @@ export const CippUserActions = () => {
296296
},
297297
{
298298
label: "Revoke all user sessions",
299-
type: "GET",
299+
type: "POST",
300300
icon: <PersonOff />,
301301
url: "/api/ExecRevokeSessions",
302302
data: { ID: "id", Username: "userPrincipalName" },
@@ -305,7 +305,7 @@ export const CippUserActions = () => {
305305
},
306306
{
307307
label: "Delete User",
308-
type: "GET",
308+
type: "POST",
309309
icon: <TrashIcon />,
310310
url: "/api/RemoveUser",
311311
data: { ID: "id" },

src/components/CippStandards/CippStandardDialog.jsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { differenceInDays } from 'date-fns';
12
import {
23
Dialog,
34
DialogActions,
@@ -47,6 +48,12 @@ const CippStandardDialog = ({
4748
[]
4849
);
4950

51+
const isNewStandard = (dateAdded) => {
52+
const currentDate = new Date();
53+
const addedDate = new Date(dateAdded);
54+
return differenceInDays(currentDate, addedDate) <= 30;
55+
};
56+
5057
return (
5158
<Dialog
5259
open={dialogOpen}
@@ -86,8 +93,17 @@ const CippStandardDialog = ({
8693
display: "flex",
8794
flexDirection: "column",
8895
height: "100%",
96+
position: "relative",
8997
}}
9098
>
99+
{isNewStandard(standard.addedDate) && (
100+
<Chip
101+
label="New"
102+
size="small"
103+
color="success"
104+
sx={{ position: "absolute"}}
105+
/>
106+
)}
91107
<CardContent sx={{ flexGrow: 1 }}>
92108
<Typography variant="h6" gutterBottom>
93109
{standard.label}
@@ -151,6 +167,18 @@ const CippStandardDialog = ({
151167
</Typography>
152168
</>
153169
)}
170+
{standard.addedDate?.length > 0 && (
171+
<>
172+
<Typography variant="subtitle2" sx={{ mt: 2 }}>
173+
Date Added:
174+
</Typography>
175+
<Box sx={{ display: "flex", alignItems: "center" }}>
176+
<Typography variant="body2" color="textSecondary">
177+
{standard.addedDate}
178+
</Typography>
179+
</Box>
180+
</>
181+
)}
154182
</CardContent>
155183

156184
<CardContent>

0 commit comments

Comments
 (0)