Skip to content

Commit 739af16

Browse files
authored
Merge pull request DSpace#3030 from 4Science/task/main/DURACOM-258
Allow submitter users to accept/ignore suggestions
2 parents 0afd791 + 88ecb25 commit 739af16

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

src/app/notifications/qa/events/quality-assurance-events.component.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ <h4 class="border-bottom pb-2">
156156
</div>
157157
</td>
158158
<td>
159-
<div *ngIf="(isAdmin$ | async)" class="btn-group button-width">
159+
<div *ngIf="(isAdmin$ | async) || !isReinstateWithdrawnRequest" class="btn-group button-width">
160160
<button *ngIf="showTopic.indexOf('/PROJECT') !== -1"
161161
class="btn btn-outline-success btn-sm button-width"
162162
ngbTooltip="{{'quality-assurance.event.action.import' | translate}}"
@@ -187,6 +187,7 @@ <h4 class="border-bottom pb-2">
187187
<i class="fas fa-ban"></i>
188188
</button>
189189
<button class="btn btn-outline-danger btn-sm button-width"
190+
*ngIf="(isAdmin$ | async)"
190191
ngbTooltip="{{'quality-assurance.event.action.reject' | translate}}"
191192
container="body"
192193
[disabled]="eventElement.isRunning"
@@ -195,8 +196,17 @@ <h4 class="border-bottom pb-2">
195196
>
196197
<i class="fas fa-trash-alt"></i>
197198
</button>
199+
<button class="btn btn-outline-danger btn-sm button-width"
200+
*ngIf="(isAdmin$ | async) === false"
201+
ngbTooltip="{{'quality-assurance.event.action.undo' | translate }}"
202+
container="body"
203+
[disabled]="eventElement.isRunning"
204+
[attr.aria-label]="'quality-assurance.event.action.undo' | translate"
205+
(click)="openModal('UNDO', eventElement, undoModal)">
206+
<i class="fas fa-trash-alt"></i>
207+
</button>
198208
</div>
199-
<div *ngIf="(isAdmin$ | async) !== true" class="btn-group button-width">
209+
<div *ngIf="(isAdmin$ | async) !== true && isReinstateWithdrawnRequest" class="btn-group button-width">
200210
<button class="btn btn-outline-danger btn-sm button-width"
201211
ngbTooltip="{{'quality-assurance.event.action.undo' | translate}}"
202212
container="body"

src/app/notifications/qa/events/quality-assurance-events.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
257257
);
258258
}
259259

260+
/**
261+
* Checks if the current topic is related to a reinstate or withdrawn request.
262+
*/
263+
public get isReinstateWithdrawnRequest(): boolean {
264+
return this.showTopic.indexOf('/WITHDRAWN') !== -1 || this.showTopic.indexOf('/REINSTATE') !== -1;
265+
}
266+
260267
/**
261268
* Open a modal or run the executeAction directly based on the presence of the project.
262269
*

src/assets/i18n/ar.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5465,9 +5465,9 @@
54655465
// "quality-assurance.event.action.ignore": "Ignore suggestion",
54665466
"quality-assurance.event.action.ignore": "تجاهل الاقتراح",
54675467

5468-
// "quality-assurance.event.action.undo": "DELETE",
5468+
// "quality-assurance.event.action.undo": "Delete",
54695469
// TODO New key - Add a translation
5470-
"quality-assurance.event.action.undo": "DELETE",
5470+
"quality-assurance.event.action.undo": "Delete",
54715471

54725472
// "quality-assurance.event.action.reject": "Reject suggestion",
54735473
"quality-assurance.event.action.reject": "رفض الاقتراح",

src/assets/i18n/en.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3552,7 +3552,7 @@
35523552

35533553
"quality-assurance.event.action.ignore": "Ignore suggestion",
35543554

3555-
"quality-assurance.event.action.undo": "DELETE",
3555+
"quality-assurance.event.action.undo": "Delete",
35563556

35573557
"quality-assurance.event.action.reject": "Reject suggestion",
35583558

0 commit comments

Comments
 (0)