Skip to content

Commit dbe12f1

Browse files
authored
[ENG-9243] fix preprint moderation preprint datail url and not allow to render Withdraw and Submission tab for preprints moderation if status is null (#744)
- Ticket: https://openscience.atlassian.net/browse/ENG-9243 - Feature flag: n/a ## Purpose Preprint Moderation: OSF preprint withdrawal request throws error when clicked on preprint and moderator details page is not loading ## Summary of Changes https://openscience.atlassian.net/browse/ENG-9243?focusedCommentId=91945 1. Use preprint guid for url of such an format https://api.staging3.osf.io/v2/preprints/686bd16271351c4bd25a5deb/?embed%5B%5D=license&embed%5B%5D=identifiers 2. Not allow to render Withdraw and Submission tab for preprints moderation if status is null
1 parent 40e63f3 commit dbe12f1

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/app/features/moderation/components/preprint-submission-item/preprint-submission-item.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class="link-btn-no-padding"
1111
styleClass="text-left"
1212
link
13-
[label]="submission().title"
13+
[label]="submission().title | fixSpecialChar"
1414
(onClick)="selected.emit()"
1515
/>
1616
@for (action of showAll ? submission().actions : submission().actions.slice(0, limitValue); track $index) {

src/app/features/moderation/components/preprint-submission-item/preprint-submission-item.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { IconComponent } from '@osf/shared/components/icon/icon.component';
1010
import { TruncatedTextComponent } from '@osf/shared/components/truncated-text/truncated-text.component';
1111
import { StopPropagationDirective } from '@osf/shared/directives/stop-propagation.directive';
1212
import { DateAgoPipe } from '@osf/shared/pipes/date-ago.pipe';
13+
import { FixSpecialCharPipe } from '@osf/shared/pipes/fix-special-char.pipe';
1314

1415
import { PREPRINT_ACTION_LABEL, ReviewStatusIcon } from '../../constants';
1516
import { ActionStatus, SubmissionReviewStatus } from '../../enums';
@@ -29,6 +30,7 @@ import { PreprintSubmissionModel, PreprintWithdrawalSubmission } from '../../mod
2930
AccordionContent,
3031
ContributorsListComponent,
3132
StopPropagationDirective,
33+
FixSpecialCharPipe,
3234
],
3335
templateUrl: './preprint-submission-item.component.html',
3436
styleUrl: './preprint-submission-item.component.scss',

src/app/features/moderation/components/preprint-submissions/preprint-submissions.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export class PreprintSubmissionsComponent implements OnInit {
9797
}
9898

9999
changeReviewStatus(value: SubmissionReviewStatus): void {
100+
if (!value) return;
101+
100102
this.selectedReviewOption.set(value);
101103
this.router.navigate([], {
102104
relativeTo: this.route,

src/app/features/moderation/components/preprint-withdrawal-submissions/preprint-withdrawal-submissions.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ export class PreprintWithdrawalSubmissionsComponent implements OnInit {
9494
}
9595

9696
changeReviewStatus(value: SubmissionReviewStatus): void {
97+
if (!value) return;
98+
9799
this.selectedReviewOption.set(value);
98100
this.router.navigate([], {
99101
relativeTo: this.route,
@@ -118,7 +120,9 @@ export class PreprintWithdrawalSubmissionsComponent implements OnInit {
118120

119121
navigateToPreprint(item: PreprintWithdrawalSubmission) {
120122
const url = this.router.serializeUrl(
121-
this.router.createUrlTree(['/preprints/', this.providerId(), item.id], { queryParams: { mode: 'moderator' } })
123+
this.router.createUrlTree(['/preprints/', this.providerId(), item.preprintId], {
124+
queryParams: { mode: 'moderator' },
125+
})
122126
);
123127

124128
window.open(url, '_blank');

0 commit comments

Comments
 (0)