Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="py-5 px-3 md:p-5 xl:p-4 xl:mt-6">
<div class="py-5 px-3 md:p-5 xl:p-4">
<div class="flex align-items-center">
<h1>{{ currentUser()?.fullName }}</h1>

Expand Down
14 changes: 13 additions & 1 deletion src/app/features/profile/profile.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
<osf-loading-spinner />
} @else {
@if (user()) {
<osf-profile-information [currentUser]="user()" [showEdit]="isMyProfile()" (editProfile)="toProfileSettings()" />
<div class="mt-7 px-3 md:px-5 xl:px-4">
@if (user()?.mergedBy) {
<p-message class="overview-message w-full mb-4" severity="info">
<ng-template #container>
<span>
{{ 'profile.mergedAccount.message' | translate }}
<a [href]="user()?.mergedBy">{{ user()?.mergedBy }}</a>
</span>
</ng-template>
</p-message>
}
<osf-profile-information [currentUser]="user()" [showEdit]="isMyProfile()" (editProfile)="toProfileSettings()" />
</div>

@if (defaultSearchFiltersInitialized()) {
<div class="mt-6">
Expand Down
6 changes: 5 additions & 1 deletion src/app/features/profile/profile.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { createDispatchMap, select } from '@ngxs/store';

import { TranslatePipe } from '@ngx-translate/core';

import { Message } from 'primeng/message';

import {
ChangeDetectionStrategy,
Component,
Expand Down Expand Up @@ -30,7 +34,7 @@ import { FetchUserProfile, ProfileSelectors, SetUserProfile } from './store';
templateUrl: './profile.component.html',
styleUrl: './profile.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ProfileInformationComponent, GlobalSearchComponent, LoadingSpinnerComponent],
imports: [ProfileInformationComponent, GlobalSearchComponent, LoadingSpinnerComponent, Message, TranslatePipe],
})
export class ProfileComponent implements OnInit, OnDestroy {
private router = inject(Router);
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/mappers/user/user.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class UserMapper {
canViewReviews: user.attributes.can_view_reviews === true, // [NS] Do not simplify it
timezone: user.attributes.timezone,
locale: user.attributes.locale,
mergedBy: user.links.merged_by,
};
}

Expand Down
1 change: 1 addition & 0 deletions src/app/shared/models/user/user-json-api.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ interface UserLinksJsonApi {
iri: string;
profile_image: string;
self: string;
merged_by?: string;
}

interface UserRelationshipsJsonApi {
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/models/user/user.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export interface UserModel {
defaultRegionId: string;
link?: string;
iri?: string;
mergedBy?: string;
}
5 changes: 5 additions & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@
"institutions": "Institutions",
"recentActivity": "Recent Activity"
},
"profile": {
"mergedAccount": {
"message": "This account has been merged with "
}
},
"toast": {
"tos-consent": {
"message": "Notice: We've updated our",
Expand Down
1 change: 1 addition & 0 deletions src/testing/mocks/data.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const MOCK_USER: UserModel = {
defaultRegionId: 'us',
allowIndexing: true,
canViewReviews: true,
mergedBy: undefined,
};

export const MOCK_USER_RELATED_COUNTS: UserRelatedCounts = {
Expand Down