Skip to content

Commit 474c08f

Browse files
authored
Merge pull request #920 from CenterForOpenScience/feature/pbs-26-2
Feature/pbs 26 2
2 parents 3666b51 + 4909e37 commit 474c08f

532 files changed

Lines changed: 15882 additions & 10527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/ngxs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Typical NGXS-related files are organized as follows:
4646
src/app/shared/stores/
4747
└── addons/
4848
├── addons.actions.ts # All action definitions
49-
├── addons.models.ts # Interfaces & data models
49+
├── addons.model.ts # Interfaces & data model
5050
├── addons.state.ts # State implementation
5151
├── addons.selectors.ts # Reusable selectors
5252
```

docs/testing.md

Lines changed: 762 additions & 213 deletions
Large diffs are not rendered by default.

jest.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module.exports = {
33
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
44
globalSetup: '<rootDir>/jest.global-setup.ts',
55
collectCoverage: false,
6+
clearMocks: true,
7+
restoreMocks: true,
68
coverageReporters: ['json-summary', 'lcov', 'clover'],
79
moduleNameMapper: {
810
'^@osf/(.*)$': '<rootDir>/src/app/$1',
@@ -36,12 +38,10 @@ module.exports = {
3638
'!src/app/app.config.ts',
3739
'!src/app/app.routes.ts',
3840
'!src/app/**/*.routes.{ts,js}',
39-
'!src/app/**/**/*.routes.{ts,js}',
4041
'!src/app/**/*.route.{ts,js}',
4142
'!src/app/**/mappers/**',
4243
'!src/app/shared/mappers/**',
43-
'!src/app/**/*.models.{ts.js}',
44-
'!src/app/**/*.model.{ts.js}',
44+
'!src/app/**/*.model.{ts,js}',
4545
'!src/app/**/models/*.{ts,js}',
4646
'!src/app/shared/models/**',
4747
'!src/app/**/*.enum.{ts,js}',
@@ -54,10 +54,10 @@ module.exports = {
5454
extensionsToTreatAsEsm: ['.ts'],
5555
coverageThreshold: {
5656
global: {
57-
branches: 34.8,
58-
functions: 38.0,
59-
lines: 65.5,
60-
statements: 66.0,
57+
branches: 43.3,
58+
functions: 42.7,
59+
lines: 69.3,
60+
statements: 69.8,
6161
},
6262
},
6363
watchPathIgnorePatterns: [

setup-jest.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ jest.mock('@newrelic/browser-agent/loaders/browser-agent', () => ({
5252
stop: jest.fn(),
5353
})),
5454
}));
55+
56+
if (!globalThis.structuredClone) {
57+
Object.defineProperty(globalThis, 'structuredClone', {
58+
value: <T>(value: T): T => JSON.parse(JSON.stringify(value)) as T,
59+
writable: true,
60+
configurable: true,
61+
});
62+
}

src/app/app.routes.server.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export const serverRoutes: ServerRoute[] = [
2121
path: 'forgotpassword',
2222
renderMode: RenderMode.Prerender,
2323
},
24-
{
25-
path: '',
26-
renderMode: RenderMode.Prerender,
27-
},
2824
{
2925
path: 'dashboard',
3026
renderMode: RenderMode.Client,

src/app/app.routes.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ export const routes: Routes = [
107107
'@osf/features/preprints/pages/preprint-pending-moderation/preprint-pending-moderation.component'
108108
).then((mod) => mod.PreprintPendingModerationComponent),
109109
},
110+
{
111+
path: 'preprints/:providerId/:id/download',
112+
loadComponent: () =>
113+
import('@osf/features/preprints/pages/preprint-download-redirect/preprint-download-redirect.component').then(
114+
(c) => c.PreprintDownloadRedirectComponent
115+
),
116+
},
110117
{
111118
path: 'preprints/:providerId/:id',
112119
loadComponent: () =>
@@ -175,6 +182,14 @@ export const routes: Routes = [
175182
import('./core/components/page-not-found/page-not-found.component').then((mod) => mod.PageNotFoundComponent),
176183
data: { skipBreadcrumbs: true },
177184
},
185+
{
186+
path: 'spam-content',
187+
loadComponent: () =>
188+
import('./core/components/resource-is-spammed/resource-is-spammed.component').then(
189+
(mod) => mod.ResourceIsSpammedComponent
190+
),
191+
data: { skipBreadcrumbs: true },
192+
},
178193
{
179194
path: 'project/:id/node/:nodeId/files/:provider/:fileId',
180195
loadComponent: () =>

src/app/core/animations/fade.in-out.animation.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/app/core/components/osf-banners/cookie-consent-banner/cookie-consent-banner.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Component: Cookie Consent Banner', () => {
2020

2121
beforeEach(async () => {
2222
await TestBed.configureTestingModule({
23-
imports: [OSFTestingModule, CookieConsentBannerComponent, MockComponent(IconComponent)],
23+
imports: [CookieConsentBannerComponent, OSFTestingModule, MockComponent(IconComponent)],
2424
providers: [{ provide: CookieService, useValue: cookieServiceMock }],
2525
});
2626

src/app/core/components/osf-banners/cookie-consent-banner/cookie-consent-banner.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@ import { Message } from 'primeng/message';
77
import { isPlatformBrowser } from '@angular/common';
88
import { ChangeDetectionStrategy, Component, inject, PLATFORM_ID, signal } from '@angular/core';
99

10-
import { fadeInOutAnimation } from '@core/animations/fade.in-out.animation';
1110
import { IconComponent } from '@osf/shared/components/icon/icon.component';
1211

1312
/**
1413
* Displays a cookie consent banner until the user accepts.
1514
*
1615
* - Uses `ngx-cookie-service` to persist acceptance across sessions.
1716
* - Automatically hides the banner if consent is already recorded.
18-
* - Animates in/out using the `fadeInOutAnimation`.
1917
* - Supports translation via `TranslatePipe`.
2018
*/
2119
@Component({
2220
selector: 'osf-cookie-consent-banner',
2321
templateUrl: './cookie-consent-banner.component.html',
2422
styleUrls: ['./cookie-consent-banner.component.scss'],
2523
imports: [Button, TranslatePipe, IconComponent, Message],
26-
animations: [fadeInOutAnimation],
2724
changeDetection: ChangeDetectionStrategy.OnPush,
2825
})
2926
export class CookieConsentBannerComponent {
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
@if (maintenance() && !dismissed()) {
22
<p-message
3+
class="block p-3"
34
styleClass="w-full"
5+
icon="pi pi-info-circle"
46
[severity]="maintenance()?.severity"
57
[text]="maintenance()?.message"
68
[closable]="true"
79
(onClose)="dismiss()"
8-
class="block p-3"
9-
icon="pi pi-info-circle"
10-
@fadeInOut
1110
>
1211
</p-message>
1312
}

0 commit comments

Comments
 (0)