From 53f8b6e79477db62b1833d48ca92278b217b6a9c Mon Sep 17 00:00:00 2001 From: iam-vir-harshit Date: Wed, 11 Dec 2024 19:58:35 +0530 Subject: [PATCH] Revert "fix for #2692" This reverts commit 3d763c909a9e3a317a064531d3b7ea2d39bb3e81. --- .../eperson-form/eperson-form.component.ts | 24 ------------------- src/app/core/eperson/eperson-data.service.ts | 2 +- src/assets/i18n/en.json5 | 2 -- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts index e0c1a8ff0ee..8aa7f152501 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts @@ -118,7 +118,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { firstName: DynamicInputModel; lastName: DynamicInputModel; email: DynamicInputModel; - phone: DynamicInputModel; // booleans canLogIn: DynamicCheckboxModel; requireCertificate: DynamicCheckboxModel; @@ -147,11 +146,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { host: 'row', }, }, - phone: { - grid: { - host: 'row', - }, - }, canLogIn: { grid: { host: 'col col-sm-6 d-inline-block', @@ -322,12 +316,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { }, hint: this.translateService.instant(`${this.messagePrefix}.emailHint`), }); - this.phone = new DynamicInputModel({ - id: 'phone', - label: this.translateService.instant(`${this.messagePrefix}.phone`), - name: 'phone', - required: false, - }); this.canLogIn = new DynamicCheckboxModel( { id: 'canLogIn', @@ -346,7 +334,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { this.firstName, this.lastName, this.email, - this.phone, this.canLogIn, this.requireCertificate, ]; @@ -362,7 +349,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { firstName: eperson != null ? eperson.firstMetadataValue('eperson.firstname') : '', lastName: eperson != null ? eperson.firstMetadataValue('eperson.lastname') : '', email: eperson != null ? eperson.email : '', - phone: eperson != null ? eperson.firstMetadataValue('eperson.phone') : '', canLogIn: eperson != null ? eperson.canLogIn : true, requireCertificate: eperson != null ? eperson.requireCertificate : false, }); @@ -439,11 +425,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { value: this.lastName.value, }, ], - 'eperson.phone': [ - { - value: this.phone.value, - }, - ], }, email: this.email.value, canLogIn: this.canLogIn.value, @@ -501,11 +482,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy { value: (this.lastName.value ? this.lastName.value : ePerson.firstMetadataValue('eperson.lastname')), }, ], - 'eperson.phone': [ - { - value: this.phone.value, - }, - ], }, email: (hasValue(values.email) ? values.email : ePerson.email), canLogIn: (hasValue(values.canLogIn) ? values.canLogIn : ePerson.canLogIn), diff --git a/src/app/core/eperson/eperson-data.service.ts b/src/app/core/eperson/eperson-data.service.ts index 0c61e918fe9..0de6de7407e 100644 --- a/src/app/core/eperson/eperson-data.service.ts +++ b/src/app/core/eperson/eperson-data.service.ts @@ -269,7 +269,7 @@ export class EPersonDataService extends IdentifiableDataService impleme * @param newEPerson */ private generateOperations(oldEPerson: EPerson, newEPerson: EPerson): Operation[] { - let operations = this.comparator.diff(oldEPerson, newEPerson).filter((operation: Operation) => operation.op === 'replace' || operation.op === 'add'); + let operations = this.comparator.diff(oldEPerson, newEPerson).filter((operation: Operation) => operation.op === 'replace'); if (hasValue(oldEPerson.email) && oldEPerson.email !== newEPerson.email) { operations = [...operations, { op: 'replace', path: '/email', value: newEPerson.email, diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 56f09115d0c..532fc849ffc 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -316,8 +316,6 @@ "admin.access-control.epeople.form.email": "Email", - "admin.access-control.epeople.form.phone" : "Phone", - "admin.access-control.epeople.form.emailHint": "Must be a valid email address", "admin.access-control.epeople.form.canLogIn": "Can log in",