@@ -65,7 +65,7 @@ import {
65
65
import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas'
66
66
import ReportImage from 'src/components/utilities/ReportImage'
67
67
import { useLoadClientPrincipalQuery } from 'src/store/api/auth'
68
- import { setOffboardingDefaults } from 'src/store/features/app'
68
+ import { setOffboardingDefaults , setNewUserDefaults } from 'src/store/features/app'
69
69
70
70
const Offcanvas = ( row , rowIndex , formatExtraData ) => {
71
71
const [ ExecuteGetRequest , getResults ] = useLazyGenericGetRequestQuery ( )
@@ -122,13 +122,88 @@ const Offcanvas = (row, rowIndex, formatExtraData) => {
122
122
}
123
123
124
124
const UserSettings = ( ) => {
125
+ const tenant = useSelector ( ( state ) => state . app . currentTenant )
126
+ const [ addedAttributes , setAddedAttribute ] = React . useState ( 0 )
127
+ const [ random3 , setRandom3 ] = useState ( '' )
128
+ const availableProperties = useGenericGetRequestQuery ( {
129
+ path : '/api/ListGraphRequest' ,
130
+ params : {
131
+ Endpoint : 'users' ,
132
+ ListProperties : true ,
133
+ TenantFilter : tenant . defaultDomainName ,
134
+ IgnoreErrors : true ,
135
+ } ,
136
+ } )
137
+ const exclusionList = [
138
+ 'id' ,
139
+ 'accountEnabled' ,
140
+ 'deletedDateTime' ,
141
+ 'ageGroup' ,
142
+ 'businessPhones' ,
143
+ 'city' ,
144
+ 'createdDateTime' ,
145
+ 'creationType' ,
146
+ 'companyName' ,
147
+ 'country' ,
148
+ 'department' ,
149
+ 'displayName' ,
150
+ 'givenName' ,
151
+ 'imAddresses' ,
152
+ 'infoCatalogs' ,
153
+ 'isLicenseReconciliationNeeded' ,
154
+ 'isManagementRestricted' ,
155
+ 'isResourceAccount' ,
156
+ 'jobTitle' ,
157
+ 'mail' ,
158
+ 'mailNickname' ,
159
+ 'mobilePhone' ,
160
+ 'onPremisesDistinguishedName' ,
161
+ 'onPremisesDomainName' ,
162
+ 'onPremisesImmutableId' ,
163
+ 'onPremisesLastSyncDateTime' ,
164
+ 'onPremisesObjectIdentifier' ,
165
+ 'onPremisesSecurityIdentifier' ,
166
+ 'onPremisesSamAccountName' ,
167
+ 'onPremisesSyncEnabled' ,
168
+ 'onPremisesUserPrincipalName' ,
169
+ 'passwordPolicies' ,
170
+ 'postalCode' ,
171
+ 'preferredDataLocation' ,
172
+ 'preferredLanguage' ,
173
+ 'proxyAddresses' ,
174
+ 'refreshTokensValidFromDateTime' ,
175
+ 'securityIdentifier' ,
176
+ 'signInSessionsValidFromDateTime' ,
177
+ 'streetAddress' ,
178
+ 'surname' ,
179
+ 'usageLocation' ,
180
+ 'userPrincipalName' ,
181
+ 'externalUserConvertedOn' ,
182
+ 'externalUserState' ,
183
+ 'externalUserStateChangeDateTime' ,
184
+ 'userType' ,
185
+ 'employeeOrgData' ,
186
+ 'assignedLicenses' ,
187
+ 'assignedPlans' ,
188
+ 'authorizationInfo' ,
189
+ 'cloudRealtimeCommunicationInfo' ,
190
+ 'deviceKeys' ,
191
+ 'identities' ,
192
+ 'onPremisesExtensionAttributes' ,
193
+ 'onPremisesProvisioningErrors' ,
194
+ 'onPremisesSipInfo' ,
195
+ 'passwordProfile' ,
196
+ 'provisionedPlans' ,
197
+ 'serviceProvisioningErrors' ,
198
+ ]
125
199
const [ genericPostRequest , postResults ] = useLazyGenericPostRequestQuery ( )
126
200
const { data : profile , isFetching, isLoading } = useLoadClientPrincipalQuery ( )
127
201
const dispatch = useDispatch ( )
128
202
const currentSettings = useSelector ( ( state ) => state . app )
129
203
130
204
const onSubmit = ( values ) => {
131
205
dispatch ( setOffboardingDefaults ( { offboardingDefaults : values } ) )
206
+ dispatch ( setNewUserDefaults ( { NewUserDefaults : values . name } ) )
132
207
const shippedvalues = {
133
208
user : values . user ,
134
209
currentSettings : currentSettings ,
@@ -201,6 +276,51 @@ const UserSettings = () => {
201
276
/>
202
277
</ CCol >
203
278
</ CRow >
279
+ < CRow className = "mb-3" >
280
+ < h3 className = "underline mb-5" > New User Attribute Defaults</ h3 >
281
+ < div className = "mb-3" >
282
+ < RFFSelectSearch
283
+ name = "Attribute Name"
284
+ label = "Select the attributes you want to use"
285
+ placeholder = "Select the attributes you want to use"
286
+ retainInput = { true }
287
+ multi = { true }
288
+ values = {
289
+ availableProperties ?. data ?. Results ?. filter (
290
+ ( prop ) => ! exclusionList . includes ( prop ) ,
291
+ ) ?. map ( ( prop ) => ( {
292
+ name : prop ,
293
+ value : prop ,
294
+ } ) ) ?? [ ]
295
+ }
296
+ allowCreate = { true }
297
+ refreshFunction = { ( ) =>
298
+ setRandom3 ( ( Math . random ( ) + 1 ) . toString ( 36 ) . substring ( 7 ) )
299
+ }
300
+ isLoading = { availableProperties . isFetching }
301
+ />
302
+ </ div >
303
+ < CRow >
304
+ < CCol className = "mb-3" md = { 12 } >
305
+ { addedAttributes > 0 && (
306
+ < CButton
307
+ onClick = { ( ) => setAddedAttribute ( addedAttributes - 1 ) }
308
+ className = { `circular-button` }
309
+ title = { '-' }
310
+ >
311
+ < FontAwesomeIcon icon = { 'minus' } />
312
+ </ CButton >
313
+ ) }
314
+ < CButton
315
+ onClick = { ( ) => setAddedAttribute ( addedAttributes + 1 ) }
316
+ className = { `circular-button` }
317
+ title = { '+' }
318
+ >
319
+ < FontAwesomeIcon icon = { 'plus' } />
320
+ </ CButton >
321
+ </ CCol >
322
+ </ CRow >
323
+ </ CRow >
204
324
< CRow className = "mb-3" >
205
325
< CCol className = "mb-3" md = { 6 } >
206
326
< CButton
0 commit comments