Skip to content

Conversation

@bolmsten
Copy link
Contributor

@bolmsten bolmsten commented Jul 14, 2025

Description

This PR removes redundant user attributes such as gender, telephone, username, position, placeholder, and birthdate in the backend and frontend of the application.

Motivation and Context

The removal of these attributes simplifies the user model and reduces the amount of unnecessary data stored in the database. This change is necessary as these attributes do not contribute to the core functionality of the application.

Changes

  1. Removed gender, telephone, username, position, placeholder, and birthdate columns from the users table in the database.
  2. Updated the UserDataSource interface to reflect the changes in the user model.
  3. Updated the UserDataSourceMock class to remove references to the deleted attributes.
  4. Updated the OAuthAuthorization class to stop populating the removed attributes.

How Has This Been Tested?

Fixes Jira Issue

https://jira.esss.lu.se/browse/SWAP-4778

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@bolmsten bolmsten requested a review from a team as a code owner July 14, 2025 14:30
@bolmsten bolmsten requested review from EdwardHaynes and removed request for a team July 14, 2025 14:30
@bolmsten bolmsten changed the title feat: remove gender, telephone, username, position, placeholder, birthdate … BREAKING CHANGE: remove gender, telephone, username, position, placeholder, birthdate … Jul 15, 2025
$$
BEGIN
IF register_patch(
'0182_RemoveUserColumns2.sql',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: No need for the numbers, they might go easily out of sync with the file name

Suggested change
'0182_RemoveUserColumns2.sql',
'RemoveUserColumns2.sql',

// Check if email exist in database and if user has been invited before
const user = await this.dataSource.getByEmail(args.email);
if (user && user.placeholder) {
if (user) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: I think this is fine, only now theelse if (user)clause is will never be called, we should probably clean it up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I am awaiting STFC to see if I can delete the whole function

@gnyiri
Copy link
Collaborator

gnyiri commented Jul 16, 2025

How about removing preferred name as well?

@bolmsten
Copy link
Contributor Author

How about removing preferred name as well?

I will raise it again with our user officer, the last time she identified this as a field she wants. Can STFC comment here on this?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

⚠️ Automatic rebase failed due to conflicts. Please rebase manually.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

⚠️ Automatic rebase failed due to conflicts. Please rebase manually.

@github-actions github-actions bot force-pushed the SWAP-4778-View_Only_Profile branch 2 times, most recently from 4055aff to 18f2f45 Compare November 4, 2025 15:16
@github-actions github-actions bot force-pushed the SWAP-4778-View_Only_Profile branch from 18f2f45 to bcac694 Compare November 4, 2025 16:25
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

⚠️ Automatic rebase failed due to conflicts. Please rebase manually.

@github-actions
Copy link
Contributor

⚠️ Automatic rebase failed due to conflicts. Please rebase manually.

institutionRoRId: $institutionRoRId
institutionName: $institutionName
institutionCountry: $institutionCountry
department: $department
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Department can be removed as well @yoganandaness

@github-actions
Copy link
Contributor

⚠️ Automatic rebase failed due to conflicts. Please rebase manually.

Copy link
Contributor

@TCMeldrum TCMeldrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioned on teams but stfc would like to keep the legacy invite feature for the time being UserOfficeProject/issue-tracker#1479

@github-actions
Copy link
Contributor

⚠️ Automatic rebase failed due to conflicts. Please rebase manually.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants