Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIBDRUM-890. Suppress "Researcher Profile" panel on "Update Profile" #83

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/app/profile-page/profile-page.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<ng-container *ngVar="(user$ | async) as user">
<div class="container" *ngIf="user">
<h1>{{'profile.title' | translate}}</h1>
<ng-container>
<!-- 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.
-->
<ng-container *ngIf="isResearcherProfileEnabled$ | async">
<!-- End UMD Customization -->
<div class="card mb-4">
<div class="card-header">{{'profile.card.researcher' | translate}}</div>
<div class="card-body">
Expand Down
24 changes: 21 additions & 3 deletions src/app/profile-page/profile-page.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand All @@ -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
});
Expand All @@ -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
});
Expand Down
18 changes: 12 additions & 6 deletions src/app/profile-page/profile-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,18 @@ export class ProfilePageComponent implements OnInit {
this.updateProfile();
}

/**
* Returns true if the researcher profile feature is enabled, false otherwise.
*/
isResearcherProfileEnabled(): Observable<boolean> {
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<boolean> {
// return this.isResearcherProfileEnabled$.asObservable();
// }
// End UMD Customization

/**
* Returns an error message from a password validation request with a specific reason or
Expand Down
Loading