Skip to content

Make EPerson "Contact Telephone" field available for Administrators via GUI - #3740

Open
Im-praveen wants to merge 18 commits into
DSpace:mainfrom
Im-praveen:main
Open

Make EPerson "Contact Telephone" field available for Administrators via GUI#3740
Im-praveen wants to merge 18 commits into
DSpace:mainfrom
Im-praveen:main

Conversation

@Im-praveen

@Im-praveen Im-praveen commented Dec 12, 2024

Copy link
Copy Markdown

References

Description

Adding Phone (Contact Number) provision for EPerson Add/Edit

Instructions for Reviewers

  • EPerson Add/Edit screen will have the Phone as form field for adding a contact number of eperson.

List of changes in this PR:

  • First, Added form field in EPersonFormComponent for Phone.
  • Second, Added a change to EPersonDataService for metadata operations add/replace based on exists/not-exists for eperson.
  • Third, Added key for the same form field under all json5 files under assets/i18n.

@tdonohue tdonohue changed the title fix for #2692 Make EPerson "Contact Telephone" field available for Administrators via GUI Dec 12, 2024
@tdonohue tdonohue added new feature 1 APPROVAL pull request only requires a single approval to merge labels Dec 12, 2024
@nwoodward

Copy link
Copy Markdown
Contributor

Hi @Im-praveen. Thank you for this PR. It looks good on inspection. Can you submit it from some other branch besides main? I'd like to deploy and test it without affecting the primary branch. You could change the name to anything related to the fix or the DSpace issue that it fixes. Thanks!

@MMilosz

MMilosz commented Feb 27, 2025

Copy link
Copy Markdown
Contributor
  • Please add once metadata under metadata registry schema eperson as eperson.phone.

There is no need to add new metadata eperson.phone to the registry, as it already exists in the core DSpace (via dspace/config/registries/eperson-types.xml) since at least 2014, so it should work out of the box 😄

Since users can edit their own email and phone number, and administrators can only edit other users' emails (and full names), I totally see this PR as a useful addition.

I wonder about adding two more things here:

  1. The 'required' status could depend on the configuration (false by default). This would allow repositories to make phone numbers mandatory for users

  2. There could be a configurable regex (no validation by default), allowing administrators to enforce some rules for valid phone numbers. Since there are multiple ITU standards, the same number can be written in various formats, so maybe some repositories would like to maintain some consistency here.

I'd love to hear someone else's thoughts on these to ensure we properly cover everyone's needs regarding this field


Anyways, I’ve tested your changes with sandbox.dspace.org, and they work as expected when editing another eperson as an administrator. However, when I delete the value, the request sends op=REPLACE with an empty string. I wonder if this should be changed to op=REMOVE to completely delete the metadata and avoid storing empty values in the database.

screenshot_20250227174355

When editing the profile of the currently logged-in user, I encountered a bug where any edit results in an error + success notification. I need to press the "Save" button twice to actually save changes. I'm not sure if this issue is related to this PR being on the main branch or if it's caused by something else.

screencast_20250227_171007.mp4

Regarding the code itself, it looks consistent with the rest of the codebase for me, although that's where my frontend experience ends 😄

@github-actions

github-actions Bot commented May 5, 2025

Copy link
Copy Markdown

Hi @Im-praveen,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@github-actions

Copy link
Copy Markdown

Hi @Im-praveen,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@PitbaranK

Copy link
Copy Markdown

@tdonohue,
Kindly help us by reviewing and merging the changes in this pull request.
If you have any feedback or suggestions, please feel free to share. we’re happy to make any necessary adjustments.

@tdonohue

Copy link
Copy Markdown
Member

@PitbaranK : This PR already has unresolved feedback from another developer. See #3740 (comment). Please resolve or respond to their feedback.

Keep in mind, I do not have time myself to review every single PR. Therefore, other developers will volunteer time for reviews/testing.

Im-praveen and others added 3 commits August 20, 2025 11:49
…ors via GUI

- Added translation for `admin.access-control.epeople.form.phone` ("Phone") across all supported language JSON files.
@PitbaranK

Copy link
Copy Markdown

@MMilosz,
Thank you for your review and feedbacks!

  • Please add once metadata under metadata registry schema eperson as eperson.phone.

Above instruction has been added by mistake, which we have corrected now under Instructions for Reviewers. Attached below is the screenshot after incorporating the changes, for your reference, as per the requirements specified in dspace-angular issue #2692.
image

I wonder about adding two more things here:

  1. The 'required' status could depend on the configuration.
  2. There could be a configurable regex.

Against the above feedbacks provided, I think these recommendations are not in the corresponding ticket which are part of the enhancements.

  1. As far as I recall, in earlier DSpace releases the Phone field was also optional. In the DSpace Angular repository, the usage of required: true/false is already implemented directly, with the scope predefined as optional where applicable.
  2. Regarding validation, the Phone field does not adhere to any predefined ITU standards under DSpace regularities. Moreover, the value entered is simply stored without being utilized in any subsequent process or workflow.

when I delete the value, the request sends op=REPLACE with an empty string. I wonder if this should be changed to op=REMOVE to completely delete the metadata and avoid storing empty values in the database.

The above approach is not feasible because a user may update any field value, and such updates need to be handled within the same call. Even if a field value is removed, the request will still invoke op=REPLACE to update the corresponding value with the existing data. Therefore, we do not see any valid use case for using op=REMOVE in this context.

When editing the profile of the currently logged-in user, I encountered a bug where any edit results in an error + success notification. I need to press the "Save" button twice to actually save changes. I'm not sure if this issue is related to this PR being on the main branch or if it's caused by something else.

The bug you mentioned appears to be non-reproducible and does not seem to have any connection with the changes introduced in this PR. Please check the attached video for your reference.
https://github.com/user-attachments/assets/119aff21-cba2-4804-bdd7-af7805cf7018

Thank you once again for your review and valuable feedback. Could you kindly take another look and get back on the same?

@github-actions

Copy link
Copy Markdown

Hi @Im-praveen,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge improvement low priority

Projects

Status: 👀 Under Review

Development

Successfully merging this pull request may close these issues.

Make EPerson "Contact Telephone" field available for Administrators via GUI

6 participants