From d31e17894ce3f8f6be82f426de879816d76acd97 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 26 Jul 2024 13:57:47 +0200 Subject: [PATCH 01/13] 116728: Removed unnecessary *ngVars from the ThumbnailComponent --- src/app/thumbnail/thumbnail.component.html | 20 ++++++------- src/app/thumbnail/thumbnail.component.spec.ts | 28 +++++++++---------- src/app/thumbnail/thumbnail.component.ts | 14 +++++----- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index 6a0516b0d4..049a47e1b0 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -1,4 +1,4 @@ -
+
@@ -6,16 +6,14 @@
- - - -
-
-
- {{ placeholder | translate }} -
+ + +
+
+
+ {{ placeholder | translate }}
- +
diff --git a/src/app/thumbnail/thumbnail.component.spec.ts b/src/app/thumbnail/thumbnail.component.spec.ts index ebecb5e075..2a25c9a318 100644 --- a/src/app/thumbnail/thumbnail.component.spec.ts +++ b/src/app/thumbnail/thumbnail.component.spec.ts @@ -67,31 +67,31 @@ describe('ThumbnailComponent', () => { describe('loading', () => { it('should start out with isLoading$ true', () => { - expect(comp.isLoading$.getValue()).toBeTrue(); + expect(comp.isLoading).toBeTrue(); }); it('should set isLoading$ to false once an image is successfully loaded', () => { comp.setSrc('http://bit.stream'); fixture.debugElement.query(By.css('img.thumbnail-content')).triggerEventHandler('load', new Event('load')); - expect(comp.isLoading$.getValue()).toBeFalse(); + expect(comp.isLoading).toBeFalse(); }); it('should set isLoading$ to false once the src is set to null', () => { comp.setSrc(null); - expect(comp.isLoading$.getValue()).toBeFalse(); + expect(comp.isLoading).toBeFalse(); }); it('should show a loading animation while isLoading$ is true', () => { expect(de.query(By.css('ds-themed-loading'))).toBeTruthy(); - comp.isLoading$.next(false); + comp.isLoading = false; fixture.detectChanges(); expect(fixture.debugElement.query(By.css('ds-themed-loading'))).toBeFalsy(); }); describe('with a thumbnail image', () => { beforeEach(() => { - comp.src$.next('https://bit.stream'); + comp.src = 'https://bit.stream'; fixture.detectChanges(); }); @@ -100,7 +100,7 @@ describe('ThumbnailComponent', () => { expect(img).toBeTruthy(); expect(img.classes['d-none']).toBeTrue(); - comp.isLoading$.next(false); + comp.isLoading = false; fixture.detectChanges(); img = fixture.debugElement.query(By.css('img.thumbnail-content')); expect(img).toBeTruthy(); @@ -111,14 +111,14 @@ describe('ThumbnailComponent', () => { describe('without a thumbnail image', () => { beforeEach(() => { - comp.src$.next(null); + comp.src = null; fixture.detectChanges(); }); it('should only show the HTML placeholder once done loading', () => { expect(fixture.debugElement.query(By.css('div.thumbnail-placeholder'))).toBeFalsy(); - comp.isLoading$.next(false); + comp.isLoading = false; fixture.detectChanges(); expect(fixture.debugElement.query(By.css('div.thumbnail-placeholder'))).toBeTruthy(); }); @@ -214,14 +214,14 @@ describe('ThumbnailComponent', () => { describe('fallback', () => { describe('if there is a default image', () => { it('should display the default image', () => { - comp.src$.next('http://bit.stream'); + comp.src = 'http://bit.stream'; comp.defaultImage = 'http://default.img'; comp.errorHandler(); - expect(comp.src$.getValue()).toBe(comp.defaultImage); + expect(comp.src).toBe(comp.defaultImage); }); it('should include the alt text', () => { - comp.src$.next('http://bit.stream'); + comp.src = 'http://bit.stream'; comp.defaultImage = 'http://default.img'; comp.errorHandler(); @@ -233,10 +233,10 @@ describe('ThumbnailComponent', () => { describe('if there is no default image', () => { it('should display the HTML placeholder', () => { - comp.src$.next('http://default.img'); + comp.src = 'http://default.img'; comp.defaultImage = null; comp.errorHandler(); - expect(comp.src$.getValue()).toBe(null); + expect(comp.src).toBe(null); fixture.detectChanges(); const placeholder = fixture.debugElement.query(By.css('div.thumbnail-placeholder')).nativeElement; @@ -328,7 +328,7 @@ describe('ThumbnailComponent', () => { it('should show the default image', () => { comp.defaultImage = 'default/image.jpg'; comp.ngOnChanges({}); - expect(comp.src$.getValue()).toBe('default/image.jpg'); + expect(comp.src).toBe('default/image.jpg'); }); }); }); diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 7f6531cc5e..0827a33e77 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { Bitstream } from '../core/shared/bitstream.model'; import { hasNoValue, hasValue } from '../shared/empty.util'; import { RemoteData } from '../core/data/remote-data'; -import { BehaviorSubject, of as observableOf } from 'rxjs'; +import { of as observableOf } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; @@ -34,7 +34,7 @@ export class ThumbnailComponent implements OnChanges { /** * The src attribute used in the template to render the image. */ - src$ = new BehaviorSubject(undefined); + src: string = undefined; retriedWithToken = false; @@ -57,7 +57,7 @@ export class ThumbnailComponent implements OnChanges { * Whether the thumbnail is currently loading * Start out as true to avoid flashing the alt text while a thumbnail is being loaded. */ - isLoading$ = new BehaviorSubject(true); + isLoading = true; constructor( protected auth: AuthService, @@ -110,7 +110,7 @@ export class ThumbnailComponent implements OnChanges { * Otherwise, fall back to the default image or a HTML placeholder */ errorHandler() { - const src = this.src$.getValue(); + const src = this.src; const thumbnail = this.bitstream; const thumbnailSrc = thumbnail?._links?.content?.href; @@ -162,9 +162,9 @@ export class ThumbnailComponent implements OnChanges { * @param src */ setSrc(src: string): void { - this.src$.next(src); + this.src = src; if (src === null) { - this.isLoading$.next(false); + this.isLoading = false; } } @@ -172,6 +172,6 @@ export class ThumbnailComponent implements OnChanges { * Stop the loading animation once the thumbnail is successfully loaded */ successHandler() { - this.isLoading$.next(false); + this.isLoading = false; } } From 11f251755b29de51ab377b824c58d96c61983144 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Fri, 25 Apr 2025 14:55:52 +0200 Subject: [PATCH 02/13] fix issue where thumnails of embargoed bitstreams wouldn't show up for users with access rights --- src/app/thumbnail/thumbnail.component.html | 10 ++--- src/app/thumbnail/thumbnail.component.spec.ts | 28 ++++++------ src/app/thumbnail/thumbnail.component.ts | 45 ++++++++++++------- 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index 049a47e1b0..bd161ea748 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -1,15 +1,15 @@
-
+
- - -
+ + +
{{ placeholder | translate }} diff --git a/src/app/thumbnail/thumbnail.component.spec.ts b/src/app/thumbnail/thumbnail.component.spec.ts index 2a25c9a318..ebecb5e075 100644 --- a/src/app/thumbnail/thumbnail.component.spec.ts +++ b/src/app/thumbnail/thumbnail.component.spec.ts @@ -67,31 +67,31 @@ describe('ThumbnailComponent', () => { describe('loading', () => { it('should start out with isLoading$ true', () => { - expect(comp.isLoading).toBeTrue(); + expect(comp.isLoading$.getValue()).toBeTrue(); }); it('should set isLoading$ to false once an image is successfully loaded', () => { comp.setSrc('http://bit.stream'); fixture.debugElement.query(By.css('img.thumbnail-content')).triggerEventHandler('load', new Event('load')); - expect(comp.isLoading).toBeFalse(); + expect(comp.isLoading$.getValue()).toBeFalse(); }); it('should set isLoading$ to false once the src is set to null', () => { comp.setSrc(null); - expect(comp.isLoading).toBeFalse(); + expect(comp.isLoading$.getValue()).toBeFalse(); }); it('should show a loading animation while isLoading$ is true', () => { expect(de.query(By.css('ds-themed-loading'))).toBeTruthy(); - comp.isLoading = false; + comp.isLoading$.next(false); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('ds-themed-loading'))).toBeFalsy(); }); describe('with a thumbnail image', () => { beforeEach(() => { - comp.src = 'https://bit.stream'; + comp.src$.next('https://bit.stream'); fixture.detectChanges(); }); @@ -100,7 +100,7 @@ describe('ThumbnailComponent', () => { expect(img).toBeTruthy(); expect(img.classes['d-none']).toBeTrue(); - comp.isLoading = false; + comp.isLoading$.next(false); fixture.detectChanges(); img = fixture.debugElement.query(By.css('img.thumbnail-content')); expect(img).toBeTruthy(); @@ -111,14 +111,14 @@ describe('ThumbnailComponent', () => { describe('without a thumbnail image', () => { beforeEach(() => { - comp.src = null; + comp.src$.next(null); fixture.detectChanges(); }); it('should only show the HTML placeholder once done loading', () => { expect(fixture.debugElement.query(By.css('div.thumbnail-placeholder'))).toBeFalsy(); - comp.isLoading = false; + comp.isLoading$.next(false); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('div.thumbnail-placeholder'))).toBeTruthy(); }); @@ -214,14 +214,14 @@ describe('ThumbnailComponent', () => { describe('fallback', () => { describe('if there is a default image', () => { it('should display the default image', () => { - comp.src = 'http://bit.stream'; + comp.src$.next('http://bit.stream'); comp.defaultImage = 'http://default.img'; comp.errorHandler(); - expect(comp.src).toBe(comp.defaultImage); + expect(comp.src$.getValue()).toBe(comp.defaultImage); }); it('should include the alt text', () => { - comp.src = 'http://bit.stream'; + comp.src$.next('http://bit.stream'); comp.defaultImage = 'http://default.img'; comp.errorHandler(); @@ -233,10 +233,10 @@ describe('ThumbnailComponent', () => { describe('if there is no default image', () => { it('should display the HTML placeholder', () => { - comp.src = 'http://default.img'; + comp.src$.next('http://default.img'); comp.defaultImage = null; comp.errorHandler(); - expect(comp.src).toBe(null); + expect(comp.src$.getValue()).toBe(null); fixture.detectChanges(); const placeholder = fixture.debugElement.query(By.css('div.thumbnail-placeholder')).nativeElement; @@ -328,7 +328,7 @@ describe('ThumbnailComponent', () => { it('should show the default image', () => { comp.defaultImage = 'default/image.jpg'; comp.ngOnChanges({}); - expect(comp.src).toBe('default/image.jpg'); + expect(comp.src$.getValue()).toBe('default/image.jpg'); }); }); }); diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 0827a33e77..842ead951f 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -1,13 +1,14 @@ -import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { Component, Inject, Input, OnChanges, PLATFORM_ID, SimpleChanges } from '@angular/core'; import { Bitstream } from '../core/shared/bitstream.model'; import { hasNoValue, hasValue } from '../shared/empty.util'; import { RemoteData } from '../core/data/remote-data'; -import { of as observableOf } from 'rxjs'; +import { of as observableOf, BehaviorSubject } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; import { AuthService } from '../core/auth/auth.service'; import { FileService } from '../core/shared/file.service'; +import { isPlatformBrowser } from '@angular/common'; /** * This component renders a given Bitstream as a thumbnail. @@ -34,7 +35,7 @@ export class ThumbnailComponent implements OnChanges { /** * The src attribute used in the template to render the image. */ - src: string = undefined; + src$: BehaviorSubject = new BehaviorSubject(undefined); retriedWithToken = false; @@ -57,9 +58,10 @@ export class ThumbnailComponent implements OnChanges { * Whether the thumbnail is currently loading * Start out as true to avoid flashing the alt text while a thumbnail is being loaded. */ - isLoading = true; + isLoading$: BehaviorSubject = new BehaviorSubject(true); constructor( + @Inject(PLATFORM_ID) private platformID: any, protected auth: AuthService, protected authorizationService: AuthorizationDataService, protected fileService: FileService, @@ -71,16 +73,25 @@ export class ThumbnailComponent implements OnChanges { * Use a default image if no actual image is available. */ ngOnChanges(changes: SimpleChanges): void { - if (hasNoValue(this.thumbnail)) { - this.setSrc(this.defaultImage); - return; - } + if (isPlatformBrowser(this.platformID)) { + // every time the inputs change we need to start the loading animation again, as it's possible + // that thumbnail is first set to null when the parent component initializes and then set to + // the actual value + if (this.isLoading$.getValue() === false) { + this.isLoading$.next(true); + } - const src = this.contentHref; - if (hasValue(src)) { - this.setSrc(src); - } else { - this.setSrc(this.defaultImage); + if (hasNoValue(this.thumbnail)) { + this.setSrc(this.defaultImage); + return; + } + + const src = this.contentHref; + if (hasValue(src)) { + this.setSrc(src); + } else { + this.setSrc(this.defaultImage); + } } } @@ -110,7 +121,7 @@ export class ThumbnailComponent implements OnChanges { * Otherwise, fall back to the default image or a HTML placeholder */ errorHandler() { - const src = this.src; + const src = this.src$.getValue(); const thumbnail = this.bitstream; const thumbnailSrc = thumbnail?._links?.content?.href; @@ -162,9 +173,9 @@ export class ThumbnailComponent implements OnChanges { * @param src */ setSrc(src: string): void { - this.src = src; + this.src$.next(src); if (src === null) { - this.isLoading = false; + this.isLoading$.next(false); } } @@ -172,6 +183,6 @@ export class ThumbnailComponent implements OnChanges { * Stop the loading animation once the thumbnail is successfully loaded */ successHandler() { - this.isLoading = false; + this.isLoading$.next(false); } } From 16839050537e2d3e61dbedd7f0373e2e82d4e5ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 04:55:01 +0000 Subject: [PATCH 03/13] Bump the angular group with 3 updates Bumps the angular group with 3 updates: [@angular/ssr](https://github.com/angular/angular-cli), [@angular-devkit/build-angular](https://github.com/angular/angular-cli) and [@angular/cli](https://github.com/angular/angular-cli). Updates `@angular/ssr` from 17.3.16 to 17.3.17 - [Release notes](https://github.com/angular/angular-cli/releases) - [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular-cli/compare/17.3.16...17.3.17) Updates `@angular-devkit/build-angular` from 17.3.16 to 17.3.17 - [Release notes](https://github.com/angular/angular-cli/releases) - [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular-cli/compare/17.3.16...17.3.17) Updates `@angular/cli` from 17.3.16 to 17.3.17 - [Release notes](https://github.com/angular/angular-cli/releases) - [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md) - [Commits](https://github.com/angular/angular-cli/compare/17.3.16...17.3.17) --- updated-dependencies: - dependency-name: "@angular/ssr" dependency-version: 17.3.17 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: angular - dependency-name: "@angular-devkit/build-angular" dependency-version: 17.3.17 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: angular - dependency-name: "@angular/cli" dependency-version: 17.3.17 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: angular ... Signed-off-by: dependabot[bot] --- package.json | 6 +-- yarn.lock | 115 ++++++++++++++++++++++++--------------------------- 2 files changed, 58 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index d1ed0e7a5c..79c37b2a34 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@angular/platform-browser-dynamic": "^17.3.11", "@angular/platform-server": "^17.3.11", "@angular/router": "^17.3.11", - "@angular/ssr": "^17.3.16", + "@angular/ssr": "^17.3.17", "@babel/runtime": "7.27.1", "@kolkov/ngx-gallery": "^2.0.1", "@ng-bootstrap/ng-bootstrap": "^11.0.0", @@ -125,14 +125,14 @@ }, "devDependencies": { "@angular-builders/custom-webpack": "~17.0.2", - "@angular-devkit/build-angular": "^17.3.16", + "@angular-devkit/build-angular": "^17.3.17", "@angular-eslint/builder": "17.5.3", "@angular-eslint/bundled-angular-compiler": "17.5.3", "@angular-eslint/eslint-plugin": "17.5.3", "@angular-eslint/eslint-plugin-template": "17.5.3", "@angular-eslint/schematics": "17.5.3", "@angular-eslint/template-parser": "17.5.3", - "@angular/cli": "^17.3.16", + "@angular/cli": "^17.3.17", "@angular/compiler-cli": "^17.3.11", "@angular/language-service": "^17.3.11", "@cypress/schematic": "^1.5.0", diff --git a/yarn.lock b/yarn.lock index 13b54d3596..c06acd76b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,12 +31,12 @@ lodash "^4.17.15" webpack-merge "^5.7.3" -"@angular-devkit/architect@0.1703.16", "@angular-devkit/architect@>=0.1700.0 < 0.1800.0": - version "0.1703.16" - resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1703.16.tgz#1088cf9909eb07d816e32572660f9358d45de900" - integrity sha512-wuqKu20ekgzzikUTZD28dS72F6vjniZuiQ7RgAYhykmsU0z0br2tksHQvjD/auzVArtgQir1+V9wp6BN4dSdNQ== +"@angular-devkit/architect@0.1703.17", "@angular-devkit/architect@>=0.1700.0 < 0.1800.0": + version "0.1703.17" + resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1703.17.tgz#4cc8abc39d69214fd905e0300e724252dfc8b130" + integrity sha512-LD6po8lGP2FI7WbnsSxtvpiIi+FYL0aNfteunkT+7po9jUNflBEYHA64UWNO56u7ryKNdbuiN8/TEh7FEUnmCw== dependencies: - "@angular-devkit/core" "17.3.16" + "@angular-devkit/core" "17.3.17" rxjs "7.8.1" "@angular-devkit/architect@^0.1202.10": @@ -47,15 +47,15 @@ "@angular-devkit/core" "12.2.18" rxjs "6.6.7" -"@angular-devkit/build-angular@^17.0.0", "@angular-devkit/build-angular@^17.3.16": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-17.3.16.tgz#5c9032e2a10e4eab01862c9483729622423e395f" - integrity sha512-5JiR1NK3MOwzipAn4UmvJ8yQa6NaBtHBWbLrY0Ps6a21kHWn42C+dpvVdlXN/ZZSpEll/nzA+b77zA3kDrGlKw== +"@angular-devkit/build-angular@^17.0.0", "@angular-devkit/build-angular@^17.3.17": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-17.3.17.tgz#29d6f2611a107d2234c568b53e572ecafd9c7e3f" + integrity sha512-0kLVwjLZ5v4uIaG0K6sHJxxppS0bvjNmxHkbybU8FBW3r5MOBQh/ApsiCQKQQ8GBrQz9qSJvLJH8lsb/uR8aPQ== dependencies: "@ampproject/remapping" "2.3.0" - "@angular-devkit/architect" "0.1703.16" - "@angular-devkit/build-webpack" "0.1703.16" - "@angular-devkit/core" "17.3.16" + "@angular-devkit/architect" "0.1703.17" + "@angular-devkit/build-webpack" "0.1703.17" + "@angular-devkit/core" "17.3.17" "@babel/core" "7.26.10" "@babel/generator" "7.26.10" "@babel/helper-annotate-as-pure" "7.25.9" @@ -66,7 +66,7 @@ "@babel/preset-env" "7.26.9" "@babel/runtime" "7.26.10" "@discoveryjs/json-ext" "0.5.7" - "@ngtools/webpack" "17.3.16" + "@ngtools/webpack" "17.3.17" "@vitejs/plugin-basic-ssl" "1.1.0" ansi-colors "4.1.3" autoprefixer "10.4.18" @@ -78,7 +78,7 @@ css-loader "6.10.0" esbuild-wasm "0.20.1" fast-glob "3.3.2" - http-proxy-middleware "2.0.7" + http-proxy-middleware "2.0.8" https-proxy-agent "7.0.4" inquirer "9.2.15" jsonc-parser "3.2.1" @@ -117,12 +117,12 @@ optionalDependencies: esbuild "0.20.1" -"@angular-devkit/build-webpack@0.1703.16": - version "0.1703.16" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1703.16.tgz#1ee821a86dea719d9b09634776c9803af24cc965" - integrity sha512-ybZr+2F4siu0MztyhSkzN3lIMF0YFeyMaoTygWKjMeGMrkdj4IOAHiR+le2dQ+W4RhwEwQwkV2lvyDJzbivWhg== +"@angular-devkit/build-webpack@0.1703.17": + version "0.1703.17" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1703.17.tgz#7ee01a8c53f6fcaa1928392aab9d119830f7684b" + integrity sha512-81RJe/WFQ1QOJA9du+jK41KaaWXmEWt3frtj9eseWSr+d+Ebt0JMblzM12A70qm7LoUvG48hSiimm7GmkzV3rw== dependencies: - "@angular-devkit/architect" "0.1703.16" + "@angular-devkit/architect" "0.1703.17" rxjs "7.8.1" "@angular-devkit/core@12.2.18", "@angular-devkit/core@^12.2.17": @@ -137,10 +137,10 @@ rxjs "6.6.7" source-map "0.7.3" -"@angular-devkit/core@17.3.16", "@angular-devkit/core@^17.0.0", "@angular-devkit/core@^17.1.0": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-17.3.16.tgz#fc40e767920aded257fb1166c77f4eba44ada460" - integrity sha512-3Dhb/pE3c6P9bDfYLhYb0ArTFYmYSx5QgEUVMuowXJtP/3EyU7lWB2kcuiBZgScxrhRLOiMGMPgcF9jVmvovug== +"@angular-devkit/core@17.3.17", "@angular-devkit/core@^17.0.0", "@angular-devkit/core@^17.1.0": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-17.3.17.tgz#d10dd61727408cf54321c3b22ec881c510ad784f" + integrity sha512-7aNVqS3rOGsSZYAOO44xl2KURwaoOP+EJhJs+LqOGOFpok2kd8YLf4CAMUossMF4H7HsJpgKwYqGrV5eXunrpw== dependencies: ajv "8.12.0" ajv-formats "2.1.1" @@ -158,12 +158,12 @@ ora "5.4.1" rxjs "6.6.7" -"@angular-devkit/schematics@17.3.16": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-17.3.16.tgz#050d67e54777b0c936a0760b3c589795769190a0" - integrity sha512-EcKBdQ02RIwYLHrExOvtrj8FXtTT/Z0IQe8maUy+YkOWjJHsjpdRBOwi3JOICyjnkopOtkkHy/bxu5VKh6rL7A== +"@angular-devkit/schematics@17.3.17": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-17.3.17.tgz#8f6918da99efff09ab33a2d32350164751b88811" + integrity sha512-ZXsIJXZm0I0dNu1BqmjfEtQhnzqoupUHHZb4GHm5NeQHBFZctQlkkNxLUU27GVeBUwFgEmP7kFgSLlMPTGSL5g== dependencies: - "@angular-devkit/core" "17.3.16" + "@angular-devkit/core" "17.3.17" jsonc-parser "3.2.1" magic-string "0.30.8" ora "5.4.1" @@ -243,15 +243,15 @@ optionalDependencies: parse5 "^7.1.2" -"@angular/cli@^17.3.16": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-17.3.16.tgz#a7651e4bb1e2e276ee7c9d0cdef5197aa4594502" - integrity sha512-cG/+aAW7z/o8Tl75U6d+pa+zygV9cvdeY/vb6ve16o4MS6Ifwbls6L51gekYGdWpLl1QnWHLbZFz7+mOa7Um2w== +"@angular/cli@^17.3.17": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-17.3.17.tgz#15464e29db9a806b52d7574f46d1deb705838fbd" + integrity sha512-FgOvf9q5d23Cpa7cjP1FYti/v8S1FTm8DEkW3TY8lkkoxh3isu28GFKcLD1p/XF3yqfPkPVHToOFla5QwsEgBQ== dependencies: - "@angular-devkit/architect" "0.1703.16" - "@angular-devkit/core" "17.3.16" - "@angular-devkit/schematics" "17.3.16" - "@schematics/angular" "17.3.16" + "@angular-devkit/architect" "0.1703.17" + "@angular-devkit/core" "17.3.17" + "@angular-devkit/schematics" "17.3.17" + "@schematics/angular" "17.3.17" "@yarnpkg/lockfile" "1.1.0" ansi-colors "4.1.3" ini "4.1.2" @@ -353,10 +353,10 @@ dependencies: tslib "^2.3.0" -"@angular/ssr@^17.3.16": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@angular/ssr/-/ssr-17.3.16.tgz#323524053a0216993db13a0b0492122775d4a5b7" - integrity sha512-GCtOaex3DIMy0qwYqg4F3NGxiXW9a2ZXbrwF3/Aby4+8QsHH2rilhrAn6OBZjgRpz0T1m/eOuPereAX/guKezw== +"@angular/ssr@^17.3.17": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@angular/ssr/-/ssr-17.3.17.tgz#b8f2f9488f6f142ffbf19356bf7cdde9ecb76a4a" + integrity sha512-hRszFhFPh74n17cjhbRuR0igSwHm4ssB0LgkE4A5tBgYTSoWomRM6nmiyrk10OdQHlLOTFwdTIZ3aPDM5174Ow== dependencies: critters "0.0.22" tslib "^2.3.0" @@ -2052,10 +2052,10 @@ dependencies: tslib "^2.0.0" -"@ngtools/webpack@17.3.16": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-17.3.16.tgz#8e1dce0e964fab6a63f279f1301046a67ec41e61" - integrity sha512-Wxtiut1o9rj3+HumyXoYWg4iCuPDEt4nf1Y9bRCo3y5evEKp0ZTO7IFPpZLaZ0JGGrpROiQErjvHdDQBOuXwWQ== +"@ngtools/webpack@17.3.17": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-17.3.17.tgz#d0206192a2c1d25371be2eb35bdde16c84c07f13" + integrity sha512-LaO++U8DoqV36M0YLKhubc1+NqM8fyp5DN03k1uP9GvtRchP9+7bfG+IEEZiDFkCUh9lfzi1CiGvUHrN4MYcsA== "@ngtools/webpack@^16.2.16": version "16.2.16" @@ -2463,13 +2463,13 @@ resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== -"@schematics/angular@17.3.16": - version "17.3.16" - resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-17.3.16.tgz#f90fdb1352424f1177f2ec7953d7dcb67afe1fa2" - integrity sha512-Ts/cAZmxlIL+AOLbmBylCMjXdHeqWZE2IIYmP5334tQNERSharOlKbLIz5PeESmBDGpH9KRa0wSMK5KXI5ixnQ== +"@schematics/angular@17.3.17": + version "17.3.17" + resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-17.3.17.tgz#48dc73c8de43b257e796e8ad887235c3ba7be677" + integrity sha512-S5HwYem5Yjeceb5OLvforNcjfTMh2qsHnTP1BAYL81XPpqeg2udjAkJjKBxCwxMZSqdCMw3ne0eKppEYTaEZ+A== dependencies: - "@angular-devkit/core" "17.3.16" - "@angular-devkit/schematics" "17.3.16" + "@angular-devkit/core" "17.3.17" + "@angular-devkit/schematics" "17.3.17" jsonc-parser "3.2.1" "@schematics/angular@^12.2.17": @@ -6303,10 +6303,10 @@ http-proxy-agent@^7.0.0: agent-base "^7.1.0" debug "^4.3.4" -http-proxy-middleware@2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" - integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== +http-proxy-middleware@2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.8.tgz#0c3cc655df8213caa51a365f2b69aff377f7bfbf" + integrity sha512-/iazaeFPmL8KLA6QB7DFAU4O5j+9y/TA0D019MbLtPuFI56VK4BXFzM6j6QS9oGpScy8IIDH4S2LHv3zg/63Bw== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1" @@ -10661,12 +10661,7 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1: - version "2.7.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" - integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== - -tslib@^2.8.1: +tslib@^2.0.0, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== From a7bcddf597b41c6789e5a90fc02e7e6ed1d3cfda Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 May 2025 14:38:45 +0200 Subject: [PATCH 04/13] fix issue where thumbnail would sometimes keep loading indefinitely --- src/app/thumbnail/thumbnail.component.ts | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 4b91c147ce..43cce16d36 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -97,13 +97,6 @@ export class ThumbnailComponent implements OnChanges { */ ngOnChanges(changes: SimpleChanges): void { if (isPlatformBrowser(this.platformID)) { - // every time the inputs change we need to start the loading animation again, as it's possible - // that thumbnail is first set to null when the parent component initializes and then set to - // the actual value - if (this.isLoading$.getValue() === false) { - this.isLoading$.next(true); - } - if (hasNoValue(this.thumbnail)) { this.setSrc(this.defaultImage); return; @@ -196,9 +189,22 @@ export class ThumbnailComponent implements OnChanges { * @param src */ setSrc(src: string): void { - this.src$.next(src); - if (src === null) { - this.isLoading$.next(false); + // only update the src if it has changed (the parent component may fire the same one multiple times + if (this.src$.getValue() !== src) { + // every time the src changes we need to start the loading animation again, as it's possible + // that it is first set to null when the parent component initializes and then set to + // the actual value + // + // isLoading$ will be set to false by the error or success handler afterwards, except in the + // case where src is null, then we have to set it manually here (because those handlers won't + // trigger) + if (this.isLoading$.getValue() === false) { + this.isLoading$.next(true); + } + this.src$.next(src); + if (src === null) { + this.isLoading$.next(false); + } } } From c222c446b50dfc156f42e335b82b673e0282e115 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 6 May 2025 14:58:53 +0200 Subject: [PATCH 05/13] don't show the loading animation when src is set to null --- src/app/thumbnail/thumbnail.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 43cce16d36..179af1dac0 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -198,11 +198,11 @@ export class ThumbnailComponent implements OnChanges { // isLoading$ will be set to false by the error or success handler afterwards, except in the // case where src is null, then we have to set it manually here (because those handlers won't // trigger) - if (this.isLoading$.getValue() === false) { + if (src !== null && this.isLoading$.getValue() === false) { this.isLoading$.next(true); } this.src$.next(src); - if (src === null) { + if (src === null && this.isLoading$.getValue() === true) { this.isLoading$.next(false); } } From 5792c4f32dfc195e7f5bb12e564e06b8f096d417 Mon Sep 17 00:00:00 2001 From: Adamo Date: Fri, 6 Dec 2024 09:17:19 +0100 Subject: [PATCH 06/13] [DURACOM-312] updated UploaderOptions to include impersonatingID. (cherry picked from commit 2c79be1456c753665e27b58563e56accc87b0383) (cherry picked from commit 4b0ab8161f0412ed322c265767462e0ef262ce9e) --- src/app/shared/upload/uploader/uploader-options.model.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/shared/upload/uploader/uploader-options.model.ts b/src/app/shared/upload/uploader/uploader-options.model.ts index 559fb0485b..e21628d06e 100644 --- a/src/app/shared/upload/uploader/uploader-options.model.ts +++ b/src/app/shared/upload/uploader/uploader-options.model.ts @@ -22,6 +22,11 @@ export class UploaderOptions { */ maxFileNumber: number; + /** + * Impersonating user uuid + */ + impersonatingID: string; + /** * The request method to use for the file upload request */ From 0439d073746253c0ebc349c901ea38bf921618ca Mon Sep 17 00:00:00 2001 From: Adamo Date: Fri, 6 Dec 2024 09:18:47 +0100 Subject: [PATCH 07/13] [DURACOM-312] set the newly created impersonatingID filed in UploaderOptions. (cherry picked from commit c70fe184208805be8657d4373f50f193e2c6e85f) (cherry picked from commit 70c6af363042676d95e473e3a09a4c7d6d3e5490) --- src/app/submission/form/submission-form.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/submission/form/submission-form.component.ts b/src/app/submission/form/submission-form.component.ts index 74c262befc..67e2e9691b 100644 --- a/src/app/submission/form/submission-form.component.ts +++ b/src/app/submission/form/submission-form.component.ts @@ -209,6 +209,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { distinctUntilChanged()) .subscribe((endpointURL) => { this.uploadFilesOptions.authToken = this.authService.buildAuthHeader(); + this.uploadFilesOptions.impersonatingID = this.authService.getImpersonateID(); this.uploadFilesOptions.url = endpointURL.concat(`/${this.submissionId}`); this.definitionId = this.submissionDefinition.name; this.submissionService.dispatchInit( From 0c564cb9c2d7ba3dfbf331a5c766ec1135fce500 Mon Sep 17 00:00:00 2001 From: Adamo Date: Fri, 6 Dec 2024 09:20:14 +0100 Subject: [PATCH 08/13] [DURACOM-312] set the X-On-Behalf-Of header with impersonatingID in FileUploader. (cherry picked from commit 727bcdc2cb23ae7fcff1d9ddfa794f872f1d1b8c) (cherry picked from commit 0574c8ed9856b28e8a000624f8aad42ca4ec9ecb) --- .../shared/upload/uploader/uploader.component.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/shared/upload/uploader/uploader.component.ts b/src/app/shared/upload/uploader/uploader.component.ts index fbafe811eb..5bb8a44a77 100644 --- a/src/app/shared/upload/uploader/uploader.component.ts +++ b/src/app/shared/upload/uploader/uploader.component.ts @@ -47,6 +47,11 @@ import { UploaderProperties } from './uploader-properties.model'; }) export class UploaderComponent implements OnInit, AfterViewInit { + /** + * Header key to impersonate a user + */ + private readonly ON_BEHALF_HEADER = 'X-On-Behalf-Of'; + /** * The message to show when drag files on the drop zone */ @@ -162,7 +167,13 @@ export class UploaderComponent implements OnInit, AfterViewInit { item.url = this.uploader.options.url; } // Ensure the current XSRF token is included in every upload request (token may change between items uploaded) - this.uploader.options.headers = [{ name: XSRF_REQUEST_HEADER, value: this.tokenExtractor.getToken() }]; + // Ensure the behalf header is set if impersonating + this.uploader.options.headers = [ + { name: XSRF_REQUEST_HEADER, value: this.tokenExtractor.getToken() }, + ...(hasValue(this.uploadFilesOptions.impersonatingID) + ? [{ name: this.ON_BEHALF_HEADER, value: this.uploadFilesOptions.impersonatingID }] + : []) + ]; this.onBeforeUpload(); this.isOverDocumentDropZone = observableOf(false); }; From 577d2413793207bcf8a90ffbe11f38cf989b72a5 Mon Sep 17 00:00:00 2001 From: Adamo Date: Fri, 2 May 2025 11:04:40 +0200 Subject: [PATCH 09/13] [DURACOM-312] lint fix (cherry picked from commit c68e5a181d006969a1fcfbeba9b3274d21549f6a) --- src/app/shared/upload/uploader/uploader.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/shared/upload/uploader/uploader.component.ts b/src/app/shared/upload/uploader/uploader.component.ts index 5bb8a44a77..804200d220 100644 --- a/src/app/shared/upload/uploader/uploader.component.ts +++ b/src/app/shared/upload/uploader/uploader.component.ts @@ -170,10 +170,10 @@ export class UploaderComponent implements OnInit, AfterViewInit { // Ensure the behalf header is set if impersonating this.uploader.options.headers = [ { name: XSRF_REQUEST_HEADER, value: this.tokenExtractor.getToken() }, - ...(hasValue(this.uploadFilesOptions.impersonatingID) - ? [{ name: this.ON_BEHALF_HEADER, value: this.uploadFilesOptions.impersonatingID }] - : []) ]; + if (hasValue(this.uploadFilesOptions.impersonatingID)) { + this.uploader.options.headers.push({ name: this.ON_BEHALF_HEADER, value: this.uploadFilesOptions.impersonatingID }); + } this.onBeforeUpload(); this.isOverDocumentDropZone = observableOf(false); }; From 9e8c0dc2623afc11c9b701cda96c0ed13e16c69a Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Thu, 8 May 2025 11:05:37 +0200 Subject: [PATCH 10/13] always use thumbnail component for files not supported by the media viewer, and switch to themed version of thumbnail component --- src/app/item-page/media-viewer/media-viewer.component.html | 7 +------ .../item-page/media-viewer/media-viewer.component.spec.ts | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/app/item-page/media-viewer/media-viewer.component.html b/src/app/item-page/media-viewer/media-viewer.component.html index a76ee73963..9f33277983 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.html +++ b/src/app/item-page/media-viewer/media-viewer.component.html @@ -16,12 +16,7 @@
- - + diff --git a/src/app/item-page/media-viewer/media-viewer.component.spec.ts b/src/app/item-page/media-viewer/media-viewer.component.spec.ts index 7649e17b71..b4f55dd9d6 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.spec.ts @@ -55,7 +55,7 @@ describe('MediaViewerComponent', () => { 'dc.title': [ { language: null, - value: 'test_word.docx', + value: 'test_image.jpg', }, ], }, @@ -150,9 +150,9 @@ describe('MediaViewerComponent', () => { expect(mediaItem.thumbnail).toBe(null); }); - it('should display a default, thumbnail', () => { + it('should display a default thumbnail', () => { const defaultThumbnail = fixture.debugElement.query( - By.css('ds-media-viewer-image'), + By.css('ds-thumbnail') ); expect(defaultThumbnail.nativeElement).toBeDefined(); }); From 12a3b4f84645297c99c5b126bc96ff15063dfed6 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Thu, 8 May 2025 11:26:14 +0200 Subject: [PATCH 11/13] always use thumbnail component for files not supported by the media viewer, and switch to themed version of thumbnail component --- .../media-viewer.component.spec.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/app/item-page/media-viewer/media-viewer.component.spec.ts b/src/app/item-page/media-viewer/media-viewer.component.spec.ts index b4f55dd9d6..5aad2c9f2a 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.spec.ts @@ -1,4 +1,4 @@ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { NO_ERRORS_SCHEMA, PLATFORM_ID } from '@angular/core'; import { ComponentFixture, TestBed, @@ -27,10 +27,17 @@ import { ThemeService } from '../../shared/theme-support/theme.service'; import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { MediaViewerComponent } from './media-viewer.component'; +import { + AuthorizationDataService +} from '../../core/data/feature-authorization/authorization-data.service'; +import { FileService } from '../../core/shared/file.service'; describe('MediaViewerComponent', () => { let comp: MediaViewerComponent; let fixture: ComponentFixture; + let authService; + let authorizationService; + let fileService; const mockBitstream: Bitstream = Object.assign(new Bitstream(), { sizeBytes: 10201, @@ -73,6 +80,15 @@ describe('MediaViewerComponent', () => { ); beforeEach(waitForAsync(() => { + authService = jasmine.createSpyObj('AuthService', { + isAuthenticated: observableOf(true), + }); + authorizationService = jasmine.createSpyObj('AuthorizationService', { + isAuthorized: observableOf(true), + }); + fileService = jasmine.createSpyObj('FileService', { + retrieveFileDownloadLink: null, + }); return TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot({ @@ -88,6 +104,10 @@ describe('MediaViewerComponent', () => { MetadataFieldWrapperComponent, ], providers: [ + { provide: AuthService, useValue: authService }, + { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: FileService, useValue: fileService }, + { provide: PLATFORM_ID, useValue: 'browser' }, { provide: BitstreamDataService, useValue: bitstreamDataService }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, From 484befafc3de8db3ec080fcbd7fdf3e6fab8e3f0 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Thu, 8 May 2025 12:07:07 +0200 Subject: [PATCH 12/13] fix lint issues --- .../media-viewer/media-viewer.component.spec.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/item-page/media-viewer/media-viewer.component.spec.ts b/src/app/item-page/media-viewer/media-viewer.component.spec.ts index 5aad2c9f2a..b479d30a92 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.spec.ts @@ -1,4 +1,7 @@ -import { NO_ERRORS_SCHEMA, PLATFORM_ID } from '@angular/core'; +import { + NO_ERRORS_SCHEMA, + PLATFORM_ID, +} from '@angular/core'; import { ComponentFixture, TestBed, @@ -14,7 +17,9 @@ import { of as observableOf } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; +import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { Bitstream } from '../../core/shared/bitstream.model'; +import { FileService } from '../../core/shared/file.service'; import { MediaViewerItem } from '../../core/shared/media-viewer-item.model'; import { MetadataFieldWrapperComponent } from '../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; @@ -27,10 +32,6 @@ import { ThemeService } from '../../shared/theme-support/theme.service'; import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { MediaViewerComponent } from './media-viewer.component'; -import { - AuthorizationDataService -} from '../../core/data/feature-authorization/authorization-data.service'; -import { FileService } from '../../core/shared/file.service'; describe('MediaViewerComponent', () => { let comp: MediaViewerComponent; @@ -172,7 +173,7 @@ describe('MediaViewerComponent', () => { it('should display a default thumbnail', () => { const defaultThumbnail = fixture.debugElement.query( - By.css('ds-thumbnail') + By.css('ds-thumbnail'), ); expect(defaultThumbnail.nativeElement).toBeDefined(); }); From 4a4c01b80b853124e330d91d33775398a970df40 Mon Sep 17 00:00:00 2001 From: Andrea Barbasso <´andrea.barbasso@4science.com´> Date: Fri, 18 Oct 2024 16:33:00 +0200 Subject: [PATCH 13/13] [DSC-1847][DSC-1966] fix navbar ui error (cherry picked from commit 49b329edb1f02c66b624029a92a46e50fe4fde55) --- .../header-navbar-wrapper.component.scss | 1 - src/themes/dspace/app/header/header.component.html | 8 ++++---- src/themes/dspace/app/navbar/navbar.component.html | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss index 444d3a9722..5293fdfb57 100644 --- a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss +++ b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss @@ -28,7 +28,6 @@ ::ng-deep { .ds-menu-item, .ds-menu-toggler-wrapper { - white-space: nowrap; text-decoration: none; } diff --git a/src/themes/dspace/app/header/header.component.html b/src/themes/dspace/app/header/header.component.html index e78d19053d..465b0f4d1b 100644 --- a/src/themes/dspace/app/header/header.component.html +++ b/src/themes/dspace/app/header/header.component.html @@ -1,19 +1,19 @@
-
+
+ class="h-100 flex-fill d-flex flex-row flex-nowrap justify-content-start align-items-center gapx-3 flex-grow-1"> -
-
+