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
Expand Up @@ -4,7 +4,7 @@
} @else {
@for (contributor of contributors(); track contributor.id) {
<div>
@if (readonly() || contributor.isUnregisteredContributor || !contributor.userId) {
@if (readonly() || contributor.isUnregisteredContributor || contributor.deactivated) {
<span data-test-contributor-name>{{ contributor.fullName }}{{ $last ? '' : ',' }}</span>
} @else {
<a class="font-bold" [routerLink]="['/user', contributor.userId]" data-test-contributor-name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2>{{ 'project.contributors.curatorInfo.heading' | translate }}</h2>
</p>
</td>
<td>
@if (isCurrentUserAdminContributor()) {
@if (isCurrentUserAdminContributor() && !contributor.deactivated) {
<div class="w-9rem">
<osf-select
[options]="permissionsOptions"
Expand Down Expand Up @@ -134,7 +134,7 @@ <h2>{{ 'project.contributors.curatorInfo.heading' | translate }}</h2>
binary="true"
[(ngModel)]="contributor.isBibliographic"
[ariaLabel]="'project.contributors.table.headers.contributor' | translate"
[readonly]="!isCurrentUserAdminContributor()"
[disabled]="!isCurrentUserAdminContributor() || contributor.deactivated"
></p-checkbox>
</div>
</td>
Expand All @@ -154,14 +154,13 @@ <h2>{{ 'project.contributors.curatorInfo.heading' | translate }}</h2>
@if (showEmployment()) {
<td>
@if (contributor.employment?.length) {
<a
class="font-bold cursor-pointer"
tabindex="0"
(click)="openEmploymentHistory(contributor)"
<p-button
link
class="link-btn-no-padding"
[label]="'project.contributors.employment.show' | translate"
(onClick)="openEmploymentHistory(contributor)"
(keydown.enter)="openEmploymentHistory(contributor)"
>
{{ 'project.contributors.employment.show' | translate }}
</a>
/>
} @else {
<span>{{ 'project.contributors.employment.none' | translate }}</span>
}
Expand All @@ -171,14 +170,13 @@ <h2>{{ 'project.contributors.curatorInfo.heading' | translate }}</h2>
<td>
<div class="flex column-gap-2">
@if (contributor.education?.length) {
<a
class="font-bold cursor-pointer"
tabindex="0"
(click)="openEducationHistory(contributor)"
<p-button
link
class="link-btn-no-padding"
[label]="'project.contributors.education.show' | translate"
(onClick)="openEducationHistory(contributor)"
(keydown.enter)="openEducationHistory(contributor)"
>
{{ 'project.contributors.education.show' | translate }}
</a>
/>
} @else {
<span>{{ 'project.contributors.education.none' | translate }}</span>
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/mappers/contributors/contributors.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ export class ContributorsMapper {
isCurator: response.attributes.is_curator,
permission: response.attributes.permission,
index: response.attributes.index,
userId: errorMeta ? '' : userData?.id || '',
userId: errorMeta ? response?.id?.split('-')[1] : userData?.id || '',
fullName: errorMeta ? errorMeta?.full_name : userData?.attributes?.full_name || '',
givenName: errorMeta ? errorMeta?.given_name : userData?.attributes?.given_name || '',
familyName: errorMeta ? errorMeta?.family_name : userData?.attributes?.family_name || '',
education: errorMeta ? [] : userData?.attributes?.education || [],
employment: errorMeta ? [] : userData?.attributes?.employment || [],
deactivated: !!errorMeta,
};
}

Expand Down
1 change: 1 addition & 0 deletions src/app/shared/models/contributors/contributor.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface ContributorModel {
familyName: string;
employment: Employment[];
education: Education[];
deactivated: boolean;
}

export type ContributorShortInfoModel = Pick<
Expand Down
Loading