@@ -42,34 +42,22 @@ const OffboardingWizard = () => {
42
42
43
43
const [ genericPostRequest , postResults ] = useLazyGenericPostRequestQuery ( )
44
44
45
- const handleSubmit = async ( values ) => {
45
+ const handleSubmit = ( values ) => {
46
+ const startDate = new Date ( )
47
+ const unixTime = Math . floor ( startDate . getTime ( ) / 1000 ) - 45
46
48
const shippedValues = {
47
49
TenantFilter : tenantDomain ,
48
- OOO : values . OOO ? values . OOO : '' ,
49
- forward : values . forward ? values . forward . value : '' ,
50
- OnedriveAccess : values . OnedriveAccess ? values . OnedriveAccess : '' ,
51
- AccessNoAutomap : values . AccessNoAutomap ? values . AccessNoAutomap : '' ,
52
- AccessAutomap : values . AccessAutomap ? values . AccessAutomap : '' ,
53
- ConvertToShared : values . ConvertToShared ,
54
- HideFromGAL : values . HideFromGAL ,
55
- DisableSignIn : values . DisableSignIn ,
56
- RemoveGroups : values . RemoveGroups ,
57
- RemoveLicenses : values . RemoveLicenses ,
58
- ResetPass : values . ResetPass ,
59
- RevokeSessions : values . RevokeSessions ,
60
- user : values . User ,
61
- deleteuser : values . DeleteUser ,
62
- removeRules : values . RemoveRules ,
63
- removeMobile : values . RemoveMobile ,
64
- keepCopy : values . keepCopy ,
65
- removePermissions : values . removePermissions ,
66
- PostExecution : values . Scheduled ?. enabled
67
- ? { webhook : values . webhook , psa : values . psa , email : values . email }
68
- : '' ,
50
+ Name : `CIPP Restore ${ tenantDomain } ` ,
51
+ Command : { value : `New-CIPPRestore` } ,
52
+ Parameters : { Type : 'Scheduled' , ScheduledBackupValues : { ...values } } ,
53
+ ScheduledTime : unixTime ,
54
+ PostExecution : {
55
+ Webhook : values . webhook ,
56
+ Email : values . email ,
57
+ PSA : values . psa ,
58
+ } ,
69
59
}
70
-
71
- //alert(JSON.stringify(values, null, 2))
72
- genericPostRequest ( { path : '/api/ExecOffboardUser' , values : shippedValues } )
60
+ genericPostRequest ( { path : '/api/AddScheduledItem' , values : shippedValues } ) . then ( ( res ) => { } )
73
61
}
74
62
75
63
return (
@@ -101,7 +89,7 @@ const OffboardingWizard = () => {
101
89
name : `${ backup . RowKey } ` ,
102
90
} ) ) }
103
91
placeholder = { ! currentBackupsIsFetching ? 'Select a backup' : 'Loading...' }
104
- name = "User "
92
+ name = "backup "
105
93
/>
106
94
{ currentBackupsError && < span > Failed to load list of Current Backups</ span > }
107
95
</ div >
@@ -117,44 +105,53 @@ const OffboardingWizard = () => {
117
105
< CRow >
118
106
< CCol >
119
107
< h3 className = "underline mb-4" > Identity</ h3 >
120
- < RFFCFormSwitch label = "User List" />
121
- < RFFCFormSwitch label = "Groups" />
108
+ < RFFCFormSwitch name = "users" label = "User List" />
109
+ < RFFCFormSwitch name = "groups" label = "Groups" />
122
110
< h3 className = "underline mb-4" > Conditional Access</ h3 >
123
- < RFFCFormSwitch label = "Conditional Access" />
124
- < RFFCFormSwitch label = "Named Locations" />
125
- < RFFCFormSwitch label = "Authentication Strengths" />
111
+ < RFFCFormSwitch name = "ca" label = "Conditional Access" />
112
+ < RFFCFormSwitch name = "namedlocations" label = "Named Locations" />
113
+ < RFFCFormSwitch name = "authstrengths" label = "Authentication Strengths" />
126
114
</ CCol >
127
115
< CCol >
128
116
< h3 className = "underline mb-4" > Intune</ h3 >
129
- < RFFCFormSwitch label = "Intune Configuration Policies" />
130
- < RFFCFormSwitch label = "Intune Compliance Policies" />
131
- < RFFCFormSwitch label = "Intune Protection Policies" />
117
+ < RFFCFormSwitch name = "intuneconfig" label = "Intune Configuration Policies" />
118
+ < RFFCFormSwitch name = "intunecompliance" label = "Intune Compliance Policies" />
119
+ < RFFCFormSwitch name = "intuneprotection" label = "Intune Protection Policies" />
132
120
< h3 className = "underline mb-4" > CIPP</ h3 >
133
- < RFFCFormSwitch label = "Alerts Configuration" />
134
- < RFFCFormSwitch label = "Standards Configuration" />
121
+ < RFFCFormSwitch name = "CippAlerts" label = "Alerts Configuration" />
122
+ < RFFCFormSwitch name = "CippStandards" label = "Standards Configuration" />
135
123
</ CCol >
136
124
</ CRow >
137
125
< hr className = "my-4" />
138
126
< CRow >
139
127
< CCol >
140
128
< RFFCFormSwitch name = "overwrite" label = "Overwrite existing entries" />
141
129
</ CCol >
142
- </ CRow >
143
- < Condition when = "overwrite" is = { true } >
144
- < CippCallout color = "warning" >
145
- < h5 > Warning</ h5 >
146
- < p >
147
- Overwriting existing entries will remove the current settings and replace them with
148
- the backup settings. If you have selected to restore users, all properties will be
149
- overwritten with the backup settings.
150
- </ p >
130
+ < Condition when = "overwrite" is = { true } >
131
+ < CippCallout color = "warning" >
132
+ < h5 > Warning</ h5 >
133
+ < p >
134
+ Overwriting existing entries will remove the current settings and replace them
135
+ with the backup settings. If you have selected to restore users, all properties
136
+ will be overwritten with the backup settings.
137
+ </ p >
151
138
152
- < p >
153
- To prevent and skip already existing entries, deselect the setting from the list
154
- above, or disable overwrite.
155
- </ p >
156
- </ CippCallout >
157
- </ Condition >
139
+ < p >
140
+ To prevent and skip already existing entries, deselect the setting from the list
141
+ above, or disable overwrite.
142
+ </ p >
143
+ </ CippCallout >
144
+ </ Condition >
145
+ </ CRow >
146
+ < hr className = "my-4" />
147
+ < CRow >
148
+ < CCol >
149
+ < label > Send Restore results to:</ label >
150
+ < RFFCFormSwitch name = "webhook" label = "Webhook" />
151
+ < RFFCFormSwitch name = "email" label = "E-mail" />
152
+ < RFFCFormSwitch name = "psa" label = "PSA" />
153
+ </ CCol >
154
+ </ CRow >
158
155
</ div >
159
156
< hr className = "my-4" />
160
157
</ CippWizard . Page >
@@ -170,13 +167,7 @@ const OffboardingWizard = () => {
170
167
< CSpinner > Loading</ CSpinner >
171
168
</ CCallout >
172
169
) }
173
- { postResults . isSuccess && (
174
- < CCallout color = "success" >
175
- { postResults . data . Results . map ( ( message , idx ) => {
176
- return < li key = { idx } > { message } </ li >
177
- } ) }
178
- </ CCallout >
179
- ) }
170
+ { postResults . isSuccess && < CCallout color = "success" > { postResults . data . Results } </ CCallout > }
180
171
{ ! postResults . isSuccess && (
181
172
< FormSpy >
182
173
{ /* eslint-disable react/prop-types */ }
@@ -189,6 +180,10 @@ const OffboardingWizard = () => {
189
180
< h5 className = "mb-0" > Selected Tenant:</ h5 >
190
181
{ tenantDomain }
191
182
</ CListGroupItem >
183
+ < CListGroupItem className = "d-flex justify-content-between align-items-center" >
184
+ < h5 className = "mb-0" > Selected Backup:</ h5 >
185
+ { props . values . backup . value }
186
+ </ CListGroupItem >
192
187
</ CListGroup >
193
188
< hr />
194
189
</ CCol >
@@ -197,123 +192,35 @@ const OffboardingWizard = () => {
197
192
< CCol md = { { span : 6 , offset : 3 } } >
198
193
< CListGroup flush >
199
194
< CListGroupItem className = "d-flex justify-content-between align-items-center" >
200
- Revoke Sessions
201
- < FontAwesomeIcon
202
- color = "#f77f00"
203
- size = "lg"
204
- icon = { props . values . RevokeSessions ? faCheck : faTimes }
205
- />
206
- </ CListGroupItem >
207
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
208
- Remove all mobile devices
209
- < FontAwesomeIcon
210
- color = "#f77f00"
211
- size = "lg"
212
- icon = { props . values . RemoveMobile ? faCheck : faTimes }
213
- />
214
- </ CListGroupItem >
215
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
216
- Remove all mailbox rules
217
- < FontAwesomeIcon
218
- color = "#f77f00"
219
- size = "lg"
220
- icon = { props . values . RemoveRules ? faCheck : faTimes }
221
- />
222
- </ CListGroupItem >
223
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
224
- Remove all mailbox permissions
225
- < FontAwesomeIcon
226
- color = "#f77f00"
227
- size = "lg"
228
- icon = { props . values . removePermissions ? faCheck : faTimes }
229
- />
230
- </ CListGroupItem >
231
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
232
- Remove Licenses
233
- < FontAwesomeIcon
234
- color = "#f77f00"
235
- size = "lg"
236
- icon = { props . values . RemoveLicenses ? faCheck : faTimes }
237
- />
238
- </ CListGroupItem >
239
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
240
- Convert to Shared
241
- < FontAwesomeIcon
242
- color = "#f77f00"
243
- size = "lg"
244
- icon = { props . values . ConvertToShared ? faCheck : faTimes }
245
- />
246
- </ CListGroupItem >
247
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
248
- Disable Sign-in
249
- < FontAwesomeIcon
250
- color = "#f77f00"
251
- size = "lg"
252
- icon = { props . values . DisableSignIn ? faCheck : faTimes }
253
- />
254
- </ CListGroupItem >
255
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
256
- Reset Password
257
- < FontAwesomeIcon
258
- color = "#f77f00"
259
- size = "lg"
260
- icon = { props . values . ResetPass ? faCheck : faTimes }
261
- />
262
- </ CListGroupItem >
263
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
264
- Remove from all groups
265
- < FontAwesomeIcon
266
- color = "#f77f00"
267
- size = "lg"
268
- icon = { props . values . RemoveGroups ? faCheck : faTimes }
269
- />
270
- </ CListGroupItem >
271
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
272
- Hide from Global Address List
273
- < FontAwesomeIcon
274
- color = "#f77f00"
275
- size = "lg"
276
- icon = { props . values . HideFromGAL ? faCheck : faTimes }
277
- />
278
- </ CListGroupItem >
279
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
280
- Set Out of Office
281
- < FontAwesomeIcon
282
- color = "#f77f00"
283
- size = "lg"
284
- icon = { props . values . OOO ? faCheck : faTimes }
285
- />
286
- </ CListGroupItem >
287
- < CListGroupItem className = "d-flex justify-content-between align-items-center" >
288
- Give another user access to the mailbox with automap
195
+ Overwrite existing configuration
289
196
< FontAwesomeIcon
290
197
color = "#f77f00"
291
198
size = "lg"
292
- icon = { props . values . AccessAutomap ? faCheck : faTimes }
199
+ icon = { props . values . overwrite ? faCheck : faTimes }
293
200
/>
294
201
</ CListGroupItem >
295
202
< CListGroupItem className = "d-flex justify-content-between align-items-center" >
296
- Give another user access to the mailbox without automap
203
+ Send results to Webhook
297
204
< FontAwesomeIcon
298
205
color = "#f77f00"
299
206
size = "lg"
300
- icon = { props . values . AccessNoAutomap ? faCheck : faTimes }
207
+ icon = { props . values . webhook ? faCheck : faTimes }
301
208
/>
302
209
</ CListGroupItem >
303
210
< CListGroupItem className = "d-flex justify-content-between align-items-center" >
304
- Give another user access to OneDrive
211
+ Send results to E-Mail
305
212
< FontAwesomeIcon
306
213
color = "#f77f00"
307
214
size = "lg"
308
- icon = { props . values . OnedriveAccess ? faCheck : faTimes }
215
+ icon = { props . values . email ? faCheck : faTimes }
309
216
/>
310
217
</ CListGroupItem >
311
218
< CListGroupItem className = "d-flex justify-content-between align-items-center" >
312
- Forward all e-mail to another user
219
+ Send results to PSA
313
220
< FontAwesomeIcon
314
221
color = "#f77f00"
315
222
size = "lg"
316
- icon = { props . values . forward ? faCheck : faTimes }
223
+ icon = { props . values . psa ? faCheck : faTimes }
317
224
/>
318
225
</ CListGroupItem >
319
226
</ CListGroup >
0 commit comments