From bed0fd0993cf5885520aee7f8330ab1c3b2c149f Mon Sep 17 00:00:00 2001 From: nsemets Date: Tue, 13 Jan 2026 17:10:05 +0200 Subject: [PATCH 1/6] fix(ssr): added ssr setup --- angular.json | 7 ++++++- src/app/app.config.ts | 4 ++-- tsconfig.app.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/angular.json b/angular.json index a00a79554..b87b677be 100644 --- a/angular.json +++ b/angular.json @@ -62,7 +62,12 @@ "node_modules/ngx-markdown-editor/assets/highlight.js/highlight.min.js", "node_modules/ngx-markdown-editor/assets/marked.min.js", "src/assets/js/ace/snippetsMarkdown.js" - ] + ], + "server": "src/main.server.ts", + "outputMode": "server", + "ssr": { + "entry": "src/server.ts" + } }, "configurations": { "production": { diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 8c68eae0a..c21e678de 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -6,7 +6,7 @@ import { ConfirmationService, MessageService } from 'primeng/api'; import { providePrimeNG } from 'primeng/config'; import { DialogService } from 'primeng/dynamicdialog'; -import { provideHttpClient, withInterceptors } from '@angular/common/http'; +import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/http'; import { ApplicationConfig, ErrorHandler, importProvidersFrom, provideZoneChangeDetection } from '@angular/core'; import { provideClientHydration, withEventReplay } from '@angular/platform-browser'; import { provideAnimations } from '@angular/platform-browser/animations'; @@ -49,7 +49,7 @@ export const appConfig: ApplicationConfig = { }, }, }), - provideHttpClient(withInterceptors([authInterceptor, viewOnlyInterceptor, errorInterceptor])), + provideHttpClient(withInterceptors([authInterceptor, viewOnlyInterceptor, errorInterceptor]), withFetch()), provideRouter(routes, withInMemoryScrolling({ scrollPositionRestoration: 'top', anchorScrolling: 'enabled' })), provideStore(STATES), provideZoneChangeDetection({ eventCoalescing: true }), diff --git a/tsconfig.app.json b/tsconfig.app.json index fa4f041fc..0dba49a02 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -7,6 +7,6 @@ "types": ["node"], "typeRoots": ["src/@types", "node_modules/@types"] }, - "files": ["src/main.ts"], + "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], "include": ["src/**/*.d.ts"] } From 2f186efc271c7c758619a27492385f7f3407ff5b Mon Sep 17 00:00:00 2001 From: nsemets Date: Tue, 13 Jan 2026 17:19:11 +0200 Subject: [PATCH 2/6] fix(preprints-registries): fixed small issues for preprints and registries --- src/app/features/files/files.routes.ts | 1 - .../advisory-board/advisory-board.component.html | 2 +- .../advisory-board/advisory-board.component.ts | 3 ++- .../preprint-withdraw-dialog.component.html | 10 +++++----- .../preprint-provider-footer.component.html | 5 ++++- .../preprint-provider-footer.component.ts | 3 ++- .../preprint-provider-hero.component.html | 2 +- .../preprint-provider-hero.component.ts | 4 ++-- .../preprints/mappers/preprint-providers.mapper.ts | 5 +++-- .../select-preprint-service.component.html | 2 +- .../select-preprint-service.component.ts | 3 +-- .../registry-provider-hero.component.html | 2 +- .../registry-provider-hero.component.ts | 3 +-- .../components/files-tree/files-tree.component.scss | 1 - .../shared/mappers/registration-provider.mapper.ts | 5 +++-- .../registration/map-registry-status.mapper.ts | 3 ++- src/app/shared/pipes/decode-html.pipe.ts | 12 ------------ src/app/shared/pipes/safe-html.pipe.ts | 6 +++++- 18 files changed, 34 insertions(+), 38 deletions(-) delete mode 100644 src/app/shared/pipes/decode-html.pipe.ts diff --git a/src/app/features/files/files.routes.ts b/src/app/features/files/files.routes.ts index 5c14d10a2..5c93c2baf 100644 --- a/src/app/features/files/files.routes.ts +++ b/src/app/features/files/files.routes.ts @@ -32,7 +32,6 @@ export const filesRoutes: Routes = [ (c) => c.FileDetailComponent ); }, - children: [ { path: 'metadata', diff --git a/src/app/features/preprints/components/advisory-board/advisory-board.component.html b/src/app/features/preprints/components/advisory-board/advisory-board.component.html index ba5937da1..25a72d05a 100644 --- a/src/app/features/preprints/components/advisory-board/advisory-board.component.html +++ b/src/app/features/preprints/components/advisory-board/advisory-board.component.html @@ -2,6 +2,6 @@
} diff --git a/src/app/features/preprints/components/advisory-board/advisory-board.component.ts b/src/app/features/preprints/components/advisory-board/advisory-board.component.ts index ec2485492..2840658ce 100644 --- a/src/app/features/preprints/components/advisory-board/advisory-board.component.ts +++ b/src/app/features/preprints/components/advisory-board/advisory-board.component.ts @@ -3,10 +3,11 @@ import { ChangeDetectionStrategy, Component, input } from '@angular/core'; import { StringOrNullOrUndefined } from '@osf/shared/helpers/types.helper'; import { BrandModel } from '@osf/shared/models/brand/brand.model'; +import { SafeHtmlPipe } from '@osf/shared/pipes/safe-html.pipe'; @Component({ selector: 'osf-advisory-board', - imports: [NgClass], + imports: [NgClass, SafeHtmlPipe], templateUrl: './advisory-board.component.html', styleUrl: './advisory-board.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.html b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.html index a483012c0..6e5b9cd3f 100644 --- a/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.html +++ b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.html @@ -9,9 +9,9 @@
- +