Skip to content
7 changes: 7 additions & 0 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ export const routes: Routes = [
import('./core/components/forbidden-page/forbidden-page.component').then((mod) => mod.ForbiddenPageComponent),
data: { skipBreadcrumbs: true },
},
{
path: 'preprints/:providerId/:id/pending-moderation',
loadComponent: () =>
import(
'@osf/features/preprints/pages/preprint-pending-moderation/preprint-pending-moderation.component'
).then((mod) => mod.PreprintPendingModerationComponent),
},
{
path: 'request-access/:id',
loadComponent: () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,15 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {
}
}
},
error: (error) => {
if (
error instanceof HttpErrorResponse &&
error.status === 403 &&
error?.error?.errors[0]?.detail === 'This preprint is pending moderation and is not yet publicly available.'
) {
this.router.navigate(['/preprints', this.providerId(), preprintId, 'pending-moderation']);
}
},
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<section class="container text-center flex flex-column flex-1 my-7 mx-3 p-3 md:p-4">
<h2>{{ 'preprints.details.moderationStatusBanner.pendingDetails.title' | translate }}</h2>
<p class="mt-4">{{ 'preprints.details.moderationStatusBanner.pendingDetails.body' | translate }}</p>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use "styles/mixins" as mix;

:host {
@include mix.flex-center;
flex: 1;
background: var(--gradient-3);
}

.container {
max-width: mix.rem(448px);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { PreprintPendingModerationComponent } from './preprint-pending-moderation.component';

import { OSFTestingModule } from '@testing/osf.testing.module';

describe('PreprintPendingModerationComponent', () => {
let component: PreprintPendingModerationComponent;
let fixture: ComponentFixture<PreprintPendingModerationComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PreprintPendingModerationComponent, OSFTestingModule],
}).compileComponents();

fixture = TestBed.createComponent(PreprintPendingModerationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { TranslatePipe } from '@ngx-translate/core';

import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'osf-preprint-pending-moderation',
templateUrl: './preprint-pending-moderation.component.html',
styleUrl: './preprint-pending-moderation.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [TranslatePipe],
})
export class PreprintPendingModerationComponent {}
5 changes: 5 additions & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,7 @@
"poweredBy": "Powered by OSF Preprints",
"searchPlaceholder": "Search {{preprintWord}}...",
"showExample": "Show an example",

"browseBySubjects": {
"title": "Browse By Subjects"
},
Expand Down Expand Up @@ -2400,6 +2401,10 @@
"noModerationNotice": "<strong>{{pluralCapitalizedPreprintWord}} are a permanent part of the scholarly record. Withdrawal requests are subject to this service’s policy on {{singularPreprintWord}} version removal and at the discretion of the moderators.</strong><br>This request will be submitted to <a href=\"mailto:{{supportEmail}}\" target=\"_blank\">{{supportEmail}}</a> for review and removal. If the request is approved, this {{singularPreprintWord}} version will be replaced by a tombstone page with metadata and the reason for withdrawal. This {{singularPreprintWord}} version will still be searchable by other users after removal."
},
"moderationStatusBanner": {
"pendingDetails": {
"title": "This Preprint Is Pending Moderation At OSF Preprints",
"body": "This preprint was submitted for review. It won't be available until it is accepted by the provider. Please check back later."
},
"recentActivity": {
"pending": "submitted this {{documentType}} on",
"accepted": "accepted this {{documentType}} on",
Expand Down