Skip to content

Commit cfb5735

Browse files
committed
netID input field
1 parent 993c89a commit cfb5735

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
116116
firstName: DynamicInputModel;
117117
lastName: DynamicInputModel;
118118
email: DynamicInputModel;
119+
netid: DynamicInputModel;
119120
// booleans
120121
canLogIn: DynamicCheckboxModel;
121122
requireCertificate: DynamicCheckboxModel;
@@ -144,6 +145,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
144145
host: 'row',
145146
},
146147
},
148+
netid: {
149+
grid: {
150+
host: 'row',
151+
},
152+
},
147153
canLogIn: {
148154
grid: {
149155
host: 'col col-sm-6 d-inline-block',
@@ -318,6 +324,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
318324
},
319325
hint: this.translateService.instant(`${this.messagePrefix}.emailHint`),
320326
});
327+
this.netid = new DynamicInputModel({
328+
id: 'netid',
329+
label: this.translateService.instant(`${this.messagePrefix}.netid`),
330+
name: 'netid',
331+
required: false,
332+
});
321333
this.canLogIn = new DynamicCheckboxModel(
322334
{
323335
id: 'canLogIn',
@@ -336,6 +348,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
336348
this.firstName,
337349
this.lastName,
338350
this.email,
351+
this.netid,
339352
this.canLogIn,
340353
this.requireCertificate,
341354
];
@@ -351,6 +364,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
351364
firstName: eperson != null ? eperson.firstMetadataValue('eperson.firstname') : '',
352365
lastName: eperson != null ? eperson.firstMetadataValue('eperson.lastname') : '',
353366
email: eperson != null ? eperson.email : '',
367+
netid: eperson != null ? eperson.netid : '',
354368
canLogIn: eperson != null ? eperson.canLogIn : true,
355369
requireCertificate: eperson != null ? eperson.requireCertificate : false,
356370
});
@@ -429,6 +443,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
429443
],
430444
},
431445
email: this.email.value,
446+
netid: this.netid.value,
432447
canLogIn: this.canLogIn.value,
433448
requireCertificate: this.requireCertificate.value,
434449
};
@@ -486,6 +501,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
486501
],
487502
},
488503
email: (hasValue(values.email) ? values.email : ePerson.email),
504+
netid: (hasValue(values.netid) ? values.netid : ePerson.netid),
489505
canLogIn: (hasValue(values.canLogIn) ? values.canLogIn : ePerson.canLogIn),
490506
requireCertificate: (hasValue(values.requireCertificate) ? values.requireCertificate : ePerson.requireCertificate),
491507
_links: ePerson._links,

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@
327327

328328
"admin.access-control.epeople.form.emailHint": "Must be a valid email address",
329329

330+
"admin.access-control.epeople.form.netid": "Net ID",
331+
330332
"admin.access-control.epeople.form.canLogIn": "Can log in",
331333

332334
"admin.access-control.epeople.form.requireCertificate": "Requires certificate",

0 commit comments

Comments
 (0)