Skip to content

Commit f70d54d

Browse files
authored
fix(contributors): fixed bug (#540)
1 parent 297498a commit f70d54d

5 files changed

Lines changed: 19 additions & 7 deletions

File tree

src/app/features/metadata/metadata.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ export class MetadataComponent implements OnInit {
338338
this.customDialogService
339339
.open(ContributorsDialogComponent, {
340340
header: this.translateService.instant('project.metadata.contributors.editContributors'),
341+
width: '600px',
341342
data: {
342343
resourceId: this.resourceId,
343344
resourceType: this.resourceType(),

src/app/features/registries/components/registries-metadata-step/registries-contributors/registries-contributors.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ <h2 class="mb-2">{{ 'project.overview.metadata.contributors' | translate }}</h2>
1313
<div class="flex justify-content-end mt-3">
1414
@if (hasChanges) {
1515
<div class="flex gap-2 mr-4">
16-
<p-button (click)="cancel()" severity="info" [label]="'common.buttons.cancel' | translate" />
17-
<p-button (click)="save()" [label]="'common.buttons.save' | translate" />
16+
<p-button (onClick)="cancel()" severity="info" [label]="'common.buttons.cancel' | translate" />
17+
<p-button (onClick)="save()" [label]="'common.buttons.save' | translate" />
1818
</div>
1919
}
20-
<p-button [label]="'registries.metadata.addContributors' | translate" (click)="openAddContributorDialog()" />
20+
<p-button [label]="'registries.metadata.addContributors' | translate" (onClick)="openAddContributorDialog()" />
2121
</div>
2222
</p-card>

src/app/shared/components/contributors/contributors-table/contributors-table.component.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
>
1616
<ng-template #header>
1717
<tr>
18-
<th></th>
18+
<th>
19+
@if (deactivatedContributors()) {
20+
<osf-info-icon [tooltipText]="'project.contributors.reorderDeactivateTooltip'"></osf-info-icon>
21+
}
22+
</th>
1923
<th>{{ 'project.contributors.table.headers.name' | translate }}</th>
2024
<th>
2125
<div class="flex align-items-center">
@@ -62,9 +66,11 @@
6266
@if (contributor.id) {
6367
<tr [pReorderableRow]="index" class="select-none">
6468
<td>
65-
<div pReorderableRowHandle>
66-
<osf-icon [iconClass]="'fas fa-bars'"></osf-icon>
67-
</div>
69+
@if (!deactivatedContributors()) {
70+
<div pReorderableRowHandle>
71+
<osf-icon [iconClass]="'fas fa-bars'"></osf-icon>
72+
</div>
73+
}
6874
</td>
6975

7076
<td>

src/app/shared/components/contributors/contributors-table/contributors-table.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ContributorModel, SelectOption, TableParameters } from '@osf/shared/mod
1818
import { CustomDialogService } from '@osf/shared/services';
1919

2020
import { IconComponent } from '../../icon/icon.component';
21+
import { InfoIconComponent } from '../../info-icon/info-icon.component';
2122

2223
@Component({
2324
selector: 'osf-contributors-table',
@@ -31,6 +32,7 @@ import { IconComponent } from '../../icon/icon.component';
3132
Button,
3233
SelectComponent,
3334
IconComponent,
35+
InfoIconComponent,
3436
],
3537
templateUrl: './contributors-table.component.html',
3638
styleUrl: './contributors-table.component.scss',
@@ -60,6 +62,8 @@ export class ContributorsTableComponent {
6062

6163
isProject = computed(() => this.resourceType() === ResourceType.Project);
6264

65+
deactivatedContributors = computed(() => this.contributors().some((contributor) => contributor.deactivated));
66+
6367
canRemoveContributor = computed(() => {
6468
const contributors = this.contributors();
6569
const currentUserId = this.currentUserId();

src/assets/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@
544544
"searchRegistrationPlaceholder": "Search Registration Contributors",
545545
"permissionFilter": "Filter by permission",
546546
"bibliographyFilter": "Bibliography",
547+
"reorderDeactivateTooltip": "Remove deactivated contributors in order to enable reordering.",
547548
"permissions": {
548549
"administrator": "Administrator",
549550
"readAndWrite": "Read + Write",

0 commit comments

Comments
 (0)