From 9d17adf0c5780d0775545f2a869cc245d56aa146 Mon Sep 17 00:00:00 2001 From: "David P. Steelman" Date: Wed, 6 Nov 2024 09:05:04 -0500 Subject: [PATCH] LIBDRUM-890. Suppress "Researcher Profile" panel on "Update Profile" This code change to suppress the "Researcher Profile" panel on the "Update Profile" page is taken from commit "ded0079" of dspace-angular pull request 3585. Customization markers have been added to indicate that the changes came from a stock DSpace pull request, and can be removed when DRUM is upgraded to a version incorporating the changes. https://umd-dit.atlassian.net/browse/LIBDRUM-890 --- .../profile-page/profile-page.component.html | 10 +++++++- .../profile-page.component.spec.ts | 24 ++++++++++++++++--- .../profile-page/profile-page.component.ts | 18 +++++++++----- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/app/profile-page/profile-page.component.html b/src/app/profile-page/profile-page.component.html index 331c3600543..5d6a545fd35 100644 --- a/src/app/profile-page/profile-page.component.html +++ b/src/app/profile-page/profile-page.component.html @@ -1,7 +1,15 @@

{{'profile.title' | translate}}

- + + + +
{{'profile.card.researcher' | translate}}
diff --git a/src/app/profile-page/profile-page.component.spec.ts b/src/app/profile-page/profile-page.component.spec.ts index 709ed56790a..d9376898730 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -320,7 +320,13 @@ describe('ProfilePageComponent', () => { }); it('should return true', () => { - const result = component.isResearcherProfileEnabled(); + // UMD Customization + // This change is from dspace-angular Pull Request 3585, specifically + // commit hash "ded0079". + // This customization marker can be remove when DRUM is update to + // a DSpace version containing this change. + const result = component.isResearcherProfileEnabled$; + // End UMD Customization const expected = cold('a', { a: true }); @@ -336,7 +342,13 @@ describe('ProfilePageComponent', () => { }); it('should return false', () => { - const result = component.isResearcherProfileEnabled(); + // UMD Customization + // This change is from dspace-angular Pull Request 3585, specifically + // commit hash "ded0079". + // This customization marker can be remove when DRUM is update to + // a DSpace version containing this change. + const result = component.isResearcherProfileEnabled$; + // End UMD Customization const expected = cold('a', { a: false }); @@ -352,7 +364,13 @@ describe('ProfilePageComponent', () => { }); it('should return false', () => { - const result = component.isResearcherProfileEnabled(); + // UMD Customization + // This change is from dspace-angular Pull Request 3585, specifically + // commit hash "ded0079". + // This customization marker can be remove when DRUM is update to + // a DSpace version containing this change. + const result = component.isResearcherProfileEnabled$; + // End UMD Customization const expected = cold('a', { a: false }); diff --git a/src/app/profile-page/profile-page.component.ts b/src/app/profile-page/profile-page.component.ts index d49bdedb838..af67d658b72 100644 --- a/src/app/profile-page/profile-page.component.ts +++ b/src/app/profile-page/profile-page.component.ts @@ -192,12 +192,18 @@ export class ProfilePageComponent implements OnInit { this.updateProfile(); } - /** - * Returns true if the researcher profile feature is enabled, false otherwise. - */ - isResearcherProfileEnabled(): Observable { - return this.isResearcherProfileEnabled$.asObservable(); - } + // UMD Customization + // This change is from dspace-angular Pull Request 3585, specifically + // commit hash "ded0079". + // This customization marker can be remove when DRUM is update to + // a DSpace version containing this change. + // /** + // * Returns true if the researcher profile feature is enabled, false otherwise. + // */ + // isResearcherProfileEnabled(): Observable { + // return this.isResearcherProfileEnabled$.asObservable(); + // } + // End UMD Customization /** * Returns an error message from a password validation request with a specific reason or