Skip to content

Commit 5b1cccb

Browse files
committed
fix(curator_delete_project_button_permissions): fix delete button visibility for curators on project settings page
1 parent 06b8657 commit 5b1cccb

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/app/features/project/settings/components/settings-project-form-card/settings-project-form-card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 class="pb-4">{{ 'myProjects.settings.project' | translate }}</h2>
3333
></p-button>
3434
</div>
3535

36-
<div class="flex justify-content-end w-full flex-0 border-top-1 pt-4 border-gray-300">
36+
<div *ngIf="canDelete()" class="flex justify-content-end w-full flex-0 border-top-1 pt-4 border-gray-300">
3737
<p-button (onClick)="deleteProject.emit()" severity="danger" [label]="deleteLabel() | translate"></p-button>
3838
</div>
3939
</form>

src/app/features/project/settings/components/settings-project-form-card/settings-project-form-card.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { TranslatePipe } from '@ngx-translate/core';
33
import { Button } from 'primeng/button';
44
import { Card } from 'primeng/card';
55
import { Textarea } from 'primeng/textarea';
6+
import { NgIf } from '@angular/common';
67

78
import { ChangeDetectionStrategy, Component, computed, effect, input, output } from '@angular/core';
89
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
@@ -16,7 +17,7 @@ import { NodeDetailsModel, ProjectDetailsModel } from '../../models';
1617

1718
@Component({
1819
selector: 'osf-settings-project-form-card',
19-
imports: [Button, Card, Textarea, TranslatePipe, ReactiveFormsModule, TextInputComponent],
20+
imports: [Button, Card, Textarea, TranslatePipe, ReactiveFormsModule, TextInputComponent, NgIf],
2021
templateUrl: './settings-project-form-card.component.html',
2122
styleUrl: 'settings-project-form-card.component.scss',
2223
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -25,6 +26,7 @@ export class SettingsProjectFormCardComponent {
2526
projectDetails = input.required<NodeDetailsModel>();
2627
submitForm = output<ProjectDetailsModel>();
2728
deleteProject = output<void>();
29+
canDelete = input<boolean>(false);
2830

2931
readonly ProjectFormControls = ProjectFormControls;
3032
readonly inputLimits = InputLimits;

src/app/features/project/settings/settings.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
(submitForm)="submitForm($event)"
1111
(deleteProject)="deleteProject()"
1212
[projectDetails]="projectDetails()"
13+
[canDelete]="hasAdminAccess()"
1314
/>
1415

1516
<osf-settings-storage-location-card

0 commit comments

Comments
 (0)