diff --git a/.editorconfig b/.editorconfig index 590d1dea08..b7b608644a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,6 +15,10 @@ trim_trailing_whitespace = false [*.ts] quote_type = single +ij_typescript_enforce_trailing_comma = whenmultiline + +[*.js] +ij_javascript_enforce_trailing_comma = whenmultiline [*.json5] ij_json_keep_blank_lines_in_code = 3 diff --git a/.eslintrc.json b/.eslintrc.json index 1e6e67ca76..af2342d822 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -263,9 +263,48 @@ "rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases // Custom DSpace Angular rules + "dspace-angular-ts/alias-imports": [ + "error", + { + "aliases": [ + { + "package": "rxjs", + "imported": "of", + "local": "of" + } + ] + } + ], "dspace-angular-ts/themed-component-classes": "error", "dspace-angular-ts/themed-component-selectors": "error", - "dspace-angular-ts/themed-component-usages": "error" + "dspace-angular-ts/themed-component-usages": "error", + "dspace-angular-ts/themed-decorators": [ + "off", + { + "decorators": { + "listableObjectComponent": 3, + "rendersSectionForMenu": 2 + } + } + ], + "dspace-angular-ts/themed-wrapper-no-input-defaults": "error", + "dspace-angular-ts/unique-decorators": [ + "off", + { + "decorators": [ + "listableObjectComponent" + ] + } + ], + "dspace-angular-ts/sort-standalone-imports": [ + "error", + { + "locale": "en-US", + "maxItems": 0, + "indent": 2, + "trailingComma": true + } + ] } }, { diff --git a/docs/lint/html/rules/no-disabled-attribute-on-button.md b/docs/lint/html/rules/no-disabled-attribute-on-button.md index d9d39ce82c..60ed50732e 100644 --- a/docs/lint/html/rules/no-disabled-attribute-on-button.md +++ b/docs/lint/html/rules/no-disabled-attribute-on-button.md @@ -9,6 +9,8 @@ _______ [Source code](../../../../lint/src/rules/html/no-disabled-attribute-on-button.ts) + + ### Examples @@ -19,24 +21,28 @@ _______ ```html ``` + ##### disabled attribute is still valid on non-button elements ```html ``` + ##### [disabled] attribute is still valid on non-button elements ```html ``` + ##### angular dynamic attributes that use disabled are still valid ```html ``` + @@ -47,6 +53,9 @@ _______ ```html + + + ``` Will produce the following error(s): ``` @@ -63,6 +72,9 @@ Result of `yarn lint --fix`: ```html + + + ``` Will produce the following error(s): ``` diff --git a/docs/lint/html/rules/themed-component-usages.md b/docs/lint/html/rules/themed-component-usages.md index a04fe1c770..aff479d2c0 100644 --- a/docs/lint/html/rules/themed-component-usages.md +++ b/docs/lint/html/rules/themed-component-usages.md @@ -11,6 +11,8 @@ _______ [Source code](../../../../lint/src/rules/html/themed-component-usages.ts) + + ### Examples @@ -23,6 +25,7 @@ _______ ``` + ##### use no-prefix selectors in TypeScript templates @@ -33,6 +36,7 @@ _______ class Test { } ``` + ##### use no-prefix selectors in TypeScript test templates @@ -45,6 +49,7 @@ Filename: `lint/test/fixture/src/test.spec.ts` class Test { } ``` + ##### base selectors are also allowed in TypeScript test templates @@ -57,6 +62,7 @@ Filename: `lint/test/fixture/src/test.spec.ts` class Test { } ``` + @@ -69,6 +75,9 @@ class Test { + + + ``` Will produce the following error(s): ``` @@ -91,6 +100,9 @@ Result of `yarn lint --fix`: + + + ``` Will produce the following error(s): ``` diff --git a/docs/lint/ts/index.md b/docs/lint/ts/index.md index ed060c946e..da22439e1e 100644 --- a/docs/lint/ts/index.md +++ b/docs/lint/ts/index.md @@ -1,6 +1,11 @@ [DSpace ESLint plugins](../../../lint/README.md) > TypeScript rules _______ +- [`dspace-angular-ts/alias-imports`](./rules/alias-imports.md): Unclear imports should be aliased for clarity +- [`dspace-angular-ts/sort-standalone-imports`](./rules/sort-standalone-imports.md): Sorts the standalone `@Component` imports alphabetically - [`dspace-angular-ts/themed-component-classes`](./rules/themed-component-classes.md): Formatting rules for themeable component classes - [`dspace-angular-ts/themed-component-selectors`](./rules/themed-component-selectors.md): Themeable component selectors should follow the DSpace convention - [`dspace-angular-ts/themed-component-usages`](./rules/themed-component-usages.md): Themeable components should be used via their `ThemedComponent` wrapper class +- [`dspace-angular-ts/themed-decorators`](./rules/themed-decorators.md): Entry components with theme support should declare the correct theme +- [`dspace-angular-ts/themed-wrapper-no-input-defaults`](./rules/themed-wrapper-no-input-defaults.md): ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164)) +- [`dspace-angular-ts/unique-decorators`](./rules/unique-decorators.md): Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values) diff --git a/docs/lint/ts/rules/alias-imports.md b/docs/lint/ts/rules/alias-imports.md new file mode 100644 index 0000000000..9a2d6cda2b --- /dev/null +++ b/docs/lint/ts/rules/alias-imports.md @@ -0,0 +1,148 @@ +[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/alias-imports` +_______ + +Unclear imports should be aliased for clarity + +_______ + +[Source code](../../../../lint/src/rules/ts/alias-imports.ts) + + +### Options + +#### `aliases` + +A list of all the imports that you want to alias for clarity. Every alias should be declared in the following format: +```json +{ + "package": "rxjs", + "imported": "of", + "local": "observableOf" +} +``` + + +### Examples + + +#### Valid code + +##### correctly aliased imports + +```typescript +import { of as observableOf } from 'rxjs'; +``` + +With options: + +```json +{ + "aliases": [ + { + "package": "rxjs", + "imported": "of", + "local": "observableOf" + } + ] +} +``` + + +##### enforce unaliased import + +```typescript +import { combineLatest } from 'rxjs'; +``` + +With options: + +```json +{ + "aliases": [ + { + "package": "rxjs", + "imported": "combineLatest", + "local": "combineLatest" + } + ] +} +``` + + + + + +#### Invalid code & automatic fixes + +##### imports without alias + +```typescript +import { of } from 'rxjs'; + + + +``` +Will produce the following error(s): +``` +This import must be aliased +``` + +Result of `yarn lint --fix`: +```typescript +import { of as observableOf } from 'rxjs'; +``` + + +##### imports under the wrong alias + +```typescript +import { of as ofSomething } from 'rxjs'; + + + +``` +Will produce the following error(s): +``` +This import uses the wrong alias (should be {{ local }}) +``` + +Result of `yarn lint --fix`: +```typescript +import { of as observableOf } from 'rxjs'; +``` + + +##### disallow aliasing import + +```typescript +import { combineLatest as observableCombineLatest } from 'rxjs'; + + +With options: + +```json +{ + "aliases": [ + { + "package": "rxjs", + "imported": "combineLatest", + "local": "combineLatest" + } + ] +} +``` + + +``` +Will produce the following error(s): +``` +This import should not use an alias +``` + +Result of `yarn lint --fix`: +```typescript +import { combineLatest } from 'rxjs'; +``` + + + diff --git a/docs/lint/ts/rules/sort-standalone-imports.md b/docs/lint/ts/rules/sort-standalone-imports.md new file mode 100644 index 0000000000..d6c7896c3e --- /dev/null +++ b/docs/lint/ts/rules/sort-standalone-imports.md @@ -0,0 +1,245 @@ +[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/sort-standalone-imports` +_______ + +Sorts the standalone `@Component` imports alphabetically + +_______ + +[Source code](../../../../lint/src/rules/ts/sort-standalone-imports.ts) + + +### Options + +#### `locale` + +The locale used to sort the imports., +#### `maxItems` + +The maximum number of imports that should be displayed before each import is separated onto its own line., +#### `indent` + +The indent used for the project., +#### `trailingComma` + +Whether the last import should have a trailing comma (only applicable for multiline imports). + + +### Examples + + +#### Valid code + +##### should sort multiple imports on separate lines + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + RootComponent, + ], +}) +export class AppComponent {} +``` + + +##### should not inlines singular imports when maxItems is 0 + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + ], +}) +export class AppComponent {} +``` + + +##### should inline singular imports when maxItems is 1 + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [RootComponent], +}) +export class AppComponent {} +``` + +With options: + +```json +{ + "maxItems": 1 +} +``` + + + + + +#### Invalid code & automatic fixes + +##### should sort multiple imports alphabetically + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + AsyncPipe, + ], +}) +export class AppComponent {} + + + +``` +Will produce the following error(s): +``` +Standalone imports should be sorted alphabetically +``` + +Result of `yarn lint --fix`: +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + RootComponent, + ], +}) +export class AppComponent {} +``` + + +##### should not put singular imports on one line when maxItems is 0 + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [RootComponent], +}) +export class AppComponent {} + + + +``` +Will produce the following error(s): +``` +Standalone imports should be sorted alphabetically +``` + +Result of `yarn lint --fix`: +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + ], +}) +export class AppComponent {} +``` + + +##### should not put singular imports on a separate line when maxItems is 1 + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + ], +}) +export class AppComponent {} + + +With options: + +```json +{ + "maxItems": 1 +} +``` + + +``` +Will produce the following error(s): +``` +Standalone imports should be sorted alphabetically +``` + +Result of `yarn lint --fix`: +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [RootComponent], +}) +export class AppComponent {} +``` + + +##### should not display multiple imports on the same line + +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [AsyncPipe, RootComponent], +}) +export class AppComponent {} + + + +``` +Will produce the following error(s): +``` +Standalone imports should be sorted alphabetically +``` + +Result of `yarn lint --fix`: +```typescript +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + RootComponent, + ], +}) +export class AppComponent {} +``` + + + diff --git a/docs/lint/ts/rules/themed-component-classes.md b/docs/lint/ts/rules/themed-component-classes.md index 1f4ec72801..0f64dc8907 100644 --- a/docs/lint/ts/rules/themed-component-classes.md +++ b/docs/lint/ts/rules/themed-component-classes.md @@ -11,6 +11,8 @@ _______ [Source code](../../../../lint/src/rules/ts/themed-component-classes.ts) + + ### Examples @@ -26,6 +28,7 @@ _______ class Something { } ``` + ##### Base component @@ -34,9 +37,10 @@ class Something { selector: 'ds-base-test-themable', standalone: true, }) -class TestThemeableTomponent { +class TestThemeableComponent { } ``` + ##### Wrapper component @@ -50,9 +54,10 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts` TestThemeableComponent, ], }) -class ThemedTestThemeableTomponent extends ThemedComponent { +class ThemedTestThemeableComponent extends ThemedComponent { } ``` + ##### Override component @@ -66,6 +71,7 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t class Override extends BaseComponent { } ``` + @@ -80,6 +86,9 @@ class Override extends BaseComponent { }) class TestThemeableComponent { } + + + ``` Will produce the following error(s): ``` @@ -107,6 +116,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts` }) class ThemedTestThemeableComponent extends ThemedComponent { } + + + ``` Will produce the following error(s): ``` @@ -137,6 +149,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts` }) class ThemedTestThemeableComponent extends ThemedComponent { } + + + ``` Will produce the following error(s): ``` @@ -171,6 +186,9 @@ import { SomethingElse } from './somewhere-else'; }) class ThemedTestThemeableComponent extends ThemedComponent { } + + + ``` Will produce the following error(s): ``` @@ -207,6 +225,9 @@ import { Something, SomethingElse } from './somewhere-else'; }) class ThemedTestThemeableComponent extends ThemedComponent { } + + + ``` Will produce the following error(s): ``` @@ -237,6 +258,9 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t }) class Override extends BaseComponent { } + + + ``` Will produce the following error(s): ``` diff --git a/docs/lint/ts/rules/themed-component-selectors.md b/docs/lint/ts/rules/themed-component-selectors.md index f4d0ea177c..bf150223ba 100644 --- a/docs/lint/ts/rules/themed-component-selectors.md +++ b/docs/lint/ts/rules/themed-component-selectors.md @@ -17,6 +17,8 @@ _______ [Source code](../../../../lint/src/rules/ts/themed-component-selectors.ts) + + ### Examples @@ -31,6 +33,7 @@ _______ class Something { } ``` + ##### Themeable component selector should replace the original version, unthemed version should be changed to ds-base- @@ -53,6 +56,7 @@ class ThemedSomething extends ThemedComponent { class OverrideSomething extends Something { } ``` + ##### Other themed component wrappers should not interfere @@ -69,6 +73,7 @@ class Something { class ThemedSomethingElse extends ThemedComponent { } ``` + @@ -85,6 +90,9 @@ Filename: `lint/test/fixture/src/app/test/test-themeable.component.ts` }) class TestThemeableComponent { } + + + ``` Will produce the following error(s): ``` @@ -111,6 +119,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts` }) class ThemedTestThemeableComponent extends ThemedComponent { } + + + ``` Will produce the following error(s): ``` @@ -137,6 +148,9 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t }) class TestThememeableComponent extends BaseComponent { } + + + ``` Will produce the following error(s): ``` diff --git a/docs/lint/ts/rules/themed-component-usages.md b/docs/lint/ts/rules/themed-component-usages.md index 16ccb701c2..2aab911af9 100644 --- a/docs/lint/ts/rules/themed-component-usages.md +++ b/docs/lint/ts/rules/themed-component-usages.md @@ -15,6 +15,8 @@ _______ [Source code](../../../../lint/src/rules/ts/themed-component-usages.ts) + + ### Examples @@ -30,6 +32,7 @@ const config = { b: ChipsComponent, } ``` + ##### allow base class in class declaration @@ -37,6 +40,7 @@ const config = { export class TestThemeableComponent { } ``` + ##### allow inheriting from base class @@ -46,6 +50,7 @@ import { TestThemeableComponent } from './app/test/test-themeable.component'; export class ThemedAdminSidebarComponent extends ThemedComponent { } ``` + ##### allow base class in ViewChild @@ -56,6 +61,7 @@ export class Something { @ViewChild(TestThemeableComponent) test: TestThemeableComponent; } ``` + ##### allow wrapper selectors in test queries @@ -65,6 +71,7 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts` By.css('ds-themeable'); By.css('#test > ds-themeable > #nest'); ``` + ##### allow wrapper selectors in cypress queries @@ -74,6 +81,7 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts` By.css('ds-themeable'); By.css('#test > ds-themeable > #nest'); ``` + @@ -90,6 +98,9 @@ const config = { a: TestThemeableComponent, b: TestComponent, } + + + ``` Will produce the following error(s): ``` @@ -120,6 +131,9 @@ const config = { b: TestComponent, c: Something, } + + + ``` Will produce the following error(s): ``` @@ -150,6 +164,9 @@ const DECLARATIONS = [ Something, ThemedTestThemeableComponent, ]; + + + ``` Will produce the following error(s): ``` @@ -173,6 +190,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts` ```typescript By.css('ds-themed-themeable'); By.css('#test > ds-themed-themeable > #nest'); + + + ``` Will produce the following error(s): ``` @@ -194,6 +214,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts` ```typescript By.css('ds-base-themeable'); By.css('#test > ds-base-themeable > #nest'); + + + ``` Will produce the following error(s): ``` @@ -215,6 +238,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts` ```typescript cy.get('ds-themed-themeable'); cy.get('#test > ds-themed-themeable > #nest'); + + + ``` Will produce the following error(s): ``` @@ -236,6 +262,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts` ```typescript cy.get('ds-base-themeable'); cy.get('#test > ds-base-themeable > #nest'); + + + ``` Will produce the following error(s): ``` @@ -266,6 +295,9 @@ import { TestThemeableComponent } from '../../../../app/test/test-themeable.comp }) export class UsageComponent { } + + + ``` Will produce the following error(s): ``` @@ -306,6 +338,9 @@ import { ThemedTestThemeableComponent } from '../../../../app/test/themed-test-t }) export class UsageComponent { } + + + ``` Will produce the following error(s): ``` diff --git a/docs/lint/ts/rules/themed-decorators.md b/docs/lint/ts/rules/themed-decorators.md new file mode 100644 index 0000000000..6a9a0bf693 --- /dev/null +++ b/docs/lint/ts/rules/themed-decorators.md @@ -0,0 +1,183 @@ +[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/themed-decorators` +_______ + +Entry components with theme support should declare the correct theme + +_______ + +[Source code](../../../../lint/src/rules/ts/themed-decorators.ts) + + +### Options + +#### `decorators` + +A mapping for all the existing themeable decorators, with the decorator name as the key and the index of the `theme` argument as the value. + + +### Examples + + +#### Valid code + +##### theme file declares the correct theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test') +export class Something extends SomethingElse { +} +``` + + +##### plain file declares no theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined) +export class Something extends SomethingElse { +} +``` + + +##### plain file declares explicit undefined theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined, undefined) +export class Something extends SomethingElse { +} +``` + + +##### test file declares theme outside of theme directory + +Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.spec.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test') +export class Something extends SomethingElse { +} +``` + + +##### only track configured decorators + +Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts` + +```typescript +@something('test') +export class Something extends SomethingElse { +} +``` + + + + + +#### Invalid code & automatic fixes + +##### theme file declares the wrong theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} + + + +``` +Will produce the following error(s): +``` +Wrong theme declaration in decorator +``` + +Result of `yarn lint --fix`: +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test') +export class Something extends SomethingElse { +} +``` + + +##### plain file declares a theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} + + + +``` +Will produce the following error(s): +``` +There is a theme declaration in decorator, but this file is not part of a theme +``` + +Result of `yarn lint --fix`: +```typescript +@listableObjectComponent(something, somethingElse, undefined) +export class Something extends SomethingElse { +} +``` + + +##### theme file declares no theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined) +export class Something extends SomethingElse { +} + + + +``` +Will produce the following error(s): +``` +No theme declaration in decorator +``` + +Result of `yarn lint --fix`: +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} +``` + + +##### theme file declares explicit undefined theme in @listableObjectComponent + +Filename: `lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts` + +```typescript +@listableObjectComponent(something, somethingElse, undefined, undefined) +export class Something extends SomethingElse { +} + + + +``` +Will produce the following error(s): +``` +No theme declaration in decorator +``` + +Result of `yarn lint --fix`: +```typescript +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} +``` + + + diff --git a/docs/lint/ts/rules/themed-wrapper-no-input-defaults.md b/docs/lint/ts/rules/themed-wrapper-no-input-defaults.md new file mode 100644 index 0000000000..4e8e833325 --- /dev/null +++ b/docs/lint/ts/rules/themed-wrapper-no-input-defaults.md @@ -0,0 +1,92 @@ +[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/themed-wrapper-no-input-defaults` +_______ + +ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164)) + +_______ + +[Source code](../../../../lint/src/rules/ts/themed-wrapper-no-input-defaults.ts) + + + +### Examples + + +#### Valid code + +##### ThemedComponent wrapper defines an input without a default value + +```typescript +export class TTest extends ThemedComponent { + +@Input() +test; +} +``` + + +##### Regular class defines an input with a default value + +```typescript +export class Test { + +@Input() +test = 'test'; +} +``` + + + + + +#### Invalid code + +##### ThemedComponent wrapper defines an input with a default value + +```typescript +export class TTest extends ThemedComponent { + +@Input() +test1 = 'test'; + +@Input() +test2 = true; + +@Input() +test2: number = 123; + +@Input() +test3: number[] = [1,2,3]; +} + + + +``` +Will produce the following error(s): +``` +ThemedComponent wrapper declares inputs with defaults +ThemedComponent wrapper declares inputs with defaults +ThemedComponent wrapper declares inputs with defaults +ThemedComponent wrapper declares inputs with defaults +``` + + +##### ThemedComponent wrapper defines an input with an undefined default value + +```typescript +export class TTest extends ThemedComponent { + +@Input() +test = undefined; +} + + + +``` +Will produce the following error(s): +``` +ThemedComponent wrapper declares inputs with defaults +``` + + + diff --git a/docs/lint/ts/rules/unique-decorators.md b/docs/lint/ts/rules/unique-decorators.md new file mode 100644 index 0000000000..70ba1235ef --- /dev/null +++ b/docs/lint/ts/rules/unique-decorators.md @@ -0,0 +1,86 @@ +[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/unique-decorators` +_______ + +Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values) + +_______ + +[Source code](../../../../lint/src/rules/ts/unique-decorators.ts) + + +### Options + +#### `decorators` + +The list of all the decorators for which you want to enforce this behavior. + + +### Examples + + +#### Valid code + +##### checked decorator, no repetitions + +```typescript +@listableObjectComponent(a) +export class A { +} + +@listableObjectComponent(a, 'b') +export class B { +} + +@listableObjectComponent(a, 'b', 3) +export class C { +} + +@listableObjectComponent(a, 'b', 3, Enum.TEST1) +export class C { +} + +@listableObjectComponent(a, 'b', 3, Enum.TEST2) +export class C { +} +``` + + +##### unchecked decorator, some repetitions + +```typescript +@something(a) +export class A { +} + +@something(a) +export class B { +} +``` + + + + + +#### Invalid code + +##### checked decorator, some repetitions + +```typescript +@listableObjectComponent(a) +export class A { +} + +@listableObjectComponent(a) +export class B { +} + + + +``` +Will produce the following error(s): +``` +Duplicate decorator call +``` + + + diff --git a/lint/src/rules/html/no-disabled-attribute-on-button.ts b/lint/src/rules/html/no-disabled-attribute-on-button.ts index bf1a72d70d..6a5fad0081 100644 --- a/lint/src/rules/html/no-disabled-attribute-on-button.ts +++ b/lint/src/rules/html/no-disabled-attribute-on-button.ts @@ -33,6 +33,7 @@ export const info = { [Message.USE_DSBTN_DISABLED]: 'Buttons should use the `dsBtnDisabled` directive instead of the `disabled` attribute.', }, }, + optionDocs: [], defaultOptions: [], } as DSpaceESLintRuleInfo; diff --git a/lint/src/rules/html/themed-component-usages.ts b/lint/src/rules/html/themed-component-usages.ts index e907285dbc..a45d442ac4 100644 --- a/lint/src/rules/html/themed-component-usages.ts +++ b/lint/src/rules/html/themed-component-usages.ts @@ -45,6 +45,7 @@ The only exception to this rule are unit tests, where we may want to use the bas [Message.WRONG_SELECTOR]: 'Themeable components should be used via their ThemedComponent wrapper\'s selector', }, }, + optionDocs: [], defaultOptions: [], } as DSpaceESLintRuleInfo; diff --git a/lint/src/rules/ts/alias-imports.ts b/lint/src/rules/ts/alias-imports.ts new file mode 100644 index 0000000000..5ff5726374 --- /dev/null +++ b/lint/src/rules/ts/alias-imports.ts @@ -0,0 +1,304 @@ +import { + AST_NODE_TYPES, + ESLintUtils, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; +import { Scope } from '@typescript-eslint/utils/ts-eslint'; + +import { + DSpaceESLintRuleInfo, + NamedTests, + OptionDoc, +} from '../../util/structure'; + +export enum Message { + MISSING_ALIAS = 'missingAlias', + WRONG_ALIAS = 'wrongAlias', + MULTIPLE_ALIASES = 'multipleAliases', + UNNECESSARY_ALIAS = 'unnecessaryAlias', +} + +interface AliasImportOptions { + aliases: AliasImportOption[]; +} + +interface AliasImportOption { + package: string; + imported: string; + local: string; +} + +interface AliasImportDocOptions { + aliases: OptionDoc; +} + +export const info: DSpaceESLintRuleInfo<[AliasImportOptions], [AliasImportDocOptions]> = { + name: 'alias-imports', + meta: { + docs: { + description: 'Unclear imports should be aliased for clarity', + }, + messages: { + [Message.MISSING_ALIAS]: 'This import must be aliased', + [Message.WRONG_ALIAS]: 'This import uses the wrong alias (should be {{ local }})', + [Message.MULTIPLE_ALIASES]: 'This import was used twice with a different alias (should be {{ local }})', + [Message.UNNECESSARY_ALIAS]: 'This import should not use an alias', + }, + fixable: 'code', + type: 'problem', + schema: { + type: 'array', + items: { + type: 'object', + properties: { + package: { type: 'string' }, + imported: { type: 'string' }, + local: { type: 'string' }, + }, + }, + }, + }, + optionDocs: [ + { + aliases: { + title: '`aliases`', + description: `A list of all the imports that you want to alias for clarity. Every alias should be declared in the following format: +\`\`\`json +{ + "package": "rxjs", + "imported": "of", + "local": "observableOf" +} +\`\`\``, + }, + }, + ], + defaultOptions: [ + { + aliases: [ + { + package: 'rxjs', + imported: 'of', + local: 'observableOf', + }, + ], + }, + ], +}; + +export const rule = ESLintUtils.RuleCreator.withoutDocs({ + ...info, + create(context: TSESLint.RuleContext, options: any) { + return (options[0] as AliasImportOptions).aliases.reduce((selectors: any, option: AliasImportOption) => { + selectors[`ImportDeclaration[source.value = "${option.package}"] > ImportSpecifier[imported.name = "${option.imported}"][local.name != "${option.local}"]`] = (node: TSESTree.ImportSpecifier) => handleUnaliasedImport(context, option, node); + return selectors; + }, {}); + }, +}); + +export const tests: NamedTests = { + plugin: info.name, + valid: [ + { + name: 'correctly aliased imports', + code: ` +import { of as observableOf } from 'rxjs'; + `, + options: [ + { + aliases: [ + { + package: 'rxjs', + imported: 'of', + local: 'observableOf', + }, + ], + }, + ], + }, + { + name: 'enforce unaliased import', + code: ` +import { combineLatest } from 'rxjs'; + `, + options: [ + { + aliases: [ + { + package: 'rxjs', + imported: 'combineLatest', + local: 'combineLatest', + }, + ], + }, + ], + }, + ], + invalid: [ + { + name: 'imports without alias', + code: ` +import { of } from 'rxjs'; + `, + errors: [ + { + messageId: 'missingAlias', + }, + ], + output: ` +import { of as observableOf } from 'rxjs'; + `, + }, + { + name: 'imports under the wrong alias', + code: ` +import { of as ofSomething } from 'rxjs'; + `, + errors: [ + { + messageId: 'wrongAlias', + }, + ], + output: ` +import { of as observableOf } from 'rxjs'; + `, + }, + { + name: 'disallow aliasing import', + code: ` +import { combineLatest as observableCombineLatest } from 'rxjs'; + `, + errors: [ + { + messageId: 'unnecessaryAlias', + }, + ], + output: ` +import { combineLatest } from 'rxjs'; + `, + options: [ + { + aliases: [ + { + package: 'rxjs', + imported: 'combineLatest', + local: 'combineLatest', + }, + ], + }, + ], + }, + ], +}; + +/** + * Replaces the incorrectly aliased imports with the ones defined in the defaultOptions + * + * @param context The current {@link TSESLint.RuleContext} + * @param option The current {@link AliasImportOption} that needs to be handled + * @param node The incorrect import node that should be fixed + */ +function handleUnaliasedImport(context: TSESLint.RuleContext, option: AliasImportOption, node: TSESTree.ImportSpecifier): void { + const hasCorrectAliasedImport: boolean = (node.parent as TSESTree.ImportDeclaration).specifiers.find((specifier: TSESTree.ImportClause) => specifier.local.name === option.local && specifier.type === AST_NODE_TYPES.ImportSpecifier && (specifier as TSESTree.ImportSpecifier).imported.name === option.imported) !== undefined; + if (option.imported === option.local) { + if (hasCorrectAliasedImport) { + context.report({ + messageId: Message.MULTIPLE_ALIASES, + data: { local: option.local }, + node: node, + fix(fixer: TSESLint.RuleFixer) { + const fixes: TSESLint.RuleFix[] = []; + + const commaAfter = context.sourceCode.getTokenAfter(node, { + filter: (token: TSESTree.Token) => token.value === ',', + }); + if (commaAfter) { + fixes.push(fixer.removeRange([node.range[0], commaAfter.range[1]])); + } else { + fixes.push(fixer.remove(node)); + } + fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local)); + + return fixes; + }, + }); + } else { + context.report({ + messageId: Message.UNNECESSARY_ALIAS, + data: { local: option.local }, + node: node, + fix(fixer: TSESLint.RuleFixer) { + const fixes: TSESLint.RuleFix[] = []; + + fixes.push(fixer.replaceText(node, option.imported)); + fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local)); + + return fixes; + }, + }); + } + } else { + if (hasCorrectAliasedImport) { + context.report({ + messageId: Message.MULTIPLE_ALIASES, + data: { local: option.local }, + node: node, + fix(fixer: TSESLint.RuleFixer) { + const fixes: TSESLint.RuleFix[] = []; + + const commaAfter = context.sourceCode.getTokenAfter(node, { + filter: (token: TSESTree.Token) => token.value === ',', + }); + if (commaAfter) { + fixes.push(fixer.removeRange([node.range[0], commaAfter.range[1]])); + } else { + fixes.push(fixer.remove(node)); + } + fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local)); + + return fixes; + }, + }); + } else if (node.local.name === node.imported.name) { + context.report({ + messageId: Message.MISSING_ALIAS, + node: node, + fix(fixer: TSESLint.RuleFixer) { + const fixes: TSESLint.RuleFix[] = []; + + fixes.push(fixer.replaceText(node.local, `${option.imported} as ${option.local}`)); + fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local)); + + return fixes; + }, + }); + } else { + context.report({ + messageId: Message.WRONG_ALIAS, + data: { local: option.local }, + node: node, + fix(fixer: TSESLint.RuleFixer) { + const fixes: TSESLint.RuleFix[] = []; + + fixes.push(fixer.replaceText(node.local, option.local)); + fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local)); + + return fixes; + }, + }); + } + } +} + +/** + * Generates the {@link TSESLint.RuleFix}s for all the usages of the incorrect import. + * + * @param context The current {@link TSESLint.RuleContext} + * @param fixer The instance {@link TSESLint.RuleFixer} + * @param node The node which needs to be replaced + * @param newAlias The new import name + */ +function retrieveUsageReplacementFixes(context: TSESLint.RuleContext, fixer: TSESLint.RuleFixer, node: TSESTree.ImportSpecifier, newAlias: string): TSESLint.RuleFix[] { + return context.sourceCode.getDeclaredVariables(node)[0].references.map((reference: Scope.Reference) => fixer.replaceText(reference.identifier, newAlias)); +} diff --git a/lint/src/rules/ts/index.ts b/lint/src/rules/ts/index.ts index a7fdfe41ef..531f0b3b9f 100644 --- a/lint/src/rules/ts/index.ts +++ b/lint/src/rules/ts/index.ts @@ -10,14 +10,24 @@ import { RuleExports, } from '../../util/structure'; /* eslint-disable import/no-namespace */ +import * as aliasImports from './alias-imports'; +import * as sortStandaloneImports from './sort-standalone-imports'; import * as themedComponentClasses from './themed-component-classes'; import * as themedComponentSelectors from './themed-component-selectors'; import * as themedComponentUsages from './themed-component-usages'; +import * as themedDecorators from './themed-decorators'; +import * as themedWrapperNoInputDefaults from './themed-wrapper-no-input-defaults'; +import * as uniqueDecorators from './unique-decorators'; const index = [ + aliasImports, + sortStandaloneImports, themedComponentClasses, themedComponentSelectors, themedComponentUsages, + themedDecorators, + themedWrapperNoInputDefaults, + uniqueDecorators, ] as unknown as RuleExports[]; export = { diff --git a/lint/src/rules/ts/sort-standalone-imports.ts b/lint/src/rules/ts/sort-standalone-imports.ts new file mode 100644 index 0000000000..fa8d45becc --- /dev/null +++ b/lint/src/rules/ts/sort-standalone-imports.ts @@ -0,0 +1,306 @@ +import { + ASTUtils as TSESLintASTUtils, + ESLintUtils, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; + +import { + DSpaceESLintRuleInfo, + NamedTests, + OptionDoc, +} from '../../util/structure'; + +const DEFAULT_LOCALE = 'en-US'; +const DEFAULT_MAX_SIZE = 0; +const DEFAULT_SPACE_INDENT_AMOUNT = 2; +const DEFAULT_TRAILING_COMMA = true; + +export enum Message { + SORT_STANDALONE_IMPORTS_ARRAYS = 'sortStandaloneImportsArrays', +} + +export interface UniqueDecoratorsOptions { + locale: string; + maxItems: number; + indent: number; + trailingComma: boolean; +} + +export interface UniqueDecoratorsDocOptions { + locale: OptionDoc; + maxItems: OptionDoc; + indent: OptionDoc; + trailingComma: OptionDoc; +} + +export const info: DSpaceESLintRuleInfo<[UniqueDecoratorsOptions], [UniqueDecoratorsDocOptions]> = { + name: 'sort-standalone-imports', + meta: { + docs: { + description: 'Sorts the standalone `@Component` imports alphabetically', + }, + messages: { + [Message.SORT_STANDALONE_IMPORTS_ARRAYS]: 'Standalone imports should be sorted alphabetically', + }, + fixable: 'code', + type: 'problem', + schema: [ + { + type: 'object', + properties: { + locale: { + type: 'string', + }, + maxItems: { + type: 'number', + }, + indent: { + type: 'number', + }, + trailingComma: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + optionDocs: [ + { + locale: { + title: '`locale`', + description: 'The locale used to sort the imports.', + }, + maxItems: { + title: '`maxItems`', + description: 'The maximum number of imports that should be displayed before each import is separated onto its own line.', + }, + indent: { + title: '`indent`', + description: 'The indent used for the project.', + }, + trailingComma: { + title: '`trailingComma`', + description: 'Whether the last import should have a trailing comma (only applicable for multiline imports).', + }, + }, + ], + defaultOptions: [ + { + locale: DEFAULT_LOCALE, + maxItems: DEFAULT_MAX_SIZE, + indent: DEFAULT_SPACE_INDENT_AMOUNT, + trailingComma: DEFAULT_TRAILING_COMMA, + }, + ], +}; + +export const rule = ESLintUtils.RuleCreator.withoutDocs({ + ...info, + create(context: TSESLint.RuleContext, [{ locale, maxItems, indent, trailingComma }]: any) { + return { + ['ClassDeclaration > Decorator > CallExpression[callee.name="Component"] > ObjectExpression > Property[key.name="imports"] > ArrayExpression']: (node: TSESTree.ArrayExpression) => { + const elements = node.elements.filter((element) => element !== null && (TSESLintASTUtils.isIdentifier(element) || element?.type === TSESTree.AST_NODE_TYPES.CallExpression)); + const sortedNames: string[] = elements + .map((element) => context.sourceCode.getText(element!)) + .sort((a: string, b: string) => a.localeCompare(b, locale)); + + const isSorted: boolean = elements.every((identifier, index) => context.sourceCode.getText(identifier!) === sortedNames[index]); + + const requiresMultiline: boolean = maxItems < node.elements.length; + const isMultiline: boolean = /\n/.test(context.sourceCode.getText(node)); + + const incorrectFormat: boolean = requiresMultiline !== isMultiline; + + if (isSorted && !incorrectFormat) { + return; + } + + context.report({ + node: node.parent, + messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS, + fix: (fixer: TSESLint.RuleFixer) => { + if (requiresMultiline) { + const multilineImports: string = sortedNames + .map((name: string) => `${' '.repeat(2 * indent)}${name}${trailingComma ? ',' : ''}`) + .join(trailingComma ? '\n' : ',\n'); + + return fixer.replaceText(node, `[\n${multilineImports}\n${' '.repeat(indent)}]`); + } else { + return fixer.replaceText(node, `[${sortedNames.join(', ')}]`); + } + }, + }); + }, + }; + }, +}); + +export const tests: NamedTests = { + plugin: info.name, + valid: [ + { + name: 'should sort multiple imports on separate lines', + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + RootComponent, + ], +}) +export class AppComponent {}`, + }, + { + name: 'should not inlines singular imports when maxItems is 0', + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + ], +}) +export class AppComponent {}`, + }, + { + name: 'should inline singular imports when maxItems is 1', + options: [{ maxItems: 1 }], + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [RootComponent], +}) +export class AppComponent {}`, + }, + ], + invalid: [ + { + name: 'should sort multiple imports alphabetically', + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + AsyncPipe, + ], +}) +export class AppComponent {}`, + errors: [ + { + messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS, + }, + ], + output: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + RootComponent, + ], +}) +export class AppComponent {}`, + }, + { + name: 'should not put singular imports on one line when maxItems is 0', + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [RootComponent], +}) +export class AppComponent {}`, + errors: [ + { + messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS, + }, + ], + output: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + ], +}) +export class AppComponent {}`, + }, + { + name: 'should not put singular imports on a separate line when maxItems is 1', + options: [{ maxItems: 1 }], + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + RootComponent, + ], +}) +export class AppComponent {}`, + errors: [ + { + messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS, + }, + ], + output: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [RootComponent], +}) +export class AppComponent {}`, + }, + { + name: 'should not display multiple imports on the same line', + code: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [AsyncPipe, RootComponent], +}) +export class AppComponent {}`, + errors: [ + { + messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS, + }, + ], + output: ` +@Component({ + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + RootComponent, + ], +}) +export class AppComponent {}`, + }, + ], +}; diff --git a/lint/src/rules/ts/themed-component-classes.ts b/lint/src/rules/ts/themed-component-classes.ts index 527655adfa..d52e06524d 100644 --- a/lint/src/rules/ts/themed-component-classes.ts +++ b/lint/src/rules/ts/themed-component-classes.ts @@ -52,6 +52,7 @@ export const info = { [Message.WRAPPER_IMPORTS_BASE]: 'Themed component wrapper classes must only import the base class', }, }, + optionDocs: [], defaultOptions: [], } as DSpaceESLintRuleInfo; @@ -180,7 +181,7 @@ class Something { selector: 'ds-base-test-themable', standalone: true, }) -class TestThemeableTomponent { +class TestThemeableComponent { } `, }, @@ -195,7 +196,7 @@ class TestThemeableTomponent { TestThemeableComponent, ], }) -class ThemedTestThemeableTomponent extends ThemedComponent { +class ThemedTestThemeableComponent extends ThemedComponent { } `, }, diff --git a/lint/src/rules/ts/themed-component-selectors.ts b/lint/src/rules/ts/themed-component-selectors.ts index c27fd66d66..e606eb4358 100644 --- a/lint/src/rules/ts/themed-component-selectors.ts +++ b/lint/src/rules/ts/themed-component-selectors.ts @@ -53,6 +53,7 @@ Unit tests are exempt from this rule, because they may redefine components using [Message.THEMED]: 'Theme override of themeable component should have a selector starting with \'ds-themed-\'', }, }, + optionDocs: [], defaultOptions: [], } as DSpaceESLintRuleInfo; diff --git a/lint/src/rules/ts/themed-component-usages.ts b/lint/src/rules/ts/themed-component-usages.ts index 83fe6f8ea8..37eb6dc454 100644 --- a/lint/src/rules/ts/themed-component-usages.ts +++ b/lint/src/rules/ts/themed-component-usages.ts @@ -63,6 +63,7 @@ There are a few exceptions where the base class can still be used: [Message.BASE_IN_MODULE]: 'Base themeable components shouldn\'t be declared in modules', }, }, + optionDocs: [], defaultOptions: [], } as DSpaceESLintRuleInfo; diff --git a/lint/src/rules/ts/themed-decorators.ts b/lint/src/rules/ts/themed-decorators.ts new file mode 100644 index 0000000000..3d2b614b1a --- /dev/null +++ b/lint/src/rules/ts/themed-decorators.ts @@ -0,0 +1,280 @@ +import { + AST_NODE_TYPES, + ESLintUtils, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; + +import { fixture } from '../../../test/fixture'; +import { isTestFile } from '../../util/filter'; +import { + DSpaceESLintRuleInfo, + NamedTests, + OptionDoc, +} from '../../util/structure'; +import { getFileTheme } from '../../util/theme-support'; + +export enum Message { + NO_THEME_DECLARED_IN_THEME_FILE = 'noThemeDeclaredInThemeFile', + THEME_DECLARED_IN_NON_THEME_FILE = 'themeDeclaredInNonThemeFile', + WRONG_THEME_DECLARED_IN_THEME_FILE = 'wrongThemeDeclaredInThemeFile', +} + +interface ThemedDecoratorsOption { + decorators: { [name: string]: number }; +} + +interface ThemedDecoratorsDocsOption { + decorators: OptionDoc; +} + +export const info: DSpaceESLintRuleInfo<[ThemedDecoratorsOption], [ThemedDecoratorsDocsOption]> = { + name: 'themed-decorators', + meta: { + docs: { + description: 'Entry components with theme support should declare the correct theme', + }, + fixable: 'code', + messages: { + [Message.NO_THEME_DECLARED_IN_THEME_FILE]: 'No theme declaration in decorator', + [Message.THEME_DECLARED_IN_NON_THEME_FILE]: 'There is a theme declaration in decorator, but this file is not part of a theme', + [Message.WRONG_THEME_DECLARED_IN_THEME_FILE]: 'Wrong theme declaration in decorator', + }, + type: 'problem', + schema: [ + { + type: 'object', + properties: { + decorators: { + type: 'object', + }, + }, + }, + ], + }, + optionDocs: [ + { + decorators: { + title: '`decorators`', + description: 'A mapping for all the existing themeable decorators, with the decorator name as the key and the index of the `theme` argument as the value.', + }, + }, + ], + defaultOptions: [ + { + decorators: { + listableObjectComponent: 3, + rendersSectionForMenu: 2, + }, + }, + ], +}; + +export const rule = ESLintUtils.RuleCreator.withoutDocs({ + ...info, + create(context: TSESLint.RuleContext, options: any) { + return { + [`ClassDeclaration > Decorator > CallExpression[callee.name=/^(${Object.keys(options[0].decorators).join('|')})$/]`]: (node: TSESTree.CallExpression) => { + if (isTestFile(context)) { + return; + } + + if (node.callee.type !== AST_NODE_TYPES.Identifier) { + // We only support regular method identifiers + return; + } + + const fileTheme = getFileTheme(context); + const themeDeclaration = getDeclaredTheme(options, node as TSESTree.CallExpression); + + if (themeDeclaration === undefined) { + if (fileTheme !== undefined) { + context.report({ + messageId: Message.NO_THEME_DECLARED_IN_THEME_FILE, + node: node, + fix(fixer) { + return fixer.insertTextAfter(node.arguments[node.arguments.length - 1], `, '${fileTheme as string}'`); + }, + }); + } + } else if (themeDeclaration?.type === AST_NODE_TYPES.Literal) { + if (fileTheme === undefined) { + context.report({ + messageId: Message.THEME_DECLARED_IN_NON_THEME_FILE, + node: themeDeclaration, + fix(fixer) { + const idx = node.arguments.findIndex((v) => v.range === themeDeclaration.range); + + if (idx === 0) { + return fixer.remove(themeDeclaration); + } else { + const previousArgument = node.arguments[idx - 1]; + return fixer.removeRange([previousArgument.range[1], themeDeclaration.range[1]]); // todo: comma? + } + }, + }); + } else if (fileTheme !== themeDeclaration?.value) { + context.report({ + messageId: Message.WRONG_THEME_DECLARED_IN_THEME_FILE, + node: themeDeclaration, + fix(fixer) { + return fixer.replaceText(themeDeclaration, `'${fileTheme as string}'`); + }, + }); + } + } else if (themeDeclaration?.type === AST_NODE_TYPES.Identifier && themeDeclaration.name === 'undefined') { + if (fileTheme !== undefined) { + context.report({ + messageId: Message.NO_THEME_DECLARED_IN_THEME_FILE, + node: node, + fix(fixer) { + return fixer.replaceText(node.arguments[node.arguments.length - 1], `'${fileTheme as string}'`); + }, + }); + } + } else { + throw new Error('Unexpected theme declaration'); + } + }, + }; + }, +}); + +export const tests: NamedTests = { + plugin: info.name, + valid: [ + { + name: 'theme file declares the correct theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined, 'test') +export class Something extends SomethingElse { +} + `, + filename: fixture('src/themes/test/app/dynamic-component/dynamic-component.ts'), + }, + { + name: 'plain file declares no theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined) +export class Something extends SomethingElse { +} + `, + filename: fixture('src/app/dynamic-component/dynamic-component.ts'), + }, + { + name: 'plain file declares explicit undefined theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined, undefined) +export class Something extends SomethingElse { +} + `, + filename: fixture('src/app/dynamic-component/dynamic-component.ts'), + }, + { + name: 'test file declares theme outside of theme directory', + code: ` +@listableObjectComponent(something, somethingElse, undefined, 'test') +export class Something extends SomethingElse { +} + `, + filename: fixture('src/app/dynamic-component/dynamic-component.spec.ts'), + }, + { + name: 'only track configured decorators', + code: ` +@something('test') +export class Something extends SomethingElse { +} + `, + filename: fixture('src/app/dynamic-component/dynamic-component.ts'), + }, + ], + invalid: [ + { + name: 'theme file declares the wrong theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} + `, + filename: fixture('src/themes/test/app/dynamic-component/dynamic-component.ts'), + errors: [ + { + messageId: 'wrongThemeDeclaredInThemeFile', + }, + ], + output: ` +@listableObjectComponent(something, somethingElse, undefined, 'test') +export class Something extends SomethingElse { +} + `, + }, + { + name: 'plain file declares a theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} + `, + filename: fixture('src/app/dynamic-component/dynamic-component.ts'), + errors: [ + { + messageId: 'themeDeclaredInNonThemeFile', + }, + ], + output: ` +@listableObjectComponent(something, somethingElse, undefined) +export class Something extends SomethingElse { +} + `, + }, + { + name: 'theme file declares no theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined) +export class Something extends SomethingElse { +} + `, + filename: fixture('src/themes/test-2/app/dynamic-component/dynamic-component.ts'), + errors: [ + { + messageId: 'noThemeDeclaredInThemeFile', + }, + ], + output: ` +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} + `, + }, + { + name: 'theme file declares explicit undefined theme in @listableObjectComponent', + code: ` +@listableObjectComponent(something, somethingElse, undefined, undefined) +export class Something extends SomethingElse { +} + `, + filename: fixture('src/themes/test-2/app/dynamic-component/dynamic-component.ts'), + errors: [ + { + messageId: 'noThemeDeclaredInThemeFile', + }, + ], + output: ` +@listableObjectComponent(something, somethingElse, undefined, 'test-2') +export class Something extends SomethingElse { +} + `, + }, + ], +}; + +function getDeclaredTheme(options: [ThemedDecoratorsOption], decoratorCall: TSESTree.CallExpression): TSESTree.Node | undefined { + const index: number = options[0].decorators[(decoratorCall.callee as TSESTree.Identifier).name]; + + if (decoratorCall.arguments.length >= index + 1) { + return decoratorCall.arguments[index]; + } + + return undefined; +} diff --git a/lint/src/rules/ts/themed-wrapper-no-input-defaults.ts b/lint/src/rules/ts/themed-wrapper-no-input-defaults.ts new file mode 100644 index 0000000000..359f291707 --- /dev/null +++ b/lint/src/rules/ts/themed-wrapper-no-input-defaults.ts @@ -0,0 +1,158 @@ +import { + ESLintUtils, + TSESTree, +} from '@typescript-eslint/utils'; +import { RuleContext } from '@typescript-eslint/utils/ts-eslint'; + +import { + DSpaceESLintRuleInfo, + NamedTests, +} from '../../util/structure'; +import { isThemedComponentWrapper } from '../../util/theme-support'; + +export enum Message { + WRAPPER_HAS_INPUT_DEFAULTS = 'wrapperHasInputDefaults', +} + +export const info: DSpaceESLintRuleInfo = { + name: 'themed-wrapper-no-input-defaults', + meta: { + docs: { + description: 'ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))', + }, + messages: { + [Message.WRAPPER_HAS_INPUT_DEFAULTS]: 'ThemedComponent wrapper declares inputs with defaults', + }, + type: 'problem', + schema: [], + }, + optionDocs: [], + defaultOptions: [], +}; + +export const rule = ESLintUtils.RuleCreator.withoutDocs({ + ...info, + create(context: RuleContext, options: any) { + return { + 'ClassBody > PropertyDefinition > Decorator > CallExpression[callee.name=\'Input\']': (node: TSESTree.CallExpression) => { + const classDeclaration = (node?.parent?.parent?.parent as TSESTree.Decorator); // todo: clean this up + if (!isThemedComponentWrapper(classDeclaration)) { + return; + } + + const propertyDefinition: TSESTree.PropertyDefinition = (node.parent.parent as any); // todo: clean this up + + if (propertyDefinition.value !== null) { + context.report({ + messageId: Message.WRAPPER_HAS_INPUT_DEFAULTS, + node: propertyDefinition.value, + // fix(fixer) { + // // todo: don't strip type annotations! + // // todo: replace default with appropriate type annotation if not present! + // return fixer.removeRange([propertyDefinition.key.range[1], (propertyDefinition.value as any).range[1]]); + // } + }); + } + }, + }; + }, +}); + +export const tests: NamedTests = { + plugin: info.name, + valid: [ + { + name: 'ThemedComponent wrapper defines an input without a default value', + code: ` +export class TTest extends ThemedComponent { + +@Input() +test; +} + `, + }, + { + name: 'Regular class defines an input with a default value', + code: ` +export class Test { + +@Input() +test = 'test'; +} + `, + }, + ], + invalid: [ + { + name: 'ThemedComponent wrapper defines an input with a default value', + code: ` +export class TTest extends ThemedComponent { + +@Input() +test1 = 'test'; + +@Input() +test2 = true; + +@Input() +test2: number = 123; + +@Input() +test3: number[] = [1,2,3]; +} + `, + errors: [ + { + messageId: 'wrapperHasInputDefaults', + }, + { + messageId: 'wrapperHasInputDefaults', + }, + { + messageId: 'wrapperHasInputDefaults', + }, + { + messageId: 'wrapperHasInputDefaults', + }, + ], + // output: ` + // export class TTest extends ThemedComponent { + // + // @Input() + // test1: string; + // + // @Input() + // test2: boolean; + // + // @Input() + // test2: number; + // + // @Input() + // test3: number[]; + // } + // `, + }, + { + name: 'ThemedComponent wrapper defines an input with an undefined default value', + code: ` +export class TTest extends ThemedComponent { + +@Input() +test = undefined; +} + `, + errors: [ + { + messageId: 'wrapperHasInputDefaults', + }, + ], + // output: ` + // export class TTest extends ThemedComponent { + // + // @Input() + // test; + // } + // `, + }, + ], +}; diff --git a/lint/src/rules/ts/unique-decorators.ts b/lint/src/rules/ts/unique-decorators.ts new file mode 100644 index 0000000000..6f36f72bd9 --- /dev/null +++ b/lint/src/rules/ts/unique-decorators.ts @@ -0,0 +1,226 @@ +import { + AST_NODE_TYPES, + ESLintUtils, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; + +import { isTestFile } from '../../util/filter'; +import { + DSpaceESLintRuleInfo, + NamedTests, + OptionDoc, +} from '../../util/structure'; + +export enum Message { + DUPLICATE_DECORATOR_CALL = 'duplicateDecoratorCall', +} + +/** + * Saves the decorators by decoratorName → file → Set + */ +const decoratorCalls: Map>> = new Map(); + +/** + * Keep a list of the files wo contain a decorator. This is done in order to prevent the `Program` selector from being + * run for every file. + */ +const fileWithDecorators: Set = new Set(); + +export interface UniqueDecoratorsOptions { + decorators: string[]; +} + +export interface UniqueDecoratorsDocOptions { + decorators: OptionDoc; +} + +export const info: DSpaceESLintRuleInfo<[UniqueDecoratorsOptions], [UniqueDecoratorsDocOptions]> = { + name: 'unique-decorators', + meta: { + docs: { + description: 'Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)', + }, + messages: { + [Message.DUPLICATE_DECORATOR_CALL]: 'Duplicate decorator call', + }, + type: 'problem', + schema: [ + { + type: 'object', + properties: { + decorators: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + optionDocs: [ + { + decorators: { + title: '`decorators`', + description: 'The list of all the decorators for which you want to enforce this behavior.', + }, + }, + ], + defaultOptions: [ + { + decorators: [ + 'listableObjectComponent', // todo: must take default arguments into account! + ], + }, + ], +}; + +export const rule = ESLintUtils.RuleCreator.withoutDocs({ + ...info, + create(context: TSESLint.RuleContext, options: any) { + + return { + ['Program']: () => { + if (fileWithDecorators.has(context.physicalFilename)) { + for (const decorator of options[0].decorators) { + decoratorCalls.get(decorator)?.get(context.physicalFilename)?.clear(); + } + } + }, + [`ClassDeclaration > Decorator > CallExpression[callee.name=/^(${options[0].decorators.join('|')})$/]`]: (node: TSESTree.CallExpression) => { + if (isTestFile(context)) { + return; + } + + if (node.callee.type !== AST_NODE_TYPES.Identifier) { + // We only support regular method identifiers + return; + } + + fileWithDecorators.add(context.physicalFilename); + + if (!isUnique(node, context.physicalFilename)) { + context.report({ + messageId: Message.DUPLICATE_DECORATOR_CALL, + node: node, + }); + } + }, + }; + }, +}); + +export const tests: NamedTests = { + plugin: info.name, + valid: [ + { + name: 'checked decorator, no repetitions', + code: ` +@listableObjectComponent(a) +export class A { +} + +@listableObjectComponent(a, 'b') +export class B { +} + +@listableObjectComponent(a, 'b', 3) +export class C { +} + +@listableObjectComponent(a, 'b', 3, Enum.TEST1) +export class C { +} + +@listableObjectComponent(a, 'b', 3, Enum.TEST2) +export class C { +} + `, + }, + { + name: 'unchecked decorator, some repetitions', + code: ` +@something(a) +export class A { +} + +@something(a) +export class B { +} + `, + }, + ], + invalid: [ + { + name: 'checked decorator, some repetitions', + code: ` +@listableObjectComponent(a) +export class A { +} + +@listableObjectComponent(a) +export class B { +} + `, + errors: [ + { + messageId: 'duplicateDecoratorCall', + }, + ], + }, + ], +}; + +function callKey(node: TSESTree.CallExpression): string { + let key = ''; + + for (const arg of node.arguments) { + switch ((arg as TSESTree.Node).type) { + // todo: can we make this more generic somehow? + case AST_NODE_TYPES.Identifier: + key += (arg as TSESTree.Identifier).name; + break; + case AST_NODE_TYPES.Literal: + // eslint-disable-next-line @typescript-eslint/no-base-to-string + key += (arg as TSESTree.Literal).value; + break; + case AST_NODE_TYPES.MemberExpression: + key += (arg as any).object.name + '.' + (arg as any).property.name; + break; + default: + throw new Error(`Unrecognized decorator argument type: ${arg.type}`); + } + + key += ', '; + } + + return key; +} + +function isUnique(node: TSESTree.CallExpression, filePath: string): boolean { + const decorator = (node.callee as TSESTree.Identifier).name; + + if (!decoratorCalls.has(decorator)) { + decoratorCalls.set(decorator, new Map()); + } + + if (!decoratorCalls.get(decorator)!.has(filePath)) { + decoratorCalls.get(decorator)!.set(filePath, new Set()); + } + + const key = callKey(node); + + let unique = true; + + for (const decoratorCallsByFile of decoratorCalls.get(decorator)!.values()) { + if (decoratorCallsByFile.has(key)) { + unique = !unique; + break; + } + } + + decoratorCalls.get(decorator)?.get(filePath)?.add(key); + + return unique; +} diff --git a/lint/src/util/filter.ts b/lint/src/util/filter.ts new file mode 100644 index 0000000000..5bc24250e4 --- /dev/null +++ b/lint/src/util/filter.ts @@ -0,0 +1,10 @@ +import { RuleContext } from '@typescript-eslint/utils/ts-eslint'; + +/** + * Determine whether the current file is a test file + * @param context the current ESLint rule context + */ +export function isTestFile(context: RuleContext): boolean { + // note: shouldn't use plain .filename (doesn't work in DSpace Angular 7.4) + return context.getFilename()?.endsWith('.spec.ts') ; +} diff --git a/lint/src/util/structure.ts b/lint/src/util/structure.ts index 2e3aebd9ab..4993b5f60b 100644 --- a/lint/src/util/structure.ts +++ b/lint/src/util/structure.ts @@ -17,10 +17,16 @@ export type Meta = RuleMetaData; export type Valid = ValidTestCase; export type Invalid = InvalidTestCase; -export interface DSpaceESLintRuleInfo { +export interface DSpaceESLintRuleInfo { name: string; meta: Meta, - defaultOptions: unknown[], + optionDocs: D, + defaultOptions: T, +} + +export interface OptionDoc { + title: string; + description: string; } export interface NamedTests { diff --git a/lint/src/util/templates/rule.ejs b/lint/src/util/templates/rule.ejs index b39d193cc1..2fc0548fba 100644 --- a/lint/src/util/templates/rule.ejs +++ b/lint/src/util/templates/rule.ejs @@ -7,6 +7,11 @@ _______ [Source code](../../../../lint/src/rules/<%- plugin.name.replace('dspace-angular-', '') %>/<%- rule.name %>.ts) +<% if (rule.optionDocs?.length > 0) { %> +### Options +<%- rule.optionDocs.map(optionDoc => Object.keys(optionDoc).map(option => '\n#### ' + optionDoc[option].title + '\n\n' + optionDoc[option].description)) %> +<% } %> + ### Examples <% if (tests.valid) {%> @@ -19,6 +24,13 @@ Filename: `<%- test.filename %>` ```<%- plugin.language.toLowerCase() %> <%- test.code.trim() %> ``` + <% if (test?.options?.length > 0) { %> +With options: + +```json +<%- JSON.stringify(test.options[0], null, 2) %> +``` + <% }%> <% }) %> <% } %> @@ -31,6 +43,15 @@ Filename: `<%- test.filename %>` <% } %> ```<%- plugin.language.toLowerCase() %> <%- test.code.trim() %> + + <% if (test?.options?.length > 0) { %> +With options: + +```json +<%- JSON.stringify(test.options[0], null, 2) %> +``` + <% }%> + ``` Will produce the following error(s): ``` diff --git a/lint/src/util/theme-support.ts b/lint/src/util/theme-support.ts index 64644145fa..7bc680b930 100644 --- a/lint/src/util/theme-support.ts +++ b/lint/src/util/theme-support.ts @@ -7,6 +7,7 @@ */ import { TSESTree } from '@typescript-eslint/utils'; +import { RuleContext } from '@typescript-eslint/utils/ts-eslint'; import { readFileSync } from 'fs'; import { basename } from 'path'; import ts, { Identifier } from 'typescript'; @@ -263,3 +264,18 @@ export const DISALLOWED_THEME_SELECTORS = 'ds-(base|themed)-'; export function fixSelectors(text: string): string { return text.replaceAll(/ds-(base|themed)-/g, 'ds-'); } + +/** + * Determine the theme of the current file based on its path in the project. + * @param context the current ESLint rule context + */ +export function getFileTheme(context: RuleContext): string | undefined { + // note: shouldn't use plain .filename (doesn't work in DSpace Angular 7.4) + const m = context.getFilename()?.match(/\/src\/themes\/([^/]+)\//); + + if (m?.length === 2) { + return m[1]; + } + + return undefined; +} diff --git a/lint/test/fixture/src/app/dynamic-component/dynamic-component.spec.ts b/lint/test/fixture/src/app/dynamic-component/dynamic-component.spec.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lint/test/fixture/src/app/dynamic-component/dynamic-component.ts b/lint/test/fixture/src/app/dynamic-component/dynamic-component.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts b/lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts b/lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lint/test/structure.spec.ts b/lint/test/structure.spec.ts index 24e69e42d9..297ce8b5ac 100644 --- a/lint/test/structure.spec.ts +++ b/lint/test/structure.spec.ts @@ -6,6 +6,8 @@ * http://www.dspace.org/license/ */ +import { RuleMetaData } from '@typescript-eslint/utils/ts-eslint'; + import { default as html } from '../src/rules/html'; import { default as ts } from '../src/rules/ts'; @@ -69,6 +71,16 @@ describe('plugin structure', () => { expect(ruleExports.tests.valid.length).toBeGreaterThan(0); expect(ruleExports.tests.invalid.length).toBeGreaterThan(0); }); + + it('should contain a valid ESLint rule', () => { + // we don't have a better way to enforce this, but it's something at least + expect((ruleExports.rule as any).name).toBeUndefined( + 'Rules should be passed to RuleCreator, omitting info.name since it is not part of the RuleWithMeta interface', + ); + + expect(ruleExports.rule.create).toBeTruthy(); + expect(ruleExports.rule.meta).toEqual(ruleExports.info.meta as RuleMetaData); + }); }); } }); diff --git a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts index fc7e86ad4c..8b7b92717a 100644 --- a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts +++ b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts @@ -51,16 +51,16 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; }, ], imports: [ - PaginationComponent, AsyncPipe, - NgbAccordionModule, - TranslateModule, - NgbNavModule, - ThemedSearchComponent, BrowserOnlyPipe, - NgxPaginationModule, - SelectableListItemControlComponent, ListableObjectComponentLoaderComponent, + NgbAccordionModule, + NgbNavModule, + NgxPaginationModule, + PaginationComponent, + SelectableListItemControlComponent, + ThemedSearchComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/access-control/bulk-access/bulk-access.component.ts b/src/app/access-control/bulk-access/bulk-access.component.ts index e158f3c446..68e4f7157c 100644 --- a/src/app/access-control/bulk-access/bulk-access.component.ts +++ b/src/app/access-control/bulk-access/bulk-access.component.ts @@ -26,10 +26,10 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com templateUrl: './bulk-access.component.html', styleUrls: ['./bulk-access.component.scss'], imports: [ - TranslateModule, - BulkAccessSettingsComponent, - BulkAccessBrowseComponent, BtnDisabledDirective, + BulkAccessBrowseComponent, + BulkAccessSettingsComponent, + TranslateModule, ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts index 7082b7dc4f..0ee4e1b56e 100644 --- a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts +++ b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts @@ -14,9 +14,9 @@ import { AccessControlFormContainerComponent } from '../../../shared/access-cont styleUrls: ['./bulk-access-settings.component.scss'], exportAs: 'dsBulkSettings', imports: [ + AccessControlFormContainerComponent, NgbAccordionModule, TranslateModule, - AccessControlFormContainerComponent, ], standalone: true, }) diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts index cd7441022c..20a066dbf7 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts @@ -27,7 +27,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; @@ -85,7 +85,7 @@ describe('EPeopleRegistryComponent', () => { }), this.allEpeople)); }, getActiveEPerson(): Observable { - return observableOf(this.activeEPerson); + return of(this.activeEPerson); }, searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable>> { if (scope === 'email') { @@ -129,7 +129,7 @@ describe('EPeopleRegistryComponent', () => { this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => { return (ePerson2.uuid !== ePerson.uuid); }); - return observableOf(true); + return of(true); }, editEPerson(ePerson: EPerson) { this.activeEPerson = ePerson; @@ -145,7 +145,7 @@ describe('EPeopleRegistryComponent', () => { }, }; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); builderService = getMockFormBuilderService(); @@ -180,7 +180,7 @@ describe('EPeopleRegistryComponent', () => { fixture = TestBed.createComponent(EPeopleRegistryComponent); component = fixture.componentInstance; modalService = TestBed.inject(NgbModal); - spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) })); + spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) })); fixture.detectChanges(); }); @@ -261,7 +261,7 @@ describe('EPeopleRegistryComponent', () => { it('should hide delete EPerson button when the isAuthorized returns false', () => { - spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false)); + spyOn(authorizationService, 'isAuthorized').and.returnValue(of(false)); component.initialisePage(); fixture.detectChanges(); diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.ts b/src/app/access-control/epeople-registry/epeople-registry.component.ts index 1aee792aba..d4a96fa826 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts @@ -67,14 +67,14 @@ import { EPersonFormComponent } from './eperson-form/eperson-form.component'; selector: 'ds-epeople-registry', templateUrl: './epeople-registry.component.html', imports: [ - TranslateModule, - RouterModule, AsyncPipe, EPersonFormComponent, - ReactiveFormsModule, - ThemedLoadingComponent, - PaginationComponent, NgClass, + PaginationComponent, + ReactiveFormsModule, + RouterModule, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts index c5c9407377..6969b44f83 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts @@ -25,7 +25,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; @@ -91,7 +91,7 @@ describe('EPersonFormComponent', () => { activeEPerson: null, allEpeople: mockEPeople, getActiveEPerson(): Observable { - return observableOf(this.activeEPerson); + return of(this.activeEPerson); }, searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable>> { if (scope === 'email') { @@ -115,7 +115,7 @@ describe('EPersonFormComponent', () => { this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => { return (ePerson2.uuid !== ePerson.uuid); }); - return observableOf(true); + return of(true); }, create(ePerson: EPerson): Observable> { this.allEpeople = [...this.allEpeople, ePerson]; @@ -210,7 +210,7 @@ describe('EPersonFormComponent', () => { }); authService = new AuthServiceStub(); authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); groupsDataService = jasmine.createSpyObj('groupsDataService', { @@ -389,7 +389,7 @@ describe('EPersonFormComponent', () => { }); describe('without active EPerson', () => { beforeEach(() => { - spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(undefined)); + spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(undefined)); component.onSubmit(); fixture.detectChanges(); }); @@ -429,7 +429,7 @@ describe('EPersonFormComponent', () => { }, }, }); - spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId)); + spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(expectedWithId)); component.ngOnInit(); component.onSubmit(); fixture.detectChanges(); @@ -485,10 +485,10 @@ describe('EPersonFormComponent', () => { spyOn(authService, 'impersonate').and.callThrough(); eperson = EPersonMock; component.epersonInitial = eperson; - component.canDelete$ = observableOf(true); - spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(observableOf(eperson)); + component.canDelete$ = of(true); + spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(of(eperson)); modalService = (component as any).modalService; - spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) })); + spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) })); component.ngOnInit(); fixture.detectChanges(); }); @@ -499,7 +499,7 @@ describe('EPersonFormComponent', () => { }); it('the delete button should be hidden if the ePerson cannot be deleted', () => { - component.canDelete$ = observableOf(false); + component.canDelete$ = of(false); fixture.detectChanges(); const deleteButton = fixture.debugElement.query(By.css('.delete-button')); expect(deleteButton).toBeNull(); diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts index 56c6e86d2e..701684009e 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts @@ -27,7 +27,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -78,14 +78,14 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator'; selector: 'ds-eperson-form', templateUrl: './eperson-form.component.html', imports: [ - FormComponent, AsyncPipe, - TranslateModule, - ThemedLoadingComponent, + BtnDisabledDirective, + FormComponent, + HasNoValuePipe, PaginationComponent, RouterLink, - HasNoValuePipe, - BtnDisabledDirective, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) @@ -357,7 +357,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { this.groups$ = this.activeEPerson$.pipe( switchMap((eperson) => { - return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, { + return observableCombineLatest([of(eperson), this.paginationService.getFindListOptions(this.config.id, { currentPage: 1, elementsPerPage: this.config.pageSize, })]); @@ -366,7 +366,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { if (eperson != null) { return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object')); } - return observableOf(undefined); + return of(undefined); }), ); @@ -379,14 +379,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy { if (hasValue(eperson)) { return this.authorizationService.isAuthorized(FeatureID.LoginOnBehalfOf, eperson.self); } else { - return observableOf(false); + return of(false); } }), ); this.canDelete$ = this.activeEPerson$.pipe( switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)), ); - this.canReset$ = observableOf(true); + this.canReset$ = of(true); } /** @@ -540,16 +540,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy { take(1), switchMap((confirm: boolean) => { if (confirm && hasValue(eperson.id)) { - this.canDelete$ = observableOf(false); + this.canDelete$ = of(false); return this.epersonService.deleteEPerson(eperson).pipe( getFirstCompletedRemoteData(), map((restResponse: RemoteData) => ({ restResponse, eperson })), ); } else { - return observableOf(null); + return of(null); } }), - finalize(() => this.canDelete$ = observableOf(true)), + finalize(() => this.canDelete$ = of(true)), ); }), ).subscribe(({ restResponse, eperson }: { restResponse: RemoteData | null, eperson: EPerson }) => { diff --git a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts index b7e6a35d4e..86ee5e725e 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts @@ -27,7 +27,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @@ -116,7 +116,7 @@ describe('GroupFormComponent', () => { activeGroup: null, createdGroup: null, getActiveGroup(): Observable { - return observableOf(this.activeGroup); + return of(this.activeGroup); }, getGroupRegistryRouterLink(): string { return '/access-control/groups'; @@ -137,7 +137,7 @@ describe('GroupFormComponent', () => { this.activeGroup = null; }, findById(id: string) { - return observableOf({ payload: null, hasSucceeded: true }); + return of({ payload: null, hasSucceeded: true }); }, findByHref(href: string) { return createSuccessfulRemoteDataObject$(this.createdGroup); @@ -164,7 +164,7 @@ describe('GroupFormComponent', () => { }, }; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); dsoDataServiceStub = { findByHref(href: string): Observable> { @@ -330,7 +330,7 @@ describe('GroupFormComponent', () => { }, }, }); - spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(observableOf(expected)); + spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(of(expected)); spyOn(groupsDataServiceStub, 'patch').and.returnValue(createSuccessfulRemoteDataObject$(expected2)); component.ngOnInit(); }); @@ -417,7 +417,7 @@ describe('GroupFormComponent', () => { }, }); spyOn(component.submitForm, 'emit'); - spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(observableOf(expected)); + spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(of(expected)); fixture.detectChanges(); component.initialisePage(); @@ -471,11 +471,11 @@ describe('GroupFormComponent', () => { beforeEach(async () => { spyOn(groupsDataServiceStub, 'delete').and.callThrough(); - component.activeGroup$ = observableOf({ + component.activeGroup$ = of({ id: 'active-group', permanent: false, } as Group); - component.canEdit$ = observableOf(true); + component.canEdit$ = of(true); component.initialisePage(); diff --git a/src/app/access-control/group-registry/group-form/group-form.component.ts b/src/app/access-control/group-registry/group-form/group-form.component.ts index 087db617e7..5c01f2e977 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.ts @@ -87,13 +87,13 @@ import { ValidateGroupExists } from './validators/group-exists.validator'; selector: 'ds-group-form', templateUrl: './group-form.component.html', imports: [ - FormComponent, AlertComponent, AsyncPipe, - TranslateModule, ContextHelpDirective, + FormComponent, MembersListComponent, SubgroupsListComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts index 9a6b2b4f05..0271dd4aad 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts @@ -32,7 +32,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -113,7 +113,7 @@ describe('MembersListComponent', () => { epersonMembers: epersonMembers, epersonNonMembers: epersonNonMembers, getActiveGroup(): Observable { - return observableOf(activeGroup); + return of(activeGroup); }, getEPersonMembers() { return this.epersonMembers; @@ -127,7 +127,7 @@ describe('MembersListComponent', () => { this.epersonNonMembers.splice(index, 1); } }); - return observableOf(new RestResponse(true, 200, 'Success')); + return of(new RestResponse(true, 200, 'Success')); }, clearGroupsRequests() { // empty @@ -147,7 +147,7 @@ describe('MembersListComponent', () => { }); // Add eperson to list of non-members this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete]; - return observableOf(new RestResponse(true, 200, 'Success')); + return of(new RestResponse(true, 200, 'Success')); }, }; builderService = getMockFormBuilderService(); diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts index 737e08427b..e8d90c1a0b 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts @@ -25,7 +25,7 @@ import { combineLatest as observableCombineLatest, Observable, ObservedValueOf, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -103,14 +103,14 @@ export interface EPersonListActionConfig { selector: 'ds-members-list', templateUrl: './members-list.component.html', imports: [ - TranslateModule, - ContextHelpDirective, - ReactiveFormsModule, - PaginationComponent, AsyncPipe, - RouterLink, - NgClass, BtnDisabledDirective, + ContextHelpDirective, + NgClass, + PaginationComponent, + ReactiveFormsModule, + RouterLink, + TranslateModule, ], standalone: true, }) @@ -260,7 +260,7 @@ export class MembersListComponent implements OnInit, OnDestroy { * @param possibleMember EPerson that is a possible member (being tested) of the group currently being edited */ isMemberOfGroup(possibleMember: EPerson): Observable { - return observableOf(true); + return of(true); } /** diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts index 5b39102ca8..819db3d1c0 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts @@ -31,7 +31,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock'; @@ -108,7 +108,7 @@ describe('SubgroupsListComponent', () => { subgroups: subgroups, groupNonMembers: groupNonMembers, getActiveGroup(): Observable { - return observableOf(this.activeGroup); + return of(this.activeGroup); }, getSubgroups(): Group { return this.subgroups; @@ -138,7 +138,7 @@ describe('SubgroupsListComponent', () => { this.groupNonMembers.splice(index, 1); } }); - return observableOf(new RestResponse(true, 200, 'Success')); + return of(new RestResponse(true, 200, 'Success')); }, clearGroupsRequests() { // empty @@ -155,7 +155,7 @@ describe('SubgroupsListComponent', () => { }); // Add group to list of non-members this.groupNonMembers = [...this.groupNonMembers, subgroupToDelete]; - return observableOf(new RestResponse(true, 200, 'Success')); + return of(new RestResponse(true, 200, 'Success')); }, }; routerStub = new RouterMock(); diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts index a42b56d6e2..82f944fe7b 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts @@ -59,12 +59,12 @@ enum SubKey { selector: 'ds-subgroups-list', templateUrl: './subgroups-list.component.html', imports: [ - RouterLink, AsyncPipe, ContextHelpDirective, - TranslateModule, - ReactiveFormsModule, PaginationComponent, + ReactiveFormsModule, + RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/access-control/group-registry/group-page.guard.spec.ts b/src/app/access-control/group-registry/group-page.guard.spec.ts index 3024e42d64..96b8092117 100644 --- a/src/app/access-control/group-registry/group-page.guard.spec.ts +++ b/src/app/access-control/group-registry/group-page.guard.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; @@ -37,7 +37,7 @@ describe('GroupPageGuard', () => { function init() { halEndpointService = jasmine.createSpyObj(['getEndpoint']); - ( halEndpointService as any ).getEndpoint.and.returnValue(observableOf(groupsEndpointUrl)); + ( halEndpointService as any ).getEndpoint.and.returnValue(of(groupsEndpointUrl)); authorizationService = jasmine.createSpyObj(['isAuthorized']); // NOTE: value is set in beforeEach @@ -46,7 +46,7 @@ describe('GroupPageGuard', () => { ( router as any ).parseUrl.and.returnValue = {}; authService = jasmine.createSpyObj(['isAuthenticated']); - ( authService as any ).isAuthenticated.and.returnValue(observableOf(true)); + ( authService as any ).isAuthenticated.and.returnValue(of(true)); TestBed.configureTestingModule({ providers: [ @@ -69,7 +69,7 @@ describe('GroupPageGuard', () => { describe('canActivate', () => { describe('when the current user can manage the group', () => { beforeEach(() => { - ( authorizationService as any ).isAuthorized.and.returnValue(observableOf(true)); + ( authorizationService as any ).isAuthorized.and.returnValue(of(true)); }); it('should return true', (done) => { @@ -89,7 +89,7 @@ describe('GroupPageGuard', () => { describe('when the current user can not manage the group', () => { beforeEach(() => { - (authorizationService as any).isAuthorized.and.returnValue(observableOf(false)); + (authorizationService as any).isAuthorized.and.returnValue(of(false)); }); it('should not return true', (done) => { diff --git a/src/app/access-control/group-registry/group-page.guard.ts b/src/app/access-control/group-registry/group-page.guard.ts index c52bed9c48..34c52debba 100644 --- a/src/app/access-control/group-registry/group-page.guard.ts +++ b/src/app/access-control/group-registry/group-page.guard.ts @@ -6,7 +6,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -33,6 +33,6 @@ export const groupPageGuard = ( getObjectUrl = defaultGroupPageGetObjectUrl, getEPersonUuid?: StringGuardParamFn, ): CanActivateFn => someFeatureAuthorizationGuard( - () => observableOf([FeatureID.CanManageGroup]), + () => of([FeatureID.CanManageGroup]), getObjectUrl, getEPersonUuid); diff --git a/src/app/access-control/group-registry/groups-registry.component.spec.ts b/src/app/access-control/group-registry/groups-registry.component.spec.ts index aaea59cead..81af022055 100644 --- a/src/app/access-control/group-registry/groups-registry.component.spec.ts +++ b/src/app/access-control/group-registry/groups-registry.component.spec.ts @@ -25,7 +25,6 @@ import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, of, } from 'rxjs'; @@ -95,11 +94,11 @@ describe('GroupsRegistryComponent', () => { (authorizationService as any).isAuthorized.and.callFake((featureId?: FeatureID) => { switch (featureId) { case FeatureID.AdministratorOf: - return observableOf(isAdmin); + return of(isAdmin); case FeatureID.CanManageGroup: - return observableOf(canManageGroup); + return of(canManageGroup); case FeatureID.CanDelete: - return observableOf(true); + return of(true); default: throw new Error(`setIsAuthorized: this fake implementation does not support ${featureId}.`); } diff --git a/src/app/access-control/group-registry/groups-registry.component.ts b/src/app/access-control/group-registry/groups-registry.component.ts index d3cf50ad4b..9a7924f210 100644 --- a/src/app/access-control/group-registry/groups-registry.component.ts +++ b/src/app/access-control/group-registry/groups-registry.component.ts @@ -19,7 +19,7 @@ import { combineLatest as observableCombineLatest, EMPTY, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -68,14 +68,14 @@ import { followLink } from '../../shared/utils/follow-link-config.model'; selector: 'ds-groups-registry', templateUrl: './groups-registry.component.html', imports: [ + AsyncPipe, + BtnDisabledDirective, + NgbTooltipModule, + PaginationComponent, + ReactiveFormsModule, + RouterLink, ThemedLoadingComponent, TranslateModule, - RouterLink, - ReactiveFormsModule, - AsyncPipe, - PaginationComponent, - NgbTooltipModule, - BtnDisabledDirective, ], standalone: true, }) @@ -179,7 +179,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { getRemoteDataPayload(), switchMap((groups: PaginatedList) => { if (groups.page.length === 0) { - return observableOf(buildPaginatedList(groups.pageInfo, [])); + return of(buildPaginatedList(groups.pageInfo, [])); } return this.authorizationService.isAuthorized(FeatureID.AdministratorOf).pipe( switchMap((isSiteAdmin: boolean) => { @@ -224,7 +224,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { canManageGroup$(isSiteAdmin: boolean, group: Group): Observable { if (isSiteAdmin) { - return observableOf(true); + return of(true); } else { return this.authorizationService.isAuthorized(FeatureID.CanManageGroup, group.self); } @@ -283,7 +283,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { return this.dSpaceObjectDataService.findByHref(group._links.object.href).pipe( getFirstSucceededRemoteData(), map((rd: RemoteData) => hasValue(rd) && hasValue(rd.payload)), - catchError(() => observableOf(false)), + catchError(() => of(false)), ); } diff --git a/src/app/admin/admin-import-batch-page/batch-import-page.component.ts b/src/app/admin/admin-import-batch-page/batch-import-page.component.ts index d4a578411d..c8446ced4a 100644 --- a/src/app/admin/admin-import-batch-page/batch-import-page.component.ts +++ b/src/app/admin/admin-import-batch-page/batch-import-page.component.ts @@ -33,10 +33,10 @@ import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzo selector: 'ds-batch-import-page', templateUrl: './batch-import-page.component.html', imports: [ - TranslateModule, - FormsModule, - UiSwitchModule, FileDropzoneNoUploaderComponent, + FormsModule, + TranslateModule, + UiSwitchModule, ], standalone: true, }) diff --git a/src/app/admin/admin-import-metadata-page/themed-metadata-import-page.component.ts b/src/app/admin/admin-import-metadata-page/themed-metadata-import-page.component.ts index 2562541dfc..9bf5705e4b 100644 --- a/src/app/admin/admin-import-metadata-page/themed-metadata-import-page.component.ts +++ b/src/app/admin/admin-import-metadata-page/themed-metadata-import-page.component.ts @@ -10,7 +10,9 @@ import { MetadataImportPageComponent } from './metadata-import-page.component'; selector: 'ds-metadata-import-page', templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [MetadataImportPageComponent], + imports: [ + MetadataImportPageComponent, + ], }) export class ThemedMetadataImportPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts index 2fd5cd872b..769726fc09 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts @@ -30,10 +30,7 @@ import { TranslateService, } from '@ngx-translate/core'; import { PaginationService } from 'ngx-pagination'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { RouteService } from '../../../core/services/route.service'; import { MockActivatedRoute } from '../../../shared/mocks/active-router.mock'; @@ -94,8 +91,8 @@ describe('LdnServiceFormEditComponent', () => { beforeEach(async () => { ldnServicesService = jasmine.createSpyObj('ldnServicesService', { - create: observableOf(null), - update: observableOf(null), + create: of(null), + update: of(null), findById: createSuccessfulRemoteDataObject$({}), }); diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts index ad3ed35439..80860c4b6e 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts @@ -71,10 +71,10 @@ import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patter ]), ], imports: [ + AsyncPipe, + NgbDropdownModule, ReactiveFormsModule, TranslateModule, - NgbDropdownModule, - AsyncPipe, ], }) export class LdnServiceFormComponent implements OnInit, OnDestroy { diff --git a/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.spec.ts b/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.spec.ts index 4ff781f629..4224b0aafd 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.spec.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.spec.ts @@ -2,7 +2,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service'; @@ -71,12 +71,12 @@ describe('LdnServicesService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(endpointURL), + getEndpoint: of(endpointURL), }); rdbService = jasmine.createSpyObj('rdbService', { @@ -107,7 +107,7 @@ describe('LdnServicesService test', () => { it('should find service by inbound pattern', (done) => { const params = [new RequestParam('pattern', 'testPattern')]; const findListOptions = Object.assign(new FindListOptions(), {}, { searchParams: params }); - spyOn(service, 'searchBy').and.returnValue(observableOf(null)); + spyOn(service, 'searchBy').and.returnValue(of(null)); spyOn((service as any).searchData, 'searchBy').and.returnValue(createSuccessfulRemoteDataObject$(createPaginatedList([mockLdnService]))); service.findByInboundPattern('testPattern').subscribe(() => { @@ -120,7 +120,7 @@ describe('LdnServicesService test', () => { const constraints = [{ void: true }]; const files = [new File([],'fileName')]; spyOn(service as any, 'getInvocationFormData'); - spyOn(service, 'getBrowseEndpoint').and.returnValue(observableOf('testEndpoint')); + spyOn(service, 'getBrowseEndpoint').and.returnValue(of('testEndpoint')); service.invoke('serviceName', 'serviceId', constraints, files).subscribe(result => { expect((service as any).getInvocationFormData).toHaveBeenCalledWith(constraints, files); expect(service.getBrowseEndpoint).toHaveBeenCalled(); diff --git a/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts b/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts index 59f21bb14a..691110873c 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts @@ -52,13 +52,13 @@ import { LdnService } from '../ldn-services-model/ldn-services.model'; styleUrls: ['./ldn-services-directory.component.scss'], changeDetection: ChangeDetectionStrategy.Default, imports: [ - TranslateModule, AsyncPipe, + NgClass, PaginationComponent, + RouterLink, + TranslateModule, TruncatableComponent, TruncatablePartComponent, - NgClass, - RouterLink, ], standalone: true, }) diff --git a/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts b/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts index 2e92125a56..b12ef533b4 100644 --- a/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts +++ b/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts @@ -6,7 +6,9 @@ import { SuggestionSourcesComponent } from '../../../notifications/suggestions/s selector: 'ds-admin-notifications-publication-claim-page', templateUrl: './admin-notifications-publication-claim-page.component.html', styleUrls: ['./admin-notifications-publication-claim-page.component.scss'], - imports: [ SuggestionSourcesComponent ], + imports: [ + SuggestionSourcesComponent, + ], standalone: true, }) export class AdminNotificationsPublicationClaimPageComponent { diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts index 4fe93f4c86..b9f7b2b81d 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts @@ -42,9 +42,9 @@ import { standalone: true, imports: [ AdminNotifyMetricsComponent, + AsyncPipe, RouterLink, TranslateModule, - AsyncPipe, ], }) diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component.ts index aaaec8437d..b2f70e6660 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component.ts @@ -20,8 +20,8 @@ import { AdminNotifyLogsResultComponent } from '../admin-notify-logs-result/admi ], standalone: true, imports: [ - RouterLink, AdminNotifyLogsResultComponent, + RouterLink, TranslateModule, ], }) diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs-result/admin-notify-logs-result.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs-result/admin-notify-logs-result.component.ts index 7aa1e63c56..ed1b78f4ae 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs-result/admin-notify-logs-result.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs-result/admin-notify-logs-result.component.ts @@ -32,9 +32,9 @@ import { ThemedSearchComponent } from '../../../../shared/search/themed-search.c ], standalone: true, imports: [ + AsyncPipe, SearchLabelsComponent, ThemedSearchComponent, - AsyncPipe, TranslateModule, ], }) diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component.ts index 79a30b7961..7a11c1a66c 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component.ts @@ -20,8 +20,8 @@ import { AdminNotifyLogsResultComponent } from '../admin-notify-logs-result/admi ], standalone: true, imports: [ - RouterLink, AdminNotifyLogsResultComponent, + RouterLink, TranslateModule, ], }) diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.spec.ts b/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.spec.ts index 02f4f024e8..aff6514e4b 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.spec.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.spec.ts @@ -7,10 +7,7 @@ import { import { RouterModule } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; @@ -120,7 +117,7 @@ describe('AdminNotifySearchResultComponent', () => { fixture = TestBed.createComponent(AdminNotifySearchResultComponent); component = fixture.componentInstance; modalService = TestBed.inject(NgbModal); - spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) })); + spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) })); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts index ece05c30bb..7b0d3cd933 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts @@ -39,12 +39,12 @@ import { AdminNotifyMessagesService } from '../services/admin-notify-messages.se ], standalone: true, imports: [ - TranslateModule, - DatePipe, AsyncPipe, + DatePipe, + RouterLink, + TranslateModule, TruncatableComponent, TruncatablePartComponent, - RouterLink, ], }) /** diff --git a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts index bdab873717..6deeeb1a15 100644 --- a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts @@ -9,7 +9,7 @@ import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; @@ -51,7 +51,7 @@ describe('AddBitstreamFormatComponent', () => { notificationService = new NotificationsServiceStub(); bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', { createBitstreamFormat: createSuccessfulRemoteDataObject$({}), - clearBitStreamFormatRequests: observableOf(null), + clearBitStreamFormatRequests: of(null), }); TestBed.configureTestingModule({ @@ -98,7 +98,7 @@ describe('AddBitstreamFormatComponent', () => { notificationService = new NotificationsServiceStub(); bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', { createBitstreamFormat: createFailedRemoteDataObject$('Error', 500), - clearBitStreamFormatRequests: observableOf(null), + clearBitStreamFormatRequests: of(null), }); TestBed.configureTestingModule({ diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts index c6d619b611..7e31cedd82 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts @@ -9,7 +9,7 @@ import { RouterModule } from '@angular/router'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { hot } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; @@ -88,14 +88,14 @@ describe('BitstreamFormatsComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: observableOf(mockFormatsRD), + findAll: of(mockFormatsRD), find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), getSelectedBitstreamFormats: hot('a', { a: mockFormatsList }), selectBitstreamFormat: {}, deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, delete: createSuccessfulRemoteDataObject$({}), - clearBitStreamFormatRequests: observableOf('cleared'), + clearBitStreamFormatRequests: of('cleared'), }); paginationService = new PaginationServiceStub(); @@ -225,14 +225,14 @@ describe('BitstreamFormatsComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: observableOf(mockFormatsRD), + findAll: of(mockFormatsRD), find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), - getSelectedBitstreamFormats: observableOf(mockFormatsList), + getSelectedBitstreamFormats: of(mockFormatsList), selectBitstreamFormat: {}, deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, delete: createNoContentRemoteDataObject$(), - clearBitStreamFormatRequests: observableOf('cleared'), + clearBitStreamFormatRequests: of('cleared'), }); paginationService = new PaginationServiceStub(); @@ -282,14 +282,14 @@ describe('BitstreamFormatsComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: observableOf(mockFormatsRD), + findAll: of(mockFormatsRD), find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), - getSelectedBitstreamFormats: observableOf(mockFormatsList), + getSelectedBitstreamFormats: of(mockFormatsList), selectBitstreamFormat: {}, deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, delete: createFailedRemoteDataObject$(), - clearBitStreamFormatRequests: observableOf('cleared'), + clearBitStreamFormatRequests: of('cleared'), }); paginationService = new PaginationServiceStub(); diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts index bc0f76ea17..381172bbe9 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts @@ -38,9 +38,9 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio templateUrl: './bitstream-formats.component.html', imports: [ AsyncPipe, + PaginationComponent, RouterLink, TranslateModule, - PaginationComponent, ], standalone: true, }) diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts index 17276ef2ac..a8785477c9 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts @@ -12,7 +12,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; import { RemoteData } from '../../../../core/data/remote-data'; @@ -44,7 +44,7 @@ describe('EditBitstreamFormatComponent', () => { bitstreamFormat.extensions = null; const routeStub = { - data: observableOf({ + data: of({ bitstreamFormat: createSuccessfulRemoteDataObject(bitstreamFormat), }), }; diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts index f932d83277..f53ae71032 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts @@ -30,9 +30,9 @@ import { FormatFormComponent } from '../format-form/format-form.component'; selector: 'ds-edit-bitstream-format', templateUrl: './edit-bitstream-format.component.html', imports: [ + AsyncPipe, FormatFormComponent, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts index 4ee61c35d5..0b32cc466c 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts @@ -14,7 +14,7 @@ import { RouterLink } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; @@ -178,7 +178,7 @@ describe('MetadataRegistryComponent', () => { })); it('should cancel editing the selected schema when clicked again', waitForAsync(() => { - comp.activeMetadataSchema$ = observableOf(mockSchemasList[0] as MetadataSchema); + comp.activeMetadataSchema$ = of(mockSchemasList[0] as MetadataSchema); spyOn(registryService, 'cancelEditMetadataSchema'); row.click(); fixture.detectChanges(); @@ -193,7 +193,7 @@ describe('MetadataRegistryComponent', () => { beforeEach(() => { spyOn(registryService, 'deleteMetadataSchema').and.callThrough(); - comp.selectedMetadataSchemaIDs$ = observableOf(selectedSchemas.map((selectedSchema: MetadataSchema) => selectedSchema.id)); + comp.selectedMetadataSchemaIDs$ = of(selectedSchemas.map((selectedSchema: MetadataSchema) => selectedSchema.id)); comp.deleteSchemas(); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts index 8e5adeddf7..9f69a78bb7 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts @@ -43,12 +43,12 @@ import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-sch templateUrl: './metadata-registry.component.html', styleUrls: ['./metadata-registry.component.scss'], imports: [ - MetadataSchemaFormComponent, - TranslateModule, AsyncPipe, - PaginationComponent, + MetadataSchemaFormComponent, NgClass, + PaginationComponent, RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts index f98e274324..5a4b4d162c 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts @@ -9,7 +9,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; import { RegistryService } from '../../../../core/registry/registry.service'; @@ -72,7 +72,7 @@ describe('MetadataSchemaFormComponent', () => { describe('without an active schema', () => { beforeEach(() => { - component.activeMetadataSchema$ = observableOf(undefined); + component.activeMetadataSchema$ = of(undefined); component.onSubmit(); fixture.detectChanges(); }); @@ -91,7 +91,7 @@ describe('MetadataSchemaFormComponent', () => { } as MetadataSchema); beforeEach(() => { - component.activeMetadataSchema$ = observableOf(expectedWithId); + component.activeMetadataSchema$ = of(expectedWithId); component.onSubmit(); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts index 139f711920..ebc8e0675c 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts @@ -37,8 +37,8 @@ import { FormComponent } from '../../../../shared/form/form.component'; templateUrl: './metadata-schema-form.component.html', imports: [ AsyncPipe, - TranslateModule, FormComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts index 440f52a24d..0816c9ee4d 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts @@ -9,7 +9,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { MetadataField } from '../../../../core/metadata/metadata-field.model'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; @@ -86,7 +86,7 @@ describe('MetadataFieldFormComponent', () => { describe('without an active field', () => { beforeEach(() => { - spyOn(registryService, 'getActiveMetadataField').and.returnValue(observableOf(undefined)); + spyOn(registryService, 'getActiveMetadataField').and.returnValue(of(undefined)); component.onSubmit(); fixture.detectChanges(); }); @@ -107,7 +107,7 @@ describe('MetadataFieldFormComponent', () => { }); beforeEach(() => { - spyOn(registryService, 'getActiveMetadataField').and.returnValue(observableOf(expectedWithId)); + spyOn(registryService, 'getActiveMetadataField').and.returnValue(of(expectedWithId)); component.onSubmit(); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts index 541f95626b..f1f1809000 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts @@ -32,9 +32,9 @@ import { FormComponent } from '../../../../shared/form/form.component'; selector: 'ds-metadata-field-form', templateUrl: './metadata-field-form.component.html', imports: [ + AsyncPipe, FormComponent, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts index 5885bde2b0..8457c67c11 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts @@ -11,7 +11,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; @@ -224,7 +224,7 @@ describe('MetadataSchemaComponent', () => { })); it('should cancel editing the selected field when clicked again', waitForAsync(() => { - comp.activeField$ = observableOf(mockFieldsList[2] as MetadataField); + comp.activeField$ = of(mockFieldsList[2] as MetadataField); spyOn(registryService, 'cancelEditMetadataField'); row.click(); fixture.detectChanges(); @@ -239,7 +239,7 @@ describe('MetadataSchemaComponent', () => { beforeEach(() => { spyOn(registryService, 'deleteMetadataField').and.callThrough(); - comp.selectedMetadataFieldIDs$ = observableOf(selectedFields.map((metadataField: MetadataField) => metadataField.id)); + comp.selectedMetadataFieldIDs$ = of(selectedFields.map((metadataField: MetadataField) => metadataField.id)); comp.deleteFields(); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts index 52f927073f..984988b199 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts @@ -19,7 +19,7 @@ import { BehaviorSubject, combineLatest, Observable, - of as observableOf, + of, Subscription, zip, } from 'rxjs'; @@ -53,12 +53,12 @@ import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field styleUrls: ['./metadata-schema.component.scss'], imports: [ AsyncPipe, - VarDirective, MetadataFieldFormComponent, - TranslateModule, - PaginationComponent, NgClass, + PaginationComponent, RouterLink, + TranslateModule, + VarDirective, ], standalone: true, }) @@ -126,7 +126,7 @@ export class MetadataSchemaComponent implements OnDestroy, OnInit { */ private updateFields() { this.metadataFields$ = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( - switchMap((currentPagination) => combineLatest([this.metadataSchema$, this.needsUpdate$, observableOf(currentPagination)])), + switchMap((currentPagination) => combineLatest([this.metadataSchema$, this.needsUpdate$, of(currentPagination)])), switchMap(([schema, update, currentPagination]: [MetadataSchema, boolean, PaginationComponentOptions]) => { if (update) { this.needsUpdate$.next(false); diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts index ae4df271ae..4c0025a0dc 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts @@ -18,7 +18,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DspaceRestService } from 'src/app/core/dspace-rest/dspace-rest.service'; import { RawRestResponse } from 'src/app/core/dspace-rest/raw-rest-response.model'; import { TranslateLoaderMock } from 'src/app/shared/mocks/translate-loader.mock'; @@ -80,7 +80,7 @@ describe('FiltersComponent', () => { describe('toggle', () => { beforeEach(() => { - spyOn(component, 'getFilteredCollections').and.returnValue(observableOf(expected)); + spyOn(component, 'getFilteredCollections').and.returnValue(of(expected)); spyOn(component.results, 'deserialize'); spyOn(component.accordionComponent, 'expand').and.callThrough(); component.submit(); diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts index 85924dd82f..a4b14e930a 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts @@ -30,10 +30,10 @@ import { FilteredCollections } from './filtered-collections.model'; templateUrl: './filtered-collections.component.html', styleUrls: ['./filtered-collections.component.scss'], imports: [ - TranslateModule, - NgbAccordionModule, FiltersComponent, KeyValuePipe, + NgbAccordionModule, + TranslateModule, ], standalone: true, }) diff --git a/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.spec.ts b/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.spec.ts index d9627dff70..d7a93f02bb 100644 --- a/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.spec.ts +++ b/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.spec.ts @@ -11,7 +11,7 @@ import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { ScriptDataService } from '../../../../core/data/processes/script-data.service'; @@ -59,7 +59,7 @@ describe('FilteredItemsExportCsvComponent', () => { invoke: createSuccessfulRemoteDataObject$(process), }); authorizationDataService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); notificationsService = new NotificationsServiceStub(); @@ -110,7 +110,7 @@ describe('FilteredItemsExportCsvComponent', () => { describe('when the user is not an admin', () => { beforeEach(waitForAsync(() => { initBeforeEachAsync(); - (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); })); beforeEach(() => { initBeforeEach(); diff --git a/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.ts b/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.ts index 50a0ca32b7..977f325fdd 100644 --- a/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.ts +++ b/src/app/admin/admin-reports/filtered-items/filtered-items-export-csv/filtered-items-export-csv.component.ts @@ -35,7 +35,11 @@ import { QueryPredicate } from '../query-predicate.model'; styleUrls: ['./filtered-items-export-csv.component.scss'], templateUrl: './filtered-items-export-csv.component.html', standalone: true, - imports: [NgbTooltipModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + TranslateModule, + ], }) /** * Display a button to export the MetadataQuery (aka Filtered Items) Report results as csv diff --git a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts index 1daea4168e..b5d2297321 100644 --- a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts +++ b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts @@ -61,14 +61,14 @@ import { QueryPredicate } from './query-predicate.model'; templateUrl: './filtered-items.component.html', styleUrls: ['./filtered-items.component.scss'], imports: [ - ReactiveFormsModule, - NgbAccordionModule, - TranslateModule, AsyncPipe, - FiltersComponent, BtnDisabledDirective, FilteredItemsExportCsvComponent, + FiltersComponent, + NgbAccordionModule, + ReactiveFormsModule, ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/admin/admin-search-page/admin-search-page.component.ts b/src/app/admin/admin-search-page/admin-search-page.component.ts index 4ae11a9d47..341c2b1213 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.ts @@ -8,7 +8,9 @@ import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed templateUrl: './admin-search-page.component.html', styleUrls: ['./admin-search-page.component.scss'], standalone: true, - imports: [ThemedConfigurationSearchPageComponent], + imports: [ + ThemedConfigurationSearchPageComponent, + ], }) /** diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts index 38352e7816..6a4b80e3dc 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts @@ -19,7 +19,10 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g styleUrls: ['./collection-admin-search-result-grid-element.component.scss'], templateUrl: './collection-admin-search-result-grid-element.component.html', standalone: true, - imports: [CollectionSearchResultGridElementComponent, RouterLink], + imports: [ + CollectionSearchResultGridElementComponent, + RouterLink, + ], }) /** * The component for displaying a list element for a collection search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts index 509c1e9266..6826c1ae3d 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts @@ -19,7 +19,10 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g styleUrls: ['./community-admin-search-result-grid-element.component.scss'], templateUrl: './community-admin-search-result-grid-element.component.html', standalone: true, - imports: [CommunitySearchResultGridElementComponent, RouterLink], + imports: [ + CommunitySearchResultGridElementComponent, + RouterLink, + ], }) /** * The component for displaying a list element for a community search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts index fd5e641f52..362bd5d54e 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts @@ -31,7 +31,10 @@ import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-r styleUrls: ['./item-admin-search-result-grid-element.component.scss'], templateUrl: './item-admin-search-result-grid-element.component.html', standalone: true, - imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective], + imports: [ + DynamicComponentLoaderDirective, + ItemAdminSearchResultActionsComponent, + ], }) /** * The component for displaying a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts index 0924379ea5..0405b5203c 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts @@ -20,7 +20,11 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l styleUrls: ['./collection-admin-search-result-list-element.component.scss'], templateUrl: './collection-admin-search-result-list-element.component.html', standalone: true, - imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule], + imports: [ + CollectionSearchResultListElementComponent, + RouterLink, + TranslateModule, + ], }) /** * The component for displaying a list element for a collection search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts index c4146dbd60..d8e0f235d4 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts @@ -20,7 +20,11 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l styleUrls: ['./community-admin-search-result-list-element.component.scss'], templateUrl: './community-admin-search-result-list-element.component.html', standalone: true, - imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule], + imports: [ + CommunitySearchResultListElementComponent, + RouterLink, + TranslateModule, + ], }) /** * The component for displaying a list element for a community search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts index d77e86689a..aab686370d 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts @@ -15,7 +15,10 @@ import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-r styleUrls: ['./item-admin-search-result-list-element.component.scss'], templateUrl: './item-admin-search-result-list-element.component.html', standalone: true, - imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent], + imports: [ + ItemAdminSearchResultActionsComponent, + ListableObjectComponentLoaderComponent, + ], }) /** * The component for displaying a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts index 681b02ce0e..e420d4be7f 100644 --- a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts @@ -23,7 +23,11 @@ import { getItemEditRoute } from '../../../item-page/item-page-routing-paths'; styleUrls: ['./item-admin-search-result-actions.component.scss'], templateUrl: './item-admin-search-result-actions.component.html', standalone: true, - imports: [NgClass, RouterLink, TranslateModule], + imports: [ + NgClass, + RouterLink, + TranslateModule, + ], }) /** * The component for displaying the actions for a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/themed-admin-search-page.component.ts b/src/app/admin/admin-search-page/themed-admin-search-page.component.ts index d49c184784..c3dcc9272f 100644 --- a/src/app/admin/admin-search-page/themed-admin-search-page.component.ts +++ b/src/app/admin/admin-search-page/themed-admin-search-page.component.ts @@ -10,7 +10,9 @@ import { AdminSearchPageComponent } from './admin-search-page.component'; selector: 'ds-admin-search-page', templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [AdminSearchPageComponent], + imports: [ + AdminSearchPageComponent, + ], }) export class ThemedAdminSearchPageComponent extends ThemedComponent { diff --git a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts index fdee7c70e4..becdcbd17b 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts @@ -96,7 +96,9 @@ describe('AdminSidebarSectionComponent', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [RouterTestingModule], + imports: [ + RouterTestingModule, + ], }) class TestComponent { } diff --git a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts index 66c7762269..1e0c4292b2 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts @@ -27,7 +27,12 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; templateUrl: './admin-sidebar-section.component.html', styleUrls: ['./admin-sidebar-section.component.scss'], standalone: true, - imports: [NgClass, RouterLink, TranslateModule, BrowserOnlyPipe], + imports: [ + BrowserOnlyPipe, + NgClass, + RouterLink, + TranslateModule, + ], }) export class AdminSidebarSectionComponent extends AbstractMenuSectionComponent implements OnInit { diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts index 25892be291..68f3cc550f 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts @@ -19,7 +19,7 @@ import { NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; @@ -57,7 +57,7 @@ describe('AdminSidebarComponent', () => { const routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), children: [], @@ -65,16 +65,16 @@ describe('AdminSidebarComponent', () => { const mockNgbModal = { open: jasmine.createSpy('open').and.returnValue( - { componentInstance: {}, closed: observableOf({}) } as NgbModalRef, + { componentInstance: {}, closed: of({}) } as NgbModalRef, ), }; beforeEach(waitForAsync(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); - scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) }); + scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: of(true) }); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], providers: [ @@ -98,10 +98,10 @@ describe('AdminSidebarComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getMenuTopSections').and.returnValue(observableOf([])); + spyOn(menuService, 'getMenuTopSections').and.returnValue(of([])); fixture = TestBed.createComponent(AdminSidebarComponent); comp = fixture.componentInstance; // SearchPageComponent test instance - comp.sections = observableOf([]); + comp.sections = of([]); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.ts index 910a384a8b..6300c80c9d 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -12,7 +12,7 @@ import { } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslatePipe } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -45,7 +45,14 @@ import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe'; styleUrls: ['./admin-sidebar.component.scss'], animations: [slideSidebar], standalone: true, - imports: [NgbDropdownModule, NgClass, NgComponentOutlet, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + NgbDropdownModule, + NgClass, + NgComponentOutlet, + TranslatePipe, + ], }) export class AdminSidebarComponent extends MenuComponent implements OnInit { /** diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts index fb227926b6..cd9dead066 100644 --- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts +++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts @@ -8,7 +8,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { MenuService } from '../../../shared/menu/menu.service'; import { MenuItemModels } from '../../../shared/menu/menu-section.model'; @@ -39,7 +39,7 @@ describe('ExpandableAdminSidebarSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([{ + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([{ id: 'test', visible: true, model: {} as MenuItemModels, @@ -90,7 +90,7 @@ describe('ExpandableAdminSidebarSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([])); fixture = TestBed.createComponent(ExpandableAdminSidebarSectionComponent); component = fixture.componentInstance; spyOn(component as any, 'getMenuItemComponent').and.returnValue(TestComponent); diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts index 0d46b1e7aa..fe8c8c9315 100644 --- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts +++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts @@ -37,7 +37,13 @@ import { AdminSidebarSectionComponent } from '../admin-sidebar-section/admin-sid styleUrls: ['./expandable-admin-sidebar-section.component.scss'], animations: [rotate, slide, bgColor], standalone: true, - imports: [NgClass, NgComponentOutlet, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + NgClass, + NgComponentOutlet, + TranslateModule, + ], }) export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionComponent implements OnInit { diff --git a/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts index 6127fd42a9..5c329abf5d 100644 --- a/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts @@ -15,7 +15,9 @@ import { AdminSidebarComponent } from './admin-sidebar.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [AdminSidebarComponent], + imports: [ + AdminSidebarComponent, + ], }) export class ThemedAdminSidebarComponent extends ThemedComponent { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts index a565c4d9b2..12c3343d77 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts @@ -17,7 +17,11 @@ import { styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'], templateUrl: './workflow-item-admin-workflow-actions.component.html', standalone: true, - imports: [NgClass, RouterLink, TranslateModule], + imports: [ + NgClass, + RouterLink, + TranslateModule, + ], }) /** * The component for displaying the actions for a list element for a workflow-item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts index 6dea020c59..8a5ed4407c 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts @@ -34,7 +34,12 @@ import { ErrorComponent } from '../../../../../../shared/error/error.component'; styleUrls: ['./supervision-order-group-selector.component.scss'], templateUrl: './supervision-order-group-selector.component.html', standalone: true, - imports: [FormsModule, ErrorComponent, EpersonGroupListComponent, TranslateModule], + imports: [ + EpersonGroupListComponent, + ErrorComponent, + FormsModule, + TranslateModule, + ], }) export class SupervisionOrderGroupSelectorComponent { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts index ae5e85019c..6eac15735c 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts @@ -38,7 +38,12 @@ export interface SupervisionOrderListEntry { templateUrl: './supervision-order-status.component.html', styleUrls: ['./supervision-order-status.component.scss'], standalone: true, - imports: [VarDirective, NgbTooltipModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + TranslateModule, + VarDirective, + ], }) export class SupervisionOrderStatusComponent implements OnChanges { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts index 04264b2c8f..c03d0a1135 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts @@ -49,7 +49,12 @@ import { styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'], templateUrl: './workspace-item-admin-workflow-actions.component.html', standalone: true, - imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, TranslateModule], + imports: [ + NgClass, + RouterLink, + SupervisionOrderStatusComponent, + TranslateModule, + ], }) /** * The component for displaying the actions for a list element for a workspace-item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts index 959a9e9985..99c7a45393 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -7,7 +7,7 @@ import { import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../../../core/auth/auth.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; @@ -71,7 +71,7 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => { { provide: ThemeService, useValue: themeService }, { provide: TruncatableService, useValue: { - isCollapsed: () => observableOf(true), + isCollapsed: () => of(true), }, }, { provide: BitstreamDataService, useValue: {} }, diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts index 8df382a7b3..9d42f9c2b7 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts @@ -43,7 +43,11 @@ import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflo styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'], templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html', standalone: true, - imports: [WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective], + imports: [ + DynamicComponentLoaderDirective, + TranslateModule, + WorkflowItemAdminWorkflowActionsComponent, + ], }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts index 4b0224a4a2..3bef33e42e 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -7,7 +7,7 @@ import { import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../../../core/auth/auth.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; @@ -83,7 +83,7 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => { { provide: ThemeService, useValue: themeService }, { provide: TruncatableService, useValue: { - isCollapsed: () => observableOf(true), + isCollapsed: () => of(true), }, }, { provide: BitstreamDataService, useValue: {} }, diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts index 271056c47e..aa7f26c596 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts @@ -56,7 +56,12 @@ import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/worksp styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'], templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html', standalone: true, - imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective], + imports: [ + AsyncPipe, + DynamicComponentLoaderDirective, + TranslateModule, + WorkspaceItemAdminWorkflowActionsComponent, + ], }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts index 584e79dccc..90515fd5f7 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts @@ -39,7 +39,12 @@ import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflo styleUrls: ['./workflow-item-search-result-admin-workflow-list-element.component.scss'], templateUrl: './workflow-item-search-result-admin-workflow-list-element.component.html', standalone: true, - imports: [ListableObjectComponentLoaderComponent, WorkflowItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ListableObjectComponentLoaderComponent, + TranslateModule, + WorkflowItemAdminWorkflowActionsComponent, + ], }) /** * The component for displaying a list element for a workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts index c9b0e6ca67..fcd4baa71b 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts @@ -49,7 +49,12 @@ import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/worksp styleUrls: ['./workspace-item-search-result-admin-workflow-list-element.component.scss'], templateUrl: './workspace-item-search-result-admin-workflow-list-element.component.html', standalone: true, - imports: [ListableObjectComponentLoaderComponent, WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ListableObjectComponentLoaderComponent, + TranslateModule, + WorkspaceItemAdminWorkflowActionsComponent, + ], }) /** * The component for displaying a list element for a workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/themed-admin-workflow-page.component.ts b/src/app/admin/admin-workflow-page/themed-admin-workflow-page.component.ts index 5668b5c7a6..81e55ec809 100644 --- a/src/app/admin/admin-workflow-page/themed-admin-workflow-page.component.ts +++ b/src/app/admin/admin-workflow-page/themed-admin-workflow-page.component.ts @@ -10,7 +10,9 @@ import { AdminWorkflowPageComponent } from './admin-workflow-page.component'; selector: 'ds-admin-workflow-page', templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [AdminWorkflowPageComponent], + imports: [ + AdminWorkflowPageComponent, + ], }) export class ThemedAdminWorkflowPageComponent extends ThemedComponent { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b87073c034..66636c3249 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -60,8 +60,8 @@ import { ThemeService } from './shared/theme-support/theme.service'; changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - ThemedRootComponent, AsyncPipe, + ThemedRootComponent, ], }) export class AppComponent implements OnInit, AfterViewInit { diff --git a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts index 2e528b5c5e..c2034b0a69 100644 --- a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts +++ b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts @@ -14,7 +14,7 @@ import { TranslateModule, } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Bitstream } from '../../core/shared/bitstream.model'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; @@ -45,7 +45,7 @@ describe('BitstreamAuthorizationsComponent', () => { const bitstreamRD = createSuccessfulRemoteDataObject(bitstream); const routeStub = { - data: observableOf({ + data: of({ bitstream: bitstreamRD, }), }; diff --git a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts index d6133f2a97..4821139b54 100644 --- a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts +++ b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts @@ -22,10 +22,10 @@ import { ResourcePoliciesComponent } from '../../shared/resource-policies/resour selector: 'ds-bitstream-authorizations', templateUrl: './bitstream-authorizations.component.html', imports: [ - ResourcePoliciesComponent, AsyncPipe, - TranslateModule, + ResourcePoliciesComponent, RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts index 9eec71fee5..5ef75db227 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts @@ -13,7 +13,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getForbiddenRoute } from '../../app-routing-paths'; import { AuthService } from '../../core/auth/auth.service'; @@ -61,16 +61,16 @@ describe('BitstreamDownloadPageComponent', () => { function init() { authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, - getShortlivedToken: observableOf('token'), + getShortlivedToken: of('token'), }); authorizationService = jasmine.createSpyObj('authorizationSerivice', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); fileService = jasmine.createSpyObj('fileService', { - retrieveFileDownloadLink: observableOf('content-url-with-headers'), + retrieveFileDownloadLink: of('content-url-with-headers'), }); hardRedirectService = jasmine.createSpyObj('hardRedirectService', { @@ -93,13 +93,13 @@ describe('BitstreamDownloadPageComponent', () => { }, }); activatedRoute = { - data: observableOf({ + data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream), }), - params: observableOf({ + params: of({ id: 'testid', }), - queryParams: observableOf({ + queryParams: of({ accessToken: undefined, }), }; @@ -111,13 +111,13 @@ describe('BitstreamDownloadPageComponent', () => { }); signpostingDataService = jasmine.createSpyObj('SignpostingDataService', { - getLinks: observableOf([mocklink, mocklink2]), + getLinks: of([mocklink, mocklink2]), }); matomoService = jasmine.createSpyObj('MatomoService', { - appendVisitorId: observableOf(''), - isMatomoEnabled$: observableOf(true), + appendVisitorId: of(''), + isMatomoEnabled$: of(true), }); - matomoService.appendVisitorId.and.callFake((link) => observableOf(link)); + matomoService.appendVisitorId.and.callFake((link) => of(link)); } function initTestbed() { @@ -161,7 +161,7 @@ describe('BitstreamDownloadPageComponent', () => { describe('when the user is authorized and not logged in', () => { beforeEach(waitForAsync(() => { init(); - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false)); initTestbed(); })); @@ -198,7 +198,7 @@ describe('BitstreamDownloadPageComponent', () => { describe('when the user is not authorized and logged in', () => { beforeEach(waitForAsync(() => { init(); - (authorizationService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); initTestbed(); })); beforeEach(() => { @@ -215,8 +215,8 @@ describe('BitstreamDownloadPageComponent', () => { describe('when the user is not authorized and not logged in', () => { beforeEach(waitForAsync(() => { init(); - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false)); - (authorizationService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false)); + (authorizationService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); initTestbed(); })); beforeEach(() => { @@ -236,7 +236,7 @@ describe('BitstreamDownloadPageComponent', () => { describe('when Matomo is enabled', () => { beforeEach(waitForAsync(() => { init(); - (matomoService.appendVisitorId as jasmine.Spy).and.callFake((link) => observableOf(link + '?visitorId=12345')); + (matomoService.appendVisitorId as jasmine.Spy).and.callFake((link) => of(link + '?visitorId=12345')); initTestbed(); })); beforeEach(() => { @@ -255,7 +255,7 @@ describe('BitstreamDownloadPageComponent', () => { describe('when Matomo is not enabled', () => { beforeEach(waitForAsync(() => { init(); - (matomoService.isMatomoEnabled$ as jasmine.Spy).and.returnValue(observableOf(false)); + (matomoService.isMatomoEnabled$ as jasmine.Spy).and.returnValue(of(false)); initTestbed(); })); beforeEach(() => { diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts index 6afa9c7553..36d8eca640 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts @@ -19,7 +19,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { filter, @@ -108,7 +108,7 @@ export class BitstreamDownloadPageComponent implements OnInit { const isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(bitstream) ? bitstream.self : undefined); const isLoggedIn$ = this.auth.isAuthenticated(); const isMatomoEnabled$ = this.matomoService.isMatomoEnabled$(); - return observableCombineLatest([isAuthorized$, isLoggedIn$, isMatomoEnabled$, accessToken$, observableOf(bitstream)]); + return observableCombineLatest([isAuthorized$, isLoggedIn$, isMatomoEnabled$, accessToken$, of(bitstream)]); }), filter(([isAuthorized, isLoggedIn, isMatomoEnabled, accessToken, bitstream]: [boolean, boolean, boolean, string, Bitstream]) => (hasValue(isAuthorized) && hasValue(isLoggedIn)) || hasValue(accessToken)), take(1), @@ -132,7 +132,7 @@ export class BitstreamDownloadPageComponent implements OnInit { map((fileLinkWithVisitorId) => [isAuthorized, isLoggedIn, bitstream, fileLinkWithVisitorId, accessToken]), ); } - return observableOf([isAuthorized, isLoggedIn, bitstream, fileLink, accessToken]); + return of([isAuthorized, isLoggedIn, bitstream, fileLink, accessToken]); }), ).subscribe(([isAuthorized, isLoggedIn, bitstream, fileLink, accessToken]: [boolean, boolean, Bitstream, string, string]) => { if (isAuthorized && isLoggedIn && isNotEmpty(fileLink)) { diff --git a/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts b/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts index 9b4d019058..e46a1b12e6 100644 --- a/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts +++ b/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts @@ -5,7 +5,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from 'src/app/core/auth/auth.service'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; @@ -29,14 +29,14 @@ describe('bitstreamPageAuthorizationsGuard', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, navigateByUrl: undefined, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { diff --git a/src/app/bitstream-page/bitstream-page-authorizations.guard.ts b/src/app/bitstream-page/bitstream-page-authorizations.guard.ts index 134693977f..6c5a6d3752 100644 --- a/src/app/bitstream-page/bitstream-page-authorizations.guard.ts +++ b/src/app/bitstream-page/bitstream-page-authorizations.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { bitstreamPageResolver } from './bitstream-page.resolver'; export const bitstreamPageAuthorizationsGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => bitstreamPageResolver, - () => observableOf(FeatureID.CanManagePolicies), + () => of(FeatureID.CanManagePolicies), ); diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index 7da9e040ce..ca55626411 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -21,7 +21,7 @@ import { DynamicFormService, } from '@ng-dynamic-forms/core'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; @@ -222,7 +222,7 @@ describe('EditBitstreamPageComponent', () => { { provide: ActivatedRoute, useValue: { - data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), snapshot: { queryParams: {} }, }, }, @@ -517,7 +517,7 @@ describe('EditBitstreamPageComponent', () => { { provide: ActivatedRoute, useValue: { - data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), snapshot: { queryParams: {} }, }, }, @@ -640,7 +640,7 @@ describe('EditBitstreamPageComponent', () => { { provide: DynamicFormService, useValue: formService }, { provide: ActivatedRoute, useValue: { - data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), snapshot: { queryParams: {} }, }, }, diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 6ad82b2a74..61338f8df3 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -28,7 +28,7 @@ import { combineLatest, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -83,15 +83,15 @@ import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.compo templateUrl: './edit-bitstream-page.component.html', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ - FormComponent, - VarDirective, - ThemedThumbnailComponent, AsyncPipe, - RouterLink, ErrorComponent, - ThemedLoadingComponent, - TranslateModule, FileSizePipe, + FormComponent, + RouterLink, + ThemedLoadingComponent, + ThemedThumbnailComponent, + TranslateModule, + VarDirective, ], standalone: true, }) @@ -682,7 +682,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { })); } else { - bundle$ = observableOf(this.bundle); + bundle$ = of(this.bundle); } if (isNewFormat) { bitstream$ = this.bitstreamService.updateFormat(this.bitstream, this.selectedFormat).pipe( @@ -699,7 +699,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { }), ); } else { - bitstream$ = observableOf(this.bitstream); + bitstream$ = of(this.bitstream); } combineLatest([bundle$, bitstream$]).pipe( diff --git a/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts index 7e922485cb..dcf1ac4593 100644 --- a/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts @@ -8,7 +8,9 @@ import { EditBitstreamPageComponent } from './edit-bitstream-page.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [EditBitstreamPageComponent], + imports: [ + EditBitstreamPageComponent, + ], }) export class ThemedEditBitstreamPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/breadcrumbs/breadcrumbs.component.spec.ts b/src/app/breadcrumbs/breadcrumbs.component.spec.ts index 168028cd1e..1e4a252c23 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.spec.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.spec.ts @@ -10,7 +10,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TranslateLoaderMock } from '../shared/testing/translate-loader.mock'; import { VarDirective } from '../shared/utils/var.directive'; @@ -38,12 +38,12 @@ describe('BreadcrumbsComponent', () => { beforeEach(waitForAsync(() => { breadcrumbsServiceMock = { - breadcrumbs$: observableOf([ + breadcrumbs$: of([ // NOTE: a root breadcrumb is automatically rendered new Breadcrumb('bc 1', 'example.com'), new Breadcrumb('bc 2', 'another.com'), ]), - showBreadcrumbs$: observableOf(true), + showBreadcrumbs$: of(true), } as BreadcrumbsService; TestBed.configureTestingModule({ diff --git a/src/app/breadcrumbs/breadcrumbs.component.ts b/src/app/breadcrumbs/breadcrumbs.component.ts index a137a3aaa2..8d241ebac3 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.ts @@ -20,7 +20,14 @@ import { BreadcrumbsService } from './breadcrumbs.service'; templateUrl: './breadcrumbs.component.html', styleUrls: ['./breadcrumbs.component.scss'], standalone: true, - imports: [VarDirective, NgTemplateOutlet, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + NgTemplateOutlet, + RouterLink, + TranslateModule, + VarDirective, + ], }) export class BreadcrumbsComponent { diff --git a/src/app/breadcrumbs/breadcrumbs.service.spec.ts b/src/app/breadcrumbs/breadcrumbs.service.spec.ts index 89dd2c98b5..8f074cf5a4 100644 --- a/src/app/breadcrumbs/breadcrumbs.service.spec.ts +++ b/src/app/breadcrumbs/breadcrumbs.service.spec.ts @@ -7,7 +7,7 @@ import { import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, Subject, } from 'rxjs'; @@ -18,7 +18,7 @@ import { BreadcrumbsService } from './breadcrumbs.service'; class TestBreadcrumbsService implements BreadcrumbsProviderService { getBreadcrumbs(key: string, url: string): Observable { - return observableOf([new Breadcrumb(key, url)]); + return of([new Breadcrumb(key, url)]); } } diff --git a/src/app/breadcrumbs/breadcrumbs.service.ts b/src/app/breadcrumbs/breadcrumbs.service.ts index 73ec7da39b..1cf770d998 100644 --- a/src/app/breadcrumbs/breadcrumbs.service.ts +++ b/src/app/breadcrumbs/breadcrumbs.service.ts @@ -7,7 +7,7 @@ import { import { combineLatest, Observable, - of as observableOf, + of, ReplaySubject, } from 'rxjs'; import { @@ -86,7 +86,7 @@ export class BreadcrumbsService { return provider.getBreadcrumbs(key, url); } } - return !last ? this.resolveBreadcrumbs(route.firstChild) : observableOf([]); + return !last ? this.resolveBreadcrumbs(route.firstChild) : of([]); } /** diff --git a/src/app/breadcrumbs/themed-breadcrumbs.component.ts b/src/app/breadcrumbs/themed-breadcrumbs.component.ts index 255af605dc..04da1f4116 100644 --- a/src/app/breadcrumbs/themed-breadcrumbs.component.ts +++ b/src/app/breadcrumbs/themed-breadcrumbs.component.ts @@ -11,7 +11,9 @@ import { BreadcrumbsComponent } from './breadcrumbs.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [BreadcrumbsComponent], + imports: [ + BreadcrumbsComponent, + ], }) export class ThemedBreadcrumbsComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts index fad573705c..611ac7e23f 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts @@ -20,7 +20,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment'; @@ -96,9 +96,9 @@ describe('BrowseByDateComponent', () => { }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - params: observableOf({}), - queryParams: observableOf({}), - data: observableOf({ metadata: 'dateissued', metadataField: 'dc.date.issued' }), + params: of({}), + queryParams: of({}), + data: of({ metadata: 'dateissued', metadataField: 'dc.date.issued' }), }); const mockCdRef = Object.assign({ diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.ts index 3cf4e94de7..2b4b04d348 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -18,7 +18,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilChanged, @@ -61,9 +61,9 @@ import { standalone: true, imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, ThemedBrowseByComponent, + ThemedLoadingComponent, + TranslateModule, ], }) /** @@ -94,7 +94,7 @@ export class BrowseByDateComponent extends BrowseByMetadataComponent implements ngOnInit(): void { if (!this.renderOnServerSide && !environment.ssr.enableBrowseComponent && isPlatformServer(this.platformId)) { - this.loading$ = observableOf(false); + this.loading$ = of(false); return; } const sortConfig = new SortOptions('default', SortDirection.ASC); diff --git a/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.spec.ts b/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.spec.ts index 25ce9742d5..782af21f10 100644 --- a/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.spec.ts +++ b/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.spec.ts @@ -7,7 +7,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { StoreModule } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { environment } from '../../../environments/environment'; import { buildPaginatedList } from '../../core/data/paginated-list.model'; @@ -25,7 +25,7 @@ import { BrowseByGeospatialDataComponent } from './browse-by-geospatial-data.com // create route stub const scope = 'test scope'; const activatedRouteStub = { - queryParams: observableOf({ + queryParams: of({ scope: scope, }), }; @@ -107,7 +107,7 @@ describe('BrowseByGeospatialDataComponent', () => { fixture = TestBed.createComponent(BrowseByGeospatialDataComponent); component = fixture.componentInstance; spyOn(searchService, 'getFacetValuesFor').and.returnValue(mockPointValues); - component.scope$ = observableOf(''); + component.scope$ = of(''); component.ngOnInit(); fixture.detectChanges(); }); @@ -128,7 +128,7 @@ describe('BrowseByGeospatialDataComponent', () => { fixture = TestBed.createComponent(BrowseByGeospatialDataComponent); component = fixture.componentInstance; spyOn(searchService, 'getFacetValuesFor').and.returnValue(mockValues); - component.scope$ = observableOf(''); + component.scope$ = of(''); component.ngOnInit(); fixture.detectChanges(); }); diff --git a/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.ts b/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.ts index 27d6ce14e2..333cb28e4f 100644 --- a/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.ts +++ b/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.ts @@ -44,7 +44,12 @@ import { PaginatedSearchOptions } from '../../shared/search/models/paginated-sea templateUrl: './browse-by-geospatial-data.component.html', styleUrls: ['./browse-by-geospatial-data.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, - imports: [GeospatialMapComponent, NgIf, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + GeospatialMapComponent, + NgIf, + TranslateModule, + ], standalone: true, }) /** diff --git a/src/app/browse-by/browse-by-guard.ts b/src/app/browse-by/browse-by-guard.ts index 62fff2fbc6..d154e8d4f6 100644 --- a/src/app/browse-by/browse-by-guard.ts +++ b/src/app/browse-by/browse-by-guard.ts @@ -9,7 +9,7 @@ import { import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -42,7 +42,7 @@ export const browseByGuard: CanActivateFn = ( map((browseDefinitionRD: RemoteData) => browseDefinitionRD.payload), ); } else { - browseDefinition$ = observableOf(route.data.browseDefinition); + browseDefinition$ = of(route.data.browseDefinition); } const scope = route.queryParams.scope ?? route.parent?.params.id; const value = route.queryParams.value; @@ -51,10 +51,10 @@ export const browseByGuard: CanActivateFn = ( switchMap((browseDefinition: BrowseDefinition | undefined) => { if (hasValue(browseDefinition)) { route.data = createData(title, id, browseDefinition, metadataTranslated, value, route, scope); - return observableOf(true); + return of(true); } else { void router.navigate([PAGE_NOT_FOUND_PATH]); - return observableOf(false); + return of(false); } }), ); diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts index 623f1af8aa..fc892c67e7 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts @@ -21,7 +21,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RouteService } from 'src/app/core/services/route.service'; import { DsoEditMenuComponent } from 'src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; @@ -124,7 +124,7 @@ describe('BrowseByMetadataComponent', () => { }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - params: observableOf({}), + params: of({}), }); paginationService = new PaginationServiceStub(); @@ -170,7 +170,7 @@ describe('BrowseByMetadataComponent', () => { fixture.detectChanges(); browseService = (comp as any).browseService; route = (comp as any).route; - route.params = observableOf({}); + route.params = of({}); comp.ngOnInit(); fixture.detectChanges(); }); @@ -190,7 +190,7 @@ describe('BrowseByMetadataComponent', () => { value: 'John Doe', }; - route.params = observableOf(paramsWithValue); + route.params = of(paramsWithValue); comp.ngOnInit(); fixture.detectChanges(); }); diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index 87366d38c6..6b66be8eaf 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -22,7 +22,7 @@ import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -68,9 +68,9 @@ export const BBM_PAGINATION_ID = 'bbm'; templateUrl: './browse-by-metadata.component.html', imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, ThemedBrowseByComponent, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) @@ -186,7 +186,7 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy { /** * Observable determining if the loading animation needs to be shown */ - loading$ = observableOf(true); + loading$ = of(true); /** * Whether this component should be rendered or not in SSR */ @@ -213,7 +213,7 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy { ngOnInit(): void { if (this.ssrRenderingDisabled) { - this.loading$ = observableOf(false); + this.loading$ = of(false); return; } const sortConfig = new SortOptions('default', SortDirection.ASC); diff --git a/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts b/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts index 1ad9a4d816..b42639d69e 100644 --- a/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts +++ b/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts @@ -31,7 +31,9 @@ class BrowseByTestComponent { selector: 'ds-browse-by-switcher', template: ``, standalone: true, - imports: [DynamicComponentLoaderDirective], + imports: [ + DynamicComponentLoaderDirective, + ], }) class TestBrowseBySwitcherComponent extends BrowseBySwitcherComponent { getComponent(): GenericConstructor { diff --git a/src/app/browse-by/browse-by-page/browse-by-page.component.ts b/src/app/browse-by/browse-by-page/browse-by-page.component.ts index 670b5a7711..b0f32f2dd2 100644 --- a/src/app/browse-by/browse-by-page/browse-by-page.component.ts +++ b/src/app/browse-by/browse-by-page/browse-by-page.component.ts @@ -16,8 +16,8 @@ import { BrowseBySwitcherComponent } from '../browse-by-switcher/browse-by-switc templateUrl: './browse-by-page.component.html', styleUrls: ['./browse-by-page.component.scss'], imports: [ - BrowseBySwitcherComponent, AsyncPipe, + BrowseBySwitcherComponent, ], standalone: true, }) diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts index 53be5fa786..cb50767474 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts @@ -17,7 +17,11 @@ import { getComponentByBrowseByType } from './browse-by-decorator'; @Component({ selector: 'ds-browse-by-switcher', templateUrl: '../../shared/abstract-component-loader/abstract-component-loader.component.html', - imports: [AsyncPipe, NgComponentOutlet, DynamicComponentLoaderDirective], + imports: [ + AsyncPipe, + DynamicComponentLoaderDirective, + NgComponentOutlet, + ], standalone: true, }) export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent { diff --git a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts index 4115bc7349..71abac56f7 100644 --- a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts +++ b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts @@ -1,4 +1,3 @@ -import { AsyncPipe } from '@angular/common'; import { Component, Input, @@ -12,7 +11,7 @@ import { RouterLink, } from '@angular/router'; import { - TranslateModule, + TranslatePipe, TranslateService, } from '@ngx-translate/core'; import { @@ -27,17 +26,8 @@ import { Context } from '../../core/shared/context.model'; import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model'; import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model'; -import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; -import { ThemedComcolPageBrowseByComponent } from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { ThemedComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/themed-comcol-page-content.component'; -import { ThemedComcolPageHandleComponent } from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { hasValue } from '../../shared/empty.util'; import { VocabularyTreeviewComponent } from '../../shared/form/vocabulary-treeview/vocabulary-treeview.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { VarDirective } from '../../shared/utils/var.directive'; import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; @Component({ @@ -45,19 +35,9 @@ import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; templateUrl: './browse-by-taxonomy.component.html', styleUrls: ['./browse-by-taxonomy.component.scss'], imports: [ - VarDirective, - AsyncPipe, - ComcolPageHeaderComponent, - ComcolPageLogoComponent, - ThemedComcolPageHandleComponent, - ThemedComcolPageContentComponent, - DsoEditMenuComponent, - ThemedComcolPageBrowseByComponent, - TranslateModule, - ThemedLoadingComponent, - ThemedBrowseByComponent, - VocabularyTreeviewComponent, RouterLink, + TranslatePipe, + VocabularyTreeviewComponent, ], standalone: true, }) diff --git a/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts b/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts index 1b6d96d3f8..f60a142ade 100644 --- a/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts +++ b/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts @@ -17,7 +17,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment'; @@ -83,9 +83,9 @@ describe('BrowseByTitleComponent', () => { }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - params: observableOf({}), - queryParams: observableOf({}), - data: observableOf({ metadata: 'title' }), + params: of({}), + queryParams: of({}), + data: of({ metadata: 'title' }), }); const paginationService = new PaginationServiceStub(); diff --git a/src/app/browse-by/browse-by-title/browse-by-title.component.ts b/src/app/browse-by/browse-by-title/browse-by-title.component.ts index 2c8f9eeaa1..bcf175f900 100644 --- a/src/app/browse-by/browse-by-title/browse-by-title.component.ts +++ b/src/app/browse-by/browse-by-title/browse-by-title.component.ts @@ -11,7 +11,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilChanged, @@ -38,9 +38,9 @@ import { standalone: true, imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, ThemedBrowseByComponent, + ThemedLoadingComponent, + TranslateModule, ], }) /** @@ -50,7 +50,7 @@ export class BrowseByTitleComponent extends BrowseByMetadataComponent implements ngOnInit(): void { if (!this.renderOnServerSide && !environment.ssr.enableBrowseComponent && isPlatformServer(this.platformId)) { - this.loading$ = observableOf(false); + this.loading$ = of(false); return; } const sortConfig = new SortOptions('dc.title', SortDirection.ASC); diff --git a/src/app/collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts index 49890c7cb5..896edf8ceb 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -55,11 +55,11 @@ import { templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', standalone: true, imports: [ + AsyncPipe, + ComcolPageLogoComponent, FormComponent, TranslateModule, UploaderComponent, - AsyncPipe, - ComcolPageLogoComponent, VarDirective, ], }) diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts index 71ba467084..4a124fa48d 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -87,7 +87,7 @@ describe('CollectionItemMapperComponent', () => { }, }); const mockCollectionRD: RemoteData = createSuccessfulRemoteDataObject(mockCollection); - const mockSearchOptions = observableOf(new PaginatedSearchOptions({ + const mockSearchOptions = of(new PaginatedSearchOptions({ pagination: Object.assign(new PaginationComponentOptions(), { id: 'search-page-configuration', pageSize: 10, @@ -109,11 +109,11 @@ describe('CollectionItemMapperComponent', () => { const emptyList = createSuccessfulRemoteDataObject(createPaginatedList([])); const itemDataServiceStub = { mapToCollection: () => createSuccessfulRemoteDataObject$({}), - findListByHref: () => observableOf(emptyList), + findListByHref: () => of(emptyList), }; const activatedRouteStub = { parent: { - data: observableOf({ + data: of({ dso: mockCollectionRD, }), }, @@ -124,42 +124,42 @@ describe('CollectionItemMapperComponent', () => { }, }; const translateServiceStub = { - get: () => observableOf('test-message of collection ' + mockCollection.name), + get: () => of('test-message of collection ' + mockCollection.name), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), onDefaultLangChange: new EventEmitter(), }; const searchServiceStub = Object.assign(new SearchServiceStub(), { - search: () => observableOf(emptyList), + search: () => of(emptyList), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ clearDiscoveryRequests: () => {}, /* eslint-enable no-empty,@typescript-eslint/no-empty-function */ }); const collectionDataServiceStub = { - getMappedItems: () => observableOf(emptyList), + getMappedItems: () => of(emptyList), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ clearMappedItemsRequests: () => {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ }; const routeServiceStub = { getRouteParameterValue: () => { - return observableOf(''); + return of(''); }, getQueryParameterValue: () => { - return observableOf(''); + return of(''); }, getQueryParamsWithPrefix: () => { - return observableOf(''); + return of(''); }, }; const fixedFilterServiceStub = { getQueryByFilterName: () => { - return observableOf(''); + return of(''); }, }; const authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); const linkHeadService = jasmine.createSpyObj('linkHeadService', { diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts index 4fce1601a9..745e59eb03 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -78,12 +78,12 @@ import { followLink } from '../../shared/utils/follow-link-config.model'; }, ], imports: [ - ThemedSearchFormComponent, - NgbNavModule, - TranslateModule, AsyncPipe, - ItemSelectComponent, BrowserOnlyPipe, + ItemSelectComponent, + NgbNavModule, + ThemedSearchFormComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/collection-page/collection-page-administrator.guard.ts b/src/app/collection-page/collection-page-administrator.guard.ts index 30edc72fc6..36875f23ad 100644 --- a/src/app/collection-page/collection-page-administrator.guard.ts +++ b/src/app/collection-page/collection-page-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { collectionPageResolver } from './collection-page.resolver'; export const collectionPageAdministratorGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => collectionPageResolver, - () => observableOf(FeatureID.AdministratorOf), + () => of(FeatureID.AdministratorOf), ); diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index 37429ba8ec..6e2f80a030 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -44,7 +44,6 @@ import { } from '../shared/empty.util'; import { ErrorComponent } from '../shared/error/error.component'; import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { ObjectCollectionComponent } from '../shared/object-collection/object-collection.component'; import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; import { VarDirective } from '../shared/utils/var.directive'; import { getCollectionPageRoute } from './collection-page-routing-paths'; @@ -59,19 +58,18 @@ import { getCollectionPageRoute } from './collection-page-routing-paths'; fadeInOut, ], imports: [ - ThemedComcolPageContentComponent, - ErrorComponent, - ThemedLoadingComponent, - TranslateModule, - VarDirective, AsyncPipe, ComcolPageHeaderComponent, ComcolPageLogoComponent, - ThemedComcolPageHandleComponent, DsoEditMenuComponent, - ThemedComcolPageBrowseByComponent, - ObjectCollectionComponent, + ErrorComponent, RouterOutlet, + ThemedComcolPageBrowseByComponent, + ThemedComcolPageContentComponent, + ThemedComcolPageHandleComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts index 061e9dc148..bb22c8585b 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -35,9 +35,9 @@ describe('CreateCollectionPageComponent', () => { { provide: CollectionDataService, useValue: {} }, { provide: CommunityDataService, - useValue: { findById: () => observableOf({ payload: { name: 'test' } }) }, + useValue: { findById: () => of({ payload: { name: 'test' } }) }, }, - { provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } }, + { provide: RouteService, useValue: { getQueryParameterValue: () => of('1234') } }, { provide: Router, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: RequestService, useValue: {} }, diff --git a/src/app/collection-page/create-collection-page/create-collection-page.component.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.ts index 989d77c15b..1a36489f03 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.component.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.component.ts @@ -25,10 +25,10 @@ import { CollectionFormComponent } from '../collection-form/collection-form.comp styleUrls: ['./create-collection-page.component.scss'], templateUrl: './create-collection-page.component.html', imports: [ - CollectionFormComponent, - TranslateModule, AsyncPipe, + CollectionFormComponent, ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/collection-page/create-collection-page/create-collection-page.guard.ts b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts index 099578c550..e52fe57d25 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.guard.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts @@ -7,7 +7,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -36,7 +36,7 @@ export const createCollectionPageGuard: CanActivateFn = ( const parentID = route.queryParams.parent; if (hasNoValue(parentID)) { router.navigate(['/404']); - return observableOf(false); + return of(false); } return communityService.findById(parentID) .pipe( diff --git a/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts index 8a99397b91..2b5b8a3d13 100644 --- a/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts +++ b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { CollectionDataService } from '../../core/data/collection-data.service'; @@ -27,7 +27,7 @@ describe('DeleteCollectionPageComponent', () => { providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CollectionDataService, useValue: {} }, - { provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } }, + { provide: ActivatedRoute, useValue: { data: of({ dso: { payload: {} } }) } }, { provide: NotificationsService, useValue: {} }, { provide: RequestService, useValue: {} }, ], diff --git a/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts index 61a6bd3336..30ecf9a271 100644 --- a/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts +++ b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts @@ -25,10 +25,10 @@ import { VarDirective } from '../../shared/utils/var.directive'; styleUrls: ['./delete-collection-page.component.scss'], templateUrl: './delete-collection-page.component.html', imports: [ - TranslateModule, AsyncPipe, - VarDirective, BtnDisabledDirective, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts index a64a8a273d..f0305c6f59 100644 --- a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts @@ -3,10 +3,7 @@ import { TestBed, } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { Community } from '../../../core/shared/community.model'; import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; @@ -23,7 +20,7 @@ describe('CollectionAccessControlComponent', () => { 'dc.title': [{ value: 'community' }], }, uuid: 'communityUUID', - parentCommunity: observableOf(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), + parentCommunity: of(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), _links: { parentCommunity: 'site', diff --git a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts index 3ee3f1c6b0..779bf1d5e3 100644 --- a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Collection } from '../../../core/shared/collection.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; @@ -35,7 +35,7 @@ describe('CollectionAuthorizationsComponent', () => { const routeStub = { parent: { parent: { - data: observableOf({ + data: of({ dso: collectionRD, }), }, diff --git a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts index 31824b7be8..c354549438 100644 --- a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts @@ -18,8 +18,8 @@ import { ResourcePoliciesComponent } from '../../../shared/resource-policies/res selector: 'ds-collection-authorizations', templateUrl: './collection-authorizations.component.html', imports: [ - ResourcePoliciesComponent, AsyncPipe, + ResourcePoliciesComponent, ], standalone: true, }) diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts index b10131e4f4..110b9f4c25 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Collection } from '../../../core/shared/collection.model'; @@ -32,7 +32,7 @@ describe('CollectionCurateComponent', () => { beforeEach(waitForAsync(() => { routeStub = { parent: { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(collection), }), }, diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts index 370506e473..f97baffff2 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts @@ -25,9 +25,9 @@ import { hasValue } from '../../../shared/empty.util'; selector: 'ds-collection-curate', templateUrl: './collection-curate.component.html', imports: [ + AsyncPipe, CurationFormComponent, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts index 8a02f0c1d4..a7dc82b00a 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { AuthService } from '../../../core/auth/auth.service'; @@ -57,8 +57,8 @@ describe('CollectionMetadataComponent', () => { const itemTemplateServiceStub = jasmine.createSpyObj('itemTemplateService', { findByCollectionID: createSuccessfulRemoteDataObject$(template), createByCollectionID: createSuccessfulRemoteDataObject$(template), - delete: observableOf(true), - getCollectionEndpoint: observableOf(collectionTemplateHref), + delete: of(true), + getCollectionEndpoint: of(collectionTemplateHref), }); const notificationsService = jasmine.createSpyObj('notificationsService', { @@ -70,7 +70,7 @@ describe('CollectionMetadataComponent', () => { }); const routerMock = { - events: observableOf(new NavigationEnd(1, 'url', 'url')), + events: of(new NavigationEnd(1, 'url', 'url')), navigate: jasmine.createSpy('navigate'), }; @@ -80,7 +80,7 @@ describe('CollectionMetadataComponent', () => { providers: [ { provide: CollectionDataService, useValue: {} }, { provide: ItemTemplateDataService, useValue: itemTemplateServiceStub }, - { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, + { provide: ActivatedRoute, useValue: { parent: { data: of({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, { provide: NotificationsService, useValue: notificationsService }, { provide: RequestService, useValue: requestService }, { provide: Router, useValue: routerMock }, @@ -100,7 +100,7 @@ describe('CollectionMetadataComponent', () => { spyOn(comp, 'ngOnInit'); spyOn(comp, 'initTemplateItem'); - routerMock.events = observableOf(new NavigationEnd(1, 'url', 'url')); + routerMock.events = of(new NavigationEnd(1, 'url', 'url')); fixture.detectChanges(); }); diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts index 26f55770c1..29a6ebb710 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts @@ -49,9 +49,9 @@ import { getCollectionItemTemplateRoute } from '../../collection-page-routing-pa selector: 'ds-collection-metadata', templateUrl: './collection-metadata.component.html', imports: [ + AsyncPipe, CollectionFormComponent, RouterLink, - AsyncPipe, TranslateModule, VarDirective, ], diff --git a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts index 76ab4079f2..8fd4941eab 100644 --- a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts @@ -11,7 +11,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../../core/data/request.service'; @@ -36,7 +36,7 @@ describe('CollectionRolesComponent', () => { const route = { parent: { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject( Object.assign(new Collection(), { _links: { @@ -69,7 +69,7 @@ describe('CollectionRolesComponent', () => { }; const requestService = { - hasByHref$: () => observableOf(true), + hasByHref$: () => of(true), }; const groupDataService = { diff --git a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts index bde3d30828..3911c16046 100644 --- a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts @@ -27,8 +27,8 @@ import { hasValue } from '../../../shared/empty.util'; selector: 'ds-collection-roles', templateUrl: './collection-roles.component.html', imports: [ - ComcolRoleComponent, AsyncPipe, + ComcolRoleComponent, ], standalone: true, }) diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts index cbe3de1483..c8249e170a 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts @@ -9,7 +9,7 @@ import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; @@ -100,7 +100,7 @@ describe('CollectionSourceControlsComponent', () => { findByHref: createSuccessfulRemoteDataObject$(bitstream), }); httpClient = jasmine.createSpyObj('httpClient', { - get: observableOf('Script text'), + get: of('Script text'), }); requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts index 1e07978af7..dbe20fc579 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts @@ -50,10 +50,10 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; styleUrls: ['./collection-source-controls.component.scss'], templateUrl: './collection-source-controls.component.html', imports: [ - TranslateModule, AsyncPipe, - VarDirective, BtnDisabledDirective, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts index 3457d75175..3e61103ff6 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts @@ -19,7 +19,7 @@ import { DynamicFormService, } from '@ng-dynamic-forms/core'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { CollectionDataService } from '../../../core/data/collection-data.service'; import { FieldUpdate } from '../../../core/data/object-updates/field-update.model'; @@ -97,18 +97,18 @@ describe('CollectionSourceComponent', () => { }; objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { - getFieldUpdates: observableOf({ + getFieldUpdates: of({ [contentSource.uuid]: fieldUpdate, }), saveAddFieldUpdate: {}, discardFieldUpdates: {}, - reinstateFieldUpdates: observableOf(true), + reinstateFieldUpdates: of(true), initialize: {}, - getUpdatedFields: observableOf([contentSource]), - getLastModified: observableOf(date), - hasUpdates: observableOf(true), - isReinstatable: observableOf(false), - isValidPage: observableOf(true), + getUpdatedFields: of([contentSource]), + getLastModified: of(date), + hasUpdates: of(true), + isReinstatable: of(false), + isValidPage: of(true), }, ); notificationsService = jasmine.createSpyObj('notificationsService', @@ -139,8 +139,8 @@ describe('CollectionSourceComponent', () => { }); collectionService = jasmine.createSpyObj('collectionService', { getContentSource: createSuccessfulRemoteDataObject$(contentSource), - updateContentSource: observableOf(contentSource), - getHarvesterEndpoint: observableOf('harvester-endpoint'), + updateContentSource: of(contentSource), + getHarvesterEndpoint: of('harvester-endpoint'), }); requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); @@ -151,7 +151,7 @@ describe('CollectionSourceComponent', () => { { provide: NotificationsService, useValue: notificationsService }, { provide: Location, useValue: location }, { provide: DynamicFormService, useValue: formService }, - { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, + { provide: ActivatedRoute, useValue: { parent: { data: of({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, { provide: Router, useValue: router }, { provide: CollectionDataService, useValue: collectionService }, { provide: RequestService, useValue: requestService }, diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts index 50b869e636..fa20b0e5e1 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts @@ -76,11 +76,11 @@ import { CollectionSourceControlsComponent } from './collection-source-controls/ templateUrl: './collection-source.component.html', imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, - FormComponent, - CollectionSourceControlsComponent, BtnDisabledDirective, + CollectionSourceControlsComponent, + FormComponent, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts index 3ef2b65df9..9fff61ad19 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { EditCollectionPageComponent } from './edit-collection-page.component'; @@ -18,7 +18,7 @@ describe('EditCollectionPageComponent', () => { let fixture: ComponentFixture; const routeStub = { - data: observableOf({ + data: of({ dso: { payload: {} }, }), routeConfig: { diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts index 03fe92faa8..25a5c7b6d7 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts @@ -23,11 +23,11 @@ import { getCollectionPageRoute } from '../collection-page-routing-paths'; templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html', styleUrls: ['./edit-collection-page.component.scss'], imports: [ - RouterLink, - TranslateModule, - NgClass, - RouterOutlet, AsyncPipe, + NgClass, + RouterLink, + RouterOutlet, + TranslateModule, ], standalone: true, }) diff --git a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts index 4d33e7d008..2cdcaf3cf9 100644 --- a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts +++ b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemTemplateDataService } from '../../core/data/item-template-data.service'; import { Collection } from '../../core/shared/collection.model'; @@ -43,7 +43,7 @@ describe('EditItemTemplatePageComponent', () => { imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, EditItemTemplatePageComponent], providers: [ { provide: ItemTemplateDataService, useValue: itemTemplateService }, - { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, + { provide: ActivatedRoute, useValue: { parent: { data: of({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], diff --git a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts index eb8b36ec89..7d67e5e63b 100644 --- a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts +++ b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts @@ -32,13 +32,13 @@ import { getCollectionEditRoute } from '../collection-page-routing-paths'; selector: 'ds-base-edit-item-template-page', templateUrl: './edit-item-template-page.component.html', imports: [ - ThemedDsoEditMetadataComponent, - RouterLink, - AsyncPipe, - VarDirective, - TranslateModule, - ThemedLoadingComponent, AlertComponent, + AsyncPipe, + RouterLink, + ThemedDsoEditMetadataComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts b/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts index 421049990a..7765a98cd6 100644 --- a/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts +++ b/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts @@ -8,7 +8,9 @@ import { EditItemTemplatePageComponent } from './edit-item-template-page.compone styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [EditItemTemplatePageComponent], + imports: [ + EditItemTemplatePageComponent, + ], }) /** * Component for editing the item template of a collection diff --git a/src/app/collection-page/themed-collection-page.component.ts b/src/app/collection-page/themed-collection-page.component.ts index c84d7c5fb4..125590072f 100644 --- a/src/app/collection-page/themed-collection-page.component.ts +++ b/src/app/collection-page/themed-collection-page.component.ts @@ -11,7 +11,9 @@ import { CollectionPageComponent } from './collection-page.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [CollectionPageComponent], + imports: [ + CollectionPageComponent, + ], }) export class ThemedCollectionPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/community-list-page/community-list-page.component.ts b/src/app/community-list-page/community-list-page.component.ts index ca0db89f53..b652c989f5 100644 --- a/src/app/community-list-page/community-list-page.component.ts +++ b/src/app/community-list-page/community-list-page.component.ts @@ -11,7 +11,10 @@ import { ThemedCommunityListComponent } from './community-list/themed-community- selector: 'ds-base-community-list-page', templateUrl: './community-list-page.component.html', standalone: true, - imports: [ThemedCommunityListComponent, TranslateModule], + imports: [ + ThemedCommunityListComponent, + TranslateModule, + ], }) export class CommunityListPageComponent { diff --git a/src/app/community-list-page/community-list-service.spec.ts b/src/app/community-list-page/community-list-service.spec.ts index 28d3cfe1a9..d6b3f406f5 100644 --- a/src/app/community-list-page/community-list-service.spec.ts +++ b/src/app/community-list-page/community-list-service.spec.ts @@ -3,7 +3,7 @@ import { TestBed, } from '@angular/core/testing'; import { Store } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { take } from 'rxjs/operators'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment.test'; @@ -285,7 +285,7 @@ describe('CommunityListService', () => { beforeEach((done) => { const expandedNodes = []; mockListOfTopCommunitiesPage1.map((community: Community) => { - const communityFlatNode = toFlatNode(community, observableOf(true), 0, true, null); + const communityFlatNode = toFlatNode(community, of(true), 0, true, null); communityFlatNode.currentCollectionPage = 1; communityFlatNode.currentCommunityPage = 1; expandedNodes.push(communityFlatNode); @@ -314,7 +314,7 @@ describe('CommunityListService', () => { }); describe('Just first top comm expanded, all page 1: should return list containing flatnodes of the communities in the test list and all its possible page-limited children (subcommunities and collections)', () => { beforeEach((done) => { - const communityFlatNode = toFlatNode(mockListOfTopCommunitiesPage1[0], observableOf(true), 0, true, null); + const communityFlatNode = toFlatNode(mockListOfTopCommunitiesPage1[0], of(true), 0, true, null); communityFlatNode.currentCollectionPage = 1; communityFlatNode.currentCommunityPage = 1; const expandedNodes = [communityFlatNode]; @@ -339,7 +339,7 @@ describe('CommunityListService', () => { }); describe('Just second top comm expanded, collections at page 2: should return list containing flatnodes of the communities in the test list and all its possible page-limited children (subcommunities and collections)', () => { beforeEach((done) => { - const communityFlatNode = toFlatNode(mockListOfTopCommunitiesPage1[1], observableOf(true), 0, true, null); + const communityFlatNode = toFlatNode(mockListOfTopCommunitiesPage1[1], of(true), 0, true, null); communityFlatNode.currentCollectionPage = 2; communityFlatNode.currentCommunityPage = 1; const expandedNodes = [communityFlatNode]; @@ -403,7 +403,7 @@ describe('CommunityListService', () => { beforeEach((done) => { const expandedNodes = []; listOfCommunities.map((community: Community) => { - const communityFlatNode = toFlatNode(community, observableOf(true), 0, true, null); + const communityFlatNode = toFlatNode(community, of(true), 0, true, null); communityFlatNode.currentCollectionPage = 1; communityFlatNode.currentCommunityPage = 1; expandedNodes.push(communityFlatNode); @@ -513,7 +513,7 @@ describe('CommunityListService', () => { }); let flatNodeList; beforeEach((done) => { - const communityFlatNode = toFlatNode(communityWithSubcoms, observableOf(true), 0, true, null); + const communityFlatNode = toFlatNode(communityWithSubcoms, of(true), 0, true, null); communityFlatNode.currentCollectionPage = 1; communityFlatNode.currentCommunityPage = 1; const expandedNodes = [communityFlatNode]; @@ -556,7 +556,7 @@ describe('CommunityListService', () => { 'dc.title': [{ language: 'en_US', value: 'Community 1' }], }, }); - const communityFlatNode = toFlatNode(communityWithCollections, observableOf(true), 0, true, null); + const communityFlatNode = toFlatNode(communityWithCollections, of(true), 0, true, null); communityFlatNode.currentCollectionPage = 2; communityFlatNode.currentCommunityPage = 1; const expandedNodes = [communityFlatNode]; diff --git a/src/app/community-list-page/community-list-service.ts b/src/app/community-list-page/community-list-service.ts index 2878d899eb..cf105b54d8 100644 --- a/src/app/community-list-page/community-list-service.ts +++ b/src/app/community-list-page/community-list-service.ts @@ -10,7 +10,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { filter, @@ -92,7 +92,7 @@ export const showMoreFlatNode = ( level: number, parent: FlatNode, ): FlatNode => ({ - isExpandable$: observableOf(false), + isExpandable$: of(false), name: 'Show More Flatnode', id: id, level: level, @@ -212,12 +212,12 @@ export class CommunityListService { return this.transformCommunity(community, level, parent, expandedNodes); }); if (currentPage < listOfPaginatedCommunities.totalPages && currentPage === listOfPaginatedCommunities.currentPage) { - obsList = [...obsList, observableOf([showMoreFlatNode(`community-${uuidv4()}`, level, parent)])]; + obsList = [...obsList, of([showMoreFlatNode(`community-${uuidv4()}`, level, parent)])]; } return combineAndFlatten(obsList); } else { - return observableOf([]); + return of([]); } } @@ -241,7 +241,7 @@ export class CommunityListService { const communityFlatNode = toFlatNode(community, isExpandable$, level, isExpanded, parent); - let obsList = [observableOf([communityFlatNode])]; + let obsList = [of([communityFlatNode])]; if (isExpanded) { const currentCommunityPage = expandedNodes.find((node: FlatNode) => node.id === community.id).currentCommunityPage; @@ -259,7 +259,7 @@ export class CommunityListService { if (hasValue(rd) && hasValue(rd.payload)) { return this.transformListOfCommunities(rd.payload, level + 1, communityFlatNode, expandedNodes); } else { - return observableOf([]); + return of([]); } }), ); @@ -281,7 +281,7 @@ export class CommunityListService { map((rd: RemoteData>) => { if (hasValue(rd) && hasValue(rd.payload)) { let nodes = rd.payload.page - .map((collection: Collection) => toFlatNode(collection, observableOf(false), level + 1, false, communityFlatNode)); + .map((collection: Collection) => toFlatNode(collection, of(false), level + 1, false, communityFlatNode)); if (currentCollectionPage < rd.payload.totalPages && currentCollectionPage === rd.payload.currentPage) { nodes = [...nodes, showMoreFlatNode(`collection-${uuidv4()}`, level + 1, communityFlatNode)]; } diff --git a/src/app/community-list-page/community-list.reducer.spec.ts b/src/app/community-list-page/community-list.reducer.spec.ts index abbd16d4cd..a6dcacce6f 100644 --- a/src/app/community-list-page/community-list.reducer.spec.ts +++ b/src/app/community-list-page/community-list.reducer.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { buildPaginatedList } from '../core/data/paginated-list.model'; import { Community } from '../core/shared/community.model'; @@ -21,7 +21,7 @@ describe('communityListReducer', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockSubcommunities1Page1)), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), name: 'community1', - }), observableOf(true), 0, false, null, + }), of(true), 0, false, null, ); it ('should set init state of the expandedNodes and loadingNode', () => { diff --git a/src/app/community-list-page/community-list/community-list.component.spec.ts b/src/app/community-list-page/community-list/community-list.component.spec.ts index f997f5db9c..347f912789 100644 --- a/src/app/community-list-page/community-list/community-list.component.spec.ts +++ b/src/app/community-list-page/community-list/community-list.component.spec.ts @@ -18,7 +18,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { v4 as uuidv4 } from 'uuid'; import { buildPaginatedList } from '../../core/data/paginated-list.model'; @@ -110,7 +110,7 @@ describe('CommunityListComponent', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockSubcommunities1Page1)), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), name: 'community1', - }), observableOf(true), 0, false, null, + }), of(true), 0, false, null, ), toFlatNode( Object.assign(new Community(), { @@ -119,7 +119,7 @@ describe('CommunityListComponent', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [...mockCollectionsPage1, ...mockCollectionsPage2])), name: 'community2', - }), observableOf(true), 0, false, null, + }), of(true), 0, false, null, ), toFlatNode( Object.assign(new Community(), { @@ -128,7 +128,7 @@ describe('CommunityListComponent', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), name: 'community3', - }), observableOf(false), 0, false, null, + }), of(false), 0, false, null, ), ]; let communityListServiceStub; @@ -139,10 +139,10 @@ describe('CommunityListComponent', () => { expandedNodes: [], loadingNode: null, getLoadingNodeFromStore() { - return observableOf(this.loadingNode); + return of(this.loadingNode); }, getExpandedNodesFromStore() { - return observableOf(this.expandedNodes); + return of(this.expandedNodes); }, saveCommunityListStateToStore(expandedNodes, loadingNode) { this.expandedNodes = expandedNodes; @@ -162,9 +162,9 @@ describe('CommunityListComponent', () => { } if (expandedNodes === null || isEmpty(expandedNodes)) { if (showMoreTopComNode) { - return observableOf([...mockTopFlatnodesUnexpanded.slice(0, endPageIndex), showMoreFlatNode(`community-${uuidv4()}`, 0, null)]); + return of([...mockTopFlatnodesUnexpanded.slice(0, endPageIndex), showMoreFlatNode(`community-${uuidv4()}`, 0, null)]); } else { - return observableOf(mockTopFlatnodesUnexpanded.slice(0, endPageIndex)); + return of(mockTopFlatnodesUnexpanded.slice(0, endPageIndex)); } } else { flatnodes = []; @@ -178,12 +178,12 @@ describe('CommunityListComponent', () => { const possibleSubcoms: Community[] = matchingTopComWithArrays.subcommunities; let subComFlatnodes = []; possibleSubcoms.map((subcom: Community) => { - subComFlatnodes = [...subComFlatnodes, toFlatNode(subcom, observableOf(false), topNode.level + 1, false, topNode)]; + subComFlatnodes = [...subComFlatnodes, toFlatNode(subcom, of(false), topNode.level + 1, false, topNode)]; }); const possibleColls: Collection[] = matchingTopComWithArrays.collections; let collFlatnodes = []; possibleColls.map((coll: Collection) => { - collFlatnodes = [...collFlatnodes, toFlatNode(coll, observableOf(false), topNode.level + 1, false, topNode)]; + collFlatnodes = [...collFlatnodes, toFlatNode(coll, of(false), topNode.level + 1, false, topNode)]; }); if (isNotEmpty(subComFlatnodes)) { const endSubComIndex = this.pageSize * expandedParent.currentCommunityPage; @@ -205,7 +205,7 @@ describe('CommunityListComponent', () => { if (showMoreTopComNode) { flatnodes = [...flatnodes, showMoreFlatNode(`community-${uuidv4()}`, 0, null)]; } - return observableOf(flatnodes); + return of(flatnodes); } }, }; diff --git a/src/app/community-list-page/community-list/community-list.component.ts b/src/app/community-list-page/community-list/community-list.component.ts index c87fbf5d13..3a17855937 100644 --- a/src/app/community-list-page/community-list/community-list.component.ts +++ b/src/app/community-list-page/community-list/community-list.component.ts @@ -2,10 +2,7 @@ import { CdkTreeModule, FlatTreeControl, } from '@angular/cdk/tree'; -import { - AsyncPipe, - NgClass, -} from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { Component, OnDestroy, @@ -41,7 +38,15 @@ import { FlatNode } from '../flat-node.model'; templateUrl: './community-list.component.html', styleUrls: ['./community-list.component.scss'], standalone: true, - imports: [ThemedLoadingComponent, CdkTreeModule, NgClass, RouterLink, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + CdkTreeModule, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) export class CommunityListComponent implements OnInit, OnDestroy { diff --git a/src/app/community-list-page/community-list/themed-community-list.component.ts b/src/app/community-list-page/community-list/themed-community-list.component.ts index 5340384ed5..b979529b4a 100644 --- a/src/app/community-list-page/community-list/themed-community-list.component.ts +++ b/src/app/community-list-page/community-list/themed-community-list.component.ts @@ -9,7 +9,9 @@ import { CommunityListComponent } from './community-list.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [CommunityListComponent], + imports: [ + CommunityListComponent, + ], }) export class ThemedCommunityListComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/community-list-page/themed-community-list-page.component.ts b/src/app/community-list-page/themed-community-list-page.component.ts index d427b1bec1..922506e1dd 100644 --- a/src/app/community-list-page/themed-community-list-page.component.ts +++ b/src/app/community-list-page/themed-community-list-page.component.ts @@ -11,7 +11,9 @@ import { CommunityListPageComponent } from './community-list-page.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [CommunityListPageComponent], + imports: [ + CommunityListPageComponent, + ], }) export class ThemedCommunityListPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts index 147f6254ea..492d2d4141 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -40,11 +40,11 @@ import { VarDirective } from '../../shared/utils/var.directive'; templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', standalone: true, imports: [ + AsyncPipe, + ComcolPageLogoComponent, FormComponent, TranslateModule, UploaderComponent, - AsyncPipe, - ComcolPageLogoComponent, VarDirective, ], }) diff --git a/src/app/community-page/community-page-administrator.guard.ts b/src/app/community-page/community-page-administrator.guard.ts index ecbc9b86c0..f4837799cd 100644 --- a/src/app/community-page/community-page-administrator.guard.ts +++ b/src/app/community-page/community-page-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { communityPageResolver } from './community-page.resolver'; export const communityPageAdministratorGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => communityPageResolver, - () => observableOf(FeatureID.AdministratorOf), + () => of(FeatureID.AdministratorOf), ); diff --git a/src/app/community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts index db8b59dcc2..c4596eb6ed 100644 --- a/src/app/community-page/community-page.component.ts +++ b/src/app/community-page/community-page.component.ts @@ -39,8 +39,6 @@ import { ErrorComponent } from '../shared/error/error.component'; import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; import { VarDirective } from '../shared/utils/var.directive'; import { getCommunityPageRoute } from './community-page-routing-paths'; -import { ThemedCollectionPageSubCollectionListComponent } from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; -import { ThemedCommunityPageSubCommunityListComponent } from './sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; @Component({ selector: 'ds-base-community-page', @@ -49,21 +47,19 @@ import { ThemedCommunityPageSubCommunityListComponent } from './sections/sub-com changeDetection: ChangeDetectionStrategy.OnPush, animations: [fadeInOut], imports: [ - ThemedComcolPageContentComponent, + AsyncPipe, + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + DsoEditMenuComponent, ErrorComponent, + RouterModule, + RouterOutlet, + ThemedComcolPageBrowseByComponent, + ThemedComcolPageContentComponent, + ThemedComcolPageHandleComponent, ThemedLoadingComponent, TranslateModule, - ThemedCommunityPageSubCommunityListComponent, - ThemedCollectionPageSubCollectionListComponent, - ThemedComcolPageBrowseByComponent, - DsoEditMenuComponent, - ThemedComcolPageHandleComponent, - ComcolPageLogoComponent, - ComcolPageHeaderComponent, - AsyncPipe, VarDirective, - RouterOutlet, - RouterModule, ], standalone: true, }) diff --git a/src/app/community-page/create-community-page/create-community-page.component.spec.ts b/src/app/community-page/create-community-page/create-community-page.component.spec.ts index 062c0ea062..c54589b09c 100644 --- a/src/app/community-page/create-community-page/create-community-page.component.spec.ts +++ b/src/app/community-page/create-community-page/create-community-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { CommunityDataService } from '../../core/data/community-data.service'; @@ -28,8 +28,8 @@ describe('CreateCommunityPageComponent', () => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, CreateCommunityPageComponent], providers: [ - { provide: CommunityDataService, useValue: { findById: () => observableOf({}) } }, - { provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } }, + { provide: CommunityDataService, useValue: { findById: () => of({}) } }, + { provide: RouteService, useValue: { getQueryParameterValue: () => of('1234') } }, { provide: Router, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: RequestService, useValue: {} }, diff --git a/src/app/community-page/create-community-page/create-community-page.component.ts b/src/app/community-page/create-community-page/create-community-page.component.ts index 7c0c26ffcd..8feed94d23 100644 --- a/src/app/community-page/create-community-page/create-community-page.component.ts +++ b/src/app/community-page/create-community-page/create-community-page.component.ts @@ -25,11 +25,11 @@ import { CommunityFormComponent } from '../community-form/community-form.compone styleUrls: ['./create-community-page.component.scss'], templateUrl: './create-community-page.component.html', imports: [ + AsyncPipe, CommunityFormComponent, + ThemedLoadingComponent, TranslateModule, VarDirective, - AsyncPipe, - ThemedLoadingComponent, ], standalone: true, }) diff --git a/src/app/community-page/create-community-page/create-community-page.guard.ts b/src/app/community-page/create-community-page/create-community-page.guard.ts index c3ee8c7091..c0cff33793 100644 --- a/src/app/community-page/create-community-page/create-community-page.guard.ts +++ b/src/app/community-page/create-community-page/create-community-page.guard.ts @@ -7,7 +7,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -35,7 +35,7 @@ export const createCommunityPageGuard: CanActivateFn = ( ): Observable => { const parentID = route.queryParams.parent; if (hasNoValue(parentID)) { - return observableOf(true); + return of(true); } return communityService.findById(parentID) diff --git a/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts index 524f3e3124..c69172d5f5 100644 --- a/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts +++ b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { CommunityDataService } from '../../core/data/community-data.service'; @@ -27,7 +27,7 @@ describe('DeleteCommunityPageComponent', () => { providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CommunityDataService, useValue: {} }, - { provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } }, + { provide: ActivatedRoute, useValue: { data: of({ dso: { payload: {} } }) } }, { provide: NotificationsService, useValue: {} }, { provide: RequestService, useValue: {} }, ], diff --git a/src/app/community-page/delete-community-page/delete-community-page.component.ts b/src/app/community-page/delete-community-page/delete-community-page.component.ts index 4799cd2db8..27578e40c7 100644 --- a/src/app/community-page/delete-community-page/delete-community-page.component.ts +++ b/src/app/community-page/delete-community-page/delete-community-page.component.ts @@ -25,10 +25,10 @@ import { VarDirective } from '../../shared/utils/var.directive'; styleUrls: ['./delete-community-page.component.scss'], templateUrl: './delete-community-page.component.html', imports: [ - TranslateModule, AsyncPipe, - VarDirective, BtnDisabledDirective, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts index 28879ed7ab..43f784891c 100644 --- a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts @@ -3,10 +3,7 @@ import { TestBed, } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { Community } from '../../../core/shared/community.model'; import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; @@ -24,7 +21,7 @@ describe('CommunityAccessControlComponent', () => { 'dc.title': [{ value: 'community' }], }, uuid: 'communityUUID', - parentCommunity: observableOf(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), + parentCommunity: of(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), _links: { parentCommunity: 'site', diff --git a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts index 921bbf0cfd..e321c8a0b4 100644 --- a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Collection } from '../../../core/shared/collection.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; @@ -35,7 +35,7 @@ describe('CommunityAuthorizationsComponent', () => { const routeStub = { parent: { parent: { - data: observableOf({ + data: of({ dso: communityRD, }), }, diff --git a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts index 3e42a830be..1fd9fc8454 100644 --- a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts +++ b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts @@ -18,8 +18,8 @@ import { ResourcePoliciesComponent } from '../../../shared/resource-policies/res selector: 'ds-community-authorizations', templateUrl: './community-authorizations.component.html', imports: [ - ResourcePoliciesComponent, AsyncPipe, + ResourcePoliciesComponent, ], standalone: true, }) diff --git a/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts index 541308c942..bf669f68ea 100644 --- a/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Community } from '../../../core/shared/community.model'; @@ -32,7 +32,7 @@ describe('CommunityCurateComponent', () => { beforeEach(waitForAsync(() => { routeStub = { parent: { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(community), }), }, diff --git a/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts index fd4d240827..68233c4675 100644 --- a/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts +++ b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts @@ -25,9 +25,9 @@ import { hasValue } from '../../../shared/empty.util'; selector: 'ds-community-curate', templateUrl: './community-curate.component.html', imports: [ + AsyncPipe, CurationFormComponent, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts index b82beaa3f7..b45a190a28 100644 --- a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts @@ -8,7 +8,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { CommunityDataService } from '../../../core/data/community-data.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; @@ -25,7 +25,7 @@ describe('CommunityMetadataComponent', () => { imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, CommunityMetadataComponent], providers: [ { provide: CommunityDataService, useValue: {} }, - { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: { payload: {} } }) } } }, + { provide: ActivatedRoute, useValue: { parent: { data: of({ dso: { payload: {} } }) } } }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts index 8001bd2969..c2827cf892 100644 --- a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts +++ b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts @@ -19,8 +19,8 @@ import { CommunityFormComponent } from '../../community-form/community-form.comp selector: 'ds-community-metadata', templateUrl: './community-metadata.component.html', imports: [ - CommunityFormComponent, AsyncPipe, + CommunityFormComponent, ], standalone: true, }) diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts index f1e75b7e23..c5e4605826 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts @@ -11,7 +11,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../../core/data/request.service'; @@ -36,7 +36,7 @@ describe('CommunityRolesComponent', () => { const route = { parent: { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject( Object.assign(new Community(), { _links: { @@ -54,7 +54,7 @@ describe('CommunityRolesComponent', () => { }; const requestService = { - hasByHref$: () => observableOf(true), + hasByHref$: () => of(true), }; const groupDataService = { diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts index 69234e07c3..a46aa0d424 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts @@ -26,8 +26,8 @@ import { ComcolRoleComponent } from '../../../shared/comcol/comcol-forms/edit-co selector: 'ds-community-roles', templateUrl: './community-roles.component.html', imports: [ - ComcolRoleComponent, AsyncPipe, + ComcolRoleComponent, ], standalone: true, }) diff --git a/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts index f099f6fc2a..8b8eea3d71 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts @@ -8,7 +8,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { CommunityDataService } from '../../core/data/community-data.service'; import { EditCommunityPageComponent } from './edit-community-page.component'; @@ -18,7 +18,7 @@ describe('EditCommunityPageComponent', () => { let fixture: ComponentFixture; const routeStub = { - data: observableOf({ + data: of({ dso: { payload: {} }, }), routeConfig: { diff --git a/src/app/community-page/edit-community-page/edit-community-page.component.ts b/src/app/community-page/edit-community-page/edit-community-page.component.ts index 77300023be..32eddf09d6 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.component.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.component.ts @@ -23,11 +23,11 @@ import { getCommunityPageRoute } from '../community-page-routing-paths'; templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html', standalone: true, imports: [ - RouterLink, - TranslateModule, - NgClass, - RouterOutlet, AsyncPipe, + NgClass, + RouterLink, + RouterOutlet, + TranslateModule, ], }) export class EditCommunityPageComponent extends EditComColPageComponent { diff --git a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts index 1d12860628..ee78a1b2f7 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts @@ -38,11 +38,11 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; templateUrl: './community-page-sub-collection-list.component.html', animations: [fadeIn], imports: [ - ObjectCollectionComponent, + AsyncPipe, ErrorComponent, + ObjectCollectionComponent, ThemedLoadingComponent, TranslateModule, - AsyncPipe, VarDirective, ], standalone: true, diff --git a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts index 4a965bc926..29141d7b7d 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts @@ -12,7 +12,9 @@ import { CommunityPageSubCollectionListComponent } from './community-page-sub-co styleUrls: [], templateUrl: '../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [CommunityPageSubCollectionListComponent], + imports: [ + CommunityPageSubCollectionListComponent, + ], }) export class ThemedCollectionPageSubCollectionListComponent extends ThemedComponent { @Input() community: Community; diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts index ea21c66b54..40c0024a7b 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts @@ -20,9 +20,9 @@ import { ThemedCommunityPageSubCommunityListComponent } from './sub-community-li templateUrl: './sub-com-col-section.component.html', styleUrls: ['./sub-com-col-section.component.scss'], imports: [ - ThemedCommunityPageSubCommunityListComponent, - ThemedCollectionPageSubCollectionListComponent, AsyncPipe, + ThemedCollectionPageSubCollectionListComponent, + ThemedCommunityPageSubCommunityListComponent, ], standalone: true, }) diff --git a/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts index 972ba3d7fb..2ad66c76a8 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts @@ -37,15 +37,11 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; templateUrl: './community-page-sub-community-list.component.html', animations: [fadeIn], imports: [ - ErrorComponent, - ThemedLoadingComponent, - VarDirective, - ObjectCollectionComponent, AsyncPipe, - TranslateModule, - ObjectCollectionComponent, ErrorComponent, + ObjectCollectionComponent, ThemedLoadingComponent, + TranslateModule, VarDirective, ], standalone: true, diff --git a/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts index 5988ad0f5e..85d0c02ad1 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts @@ -12,7 +12,9 @@ import { CommunityPageSubCommunityListComponent } from './community-page-sub-com styleUrls: [], templateUrl: '../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [CommunityPageSubCommunityListComponent], + imports: [ + CommunityPageSubCommunityListComponent, + ], }) export class ThemedCommunityPageSubCommunityListComponent extends ThemedComponent { diff --git a/src/app/community-page/themed-community-page.component.ts b/src/app/community-page/themed-community-page.component.ts index b655452041..476c98a72c 100644 --- a/src/app/community-page/themed-community-page.component.ts +++ b/src/app/community-page/themed-community-page.component.ts @@ -11,7 +11,9 @@ import { CommunityPageComponent } from './community-page.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [CommunityPageComponent], + imports: [ + CommunityPageComponent, + ], }) export class ThemedCommunityPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/core/auth/auth-request.service.spec.ts b/src/app/core/auth/auth-request.service.spec.ts index 2220efe5fa..b7cb8557e4 100644 --- a/src/app/core/auth/auth-request.service.spec.ts +++ b/src/app/core/auth/auth-request.service.spec.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -40,7 +40,7 @@ describe(`AuthRequestService`, () => { } protected createShortLivedTokenRequest(href: string): Observable { - return observableOf(new PostRequest(this.requestService.generateRequestId(), href)); + return of(new PostRequest(this.requestService.generateRequestId(), href)); } } diff --git a/src/app/core/auth/auth.effects.spec.ts b/src/app/core/auth/auth.effects.spec.ts index a423455594..733efd6a01 100644 --- a/src/app/core/auth/auth.effects.spec.ts +++ b/src/app/core/auth/auth.effects.spec.ts @@ -18,7 +18,7 @@ import { } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, throwError as observableThrow, } from 'rxjs'; @@ -234,7 +234,7 @@ describe('AuthEffects', () => { describe('when check token succeeded', () => { it('should return a RETRIEVE_TOKEN action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is true', () => { spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( - observableOf( + of( { authenticated: true, }), @@ -254,7 +254,7 @@ describe('AuthEffects', () => { it('should return a RETRIEVE_AUTH_METHODS action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is false', () => { spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( - observableOf( + of( { authenticated: false }), ); actions = hot('--a-', { a: { type: AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_COOKIE } }); @@ -426,7 +426,7 @@ describe('AuthEffects', () => { describe('when auth loaded is false', () => { it('should not call removeToken method', fakeAsync(() => { store.overrideSelector(isAuthenticatedLoaded, false); - actions = observableOf({ type: StoreActionTypes.REHYDRATE }); + actions = of({ type: StoreActionTypes.REHYDRATE }); spyOn(authServiceStub, 'removeToken'); authEffects.clearInvalidTokenOnRehydrate$.subscribe(() => { @@ -442,7 +442,7 @@ describe('AuthEffects', () => { spyOn(console, 'log').and.callThrough(); store.overrideSelector(isAuthenticatedLoaded, true); - actions = observableOf({ type: StoreActionTypes.REHYDRATE }); + actions = of({ type: StoreActionTypes.REHYDRATE }); spyOn(authServiceStub, 'removeToken'); authEffects.clearInvalidTokenOnRehydrate$.subscribe(() => { @@ -455,7 +455,7 @@ describe('AuthEffects', () => { describe('invalidateAuthorizationsRequestCache$', () => { it('should call invalidateAuthorizationsRequestCache method in response to a REHYDRATE action', (done) => { - actions = observableOf({ type: StoreActionTypes.REHYDRATE }); + actions = of({ type: StoreActionTypes.REHYDRATE }); authEffects.invalidateAuthorizationsRequestCache$.subscribe(() => { expect((authEffects as any).authorizationsService.invalidateAuthorizationsRequestCache).toHaveBeenCalled(); diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 2919a40fa8..05f8c59703 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -18,7 +18,7 @@ import { asyncScheduler, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, queueScheduler, timer, } from 'rxjs'; @@ -85,12 +85,12 @@ const IDLE_TIMER_IGNORE_TYPES: string[] export function errorToAuthAction$(actionType: Type, error: unknown): Observable { if (error instanceof Error) { - return observableOf(new actionType(error)); + return of(new actionType(error)); } // If we caught something that's not an Error: complain & drop type safety console.warn('AuthEffects caught non-Error object:', error); - return observableOf(new actionType(error as any)); + return of(new actionType(error as any)); } @Injectable() @@ -177,7 +177,7 @@ export class AuthEffects { switchMap(() => { return this.authService.hasValidAuthenticationToken().pipe( map((token: AuthTokenInfo) => new AuthenticatedAction(token)), - catchError((error: unknown) => observableOf(new CheckAuthenticationTokenCookieAction())), + catchError((error: unknown) => of(new CheckAuthenticationTokenCookieAction())), ); }), )); @@ -215,7 +215,7 @@ export class AuthEffects { switchMap((action: RefreshTokenAction) => { return this.authService.refreshAuthenticationToken(action.payload).pipe( map((token: AuthTokenInfo) => new RefreshTokenSuccessAction(token)), - catchError((error: unknown) => observableOf(new RefreshTokenErrorAction())), + catchError((error: unknown) => of(new RefreshTokenErrorAction())), ); }), )); @@ -286,7 +286,7 @@ export class AuthEffects { return this.authService.retrieveAuthMethodsFromAuthStatus(action.payload) .pipe( map((authMethodModels: AuthMethod[]) => new RetrieveAuthMethodsSuccessAction(authMethodModels)), - catchError(() => observableOf(new RetrieveAuthMethodsErrorAction())), + catchError(() => of(new RetrieveAuthMethodsErrorAction())), ); }), )); diff --git a/src/app/core/auth/auth.interceptor.spec.ts b/src/app/core/auth/auth.interceptor.spec.ts index b137b2713c..7dda807c58 100644 --- a/src/app/core/auth/auth.interceptor.spec.ts +++ b/src/app/core/auth/auth.interceptor.spec.ts @@ -10,7 +10,7 @@ import { import { TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { Store } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthServiceStub } from '../../shared/testing/auth-service.stub'; import { RouterStub } from '../../shared/testing/router.stub'; @@ -27,7 +27,7 @@ describe(`AuthInterceptor`, () => { const authServiceStub = new AuthServiceStub(); const store: Store = jasmine.createSpyObj('store', { dispatch: {}, - select: observableOf(true), + select: of(true), }); beforeEach(() => { diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index d011d27059..e61b1180e1 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -16,7 +16,7 @@ import { Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { Observable, - of as observableOf, + of, throwError as observableThrowError, } from 'rxjs'; import { @@ -257,7 +257,7 @@ export class AuthInterceptor implements HttpInterceptor { let authorization: string; if (authService.isTokenExpired()) { - return observableOf(null); + return of(null); } else if ((!this.isAuthRequest(req) || this.isLogoutResponse(req)) && isNotEmpty(token)) { // Get the auth header from the service. authorization = authService.buildAuthHeader(token); @@ -325,7 +325,7 @@ export class AuthInterceptor implements HttpInterceptor { statusText: error.statusText, url: error.url, }); - return observableOf(authResponse); + return of(authResponse); } else if (this.isUnauthorized(error) && isNotNull(token) && authService.isTokenExpired()) { // The access token provided is expired, revoked, malformed, or invalid for other reasons // Redirect to the login route diff --git a/src/app/core/auth/auth.service.spec.ts b/src/app/core/auth/auth.service.spec.ts index e596650cfa..94a8bb2cb1 100644 --- a/src/app/core/auth/auth.service.spec.ts +++ b/src/app/core/auth/auth.service.spec.ts @@ -16,7 +16,7 @@ import { TranslateService } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { REQUEST } from '../../../express.tokens'; @@ -97,7 +97,7 @@ describe('AuthService test', () => { function init() { mockStore = jasmine.createSpyObj('store', { dispatch: {}, - pipe: observableOf(true), + pipe: of(true), }); window = new NativeWindowRef(); routerStub = new RouterStub(); @@ -133,7 +133,7 @@ describe('AuthService test', () => { resolveLinks: {}, }; hardRedirectService = jasmine.createSpyObj('hardRedirectService', ['redirect']); - spyOn(linkService, 'resolveLinks').and.returnValue({ authenticated: true, eperson: observableOf({ payload: {} }) }); + spyOn(linkService, 'resolveLinks').and.returnValue({ authenticated: true, eperson: of({ payload: {} }) }); } diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index a4a85d8e67..5fe17b8631 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -12,7 +12,7 @@ import { TranslateService } from '@ngx-translate/core'; import { CookieAttributes } from 'js-cookie'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { filter, @@ -278,7 +278,7 @@ export class AuthService { if (hasValue(id)) { return this.epersonService.findById(id).pipe(getFirstSucceededRemoteDataPayload()); } else { - return observableOf(null); + return of(null); } }), ); @@ -365,7 +365,7 @@ export class AuthService { if (isNotEmpty(status.authMethods)) { authMethods = status.authMethods; } - return observableOf(authMethods); + return of(authMethods); } /** @@ -684,7 +684,7 @@ export class AuthService { */ getShortlivedToken(): Observable { return this.isAuthenticated().pipe( - switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : observableOf(null)), + switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : of(null)), ); } diff --git a/src/app/core/auth/browser-auth-request.service.ts b/src/app/core/auth/browser-auth-request.service.ts index d708cd8982..58690d4109 100644 --- a/src/app/core/auth/browser-auth-request.service.ts +++ b/src/app/core/auth/browser-auth-request.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; @@ -31,7 +31,7 @@ export class BrowserAuthRequestService extends AuthRequestService { * @protected */ protected createShortLivedTokenRequest(href: string): Observable { - return observableOf(new PostRequest(this.requestService.generateRequestId(), href)); + return of(new PostRequest(this.requestService.generateRequestId(), href)); } } diff --git a/src/app/core/auth/server-auth-request.service.spec.ts b/src/app/core/auth/server-auth-request.service.spec.ts index b119f6b3b7..143f12526c 100644 --- a/src/app/core/auth/server-auth-request.service.spec.ts +++ b/src/app/core/auth/server-auth-request.service.spec.ts @@ -5,7 +5,7 @@ import { } from '@angular/common/http'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { PostRequest } from '../data/request.models'; @@ -40,7 +40,7 @@ describe(`ServerAuthRequestService`, () => { statusText: '200', } as HttpResponse; httpClient = jasmine.createSpyObj('httpClient', { - get: observableOf(httpResponse), + get: of(httpResponse), }); halService = jasmine.createSpyObj('halService', { 'getRootHref': '/api', diff --git a/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts b/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts index 11a3a74350..c7b4ebe1e6 100644 --- a/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts +++ b/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -61,7 +61,7 @@ export class BitstreamBreadcrumbsService extends DSOBreadcrumbsService { const parent = parentRD.payload; return super.getBreadcrumbs(parent, getDSORoute(parent)); } - return observableOf([]); + return of([]); }), map((breadcrumbs: Breadcrumb[]) => [...breadcrumbs, crumb]), @@ -83,12 +83,12 @@ export class BitstreamBreadcrumbsService extends DSOBreadcrumbsService { getFirstCompletedRemoteData(), ); } else { - return observableOf(undefined); + return of(undefined); } }), ); } else { - return observableOf(undefined); + return of(undefined); } }), ); diff --git a/src/app/core/breadcrumbs/dso-breadcrumbs.service.spec.ts b/src/app/core/breadcrumbs/dso-breadcrumbs.service.spec.ts index 3869defa70..9e1fc7ed02 100644 --- a/src/app/core/breadcrumbs/dso-breadcrumbs.service.spec.ts +++ b/src/app/core/breadcrumbs/dso-breadcrumbs.service.spec.ts @@ -3,7 +3,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getDSORoute } from '../../app-routing-paths'; import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; @@ -53,7 +53,7 @@ describe('DSOBreadcrumbsService', () => { 'dc.title': [{ value: 'community' }], }, uuid: communityUUID, - parentCommunity: observableOf(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), + parentCommunity: of(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), _links: { parentCommunity: 'site', diff --git a/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts b/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts index 7d2e3697e1..324c29cd97 100644 --- a/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts +++ b/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { find, @@ -51,7 +51,7 @@ export class DSOBreadcrumbsService implements BreadcrumbsProviderService [...breadcrumbs, crumb]), diff --git a/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts b/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts index 5746f6faf2..e87bace7b7 100644 --- a/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts +++ b/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; @@ -26,6 +26,6 @@ export class I18nBreadcrumbsService implements BreadcrumbsProviderService { - return observableOf([new Breadcrumb(key + BREADCRUMB_MESSAGE_POSTFIX, url)]); + return of([new Breadcrumb(key + BREADCRUMB_MESSAGE_POSTFIX, url)]); } } diff --git a/src/app/core/breadcrumbs/navigation-breadcrumb.service.ts b/src/app/core/breadcrumbs/navigation-breadcrumb.service.ts index 2da8b06eab..af79e59e45 100644 --- a/src/app/core/breadcrumbs/navigation-breadcrumb.service.ts +++ b/src/app/core/breadcrumbs/navigation-breadcrumb.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; @@ -29,6 +29,6 @@ export class NavigationBreadcrumbsService implements BreadcrumbsProviderService< const keys = key.split(':'); const urls = url.split(':'); const breadcrumbs = keys.map((currentKey, index) => new Breadcrumb(currentKey + BREADCRUMB_MESSAGE_POSTFIX, urls[index] )); - return observableOf(breadcrumbs.reverse()); + return of(breadcrumbs.reverse()); } } diff --git a/src/app/core/breadcrumbs/sources-breadcrumb.service.ts b/src/app/core/breadcrumbs/sources-breadcrumb.service.ts index 71a9ae2a7d..7d69604c85 100644 --- a/src/app/core/breadcrumbs/sources-breadcrumb.service.ts +++ b/src/app/core/breadcrumbs/sources-breadcrumb.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; @@ -36,11 +36,11 @@ export class SourcesBreadcrumbService implements BreadcrumbsProviderService 3 ? args[args.length - 1] : args[2]; if (topicId) { - return observableOf( [new Breadcrumb(this.translationService.instant(breadcrumbKey), url), + return of( [new Breadcrumb(this.translationService.instant(breadcrumbKey), url), new Breadcrumb(sourceId, `${url}${sourceId}`), new Breadcrumb(topicId, undefined)]); } else { - return observableOf([new Breadcrumb(this.translationService.instant(breadcrumbKey), url), + return of([new Breadcrumb(this.translationService.instant(breadcrumbKey), url), new Breadcrumb(sourceId, `${url}${sourceId}`)]); } diff --git a/src/app/core/browse/browse-definition-data.service.ts b/src/app/core/browse/browse-definition-data.service.ts index 9c0d0d16c9..1720c2c83a 100644 --- a/src/app/core/browse/browse-definition-data.service.ts +++ b/src/app/core/browse/browse-definition-data.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -42,7 +42,7 @@ export const createAndSendBrowseDefinitionGetRequest = (requestService: RequestS useCachedVersionIfAvailable: boolean = true): void => { if (isNotEmpty(href$)) { if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } href$.pipe( diff --git a/src/app/core/browse/browse.service.spec.ts b/src/app/core/browse/browse.service.spec.ts index f3328c2bed..a7db4a009e 100644 --- a/src/app/core/browse/browse.service.spec.ts +++ b/src/app/core/browse/browse.service.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockHrefOnlyDataService } from '../../shared/mocks/href-only-data.service.mock'; @@ -111,7 +111,7 @@ describe('BrowseService', () => { let hrefOnlyDataService; const getRequestEntry$ = (successful: boolean) => { - return observableOf({ + return of({ response: { isSuccessful: successful, payload: browseDefinitions } as any, } as RequestEntry); }; diff --git a/src/app/core/cache/builders/remote-data-build.service.spec.ts b/src/app/core/cache/builders/remote-data-build.service.spec.ts index ec756ce85e..79040b20b0 100644 --- a/src/app/core/cache/builders/remote-data-build.service.spec.ts +++ b/src/app/core/cache/builders/remote-data-build.service.spec.ts @@ -5,7 +5,7 @@ import { import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { take } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; @@ -151,7 +151,7 @@ describe('RemoteDataBuildService', () => { statusCode: 500, }, } as RequestEntry; - requestEntry$ = observableOf(entrySuccessCacheable); + requestEntry$ = of(entrySuccessCacheable); linksToFollow = [ followLink('a'), followLink('b'), @@ -163,8 +163,8 @@ describe('RemoteDataBuildService', () => { describe(`buildPayload`, () => { beforeEach(() => { spyOn(service as any, 'plainObjectToInstance').and.returnValue(unCacheableObject); - spyOn(service as any, 'buildPaginatedList').and.returnValue(observableOf(paginatedList)); - (objectCache.getObjectByHref as jasmine.Spy).and.returnValue(observableOf(array[0])); + spyOn(service as any, 'buildPaginatedList').and.returnValue(of(paginatedList)); + (objectCache.getObjectByHref as jasmine.Spy).and.returnValue(of(array[0])); (linkService.resolveLinks as jasmine.Spy).and.returnValue(array[1]); }); @@ -239,7 +239,7 @@ describe('RemoteDataBuildService', () => { }); it(`should call hasExactMatchInObjectCache with that self link and the requestEntry`, (done) => { - (service as any).buildPayload(requestEntry$, observableOf(selfLink2), ...linksToFollow) + (service as any).buildPayload(requestEntry$, of(selfLink2), ...linksToFollow) .pipe(take(1)) .subscribe(() => { expect((service as any).hasExactMatchInObjectCache).toHaveBeenCalledWith(selfLink2, entrySuccessCacheable); @@ -248,7 +248,7 @@ describe('RemoteDataBuildService', () => { }); it(`should call objectCache.getObjectByHref() with that self link`, (done) => { - (service as any).buildPayload(requestEntry$, observableOf(selfLink2), ...linksToFollow) + (service as any).buildPayload(requestEntry$, of(selfLink2), ...linksToFollow) .pipe(take(1)) .subscribe(() => { expect(objectCache.getObjectByHref).toHaveBeenCalledWith(selfLink2); @@ -277,7 +277,7 @@ describe('RemoteDataBuildService', () => { describe(`when the entry contains an uncachable payload`, () => { beforeEach(() => { - requestEntry$ = observableOf(entrySuccessUnCacheable); + requestEntry$ = of(entrySuccessUnCacheable); spyOn(service as any, 'hasExactMatchInObjectCache').and.returnValue(false); spyOn(service as any, 'isCacheablePayload').and.returnValue(false); spyOn(service as any, 'isUnCacheablePayload').and.returnValue(true); @@ -331,14 +331,14 @@ describe('RemoteDataBuildService', () => { describe(`when the entry contains a 204 response`, () => { beforeEach(() => { - requestEntry$ = observableOf(entrySuccessNoContent); + requestEntry$ = of(entrySuccessNoContent); spyOn(service as any, 'hasExactMatchInObjectCache').and.returnValue(false); spyOn(service as any, 'isCacheablePayload').and.returnValue(false); spyOn(service as any, 'isUnCacheablePayload').and.returnValue(false); }); it(`should return null`, (done) => { - (service as any).buildPayload(requestEntry$, observableOf(selfLink2), ...linksToFollow) + (service as any).buildPayload(requestEntry$, of(selfLink2), ...linksToFollow) .pipe(take(1)) .subscribe((response) => { expect(response).toBeNull(); @@ -349,7 +349,7 @@ describe('RemoteDataBuildService', () => { describe(`when the entry contains an error`, () => { beforeEach(() => { - requestEntry$ = observableOf(entryError); + requestEntry$ = of(entryError); spyOn(service as any, 'hasExactMatchInObjectCache').and.returnValue(false); spyOn(service as any, 'isCacheablePayload').and.returnValue(false); spyOn(service as any, 'isUnCacheablePayload').and.returnValue(false); @@ -367,8 +367,8 @@ describe('RemoteDataBuildService', () => { describe(`when the entry contains a link to a paginated list`, () => { beforeEach(() => { - requestEntry$ = observableOf(entrySuccessCacheable); - (objectCache.getObjectByHref as jasmine.Spy).and.returnValue(observableOf(paginatedList)); + requestEntry$ = of(entrySuccessCacheable); + (objectCache.getObjectByHref as jasmine.Spy).and.returnValue(of(paginatedList)); spyOn(service as any, 'hasExactMatchInObjectCache').and.returnValue(false); spyOn(service as any, 'isCacheablePayload').and.returnValue(true); spyOn(service as any, 'isUnCacheablePayload').and.returnValue(false); @@ -536,7 +536,7 @@ describe('RemoteDataBuildService', () => { describe(`buildPaginatedList`, () => { beforeEach(() => { - (objectCache.getList as jasmine.Spy).and.returnValue(observableOf(array)); + (objectCache.getList as jasmine.Spy).and.returnValue(of(array)); (linkService.resolveLinks as jasmine.Spy).and.callFake((obj) => obj); spyOn(service as any, 'plainObjectToInstance').and.callFake((obj) => obj); }); @@ -808,18 +808,18 @@ describe('RemoteDataBuildService', () => { }); callback = jasmine.createSpy('callback'); - callback.and.returnValue(observableOf(undefined)); + callback.and.returnValue(of(undefined)); buildFromRequestUUIDSpy = spyOn(service, 'buildFromRequestUUID').and.callThrough(); }); it('should patch through href & followLinks to buildFromRequestUUID', () => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(MOCK_SUCCEEDED_RD)); + buildFromRequestUUIDSpy.and.returnValue(of(MOCK_SUCCEEDED_RD)); service.buildFromRequestUUIDAndAwait('some-href', callback, ...linksToFollow); expect(buildFromRequestUUIDSpy).toHaveBeenCalledWith('some-href', ...linksToFollow); }); it('should trigger the callback on successful RD', (done) => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(MOCK_SUCCEEDED_RD)); + buildFromRequestUUIDSpy.and.returnValue(of(MOCK_SUCCEEDED_RD)); service.buildFromRequestUUIDAndAwait('some-href', callback).subscribe(rd => { expect(rd).toBe(MOCK_SUCCEEDED_RD); @@ -829,7 +829,7 @@ describe('RemoteDataBuildService', () => { }); it('should trigger the callback on successful RD even if nothing subscribes to the returned Observable', fakeAsync(() => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(MOCK_SUCCEEDED_RD)); + buildFromRequestUUIDSpy.and.returnValue(of(MOCK_SUCCEEDED_RD)); service.buildFromRequestUUIDAndAwait('some-href', callback); tick(); @@ -838,7 +838,7 @@ describe('RemoteDataBuildService', () => { })); it('should not trigger the callback on pending RD', (done) => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(MOCK_PENDING_RD)); + buildFromRequestUUIDSpy.and.returnValue(of(MOCK_PENDING_RD)); service.buildFromRequestUUIDAndAwait('some-href', callback).subscribe(rd => { expect(rd).toBe(MOCK_PENDING_RD); @@ -848,7 +848,7 @@ describe('RemoteDataBuildService', () => { }); it('should not trigger the callback on failed RD', (done) => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(MOCK_FAILED_RD)); + buildFromRequestUUIDSpy.and.returnValue(of(MOCK_FAILED_RD)); service.buildFromRequestUUIDAndAwait('some-href', callback).subscribe(rd => { expect(rd).toBe(MOCK_FAILED_RD); diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index 36305b4a0c..366e85883c 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -3,7 +3,7 @@ import { AsyncSubject, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilKeyChanged, @@ -71,7 +71,7 @@ export class RemoteDataBuildService { */ private buildPayload(requestEntry$: Observable, href$?: Observable, ...linksToFollow: FollowLinkConfig[]): Observable { if (hasNoValue(href$)) { - href$ = observableOf(undefined); + href$ = of(undefined); } return observableCombineLatest([href$, requestEntry$]).pipe( switchMap(([href, entry]: [string, RequestEntry]) => { @@ -190,11 +190,11 @@ export class RemoteDataBuildService { this.linkService.resolveLinks(obj, ...pageLink.linksToFollow), ); if (isNotEmpty(otherLinks)) { - return observableOf(this.linkService.resolveLinks(paginatedList, ...otherLinks)); + return of(this.linkService.resolveLinks(paginatedList, ...otherLinks)); } } } - return observableOf(paginatedList as any); + return of(paginatedList as any); } /** @@ -205,7 +205,7 @@ export class RemoteDataBuildService { */ buildFromRequestUUID(requestUUID$: string | Observable, ...linksToFollow: FollowLinkConfig[]): Observable> { if (typeof requestUUID$ === 'string') { - requestUUID$ = observableOf(requestUUID$); + requestUUID$ = of(requestUUID$); } const requestEntry$ = requestUUID$.pipe(getRequestFromRequestUUID(this.requestService)); @@ -265,7 +265,7 @@ export class RemoteDataBuildService { */ buildFromHref(href$: string | Observable, ...linksToFollow: FollowLinkConfig[]): Observable> { if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } href$ = href$.pipe(map((href: string) => getUrlWithoutEmbedParams(href))); diff --git a/src/app/core/cache/object-cache.service.spec.ts b/src/app/core/cache/object-cache.service.spec.ts index 3d27f7252c..12183d2694 100644 --- a/src/app/core/cache/object-cache.service.spec.ts +++ b/src/app/core/cache/object-cache.service.spec.ts @@ -15,7 +15,7 @@ import { cold } from 'jasmine-marbles'; import { TestColdObservable } from 'jasmine-marbles/src/test-observables'; import { empty, - of as observableOf, + of, } from 'rxjs'; import { first } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; @@ -152,7 +152,7 @@ describe('ObjectCacheService', () => { describe('remove', () => { beforeEach(() => { - spyOn(service as any, 'getByHref').and.returnValue(observableOf(cacheEntry)); + spyOn(service as any, 'getByHref').and.returnValue(of(cacheEntry)); }); it('should dispatch a REMOVE action with the self link of the object to remove', () => { @@ -179,8 +179,8 @@ describe('ObjectCacheService', () => { describe('getByHref', () => { describe('if getBySelfLink emits a valid object and getByAlternativeLink emits undefined', () => { beforeEach(() => { - spyOn(service as any, 'getBySelfLink').and.returnValue(observableOf(cacheEntry)); - spyOn(service as any, 'getByAlternativeLink').and.returnValue(observableOf(undefined)); + spyOn(service as any, 'getBySelfLink').and.returnValue(of(cacheEntry)); + spyOn(service as any, 'getByAlternativeLink').and.returnValue(of(undefined)); }); it('should return the object emitted by getBySelfLink', () => { @@ -192,8 +192,8 @@ describe('ObjectCacheService', () => { describe('if getBySelfLink emits undefined and getByAlternativeLink a valid object', () => { beforeEach(() => { - spyOn(service as any, 'getBySelfLink').and.returnValue(observableOf(undefined)); - spyOn(service as any, 'getByAlternativeLink').and.returnValue(observableOf(cacheEntry)); + spyOn(service as any, 'getBySelfLink').and.returnValue(of(undefined)); + spyOn(service as any, 'getByAlternativeLink').and.returnValue(of(cacheEntry)); }); it('should return the object emitted by getByAlternativeLink', () => { @@ -205,8 +205,8 @@ describe('ObjectCacheService', () => { describe('if getBySelfLink emits an invalid and getByAlternativeLink a valid object', () => { beforeEach(() => { - spyOn(service as any, 'getBySelfLink').and.returnValue(observableOf(cacheEntry)); - spyOn(service as any, 'getByAlternativeLink').and.returnValue(observableOf(cacheEntry2)); + spyOn(service as any, 'getBySelfLink').and.returnValue(of(cacheEntry)); + spyOn(service as any, 'getByAlternativeLink').and.returnValue(of(cacheEntry2)); }); it('should return the object emitted by getByAlternativeLink', () => { @@ -222,7 +222,7 @@ describe('ObjectCacheService', () => { const item = Object.assign(new Item(), { _links: { self: { href: selfLink } }, }); - spyOn(service, 'getObjectByHref').and.returnValue(observableOf(item)); + spyOn(service, 'getObjectByHref').and.returnValue(of(item)); service.getList([selfLink, selfLink]).pipe(first()).subscribe((arr) => { expect(arr[0]._links.self.href).toBe(selfLink); @@ -235,7 +235,7 @@ describe('ObjectCacheService', () => { describe('with requestUUID not specified', () => { describe('getByHref emits an object', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf(cacheEntry)); + spyOn(service, 'getByHref').and.returnValue(of(cacheEntry)); }); it('should return true', () => { @@ -257,7 +257,7 @@ describe('ObjectCacheService', () => { describe('with requestUUID specified', () => { describe('getByHref emits an object that includes the specified requestUUID', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf(Object.assign(cacheEntry, { + spyOn(service, 'getByHref').and.returnValue(of(Object.assign(cacheEntry, { requestUUIDs: [ 'something', 'something-else', @@ -273,7 +273,7 @@ describe('ObjectCacheService', () => { describe('getByHref emits an object that doesn\'t include the specified requestUUID', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf(Object.assign(cacheEntry, { + spyOn(service, 'getByHref').and.returnValue(of(Object.assign(cacheEntry, { requestUUIDs: [ 'something', 'something-else', @@ -420,7 +420,7 @@ describe('ObjectCacheService', () => { }); it('should work with observable hrefs', () => { - service.addDependency(observableOf(selfLink), observableOf('objectWithoutDependents')); + service.addDependency(of(selfLink), of('objectWithoutDependents')); expect(store.dispatch).toHaveBeenCalledOnceWith(new AddDependentsObjectCacheAction('objectWithoutDependents', [requestUUID])); }); diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index f645b5a878..c8a78140d3 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -12,7 +12,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilChanged, @@ -271,7 +271,7 @@ export class ObjectCacheService { */ getList(selfLinks: string[]): Observable { if (isEmpty(selfLinks)) { - return observableOf([]); + return of([]); } else { return observableCombineLatest( selfLinks.map((selfLink: string) => this.getObjectByHref(selfLink)), @@ -391,10 +391,10 @@ export class ObjectCacheService { } if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } if (typeof dependsOnHref$ === 'string') { - dependsOnHref$ = observableOf(dependsOnHref$); + dependsOnHref$ = of(dependsOnHref$); } observableCombineLatest([ @@ -404,7 +404,7 @@ export class ObjectCacheService { ), ]).pipe( switchMap(([href, dependsOnSelfLink]: [string, string]) => { - const dependsOnSelfLink$ = observableOf(dependsOnSelfLink); + const dependsOnSelfLink$ = of(dependsOnSelfLink); return observableCombineLatest([ dependsOnSelfLink$, diff --git a/src/app/core/cache/server-sync-buffer.effects.spec.ts b/src/app/core/cache/server-sync-buffer.effects.spec.ts index 889b3b7454..55e06e32d5 100644 --- a/src/app/core/cache/server-sync-buffer.effects.spec.ts +++ b/src/app/core/cache/server-sync-buffer.effects.spec.ts @@ -10,7 +10,7 @@ import { } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -62,7 +62,7 @@ describe('ServerSyncBufferEffects', () => { const object = Object.assign(new DSpaceObject(), { _links: { self: { href: link } }, }); - return observableOf(object); + return of(object); }, getByHref: (link) => { const object = Object.assign(new DSpaceObject(), { @@ -70,7 +70,7 @@ describe('ServerSyncBufferEffects', () => { self: { href: link }, }, }); - return observableOf(object); + return of(object); }, }, }, diff --git a/src/app/core/cache/server-sync-buffer.effects.ts b/src/app/core/cache/server-sync-buffer.effects.ts index 6f346d5bb3..f044fe91fc 100644 --- a/src/app/core/cache/server-sync-buffer.effects.ts +++ b/src/app/core/cache/server-sync-buffer.effects.ts @@ -15,7 +15,7 @@ import { Operation } from 'fast-json-patch'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { delay, @@ -66,7 +66,7 @@ export class ServerSyncBufferEffects { exhaustMap((action: AddToSSBAction) => { const autoSyncConfig = environment.cache.autoSync; const timeoutInSeconds = autoSyncConfig.timePerMethod[action.payload.method] || autoSyncConfig.defaultTime; - return observableOf(new CommitSSBAction(action.payload.method)).pipe( + return of(new CommitSSBAction(action.payload.method)).pipe( delay(timeoutInSeconds * 1000), ); }), @@ -109,7 +109,7 @@ export class ServerSyncBufferEffects { switchMap((array) => [...array, new EmptySSBAction(action.payload)]), ); } else { - return observableOf(new NoOpAction()); + return of(new NoOpAction()); } }), ); diff --git a/src/app/core/data/base/base-data.service.spec.ts b/src/app/core/data/base/base-data.service.spec.ts index 6f32395667..8a4fd789aa 100644 --- a/src/app/core/data/base/base-data.service.spec.ts +++ b/src/app/core/data/base/base-data.service.spec.ts @@ -13,7 +13,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -61,7 +61,7 @@ class TestService extends BaseDataService { } public getBrowseEndpoint(options: FindListOptions = {}, linkPath: string = this.linkPath): Observable { - return observableOf(endpoint); + return of(endpoint); } } @@ -120,8 +120,8 @@ describe('BaseDataService', () => { const msToLive = 15 * 60 * 1000; const payload: BaseData = Object.assign(new BaseData(), { foo: 'bar', - followLink1: observableOf({}), - followLink2CustomVariableName: observableOf(createPaginatedList()), + followLink1: of({}), + followLink2CustomVariableName: of(createPaginatedList()), _links: { self: Object.assign(new HALLink(), { href: 'self-test-link', @@ -710,7 +710,7 @@ describe('BaseDataService', () => { let getByHrefSpy: jasmine.Spy; beforeEach(() => { - getByHrefSpy = spyOn(objectCache, 'getByHref').and.returnValue(observableOf({ + getByHrefSpy = spyOn(objectCache, 'getByHref').and.returnValue(of({ requestUUIDs: ['request1', 'request2', 'request3'], dependentRequestUUIDs: ['request4', 'request5'], } as ObjectCacheEntry)); @@ -810,7 +810,7 @@ describe('BaseDataService', () => { describe('hasCachedErrorResponse', () => { it('should return false when no response is cached', (done) => { - spyOn(service,'hasCachedResponse').and.returnValue(observableOf(false)); + spyOn(service,'hasCachedResponse').and.returnValue(of(false)); const result = service.hasCachedErrorResponse('test-href'); result.subscribe((hasCachedErrorResponse) => { @@ -819,7 +819,7 @@ describe('BaseDataService', () => { }); }); it('should return false when no error response is cached', (done) => { - spyOn(service,'hasCachedResponse').and.returnValue(observableOf(true)); + spyOn(service,'hasCachedResponse').and.returnValue(of(true)); spyOn(rdbService,'buildSingle').and.returnValue(createSuccessfulRemoteDataObject$({})); const result = service.hasCachedErrorResponse('test-href'); @@ -831,7 +831,7 @@ describe('BaseDataService', () => { }); it('should return true when an error response is cached', (done) => { - spyOn(service,'hasCachedResponse').and.returnValue(observableOf(true)); + spyOn(service,'hasCachedResponse').and.returnValue(of(true)); spyOn(rdbService,'buildSingle').and.returnValue(createFailedRemoteDataObject$()); const result = service.hasCachedErrorResponse('test-href'); @@ -860,7 +860,7 @@ describe('BaseDataService', () => { (service as any).addDependency( createSuccessfulRemoteDataObject$({ _links: { self: { href: 'object-href' } } }), - observableOf('dependsOnHref'), + of('dependsOnHref'), ); expect(addDependencySpy).toHaveBeenCalled(); }); @@ -875,7 +875,7 @@ describe('BaseDataService', () => { (service as any).addDependency( createFailedRemoteDataObject$('something went wrong'), - observableOf('dependsOnHref'), + of('dependsOnHref'), ); expect(addDependencySpy).toHaveBeenCalled(); }); diff --git a/src/app/core/data/base/base-data.service.ts b/src/app/core/data/base/base-data.service.ts index da36461240..0788afe0a6 100644 --- a/src/app/core/data/base/base-data.service.ts +++ b/src/app/core/data/base/base-data.service.ts @@ -10,7 +10,7 @@ import { AsyncSubject, from as observableFrom, Observable, - of as observableOf, + of, shareReplay, } from 'rxjs'; import { @@ -282,7 +282,7 @@ export class BaseDataService implements HALDataServic */ findByHref(href$: string | Observable, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable> { if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } const requestHref$ = href$.pipe( @@ -341,7 +341,7 @@ export class BaseDataService implements HALDataServic */ findListByHref(href$: string | Observable, options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } const requestHref$ = href$.pipe( @@ -403,7 +403,7 @@ export class BaseDataService implements HALDataServic protected createAndSendGetRequest(href$: string | Observable, useCachedVersionIfAvailable = true): void { if (isNotEmpty(href$)) { if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } href$.pipe( @@ -428,7 +428,7 @@ export class BaseDataService implements HALDataServic hasCachedResponse(href$: string | Observable): Observable { if (isNotEmpty(href$)) { if (typeof href$ === 'string') { - href$ = observableOf(href$); + href$ = of(href$); } return href$.pipe( isNotEmptyOperator(), @@ -457,7 +457,7 @@ export class BaseDataService implements HALDataServic map((rd => rd.hasFailed)), ); } - return observableOf(false); + return of(false); }), ); } diff --git a/src/app/core/data/base/create-data.spec.ts b/src/app/core/data/base/create-data.spec.ts index 1248c5ffe4..04d08a9838 100644 --- a/src/app/core/data/base/create-data.spec.ts +++ b/src/app/core/data/base/create-data.spec.ts @@ -7,7 +7,7 @@ */ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { getMockRemoteDataBuildService } from '../../../shared/mocks/remote-data-build.service.mock'; @@ -78,7 +78,7 @@ class TestService extends CreateDataImpl { } public getEndpoint(options: FindListOptions = {}, linkPath: string = this.linkPath): Observable { - return observableOf(endpoint); + return of(endpoint); } } @@ -161,7 +161,7 @@ describe('CreateDataImpl', () => { const params = [ new RequestParam('abc', 123), new RequestParam('def', 456), ]; - buildFromRequestUUIDSpy.and.returnValue(observableOf(remoteDataMocks.Success)); + buildFromRequestUUIDSpy.and.returnValue(of(remoteDataMocks.Success)); service.create(obj, ...params).subscribe(out => { expect(createOnEndpointSpy).toHaveBeenCalledWith(obj, jasmine.anything()); @@ -180,11 +180,11 @@ describe('CreateDataImpl', () => { describe('createOnEndpoint', () => { beforeEach(() => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(remoteDataMocks.Success)); + buildFromRequestUUIDSpy.and.returnValue(of(remoteDataMocks.Success)); }); it('should send a POST request with the object as JSON', (done) => { - service.createOnEndpoint(obj, observableOf('https://rest.api/core/custom?search')).subscribe(out => { + service.createOnEndpoint(obj, of('https://rest.api/core/custom?search')).subscribe(out => { expect(requestService.send).toHaveBeenCalledWith(jasmine.objectContaining({ method: RestRequestMethod.POST, body: JSON.stringify(obj), @@ -195,7 +195,7 @@ describe('CreateDataImpl', () => { it('should send the POST request to the given endpoint', (done) => { - service.createOnEndpoint(obj, observableOf('https://rest.api/core/custom?search')).subscribe(out => { + service.createOnEndpoint(obj, of('https://rest.api/core/custom?search')).subscribe(out => { expect(requestService.send).toHaveBeenCalledWith(jasmine.objectContaining({ method: RestRequestMethod.POST, href: 'https://rest.api/core/custom?search', @@ -205,7 +205,7 @@ describe('CreateDataImpl', () => { }); it('should return the remote data for the sent request', (done) => { - service.createOnEndpoint(obj, observableOf('https://rest.api/core/custom?search')).subscribe(out => { + service.createOnEndpoint(obj, of('https://rest.api/core/custom?search')).subscribe(out => { expect(requestService.send).toHaveBeenCalledWith(jasmine.objectContaining({ method: RestRequestMethod.POST, uuid: requestService.generateRequestId(), @@ -218,9 +218,9 @@ describe('CreateDataImpl', () => { }); it('should show an error notification if the request fails', (done) => { - buildFromRequestUUIDSpy.and.returnValue(observableOf(remoteDataMocks.Error)); + buildFromRequestUUIDSpy.and.returnValue(of(remoteDataMocks.Error)); - service.createOnEndpoint(obj, observableOf('https://rest.api/core/custom?search')).subscribe(out => { + service.createOnEndpoint(obj, of('https://rest.api/core/custom?search')).subscribe(out => { expect(requestService.send).toHaveBeenCalledWith(jasmine.objectContaining({ method: RestRequestMethod.POST, uuid: requestService.generateRequestId(), diff --git a/src/app/core/data/base/delete-data.spec.ts b/src/app/core/data/base/delete-data.spec.ts index f3fa72a285..30d024299c 100644 --- a/src/app/core/data/base/delete-data.spec.ts +++ b/src/app/core/data/base/delete-data.spec.ts @@ -7,7 +7,7 @@ */ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -86,7 +86,7 @@ class TestService extends DeleteDataImpl { } public getBrowseEndpoint(options: FindListOptions = {}, linkPath: string = this.linkPath): Observable { - return observableOf(endpoint); + return of(endpoint); } } @@ -169,7 +169,7 @@ describe('DeleteDataImpl', () => { let deleteByHrefSpy: jasmine.Spy; beforeEach(() => { - invalidateByHrefSpy = spyOn(service, 'invalidateByHref').and.returnValue(observableOf(true)); + invalidateByHrefSpy = spyOn(service, 'invalidateByHref').and.returnValue(of(true)); buildFromRequestUUIDAndAwaitSpy = spyOn(rdbService, 'buildFromRequestUUIDAndAwait').and.callThrough(); getIDHrefObsSpy = spyOn(service, 'getIDHrefObs').and.callThrough(); deleteByHrefSpy = spyOn(service, 'deleteByHref').and.callThrough(); @@ -179,7 +179,7 @@ describe('DeleteDataImpl', () => { }); it('should retrieve href by ID and call deleteByHref', () => { - getIDHrefObsSpy.and.returnValue(observableOf('some-href')); + getIDHrefObsSpy.and.returnValue(of('some-href')); buildFromRequestUUIDAndAwaitSpy.and.returnValue(createSuccessfulRemoteDataObject$({})); service.delete('some-id', ['a', 'b', 'c']).subscribe(rd => { @@ -190,7 +190,7 @@ describe('DeleteDataImpl', () => { describe('deleteByHref', () => { it('should send a DELETE request', (done) => { - buildFromRequestUUIDAndAwaitSpy.and.returnValue(observableOf(MOCK_SUCCEEDED_RD)); + buildFromRequestUUIDAndAwaitSpy.and.returnValue(of(MOCK_SUCCEEDED_RD)); service.deleteByHref('some-href').subscribe(() => { expect(requestService.send).toHaveBeenCalledWith(jasmine.objectContaining({ @@ -202,7 +202,7 @@ describe('DeleteDataImpl', () => { }); it('should include the virtual metadata to be copied in the DELETE request', (done) => { - buildFromRequestUUIDAndAwaitSpy.and.returnValue(observableOf(MOCK_SUCCEEDED_RD)); + buildFromRequestUUIDAndAwaitSpy.and.returnValue(of(MOCK_SUCCEEDED_RD)); service.deleteByHref('some-href', ['a', 'b', 'c']).subscribe(() => { expect(requestService.send).toHaveBeenCalledWith(jasmine.objectContaining({ @@ -234,7 +234,7 @@ describe('DeleteDataImpl', () => { }); it('should return the RemoteData of the response', (done) => { - buildFromRequestUUIDAndAwaitSpy.and.returnValue(observableOf(MOCK_SUCCEEDED_RD)); + buildFromRequestUUIDAndAwaitSpy.and.returnValue(of(MOCK_SUCCEEDED_RD)); service.deleteByHref('some-href').subscribe(rd => { expect(rd).toBe(MOCK_SUCCEEDED_RD); diff --git a/src/app/core/data/base/find-all-data.spec.ts b/src/app/core/data/base/find-all-data.spec.ts index f2c48feb76..8940b631eb 100644 --- a/src/app/core/data/base/find-all-data.spec.ts +++ b/src/app/core/data/base/find-all-data.spec.ts @@ -7,7 +7,7 @@ */ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -75,7 +75,7 @@ class TestService extends FindAllDataImpl { } public getBrowseEndpoint(options: FindListOptions = {}, linkPath: string = this.linkPath): Observable { - return observableOf(endpoint); + return of(endpoint); } } diff --git a/src/app/core/data/base/identifiable-data.service.spec.ts b/src/app/core/data/base/identifiable-data.service.spec.ts index 9281a5c0eb..043b422a01 100644 --- a/src/app/core/data/base/identifiable-data.service.spec.ts +++ b/src/app/core/data/base/identifiable-data.service.spec.ts @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockRemoteDataBuildService } from '../../../shared/mocks/remote-data-build.service.mock'; @@ -143,7 +143,7 @@ describe('IdentifiableDataService', () => { describe('invalidateById', () => { it('should invalidate the correct resource by href', () => { - spyOn(service, 'invalidateByHref').and.returnValue(observableOf(true)); + spyOn(service, 'invalidateByHref').and.returnValue(of(true)); service.invalidateById('123'); expect(service.invalidateByHref).toHaveBeenCalledWith(`${base}/${endpoint}/123`); }); diff --git a/src/app/core/data/base/patch-data.spec.ts b/src/app/core/data/base/patch-data.spec.ts index 03c15199a7..ba719171ef 100644 --- a/src/app/core/data/base/patch-data.spec.ts +++ b/src/app/core/data/base/patch-data.spec.ts @@ -12,7 +12,7 @@ import { } from 'fast-json-patch'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -107,7 +107,7 @@ class TestService extends PatchDataImpl { } public getBrowseEndpoint(options: FindListOptions = {}, linkPath: string = this.linkPath): Observable { - return observableOf(endpoint); + return of(endpoint); } } diff --git a/src/app/core/data/base/put-data.spec.ts b/src/app/core/data/base/put-data.spec.ts index 1430bb3106..c6c0b9152c 100644 --- a/src/app/core/data/base/put-data.spec.ts +++ b/src/app/core/data/base/put-data.spec.ts @@ -8,7 +8,7 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { getMockRemoteDataBuildService } from '../../../shared/mocks/remote-data-build.service.mock'; @@ -69,7 +69,7 @@ class TestService extends PutDataImpl { } public getBrowseEndpoint(options: FindListOptions = {}, linkPath: string = this.linkPath): Observable { - return observableOf(endpoint); + return of(endpoint); } } @@ -141,7 +141,7 @@ describe('PutDataImpl', () => { }); - buildFromRequestUUIDSpy = spyOn(rdbService, 'buildFromRequestUUID').and.returnValue(observableOf(remoteDataMocks.Success)); + buildFromRequestUUIDSpy = spyOn(rdbService, 'buildFromRequestUUID').and.returnValue(of(remoteDataMocks.Success)); }); describe('put', () => { diff --git a/src/app/core/data/base/search-data.spec.ts b/src/app/core/data/base/search-data.spec.ts index af9f87bf2c..6c68e630e9 100644 --- a/src/app/core/data/base/search-data.spec.ts +++ b/src/app/core/data/base/search-data.spec.ts @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getMockRemoteDataBuildService } from '../../../shared/mocks/remote-data-build.service.mock'; import { getMockRequestService } from '../../../shared/mocks/request.service.mock'; @@ -61,7 +61,7 @@ describe('SearchDataImpl', () => { function initTestService(): SearchDataImpl { requestService = getMockRequestService(); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(endpoint), + getEndpoint: of(endpoint), }); rdbService = getMockRemoteDataBuildService(); linksToFollow = [ diff --git a/src/app/core/data/bitstream-data.service.spec.ts b/src/app/core/data/bitstream-data.service.spec.ts index 68c6b4850c..7620b012bb 100644 --- a/src/app/core/data/bitstream-data.service.spec.ts +++ b/src/app/core/data/bitstream-data.service.spec.ts @@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing'; import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { ItemMock } from 'src/app/shared/mocks/item.mock'; import { @@ -80,12 +80,12 @@ describe('BitstreamDataService', () => { objectCache = jasmine.createSpyObj('objectCache', { remove: jasmine.createSpy('remove'), - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), }); requestService = getMockRequestService(); halService = Object.assign(new HALEndpointServiceStub(url)); bitstreamFormatService = jasmine.createSpyObj('bistreamFormatService', { - getBrowseEndpoint: observableOf(bitstreamFormatHref), + getBrowseEndpoint: of(bitstreamFormatHref), }); rdbService = getMockRemoteDataBuildService(); @@ -149,24 +149,24 @@ describe('BitstreamDataService', () => { it('should return primary bitstream', () => { const expected$ = cold('(a|)', { a: bitstream1 } ); const bundle = Object.assign(new Bundle(), { - primaryBitstream: observableOf(createSuccessfulRemoteDataObject(bitstream1)), + primaryBitstream: of(createSuccessfulRemoteDataObject(bitstream1)), }); - spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createSuccessfulRemoteDataObject(bundle))); + spyOn(bundleDataService, 'findByItemAndName').and.returnValue(of(createSuccessfulRemoteDataObject(bundle))); expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(expected$); }); it('should return null if primary bitstream has not be succeeded ', () => { const expected$ = cold('(a|)', { a: null } ); const bundle = Object.assign(new Bundle(), { - primaryBitstream: observableOf(createFailedRemoteDataObject()), + primaryBitstream: of(createFailedRemoteDataObject()), }); - spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createSuccessfulRemoteDataObject(bundle))); + spyOn(bundleDataService, 'findByItemAndName').and.returnValue(of(createSuccessfulRemoteDataObject(bundle))); expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(expected$); }); it('should return EMPTY if nothing where found', () => { const expected$ = cold('(|)', {} ); - spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createFailedRemoteDataObject())); + spyOn(bundleDataService, 'findByItemAndName').and.returnValue(of(createFailedRemoteDataObject())); expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(expected$); }); }); diff --git a/src/app/core/data/bitstream-format-data.service.spec.ts b/src/app/core/data/bitstream-format-data.service.spec.ts index 234326d453..e305e5ae21 100644 --- a/src/app/core/data/bitstream-format-data.service.spec.ts +++ b/src/app/core/data/bitstream-format-data.service.spec.ts @@ -10,7 +10,7 @@ import { } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -52,7 +52,7 @@ describe('BitstreamFormatDataService', () => { const requestUUIDs = ['some', 'uuid']; const objectCache = jasmine.createSpyObj('objectCache', { - getByHref: observableOf({ requestUUIDs }), + getByHref: of({ requestUUIDs }), }) as ObjectCacheService; const halEndpointService = { @@ -69,8 +69,8 @@ describe('BitstreamFormatDataService', () => { function initTestService(halService) { rd = createSuccessfulRemoteDataObject({}); rdbService = jasmine.createSpyObj('rdbService', { - buildFromRequestUUID: observableOf(rd), - buildFromRequestUUIDAndAwait: observableOf(rd), + buildFromRequestUUID: of(rd), + buildFromRequestUUIDAndAwait: of(rd), }); return new BitstreamFormatDataService( @@ -94,9 +94,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -115,9 +115,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -138,9 +138,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -160,9 +160,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -185,9 +185,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -209,15 +209,15 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); const halService = { getEndpoint(linkPath: string): Observable { - return observableOf(bitstreamFormatsEndpoint); + return of(bitstreamFormatsEndpoint); }, } as HALEndpointService; service = initTestService(halService); @@ -233,9 +233,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -256,9 +256,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -279,9 +279,9 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: cold('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); @@ -300,15 +300,15 @@ describe('BitstreamFormatDataService', () => { scheduler = getTestScheduler(); requestService = jasmine.createSpyObj('requestService', { send: {}, - getByHref: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), getByUUID: hot('a', { a: responseCacheEntry }), - setStaleByUUID: observableOf(true), + setStaleByUUID: of(true), generateRequestId: 'request-id', removeByHrefSubstring: {}, }); const halService = { getEndpoint(linkPath: string): Observable { - return observableOf(bitstreamFormatsEndpoint); + return of(bitstreamFormatsEndpoint); }, } as HALEndpointService; service = initTestService(halService); diff --git a/src/app/core/data/comcol-data.service.spec.ts b/src/app/core/data/comcol-data.service.spec.ts index e1fe48c076..d86c8576d2 100644 --- a/src/app/core/data/comcol-data.service.spec.ts +++ b/src/app/core/data/comcol-data.service.spec.ts @@ -3,7 +3,7 @@ import { Store } from '@ngrx/store'; import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -66,7 +66,7 @@ class TestService extends ComColDataService { protected getScopeCommunityHref(options: FindListOptions): Observable { // implementation in subclasses for communities/collections - return observableOf(communityEndpoint); + return of(communityEndpoint); } } @@ -93,7 +93,7 @@ describe('ComColDataService', () => { const scopedEndpoint = `${communityEndpoint}/${LINK_NAME}`; const mockHalService = { - getEndpoint: (linkPath) => observableOf(communitiesEndpoint), + getEndpoint: (linkPath) => of(communitiesEndpoint), }; function initRdbService(): RemoteDataBuildService { diff --git a/src/app/core/data/eperson-registration.service.spec.ts b/src/app/core/data/eperson-registration.service.spec.ts index b06f614139..4a0ec962e1 100644 --- a/src/app/core/data/eperson-registration.service.spec.ts +++ b/src/app/core/data/eperson-registration.service.spec.ts @@ -1,6 +1,6 @@ import { HttpHeaders } from '@angular/common/http'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; @@ -48,8 +48,8 @@ describe('EpersonRegistrationService', () => { { a: Object.assign(new RequestEntry(), { response: new RestResponse(true, 200, 'Success') }) }), }); rdbService = jasmine.createSpyObj('rdbService', { - buildSingle: observableOf(rd), - buildFromRequestUUID: observableOf(rd), + buildSingle: of(rd), + buildFromRequestUUID: of(rd), }); service = new EpersonRegistrationService( requestService, diff --git a/src/app/core/data/external-source-data.service.spec.ts b/src/app/core/data/external-source-data.service.spec.ts index 5e643cc549..ba8ce48256 100644 --- a/src/app/core/data/external-source-data.service.spec.ts +++ b/src/app/core/data/external-source-data.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { take } from 'rxjs/operators'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; @@ -51,7 +51,7 @@ describe('ExternalSourceService', () => { buildList: createSuccessfulRemoteDataObject$(createPaginatedList(entries)), }); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf('external-sources-REST-endpoint'), + getEndpoint: of('external-sources-REST-endpoint'), }); service = new ExternalSourceDataService(requestService, rdbService, undefined, halService); } @@ -70,7 +70,7 @@ describe('ExternalSourceService', () => { describe('when no error response is cached', () => { let result; beforeEach(() => { - spyOn(service, 'hasCachedErrorResponse').and.returnValue(observableOf(false)); + spyOn(service, 'hasCachedErrorResponse').and.returnValue(of(false)); result = service.getExternalSourceEntries('test'); }); @@ -89,7 +89,7 @@ describe('ExternalSourceService', () => { describe('when an error response is cached', () => { let result; beforeEach(() => { - spyOn(service, 'hasCachedErrorResponse').and.returnValue(observableOf(true)); + spyOn(service, 'hasCachedErrorResponse').and.returnValue(of(true)); result = service.getExternalSourceEntries('test'); }); diff --git a/src/app/core/data/feature-authorization/authorization-data.service.spec.ts b/src/app/core/data/feature-authorization/authorization-data.service.spec.ts index 4ada344beb..f5b76e0cf8 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.spec.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.spec.ts @@ -1,7 +1,7 @@ import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { hasValue } from '../../../shared/empty.util'; @@ -46,7 +46,7 @@ describe('AuthorizationDataService', () => { uuid: 'test-eperson', }); siteService = jasmine.createSpyObj('siteService', { - find: observableOf(site), + find: of(site), }); objectCache = getMockObjectCacheService(); service = new AuthorizationDataService(requestService, undefined, objectCache, undefined, siteService); @@ -54,7 +54,7 @@ describe('AuthorizationDataService', () => { beforeEach(() => { init(); - spyOn(service, 'searchBy').and.returnValue(observableOf(undefined)); + spyOn(service, 'searchBy').and.returnValue(of(undefined)); }); describe('composition', () => { @@ -126,7 +126,7 @@ describe('AuthorizationDataService', () => { let addDependencySpy; beforeEach(() => { - (service.searchBy as any).and.returnValue(observableOf('searchBy RD$')); + (service.searchBy as any).and.returnValue(of('searchBy RD$')); addDependencySpy = spyOn(service as any, 'addDependency'); }); diff --git a/src/app/core/data/feature-authorization/authorization-data.service.ts b/src/app/core/data/feature-authorization/authorization-data.service.ts index e5efbae671..1f9a5e4c10 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { catchError, @@ -89,7 +89,7 @@ export class AuthorizationDataService extends BaseDataService imp return []; } }), - catchError(() => observableOf([])), + catchError(() => of([])), oneAuthorizationMatchesFeature(featureId), ); } @@ -111,14 +111,14 @@ export class AuthorizationDataService extends BaseDataService imp * {@link HALLink}s should be automatically resolved */ searchByObject(featureId?: FeatureID, objectUrl?: string, ePersonUuid?: string, options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { - const objectUrl$ = observableOf(objectUrl).pipe( + const objectUrl$ = of(objectUrl).pipe( switchMap((url) => { if (hasNoValue(url)) { return this.siteService.find().pipe( map((site) => site.self), ); } else { - return observableOf(url); + return of(url); } }), ); diff --git a/src/app/core/data/feature-authorization/authorization-utils.ts b/src/app/core/data/feature-authorization/authorization-utils.ts index cd4bc452a5..61d35cd6d8 100644 --- a/src/app/core/data/feature-authorization/authorization-utils.ts +++ b/src/app/core/data/feature-authorization/authorization-utils.ts @@ -1,7 +1,7 @@ import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -35,7 +35,7 @@ export const addSiteObjectUrlIfEmpty = (siteService: SiteDataService) => map((site) => Object.assign({}, params, { objectUrl: site.self })), ); } else { - return observableOf(params); + return of(params); } }), ); @@ -57,12 +57,12 @@ export const addAuthenticatedUserUuidIfEmpty = (authService: AuthService) => map((ePerson) => Object.assign({}, params, { ePersonUuid: ePerson.uuid })), ); } else { - return observableOf(params); + return of(params); } }), ); } else { - return observableOf(params); + return of(params); } }), ); @@ -88,7 +88,7 @@ export const oneAuthorizationMatchesFeature = (featureID: FeatureID) => )), ]); } else { - return observableOf([]); + return of([]); } }), map((features: Feature[]) => features.filter((feature: Feature) => feature.id === featureID.valueOf()).length > 0), diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts index 1b1b4a9d6c..07be578ed5 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FeatureID } from '../feature-id'; import { singleFeatureAuthorizationGuard } from './single-feature-authorization.guard'; @@ -10,4 +10,4 @@ import { singleFeatureAuthorizationGuard } from './single-feature-authorization. * Check group management rights */ export const collectionAdministratorGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.IsCollectionAdmin)); + singleFeatureAuthorizationGuard(() => of(FeatureID.IsCollectionAdmin)); diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts index 6d7dac314e..58f836c126 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FeatureID } from '../feature-id'; import { singleFeatureAuthorizationGuard } from './single-feature-authorization.guard'; @@ -10,4 +10,4 @@ import { singleFeatureAuthorizationGuard } from './single-feature-authorization. * Check group management rights */ export const communityAdministratorGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.IsCommunityAdmin)); + singleFeatureAuthorizationGuard(() => of(FeatureID.IsCommunityAdmin)); diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts index 18292bb943..c4f241243c 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; @@ -39,14 +39,14 @@ describe('DsoPageSingleFeatureGuard', () => { } as DSpaceObject; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, }); resolver = () => createSuccessfulRemoteDataObject$(object); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { params: { @@ -94,7 +94,7 @@ describe('DsoPageSingleFeatureGuard', () => { it('should call authorizationService.isAuthenticated with the appropriate arguments', (done) => { const result$ = TestBed.runInInjectionContext(() => { return dsoPageSingleFeatureGuard( - () => resolver, () => observableOf(featureId), + () => resolver, () => of(featureId), )(route, { url: 'current-url' } as any); }) as Observable; diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts index 08f1c96b29..025c2c7a0a 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; @@ -39,14 +39,14 @@ describe('dsoPageSomeFeatureGuard and its functions', () => { } as DSpaceObject; featureIds = [FeatureID.LoginOnBehalfOf, FeatureID.CanDelete]; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, }); resolver = () => createSuccessfulRemoteDataObject$(object); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { params: { @@ -95,7 +95,7 @@ describe('dsoPageSomeFeatureGuard and its functions', () => { it('should call authorizationService.isAuthenticated with the appropriate arguments', (done) => { const result$ = TestBed.runInInjectionContext(() => { return dsoPageSomeFeatureGuard( - () => resolver, () => observableOf(featureIds), + () => resolver, () => of(featureIds), )(route, { url: 'current-url' } as any); }) as Observable; diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts index 9641d0aace..718ca2b653 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FeatureID } from '../feature-id'; import { singleFeatureAuthorizationGuard } from './single-feature-authorization.guard'; @@ -9,4 +9,4 @@ import { singleFeatureAuthorizationGuard } from './single-feature-authorization. * management rights */ export const groupAdministratorGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.CanManageGroups)); + singleFeatureAuthorizationGuard(() => of(FeatureID.CanManageGroups)); diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts index 7c15fa4cdf..8bf7785e5f 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from '../../../auth/auth.service'; @@ -31,13 +31,13 @@ describe('singleFeatureAuthorizationGuard', () => { ePersonUuid = 'fake-eperson-uuid'; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); TestBed.configureTestingModule({ @@ -57,9 +57,9 @@ describe('singleFeatureAuthorizationGuard', () => { it('should call authorizationService.isAuthenticated with the appropriate arguments', (done: DoneFn) => { const result$ = TestBed.runInInjectionContext(() => { return singleFeatureAuthorizationGuard( - () => observableOf(featureId), - () => observableOf(objectUrl), - () => observableOf(ePersonUuid), + () => of(featureId), + () => of(objectUrl), + () => of(ePersonUuid), )(undefined, { url: 'current-url' } as any); }) as Observable; diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts index 4caa1f806d..53d3ee3cea 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FeatureID } from '../feature-id'; import { singleFeatureAuthorizationGuard } from './single-feature-authorization.guard'; @@ -9,4 +9,4 @@ import { singleFeatureAuthorizationGuard } from './single-feature-authorization. * rights to the {@link Site} */ export const siteAdministratorGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.AdministratorOf)); + singleFeatureAuthorizationGuard(() => of(FeatureID.AdministratorOf)); diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts index ee08532d38..b4b8e47883 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FeatureID } from '../feature-id'; import { singleFeatureAuthorizationGuard } from './single-feature-authorization.guard'; @@ -9,4 +9,4 @@ import { singleFeatureAuthorizationGuard } from './single-feature-authorization. * rights to the {@link Site} */ export const siteRegisterGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.EPersonRegistration)); + singleFeatureAuthorizationGuard(() => of(FeatureID.EPersonRegistration)); diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts index 79e023bdd0..4a1d06f83c 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from '../../../auth/auth.service'; @@ -34,7 +34,7 @@ describe('SomeFeatureAuthorizationGuard', () => { authorizationService = Object.assign({ isAuthorized(featureId?: FeatureID): Observable { - return observableOf(authorizedFeatureIds.indexOf(featureId) > -1); + return of(authorizedFeatureIds.indexOf(featureId) > -1); }, }); @@ -43,7 +43,7 @@ describe('SomeFeatureAuthorizationGuard', () => { }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); TestBed.configureTestingModule({ @@ -69,9 +69,9 @@ describe('SomeFeatureAuthorizationGuard', () => { const result$ = TestBed.runInInjectionContext(() => { return someFeatureAuthorizationGuard( - () => observableOf(featureIds), - () => observableOf(objectUrl), - () => observableOf(ePersonUuid), + () => of(featureIds), + () => of(objectUrl), + () => of(ePersonUuid), )(undefined, { url: 'current-url' } as any); }) as Observable; @@ -91,9 +91,9 @@ describe('SomeFeatureAuthorizationGuard', () => { const result$ = TestBed.runInInjectionContext(() => { return someFeatureAuthorizationGuard( - () => observableOf(featureIds), - () => observableOf(objectUrl), - () => observableOf(ePersonUuid), + () => of(featureIds), + () => of(objectUrl), + () => of(ePersonUuid), )(undefined, { url: 'current-url' } as any); }) as Observable; @@ -113,9 +113,9 @@ describe('SomeFeatureAuthorizationGuard', () => { const result$ = TestBed.runInInjectionContext(() => { return someFeatureAuthorizationGuard( - () => observableOf(featureIds), - () => observableOf(objectUrl), - () => observableOf(ePersonUuid), + () => of(featureIds), + () => of(objectUrl), + () => of(ePersonUuid), )(undefined, { url: 'current-url' } as any); }) as Observable; diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts index 53e5e582eb..1ce7fe5f91 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts @@ -9,7 +9,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { switchMap } from 'rxjs/operators'; @@ -20,7 +20,7 @@ import { FeatureID } from '../feature-id'; export declare type SomeFeatureGuardParamFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable; export declare type StringGuardParamFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable; -export const defaultStringGuardParamFn = () => observableOf(undefined); +export const defaultStringGuardParamFn = () => of(undefined); /** * Guard for preventing unauthorized activating and loading of routes when a user doesn't have diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts index 21cafeaba3..04e8d6ca65 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FeatureID } from '../feature-id'; import { singleFeatureAuthorizationGuard } from './single-feature-authorization.guard'; @@ -9,4 +9,4 @@ import { singleFeatureAuthorizationGuard } from './single-feature-authorization. * management rights */ export const statisticsAdministratorGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.CanViewUsageStatistics)); + singleFeatureAuthorizationGuard(() => of(FeatureID.CanViewUsageStatistics)); diff --git a/src/app/core/data/item-data.service.spec.ts b/src/app/core/data/item-data.service.spec.ts index dd60d94070..71833e24e8 100644 --- a/src/app/core/data/item-data.service.spec.ts +++ b/src/app/core/data/item-data.service.spec.ts @@ -4,7 +4,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockRemoteDataBuildService } from '../../shared/mocks/remote-data-build.service.mock'; @@ -39,7 +39,7 @@ describe('ItemDataService', () => { getByHref(requestHref: string) { const responseCacheEntry = new RequestEntry(); responseCacheEntry.response = new RestResponse(true, 200, 'OK'); - return observableOf(responseCacheEntry); + return of(responseCacheEntry); }, removeByHrefSubstring(href: string) { // Do nothing diff --git a/src/app/core/data/item-request-data.service.spec.ts b/src/app/core/data/item-request-data.service.spec.ts index 59a497777f..3c74c8879f 100644 --- a/src/app/core/data/item-request-data.service.spec.ts +++ b/src/app/core/data/item-request-data.service.spec.ts @@ -1,5 +1,5 @@ import { HttpHeaders } from '@angular/common/http'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestCopyEmail } from '../../request-copy/email-request-copy/request-copy-email.model'; import { MockBitstream1 } from '../../shared/mocks/item.mock'; @@ -51,7 +51,7 @@ describe('ItemRequestDataService', () => { authorizationDataService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(false), + isAuthorized: of(false), }); itemRequest = Object.assign(new ItemRequest(), { token: 'item-request-token', @@ -64,7 +64,7 @@ describe('ItemRequestDataService', () => { buildFromRequestUUID: createSuccessfulRemoteDataObject$(itemRequest), }); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(restApiEndpoint), + getEndpoint: of(restApiEndpoint), }); service = new ItemRequestDataService(requestService, rdbService, null, halService, configService, authorizationDataService); @@ -75,7 +75,7 @@ describe('ItemRequestDataService', () => { const searchMethod = 'testMethod'; const options = new FindListOptions(); - const searchDataSpy = spyOn((service as any).searchData, 'searchBy').and.returnValue(observableOf(null)); + const searchDataSpy = spyOn((service as any).searchData, 'searchBy').and.returnValue(of(null)); service.searchBy(searchMethod, options); diff --git a/src/app/core/data/item-template-data.service.spec.ts b/src/app/core/data/item-template-data.service.spec.ts index 27db819861..82e76124f7 100644 --- a/src/app/core/data/item-template-data.service.spec.ts +++ b/src/app/core/data/item-template-data.service.spec.ts @@ -2,7 +2,7 @@ import { Store } from '@ngrx/store'; import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -41,12 +41,12 @@ describe('ItemTemplateDataService', () => { getByHref(requestHref: string) { const responseCacheEntry = new RequestEntry(); responseCacheEntry.response = new RestResponse(true, 200, 'OK'); - return observableOf(responseCacheEntry); + return of(responseCacheEntry); }, getByUUID(uuid: string) { const responseCacheEntry = new RequestEntry(); responseCacheEntry.response = new RestResponse(true, 200, 'OK'); - return observableOf(responseCacheEntry); + return of(responseCacheEntry); }, commit(method?: RestRequestMethod) { // Do nothing @@ -57,7 +57,7 @@ describe('ItemTemplateDataService', () => { const browseService = {} as BrowseService; const objectCache = { getObjectBySelfLink(self) { - return observableOf({}); + return of({}); }, addPatch(self, operations) { // Do nothing @@ -76,7 +76,7 @@ describe('ItemTemplateDataService', () => { } as any; const collectionService = { getIDHrefObs(id): Observable { - return observableOf(collectionEndpoint); + return of(collectionEndpoint); }, } as CollectionDataService; diff --git a/src/app/core/data/lookup-relation.service.spec.ts b/src/app/core/data/lookup-relation.service.spec.ts index 93b4ed6696..8c05a32f5a 100644 --- a/src/app/core/data/lookup-relation.service.spec.ts +++ b/src/app/core/data/lookup-relation.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { skip, take, @@ -56,7 +56,7 @@ describe('LookupRelationService', () => { }); searchService = jasmine.createSpyObj('searchService', { search: createSuccessfulRemoteDataObject$(createPaginatedList(localResults)), - getEndpoint: observableOf(searchServiceEndpoint), + getEndpoint: of(searchServiceEndpoint), }); requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring']); service = new LookupRelationService(externalSourceService, searchService, requestService); diff --git a/src/app/core/data/metadata-field-data.service.spec.ts b/src/app/core/data/metadata-field-data.service.spec.ts index 8d65038060..b891c84324 100644 --- a/src/app/core/data/metadata-field-data.service.spec.ts +++ b/src/app/core/data/metadata-field-data.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; @@ -38,7 +38,7 @@ describe('MetadataFieldDataService', () => { requestService = jasmine.createSpyObj('requestService', { generateRequestId: '34cfed7c-f597-49ef-9cbe-ea351f0023c2', send: {}, - getByUUID: observableOf({ response: new RestResponse(true, 200, 'OK') }), + getByUUID: of({ response: new RestResponse(true, 200, 'OK') }), setStaleByHrefSubstring: {}, }); halService = Object.assign(new HALEndpointServiceStub(endpoint)); @@ -82,7 +82,7 @@ describe('MetadataFieldDataService', () => { describe('clearRequests', () => { it('should remove requests on the data service\'s endpoint', () => { - spyOn(metadataFieldService, 'getBrowseEndpoint').and.returnValue(observableOf(endpoint)); + spyOn(metadataFieldService, 'getBrowseEndpoint').and.returnValue(of(endpoint)); metadataFieldService.clearRequests(); expect(requestService.setStaleByHrefSubstring).toHaveBeenCalledWith(endpoint); }); diff --git a/src/app/core/data/metadata-schema-data.service.spec.ts b/src/app/core/data/metadata-schema-data.service.spec.ts index 02fbc016e7..224df3154e 100644 --- a/src/app/core/data/metadata-schema-data.service.spec.ts +++ b/src/app/core/data/metadata-schema-data.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getMockRemoteDataBuildService } from '../../shared/mocks/remote-data-build.service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -29,7 +29,7 @@ describe('MetadataSchemaDataService', () => { requestService = jasmine.createSpyObj('requestService', { generateRequestId: '34cfed7c-f597-49ef-9cbe-ea351f0023c2', send: {}, - getByUUID: observableOf({ response: new RestResponse(true, 200, 'OK') }), + getByUUID: of({ response: new RestResponse(true, 200, 'OK') }), removeByHrefSubstring: {}, }); halService = Object.assign(new HALEndpointServiceStub(endpoint)); diff --git a/src/app/core/data/object-updates/object-updates.effects.ts b/src/app/core/data/object-updates/object-updates.effects.ts index 5ef86dbbec..07f7761076 100644 --- a/src/app/core/data/object-updates/object-updates.effects.ts +++ b/src/app/core/data/object-updates/object-updates.effects.ts @@ -6,7 +6,7 @@ import { } from '@ngrx/effects'; import { Action } from '@ngrx/store'; import { - of as observableOf, + of, race as observableRace, Subject, } from 'rxjs'; @@ -122,7 +122,7 @@ export class ObjectUpdatesEffects { return observableRace( // Either wait for the delay and perform a remove action - observableOf(removeAction).pipe(delay(timeOut)), + of(removeAction).pipe(delay(timeOut)), // Or wait for a a user action this.actionMap$[url].pipe( take(1), diff --git a/src/app/core/data/object-updates/object-updates.service.spec.ts b/src/app/core/data/object-updates/object-updates.service.spec.ts index 6602cda080..24afe87f9a 100644 --- a/src/app/core/data/object-updates/object-updates.service.spec.ts +++ b/src/app/core/data/object-updates/object-updates.service.spec.ts @@ -1,7 +1,7 @@ import { Injector } from '@angular/core'; import { Store } from '@ngrx/store'; import { createMockStore } from '@ngrx/store/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Notification } from '../../../shared/notifications/models/notification.model'; import { NotificationType } from '../../../shared/notifications/models/notification-type'; @@ -60,9 +60,9 @@ describe('ObjectUpdatesService', () => { }); service = new ObjectUpdatesService(store, injector); - spyOn(service as any, 'getObjectEntry').and.returnValue(observableOf(objectEntry)); + spyOn(service as any, 'getObjectEntry').and.returnValue(of(objectEntry)); spyOn(service as any, 'getFieldState').and.callFake((uuid) => { - return observableOf(fieldStates[uuid]); + return of(fieldStates[uuid]); }); spyOn(service as any, 'saveFieldUpdate'); }); @@ -223,7 +223,7 @@ describe('ObjectUpdatesService', () => { }); describe('when updates are emtpy', () => { beforeEach(() => { - (service as any).getObjectEntry.and.returnValue(observableOf({})); + (service as any).getObjectEntry.and.returnValue(of({})); }); it('should return false when there are no updates', () => { @@ -242,7 +242,7 @@ describe('ObjectUpdatesService', () => { describe('when updates are not emtpy', () => { beforeEach(() => { - spyOn(service, 'hasUpdates').and.returnValue(observableOf(true)); + spyOn(service, 'hasUpdates').and.returnValue(of(true)); }); it('should return true', () => { @@ -258,7 +258,7 @@ describe('ObjectUpdatesService', () => { describe('when updates are emtpy', () => { beforeEach(() => { - spyOn(service, 'hasUpdates').and.returnValue(observableOf(false)); + spyOn(service, 'hasUpdates').and.returnValue(of(false)); }); it('should return false', () => { diff --git a/src/app/core/data/primary-bitstream.service.spec.ts b/src/app/core/data/primary-bitstream.service.spec.ts index 6a9c89f796..b9e0634d78 100644 --- a/src/app/core/data/primary-bitstream.service.spec.ts +++ b/src/app/core/data/primary-bitstream.service.spec.ts @@ -1,5 +1,5 @@ import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getMockRemoteDataBuildService } from '../../shared/mocks/remote-data-build.service.mock'; import { getMockRequestService } from '../../shared/mocks/request.service.mock'; @@ -80,7 +80,7 @@ describe('PrimaryBitstreamService', () => { beforeEach(() => { spyOn(service as any, 'getHttpOptions').and.returnValue(options); (requestService.generateRequestId as jasmine.Spy).and.returnValue(testId); - spyOn(rdbService, 'buildFromRequestUUID').and.returnValue(observableOf(testResult)); + spyOn(rdbService, 'buildFromRequestUUID').and.returnValue(of(testResult)); }); it('should return a Request object with the given constructor and the given parameters', () => { @@ -96,7 +96,7 @@ describe('PrimaryBitstreamService', () => { describe('create', () => { const testResult = createSuccessfulRemoteDataObject(new Bundle()); beforeEach(() => { - spyOn((service as any), 'createAndSendRequest').and.returnValue(observableOf(testResult)); + spyOn((service as any), 'createAndSendRequest').and.returnValue(of(testResult)); }); it('should delegate the call to createAndSendRequest', () => { @@ -113,7 +113,7 @@ describe('PrimaryBitstreamService', () => { describe('put', () => { const testResult = createSuccessfulRemoteDataObject(new Bundle()); beforeEach(() => { - spyOn((service as any), 'createAndSendRequest').and.returnValue(observableOf(testResult)); + spyOn((service as any), 'createAndSendRequest').and.returnValue(of(testResult)); }); it('should delegate the call to createAndSendRequest and return the requested bundle', () => { @@ -144,8 +144,8 @@ describe('PrimaryBitstreamService', () => { const bundleServiceResult = createSuccessfulRemoteDataObject(testBundle); beforeEach(() => { - spyOn((service as any), 'createAndSendRequest').and.returnValue(observableOf(testResult)); - (bundleDataService.findByHref as jasmine.Spy).and.returnValue(observableOf(bundleServiceResult)); + spyOn((service as any), 'createAndSendRequest').and.returnValue(of(testResult)); + (bundleDataService.findByHref as jasmine.Spy).and.returnValue(of(bundleServiceResult)); }); it('should delegate the call to createAndSendRequest', () => { @@ -167,8 +167,8 @@ describe('PrimaryBitstreamService', () => { const bundleServiceResult = createSuccessfulRemoteDataObject(testBundle); beforeEach(() => { - spyOn((service as any), 'createAndSendRequest').and.returnValue(observableOf(testResult)); - (bundleDataService.findByHref as jasmine.Spy).and.returnValue(observableOf(bundleServiceResult)); + spyOn((service as any), 'createAndSendRequest').and.returnValue(of(testResult)); + (bundleDataService.findByHref as jasmine.Spy).and.returnValue(of(bundleServiceResult)); }); it('should delegate the call to createAndSendRequest and request the bundle from the bundleDataService', () => { diff --git a/src/app/core/data/relationship-data.service.spec.ts b/src/app/core/data/relationship-data.service.spec.ts index d4a6658f47..89e11e5d81 100644 --- a/src/app/core/data/relationship-data.service.spec.ts +++ b/src/app/core/data/relationship-data.service.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment.test'; @@ -130,11 +130,11 @@ describe('RelationshipDataService', () => { const itemService = jasmine.createSpyObj('itemService', { findById: (uuid) => createSuccessfulRemoteDataObject(relatedItems.find((relatedItem) => relatedItem.id === uuid)), findByHref: createSuccessfulRemoteDataObject$(relatedItems[0]), - getIDHrefObs: (uuid: string) => observableOf(`https://demo.dspace.org/server/api/core/items/${uuid}`), + getIDHrefObs: (uuid: string) => of(`https://demo.dspace.org/server/api/core/items/${uuid}`), }); const getRequestEntry$ = (successful: boolean) => { - return observableOf({ + return of({ response: { isSuccessful: successful, payload: relationships } as any, } as RequestEntry); }; diff --git a/src/app/core/data/relationship-data.service.ts b/src/app/core/data/relationship-data.service.ts index d52c14f0a7..f28c980330 100644 --- a/src/app/core/data/relationship-data.service.ts +++ b/src/app/core/data/relationship-data.service.ts @@ -11,7 +11,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilChanged, @@ -643,7 +643,7 @@ export class RelationshipDataService extends IdentifiableDataService { }); buildList = createSuccessfulRemoteDataObject(createPaginatedList([relationshipType1, relationshipType2])); - rdbService = getMockRemoteDataBuildService(undefined, observableOf(buildList)); + rdbService = getMockRemoteDataBuildService(undefined, of(buildList)); objectCache = new ObjectCacheServiceStub(); } diff --git a/src/app/core/data/request.service.spec.ts b/src/app/core/data/request.service.spec.ts index d8fa04973e..82a3d3aa43 100644 --- a/src/app/core/data/request.service.spec.ts +++ b/src/app/core/data/request.service.spec.ts @@ -19,7 +19,7 @@ import { import { EMPTY, Observable, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -126,7 +126,7 @@ describe('RequestService', () => { describe('isPending', () => { describe('before the request is configured', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf(undefined)); + spyOn(service, 'getByHref').and.returnValue(of(undefined)); }); it('should return false', () => { @@ -139,7 +139,7 @@ describe('RequestService', () => { describe('when the request has been configured but hasn\'t reached the store yet', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf(undefined)); + spyOn(service, 'getByHref').and.returnValue(of(undefined)); serviceAsAny.requestsOnTheirWayToTheStore = [testHref]; }); @@ -153,7 +153,7 @@ describe('RequestService', () => { describe('when the request has reached the store, before the server responds', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf({ + spyOn(service, 'getByHref').and.returnValue(of({ state: RequestEntryState.ResponsePending, } as RequestEntry)); }); @@ -168,7 +168,7 @@ describe('RequestService', () => { describe('after the server responds', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValues(observableOf({ + spyOn(service, 'getByHref').and.returnValues(of({ state: RequestEntryState.Success, } as RequestEntry)); }); @@ -391,7 +391,7 @@ describe('RequestService', () => { describe('and it is cached', () => { describe('in the ObjectCache', () => { beforeEach(() => { - (objectCache.getByHref as any).and.returnValue(observableOf({ requestUUID: 'some-uuid' })); + (objectCache.getByHref as any).and.returnValue(of({ requestUUID: 'some-uuid' })); spyOn(serviceAsAny, 'hasByHref').and.returnValue(false); spyOn(serviceAsAny, 'hasByUUID').and.returnValue(true); }); @@ -400,7 +400,7 @@ describe('RequestService', () => { }); describe('in the request cache', () => { beforeEach(() => { - (objectCache.getByHref as any).and.returnValue(observableOf(undefined)); + (objectCache.getByHref as any).and.returnValue(of(undefined)); spyOn(serviceAsAny, 'hasByHref').and.returnValues(true); spyOn(serviceAsAny, 'hasByUUID').and.returnValue(false); }); @@ -451,7 +451,7 @@ describe('RequestService', () => { describe('and it is cached', () => { describe('in the ObjectCache', () => { beforeEach(() => { - (objectCache.getByHref as any).and.returnValue(observableOf({ requestUUIDs: ['some-uuid'] })); + (objectCache.getByHref as any).and.returnValue(of({ requestUUIDs: ['some-uuid'] })); spyOn(serviceAsAny, 'hasByHref').and.returnValue(false); spyOn(serviceAsAny, 'hasByUUID').and.returnValue(true); }); @@ -465,7 +465,7 @@ describe('RequestService', () => { }); describe('in the request cache', () => { beforeEach(() => { - (objectCache.getByHref as any).and.returnValue(observableOf(undefined)); + (objectCache.getByHref as any).and.returnValue(of(undefined)); spyOn(serviceAsAny, 'hasByHref').and.returnValues(true); spyOn(serviceAsAny, 'hasByUUID').and.returnValue(false); }); @@ -570,7 +570,7 @@ describe('RequestService', () => { describe('when the request is added to the store', () => { it('should stop tracking the request', () => { - spyOn(serviceAsAny, 'getByHref').and.returnValue(observableOf(entry)); + spyOn(serviceAsAny, 'getByHref').and.returnValue(of(entry)); serviceAsAny.trackRequestsOnTheirWayToTheStore(request); expect(serviceAsAny.requestsOnTheirWayToTheStore.includes(request.href)).toBeFalsy(); }); @@ -590,7 +590,7 @@ describe('RequestService', () => { describe('when the RequestEntry is undefined', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf(undefined)); + spyOn(service, 'getByHref').and.returnValue(of(undefined)); }); it('hasByHref should return false', () => { const result = service.hasByHref('', false); @@ -600,7 +600,7 @@ describe('RequestService', () => { describe('when the RequestEntry is not undefined', () => { beforeEach(() => { - spyOn(service, 'getByHref').and.returnValue(observableOf({} as any)); + spyOn(service, 'getByHref').and.returnValue(of({} as any)); }); it('hasByHref should return true', () => { const result = service.hasByHref('', false); @@ -679,13 +679,13 @@ describe('RequestService', () => { }; it(`should call getByHref to retrieve the RequestEntry matching the href`, () => { - spyOn(service, 'getByHref').and.returnValue(observableOf(staleRE)); + spyOn(service, 'getByHref').and.returnValue(of(staleRE)); service.setStaleByHref(href); expect(service.getByHref).toHaveBeenCalledWith(href); }); it(`should dispatch a RequestStaleAction for the RequestEntry returned by getByHref`, (done: DoneFn) => { - spyOn(service, 'getByHref').and.returnValue(observableOf(staleRE)); + spyOn(service, 'getByHref').and.returnValue(of(staleRE)); spyOn(store, 'dispatch'); service.setStaleByHref(href).subscribe(() => { const requestStaleAction = new RequestStaleAction(uuid); diff --git a/src/app/core/data/root-data.service.ts b/src/app/core/data/root-data.service.ts index 7d02fb0060..5c0a97346e 100644 --- a/src/app/core/data/root-data.service.ts +++ b/src/app/core/data/root-data.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { catchError, @@ -39,7 +39,7 @@ export class RootDataService extends BaseDataService { return this.findRoot().pipe( catchError((err: unknown) => { console.error(err); - return observableOf(false); + return of(false); }), getFirstCompletedRemoteData(), map((rootRd: RemoteData) => rootRd.statusCode === 200), diff --git a/src/app/core/data/signposting-data.service.ts b/src/app/core/data/signposting-data.service.ts index d78f75bd11..b6d2422ea9 100644 --- a/src/app/core/data/signposting-data.service.ts +++ b/src/app/core/data/signposting-data.service.ts @@ -4,7 +4,7 @@ import { } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { catchError, @@ -40,7 +40,7 @@ export class SignpostingDataService { return this.restService.get(`${baseUrl}/signposting/links/${uuid}`).pipe( catchError((err: unknown) => { - return observableOf([]); + return of([]); }), map((res: RawRestResponse) => res.statusCode === 200 ? res.payload as SignpostingLink[] : []), ); diff --git a/src/app/core/data/update-data.service.spec.ts b/src/app/core/data/update-data.service.spec.ts index 73ea07b84d..1bcbea8796 100644 --- a/src/app/core/data/update-data.service.spec.ts +++ b/src/app/core/data/update-data.service.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockHrefOnlyDataService } from '../../shared/mocks/href-only-data.service.mock'; @@ -45,7 +45,7 @@ describe('VersionDataService test', () => { const item = Object.assign(new Item(), { id: '1234-1234', uuid: '1234-1234', - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -120,8 +120,8 @@ describe('VersionDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: hot('(a|)', { diff --git a/src/app/core/data/version-data.service.spec.ts b/src/app/core/data/version-data.service.spec.ts index 54af9b8895..f62a3d0577 100644 --- a/src/app/core/data/version-data.service.spec.ts +++ b/src/app/core/data/version-data.service.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockHrefOnlyDataService } from '../../shared/mocks/href-only-data.service.mock'; @@ -38,7 +38,7 @@ describe('VersionDataService test', () => { const item = Object.assign(new Item(), { id: '1234-1234', uuid: '1234-1234', - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -117,8 +117,8 @@ describe('VersionDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: hot('(a|)', { @@ -160,7 +160,7 @@ describe('VersionDataService test', () => { describe('getHistoryIdFromVersion', () => { it('should return the version history id', () => { - spyOn((service as any), 'getHistoryFromVersion').and.returnValue(observableOf(versionHistory)); + spyOn((service as any), 'getHistoryFromVersion').and.returnValue(of(versionHistory)); const result = service.getHistoryIdFromVersion(mockVersion); const expected = cold('(a|)', { diff --git a/src/app/core/data/version-history-data.service.ts b/src/app/core/data/version-history-data.service.ts index e15fcd3907..98afb470f9 100644 --- a/src/app/core/data/version-history-data.service.ts +++ b/src/app/core/data/version-history-data.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import { combineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { filter, @@ -166,7 +166,7 @@ export class VersionHistoryDataService extends IdentifiableDataService res.versionhistory), getFirstSucceededRemoteDataPayload(), switchMap((versionHistoryRD) => this.getLatestVersionFromHistory$(versionHistoryRD)), - ) : observableOf(null); + ) : of(null); } /** @@ -177,8 +177,8 @@ export class VersionHistoryDataService extends IdentifiableDataService { return version ? this.getLatestVersion$(version).pipe( take(1), - switchMap((latestVersion) => observableOf(version.version === latestVersion.version)), - ) : observableOf(null); + switchMap((latestVersion) => of(version.version === latestVersion.version)), + ) : of(null); } /** @@ -202,7 +202,7 @@ export class VersionHistoryDataService extends IdentifiableDataService { const endUserAgreementService = inject(EndUserAgreementService); - return observableOf(endUserAgreementService.isCookieAccepted()); + return of(endUserAgreementService.isCookieAccepted()); }, ); diff --git a/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.spec.ts b/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.spec.ts index ae1f63884f..21963edabd 100644 --- a/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.spec.ts +++ b/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.spec.ts @@ -5,7 +5,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { environment } from '../../../environments/environment.test'; @@ -18,7 +18,7 @@ describe('endUserAgreementGuard', () => { beforeEach(() => { endUserAgreementService = jasmine.createSpyObj('endUserAgreementService', { - hasCurrentUserAcceptedAgreement: observableOf(true), + hasCurrentUserAcceptedAgreement: of(true), }); router = jasmine.createSpyObj('router', { @@ -52,7 +52,7 @@ describe('endUserAgreementGuard', () => { describe('when the user hasn\'t accepted the agreement', () => { beforeEach(() => { - (endUserAgreementService.hasCurrentUserAcceptedAgreement as jasmine.Spy).and.returnValue(observableOf(false)); + (endUserAgreementService.hasCurrentUserAcceptedAgreement as jasmine.Spy).and.returnValue(of(false)); }); it('should return a UrlTree', (done) => { diff --git a/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.ts b/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.ts index 7c190a08b3..5b30542c23 100644 --- a/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.ts +++ b/src/app/core/end-user-agreement/end-user-agreement-current-user.guard.ts @@ -1,6 +1,6 @@ import { inject } from '@angular/core'; import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { environment } from '../../../environments/environment'; import { endUserAgreementGuard } from './end-user-agreement.guard'; @@ -17,7 +17,7 @@ export const endUserAgreementCurrentUserGuard: CanActivateFn = () => { const endUserAgreementService = inject(EndUserAgreementService); if (!environment.info.enableEndUserAgreement) { - return observableOf(true); + return of(true); } return endUserAgreementService.hasCurrentUserAcceptedAgreement(true); diff --git a/src/app/core/end-user-agreement/end-user-agreement.guard.ts b/src/app/core/end-user-agreement/end-user-agreement.guard.ts index 911dd54e25..14d47e49d0 100644 --- a/src/app/core/end-user-agreement/end-user-agreement.guard.ts +++ b/src/app/core/end-user-agreement/end-user-agreement.guard.ts @@ -8,7 +8,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { environment } from '../../../environments/environment'; @@ -25,7 +25,7 @@ export const endUserAgreementGuard = ( return (route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable => { const router = inject(Router); if (!environment.info.enableEndUserAgreement) { - return observableOf(true); + return of(true); } return hasAccepted().pipe( returnEndUserAgreementUrlTreeOnFalse(router, state.url), diff --git a/src/app/core/end-user-agreement/end-user-agreement.service.spec.ts b/src/app/core/end-user-agreement/end-user-agreement.service.spec.ts index 0511fd8b72..e6ddcc48f1 100644 --- a/src/app/core/end-user-agreement/end-user-agreement.service.spec.ts +++ b/src/app/core/end-user-agreement/end-user-agreement.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { CookieServiceMock } from '../../shared/mocks/cookie.service.mock'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; @@ -33,8 +33,8 @@ describe('EndUserAgreementService', () => { cookie = new CookieServiceMock(); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), - getAuthenticatedUserFromStore: observableOf(userWithMetadata), + isAuthenticated: of(true), + getAuthenticatedUserFromStore: of(userWithMetadata), }); ePersonService = jasmine.createSpyObj('ePersonService', { update: createSuccessfulRemoteDataObject$(userWithMetadata), @@ -69,12 +69,12 @@ describe('EndUserAgreementService', () => { describe('when the cookie isn\'t set', () => { describe('and the user is authenticated', () => { beforeEach(() => { - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(true)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(true)); }); describe('and the user contains agreement metadata', () => { beforeEach(() => { - (authService.getAuthenticatedUserFromStore as jasmine.Spy).and.returnValue(observableOf(userWithMetadata)); + (authService.getAuthenticatedUserFromStore as jasmine.Spy).and.returnValue(of(userWithMetadata)); }); it('hasCurrentUserOrCookieAcceptedAgreement should return true', (done) => { @@ -87,7 +87,7 @@ describe('EndUserAgreementService', () => { describe('and the user doesn\'t contain agreement metadata', () => { beforeEach(() => { - (authService.getAuthenticatedUserFromStore as jasmine.Spy).and.returnValue(observableOf(userWithoutMetadata)); + (authService.getAuthenticatedUserFromStore as jasmine.Spy).and.returnValue(of(userWithoutMetadata)); }); it('hasCurrentUserOrCookieAcceptedAgreement should return false', (done) => { @@ -108,7 +108,7 @@ describe('EndUserAgreementService', () => { describe('and the user is not authenticated', () => { beforeEach(() => { - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false)); }); it('hasCurrentUserOrCookieAcceptedAgreement should return false', (done) => { diff --git a/src/app/core/end-user-agreement/end-user-agreement.service.ts b/src/app/core/end-user-agreement/end-user-agreement.service.ts index 9263397f21..127ed8ab85 100644 --- a/src/app/core/end-user-agreement/end-user-agreement.service.ts +++ b/src/app/core/end-user-agreement/end-user-agreement.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -36,7 +36,7 @@ export class EndUserAgreementService { */ hasCurrentUserOrCookieAcceptedAgreement(acceptedWhenAnonymous: boolean): Observable { if (this.isCookieAccepted()) { - return observableOf(true); + return of(true); } else { return this.hasCurrentUserAcceptedAgreement(acceptedWhenAnonymous); } @@ -55,7 +55,7 @@ export class EndUserAgreementService { map((user) => hasValue(user) && user.hasMetadata(END_USER_AGREEMENT_METADATA_FIELD) && user.firstMetadata(END_USER_AGREEMENT_METADATA_FIELD).value === 'true'), ); } else { - return observableOf(acceptedWhenAnonymous); + return of(acceptedWhenAnonymous); } }), ); @@ -88,7 +88,7 @@ export class EndUserAgreementService { ); } else { this.setCookieAccepted(accepted); - return observableOf(true); + return of(true); } }), take(1), diff --git a/src/app/core/eperson/eperson-data.service.spec.ts b/src/app/core/eperson/eperson-data.service.spec.ts index f3209cd34c..620ca190b2 100644 --- a/src/app/core/eperson/eperson-data.service.spec.ts +++ b/src/app/core/eperson/eperson-data.service.spec.ts @@ -15,7 +15,7 @@ import { Operation, } from 'fast-json-patch'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { EPeopleRegistryCancelEPersonAction, @@ -316,7 +316,7 @@ describe('EPersonDataService', () => { describe('clearEPersonRequests', () => { beforeEach(() => { spyOn(halService, 'getEndpoint').and.callFake((linkPath: string) => { - return observableOf(`${restEndpointURL}/${linkPath}`); + return of(`${restEndpointURL}/${linkPath}`); }); }); it('should remove the eperson hrefs in the request service', fakeAsync(() => { diff --git a/src/app/core/eperson/group-data.service.spec.ts b/src/app/core/eperson/group-data.service.spec.ts index 5a4ec018f0..548eba7b30 100644 --- a/src/app/core/eperson/group-data.service.spec.ts +++ b/src/app/core/eperson/group-data.service.spec.ts @@ -15,7 +15,7 @@ import { compare, Operation, } from 'fast-json-patch'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { GroupRegistryCancelGroupAction, @@ -159,7 +159,7 @@ describe('GroupDataService', () => { describe('addSubGroupToGroup', () => { beforeEach(() => { - objectCache.getByHref.and.returnValue(observableOf({ + objectCache.getByHref.and.returnValue(of({ requestUUIDs: ['request1', 'request2'], dependentRequestUUIDs: [], } as ObjectCacheEntry)); @@ -189,7 +189,7 @@ describe('GroupDataService', () => { describe('deleteSubGroupFromGroup', () => { beforeEach(() => { - objectCache.getByHref.and.returnValue(observableOf({ + objectCache.getByHref.and.returnValue(of({ requestUUIDs: ['request1', 'request2'], dependentRequestUUIDs: [], } as ObjectCacheEntry)); @@ -215,7 +215,7 @@ describe('GroupDataService', () => { describe('addMemberToGroup', () => { beforeEach(() => { - objectCache.getByHref.and.returnValue(observableOf({ + objectCache.getByHref.and.returnValue(of({ requestUUIDs: ['request1', 'request2'], dependentRequestUUIDs: [], } as ObjectCacheEntry)); @@ -244,7 +244,7 @@ describe('GroupDataService', () => { describe('deleteMemberFromGroup', () => { beforeEach(() => { - objectCache.getByHref.and.returnValue(observableOf({ + objectCache.getByHref.and.returnValue(of({ requestUUIDs: ['request1', 'request2'], dependentRequestUUIDs: [], } as ObjectCacheEntry)); diff --git a/src/app/core/google-recaptcha/google-recaptcha.service.spec.ts b/src/app/core/google-recaptcha/google-recaptcha.service.spec.ts index 94b03bba46..658d475212 100644 --- a/src/app/core/google-recaptcha/google-recaptcha.service.spec.ts +++ b/src/app/core/google-recaptcha/google-recaptcha.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { NativeWindowRef } from '../services/window.service'; @@ -23,7 +23,7 @@ describe('GoogleRecaptchaService', () => { function init() { window = new NativeWindowRef(); rendererFactory2 = jasmine.createSpyObj('rendererFactory2', { - createRenderer: observableOf('googleRecaptchaToken'), + createRenderer: of('googleRecaptchaToken'), createElement: scriptElementMock, }); configurationDataService = jasmine.createSpyObj('configurationDataService', { diff --git a/src/app/core/json-patch/json-patch-operations.effects.spec.ts b/src/app/core/json-patch/json-patch-operations.effects.spec.ts index d43fb0edd1..cbadf7fbd3 100644 --- a/src/app/core/json-patch/json-patch-operations.effects.spec.ts +++ b/src/app/core/json-patch/json-patch-operations.effects.spec.ts @@ -7,7 +7,7 @@ import { } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -24,7 +24,7 @@ describe('JsonPatchOperationsEffects test suite', () => { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - select: observableOf(true), + select: of(true), }); const testJsonPatchResourceType = 'testResourceType'; const testJsonPatchResourceId = 'testResourceId'; diff --git a/src/app/core/json-patch/json-patch-operations.service.spec.ts b/src/app/core/json-patch/json-patch-operations.service.spec.ts index e1c6e79d10..83da82612b 100644 --- a/src/app/core/json-patch/json-patch-operations.service.spec.ts +++ b/src/app/core/json-patch/json-patch-operations.service.spec.ts @@ -4,7 +4,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; @@ -95,7 +95,7 @@ describe('JsonPatchOperationsService test suite', () => { }]; const getRequestEntry$ = (successful: boolean) => { - return observableOf({ + return of({ response: { isSuccessful: successful, timeCompleted: timestampResponse } as any, } as RequestEntry); }; @@ -113,20 +113,20 @@ describe('JsonPatchOperationsService test suite', () => { function getStore() { return jasmine.createSpyObj('store', { dispatch: {}, - select: observableOf(mockState['json/patch'][testJsonPatchResourceType]), - pipe: observableOf(true), + select: of(mockState['json/patch'][testJsonPatchResourceType]), + pipe: of(true), }); } function spyOnRdbServiceAndReturnSuccessfulRemoteData() { spyOn(rdbService, 'buildFromRequestUUID').and.returnValue( - observableOf(Object.assign(createSuccessfulRemoteDataObject({ dataDefinition: 'test' }), { timeCompleted: new Date().getTime() + 10000 })), + of(Object.assign(createSuccessfulRemoteDataObject({ dataDefinition: 'test' }), { timeCompleted: new Date().getTime() + 10000 })), ); } function spyOnRdbServiceAndReturnFailedRemoteData() { spyOn(rdbService, 'buildFromRequestUUID').and.returnValue( - observableOf(Object.assign(createFailedRemoteDataObject('Error', 500), { timeCompleted: new Date().getTime() + 10000 })), + of(Object.assign(createFailedRemoteDataObject('Error', 500), { timeCompleted: new Date().getTime() + 10000 })), ); } @@ -191,7 +191,7 @@ describe('JsonPatchOperationsService test suite', () => { service = initTestService(); spyOnRdbServiceAndReturnFailedRemoteData(); - store.select.and.returnValue(observableOf(mockState['json/patch'][testJsonPatchResourceType])); + store.select.and.returnValue(of(mockState['json/patch'][testJsonPatchResourceType])); store.dispatch.and.callThrough(); }); @@ -199,7 +199,7 @@ describe('JsonPatchOperationsService test suite', () => { const expectedAction = new RollbacktPatchOperationsAction(testJsonPatchResourceType, undefined); scheduler.schedule(() => service.jsonPatchByResourceType(resourceEndpoint, resourceScope, testJsonPatchResourceType) - .pipe(catchError(() => observableOf({}))) + .pipe(catchError(() => of({}))) .subscribe()); scheduler.flush(); @@ -223,7 +223,7 @@ describe('JsonPatchOperationsService test suite', () => { const mockStateNoOp = deepClone(mockState); mockStateNoOp['json/patch'][testJsonPatchResourceType].children = []; - store.select.and.returnValue(observableOf(mockStateNoOp['json/patch'][testJsonPatchResourceType])); + store.select.and.returnValue(of(mockStateNoOp['json/patch'][testJsonPatchResourceType])); const expected = hot('(x|)', { x: false }); @@ -281,7 +281,7 @@ describe('JsonPatchOperationsService test suite', () => { service = initTestService(); spyOnRdbServiceAndReturnFailedRemoteData(); - store.select.and.returnValue(observableOf(mockState['json/patch'][testJsonPatchResourceType])); + store.select.and.returnValue(of(mockState['json/patch'][testJsonPatchResourceType])); store.dispatch.and.callThrough(); }); @@ -289,7 +289,7 @@ describe('JsonPatchOperationsService test suite', () => { const expectedAction = new RollbacktPatchOperationsAction(testJsonPatchResourceType, testJsonPatchResourceId); scheduler.schedule(() => service.jsonPatchByResourceID(resourceEndpoint, resourceScope, testJsonPatchResourceType, testJsonPatchResourceId) - .pipe(catchError(() => observableOf({}))) + .pipe(catchError(() => of({}))) .subscribe()); scheduler.flush(); diff --git a/src/app/core/locale/locale.service.ts b/src/app/core/locale/locale.service.ts index 0c54ce8412..effc0c3e2e 100644 --- a/src/app/core/locale/locale.service.ts +++ b/src/app/core/locale/locale.service.ts @@ -7,7 +7,7 @@ import { TranslateService } from '@ngx-translate/core'; import { combineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -95,7 +95,7 @@ export class LocaleService { take(1), mergeMap(([isAuthenticated, isLoaded]) => { // TODO to enabled again when https://github.com/DSpace/dspace-angular/issues/739 will be resolved - const epersonLang$: Observable = observableOf([]); + const epersonLang$: Observable = of([]); /* if (isAuthenticated && isLoaded) { epersonLang$ = this.authService.getAuthenticatedUserFromStore().pipe( take(1), diff --git a/src/app/core/locale/server-locale.service.ts b/src/app/core/locale/server-locale.service.ts index 12358595d1..976da6c050 100644 --- a/src/app/core/locale/server-locale.service.ts +++ b/src/app/core/locale/server-locale.service.ts @@ -7,7 +7,7 @@ import { TranslateService } from '@ngx-translate/core'; import { combineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -62,7 +62,7 @@ export class ServerLocaleService extends LocaleService { return obs$.pipe( take(1), mergeMap(([isAuthenticated, isLoaded]) => { - let epersonLang$: Observable = observableOf([]); + let epersonLang$: Observable = of([]); if (isAuthenticated && isLoaded) { epersonLang$ = this.authService.getAuthenticatedUserFromStore().pipe( take(1), diff --git a/src/app/core/metadata/head-tag.service.spec.ts b/src/app/core/metadata/head-tag.service.spec.ts index 2fbae88f12..aec92535ce 100644 --- a/src/app/core/metadata/head-tag.service.spec.ts +++ b/src/app/core/metadata/head-tag.service.spec.ts @@ -14,7 +14,6 @@ import { createMockStore } from '@ngrx/store/testing'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, of, } from 'rxjs'; @@ -99,7 +98,7 @@ describe('HeadTagService', () => { getCurrentOrigin: 'https://request.org', }); authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); store = createMockStore({ initialState }); @@ -351,7 +350,7 @@ describe('HeadTagService', () => { describe('bitstream not download allowed', () => { it('should not have citation_pdf_url', fakeAsync(() => { (bundleDataService.findByItemAndName as jasmine.Spy).and.returnValue(mockBundleRD$([MockBitstream3])); - (authorizationService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); (headTagService as any).processRouteChange({ data: { diff --git a/src/app/core/metadata/head-tag.service.ts b/src/app/core/metadata/head-tag.service.ts index d52efb8fa1..118f4efa82 100644 --- a/src/app/core/metadata/head-tag.service.ts +++ b/src/app/core/metadata/head-tag.service.ts @@ -24,7 +24,7 @@ import { concat as observableConcat, EMPTY, Observable, - of as observableOf, + of, } from 'rxjs'; import { filter, @@ -403,7 +403,7 @@ export class HeadTagService { } getBitLinkIfDownloadable(bitstream: Bitstream, bitstreamRd: RemoteData>): Observable { - return observableOf(bitstream).pipe( + return of(bitstream).pipe( getDownloadableBitstream(this.authorizationService), switchMap((bit: Bitstream) => { if (hasValue(bit)) { @@ -440,7 +440,7 @@ export class HeadTagService { )), ).pipe( // Verify that the bitstream is downloadable - mergeMap(([bitstream, format]: [Bitstream, BitstreamFormat]) => observableOf(bitstream).pipe( + mergeMap(([bitstream, format]: [Bitstream, BitstreamFormat]) => of(bitstream).pipe( getDownloadableBitstream(this.authorizationService), map((bit: Bitstream) => [bit, format]), )), diff --git a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts index c981afbe57..7cdd55a86f 100644 --- a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts +++ b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts @@ -4,7 +4,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { @@ -124,9 +124,9 @@ describe('QualityAssuranceEventDataService', () => { describe('getEventsByTopic', () => { beforeEach(() => { - serviceASAny.requestService.getByHref.and.returnValue(observableOf(responseCacheEntry)); - serviceASAny.requestService.getByUUID.and.returnValue(observableOf(responseCacheEntry)); - serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(observableOf(qaEventObjectRD)); + serviceASAny.requestService.getByHref.and.returnValue(of(responseCacheEntry)); + serviceASAny.requestService.getByUUID.and.returnValue(of(responseCacheEntry)); + serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(of(qaEventObjectRD)); }); it('should proxy the call to searchData.searchBy', () => { @@ -150,9 +150,9 @@ describe('QualityAssuranceEventDataService', () => { describe('getEvent', () => { beforeEach(() => { - serviceASAny.requestService.getByHref.and.returnValue(observableOf(responseCacheEntry)); - serviceASAny.requestService.getByUUID.and.returnValue(observableOf(responseCacheEntry)); - serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(observableOf(qaEventObjectRD)); + serviceASAny.requestService.getByHref.and.returnValue(of(responseCacheEntry)); + serviceASAny.requestService.getByUUID.and.returnValue(of(responseCacheEntry)); + serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(of(qaEventObjectRD)); }); it('should call findById', () => { @@ -174,10 +174,10 @@ describe('QualityAssuranceEventDataService', () => { describe('patchEvent', () => { beforeEach(() => { - serviceASAny.requestService.getByHref.and.returnValue(observableOf(responseCacheEntry)); - serviceASAny.requestService.getByUUID.and.returnValue(observableOf(responseCacheEntry)); - serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(observableOf(qaEventObjectRD)); - serviceASAny.rdbService.buildFromRequestUUIDAndAwait.and.returnValue(observableOf(qaEventObjectRD)); + serviceASAny.requestService.getByHref.and.returnValue(of(responseCacheEntry)); + serviceASAny.requestService.getByUUID.and.returnValue(of(responseCacheEntry)); + serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(of(qaEventObjectRD)); + serviceASAny.rdbService.buildFromRequestUUIDAndAwait.and.returnValue(of(qaEventObjectRD)); }); it('should proxy the call to patchData.patch', () => { @@ -199,9 +199,9 @@ describe('QualityAssuranceEventDataService', () => { describe('boundProject', () => { beforeEach(() => { - serviceASAny.requestService.getByHref.and.returnValue(observableOf(responseCacheEntryB)); - serviceASAny.requestService.getByUUID.and.returnValue(observableOf(responseCacheEntryB)); - serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(observableOf(qaEventObjectMissingProjectRD)); + serviceASAny.requestService.getByHref.and.returnValue(of(responseCacheEntryB)); + serviceASAny.requestService.getByUUID.and.returnValue(of(responseCacheEntryB)); + serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(of(qaEventObjectMissingProjectRD)); }); it('should call postOnRelated', () => { @@ -223,9 +223,9 @@ describe('QualityAssuranceEventDataService', () => { describe('removeProject', () => { beforeEach(() => { - serviceASAny.requestService.getByHref.and.returnValue(observableOf(responseCacheEntryC)); - serviceASAny.requestService.getByUUID.and.returnValue(observableOf(responseCacheEntryC)); - serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(observableOf(createSuccessfulRemoteDataObject({}))); + serviceASAny.requestService.getByHref.and.returnValue(of(responseCacheEntryC)); + serviceASAny.requestService.getByUUID.and.returnValue(of(responseCacheEntryC)); + serviceASAny.rdbService.buildFromRequestUUID.and.returnValue(of(createSuccessfulRemoteDataObject({}))); }); it('should call deleteOnRelated', () => { diff --git a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts index 0fca119e8b..25e625f88e 100644 --- a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts +++ b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts @@ -3,7 +3,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { @@ -53,8 +53,8 @@ describe('QualityAssuranceSourceDataService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { diff --git a/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.spec.ts b/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.spec.ts index ede1563c30..03463adcb6 100644 --- a/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.spec.ts +++ b/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.spec.ts @@ -3,7 +3,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { @@ -53,8 +53,8 @@ describe('QualityAssuranceTopicDataService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { diff --git a/src/app/core/notifications/suggestions/source/suggestion-source-data.service.spec.ts b/src/app/core/notifications/suggestions/source/suggestion-source-data.service.spec.ts index b5c7158979..42fc9e7774 100644 --- a/src/app/core/notifications/suggestions/source/suggestion-source-data.service.spec.ts +++ b/src/app/core/notifications/suggestions/source/suggestion-source-data.service.spec.ts @@ -4,7 +4,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; @@ -73,12 +73,12 @@ describe('SuggestionSourceDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(endpointURL), + getEndpoint: of(endpointURL), }); rdbService = jasmine.createSpyObj('rdbService', { diff --git a/src/app/core/notifications/suggestions/suggestion-data.service.spec.ts b/src/app/core/notifications/suggestions/suggestion-data.service.spec.ts index 5b3bf0b0ae..7ed80bdbce 100644 --- a/src/app/core/notifications/suggestions/suggestion-data.service.spec.ts +++ b/src/app/core/notifications/suggestions/suggestion-data.service.spec.ts @@ -3,7 +3,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; @@ -64,13 +64,13 @@ describe('SuggestionDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), - setStaleByHrefSubstring: observableOf(true), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), + setStaleByHrefSubstring: of(true), }); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(endpointURL), + getEndpoint: of(endpointURL), }); rdbService = jasmine.createSpyObj('rdbService', { @@ -83,7 +83,7 @@ describe('SuggestionDataService test', () => { describe('Suggestion service', () => { it('should call suggestionsDataService.searchBy', () => { - spyOn((service as any).searchData, 'searchBy').and.returnValue(observableOf(null)); + spyOn((service as any).searchData, 'searchBy').and.returnValue(of(null)); const options = { searchParams: [new RequestParam('target', testUserId), new RequestParam('source', testSource)], }; @@ -92,7 +92,7 @@ describe('SuggestionDataService test', () => { }); it('should call suggestionsDataService.delete', () => { - spyOn((service as any).deleteData, 'delete').and.returnValue(observableOf(null)); + spyOn((service as any).deleteData, 'delete').and.returnValue(of(null)); service.deleteSuggestion('1'); expect((service as any).deleteData.delete).toHaveBeenCalledWith('1'); }); diff --git a/src/app/core/notifications/suggestions/target/suggestion-target-data.service.spec.ts b/src/app/core/notifications/suggestions/target/suggestion-target-data.service.spec.ts index 6aa5aad3ea..b88513abe3 100644 --- a/src/app/core/notifications/suggestions/target/suggestion-target-data.service.spec.ts +++ b/src/app/core/notifications/suggestions/target/suggestion-target-data.service.spec.ts @@ -4,7 +4,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; @@ -76,12 +76,12 @@ describe('SuggestionTargetDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(endpointURL), + getEndpoint: of(endpointURL), }); rdbService = jasmine.createSpyObj('rdbService', { diff --git a/src/app/core/pagination/pagination.service.spec.ts b/src/app/core/pagination/pagination.service.spec.ts index e9c75703b1..529317c7f2 100644 --- a/src/app/core/pagination/pagination.service.spec.ts +++ b/src/app/core/pagination/pagination.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { RouterStub } from '../../shared/testing/router.stub'; @@ -36,7 +36,7 @@ describe('PaginationService', () => { if (param.endsWith('.sf')) { value = 'score'; } - return observableOf(value); + return of(value); }, }; @@ -70,7 +70,7 @@ describe('PaginationService', () => { if (param.endsWith('.rpp')) { value = 10; } - return observableOf(value); + return of(value); }, }; service = new PaginationService(routeService, router); diff --git a/src/app/core/profile/researcher-profile-data.service.spec.ts b/src/app/core/profile/researcher-profile-data.service.spec.ts index ccaa7063dd..712bb1850f 100644 --- a/src/app/core/profile/researcher-profile-data.service.spec.ts +++ b/src/app/core/profile/researcher-profile-data.service.spec.ts @@ -8,7 +8,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { RouterMock } from '../../shared/mocks/router.mock'; @@ -233,8 +233,8 @@ describe('ResearcherProfileService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), setStaleByHrefSubstring: jasmine.createSpy('setStaleByHrefSubstring'), }); rdbService = jasmine.createSpyObj('rdbService', { @@ -271,7 +271,7 @@ describe('ResearcherProfileService', () => { spyOn((service as any), 'findById').and.callThrough(); spyOn((service as any), 'findByHref').and.callThrough(); - spyOn((service as any), 'getLinkPath').and.returnValue(observableOf(endpointURL)); + spyOn((service as any), 'getLinkPath').and.returnValue(of(endpointURL)); spyOn((service as any).createData, 'create').and.callThrough(); spyOn((service as any).patchData, 'update').and.callThrough(); spyOn((service as any).searchData, 'searchBy').and.callThrough(); diff --git a/src/app/core/profile/researcher-profile-data.service.ts b/src/app/core/profile/researcher-profile-data.service.ts index 1fd219423f..cb8631c1b7 100644 --- a/src/app/core/profile/researcher-profile-data.service.ts +++ b/src/app/core/profile/researcher-profile-data.service.ts @@ -7,7 +7,7 @@ import { } from 'fast-json-patch'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { find, @@ -167,7 +167,7 @@ export class ResearcherProfileDataService extends IdentifiableDataService { findById: createSuccessfulRemoteDataObject$(mockSchemasList[0]), createOrUpdateMetadataSchema: createSuccessfulRemoteDataObject$(mockSchemasList[0]), delete: createNoContentRemoteDataObject$(), - clearRequests: observableOf('href'), + clearRequests: of('href'), }); metadataFieldService = jasmine.createSpyObj('metadataFieldService', { @@ -151,7 +151,7 @@ describe('RegistryService', () => { create: createSuccessfulRemoteDataObject$(mockFieldsList[0]), put: createSuccessfulRemoteDataObject$(mockFieldsList[0]), delete: createNoContentRemoteDataObject$(), - clearRequests: observableOf('href'), + clearRequests: of('href'), }); } diff --git a/src/app/core/resource-policy/resource-policy-data.service.spec.ts b/src/app/core/resource-policy/resource-policy-data.service.spec.ts index 1af36c1254..ca633bdb82 100644 --- a/src/app/core/resource-policy/resource-policy-data.service.spec.ts +++ b/src/app/core/resource-policy/resource-policy-data.service.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -113,8 +113,8 @@ describe('ResourcePolicyService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), setStaleByHrefSubstring: {}, }); rdbService = jasmine.createSpyObj('rdbService', { @@ -161,12 +161,12 @@ describe('ResourcePolicyService', () => { spyOn(service, 'findById').and.callThrough(); spyOn(service, 'findByHref').and.callThrough(); - spyOn(service, 'invalidateByHref').and.returnValue(observableOf(true)); + spyOn(service, 'invalidateByHref').and.returnValue(of(true)); spyOn((service as any).createData, 'create').and.callThrough(); spyOn((service as any).deleteData, 'delete').and.callThrough(); spyOn((service as any).patchData, 'update').and.callThrough(); spyOn((service as any).searchData, 'searchBy').and.callThrough(); - spyOn((service as any).searchData, 'getSearchByHref').and.returnValue(observableOf(requestURL)); + spyOn((service as any).searchData, 'getSearchByHref').and.returnValue(of(requestURL)); }); describe('create', () => { diff --git a/src/app/core/rest-property/forgot-password-check-guard.guard.ts b/src/app/core/rest-property/forgot-password-check-guard.guard.ts index 49727dda11..4cd81f7a1e 100644 --- a/src/app/core/rest-property/forgot-password-check-guard.guard.ts +++ b/src/app/core/rest-property/forgot-password-check-guard.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { singleFeatureAuthorizationGuard } from '../data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard'; import { FeatureID } from '../data/feature-authorization/feature-id'; @@ -8,4 +8,4 @@ import { FeatureID } from '../data/feature-authorization/feature-id'; * Guard that checks if the forgot-password feature is enabled */ export const forgotPasswordCheckGuard: CanActivateFn = - singleFeatureAuthorizationGuard(() => observableOf(FeatureID.EPersonForgotPassword)); + singleFeatureAuthorizationGuard(() => of(FeatureID.EPersonForgotPassword)); diff --git a/src/app/core/roles/role.service.ts b/src/app/core/roles/role.service.ts index 74f318222a..365a5cbbb3 100644 --- a/src/app/core/roles/role.service.ts +++ b/src/app/core/roles/role.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilChanged } from 'rxjs/operators'; @@ -36,7 +36,7 @@ export class RoleService { */ isController(): Observable { // TODO find a way to check if user is a controller - return observableOf(true); + return of(true); } /** @@ -44,7 +44,7 @@ export class RoleService { */ isAdmin(): Observable { // TODO find a way to check if user is an admin - return observableOf(false); + return of(false); } /** diff --git a/src/app/core/services/browser.referrer.service.spec.ts b/src/app/core/services/browser.referrer.service.spec.ts index 90ce43c995..607eea37ba 100644 --- a/src/app/core/services/browser.referrer.service.spec.ts +++ b/src/app/core/services/browser.referrer.service.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { BrowserReferrerService } from './browser.referrer.service'; import { RouteService } from './route.service'; @@ -11,7 +11,7 @@ describe(`BrowserReferrerService`, () => { beforeEach(() => { routeService = { - getHistory: () => observableOf([]), + getHistory: () => of([]), } as any; service = new BrowserReferrerService( { referrer: documentReferrer }, @@ -23,7 +23,7 @@ describe(`BrowserReferrerService`, () => { describe(`getReferrer`, () => { describe(`when the history is an empty`, () => { beforeEach(() => { - spyOn(routeService, 'getHistory').and.returnValue(observableOf([])); + spyOn(routeService, 'getHistory').and.returnValue(of([])); }); it(`should return document.referrer`, (done: DoneFn) => { @@ -36,7 +36,7 @@ describe(`BrowserReferrerService`, () => { describe(`when the history only contains the current route`, () => { beforeEach(() => { - spyOn(routeService, 'getHistory').and.returnValue(observableOf(['/current/route'])); + spyOn(routeService, 'getHistory').and.returnValue(of(['/current/route'])); }); it(`should return document.referrer`, (done: DoneFn) => { @@ -50,7 +50,7 @@ describe(`BrowserReferrerService`, () => { describe(`when the history contains multiple routes`, () => { const prevUrl = '/the/route/we/need'; beforeEach(() => { - spyOn(routeService, 'getHistory').and.returnValue(observableOf([ + spyOn(routeService, 'getHistory').and.returnValue(of([ '/first/route', '/second/route', prevUrl, diff --git a/src/app/core/services/route.service.spec.ts b/src/app/core/services/route.service.spec.ts index 2f69156cbc..6beadaf5da 100644 --- a/src/app/core/services/route.service.spec.ts +++ b/src/app/core/services/route.service.spec.ts @@ -14,7 +14,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { take } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; @@ -151,7 +151,7 @@ describe('RouteService', () => { describe('getHistory', () => { it('should dispatch AddUrlToHistoryAction on NavigationEnd event', () => { - serviceAsAny.store = observableOf({ + serviceAsAny.store = of({ core: { history: ['url', 'newurl'], }, @@ -165,7 +165,7 @@ describe('RouteService', () => { describe('getCurrentUrl', () => { it('should return an observable with the current url', () => { - serviceAsAny.store = observableOf({ + serviceAsAny.store = of({ core: { history: ['url', 'newurl'], }, @@ -179,7 +179,7 @@ describe('RouteService', () => { describe('getCurrentUrl', () => { it('should return an observable with the previous url', () => { - serviceAsAny.store = observableOf({ + serviceAsAny.store = of({ core: { history: ['url', 'newurl'], }, diff --git a/src/app/core/services/server.referrer.service.ts b/src/app/core/services/server.referrer.service.ts index 70b0e806c8..e8fc62f0c8 100644 --- a/src/app/core/services/server.referrer.service.ts +++ b/src/app/core/services/server.referrer.service.ts @@ -4,7 +4,7 @@ import { } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { REQUEST } from '../../../express.tokens'; @@ -33,6 +33,6 @@ export class ServerReferrerService extends ReferrerService { */ public getReferrer(): Observable { const referrer = this.request.headers.referer || ''; - return observableOf(referrer); + return of(referrer); } } diff --git a/src/app/core/shared/bitstream.operators.ts b/src/app/core/shared/bitstream.operators.ts index c62def49b2..f34ec279b3 100644 --- a/src/app/core/shared/bitstream.operators.ts +++ b/src/app/core/shared/bitstream.operators.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -25,7 +25,7 @@ export const getDownloadableBitstream = (authService: AuthorizationDataService) return canDownload ? bit : null; })); } else { - return observableOf(null); + return of(null); } }), ); diff --git a/src/app/core/shared/hal-endpoint.service.spec.ts b/src/app/core/shared/hal-endpoint.service.spec.ts index ec0379137b..e2677c2f1a 100644 --- a/src/app/core/shared/hal-endpoint.service.spec.ts +++ b/src/app/core/shared/hal-endpoint.service.spec.ts @@ -1,6 +1,6 @@ import { combineLatest as observableCombineLatest, - of as observableOf, + of, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -177,7 +177,7 @@ describe('HALEndpointService', () => { }); it('should be at least called as many times as the length of halNames', () => { - spyOn(service as any, 'getEndpointMapAt').and.returnValue(observableOf(endpointMap)); + spyOn(service as any, 'getEndpointMapAt').and.returnValue(of(endpointMap)); spyOn((service as any), 'getEndpointAt').and.callThrough(); (service as any).getEndpointAt('', 'endpoint').subscribe(); @@ -199,7 +199,7 @@ describe('HALEndpointService', () => { it('should return the correct endpoint', (done) => { spyOn(service as any, 'getEndpointMapAt').and.callFake((param) => { - return observableOf(endpointMaps[param]); + return of(endpointMaps[param]); }); observableCombineLatest([ diff --git a/src/app/core/shared/operators.spec.ts b/src/app/core/shared/operators.spec.ts index 07ba82caba..32b8c8ec78 100644 --- a/src/app/core/shared/operators.spec.ts +++ b/src/app/core/shared/operators.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockRequestService } from '../../shared/mocks/request.service.mock'; @@ -192,7 +192,7 @@ describe('Core Module - RxJS Operators', () => { }); router = jasmine.createSpyObj('router', ['navigateByUrl']); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); }); @@ -264,7 +264,7 @@ describe('Core Module - RxJS Operators', () => { describe('when the user is not authenticated', () => { beforeEach(() => { - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false)); }); it('should set the redirect url and navigate to login when the remote data contains a 401 error, and not emit anything', () => { diff --git a/src/app/core/shared/search/search-configuration.service.spec.ts b/src/app/core/shared/search/search-configuration.service.spec.ts index d56ee8f756..2cafd67cfe 100644 --- a/src/app/core/shared/search/search-configuration.service.spec.ts +++ b/src/app/core/shared/search/search-configuration.service.spec.ts @@ -3,7 +3,7 @@ import { Params } from '@angular/router'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -47,11 +47,11 @@ describe('SearchConfigurationService', () => { ]; const routeService = jasmine.createSpyObj('RouteService', { - getQueryParameterValue: observableOf(value1), - getQueryParamsWithPrefix: observableOf(prefixFilter), - getRouteParameterValue: observableOf(''), - getParamsExceptValue: observableOf({}), - getParamsWithAdditionalValue: observableOf({}), + getQueryParameterValue: of(value1), + getQueryParamsWithPrefix: of(prefixFilter), + getRouteParameterValue: of(''), + getParamsExceptValue: of({}), + getParamsWithAdditionalValue: of({}), }); let paginationService: PaginationServiceStub; @@ -215,7 +215,7 @@ describe('SearchConfigurationService', () => { const scope = 'test'; const requestUrl = endPoint + '?scope=' + scope; beforeEach(() => { - spyOn((service as any).halService, 'getEndpoint').and.returnValue(observableOf(endPoint)); + spyOn((service as any).halService, 'getEndpoint').and.returnValue(of(endPoint)); service.getSearchConfigurationFor(scope).subscribe((t) => { }); // subscribe to make sure all methods are called }); @@ -236,7 +236,7 @@ describe('SearchConfigurationService', () => { describe('when getSearchConfigurationFor is called without a scope', () => { const endPoint = 'http://endpoint.com/test/config'; beforeEach(() => { - spyOn((service as any).halService, 'getEndpoint').and.returnValue(observableOf(endPoint)); + spyOn((service as any).halService, 'getEndpoint').and.returnValue(of(endPoint)); spyOn((service as any).rdb, 'buildFromHref').and.callThrough(); service.getSearchConfigurationFor(null).subscribe((t) => { }); // subscribe to make sure all methods are called @@ -257,7 +257,7 @@ describe('SearchConfigurationService', () => { describe('when getConfig is called without a scope', () => { const endPoint = 'http://endpoint.com/test/config'; beforeEach(() => { - spyOn((service as any).halService, 'getEndpoint').and.returnValue(observableOf(endPoint)); + spyOn((service as any).halService, 'getEndpoint').and.returnValue(of(endPoint)); spyOn((service as any).rdb, 'buildFromHref').and.callThrough(); service.getConfig(null).subscribe((t) => { }); // subscribe to make sure all methods are called @@ -281,7 +281,7 @@ describe('SearchConfigurationService', () => { const scope = 'test'; const requestUrl = endPoint + '?scope=' + scope; beforeEach(() => { - spyOn((service as any).halService, 'getEndpoint').and.returnValue(observableOf(endPoint)); + spyOn((service as any).halService, 'getEndpoint').and.returnValue(of(endPoint)); service.getConfig(scope).subscribe((t) => { }); // subscribe to make sure all methods are called }); diff --git a/src/app/core/shared/search/search-filter.service.spec.ts b/src/app/core/shared/search/search-filter.service.spec.ts index 4a7243de95..57ddc5eed0 100644 --- a/src/app/core/shared/search/search-filter.service.spec.ts +++ b/src/app/core/shared/search/search-filter.service.spec.ts @@ -3,7 +3,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { Store } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FilterType } from '../../../shared/search/models/filter-type.model'; import { SearchFilterConfig } from '../../../shared/search/models/search-filter-config.model'; @@ -46,7 +46,7 @@ describe('SearchFilterService', () => { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty,@typescript-eslint/no-empty-function */ - select: observableOf(true), + select: of(true), }); beforeEach(waitForAsync(() => { @@ -187,7 +187,7 @@ describe('SearchFilterService', () => { const mockReturn = 5; beforeEach(() => { - spyOn(routeServiceStub, 'getQueryParameterValue').and.returnValue(observableOf(mockReturn)); + spyOn(routeServiceStub, 'getQueryParameterValue').and.returnValue(of(mockReturn)); result = service.getCurrentPagination(); }); @@ -213,7 +213,7 @@ describe('SearchFilterService', () => { const direction = SortDirection.ASC; beforeEach(() => { - spyOn(routeServiceStub, 'getQueryParameterValue').and.returnValue(observableOf(undefined)); + spyOn(routeServiceStub, 'getQueryParameterValue').and.returnValue(of(undefined)); result = service.getCurrentSort(new SortOptions(field, direction)); }); @@ -261,7 +261,7 @@ describe('SearchFilterService', () => { const searchOptions = new SearchOptions({}); beforeEach(() => { - spyOn(searchService, 'getFacetValuesFor').and.returnValue(observableOf()); + spyOn(searchService, 'getFacetValuesFor').and.returnValue(of()); service.findSuggestions(mockFilterConfig, searchOptions, query); }); diff --git a/src/app/core/shared/search/search-filter.service.ts b/src/app/core/shared/search/search-filter.service.ts index 2803e71eeb..ddf19632c5 100644 --- a/src/app/core/shared/search/search-filter.service.ts +++ b/src/app/core/shared/search/search-filter.service.ts @@ -9,7 +9,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { distinctUntilChanged, @@ -175,7 +175,7 @@ export class SearchFilterService { })), ); } else { - return observableOf([]); + return of([]); } } diff --git a/src/app/core/shared/search/search.service.spec.ts b/src/app/core/shared/search/search.service.spec.ts index efe160f3aa..b3bd6c7ba3 100644 --- a/src/app/core/shared/search/search.service.spec.ts +++ b/src/app/core/shared/search/search.service.spec.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { TestBed } from '@angular/core/testing'; import { RouterModule } from '@angular/router'; import { Angulartics2 } from 'angulartics2'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { environment } from '../../../../environments/environment.test'; @@ -119,7 +119,7 @@ describe('SearchService', () => { it('should return ViewMode.List when the viewMode is set to ViewMode.List in the ActivatedRoute', () => { testScheduler.run(({ expectObservable }) => { - spyOn(routeService, 'getQueryParamMap').and.returnValue(observableOf(new Map([ + spyOn(routeService, 'getQueryParamMap').and.returnValue(of(new Map([ ['view', ViewMode.ListElement], ]))); @@ -131,7 +131,7 @@ describe('SearchService', () => { it('should return ViewMode.Grid when the viewMode is set to ViewMode.Grid in the ActivatedRoute', () => { testScheduler.run(({ expectObservable }) => { - spyOn(routeService, 'getQueryParamMap').and.returnValue(observableOf(new Map([ + spyOn(routeService, 'getQueryParamMap').and.returnValue(of(new Map([ ['view', ViewMode.GridElement], ]))); diff --git a/src/app/core/submission/submission-object-data.service.ts b/src/app/core/submission/submission-object-data.service.ts index c044cb8129..480565b0f3 100644 --- a/src/app/core/submission/submission-object-data.service.ts +++ b/src/app/core/submission/submission-object-data.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -63,7 +63,7 @@ export class SubmissionObjectDataService { return this.workflowItemDataService.findById(id, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); default: { const now = new Date().getTime(); - return observableOf(new RemoteData( + return of(new RemoteData( now, environment.cache.msToLive.default, now, diff --git a/src/app/core/submission/submission-parent-breadcrumb.service.ts b/src/app/core/submission/submission-parent-breadcrumb.service.ts index 2f9051b858..e68f44a90f 100644 --- a/src/app/core/submission/submission-parent-breadcrumb.service.ts +++ b/src/app/core/submission/submission-parent-breadcrumb.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { combineLatest, Observable, - of as observableOf, + of, switchMap, } from 'rxjs'; @@ -50,7 +50,7 @@ export class SubmissionParentBreadcrumbsService implements BreadcrumbsProviderSe */ getBreadcrumbs(submissionObject: SubmissionObject): Observable { if (isEmpty(submissionObject)) { - return observableOf([]); + return of([]); } return combineLatest([ @@ -67,7 +67,7 @@ export class SubmissionParentBreadcrumbsService implements BreadcrumbsProviderSe getRemoteDataPayload(), ); } else { - return observableOf(collection); + return of(collection); } }), switchMap((collection: Collection) => this.dsoBreadcrumbsService.getBreadcrumbs(collection, getDSORoute(collection))), diff --git a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts index 5e3fdeb034..00b5c80bfd 100644 --- a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts +++ b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockHrefOnlyDataService } from '../../../shared/mocks/href-only-data.service.mock'; @@ -203,7 +203,7 @@ describe('VocabularyService', () => { const vocabularyEntryChildrenRD = createSuccessfulRemoteDataObject(childrenPaginatedList); const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); const getRequestEntries$ = (successful: boolean) => { - return observableOf({ + return of({ response: { isSuccessful: successful, payload: arrayEntries } as any, } as RequestEntry); }; @@ -242,8 +242,8 @@ describe('VocabularyService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: hot('a|', { @@ -260,8 +260,8 @@ describe('VocabularyService', () => { spyOn((service as any).vocabularyDataService, 'findAll').and.callThrough(); spyOn((service as any).vocabularyDataService, 'findByHref').and.callThrough(); spyOn((service as any).vocabularyDataService, 'getVocabularyByMetadataAndCollection').and.callThrough(); - spyOn((service as any).vocabularyDataService.findAllData, 'getFindAllHref').and.returnValue(observableOf(entriesRequestURL)); - spyOn((service as any).vocabularyDataService.searchData, 'getSearchByHref').and.returnValue(observableOf(searchRequestURL)); + spyOn((service as any).vocabularyDataService.findAllData, 'getFindAllHref').and.returnValue(of(entriesRequestURL)); + spyOn((service as any).vocabularyDataService.searchData, 'getSearchByHref').and.returnValue(of(searchRequestURL)); }); afterEach(() => { @@ -427,8 +427,8 @@ describe('VocabularyService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: hot('a|', { @@ -446,9 +446,9 @@ describe('VocabularyService', () => { spyOn((service as any).vocabularyEntryDetailDataService, 'findByHref').and.callThrough(); spyOn((service as any).vocabularyEntryDetailDataService, 'findListByHref').and.callThrough(); spyOn((service as any).vocabularyEntryDetailDataService, 'searchBy').and.callThrough(); - spyOn((service as any).vocabularyEntryDetailDataService.searchData, 'getSearchByHref').and.returnValue(observableOf(searchRequestURL)); - spyOn((service as any).vocabularyEntryDetailDataService.findAllData, 'getFindAllHref').and.returnValue(observableOf(entryDetailChildrenRequestURL)); - spyOn((service as any).vocabularyEntryDetailDataService, 'getBrowseEndpoint').and.returnValue(observableOf(entryDetailEndpointURL)); + spyOn((service as any).vocabularyEntryDetailDataService.searchData, 'getSearchByHref').and.returnValue(of(searchRequestURL)); + spyOn((service as any).vocabularyEntryDetailDataService.findAllData, 'getFindAllHref').and.returnValue(of(entryDetailChildrenRequestURL)); + spyOn((service as any).vocabularyEntryDetailDataService, 'getBrowseEndpoint').and.returnValue(of(entryDetailEndpointURL)); }); afterEach(() => { diff --git a/src/app/core/submission/workflowitem-data.service.spec.ts b/src/app/core/submission/workflowitem-data.service.spec.ts index a07ac238cd..7353cceb77 100644 --- a/src/app/core/submission/workflowitem-data.service.spec.ts +++ b/src/app/core/submission/workflowitem-data.service.spec.ts @@ -5,7 +5,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockHrefOnlyDataService } from '../../shared/mocks/href-only-data.service.mock'; @@ -37,7 +37,7 @@ describe('WorkflowItemDataService test', () => { const item = Object.assign(new Item(), { id: '1234-1234', uuid: '1234-1234', - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -66,12 +66,12 @@ describe('WorkflowItemDataService test', () => { }, }); const itemRD = createSuccessfulRemoteDataObject(item); - const wsi = Object.assign(new WorkflowItem(), { item: observableOf(itemRD), id: '1234', uuid: '1234' }); + const wsi = Object.assign(new WorkflowItem(), { item: of(itemRD), id: '1234', uuid: '1234' }); const wsiRD = createSuccessfulRemoteDataObject(wsi); const endpointURL = `https://rest.api/rest/api/submission/workspaceitems`; const searchRequestURL = `https://rest.api/rest/api/submission/workspaceitems/search/item?uuid=1234-1234`; - const searchRequestURL$ = observableOf(searchRequestURL); + const searchRequestURL$ = of(searchRequestURL); const requestUUID = '8b3c613a-5a4b-438b-9686-be1d5b4a1c5a'; @@ -110,8 +110,8 @@ describe('WorkflowItemDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: hot('a|', { diff --git a/src/app/core/submission/workspaceitem-data.service.spec.ts b/src/app/core/submission/workspaceitem-data.service.spec.ts index 8837792a78..9d5aeb98cd 100644 --- a/src/app/core/submission/workspaceitem-data.service.spec.ts +++ b/src/app/core/submission/workspaceitem-data.service.spec.ts @@ -9,10 +9,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; @@ -55,7 +52,7 @@ describe('WorkspaceitemDataService test', () => { const item = Object.assign(new Item(), { id: '1234-1234', uuid: '1234-1234', - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -84,7 +81,7 @@ describe('WorkspaceitemDataService test', () => { }, }); const itemRD = createSuccessfulRemoteDataObject(item); - const wsi = Object.assign(new WorkspaceItem(), { item: observableOf(itemRD), id: '1234', uuid: '1234' }); + const wsi = Object.assign(new WorkspaceItem(), { item: of(itemRD), id: '1234', uuid: '1234' }); const wsiRD = createSuccessfulRemoteDataObject(wsi); const endpointURL = `https://rest.api/rest/api/submission/workspaceitems`; @@ -126,7 +123,7 @@ describe('WorkspaceitemDataService test', () => { scheduler = getTestScheduler(); halService = jasmine.createSpyObj('halService', { - getEndpoint: observableOf(endpointURL), + getEndpoint: of(endpointURL), }); responseCacheEntry = new RequestEntry(); responseCacheEntry.request = { href: 'https://rest.api/' } as any; @@ -136,8 +133,8 @@ describe('WorkspaceitemDataService test', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: hot('a|', { diff --git a/src/app/core/supervision-order/supervision-order-data.service.spec.ts b/src/app/core/supervision-order/supervision-order-data.service.spec.ts index 945a3f44e8..7985618636 100644 --- a/src/app/core/supervision-order/supervision-order-data.service.spec.ts +++ b/src/app/core/supervision-order/supervision-order-data.service.spec.ts @@ -3,7 +3,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -101,8 +101,8 @@ describe('SupervisionOrderService', () => { generateRequestId: requestUUID, send: true, removeByHrefSubstring: {}, - getByHref: observableOf(responseCacheEntry), - getByUUID: observableOf(responseCacheEntry), + getByHref: of(responseCacheEntry), + getByUUID: of(responseCacheEntry), setStaleByHrefSubstring: {}, }); rdbService = jasmine.createSpyObj('rdbService', { @@ -148,12 +148,12 @@ describe('SupervisionOrderService', () => { spyOn(service, 'findById').and.callThrough(); spyOn(service, 'findByHref').and.callThrough(); - spyOn(service, 'invalidateByHref').and.returnValue(observableOf(true)); + spyOn(service, 'invalidateByHref').and.returnValue(of(true)); spyOn((service as any).createData, 'create').and.callThrough(); spyOn((service as any).deleteData, 'delete').and.callThrough(); spyOn((service as any).patchData, 'update').and.callThrough(); spyOn((service as any).searchData, 'searchBy').and.callThrough(); - spyOn((service as any).searchData, 'getSearchByHref').and.returnValue(observableOf(requestURL)); + spyOn((service as any).searchData, 'getSearchByHref').and.returnValue(of(requestURL)); }); describe('create', () => { diff --git a/src/app/core/tasks/claimed-task-data.service.spec.ts b/src/app/core/tasks/claimed-task-data.service.spec.ts index a0df1e3202..3cbb3c17ee 100644 --- a/src/app/core/tasks/claimed-task-data.service.spec.ts +++ b/src/app/core/tasks/claimed-task-data.service.spec.ts @@ -1,6 +1,6 @@ import { HttpHeaders } from '@angular/common/http'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockRequestService } from '../../shared/mocks/request.service.mock'; @@ -74,7 +74,7 @@ describe('ClaimedTaskDataService', () => { it('should call postToEndpoint method', () => { - spyOn(service, 'postToEndpoint').and.returnValue(observableOf(null)); + spyOn(service, 'postToEndpoint').and.returnValue(of(null)); scheduler.schedule(() => service.claimTask('scopeId', 'poolTaskHref').subscribe()); scheduler.flush(); @@ -103,7 +103,7 @@ describe('ClaimedTaskDataService', () => { describe('findByItem', () => { it('should call searchTask method', () => { - spyOn((service as any), 'searchTask').and.returnValue(observableOf(createSuccessfulRemoteDataObject$({}))); + spyOn((service as any), 'searchTask').and.returnValue(of(createSuccessfulRemoteDataObject$({}))); scheduler.schedule(() => service.findByItem('a0db0fde-1d12-4d43-bd0d-0f43df8d823c').subscribe()); scheduler.flush(); diff --git a/src/app/core/tasks/pool-task-data.service.spec.ts b/src/app/core/tasks/pool-task-data.service.spec.ts index 266c3c6223..32c900e1ee 100644 --- a/src/app/core/tasks/pool-task-data.service.spec.ts +++ b/src/app/core/tasks/pool-task-data.service.spec.ts @@ -1,6 +1,6 @@ import { HttpHeaders } from '@angular/common/http'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockRequestService } from '../../shared/mocks/request.service.mock'; @@ -56,7 +56,7 @@ describe('PoolTaskDataService', () => { describe('findByItem', () => { it('should call searchTask method', () => { - spyOn((service as any), 'searchTask').and.returnValue(observableOf(createSuccessfulRemoteDataObject$({}))); + spyOn((service as any), 'searchTask').and.returnValue(of(createSuccessfulRemoteDataObject$({}))); scheduler.schedule(() => service.findByItem('a0db0fde-1d12-4d43-bd0d-0f43df8d823c').subscribe()); scheduler.flush(); @@ -73,7 +73,7 @@ describe('PoolTaskDataService', () => { describe('getPoolTaskEndpointById', () => { it('should call getEndpointById method', () => { - spyOn(service, 'getEndpointById').and.returnValue(observableOf(null)); + spyOn(service, 'getEndpointById').and.returnValue(of(null)); scheduler.schedule(() => service.getPoolTaskEndpointById('a0db0fde-1d12-4d43-bd0d-0f43df8d823c').subscribe()); scheduler.flush(); diff --git a/src/app/core/tasks/tasks.service.spec.ts b/src/app/core/tasks/tasks.service.spec.ts index 8c1d33d953..8edab72531 100644 --- a/src/app/core/tasks/tasks.service.spec.ts +++ b/src/app/core/tasks/tasks.service.spec.ts @@ -6,7 +6,7 @@ import { Operation, } from 'fast-json-patch'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockRemoteDataBuildService } from '../../shared/mocks/remote-data-build.service.mock'; @@ -123,8 +123,8 @@ describe('TasksService', () => { it('should call findByHref with the href generated by getSearchByHref', () => { - spyOn((service as any).searchData, 'getSearchByHref').and.returnValue(observableOf('generatedHref')); - spyOn(service, 'findByHref').and.returnValue(observableOf(null)); + spyOn((service as any).searchData, 'getSearchByHref').and.returnValue(of('generatedHref')); + spyOn(service, 'findByHref').and.returnValue(of(null)); const followLinks = {}; const options = new FindListOptions(); @@ -142,7 +142,7 @@ describe('TasksService', () => { it('should call halService.getEndpoint and then getEndpointByIDHref', () => { - spyOn(halService, 'getEndpoint').and.returnValue(observableOf('generatedHref')); + spyOn(halService, 'getEndpoint').and.returnValue(of('generatedHref')); spyOn(service, 'getEndpointByIDHref').and.returnValue(null); scheduler.schedule(() => service.getEndpointById('scopeId').subscribe()); diff --git a/src/app/curation-form/curation-form.component.spec.ts b/src/app/curation-form/curation-form.component.spec.ts index 20611d7a32..8ca8e5e19d 100644 --- a/src/app/curation-form/curation-form.component.spec.ts +++ b/src/app/curation-form/curation-form.component.spec.ts @@ -13,7 +13,7 @@ import { import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; import { ProcessDataService } from '../core/data/processes/process-data.service'; @@ -68,7 +68,7 @@ describe('CurationFormComponent', () => { }); handleService = { - normalizeHandle: (a: string) => observableOf(a), + normalizeHandle: (a: string) => of(a), } as any; notificationsService = new NotificationsServiceStub(); @@ -166,7 +166,7 @@ describe('CurationFormComponent', () => { it(`should show an error notification and return when an invalid dsoHandle is provided`, fakeAsync(() => { comp.dsoHandle = 'test-handle'; - spyOn(handleService, 'normalizeHandle').and.returnValue(observableOf(null)); + spyOn(handleService, 'normalizeHandle').and.returnValue(of(null)); comp.submit(); flush(); diff --git a/src/app/curation-form/curation-form.component.ts b/src/app/curation-form/curation-form.component.ts index 3a69a09466..d48f6b113d 100644 --- a/src/app/curation-form/curation-form.component.ts +++ b/src/app/curation-form/curation-form.component.ts @@ -50,7 +50,11 @@ export const CURATION_CFG = 'plugin.named.org.dspace.curate.CurationTask'; selector: 'ds-curation-form', templateUrl: './curation-form.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class CurationFormComponent implements OnDestroy, OnInit { diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts index f4b66c6113..0929f4a21f 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts @@ -30,7 +30,12 @@ import { DsoEditMetadataValueHeadersComponent } from '../dso-edit-metadata-value styleUrls: ['./dso-edit-metadata-field-values.component.scss'], templateUrl: './dso-edit-metadata-field-values.component.html', standalone: true, - imports: [CdkDropList, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, AsyncPipe], + imports: [ + AsyncPipe, + CdkDropList, + DsoEditMetadataValueComponent, + DsoEditMetadataValueHeadersComponent, + ], }) /** * Component displaying table rows for each value for a certain metadata field within a form diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts index b0da8b4d78..381794f15b 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts @@ -9,7 +9,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./dso-edit-metadata-headers.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], templateUrl: './dso-edit-metadata-headers.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * Component displaying the header table row for DSO edit metadata page diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-authority-field/dso-edit-metadata-authority-field.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-authority-field/dso-edit-metadata-authority-field.component.ts index e4101535ed..a6a4e0cb62 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-authority-field/dso-edit-metadata-authority-field.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-authority-field/dso-edit-metadata-authority-field.component.ts @@ -22,7 +22,7 @@ import { import { BehaviorSubject, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -68,15 +68,15 @@ import { DsoEditMetadataFieldService } from '../dso-edit-metadata-field.service' styleUrls: ['./dso-edit-metadata-authority-field.component.scss'], standalone: true, imports: [ - DsDynamicScrollableDropdownComponent, - DsDynamicOneboxComponent, - AuthorityConfidenceStateDirective, - NgbTooltipModule, AsyncPipe, - TranslateModule, - FormsModule, - NgClass, + AuthorityConfidenceStateDirective, DebounceDirective, + DsDynamicOneboxComponent, + DsDynamicScrollableDropdownComponent, + FormsModule, + NgbTooltipModule, + NgClass, + TranslateModule, ], }) export class DsoEditMetadataAuthorityFieldComponent extends AbstractDsoEditMetadataValueFieldComponent implements OnInit, OnChanges { @@ -248,7 +248,7 @@ export class DsoEditMetadataAuthorityFieldComponent extends AbstractDsoEditMetad getFirstCompletedRemoteData(), switchMap((rd) => { if (rd.hasSucceeded) { - return observableOf(rd).pipe( + return of(rd).pipe( metadataFieldsToString(), take(1), map((fields: string[]) => fields.indexOf(this.mdField) > -1), diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-field.service.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-field.service.ts index d235b4c08e..bcf5d525d1 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-field.service.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-field/dso-edit-metadata-field.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { switchMap } from 'rxjs/operators'; @@ -50,7 +50,7 @@ export class DsoEditMetadataFieldService { )), ); } else { - return observableOf(undefined); + return of(undefined); } } } diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts index 9783be6f35..0381e7ef4c 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts @@ -9,7 +9,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./dso-edit-metadata-value-headers.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], templateUrl: './dso-edit-metadata-value-headers.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * Component displaying invisible headers for a list of metadata values using table roles for accessibility diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts index 5a0e6476c1..44b1efe414 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts @@ -56,7 +56,21 @@ import { DsoEditMetadataValueFieldLoaderComponent } from '../dso-edit-metadata-v styleUrls: ['./dso-edit-metadata-value.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], templateUrl: './dso-edit-metadata-value.component.html', standalone: true, - imports: [CdkDrag, NgClass, FormsModule, DebounceDirective, RouterLink, ThemedTypeBadgeComponent, NgbTooltipModule, CdkDragHandle, AsyncPipe, TranslateModule, AuthorityConfidenceStateDirective, BtnDisabledDirective, DsoEditMetadataValueFieldLoaderComponent], + imports: [ + AsyncPipe, + AuthorityConfidenceStateDirective, + BtnDisabledDirective, + CdkDrag, + CdkDragHandle, + DebounceDirective, + DsoEditMetadataValueFieldLoaderComponent, + FormsModule, + NgbTooltipModule, + NgClass, + RouterLink, + ThemedTypeBadgeComponent, + TranslateModule, + ], }) /** * Component displaying a single editable row for a metadata value diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts index 03e7a95bea..efbc6ec93a 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts @@ -64,7 +64,18 @@ import { MetadataFieldSelectorComponent } from './metadata-field-selector/metada styleUrls: ['./dso-edit-metadata.component.scss'], templateUrl: './dso-edit-metadata.component.html', standalone: true, - imports: [DsoEditMetadataHeadersComponent, MetadataFieldSelectorComponent, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, DsoEditMetadataFieldValuesComponent, AlertComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + DsoEditMetadataFieldValuesComponent, + DsoEditMetadataHeadersComponent, + DsoEditMetadataValueComponent, + DsoEditMetadataValueHeadersComponent, + MetadataFieldSelectorComponent, + ThemedLoadingComponent, + TranslateModule, + ], }) /** * Component showing a table of all metadata on a DSpaceObject and options to modify them diff --git a/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts b/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts index 12e37efd19..bd9bf8a9e8 100644 --- a/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts @@ -61,7 +61,16 @@ import { followLink } from '../../../shared/utils/follow-link-config.model'; styleUrls: ['./metadata-field-selector.component.scss'], templateUrl: './metadata-field-selector.component.html', standalone: true, - imports: [FormsModule, NgClass, ReactiveFormsModule, ClickOutsideDirective, AsyncPipe, TranslateModule, ThemedLoadingComponent, InfiniteScrollModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + FormsModule, + InfiniteScrollModule, + NgClass, + ReactiveFormsModule, + ThemedLoadingComponent, + TranslateModule, + ], }) /** * Component displaying a searchable input for metadata-fields diff --git a/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts b/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts index 063263b670..2097d6b5e4 100644 --- a/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts @@ -13,7 +13,9 @@ import { DsoEditMetadataComponent } from './dso-edit-metadata.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [DsoEditMetadataComponent], + imports: [ + DsoEditMetadataComponent, + ], }) export class ThemedDsoEditMetadataComponent extends ThemedComponent { diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts index aeca1fccc6..d8e66eff85 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; @@ -52,7 +52,7 @@ describe('JournalIssueGridElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts index 3968e6013c..d96e9868b1 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts @@ -12,7 +12,9 @@ import { JournalIssueSearchResultGridElementComponent } from '../search-result-g styleUrls: ['./journal-issue-grid-element.component.scss'], templateUrl: './journal-issue-grid-element.component.html', standalone: true, - imports: [JournalIssueSearchResultGridElementComponent], + imports: [ + JournalIssueSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts index 1184e79aa8..b40e4ea3b3 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts @@ -10,7 +10,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../../core/auth/auth.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -58,7 +58,7 @@ describe('JournalVolumeGridElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), expand: (id: number) => null, collapse: (id: number) => null, }; diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts index 4770d62a18..83d70461a5 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts @@ -12,7 +12,9 @@ import { JournalVolumeSearchResultGridElementComponent } from '../search-result- styleUrls: ['./journal-volume-grid-element.component.scss'], templateUrl: './journal-volume-grid-element.component.html', standalone: true, - imports: [JournalVolumeSearchResultGridElementComponent], + imports: [ + JournalVolumeSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts index 2dd425940c..b00efb6dba 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; @@ -56,7 +56,7 @@ describe('JournalGridElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts index edd12938a3..3c5f3a687b 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts @@ -12,7 +12,9 @@ import { JournalSearchResultGridElementComponent } from '../search-result-grid-e styleUrls: ['./journal-grid-element.component.scss'], templateUrl: './journal-grid-element.component.html', standalone: true, - imports: [JournalSearchResultGridElementComponent], + imports: [ + JournalSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts index 61c1e5d80e..5b4424821f 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn templateUrl: './journal-issue-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [TruncatableComponent, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts index 001c06186d..ea8c755b11 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn templateUrl: './journal-volume-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [TruncatableComponent, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts index 72fb8dadb4..a92232586e 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn templateUrl: './journal-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [TruncatableComponent, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts index f18a570dcf..4217dc5a47 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment.test'; @@ -28,7 +28,7 @@ import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { JournalIssueListElementComponent } from './journal-issue-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts index 0a69f99610..beff4c1a08 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts @@ -12,7 +12,9 @@ import { JournalIssueSearchResultListElementComponent } from '../search-result-l styleUrls: ['./journal-issue-list-element.component.scss'], templateUrl: './journal-issue-list-element.component.html', standalone: true, - imports: [JournalIssueSearchResultListElementComponent], + imports: [ + JournalIssueSearchResultListElementComponent, + ], }) /** * The component for displaying a list element for an item of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts index 35a8f08078..b7ed26dfc2 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts @@ -7,7 +7,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../core/shared/item.model'; @@ -18,7 +18,7 @@ import { JournalVolumeSearchResultListElementComponent } from '../search-result- import { JournalVolumeListElementComponent } from './journal-volume-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -46,7 +46,7 @@ describe('JournalVolumeListElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts index c9ae9bf8bf..064fcc34ac 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts @@ -12,7 +12,9 @@ import { JournalVolumeSearchResultListElementComponent } from '../search-result- styleUrls: ['./journal-volume-list-element.component.scss'], templateUrl: './journal-volume-list-element.component.html', standalone: true, - imports: [JournalVolumeSearchResultListElementComponent], + imports: [ + JournalVolumeSearchResultListElementComponent, + ], }) /** * The component for displaying a list element for an item of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts index 713af915bf..55805cf467 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment.test'; @@ -27,7 +27,7 @@ import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { JournalListElementComponent } from './journal-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -49,7 +49,7 @@ describe('JournalListElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), collapse: (id: number) => null, expand: (id: number) => null, }; diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts index 797b62f49b..3d1777abf2 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts @@ -12,7 +12,9 @@ import { JournalSearchResultListElementComponent } from '../search-result-list-e styleUrls: ['./journal-list-element.component.scss'], templateUrl: './journal-list-element.component.html', standalone: true, - imports: [JournalSearchResultListElementComponent], + imports: [ + JournalSearchResultListElementComponent, + ], }) /** * The component for displaying a list element for an item of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts index a6b74c7a79..ce1da0af8e 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; @@ -36,7 +36,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -64,7 +64,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts index 7ce5ac9df1..59dc23014d 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn styleUrls: ['./journal-issue-search-result-list-element.component.scss'], templateUrl: './journal-issue-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts index 18ba6232b3..f828b1e95a 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; import { ThemeService } from 'src/app/shared/theme-support/theme.service'; @@ -36,7 +36,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -63,7 +63,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts index f01c859fdd..e23fadafa2 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn styleUrls: ['./journal-volume-search-result-list-element.component.scss'], templateUrl: './journal-volume-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts index b7373e2fc2..29ac885a51 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; import { ThemeService } from 'src/app/shared/theme-support/theme.service'; @@ -36,7 +36,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -58,7 +58,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts index f589e2ffc5..bda7a6ba57 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn styleUrls: ['./journal-search-result-list-element.component.scss'], templateUrl: './journal-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts index 919d712c32..c26917457c 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts @@ -22,7 +22,12 @@ import { TruncatablePartComponent } from '../../../../../shared/truncatable/trun selector: 'ds-journal-issue-sidebar-search-list-element', templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "JournalIssue" within the context of diff --git a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts index d9ec174b16..19186fca21 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts @@ -22,7 +22,12 @@ import { TruncatablePartComponent } from '../../../../../shared/truncatable/trun selector: 'ds-journal-volume-sidebar-search-list-element', templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "JournalVolume" within the context of diff --git a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts index 2c17494f87..d4f547290c 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts @@ -22,7 +22,12 @@ import { TruncatablePartComponent } from '../../../../../shared/truncatable/trun selector: 'ds-journal-sidebar-search-list-element', templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Journal" within the context of diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts index ed52174054..046e5bcd61 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts @@ -20,7 +20,18 @@ import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail styleUrls: ['./journal-issue.component.scss'], templateUrl: './journal-issue.component.html', standalone: true, - imports: [ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * The component for displaying metadata and relations of an item of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts index 81764dd3ee..02ca72f2fc 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts @@ -20,7 +20,18 @@ import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail styleUrls: ['./journal-volume.component.scss'], templateUrl: './journal-volume.component.html', standalone: true, - imports: [ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * The component for displaying metadata and relations of an item of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts index 7e3dc40c1e..dc884708cb 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts @@ -21,7 +21,19 @@ import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail styleUrls: ['./journal.component.scss'], templateUrl: './journal.component.html', standalone: true, - imports: [ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + TabbedRelatedEntitiesSearchComponent, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * The component for displaying metadata and relations of an item of the type Journal diff --git a/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts index 5be610a35f..a16f33f6e9 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts @@ -12,7 +12,9 @@ import { OrgUnitSearchResultGridElementComponent } from '../search-result-grid-e styleUrls: ['./org-unit-grid-element.component.scss'], templateUrl: './org-unit-grid-element.component.html', standalone: true, - imports: [OrgUnitSearchResultGridElementComponent], + imports: [ + OrgUnitSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts index 6a1946c441..1761e84cbc 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; @@ -50,7 +50,7 @@ describe('PersonGridElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; beforeEach(waitForAsync(() => { diff --git a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts index bb1ee53ae8..87cc85c233 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts @@ -12,7 +12,9 @@ import { PersonSearchResultGridElementComponent } from '../search-result-grid-el styleUrls: ['./person-grid-element.component.scss'], templateUrl: './person-grid-element.component.html', standalone: true, - imports: [PersonSearchResultGridElementComponent], + imports: [ + PersonSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Person diff --git a/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts index 561ebb288b..4337d9f795 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts @@ -12,7 +12,9 @@ import { ProjectSearchResultGridElementComponent } from '../search-result-grid-e styleUrls: ['./project-grid-element.component.scss'], templateUrl: './project-grid-element.component.html', standalone: true, - imports: [ProjectSearchResultGridElementComponent], + imports: [ + ProjectSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Project diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts index ae681a3129..41ba821d1d 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn templateUrl: './org-unit-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [TruncatableComponent, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts index aaa0434c02..0294875d7e 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn templateUrl: './person-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [TruncatableComponent, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Person diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts index 77f67f5756..90f5ae8cab 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts @@ -19,7 +19,15 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn templateUrl: './project-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [TruncatableComponent, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Project diff --git a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts index a2ca0c77da..d539105a8d 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment.test'; @@ -28,7 +28,7 @@ import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { OrgUnitListElementComponent } from './org-unit-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts index 32aac7e48f..15d5458b8c 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts @@ -12,7 +12,9 @@ import { OrgUnitSearchResultListElementComponent } from '../search-result-list-e styleUrls: ['./org-unit-list-element.component.scss'], templateUrl: './org-unit-list-element.component.html', standalone: true, - imports: [OrgUnitSearchResultListElementComponent], + imports: [ + OrgUnitSearchResultListElementComponent, + ], }) /** * The component for displaying a list element for an item of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts index 631d3e90b2..d7dab8ec66 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment.test'; @@ -28,7 +28,7 @@ import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { PersonListElementComponent } from './person-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts index 1f18ac8a9e..3d375388b4 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts @@ -12,7 +12,9 @@ import { PersonSearchResultListElementComponent } from '../search-result-list-el styleUrls: ['./person-list-element.component.scss'], templateUrl: './person-list-element.component.html', standalone: true, - imports: [PersonSearchResultListElementComponent], + imports: [ + PersonSearchResultListElementComponent, + ], }) /** * The component for displaying a list element for an item of the type Person diff --git a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts index 0828b373ab..16248dc66c 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment.test'; @@ -28,7 +28,7 @@ import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { ProjectListElementComponent } from './project-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts index 098637200b..1c9e317962 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts @@ -12,7 +12,9 @@ import { ProjectSearchResultListElementComponent } from '../search-result-list-e styleUrls: ['./project-list-element.component.scss'], templateUrl: './project-list-element.component.html', standalone: true, - imports: [ProjectSearchResultListElementComponent], + imports: [ + ProjectSearchResultListElementComponent, + ], }) /** * The component for displaying a list element for an item of the type Project diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index 28ed1c0feb..a8b0940195 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { AuthService } from '../../../../../core/auth/auth.service'; @@ -39,7 +39,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -60,7 +60,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts index 47cbefd4f5..e629691636 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts @@ -20,7 +20,16 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn styleUrls: ['./org-unit-search-result-list-element.component.scss'], templateUrl: './org-unit-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index 9632f663d2..895983af07 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { AuthService } from '../../../../../core/auth/auth.service'; @@ -39,7 +39,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -60,7 +60,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index 870d3222b5..95a4337f78 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -30,7 +30,16 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn styleUrls: ['./person-search-result-list-element.component.scss'], templateUrl: './person-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Person diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts index 5c11727176..dbf3d175a3 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; @@ -34,7 +34,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -56,7 +56,7 @@ const mockItemWithoutMetadata: ItemSearchResult = Object.assign( new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts index dd8f6acb44..af05fbaf8b 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts @@ -18,7 +18,14 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn styleUrls: ['./project-search-result-list-element.component.scss'], templateUrl: './project-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, TruncatableComponent, ThemedBadgesComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TruncatableComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Project diff --git a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts index 9d41175ecd..3d1f1d7836 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts @@ -21,7 +21,12 @@ import { TruncatablePartComponent } from '../../../../../shared/truncatable/trun selector: 'ds-org-unit-sidebar-search-list-element', templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "OrgUnit" within the context of diff --git a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts index 5a115f74de..8c4323df07 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts @@ -28,7 +28,12 @@ import { TruncatablePartComponent } from '../../../../../shared/truncatable/trun selector: 'ds-person-sidebar-search-list-element', templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Person" within the context of diff --git a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts index 3002f3b283..c46d4c6ccf 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts @@ -21,7 +21,12 @@ import { TruncatablePartComponent } from '../../../../../shared/truncatable/trun selector: 'ds-project-sidebar-search-list-element', templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Project" within the context of diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts index 41e798fb6f..c9537418ab 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts @@ -22,7 +22,20 @@ import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail styleUrls: ['./org-unit.component.scss'], templateUrl: './org-unit.component.html', standalone: true, - imports: [ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule, ItemPageImgFieldComponent], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + ItemPageImgFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + TabbedRelatedEntitiesSearchComponent, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * The component for displaying metadata and relations of an item of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts index 4071d9a709..b1d43fca5b 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts @@ -21,7 +21,19 @@ import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail styleUrls: ['./person.component.scss'], templateUrl: './person.component.html', standalone: true, - imports: [ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + TabbedRelatedEntitiesSearchComponent, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * The component for displaying metadata and relations of an item of the type Person diff --git a/src/app/entity-groups/research-entities/item-pages/project/project.component.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts index d5d33919a9..1f13975b5d 100644 --- a/src/app/entity-groups/research-entities/item-pages/project/project.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts @@ -21,7 +21,19 @@ import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail styleUrls: ['./project.component.scss'], templateUrl: './project.component.html', standalone: true, - imports: [ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + ThemedItemPageTitleFieldComponent, + ThemedMetadataRepresentationListComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * The component for displaying metadata and relations of an item of the type Project diff --git a/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts index 01477d4e09..8a2195505c 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts @@ -9,7 +9,11 @@ import { TruncatableComponent } from '../../../../shared/truncatable/truncatable selector: 'ds-org-unit-item-metadata-list-element', templateUrl: './org-unit-item-metadata-list-element.component.html', standalone: true, - imports: [TruncatableComponent, RouterLink, NgbTooltipModule], + imports: [ + NgbTooltipModule, + RouterLink, + TruncatableComponent, + ], }) /** * The component for displaying an item of the type OrgUnit as a metadata field diff --git a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts index 82e5f54ebb..0cba98fe60 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts @@ -11,7 +11,12 @@ import { TruncatableComponent } from '../../../../shared/truncatable/truncatable selector: 'ds-person-item-metadata-list-element', templateUrl: './person-item-metadata-list-element.component.html', standalone: true, - imports: [TruncatableComponent, RouterLink, NgbTooltipModule, OrcidBadgeAndTooltipComponent], + imports: [ + NgbTooltipModule, + OrcidBadgeAndTooltipComponent, + RouterLink, + TruncatableComponent, + ], }) /** * The component for displaying an item of the type Person as a metadata field diff --git a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts index 84df74f110..d2dd577146 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts @@ -10,7 +10,11 @@ import { TruncatableComponent } from '../../../../shared/truncatable/truncatable selector: 'ds-project-item-metadata-list-element', templateUrl: './project-item-metadata-list-element.component.html', standalone: true, - imports: [TruncatableComponent, RouterLink, NgbTooltipModule], + imports: [ + NgbTooltipModule, + RouterLink, + TruncatableComponent, + ], }) /** * The component for displaying an item of the type Project as a metadata field diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts index a56dc45a39..3b3a601198 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts @@ -14,7 +14,7 @@ import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; @@ -99,7 +99,7 @@ function init() { nameVariant = 'Doe J.'; mockRelationshipService = { - getNameVariant: () => observableOf(nameVariant), + getNameVariant: () => of(nameVariant), }; } diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts index e08f917fe9..98948ea6d0 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts @@ -37,7 +37,10 @@ import { OrgUnitInputSuggestionsComponent } from './org-unit-suggestions/org-uni styleUrls: ['./org-unit-search-result-list-submission-element.component.scss'], templateUrl: './org-unit-search-result-list-submission-element.component.html', standalone: true, - imports: [OrgUnitInputSuggestionsComponent, FormsModule], + imports: [ + FormsModule, + OrgUnitInputSuggestionsComponent, + ], }) /** diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts index 6896da5783..16367ff614 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts @@ -32,7 +32,14 @@ import { DebounceDirective } from '../../../../../../shared/utils/debounce.direc }, ], standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + DebounceDirective, + FormsModule, + NgClass, + TranslateModule, + ], }) /** diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts index 908b9e758b..d7fa160928 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts @@ -16,7 +16,7 @@ import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; @@ -68,7 +68,7 @@ const enviromentNoThumbs = { }; const translateServiceStub = { - get: () => observableOf('test' ), + get: () => of('test' ), instant: (key) => key, onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), @@ -115,7 +115,7 @@ function init() { nameVariant = 'Doe J.'; mockRelationshipService = { - getNameVariant: () => observableOf(nameVariant), + getNameVariant: () => of(nameVariant), }; } diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts index f5973408f6..c0bc3214ce 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts @@ -37,7 +37,13 @@ import { PersonInputSuggestionsComponent } from './person-suggestions/person-inp styleUrls: ['./person-search-result-list-submission-element.component.scss'], templateUrl: './person-search-result-list-submission-element.component.html', standalone: true, - imports: [ThemedThumbnailComponent, NgClass, PersonInputSuggestionsComponent, FormsModule, AsyncPipe], + imports: [ + AsyncPipe, + FormsModule, + NgClass, + PersonInputSuggestionsComponent, + ThemedThumbnailComponent, + ], }) /** diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts index b5645ff3f1..11635dd4b5 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts @@ -32,7 +32,14 @@ import { DebounceDirective } from '../../../../../../shared/utils/debounce.direc }, ], standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + DebounceDirective, + FormsModule, + NgClass, + TranslateModule, + ], }) /** diff --git a/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts b/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts index 2276d1d191..a20014861a 100644 --- a/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts +++ b/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts @@ -14,7 +14,9 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './name-variant-modal.component.html', styleUrls: ['./name-variant-modal.component.scss'], standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * The component for the modal to add a name variant to an item diff --git a/src/app/external-log-in/email-confirmation/confirm-email/confirm-email.component.ts b/src/app/external-log-in/email-confirmation/confirm-email/confirm-email.component.ts index c4a5edc162..8f79b37dc5 100644 --- a/src/app/external-log-in/email-confirmation/confirm-email/confirm-email.component.ts +++ b/src/app/external-log-in/email-confirmation/confirm-email/confirm-email.component.ts @@ -50,8 +50,8 @@ import { ExternalLoginService } from '../../services/external-login.service'; changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - TranslateModule, ReactiveFormsModule, + TranslateModule, ], }) /** diff --git a/src/app/external-log-in/email-confirmation/confirmation-sent/confirmation-sent.component.ts b/src/app/external-log-in/email-confirmation/confirmation-sent/confirmation-sent.component.ts index df5aedf29b..1bb0481b6a 100644 --- a/src/app/external-log-in/email-confirmation/confirmation-sent/confirmation-sent.component.ts +++ b/src/app/external-log-in/email-confirmation/confirmation-sent/confirmation-sent.component.ts @@ -9,7 +9,9 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './confirmation-sent.component.html', styleUrls: ['./confirmation-sent.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], standalone: true, }) diff --git a/src/app/external-log-in/email-confirmation/provide-email/provide-email.component.ts b/src/app/external-log-in/email-confirmation/provide-email/provide-email.component.ts index 241061e31d..dd95083686 100644 --- a/src/app/external-log-in/email-confirmation/provide-email/provide-email.component.ts +++ b/src/app/external-log-in/email-confirmation/provide-email/provide-email.component.ts @@ -22,8 +22,8 @@ import { ExternalLoginService } from '../../services/external-login.service'; styleUrls: ['./provide-email.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, imports: [ - TranslateModule, ReactiveFormsModule, + TranslateModule, ], standalone: true, }) diff --git a/src/app/external-log-in/external-log-in/external-log-in.component.spec.ts b/src/app/external-log-in/external-log-in/external-log-in.component.spec.ts index d57aebd0d7..2d306bf204 100644 --- a/src/app/external-log-in/external-log-in/external-log-in.component.spec.ts +++ b/src/app/external-log-in/external-log-in/external-log-in.component.spec.ts @@ -14,7 +14,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { storeModuleConfig } from '../../app.reducer'; import { authReducer } from '../../core/auth/auth.reducer'; @@ -72,7 +72,7 @@ describe('ExternalLogInComponent', () => { }, }; const translateServiceStub = { - get: () => observableOf('Info Text'), + get: () => of('Info Text'), instant: (key: any) => 'Info Text', onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), diff --git a/src/app/external-log-in/external-log-in/external-log-in.component.ts b/src/app/external-log-in/external-log-in/external-log-in.component.ts index 63eb6414b1..4673e0ef09 100644 --- a/src/app/external-log-in/external-log-in/external-log-in.component.ts +++ b/src/app/external-log-in/external-log-in/external-log-in.component.ts @@ -47,13 +47,13 @@ import { ProvideEmailComponent } from '../email-confirmation/provide-email/provi styleUrls: ['./external-log-in.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, imports: [ - ProvideEmailComponent, AlertComponent, - TranslateModule, - ConfirmEmailComponent, - ThemedLogInComponent, - NgComponentOutlet, AsyncPipe, + ConfirmEmailComponent, + NgComponentOutlet, + ProvideEmailComponent, + ThemedLogInComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/external-log-in/guards/registration-token.guard.spec.ts b/src/app/external-log-in/guards/registration-token.guard.spec.ts index eb9add5965..2e914815fd 100644 --- a/src/app/external-log-in/guards/registration-token.guard.spec.ts +++ b/src/app/external-log-in/guards/registration-token.guard.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; @@ -35,7 +35,7 @@ describe('RegistrationTokenGuard', searchByTokenAndHandleError: createSuccessfulRemoteDataObject$(registrationWithGroups), }); const authService = { - getAuthenticatedUserFromStore: () => observableOf(ePerson), + getAuthenticatedUserFromStore: () => of(ePerson), setRedirectUrl: () => { return true; }, @@ -100,7 +100,7 @@ describe('RegistrationTokenGuard', }); const epersonDifferentUserFromLoggedIn = jasmine.createSpyObj('epersonRegistrationService', { - searchByTokenAndHandleError: observableOf(registrationWithDifferentUserFromLoggedIn), + searchByTokenAndHandleError: of(registrationWithDifferentUserFromLoggedIn), }); beforeEach(() => { diff --git a/src/app/external-log-in/registration-types/orcid-confirmation/orcid-confirmation.component.ts b/src/app/external-log-in/registration-types/orcid-confirmation/orcid-confirmation.component.ts index 2e1b10a736..1d1cc43a91 100644 --- a/src/app/external-log-in/registration-types/orcid-confirmation/orcid-confirmation.component.ts +++ b/src/app/external-log-in/registration-types/orcid-confirmation/orcid-confirmation.component.ts @@ -21,9 +21,9 @@ import { ExternalLoginMethodEntryComponent } from '../../decorators/external-log styleUrls: ['./orcid-confirmation.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, imports: [ + BrowserOnlyPipe, ReactiveFormsModule, TranslateModule, - BrowserOnlyPipe, ], standalone: true, }) diff --git a/src/app/external-log-in/services/external-login.service.spec.ts b/src/app/external-log-in/services/external-login.service.spec.ts index ca0a54bb4b..debf843ddf 100644 --- a/src/app/external-log-in/services/external-login.service.spec.ts +++ b/src/app/external-log-in/services/external-login.service.spec.ts @@ -8,7 +8,7 @@ import { Router } from '@angular/router'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateService } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { EpersonRegistrationService } from '../../core/data/eperson-registration.service'; @@ -66,7 +66,7 @@ describe('ExternalLoginService', () => { }); it('should call epersonRegistrationService.patchUpdateRegistration with the correct parameters', () => { - epersonRegistrationService.patchUpdateRegistration.and.returnValue(observableOf({} as RemoteData)); + epersonRegistrationService.patchUpdateRegistration.and.returnValue(of({} as RemoteData)); service.patchUpdateRegistration(values, field, registrationId, token, operation); expect(epersonRegistrationService.patchUpdateRegistration).toHaveBeenCalledWith(values, field, registrationId, token, operation); }); @@ -80,8 +80,8 @@ describe('ExternalLoginService', () => { it('should show an error notification if the remote data has failed', fakeAsync(() => { const remoteData = createFailedRemoteDataObject('error message'); - epersonRegistrationService.patchUpdateRegistration.and.returnValue(observableOf(remoteData)); - translate.get.and.returnValue(observableOf('error message')); + epersonRegistrationService.patchUpdateRegistration.and.returnValue(of(remoteData)); + translate.get.and.returnValue(of('error message')); let result = null; service.patchUpdateRegistration(values, field, registrationId, token, operation).subscribe((data) => (result = data)); diff --git a/src/app/external-login-email-confirmation-page/external-login-email-confirmation-page.component.ts b/src/app/external-login-email-confirmation-page/external-login-email-confirmation-page.component.ts index 915242828e..7520be1143 100644 --- a/src/app/external-login-email-confirmation-page/external-login-email-confirmation-page.component.ts +++ b/src/app/external-login-email-confirmation-page/external-login-email-confirmation-page.component.ts @@ -6,7 +6,9 @@ import { ConfirmationSentComponent } from '../external-log-in/email-confirmation templateUrl: './external-login-email-confirmation-page.component.html', styleUrls: ['./external-login-email-confirmation-page.component.scss'], standalone: true, - imports: [ConfirmationSentComponent], + imports: [ + ConfirmationSentComponent, + ], }) export class ExternalLoginEmailConfirmationPageComponent { } diff --git a/src/app/external-login-page/external-login-page.component.ts b/src/app/external-login-page/external-login-page.component.ts index 8e7ec24c55..d09e38472d 100644 --- a/src/app/external-login-page/external-login-page.component.ts +++ b/src/app/external-login-page/external-login-page.component.ts @@ -26,10 +26,10 @@ import { AUTH_METHOD_FOR_DECORATOR_MAP } from '../shared/log-in/methods/log-in.m templateUrl: './external-login-page.component.html', styleUrls: ['./external-login-page.component.scss'], imports: [ - TranslateModule, + AlertComponent, AsyncPipe, ExternalLogInComponent, - AlertComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/external-login-page/themed-external-login-page.component.ts b/src/app/external-login-page/themed-external-login-page.component.ts index 320930ea87..512cd185ae 100644 --- a/src/app/external-login-page/themed-external-login-page.component.ts +++ b/src/app/external-login-page/themed-external-login-page.component.ts @@ -11,7 +11,9 @@ import { ExternalLoginPageComponent } from './external-login-page.component'; styleUrls: [], templateUrl: './../shared/theme-support/themed.component.html', standalone: true, - imports: [ExternalLoginPageComponent], + imports: [ + ExternalLoginPageComponent, + ], }) export class ThemedExternalLoginPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/external-login-review-account-info-page/external-login-review-account-info-page.component.ts b/src/app/external-login-review-account-info-page/external-login-review-account-info-page.component.ts index b4ff7e9a3d..ccd47fb28e 100644 --- a/src/app/external-login-review-account-info-page/external-login-review-account-info-page.component.ts +++ b/src/app/external-login-review-account-info-page/external-login-review-account-info-page.component.ts @@ -22,9 +22,9 @@ import { ReviewAccountInfoComponent } from './review-account-info/review-account templateUrl: './external-login-review-account-info-page.component.html', styleUrls: ['./external-login-review-account-info-page.component.scss'], imports: [ - ReviewAccountInfoComponent, - AsyncPipe, AlertComponent, + AsyncPipe, + ReviewAccountInfoComponent, ], standalone: true, }) diff --git a/src/app/external-login-review-account-info-page/helpers/review-account.guard.spec.ts b/src/app/external-login-review-account-info-page/helpers/review-account.guard.spec.ts index 1da628e830..ccd08577d1 100644 --- a/src/app/external-login-review-account-info-page/helpers/review-account.guard.spec.ts +++ b/src/app/external-login-review-account-info-page/helpers/review-account.guard.spec.ts @@ -12,7 +12,6 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, of, } from 'rxjs'; @@ -43,7 +42,7 @@ describe('ReviewAccountGuard', () => { searchByTokenAndHandleError: createSuccessfulRemoteDataObject$(registrationMock), }); authService = { - isAuthenticated: () => observableOf(true), + isAuthenticated: () => of(true), } as any; router = new RouterMock(); @@ -53,7 +52,7 @@ describe('ReviewAccountGuard', () => { { provide: ActivatedRoute, useValue: { - queryParamMap: observableOf(convertToParamMap(paramObject)), + queryParamMap: of(convertToParamMap(paramObject)), snapshot: { params: { token: '1234', diff --git a/src/app/external-login-review-account-info-page/review-account-info/review-account-info.component.ts b/src/app/external-login-review-account-info-page/review-account-info/review-account-info.component.ts index 8eb14ece43..a1f34dfe49 100644 --- a/src/app/external-login-review-account-info-page/review-account-info/review-account-info.component.ts +++ b/src/app/external-login-review-account-info-page/review-account-info/review-account-info.component.ts @@ -58,10 +58,10 @@ export interface ReviewAccountInfoData { templateUrl: './review-account-info.component.html', styleUrls: ['./review-account-info.component.scss'], imports: [ + AlertComponent, CompareValuesPipe, TitleCasePipe, TranslateModule, - AlertComponent, UiSwitchModule, ], changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/external-login-review-account-info-page/themed-external-login-review-account-info-page.component.ts b/src/app/external-login-review-account-info-page/themed-external-login-review-account-info-page.component.ts index 53c1f223a7..50369b7276 100644 --- a/src/app/external-login-review-account-info-page/themed-external-login-review-account-info-page.component.ts +++ b/src/app/external-login-review-account-info-page/themed-external-login-review-account-info-page.component.ts @@ -11,7 +11,9 @@ import { ExternalLoginReviewAccountInfoPageComponent } from './external-login-re styleUrls: [], templateUrl: './../shared/theme-support/themed.component.html', standalone: true, - imports: [ExternalLoginReviewAccountInfoPageComponent], + imports: [ + ExternalLoginReviewAccountInfoPageComponent, + ], }) export class ThemedExternalLoginReviewAccountInfoPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/footer/footer.component.ts b/src/app/footer/footer.component.ts index 1296b61b1f..17da24076b 100644 --- a/src/app/footer/footer.component.ts +++ b/src/app/footer/footer.component.ts @@ -12,7 +12,7 @@ import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -30,7 +30,12 @@ import { hasValue } from '../shared/empty.util'; styleUrls: ['footer.component.scss'], templateUrl: 'footer.component.html', standalone: true, - imports: [RouterLink, AsyncPipe, DatePipe, TranslateModule], + imports: [ + AsyncPipe, + DatePipe, + RouterLink, + TranslateModule, + ], }) export class FooterComponent implements OnInit { dateObj: number = Date.now(); @@ -57,7 +62,7 @@ export class FooterComponent implements OnInit { this.showCookieSettings = this.appConfig.info.enableCookieConsentPopup; this.showPrivacyPolicy = this.appConfig.info.enablePrivacyStatement; this.showEndUserAgreement = this.appConfig.info.enableEndUserAgreement; - this.coarLdnEnabled$ = this.appConfig.info.enableCOARNotifySupport ? this.notifyInfoService.isCoarConfigEnabled() : observableOf(false); + this.coarLdnEnabled$ = this.appConfig.info.enableCOARNotifySupport ? this.notifyInfoService.isCoarConfigEnabled() : of(false); this.showSendFeedback$ = this.authorizationService.isAuthorized(FeatureID.CanSendFeedback); } diff --git a/src/app/footer/themed-footer.component.ts b/src/app/footer/themed-footer.component.ts index a09484ebca..6579d3ba02 100644 --- a/src/app/footer/themed-footer.component.ts +++ b/src/app/footer/themed-footer.component.ts @@ -11,7 +11,9 @@ import { FooterComponent } from './footer.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [FooterComponent], + imports: [ + FooterComponent, + ], }) export class ThemedFooterComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forbidden/forbidden.component.ts b/src/app/forbidden/forbidden.component.ts index 74cfdf31ce..26cf9b51b7 100644 --- a/src/app/forbidden/forbidden.component.ts +++ b/src/app/forbidden/forbidden.component.ts @@ -16,7 +16,10 @@ import { ServerResponseService } from '../core/services/server-response.service' templateUrl: './forbidden.component.html', styleUrls: ['./forbidden.component.scss'], standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) export class ForbiddenComponent implements OnInit { diff --git a/src/app/forbidden/themed-forbidden.component.ts b/src/app/forbidden/themed-forbidden.component.ts index 4d1b6d6fb7..f32bb88270 100644 --- a/src/app/forbidden/themed-forbidden.component.ts +++ b/src/app/forbidden/themed-forbidden.component.ts @@ -11,7 +11,9 @@ import { ForbiddenComponent } from './forbidden.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [ForbiddenComponent], + imports: [ + ForbiddenComponent, + ], }) export class ThemedForbiddenComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts b/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts index af9f557fbb..237ef73e88 100644 --- a/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts +++ b/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts @@ -11,7 +11,9 @@ import { ForgotEmailComponent } from './forgot-email.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [ForgotEmailComponent], + imports: [ + ForgotEmailComponent, + ], }) export class ThemedForgotEmailComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts index b45c18a587..04c35f416c 100644 --- a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts +++ b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts @@ -18,7 +18,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthenticateAction } from '../../core/auth/auth.actions'; import { CoreState } from '../../core/core-state.model'; @@ -54,7 +54,7 @@ describe('ForgotPasswordFormComponent', () => { beforeEach(waitForAsync(() => { - route = { data: observableOf({ registration: createSuccessfulRemoteDataObject(registration) }) }; + route = { data: of({ registration: createSuccessfulRemoteDataObject(registration) }) }; router = new RouterStub(); notificationsService = new NotificationsServiceStub(); diff --git a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts index 37d964084a..58892d0c12 100644 --- a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts +++ b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts @@ -35,11 +35,11 @@ import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe'; styleUrls: ['./forgot-password-form.component.scss'], templateUrl: './forgot-password-form.component.html', imports: [ - TranslateModule, - BrowserOnlyPipe, - ProfilePageSecurityFormComponent, AsyncPipe, + BrowserOnlyPipe, BtnDisabledDirective, + ProfilePageSecurityFormComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts b/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts index 956568e2bf..c90882f7d4 100644 --- a/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts +++ b/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts @@ -11,7 +11,9 @@ import { ForgotPasswordFormComponent } from './forgot-password-form.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [ForgotPasswordFormComponent], + imports: [ + ForgotPasswordFormComponent, + ], }) export class ThemedForgotPasswordFormComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts index 53f1057531..8c35172600 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -25,7 +25,12 @@ import { MenuID } from '../shared/menu/menu-id.model'; styleUrls: ['header-navbar-wrapper.component.scss'], templateUrl: 'header-navbar-wrapper.component.html', standalone: true, - imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + ThemedHeaderComponent, + ThemedNavbarComponent, + ], }) export class HeaderNavbarWrapperComponent implements OnInit { public isNavBarCollapsed$: Observable; diff --git a/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts b/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts index 64d36edae3..151044d6d8 100644 --- a/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts @@ -11,7 +11,9 @@ import { HeaderNavbarWrapperComponent } from './header-navbar-wrapper.component' styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [HeaderNavbarWrapperComponent], + imports: [ + HeaderNavbarWrapperComponent, + ], }) export class ThemedHeaderNavbarWrapperComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts b/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts index 33dfccc5ad..5172cfd991 100644 --- a/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts +++ b/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ContextHelpService } from '../../shared/context-help.service'; import { ContextHelpToggleComponent } from './context-help-toggle.component'; @@ -20,7 +20,7 @@ describe('ContextHelpToggleComponent', () => { contextHelpService = jasmine.createSpyObj('contextHelpService', [ 'tooltipCount$', 'toggleIcons', ]); - contextHelpService.tooltipCount$.and.returnValue(observableOf(0)); + contextHelpService.tooltipCount$.and.returnValue(of(0)); await TestBed.configureTestingModule({ providers: [ { provide: ContextHelpService, useValue: contextHelpService }, @@ -51,7 +51,7 @@ describe('ContextHelpToggleComponent', () => { describe('if there are elements on the page with a tooltip', () => { beforeEach(() => { - contextHelpService.tooltipCount$.and.returnValue(observableOf(1)); + contextHelpService.tooltipCount$.and.returnValue(of(1)); fixture.detectChanges(); }); diff --git a/src/app/header/context-help-toggle/context-help-toggle.component.ts b/src/app/header/context-help-toggle/context-help-toggle.component.ts index 84eeb4013b..da1b6e01fa 100644 --- a/src/app/header/context-help-toggle/context-help-toggle.component.ts +++ b/src/app/header/context-help-toggle/context-help-toggle.component.ts @@ -22,7 +22,10 @@ import { ContextHelpService } from '../../shared/context-help.service'; templateUrl: './context-help-toggle.component.html', styleUrls: ['./context-help-toggle.component.scss'], standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) export class ContextHelpToggleComponent implements OnInit { buttonVisible$: Observable; diff --git a/src/app/header/header.component.spec.ts b/src/app/header/header.component.spec.ts index 72fe87eac8..ca1e3c4db9 100644 --- a/src/app/header/header.component.spec.ts +++ b/src/app/header/header.component.spec.ts @@ -9,10 +9,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { LocaleService } from '../core/locale/locale.service'; import { ThemedSearchNavbarComponent } from '../search-navbar/themed-search-navbar.component'; @@ -66,7 +63,7 @@ describe('HeaderComponent', () => { // synchronous beforeEach beforeEach(() => { - spyOn(menuService, 'getMenuTopSections').and.returnValue(observableOf([])); + spyOn(menuService, 'getMenuTopSections').and.returnValue(of([])); fixture = TestBed.createComponent(HeaderComponent); diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index 48fad0b56b..e6f038aafa 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -28,7 +28,17 @@ import { ContextHelpToggleComponent } from './context-help-toggle/context-help-t styleUrls: ['header.component.scss'], templateUrl: 'header.component.html', standalone: true, - imports: [RouterLink, ThemedLangSwitchComponent, NgbDropdownModule, ThemedSearchNavbarComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule, AsyncPipe], + imports: [ + AsyncPipe, + ContextHelpToggleComponent, + ImpersonateNavbarComponent, + NgbDropdownModule, + RouterLink, + ThemedAuthNavMenuComponent, + ThemedLangSwitchComponent, + ThemedSearchNavbarComponent, + TranslateModule, + ], }) export class HeaderComponent implements OnInit { /** diff --git a/src/app/header/themed-header.component.ts b/src/app/header/themed-header.component.ts index 5f92a34138..49bf7a47ea 100644 --- a/src/app/header/themed-header.component.ts +++ b/src/app/header/themed-header.component.ts @@ -11,7 +11,9 @@ import { HeaderComponent } from './header.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [HeaderComponent], + imports: [ + HeaderComponent, + ], }) export class ThemedHeaderComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/health-page/health-info/health-info-component/health-info-component.component.ts b/src/app/health-page/health-info/health-info-component/health-info-component.component.ts index 531efe6059..59f04bd865 100644 --- a/src/app/health-page/health-info/health-info-component/health-info-component.component.ts +++ b/src/app/health-page/health-info/health-info-component/health-info-component.component.ts @@ -17,7 +17,11 @@ import { HealthInfoComponent } from '../../models/health-component.model'; templateUrl: './health-info-component.component.html', styleUrls: ['./health-info-component.component.scss'], standalone: true, - imports: [NgbCollapseModule, TitleCasePipe, ObjNgFor], + imports: [ + NgbCollapseModule, + ObjNgFor, + TitleCasePipe, + ], }) export class HealthInfoComponentComponent extends HealthComponentComponent { diff --git a/src/app/health-page/health-info/health-info.component.ts b/src/app/health-page/health-info/health-info.component.ts index 3e6f7714ff..9fe25d1d98 100644 --- a/src/app/health-page/health-info/health-info.component.ts +++ b/src/app/health-page/health-info/health-info.component.ts @@ -24,7 +24,13 @@ import { HealthInfoComponentComponent } from './health-info-component/health-inf templateUrl: './health-info.component.html', styleUrls: ['./health-info.component.scss'], standalone: true, - imports: [NgbAccordionModule, HealthStatusComponent, HealthInfoComponentComponent, TitleCasePipe, ObjNgFor], + imports: [ + HealthInfoComponentComponent, + HealthStatusComponent, + NgbAccordionModule, + ObjNgFor, + TitleCasePipe, + ], }) export class HealthInfoComponent implements OnInit { diff --git a/src/app/health-page/health-page.component.ts b/src/app/health-page/health-page.component.ts index d1c322bff2..7bcfef3265 100644 --- a/src/app/health-page/health-page.component.ts +++ b/src/app/health-page/health-page.component.ts @@ -23,7 +23,14 @@ import { templateUrl: './health-page.component.html', styleUrls: ['./health-page.component.scss'], standalone: true, - imports: [NgbNavModule, HealthPanelComponent, HealthInfoComponent, AlertComponent, AsyncPipe, TranslateModule], + imports: [ + AlertComponent, + AsyncPipe, + HealthInfoComponent, + HealthPanelComponent, + NgbNavModule, + TranslateModule, + ], }) export class HealthPageComponent implements OnInit { diff --git a/src/app/health-page/health-panel/health-component/health-component.component.ts b/src/app/health-page/health-panel/health-component/health-component.component.ts index a7ec69d06f..af909dd388 100644 --- a/src/app/health-page/health-panel/health-component/health-component.component.ts +++ b/src/app/health-page/health-panel/health-component/health-component.component.ts @@ -23,7 +23,12 @@ import { HealthComponent } from '../../models/health-component.model'; templateUrl: './health-component.component.html', styleUrls: ['./health-component.component.scss'], standalone: true, - imports: [NgbCollapseModule, AlertComponent, TitleCasePipe, ObjNgFor], + imports: [ + AlertComponent, + NgbCollapseModule, + ObjNgFor, + TitleCasePipe, + ], }) export class HealthComponentComponent { diff --git a/src/app/health-page/health-panel/health-panel.component.ts b/src/app/health-page/health-panel/health-panel.component.ts index d1b233df64..ca7ce970d0 100644 --- a/src/app/health-page/health-panel/health-panel.component.ts +++ b/src/app/health-page/health-panel/health-panel.component.ts @@ -23,7 +23,14 @@ import { HealthStatusComponent } from './health-status/health-status.component'; templateUrl: './health-panel.component.html', styleUrls: ['./health-panel.component.scss'], standalone: true, - imports: [HealthStatusComponent, NgbAccordionModule, HealthComponentComponent, TitleCasePipe, ObjNgFor, TranslateModule], + imports: [ + HealthComponentComponent, + HealthStatusComponent, + NgbAccordionModule, + ObjNgFor, + TitleCasePipe, + TranslateModule, + ], }) export class HealthPanelComponent implements OnInit { diff --git a/src/app/health-page/health-panel/health-status/health-status.component.ts b/src/app/health-page/health-panel/health-status/health-status.component.ts index 050dd2c621..7cb7d2b3cc 100644 --- a/src/app/health-page/health-panel/health-status/health-status.component.ts +++ b/src/app/health-page/health-panel/health-status/health-status.component.ts @@ -16,7 +16,10 @@ import { HealthStatus } from '../../models/health-component.model'; templateUrl: './health-status.component.html', styleUrls: ['./health-status.component.scss'], standalone: true, - imports: [NgbTooltipModule, TranslateModule], + imports: [ + NgbTooltipModule, + TranslateModule, + ], }) export class HealthStatusComponent { /** diff --git a/src/app/home-page/home-coar/home-coar.component.ts b/src/app/home-page/home-coar/home-coar.component.ts index f8efa29d07..8f92efdc4f 100644 --- a/src/app/home-page/home-coar/home-coar.component.ts +++ b/src/app/home-page/home-coar/home-coar.component.ts @@ -7,7 +7,7 @@ import { PLATFORM_ID, } from '@angular/core'; import { - of as observableOf, + of, Subscription, } from 'rxjs'; import { switchMap } from 'rxjs/operators'; @@ -46,7 +46,7 @@ export class HomeCoarComponent implements OnInit, OnDestroy { // Get COAR REST API URLs from REST configuration // only if COAR configuration is enabled this.subs.push(this.notifyInfoService.isCoarConfigEnabled().pipe( - switchMap((coarLdnEnabled: boolean) => coarLdnEnabled ? this.notifyInfoService.getCoarLdnLocalInboxUrls() : observableOf([])), + switchMap((coarLdnEnabled: boolean) => coarLdnEnabled ? this.notifyInfoService.getCoarLdnLocalInboxUrls() : of([])), ).subscribe((coarRestApiUrls: string[]) => { if (coarRestApiUrls.length > 0) { this.initPageLinks(coarRestApiUrls); diff --git a/src/app/home-page/home-news/themed-home-news.component.ts b/src/app/home-page/home-news/themed-home-news.component.ts index d0389ff0fb..5128ecf2f3 100644 --- a/src/app/home-page/home-news/themed-home-news.component.ts +++ b/src/app/home-page/home-news/themed-home-news.component.ts @@ -8,7 +8,9 @@ import { HomeNewsComponent } from './home-news.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [HomeNewsComponent], + imports: [ + HomeNewsComponent, + ], }) /** diff --git a/src/app/home-page/home-page.component.ts b/src/app/home-page/home-page.component.ts index 03ac44c9f3..f262581e59 100644 --- a/src/app/home-page/home-page.component.ts +++ b/src/app/home-page/home-page.component.ts @@ -1,6 +1,5 @@ import { AsyncPipe, - NgClass, NgTemplateOutlet, } from '@angular/common'; import { @@ -21,7 +20,6 @@ import { Site } from '../core/shared/site.model'; import { SuggestionsPopupComponent } from '../notifications/suggestions/popup/suggestions-popup.component'; import { ThemedConfigurationSearchPageComponent } from '../search-page/themed-configuration-search-page.component'; import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; -import { PageWithSidebarComponent } from '../shared/sidebar/page-with-sidebar.component'; import { HomeCoarComponent } from './home-coar/home-coar.component'; import { ThemedHomeNewsComponent } from './home-news/themed-home-news.component'; import { RecentItemListComponent } from './recent-item-list/recent-item-list.component'; @@ -32,7 +30,18 @@ import { ThemedTopLevelCommunityListComponent } from './top-level-community-list styleUrls: ['./home-page.component.scss'], templateUrl: './home-page.component.html', standalone: true, - imports: [ThemedHomeNewsComponent, NgTemplateOutlet, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, RecentItemListComponent, AsyncPipe, TranslateModule, NgClass, SuggestionsPopupComponent, ThemedConfigurationSearchPageComponent, PageWithSidebarComponent, HomeCoarComponent], + imports: [ + AsyncPipe, + HomeCoarComponent, + NgTemplateOutlet, + RecentItemListComponent, + SuggestionsPopupComponent, + ThemedConfigurationSearchPageComponent, + ThemedHomeNewsComponent, + ThemedSearchFormComponent, + ThemedTopLevelCommunityListComponent, + TranslateModule, + ], }) export class HomePageComponent implements OnInit { diff --git a/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts b/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts index 298e66b05c..2e9f565d8b 100644 --- a/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts +++ b/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed, } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment'; @@ -28,13 +28,13 @@ describe('RecentItemListComponent', () => { const emptyList = createSuccessfulRemoteDataObject(createPaginatedList([])); let paginationService; const searchServiceStub = Object.assign(new SearchServiceStub(), { - search: () => observableOf(emptyList), + search: () => of(emptyList), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ clearDiscoveryRequests: () => {}, /* eslint-enable no-empty,@typescript-eslint/no-empty-function */ }); paginationService = new PaginationServiceStub(); - const mockSearchOptions = observableOf(new PaginatedSearchOptions({ + const mockSearchOptions = of(new PaginatedSearchOptions({ pagination: Object.assign(new PaginationComponentOptions(), { id: 'search-page-configuration', pageSize: 10, diff --git a/src/app/home-page/recent-item-list/recent-item-list.component.ts b/src/app/home-page/recent-item-list/recent-item-list.component.ts index b336cf7e9b..1883a959b1 100644 --- a/src/app/home-page/recent-item-list/recent-item-list.component.ts +++ b/src/app/home-page/recent-item-list/recent-item-list.component.ts @@ -59,7 +59,15 @@ import { VarDirective } from '../../shared/utils/var.directive'; fadeInOut, ], standalone: true, - imports: [VarDirective, NgClass, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ErrorComponent, + ListableObjectComponentLoaderComponent, + NgClass, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class RecentItemListComponent implements OnInit, OnDestroy { itemRD$: Observable>>; diff --git a/src/app/home-page/themed-home-page.component.ts b/src/app/home-page/themed-home-page.component.ts index 92934859a9..a20d85f9f0 100644 --- a/src/app/home-page/themed-home-page.component.ts +++ b/src/app/home-page/themed-home-page.component.ts @@ -8,7 +8,9 @@ import { HomePageComponent } from './home-page.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [HomePageComponent], + imports: [ + HomePageComponent, + ], }) export class ThemedHomePageComponent extends ThemedComponent { diff --git a/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts b/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts index 107466cc18..a3ea485270 100644 --- a/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts +++ b/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts @@ -8,7 +8,9 @@ import { TopLevelCommunityListComponent } from './top-level-community-list.compo styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [TopLevelCommunityListComponent], + imports: [ + TopLevelCommunityListComponent, + ], }) export class ThemedTopLevelCommunityListComponent extends ThemedComponent { protected inAndOutputNames: (keyof TopLevelCommunityListComponent & keyof this)[]; diff --git a/src/app/home-page/top-level-community-list/top-level-community-list.component.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.ts index 7f3e384df8..609bb6a870 100644 --- a/src/app/home-page/top-level-community-list/top-level-community-list.component.ts +++ b/src/app/home-page/top-level-community-list/top-level-community-list.component.ts @@ -45,7 +45,14 @@ import { VarDirective } from '../../shared/utils/var.directive'; changeDetection: ChangeDetectionStrategy.OnPush, animations: [fadeInOut], standalone: true, - imports: [VarDirective, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ErrorComponent, + ObjectCollectionComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class TopLevelCommunityListComponent implements OnInit, OnDestroy { diff --git a/src/app/info/accessibility-settings/accessibility-settings.component.ts b/src/app/info/accessibility-settings/accessibility-settings.component.ts index 23699b14a6..7dda13a217 100644 --- a/src/app/info/accessibility-settings/accessibility-settings.component.ts +++ b/src/app/info/accessibility-settings/accessibility-settings.component.ts @@ -40,12 +40,12 @@ import { NotificationsService } from '../../shared/notifications/notifications.s selector: 'ds-accessibility-settings', templateUrl: './accessibility-settings.component.html', imports: [ - CommonModule, - TranslateModule, - FormsModule, - UiSwitchModule, - ContextHelpDirective, AlertComponent, + CommonModule, + ContextHelpDirective, + FormsModule, + TranslateModule, + UiSwitchModule, ], standalone: true, }) diff --git a/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts b/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts index 75928c8440..69db9b228f 100644 --- a/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts +++ b/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts @@ -7,7 +7,10 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './end-user-agreement-content.component.html', styleUrls: ['./end-user-agreement-content.component.scss'], standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) /** * Component displaying the contents of the End User Agreement diff --git a/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts b/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts index 88cb46e377..e4571bba93 100644 --- a/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts +++ b/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LogOutAction } from '../../core/auth/auth.actions'; import { AuthService } from '../../core/auth/auth.service'; @@ -39,17 +39,17 @@ describe('EndUserAgreementComponent', () => { redirectUrl = 'redirect/url'; endUserAgreementService = jasmine.createSpyObj('endUserAgreementService', { - hasCurrentUserOrCookieAcceptedAgreement: observableOf(false), - setUserAcceptedAgreement: observableOf(true), + hasCurrentUserOrCookieAcceptedAgreement: of(false), + setUserAcceptedAgreement: of(true), }); notificationsService = jasmine.createSpyObj('notificationsService', ['success', 'error']); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); store = jasmine.createSpyObj('store', ['dispatch']); router = jasmine.createSpyObj('router', ['navigate', 'navigateByUrl']); route = Object.assign(new ActivatedRouteStub(), { - queryParams: observableOf({ + queryParams: of({ redirect: redirectUrl, }), }) as any; @@ -85,7 +85,7 @@ describe('EndUserAgreementComponent', () => { describe('when the user hasn\'t accepted the agreement', () => { beforeEach(() => { - (endUserAgreementService.hasCurrentUserOrCookieAcceptedAgreement as jasmine.Spy).and.returnValue(observableOf(false)); + (endUserAgreementService.hasCurrentUserOrCookieAcceptedAgreement as jasmine.Spy).and.returnValue(of(false)); component.ngOnInit(); fixture.detectChanges(); }); @@ -103,7 +103,7 @@ describe('EndUserAgreementComponent', () => { describe('when the user has accepted the agreement', () => { beforeEach(() => { - (endUserAgreementService.hasCurrentUserOrCookieAcceptedAgreement as jasmine.Spy).and.returnValue(observableOf(true)); + (endUserAgreementService.hasCurrentUserOrCookieAcceptedAgreement as jasmine.Spy).and.returnValue(of(true)); component.ngOnInit(); fixture.detectChanges(); }); @@ -120,7 +120,7 @@ describe('EndUserAgreementComponent', () => { describe('submit', () => { describe('when accepting the agreement was successful', () => { beforeEach(() => { - (endUserAgreementService.setUserAcceptedAgreement as jasmine.Spy).and.returnValue(observableOf(true)); + (endUserAgreementService.setUserAcceptedAgreement as jasmine.Spy).and.returnValue(of(true)); component.submit(); }); @@ -135,7 +135,7 @@ describe('EndUserAgreementComponent', () => { describe('when accepting the agreement was unsuccessful', () => { beforeEach(() => { - (endUserAgreementService.setUserAcceptedAgreement as jasmine.Spy).and.returnValue(observableOf(false)); + (endUserAgreementService.setUserAcceptedAgreement as jasmine.Spy).and.returnValue(of(false)); component.submit(); }); @@ -149,7 +149,7 @@ describe('EndUserAgreementComponent', () => { describe('cancel', () => { describe('when the user is authenticated', () => { beforeEach(() => { - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(true)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(true)); component.cancel(); }); @@ -160,7 +160,7 @@ describe('EndUserAgreementComponent', () => { describe('when the user is not authenticated', () => { beforeEach(() => { - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false)); component.cancel(); }); diff --git a/src/app/info/end-user-agreement/end-user-agreement.component.ts b/src/app/info/end-user-agreement/end-user-agreement.component.ts index e9835945f5..3536cf9da1 100644 --- a/src/app/info/end-user-agreement/end-user-agreement.component.ts +++ b/src/app/info/end-user-agreement/end-user-agreement.component.ts @@ -12,7 +12,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { map, switchMap, @@ -33,7 +33,12 @@ import { EndUserAgreementContentComponent } from './end-user-agreement-content/e templateUrl: './end-user-agreement.component.html', styleUrls: ['./end-user-agreement.component.scss'], standalone: true, - imports: [EndUserAgreementContentComponent, FormsModule, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + EndUserAgreementContentComponent, + FormsModule, + TranslateModule, + ], }) /** * Component displaying the End User Agreement and an option to accept it @@ -82,7 +87,7 @@ export class EndUserAgreementComponent implements OnInit { return this.route.queryParams.pipe(map((params) => params.redirect)); } else { this.notificationsService.error(this.translate.instant('info.end-user-agreement.accept.error')); - return observableOf(undefined); + return of(undefined); } }), take(1), diff --git a/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts b/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts index 05e6474c3d..e79d74bc9c 100644 --- a/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts +++ b/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts @@ -11,7 +11,9 @@ import { EndUserAgreementComponent } from './end-user-agreement.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [EndUserAgreementComponent], + imports: [ + EndUserAgreementComponent, + ], }) export class ThemedEndUserAgreementComponent extends ThemedComponent { diff --git a/src/app/info/feedback/feedback-form/feedback-form.component.ts b/src/app/info/feedback/feedback-form/feedback-form.component.ts index fd7bb09eb8..7c27609b33 100644 --- a/src/app/info/feedback/feedback-form/feedback-form.component.ts +++ b/src/app/info/feedback/feedback-form/feedback-form.component.ts @@ -39,7 +39,13 @@ import { NotificationsService } from '../../../shared/notifications/notification templateUrl: './feedback-form.component.html', styleUrls: ['./feedback-form.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, ErrorComponent, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + ErrorComponent, + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) /** * Component displaying the contents of the Feedback Statement diff --git a/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts b/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts index 0a72323f08..ba17a7028e 100644 --- a/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts +++ b/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts @@ -11,7 +11,9 @@ import { FeedbackFormComponent } from './feedback-form.component'; styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [FeedbackFormComponent], + imports: [ + FeedbackFormComponent, + ], }) export class ThemedFeedbackFormComponent extends ThemedComponent { diff --git a/src/app/info/feedback/feedback.component.ts b/src/app/info/feedback/feedback.component.ts index 1fdf8740c3..40b723df8e 100644 --- a/src/app/info/feedback/feedback.component.ts +++ b/src/app/info/feedback/feedback.component.ts @@ -7,7 +7,9 @@ import { ThemedFeedbackFormComponent } from './feedback-form/themed-feedback-for templateUrl: './feedback.component.html', styleUrls: ['./feedback.component.scss'], standalone: true, - imports: [ThemedFeedbackFormComponent], + imports: [ + ThemedFeedbackFormComponent, + ], }) /** * Component displaying the Feedback Statement diff --git a/src/app/info/feedback/themed-feedback.component.ts b/src/app/info/feedback/themed-feedback.component.ts index a5713b839f..dc23c4366a 100644 --- a/src/app/info/feedback/themed-feedback.component.ts +++ b/src/app/info/feedback/themed-feedback.component.ts @@ -11,7 +11,9 @@ import { FeedbackComponent } from './feedback.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [FeedbackComponent], + imports: [ + FeedbackComponent, + ], }) export class ThemedFeedbackComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/info/notify-info/notify-info.component.ts b/src/app/info/notify-info/notify-info.component.ts index a9b4661fad..1989e56174 100644 --- a/src/app/info/notify-info/notify-info.component.ts +++ b/src/app/info/notify-info/notify-info.component.ts @@ -17,9 +17,9 @@ import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-inf templateUrl: './notify-info.component.html', styleUrls: ['./notify-info.component.scss'], imports: [ + AsyncPipe, RouterLink, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/info/privacy/privacy-content/privacy-content.component.ts b/src/app/info/privacy/privacy-content/privacy-content.component.ts index 4e9e58a44f..c148fb865d 100644 --- a/src/app/info/privacy/privacy-content/privacy-content.component.ts +++ b/src/app/info/privacy/privacy-content/privacy-content.component.ts @@ -7,7 +7,10 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './privacy-content.component.html', styleUrls: ['./privacy-content.component.scss'], standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) /** * Component displaying the contents of the Privacy Statement diff --git a/src/app/info/privacy/privacy.component.ts b/src/app/info/privacy/privacy.component.ts index 7b75f85a60..5bb10f51b4 100644 --- a/src/app/info/privacy/privacy.component.ts +++ b/src/app/info/privacy/privacy.component.ts @@ -7,7 +7,9 @@ import { PrivacyContentComponent } from './privacy-content/privacy-content.compo templateUrl: './privacy.component.html', styleUrls: ['./privacy.component.scss'], standalone: true, - imports: [PrivacyContentComponent], + imports: [ + PrivacyContentComponent, + ], }) /** * Component displaying the Privacy Statement diff --git a/src/app/info/privacy/themed-privacy.component.ts b/src/app/info/privacy/themed-privacy.component.ts index 117727da08..ff29a4ffa3 100644 --- a/src/app/info/privacy/themed-privacy.component.ts +++ b/src/app/info/privacy/themed-privacy.component.ts @@ -11,7 +11,9 @@ import { PrivacyComponent } from './privacy.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [PrivacyComponent], + imports: [ + PrivacyComponent, + ], }) export class ThemedPrivacyComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/item-page/alerts/item-alerts.component.ts b/src/app/item-page/alerts/item-alerts.component.ts index 3dbe0f2562..04e8c94767 100644 --- a/src/app/item-page/alerts/item-alerts.component.ts +++ b/src/app/item-page/alerts/item-alerts.component.ts @@ -34,9 +34,9 @@ import { styleUrls: ['./item-alerts.component.scss'], imports: [ AlertComponent, - TranslateModule, - RouterLink, AsyncPipe, + RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/alerts/themed-item-alerts.component.ts b/src/app/item-page/alerts/themed-item-alerts.component.ts index 94197f3fb4..15d324af18 100644 --- a/src/app/item-page/alerts/themed-item-alerts.component.ts +++ b/src/app/item-page/alerts/themed-item-alerts.component.ts @@ -15,7 +15,9 @@ import { ItemAlertsComponent } from './item-alerts.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [ItemAlertsComponent], + imports: [ + ItemAlertsComponent, + ], }) export class ThemedItemAlertsComponent extends ThemedComponent { protected inAndOutputNames: (keyof ItemAlertsComponent & keyof this)[] = ['item']; diff --git a/src/app/item-page/bitstreams/request-a-copy/altcha-captcha.component.ts b/src/app/item-page/bitstreams/request-a-copy/altcha-captcha.component.ts index a9d5fd77f3..2b02a233fb 100644 --- a/src/app/item-page/bitstreams/request-a-copy/altcha-captcha.component.ts +++ b/src/app/item-page/bitstreams/request-a-copy/altcha-captcha.component.ts @@ -20,11 +20,11 @@ import { VarDirective } from '../../../shared/utils/var.directive'; selector: 'ds-altcha-captcha', templateUrl: './altcha-captcha.component.html', imports: [ - TranslateModule, - RouterLink, AsyncPipe, - ReactiveFormsModule, NgIf, + ReactiveFormsModule, + RouterLink, + TranslateModule, VarDirective, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], diff --git a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts index 7456ec6200..f3fadf6ab7 100644 --- a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts +++ b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts @@ -19,7 +19,7 @@ import { import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { AuthService } from '../../../core/auth/auth.service'; @@ -78,23 +78,23 @@ describe('BitstreamRequestACopyPageComponent', () => { }, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(false), - getAuthenticatedUserFromStore: observableOf(eperson), + isAuthenticated: of(false), + getAuthenticatedUserFromStore: of(eperson), }); authorizationService = jasmine.createSpyObj('authorizationSerivice', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); itemRequestDataService = jasmine.createSpyObj('itemRequestDataService', { requestACopy: createSuccessfulRemoteDataObject$({}), - isProtectedByCaptcha: observableOf(true), + isProtectedByCaptcha: of(true), }); requestService = Object.assign(getMockRequestService(), { getByHref(requestHref: string) { const responseCacheEntry = new RequestEntry(); responseCacheEntry.response = new RestResponse(true, 200, 'OK'); - return observableOf(responseCacheEntry); + return of(responseCacheEntry); }, removeByHrefSubstring(href: string) { // Do nothing @@ -118,12 +118,12 @@ describe('BitstreamRequestACopyPageComponent', () => { }); activatedRoute = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject( item, ), }), - queryParams: observableOf({ + queryParams: of({ bitstream : bitstream.uuid, }), }; @@ -193,7 +193,7 @@ describe('BitstreamRequestACopyPageComponent', () => { describe('when the user is logged in', () => { beforeEach(waitForAsync(() => { init(); - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(true)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(true)); initTestbed(); })); beforeEach(() => { @@ -213,12 +213,12 @@ describe('BitstreamRequestACopyPageComponent', () => { beforeEach(waitForAsync(() => { init(); activatedRoute = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject( item, ), }), - queryParams: observableOf({ + queryParams: of({ }), }; initTestbed(); @@ -242,7 +242,7 @@ describe('BitstreamRequestACopyPageComponent', () => { describe('when the user has authorization to download the file', () => { beforeEach(waitForAsync(() => { init(); - (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(true)); + (authService.isAuthenticated as jasmine.Spy).and.returnValue(of(true)); initTestbed(); })); beforeEach(() => { diff --git a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts index 23dd76d4ef..bb7b809ad2 100644 --- a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts +++ b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts @@ -28,7 +28,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -70,12 +70,12 @@ import { AltchaCaptchaComponent } from './altcha-captcha.component'; selector: 'ds-bitstream-request-a-copy-page', templateUrl: './bitstream-request-a-copy-page.component.html', imports: [ - TranslateModule, - RouterLink, - AsyncPipe, - ReactiveFormsModule, - BtnDisabledDirective, AltchaCaptchaComponent, + AsyncPipe, + BtnDisabledDirective, + ReactiveFormsModule, + RouterLink, + TranslateModule, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], standalone: true, @@ -230,7 +230,7 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy { if (authenticated) { return this.auth.getAuthenticatedUserFromStore(); } else { - return observableOf(undefined); + return of(undefined); } }), ); diff --git a/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts index 6a57c6d4b5..78c8c0b0a4 100644 --- a/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts +++ b/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts @@ -12,7 +12,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { environment } from '../../../../environments/environment'; import { AuthService } from '../../../core/auth/auth.service'; @@ -95,12 +95,12 @@ describe('UploadBitstreamComponent', () => { const routerStub = new RouterStub(); const restEndpoint = 'fake-rest-endpoint'; const mockItemDataService = jasmine.createSpyObj('mockItemDataService', { - getBitstreamsEndpoint: observableOf(restEndpoint), + getBitstreamsEndpoint: of(restEndpoint), createBundle: createSuccessfulRemoteDataObject$(createdBundle), getBundles: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [bundle])), }); const bundleService = jasmine.createSpyObj('bundleService', { - getBitstreamsEndpoint: observableOf(restEndpoint), + getBitstreamsEndpoint: of(restEndpoint), findById: createSuccessfulRemoteDataObject$(bundle), }); const authToken = 'fake-auth-token'; @@ -287,10 +287,10 @@ describe('UploadBitstreamComponent', () => { */ function createUploadBitstreamTestingModule(queryParams) { routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), - queryParams: observableOf(queryParams), + queryParams: of(queryParams), snapshot: { queryParams: queryParams, params: { diff --git a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts index 00d0a9a420..e33077bd17 100644 --- a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts +++ b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts @@ -16,7 +16,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -56,12 +56,12 @@ import { getEntityEditRoute } from '../../item-page-routing-paths'; selector: 'ds-upload-bitstream', templateUrl: './upload-bitstream.component.html', imports: [ - TranslateModule, AsyncPipe, - VarDirective, DsoInputSuggestionsComponent, FormsModule, + TranslateModule, UploaderComponent, + VarDirective, ], standalone: true, }) @@ -179,7 +179,7 @@ export class UploadBitstreamComponent implements OnInit, OnDestroy { }), ); } - return observableOf(remoteData.payload.page); + return of(remoteData.payload.page); } })); this.selectedBundleId = this.route.snapshot.queryParams.bundle; diff --git a/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts b/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts index da92f53c1d..144c9015f3 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts @@ -22,7 +22,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { Item } from '../../core/shared/item.model'; @@ -38,14 +38,14 @@ describe('EditItemPageComponent', () => { route: ActivatedRouteSnapshot, state: RouterStateSnapshot, ): Observable => { - return observableOf(true); + return of(true); }; const AcceptNoneGuard: CanActivateFn = ( route: ActivatedRouteSnapshot, state: RouterStateSnapshot, ): Observable => { - return observableOf(false); + return of(false); }; const accessiblePages = ['accessible']; @@ -75,7 +75,7 @@ describe('EditItemPageComponent', () => { }, ], }, - data: observableOf({ dso: createSuccessfulRemoteDataObject(new Item()) }), + data: of({ dso: createSuccessfulRemoteDataObject(new Item()) }), }; beforeEach(waitForAsync(() => { diff --git a/src/app/item-page/edit-item-page/edit-item-page.component.ts b/src/app/item-page/edit-item-page/edit-item-page.component.ts index 64a32968e5..e0fc5f577e 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.component.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.component.ts @@ -22,7 +22,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -44,12 +44,12 @@ import { getItemPageRoute } from '../item-page-routing-paths'; fadeInOut, ], imports: [ - TranslateModule, - NgClass, AsyncPipe, NgbTooltipModule, + NgClass, RouterLink, RouterOutlet, + TranslateModule, ], standalone: true, }) @@ -82,7 +82,7 @@ export class EditItemPageComponent implements OnInit { this.pages = this.route.routeConfig.children .filter((child: Route) => isNotEmpty(child.path)) .map((child: Route) => { - let enabled = observableOf(true); + let enabled = of(true); if (isNotEmpty(child.canActivate)) { enabled = observableCombineLatest(child.canActivate.map((guardFn: CanActivateFn) => { return runInInjectionContext(this.injector, () => { diff --git a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts index 15bd82b82a..4db209cedf 100644 --- a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts @@ -12,7 +12,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LinkService } from '../../../core/cache/builders/link.service'; import { Bitstream } from '../../../core/shared/bitstream.model'; @@ -83,7 +83,7 @@ describe('ItemAuthorizationsComponent test suite', () => { }); const routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(item), }), }; diff --git a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts index 881de3d6c9..a641f72ac2 100644 --- a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts +++ b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts @@ -11,7 +11,7 @@ import isEqual from 'lodash/isEqual'; import { BehaviorSubject, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -57,11 +57,11 @@ interface BundleBitstreamsMapEntry { templateUrl: './item-authorizations.component.html', styleUrls: ['./item-authorizations.component.scss'], imports: [ - ResourcePoliciesComponent, - NgbCollapseModule, - TranslateModule, - AsyncPipe, AlertComponent, + AsyncPipe, + NgbCollapseModule, + ResourcePoliciesComponent, + TranslateModule, ], standalone: true, }) @@ -174,7 +174,7 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy { getFirstSucceededRemoteDataWithNotEmptyPayload(), catchError((error: unknown) => { console.error(error); - return observableOf(buildPaginatedList(null, [])); + return of(buildPaginatedList(null, [])); }), ); @@ -223,7 +223,7 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy { getFirstSucceededRemoteDataPayload(), catchError((error: unknown) => { console.error(error); - return observableOf(buildPaginatedList(null, [])); + return of(buildPaginatedList(null, [])); }), ); } diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts index 874107e6de..3e657f6471 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts @@ -13,7 +13,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; @@ -107,25 +107,25 @@ describe('ItemBitstreamsComponent', () => { beforeEach(waitForAsync(() => { objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { - getFieldUpdates: observableOf({ + getFieldUpdates: of({ [bitstream1.uuid]: fieldUpdate1, [bitstream2.uuid]: fieldUpdate2, }), - getFieldUpdatesExclusive: observableOf({ + getFieldUpdatesExclusive: of({ [bitstream1.uuid]: fieldUpdate1, [bitstream2.uuid]: fieldUpdate2, }), saveAddFieldUpdate: {}, discardFieldUpdates: {}, discardAllFieldUpdates: {}, - reinstateFieldUpdates: observableOf(true), + reinstateFieldUpdates: of(true), initialize: {}, - getUpdatedFields: observableOf([bitstream1, bitstream2]), - getLastModified: observableOf(date), - hasUpdates: observableOf(true), - isReinstatable: observableOf(false), - isValidPage: observableOf(true), - getMoveOperations: observableOf(moveOperations), + getUpdatedFields: of([bitstream1, bitstream2]), + getLastModified: of(date), + hasUpdates: of(true), + isReinstatable: of(false), + isValidPage: of(true), + getMoveOperations: of(moveOperations), }, ); router = Object.assign(new RouterStub(), { @@ -144,7 +144,7 @@ describe('ItemBitstreamsComponent', () => { }); requestService = getMockRequestService(); searchConfig = Object.assign({ - paginatedSearchOptions: observableOf({}), + paginatedSearchOptions: of({}), }); item = Object.assign(new Item(), { @@ -164,9 +164,9 @@ describe('ItemBitstreamsComponent', () => { }); route = Object.assign({ parent: { - data: observableOf({ dso: createSuccessfulRemoteDataObject(item) }), + data: of({ dso: createSuccessfulRemoteDataObject(item) }), }, - data: observableOf({}), + data: of({}), url: url, }); bundleService = jasmine.createSpyObj('bundleService', { diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts index bd6679d6a1..4cdb5367fa 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts @@ -69,15 +69,15 @@ import { ItemEditBitstreamBundleComponent } from './item-edit-bitstream-bundle/i styleUrls: ['./item-bitstreams.component.scss'], templateUrl: './item-bitstreams.component.html', imports: [ - CommonModule, + AlertComponent, AsyncPipe, - TranslateModule, + BtnDisabledDirective, + CommonModule, ItemEditBitstreamBundleComponent, RouterLink, - VarDirective, ThemedLoadingComponent, - AlertComponent, - BtnDisabledDirective, + TranslateModule, + VarDirective, ], providers: [ObjectValuesPipe], standalone: true, diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts index bd99b29c47..ff0567eb9f 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts @@ -10,7 +10,6 @@ import { } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { - of as observableOf, of, Subject, } from 'rxjs'; @@ -66,7 +65,7 @@ describe('ItemEditBitstreamBundleComponent', () => { const restEndpoint = 'fake-rest-endpoint'; const bundleService = jasmine.createSpyObj('bundleService', { - getBitstreamsEndpoint: observableOf(restEndpoint), + getBitstreamsEndpoint: of(restEndpoint), getBitstreams: createSuccessfulRemoteDataObject$(createPaginatedList([])), }); diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts index 969a971ce9..027784df1b 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts @@ -75,16 +75,16 @@ import { styleUrls: ['../item-bitstreams.component.scss', './item-edit-bitstream-bundle.component.scss'], templateUrl: './item-edit-bitstream-bundle.component.html', imports: [ - CommonModule, - TranslateModule, - RouterLink, - PaginationComponent, - NgbTooltipModule, - CdkDropList, - NgbDropdownModule, - CdkDrag, BrowserOnlyPipe, BtnDisabledDirective, + CdkDrag, + CdkDropList, + CommonModule, + NgbDropdownModule, + NgbTooltipModule, + PaginationComponent, + RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts index 624f71242a..5c8a896d53 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -74,7 +74,7 @@ describe('ItemCollectionMapperComponent', () => { name: 'test-item', }); const mockItemRD: RemoteData = createSuccessfulRemoteDataObject(mockItem); - const mockSearchOptions = observableOf(new PaginatedSearchOptions({ + const mockSearchOptions = of(new PaginatedSearchOptions({ pagination: Object.assign(new PaginationComponentOptions(), { id: 'search-page-configuration', pageSize: 10, @@ -96,37 +96,37 @@ describe('ItemCollectionMapperComponent', () => { const itemDataServiceStub = { mapToCollection: () => createSuccessfulRemoteDataObject$({}), removeMappingFromCollection: () => createSuccessfulRemoteDataObject$({}), - getMappedCollectionsEndpoint: () => observableOf('rest/api/mappedCollectionsEndpoint'), - getMappedCollections: () => observableOf(mockCollectionsRD), + getMappedCollectionsEndpoint: () => of('rest/api/mappedCollectionsEndpoint'), + getMappedCollections: () => of(mockCollectionsRD), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ clearMappedCollectionsRequests: () => {}, /* eslint-enable no-empty,@typescript-eslint/no-empty-function */ }; const collectionDataServiceStub = { - findListByHref: () => observableOf(mockCollectionsRD), + findListByHref: () => of(mockCollectionsRD), }; const searchServiceStub = Object.assign(new SearchServiceStub(), { - search: () => observableOf(mockCollectionsRD), + search: () => of(mockCollectionsRD), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ clearDiscoveryRequests: () => {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ }); const activatedRouteStub = { parent: { - data: observableOf({ + data: of({ dso: mockItemRD, }), }, }; const translateServiceStub = { - get: () => observableOf('test-message of item ' + mockItem.name), + get: () => of('test-message of item ' + mockItem.name), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), onDefaultLangChange: new EventEmitter(), }; const authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); beforeEach(waitForAsync(() => { diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts index f1be1a99a6..c5fa717ceb 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts @@ -71,12 +71,12 @@ import { getItemPageRoute } from '../../item-page-routing-paths'; fadeInOut, ], imports: [ - NgbNavModule, - CollectionSelectComponent, - ThemedSearchFormComponent, AsyncPipe, - TranslateModule, BrowserOnlyPipe, + CollectionSelectComponent, + NgbNavModule, + ThemedSearchFormComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts b/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts index 4b92ceb09f..03de7fd659 100644 --- a/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../core/shared/item.model'; @@ -33,7 +33,7 @@ describe('ItemCurateComponent', () => { beforeEach(waitForAsync(() => { routeStub = { parent: { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(item), }), }, diff --git a/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts b/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts index 6767d507f2..def02b0d3f 100644 --- a/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts +++ b/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts @@ -25,9 +25,9 @@ import { hasValue } from '../../../shared/empty.util'; selector: 'ds-item-curate', templateUrl: './item-curate.component.html', imports: [ + AsyncPipe, CurationFormComponent, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts index e54d41296c..a162808db1 100644 --- a/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts @@ -16,7 +16,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { EMPTY, - of as observableOf, + of, } from 'rxjs'; import { LinkService } from '../../../core/cache/builders/link.service'; @@ -125,7 +125,7 @@ describe('ItemDeleteComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), }; @@ -146,12 +146,12 @@ describe('ItemDeleteComponent', () => { initialize: () => { // do nothing }, - isSelectedVirtualMetadata: (type) => observableOf(typesSelection[type]), + isSelectedVirtualMetadata: (type) => of(typesSelection[type]), }; relationshipService = jasmine.createSpyObj('relationshipService', { - getItemRelationshipsArray: observableOf(relationships), + getItemRelationshipsArray: of(relationships), }, ); diff --git a/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts index e1bd37f9e5..0e394edb59 100644 --- a/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts +++ b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts @@ -24,7 +24,7 @@ import { combineLatest, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -98,13 +98,13 @@ class RelationshipDTO { selector: 'ds-item-delete', templateUrl: '../item-delete/item-delete.component.html', imports: [ - TranslateModule, + AsyncPipe, + BtnDisabledDirective, ListableObjectComponentLoaderComponent, ModifyItemOverviewComponent, - AsyncPipe, - VarDirective, RouterLink, - BtnDisabledDirective, + TranslateModule, + VarDirective, ], standalone: true, }) @@ -201,7 +201,7 @@ export class ItemDeleteComponent map((relationshipTypes) => relationshipTypes.page), switchMap((types) => { if (types.length === 0) { - return observableOf(types); + return of(types); } return combineLatest(types.map((type) => this.getRelationships(type))).pipe( map((relationships) => diff --git a/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts b/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts index 658223c661..9e23d51a0f 100644 --- a/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts @@ -12,7 +12,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RequestService } from '../../../core/data/request.service'; @@ -70,7 +70,7 @@ describe('ItemMoveComponent', () => { }); const routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(Object.assign(new Item(), { id: 'item1', owningCollection: createSuccessfulRemoteDataObject$(Object.assign(new Collection(), { diff --git a/src/app/item-page/edit-item-page/item-move/item-move.component.ts b/src/app/item-page/edit-item-page/item-move/item-move.component.ts index 1c6e78850a..96cdad3e1c 100644 --- a/src/app/item-page/edit-item-page/item-move/item-move.component.ts +++ b/src/app/item-page/edit-item-page/item-move/item-move.component.ts @@ -47,13 +47,13 @@ import { selector: 'ds-item-move', templateUrl: './item-move.component.html', imports: [ - TranslateModule, - NgbModule, - FormsModule, - RouterLink, AsyncPipe, AuthorizedCollectionSelectorComponent, BtnDisabledDirective, + FormsModule, + NgbModule, + RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts b/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts index cb8a754bfb..fa9fb421fd 100644 --- a/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts +++ b/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts @@ -14,10 +14,10 @@ import { ItemOperation } from './itemOperation.model'; selector: 'ds-item-operation', templateUrl: './item-operation.component.html', imports: [ - TranslateModule, - RouterLink, - NgbTooltipModule, BtnDisabledDirective, + NgbTooltipModule, + RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-page-access-control.guard.ts b/src/app/item-page/edit-item-page/item-page-access-control.guard.ts index bcf5ea9a13..4f8f938a7a 100644 --- a/src/app/item-page/edit-item-page/item-page-access-control.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-access-control.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -11,5 +11,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageAccessControlGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.AdministratorOf), + () => of(FeatureID.AdministratorOf), ); diff --git a/src/app/item-page/edit-item-page/item-page-bitstreams.guard.ts b/src/app/item-page/edit-item-page/item-page-bitstreams.guard.ts index 32af7e603e..43482d015b 100644 --- a/src/app/item-page/edit-item-page/item-page-bitstreams.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-bitstreams.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageBitstreamsGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanManageBitstreamBundles), + () => of(FeatureID.CanManageBitstreamBundles), ); diff --git a/src/app/item-page/edit-item-page/item-page-collection-mapper.guard.ts b/src/app/item-page/edit-item-page/item-page-collection-mapper.guard.ts index 56d9675d92..ab975b5282 100644 --- a/src/app/item-page/edit-item-page/item-page-collection-mapper.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-collection-mapper.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageCollectionMapperGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanManageMappings), + () => of(FeatureID.CanManageMappings), ); diff --git a/src/app/item-page/edit-item-page/item-page-curate.guard.ts b/src/app/item-page/edit-item-page/item-page-curate.guard.ts index 40cfe00c2f..fbbd6d8601 100644 --- a/src/app/item-page/edit-item-page/item-page-curate.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-curate.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -11,5 +11,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageCurateGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.AdministratorOf), + () => of(FeatureID.AdministratorOf), ); diff --git a/src/app/item-page/edit-item-page/item-page-delete.guard.spec.ts b/src/app/item-page/edit-item-page/item-page-delete.guard.spec.ts index d2d7954c6f..be4da97591 100644 --- a/src/app/item-page/edit-item-page/item-page-delete.guard.spec.ts +++ b/src/app/item-page/edit-item-page/item-page-delete.guard.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from 'src/app/core/auth/auth.service'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; @@ -36,17 +36,17 @@ describe('itemPageDeleteGuard', () => { store = jasmine.createSpyObj('store', { dispatch: {}, - pipe: observableOf(true), + pipe: of(true), }); authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, navigateByUrl: undefined, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { diff --git a/src/app/item-page/edit-item-page/item-page-delete.guard.ts b/src/app/item-page/edit-item-page/item-page-delete.guard.ts index 99d79ca68f..560fc2487c 100644 --- a/src/app/item-page/edit-item-page/item-page-delete.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-delete.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageDeleteGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanDelete), + () => of(FeatureID.CanDelete), ); diff --git a/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.spec.ts b/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.spec.ts index f03e79ad36..2aa38323f8 100644 --- a/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.spec.ts +++ b/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from 'src/app/core/auth/auth.service'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; @@ -36,17 +36,17 @@ describe('itemPageEditAuthorizationsGuard', () => { store = jasmine.createSpyObj('store', { dispatch: {}, - pipe: observableOf(true), + pipe: of(true), }); authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, navigateByUrl: undefined, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { diff --git a/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.ts b/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.ts index c5032ac604..96fd1022f7 100644 --- a/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-edit-authorizations.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageEditAuthorizationsGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanManagePolicies), + () => of(FeatureID.CanManagePolicies), ); diff --git a/src/app/item-page/edit-item-page/item-page-metadata.guard.ts b/src/app/item-page/edit-item-page/item-page-metadata.guard.ts index f058eb7359..b68390e197 100644 --- a/src/app/item-page/edit-item-page/item-page-metadata.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-metadata.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageMetadataGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanEditMetadata), + () => of(FeatureID.CanEditMetadata), ); diff --git a/src/app/item-page/edit-item-page/item-page-move.guard.spec.ts b/src/app/item-page/edit-item-page/item-page-move.guard.spec.ts index d30f23817a..9041df5079 100644 --- a/src/app/item-page/edit-item-page/item-page-move.guard.spec.ts +++ b/src/app/item-page/edit-item-page/item-page-move.guard.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from 'src/app/core/auth/auth.service'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; @@ -36,17 +36,17 @@ describe('itemPageMoveGuard', () => { store = jasmine.createSpyObj('store', { dispatch: {}, - pipe: observableOf(true), + pipe: of(true), }); authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, navigateByUrl: undefined, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { diff --git a/src/app/item-page/edit-item-page/item-page-move.guard.ts b/src/app/item-page/edit-item-page/item-page-move.guard.ts index 307201ef90..b1fb6d966b 100644 --- a/src/app/item-page/edit-item-page/item-page-move.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-move.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageMoveGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanMove), + () => of(FeatureID.CanMove), ); diff --git a/src/app/item-page/edit-item-page/item-page-private.guard.spec.ts b/src/app/item-page/edit-item-page/item-page-private.guard.spec.ts index 3e573923d8..2b677d29f2 100644 --- a/src/app/item-page/edit-item-page/item-page-private.guard.spec.ts +++ b/src/app/item-page/edit-item-page/item-page-private.guard.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthService } from 'src/app/core/auth/auth.service'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; @@ -36,17 +36,17 @@ describe('itemPagePrivateGuard', () => { store = jasmine.createSpyObj('store', { dispatch: {}, - pipe: observableOf(true), + pipe: of(true), }); authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); router = jasmine.createSpyObj('router', { parseUrl: {}, navigateByUrl: undefined, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); parentRoute = { diff --git a/src/app/item-page/edit-item-page/item-page-private.guard.ts b/src/app/item-page/edit-item-page/item-page-private.guard.ts index 64626542ff..4dedabf6f9 100644 --- a/src/app/item-page/edit-item-page/item-page-private.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-private.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPagePrivateGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanMakePrivate), + () => of(FeatureID.CanMakePrivate), ); diff --git a/src/app/item-page/edit-item-page/item-page-register-doi.guard.ts b/src/app/item-page/edit-item-page/item-page-register-doi.guard.ts index 9bedca518b..f9f13596fe 100644 --- a/src/app/item-page/edit-item-page/item-page-register-doi.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-register-doi.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageRegisterDoiGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanRegisterDOI), + () => of(FeatureID.CanRegisterDOI), ); diff --git a/src/app/item-page/edit-item-page/item-page-reinstate.guard.ts b/src/app/item-page/edit-item-page/item-page-reinstate.guard.ts index 3e60158d0a..75fe30ec40 100644 --- a/src/app/item-page/edit-item-page/item-page-reinstate.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-reinstate.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageReinstateGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.ReinstateItem), + () => of(FeatureID.ReinstateItem), ); diff --git a/src/app/item-page/edit-item-page/item-page-relationships.guard.ts b/src/app/item-page/edit-item-page/item-page-relationships.guard.ts index fe107977db..77b72e3606 100644 --- a/src/app/item-page/edit-item-page/item-page-relationships.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-relationships.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageRelationshipsGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanManageRelationships), + () => of(FeatureID.CanManageRelationships), ); diff --git a/src/app/item-page/edit-item-page/item-page-status.guard.ts b/src/app/item-page/edit-item-page/item-page-status.guard.ts index deeb2dbb5e..e4d3aa2d21 100644 --- a/src/app/item-page/edit-item-page/item-page-status.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-status.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSomeFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -13,5 +13,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageStatusGuard: CanActivateFn = dsoPageSomeFeatureGuard( () => itemPageResolver, - () => observableOf([FeatureID.CanManageMappings, FeatureID.WithdrawItem, FeatureID.ReinstateItem, FeatureID.CanManagePolicies, FeatureID.CanMakePrivate, FeatureID.CanDelete, FeatureID.CanMove, FeatureID.CanRegisterDOI]), + () => of([FeatureID.CanManageMappings, FeatureID.WithdrawItem, FeatureID.ReinstateItem, FeatureID.CanManagePolicies, FeatureID.CanMakePrivate, FeatureID.CanDelete, FeatureID.CanMove, FeatureID.CanRegisterDOI]), ); diff --git a/src/app/item-page/edit-item-page/item-page-version-history.guard.ts b/src/app/item-page/edit-item-page/item-page-version-history.guard.ts index 99d581dce6..36ff999b44 100644 --- a/src/app/item-page/edit-item-page/item-page-version-history.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-version-history.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageVersionHistoryGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanManageVersions), + () => of(FeatureID.CanManageVersions), ); diff --git a/src/app/item-page/edit-item-page/item-page-withdraw.guard.ts b/src/app/item-page/edit-item-page/item-page-withdraw.guard.ts index 8e41b1c653..2bd68fff33 100644 --- a/src/app/item-page/edit-item-page/item-page-withdraw.guard.ts +++ b/src/app/item-page/edit-item-page/item-page-withdraw.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const itemPageWithdrawGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.WithdrawItem), + () => of(FeatureID.WithdrawItem), ); diff --git a/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts b/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts index 0c4ca07f3f..ae42ab195c 100644 --- a/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts @@ -14,7 +14,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RestResponse } from '../../../core/cache/response.models'; import { ItemDataService } from '../../../core/data/item-data.service'; @@ -60,7 +60,7 @@ describe('ItemPrivateComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), }; diff --git a/src/app/item-page/edit-item-page/item-private/item-private.component.ts b/src/app/item-page/edit-item-page/item-private/item-private.component.ts index fe82c3d677..cd5ed95304 100644 --- a/src/app/item-page/edit-item-page/item-private/item-private.component.ts +++ b/src/app/item-page/edit-item-page/item-private/item-private.component.ts @@ -23,8 +23,8 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac standalone: true, imports: [ ModifyItemOverviewComponent, - TranslateModule, RouterLink, + TranslateModule, ], }) /** diff --git a/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts b/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts index 64ac870804..c50399abfb 100644 --- a/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts @@ -14,7 +14,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../../core/data/item-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -57,7 +57,7 @@ describe('ItemPublicComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), }; diff --git a/src/app/item-page/edit-item-page/item-public/item-public.component.ts b/src/app/item-page/edit-item-page/item-public/item-public.component.ts index c4858fd250..07574ef419 100644 --- a/src/app/item-page/edit-item-page/item-public/item-public.component.ts +++ b/src/app/item-page/edit-item-page/item-public/item-public.component.ts @@ -23,8 +23,8 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac standalone: true, imports: [ ModifyItemOverviewComponent, - TranslateModule, RouterLink, + TranslateModule, ], }) /** diff --git a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts index 36e5c143c5..677a3576fe 100644 --- a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts @@ -14,7 +14,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { IdentifierDataService } from '../../../core/data/identifier-data.service'; import { ItemDataService } from '../../../core/data/item-data.service'; @@ -65,7 +65,7 @@ describe('ItemRegisterDoiComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(Object.assign(new Item(), { id: 'fake-id', })), diff --git a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts index 4c484d2f4f..8897627b5a 100644 --- a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts +++ b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts @@ -34,10 +34,10 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac selector: 'ds-item-register-doi', templateUrl: './item-register-doi-component.html', imports: [ + AsyncPipe, ModifyItemOverviewComponent, RouterLink, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts index ff517a6f25..62fabddd74 100644 --- a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts @@ -14,7 +14,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../../core/data/item-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -57,7 +57,7 @@ describe('ItemReinstateComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(Object.assign(new Item(), { id: 'fake-id', })), diff --git a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts index 534a79c602..e409308b30 100644 --- a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts +++ b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts @@ -23,8 +23,8 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac standalone: true, imports: [ ModifyItemOverviewComponent, - TranslateModule, RouterLink, + TranslateModule, ], }) /** diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-item-relationships.service.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-item-relationships.service.spec.ts index 4809a4f730..bfd02bb89a 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-item-relationships.service.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-item-relationships.service.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { v4 as uuidv4 } from 'uuid'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; @@ -174,7 +174,7 @@ describe('EditItemRelationshipsService', () => { }); it('should support performing multiple relationships manipulations in one submit() call', () => { - spyOn(objectUpdatesService, 'getFieldUpdates').and.returnValue(observableOf({ + spyOn(objectUpdatesService, 'getFieldUpdates').and.returnValue(of({ [`1-${relationshipItem1.uuid}`]: fieldUpdateAddRelationship1, [`1-${relationshipItem2.uuid}`]: fieldUpdateRemoveRelationship2, } as FieldUpdates)); diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list-wrapper/edit-relationship-list-wrapper.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list-wrapper/edit-relationship-list-wrapper.component.spec.ts index 077f609633..a901ab0423 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list-wrapper/edit-relationship-list-wrapper.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list-wrapper/edit-relationship-list-wrapper.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { ItemType } from '../../../../core/shared/item-relationships/item-type.model'; @@ -42,8 +42,8 @@ describe('EditRelationshipListWrapperComponent', () => { beforeEach(waitForAsync(() => { editItemRelationshipsService = jasmine.createSpyObj('editItemRelationshipsService', { - isProvidedItemTypeLeftType: observableOf(true), - shouldDisplayBothRelationshipSides: observableOf(false), + isProvidedItemTypeLeftType: of(true), + shouldDisplayBothRelationshipSides: of(false), }); @@ -99,7 +99,7 @@ describe('EditRelationshipListWrapperComponent', () => { describe('when the current item is right', () => { it('should render one relationship list section', () => { - (editItemRelationshipsService.isProvidedItemTypeLeftType as jasmine.Spy).and.returnValue(observableOf(false)); + (editItemRelationshipsService.isProvidedItemTypeLeftType as jasmine.Spy).and.returnValue(of(false)); comp.ngOnInit(); fixture.detectChanges(); @@ -110,7 +110,7 @@ describe('EditRelationshipListWrapperComponent', () => { describe('when the current item is both left and right', () => { it('should render two relationship list sections', () => { - (editItemRelationshipsService.shouldDisplayBothRelationshipSides as jasmine.Spy).and.returnValue(observableOf(true)); + (editItemRelationshipsService.shouldDisplayBothRelationshipSides as jasmine.Spy).and.returnValue(of(true)); comp.ngOnInit(); fixture.detectChanges(); diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts index f470b09341..8dafa9338d 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -95,7 +95,7 @@ describe('EditRelationshipListComponent', () => { comp.itemType = entityTypeLeft; comp.url = url; comp.relationshipType = relationshipType; - comp.hasChanges = observableOf(false); + comp.hasChanges = of(false); comp.currentItemIsLeftItem$ = currentItemIsLeftItem$; fixture.detectChanges(); }; @@ -196,7 +196,7 @@ describe('EditRelationshipListComponent', () => { objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { - getFieldUpdates: observableOf({ + getFieldUpdates: of({ [relationships[0].uuid]: fieldUpdate1, [relationships[1].uuid]: fieldUpdate2, }), @@ -210,7 +210,7 @@ describe('EditRelationshipListComponent', () => { { getRelatedItemsByLabel: createSuccessfulRemoteDataObject$(createPaginatedList([itemRight1, itemRight2])), getItemRelationshipsByLabel: createSuccessfulRemoteDataObject$(createPaginatedList(relationships)), - isLeftItem: observableOf(true), + isLeftItem: of(true), }, ); @@ -385,7 +385,7 @@ describe('EditRelationshipListComponent', () => { }); it('after hash changes changed', () => { - comp.hasChanges = observableOf(true); + comp.hasChanges = of(true); fixture.detectChanges(); const element = de.query(By.css('.btn-success')); expect(element.nativeElement?.getAttribute('aria-disabled')).toBe('true'); diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts index 67705295de..78ec013f89 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts @@ -89,15 +89,15 @@ import { EditRelationshipComponent } from '../edit-relationship/edit-relationshi styleUrls: ['./edit-relationship-list.component.scss'], templateUrl: './edit-relationship-list.component.html', imports: [ - EditRelationshipComponent, - PaginationComponent, AsyncPipe, - ObjectValuesPipe, - VarDirective, - TranslateModule, - NgClass, - ThemedLoadingComponent, BtnDisabledDirective, + EditRelationshipComponent, + NgClass, + ObjectValuesPipe, + PaginationComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts index 087866959c..f1ab48b436 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts @@ -13,7 +13,7 @@ import { NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service'; @@ -133,11 +133,11 @@ describe('EditRelationshipComponent', () => { mockNgbModal = { open: jasmine.createSpy('open').and.returnValue( - { componentInstance: {}, closed: observableOf({}) } as NgbModalRef, + { componentInstance: {}, closed: of({}) } as NgbModalRef, ), }; - spyOn(objectUpdatesService, 'isSelectedVirtualMetadata').and.callFake((a, b, uuid) => observableOf(itemSelection[uuid])); + spyOn(objectUpdatesService, 'isSelectedVirtualMetadata').and.callFake((a, b, uuid) => of(itemSelection[uuid])); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), EditRelationshipComponent], diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts index f14cb8c24f..f585037a70 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts @@ -47,11 +47,11 @@ import { VirtualMetadataComponent } from '../../virtual-metadata/virtual-metadat styleUrls: ['./edit-relationship.component.scss'], templateUrl: './edit-relationship.component.html', imports: [ - ListableObjectComponentLoaderComponent, AsyncPipe, + BtnDisabledDirective, + ListableObjectComponentLoaderComponent, TranslateModule, VirtualMetadataComponent, - BtnDisabledDirective, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts index 28380b3f27..d953318662 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts @@ -15,7 +15,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, - of as observableOf, + of, } from 'rxjs'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; @@ -158,58 +158,58 @@ describe('ItemRelationshipsComponent', () => { itemService = new ItemDataServiceStub(); routeStub = { - data: observableOf({}), + data: of({}), parent: { - data: observableOf({ dso: createSuccessfulRemoteDataObject(item) }), + data: of({ dso: createSuccessfulRemoteDataObject(item) }), }, }; objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { - getFieldUpdates: observableOf({ + getFieldUpdates: of({ [relationships[0].uuid]: fieldUpdate1, [relationships[1].uuid]: fieldUpdate2, }), - getFieldUpdatesExclusive: observableOf({ + getFieldUpdatesExclusive: of({ [relationships[0].uuid]: fieldUpdate1, [relationships[1].uuid]: fieldUpdate2, }), saveAddFieldUpdate: {}, discardFieldUpdates: {}, - reinstateFieldUpdates: observableOf(true), + reinstateFieldUpdates: of(true), initialize: {}, - getUpdatedFields: observableOf([author1, author2]), - getLastModified: observableOf(date), - hasUpdates: observableOf(true), - isReinstatable: observableOf(false), // should always return something --> its in ngOnInit - isValidPage: observableOf(true), + getUpdatedFields: of([author1, author2]), + getLastModified: of(date), + hasUpdates: of(true), + isReinstatable: of(false), // should always return something --> its in ngOnInit + isValidPage: of(true), }, ); relationshipService = jasmine.createSpyObj('relationshipService', { - getItemRelationshipLabels: observableOf(['isAuthorOfPublication']), - getRelatedItems: observableOf([author1, author2]), - getRelatedItemsByLabel: observableOf([author1, author2]), - getItemRelationshipsArray: observableOf(relationships), - deleteRelationship: observableOf(new RestResponse(true, 200, 'OK')), - getItemResolvedRelatedItemsAndRelationships: observableCombineLatest(observableOf([author1, author2]), observableOf([item, item]), observableOf(relationships)), - getRelationshipsByRelatedItemIds: observableOf(relationships), - getRelationshipTypeLabelsByItem: observableOf([relationshipType.leftwardType]), + getItemRelationshipLabels: of(['isAuthorOfPublication']), + getRelatedItems: of([author1, author2]), + getRelatedItemsByLabel: of([author1, author2]), + getItemRelationshipsArray: of(relationships), + deleteRelationship: of(new RestResponse(true, 200, 'OK')), + getItemResolvedRelatedItemsAndRelationships: observableCombineLatest(of([author1, author2]), of([item, item]), of(relationships)), + getRelationshipsByRelatedItemIds: of(relationships), + getRelationshipTypeLabelsByItem: of([relationshipType.leftwardType]), }, ); relationshipTypeService = jasmine.createSpyObj('searchByEntityType', { - searchByEntityType: observableOf(relationshipTypes), + searchByEntityType: of(relationshipTypes), }, ); requestService = jasmine.createSpyObj('requestService', { removeByHrefSubstring: {}, - hasByHref$: observableOf(false), + hasByHref$: of(false), }, ); diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts index 38bc6b8805..8b57276fab 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts @@ -58,13 +58,13 @@ import { EditRelationshipListWrapperComponent } from './edit-relationship-list-w imports: [ AlertComponent, AsyncPipe, + BtnDisabledDirective, EditRelationshipListComponent, + EditRelationshipListWrapperComponent, NgTemplateOutlet, ThemedLoadingComponent, TranslateModule, VarDirective, - EditRelationshipListWrapperComponent, - BtnDisabledDirective, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts b/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts index 4a11901f86..e463967d5f 100644 --- a/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts @@ -10,7 +10,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -61,7 +61,7 @@ describe('ItemStatusComponent', () => { const routeStub = { parent: { - data: observableOf({ dso: createSuccessfulRemoteDataObject(mockItem) }), + data: of({ dso: createSuccessfulRemoteDataObject(mockItem) }), }, }; @@ -70,11 +70,11 @@ describe('ItemStatusComponent', () => { beforeEach(waitForAsync(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); orcidAuthService = jasmine.createSpyObj('OrcidAuthService', { - onlyAdminCanDisconnectProfileFromOrcid: observableOf ( true ), + onlyAdminCanDisconnectProfileFromOrcid: of ( true ), isLinkedToOrcid: true, }); diff --git a/src/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/app/item-page/edit-item-page/item-status/item-status.component.ts index d693d7758b..3c37683df9 100644 --- a/src/app/item-page/edit-item-page/item-status/item-status.component.ts +++ b/src/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -65,11 +65,11 @@ import { ItemOperation } from '../item-operation/itemOperation.model'; fadeInOut, ], imports: [ - TranslateModule, AsyncPipe, - RouterLink, ItemOperationComponent, NgClass, + RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts b/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts index c3ba17a4b5..1829851ade 100644 --- a/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts +++ b/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts @@ -8,7 +8,9 @@ import { ItemStatusComponent } from './item-status.component'; styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [ItemStatusComponent], + imports: [ + ItemStatusComponent, + ], }) export class ThemedItemStatusComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts index f1ba067ddc..3a1cc50084 100644 --- a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts @@ -10,7 +10,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../core/shared/item.model'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; @@ -30,7 +30,7 @@ describe('ItemVersionHistoryComponent', () => { const activatedRoute = { parent: { parent: { - data: observableOf({ dso: createSuccessfulRemoteDataObject(item) }), + data: of({ dso: createSuccessfulRemoteDataObject(item) }), }, }, }; diff --git a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts index f2af333be7..a941332aef 100644 --- a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts +++ b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts @@ -18,9 +18,9 @@ import { ItemVersionsComponent } from '../../versions/item-versions.component'; selector: 'ds-item-version-history', templateUrl: './item-version-history.component.html', imports: [ + AsyncPipe, ItemVersionsComponent, VarDirective, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts index bef3978ed2..0ea5129d8d 100644 --- a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts @@ -14,7 +14,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../../core/data/item-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -57,7 +57,7 @@ describe('ItemWithdrawComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), }; diff --git a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts index 720c0a62e9..9ad7e99846 100644 --- a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts +++ b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts @@ -23,8 +23,8 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac standalone: true, imports: [ ModifyItemOverviewComponent, - TranslateModule, RouterLink, + TranslateModule, ], }) /** diff --git a/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts b/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts index 223c6b58c5..bb8d68ecd2 100644 --- a/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts +++ b/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts @@ -13,7 +13,10 @@ import { MetadataMap } from '../../../core/shared/metadata.models'; selector: 'ds-modify-item-overview', templateUrl: './modify-item-overview.component.html', standalone: true, - imports: [KeyValuePipe, TranslateModule], + imports: [ + KeyValuePipe, + TranslateModule, + ], }) /** * Component responsible for rendering a table containing the metadatavalues from the to be edited item diff --git a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts index 5613403d2d..1325beaf7b 100644 --- a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts +++ b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts @@ -17,7 +17,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RemoteData } from '../../../core/data/remote-data'; @@ -41,7 +41,12 @@ import { AbstractSimpleItemActionComponent } from './abstract-simple-item-action selector: 'ds-simple-action', templateUrl: './abstract-simple-item-action.component.html', standalone: true, - imports: [CommonModule, FormsModule, NgbModule, TranslateModule], + imports: [ + CommonModule, + FormsModule, + NgbModule, + TranslateModule, + ], }) export class MySimpleItemActionComponent extends AbstractSimpleItemActionComponent { @@ -86,7 +91,7 @@ describe('AbstractSimpleItemActionComponent', () => { }); routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(Object.assign(new Item(), { id: 'fake-id', })), diff --git a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts index 286fc78909..b3fdb3ed87 100644 --- a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts +++ b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts @@ -39,8 +39,8 @@ import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item templateUrl: './abstract-simple-item-action.component.html', imports: [ ModifyItemOverviewComponent, - TranslateModule, RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts index 3d0f520d3d..9979244849 100644 --- a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts +++ b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../config/app-config.interface'; import { environment } from '../../../../environments/environment'; @@ -49,7 +49,7 @@ describe('VirtualMetadataComponent', () => { }); objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { - isSelectedVirtualMetadata: observableOf(false), + isSelectedVirtualMetadata: of(false), setSelectedVirtualMetadata: null, }); diff --git a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts index ad413db962..1381751eb2 100644 --- a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts +++ b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts @@ -42,11 +42,11 @@ interface ItemDTO { selector: 'ds-virtual-metadata', templateUrl: './virtual-metadata.component.html', imports: [ + AsyncPipe, + ListableObjectComponentLoaderComponent, NgClass, TranslateModule, VarDirective, - AsyncPipe, - ListableObjectComponentLoaderComponent, ], standalone: true, }) diff --git a/src/app/item-page/field-components/collections/collections.component.ts b/src/app/item-page/field-components/collections/collections.component.ts index d5347c3285..56e837a86f 100644 --- a/src/app/item-page/field-components/collections/collections.component.ts +++ b/src/app/item-page/field-components/collections/collections.component.ts @@ -45,10 +45,10 @@ import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wr selector: 'ds-item-page-collections', templateUrl: './collections.component.html', imports: [ - MetadataFieldWrapperComponent, - TranslateModule, AsyncPipe, + MetadataFieldWrapperComponent, RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index d12881ce91..be58645015 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -34,7 +34,14 @@ import { ImageField } from '../../simple/field-components/specific-field/image-f styleUrls: ['./metadata-values.component.scss'], templateUrl: './metadata-values.component.html', standalone: true, - imports: [MetadataFieldWrapperComponent, NgTemplateOutlet, RouterLink, AsyncPipe, TranslateModule, MarkdownDirective], + imports: [ + AsyncPipe, + MarkdownDirective, + MetadataFieldWrapperComponent, + NgTemplateOutlet, + RouterLink, + TranslateModule, + ], }) export class MetadataValuesComponent implements OnChanges { diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts b/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts index 9eba8c5fd1..268af2f172 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts @@ -11,7 +11,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment'; @@ -42,7 +42,7 @@ describe('FullFileSectionComponent', () => { { sizeBytes: 10201, content: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreams/cf9b0c8e-a1eb-4b65-afd0-567366448713/content', - format: observableOf(MockBitstreamFormat1), + format: of(MockBitstreamFormat1), bundleName: 'ORIGINAL', _links: { self: { diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts index 73d844214a..a1ef48ec7b 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts @@ -52,14 +52,14 @@ import { FileSectionComponent } from '../../../simple/field-components/file-sect styleUrls: ['./full-file-section.component.scss'], templateUrl: './full-file-section.component.html', imports: [ - PaginationComponent, - TranslateModule, AsyncPipe, - VarDirective, - ThemedThumbnailComponent, - ThemedFileDownloadLinkComponent, FileSizePipe, MetadataFieldWrapperComponent, + PaginationComponent, + ThemedFileDownloadLinkComponent, + ThemedThumbnailComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts b/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts index 425b0cffd8..3f0f3237ed 100644 --- a/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts +++ b/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts @@ -15,7 +15,9 @@ import { FullFileSectionComponent } from './full-file-section.component'; styleUrls: [], templateUrl: './../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [FullFileSectionComponent], + imports: [ + FullFileSectionComponent, + ], }) export class ThemedFullFileSectionComponent extends ThemedComponent { diff --git a/src/app/item-page/full/full-item-page.component.spec.ts b/src/app/item-page/full/full-item-page.component.spec.ts index d38b3ba017..a03c5458d4 100644 --- a/src/app/item-page/full/full-item-page.component.spec.ts +++ b/src/app/item-page/full/full-item-page.component.spec.ts @@ -19,7 +19,7 @@ import { } from '@ngx-translate/core'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service'; @@ -104,11 +104,11 @@ describe('FullItemPageComponent', () => { }; routeStub = Object.assign(new ActivatedRouteStub(), { - data: observableOf(routeData), + data: of(routeData), }); authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(false), + isAuthorized: of(false), }); serverResponseService = jasmine.createSpyObj('ServerResponseService', { @@ -116,7 +116,7 @@ describe('FullItemPageComponent', () => { }); signpostingDataService = jasmine.createSpyObj('SignpostingDataService', { - getLinks: observableOf([mocklink, mocklink2]), + getLinks: of([mocklink, mocklink2]), }); linkHeadService = jasmine.createSpyObj('LinkHeadService', { @@ -125,9 +125,9 @@ describe('FullItemPageComponent', () => { }); notifyInfoService = jasmine.createSpyObj('NotifyInfoService', { - isCoarConfigEnabled: observableOf(true), - getCoarLdnLocalInboxUrls: observableOf(['http://test.org']), - getInboxRelationLink: observableOf('http://test.org'), + isCoarConfigEnabled: of(true), + getCoarLdnLocalInboxUrls: of(['http://test.org']), + getInboxRelationLink: of('http://test.org'), }); headTagService = new HeadTagServiceMock(); @@ -206,7 +206,7 @@ describe('FullItemPageComponent', () => { describe('when the item is withdrawn and the user is an admin', () => { beforeEach(() => { - comp.isAdmin$ = observableOf(true); + comp.isAdmin$ = of(true); comp.itemRD$ = new BehaviorSubject>(createSuccessfulRemoteDataObject(mockWithdrawnItem)); fixture.detectChanges(); }); @@ -235,7 +235,7 @@ describe('FullItemPageComponent', () => { describe('when the item is not withdrawn and the user is an admin', () => { beforeEach(() => { - comp.isAdmin$ = observableOf(true); + comp.isAdmin$ = of(true); comp.itemRD$ = new BehaviorSubject>(createSuccessfulRemoteDataObject(mockItem)); fixture.detectChanges(); }); diff --git a/src/app/item-page/full/full-item-page.component.ts b/src/app/item-page/full/full-item-page.component.ts index f63447b809..6ebc9978d7 100644 --- a/src/app/item-page/full/full-item-page.component.ts +++ b/src/app/item-page/full/full-item-page.component.ts @@ -62,19 +62,19 @@ import { ThemedFullFileSectionComponent } from './field-components/file-section/ changeDetection: ChangeDetectionStrategy.OnPush, animations: [fadeInOut], imports: [ - ErrorComponent, - ThemedLoadingComponent, - TranslateModule, - ThemedFullFileSectionComponent, - CollectionsComponent, - ItemVersionsComponent, AsyncPipe, + CollectionsComponent, + DsoEditMenuComponent, + ErrorComponent, + ItemVersionsComponent, + ItemVersionsNoticeComponent, KeyValuePipe, RouterLink, - ThemedItemPageTitleFieldComponent, - DsoEditMenuComponent, - ItemVersionsNoticeComponent, + ThemedFullFileSectionComponent, ThemedItemAlertsComponent, + ThemedItemPageTitleFieldComponent, + ThemedLoadingComponent, + TranslateModule, VarDirective, ], standalone: true, diff --git a/src/app/item-page/full/themed-full-item-page.component.ts b/src/app/item-page/full/themed-full-item-page.component.ts index f5034d3042..225d8ad6c1 100644 --- a/src/app/item-page/full/themed-full-item-page.component.ts +++ b/src/app/item-page/full/themed-full-item-page.component.ts @@ -11,7 +11,9 @@ import { FullItemPageComponent } from './full-item-page.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [FullItemPageComponent], + imports: [ + FullItemPageComponent, + ], }) export class ThemedFullItemPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/item-page/item-page-administrator.guard.ts b/src/app/item-page/item-page-administrator.guard.ts index 411ffa1e37..831cd43831 100644 --- a/src/app/item-page/item-page-administrator.guard.ts +++ b/src/app/item-page/item-page-administrator.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; @@ -11,5 +11,5 @@ import { itemPageResolver } from './item-page.resolver'; export const itemPageAdministratorGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.AdministratorOf), + () => of(FeatureID.AdministratorOf), ); diff --git a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts index f5f031903a..b9e2a5683c 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts @@ -5,7 +5,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { NgxGalleryOptions } from '@kolkov/ngx-gallery'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; import { Bitstream } from '../../../core/shared/bitstream.model'; @@ -18,14 +18,14 @@ describe('MediaViewerImageComponent', () => { let fixture: ComponentFixture; const authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(false), + isAuthenticated: of(false), }); const mockBitstream: Bitstream = Object.assign(new Bitstream(), { sizeBytes: 10201, content: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreams/cf9b0c8e-a1eb-4b65-afd0-567366448713/content', - format: observableOf(MockBitstreamFormat1), + format: of(MockBitstreamFormat1), bundleName: 'ORIGINAL', _links: { self: { diff --git a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts index cf1fd64855..ddc6c131d4 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts @@ -25,8 +25,8 @@ import { hasValue } from '../../../shared/empty.util'; templateUrl: './media-viewer-image.component.html', styleUrls: ['./media-viewer-image.component.scss'], imports: [ - NgxGalleryModule, AsyncPipe, + NgxGalleryModule, ], standalone: true, }) diff --git a/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts b/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts index d7df6da629..42ce742051 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts @@ -15,7 +15,9 @@ import { MediaViewerImageComponent } from './media-viewer-image.component'; styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [MediaViewerImageComponent], + imports: [ + MediaViewerImageComponent, + ], }) export class ThemedMediaViewerImageComponent extends ThemedComponent { diff --git a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts index 19b86d7448..f97b11bc1d 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts @@ -10,7 +10,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Bitstream } from '../../../core/shared/bitstream.model'; import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; @@ -48,7 +48,7 @@ describe('MediaViewerVideoComponent', () => { sizeBytes: 10201, content: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreams/cf9b0c8e-a1eb-4b65-afd0-567366448713/content', - format: observableOf(MockBitstreamFormat1), + format: of(MockBitstreamFormat1), bundleName: 'ORIGINAL', _links: { self: { diff --git a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts index 8a0634fee0..f6ec739742 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts @@ -22,9 +22,9 @@ import { languageHelper } from './language-helper'; templateUrl: './media-viewer-video.component.html', styleUrls: ['./media-viewer-video.component.scss'], imports: [ + BtnDisabledDirective, NgbDropdownModule, TranslateModule, - BtnDisabledDirective, ], standalone: true, }) diff --git a/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts b/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts index 800034835c..0a8d852add 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts @@ -16,7 +16,9 @@ import { MediaViewerVideoComponent } from './media-viewer-video.component'; styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [MediaViewerVideoComponent], + imports: [ + MediaViewerVideoComponent, + ], }) export class ThemedMediaViewerVideoComponent extends ThemedComponent { 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 90e99b21ff..ae39fc4039 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 @@ -14,7 +14,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; @@ -46,7 +46,7 @@ describe('MediaViewerComponent', () => { sizeBytes: 10201, content: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreams/cf9b0c8e-a1eb-4b65-afd0-567366448713/content', - format: observableOf(MockBitstreamFormat1), + format: of(MockBitstreamFormat1), bundleName: 'ORIGINAL', _links: { self: { @@ -84,10 +84,10 @@ describe('MediaViewerComponent', () => { beforeEach(waitForAsync(() => { authService = jasmine.createSpyObj('AuthService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); authorizationService = jasmine.createSpyObj('AuthorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); fileService = jasmine.createSpyObj('FileService', { retrieveFileDownloadLink: null, diff --git a/src/app/item-page/media-viewer/media-viewer.component.ts b/src/app/item-page/media-viewer/media-viewer.component.ts index daa85963a5..0ce24b1c35 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.ts @@ -45,12 +45,12 @@ import { ThemedMediaViewerVideoComponent } from './media-viewer-video/themed-med templateUrl: './media-viewer.component.html', styleUrls: ['./media-viewer.component.scss'], imports: [ - ThemedMediaViewerImageComponent, - ThemedThumbnailComponent, AsyncPipe, - ThemedMediaViewerVideoComponent, - TranslateModule, ThemedLoadingComponent, + ThemedMediaViewerImageComponent, + ThemedMediaViewerVideoComponent, + ThemedThumbnailComponent, + TranslateModule, VarDirective, ], standalone: true, diff --git a/src/app/item-page/media-viewer/themed-media-viewer.component.ts b/src/app/item-page/media-viewer/themed-media-viewer.component.ts index 0fa5657094..2305b5b40f 100644 --- a/src/app/item-page/media-viewer/themed-media-viewer.component.ts +++ b/src/app/item-page/media-viewer/themed-media-viewer.component.ts @@ -16,7 +16,9 @@ import { MediaViewerComponent } from './media-viewer.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [MediaViewerComponent], + imports: [ + MediaViewerComponent, + ], }) export class ThemedMediaViewerComponent extends ThemedComponent { diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts b/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts index 3175773bc1..93a9cbca46 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts @@ -8,7 +8,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; import { BundleDataService } from '../../core/data/bundle-data.service'; @@ -35,7 +35,7 @@ const noMetadata = new MetadataMap(); const mockHostWindowService = { // This isn't really testing mobile status, the return observable just allows the test to run. - widthCategory: observableOf(true), + widthCategory: of(true), }; describe('MiradorViewerComponent with search', () => { @@ -106,7 +106,7 @@ describe('MiradorViewerComponent with multiple images', () => { beforeEach(waitForAsync(() => { viewerService.showEmbeddedViewer.and.returnValue(true); - viewerService.getImageCount.and.returnValue(observableOf(2)); + viewerService.getImageCount.and.returnValue(of(2)); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ loader: { @@ -165,7 +165,7 @@ describe('MiradorViewerComponent with a single image', () => { beforeEach(waitForAsync(() => { viewerService.showEmbeddedViewer.and.returnValue(true); - viewerService.getImageCount.and.returnValue(observableOf(1)); + viewerService.getImageCount.and.returnValue(of(1)); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ loader: { @@ -217,7 +217,7 @@ describe('MiradorViewerComponent in development mode', () => { beforeEach(waitForAsync(() => { viewerService.showEmbeddedViewer.and.returnValue(false); - viewerService.getImageCount.and.returnValue(observableOf(1)); + viewerService.getImageCount.and.returnValue(of(1)); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ loader: { diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts index f1cdb6e4f4..f082446db9 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts @@ -40,8 +40,8 @@ import { MiradorViewerService } from './mirador-viewer.service'; templateUrl: './mirador-viewer.component.html', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ - TranslateModule, AsyncPipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts b/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts index f4ed87f2c6..8527c961af 100644 --- a/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts +++ b/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts @@ -40,10 +40,10 @@ import { createFailedRemoteDataObjectFromError$ } from '../../../shared/remote-d templateUrl: './orcid-auth.component.html', styleUrls: ['./orcid-auth.component.scss'], imports: [ - TranslateModule, - AsyncPipe, AlertComponent, + AsyncPipe, BtnDisabledDirective, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/orcid-page/orcid-page.component.spec.ts b/src/app/item-page/orcid-page/orcid-page.component.spec.ts index fafb08ee3e..bbd8c41880 100644 --- a/src/app/item-page/orcid-page/orcid-page.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-page.component.spec.ts @@ -17,10 +17,7 @@ import { TranslateModule, } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthService } from '../../core/auth/auth.service'; @@ -170,7 +167,7 @@ describe('OrcidPageComponent test suite', () => { scheduler = getTestScheduler(); fixture = TestBed.createComponent(OrcidPageComponent); comp = fixture.componentInstance; - authService.isAuthenticated.and.returnValue(observableOf(true)); + authService.isAuthenticated.and.returnValue(of(true)); })); describe('whn has no query param', () => { diff --git a/src/app/item-page/orcid-page/orcid-page.component.ts b/src/app/item-page/orcid-page/orcid-page.component.ts index 7e634fdeca..857e27285e 100644 --- a/src/app/item-page/orcid-page/orcid-page.component.ts +++ b/src/app/item-page/orcid-page/orcid-page.component.ts @@ -53,14 +53,14 @@ import { OrcidSyncSettingsComponent } from './orcid-sync-settings/orcid-sync-set templateUrl: './orcid-page.component.html', styleUrls: ['./orcid-page.component.scss'], imports: [ - CommonModule, - ThemedLoadingComponent, AlertComponent, + CommonModule, OrcidAuthComponent, - OrcidSyncSettingsComponent, OrcidQueueComponent, - TranslateModule, + OrcidSyncSettingsComponent, RouterLink, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/orcid-page/orcid-page.guard.ts b/src/app/item-page/orcid-page/orcid-page.guard.ts index c06ab7d97d..2d9610bad4 100644 --- a/src/app/item-page/orcid-page/orcid-page.guard.ts +++ b/src/app/item-page/orcid-page/orcid-page.guard.ts @@ -1,5 +1,5 @@ import { CanActivateFn } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { dsoPageSingleFeatureGuard } from '../../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @@ -12,5 +12,5 @@ import { itemPageResolver } from '../item-page.resolver'; export const orcidPageGuard: CanActivateFn = dsoPageSingleFeatureGuard( () => itemPageResolver, - () => observableOf(FeatureID.CanSynchronizeWithORCID), + () => of(FeatureID.CanSynchronizeWithORCID), ); diff --git a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts index 325204309c..10ba1a66a0 100644 --- a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts +++ b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts @@ -48,12 +48,12 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio templateUrl: './orcid-queue.component.html', styleUrls: ['./orcid-queue.component.scss'], imports: [ + AlertComponent, CommonModule, NgbTooltipModule, - TranslateModule, - ThemedLoadingComponent, - AlertComponent, PaginationComponent, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts index 7384949267..f568e141ad 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts @@ -12,7 +12,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { environment } from 'src/environments/environment'; import { @@ -43,14 +43,14 @@ describe('FileSectionComponent', () => { const bitstreamDataService = jasmine.createSpyObj('bitstreamDataService', { findAllByItemAndBundleName: createSuccessfulRemoteDataObject$(createPaginatedList([])), - findPrimaryBitstreamByItemAndName: observableOf(null), + findPrimaryBitstreamByItemAndName: of(null), }); const mockBitstream: Bitstream = Object.assign(new Bitstream(), { sizeBytes: 10201, content: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreams/cf9b0c8e-a1eb-4b65-afd0-567366448713/content', - format: observableOf(MockBitstreamFormat1), + format: of(MockBitstreamFormat1), bundleName: 'ORIGINAL', _links: { self: { @@ -112,14 +112,14 @@ describe('FileSectionComponent', () => { it('should set the id of primary bitstream', () => { comp.primaryBitstreamId = undefined; - bitstreamDataService.findPrimaryBitstreamByItemAndName.and.returnValue(observableOf(mockBitstream)); + bitstreamDataService.findPrimaryBitstreamByItemAndName.and.returnValue(of(mockBitstream)); comp.ngOnInit(); expect(comp.primaryBitstreamId).toBe(mockBitstream.id); }); it('should not set the id of primary bitstream', () => { comp.primaryBitstreamId = undefined; - bitstreamDataService.findPrimaryBitstreamByItemAndName.and.returnValue(observableOf(null)); + bitstreamDataService.findPrimaryBitstreamByItemAndName.and.returnValue(of(null)); comp.ngOnInit(); expect(comp.primaryBitstreamId).toBeUndefined(); }); diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.ts index ffa302687e..02b3ac7a3b 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -40,11 +40,11 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; templateUrl: './file-section.component.html', imports: [ CommonModule, - ThemedFileDownloadLinkComponent, + FileSizePipe, MetadataFieldWrapperComponent, + ThemedFileDownloadLinkComponent, ThemedLoadingComponent, TranslateModule, - FileSizePipe, VarDirective, ], standalone: true, diff --git a/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts b/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts index 2dd8a1df73..491ae9d2cb 100644 --- a/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts @@ -11,7 +11,9 @@ import { FileSectionComponent } from './file-section.component'; selector: 'ds-item-page-file-section', templateUrl: '../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [FileSectionComponent], + imports: [ + FileSectionComponent, + ], }) export class ThemedFileSectionComponent extends ThemedComponent { diff --git a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts index 1453427db6..30bac0e326 100644 --- a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts @@ -13,8 +13,8 @@ import { ItemPageFieldComponent } from '../item-page-field.component'; templateUrl: '../item-page-field.component.html', standalone: true, imports: [ - MetadataValuesComponent, AsyncPipe, + MetadataValuesComponent, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts index aee1c67b03..b2884198bc 100644 --- a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts @@ -13,8 +13,8 @@ import { ItemPageFieldComponent } from '../item-page-field.component'; templateUrl: '../item-page-field.component.html', standalone: true, imports: [ - MetadataValuesComponent, AsyncPipe, + MetadataValuesComponent, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts b/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts index 2511f1d69c..262c4a6b09 100644 --- a/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts @@ -30,7 +30,13 @@ import { parseCcCode } from 'src/app/shared/utils/license.utils'; selector: 'ds-item-page-cc-license-field', templateUrl: './item-page-cc-license-field.component.html', standalone: true, - imports: [AsyncPipe, NgClass, NgStyle, TranslateModule, MetadataFieldWrapperComponent], + imports: [ + AsyncPipe, + MetadataFieldWrapperComponent, + NgClass, + NgStyle, + TranslateModule, + ], }) /** * Displays the item's Creative Commons license image in it's simple item page diff --git a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts index bdce65f085..4aeacca73b 100644 --- a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts @@ -13,8 +13,8 @@ import { ItemPageFieldComponent } from '../item-page-field.component'; templateUrl: '../item-page-field.component.html', standalone: true, imports: [ - MetadataValuesComponent, AsyncPipe, + MetadataValuesComponent, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts index 768608fd77..707fe0d928 100644 --- a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts @@ -12,7 +12,10 @@ import { ItemPageFieldComponent } from '../item-page-field.component'; selector: 'ds-generic-item-page-field', templateUrl: '../item-page-field.component.html', standalone: true, - imports: [MetadataValuesComponent, AsyncPipe], + imports: [ + AsyncPipe, + MetadataValuesComponent, + ], }) /** * This component can be used to represent metadata on a simple item page. diff --git a/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.ts index 28da9de276..7e4a0b8b15 100644 --- a/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.ts @@ -19,10 +19,10 @@ import { ItemPageFieldComponent } from '../item-page-field.component'; selector: 'ds-geospatial-item-page-field', templateUrl: './geospatial-item-page-field.component.html', imports: [ - MetadataFieldWrapperComponent, GeospatialMapComponent, - TranslateModule, + MetadataFieldWrapperComponent, NgIf, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts index 9e93874b9f..48bbdee20e 100644 --- a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts @@ -14,8 +14,8 @@ import { ItemPageFieldComponent } from '../item-page-field.component'; templateUrl: '../item-page-field.component.html', standalone: true, imports: [ - MetadataValuesComponent, AsyncPipe, + MetadataValuesComponent, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index fd3506c91e..fb923edbfc 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -32,8 +32,8 @@ import { ImageField } from './image-field'; @Component({ templateUrl: './item-page-field.component.html', imports: [ - MetadataValuesComponent, AsyncPipe, + MetadataValuesComponent, ], standalone: true, }) diff --git a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts index 3655a864bf..fb4c46a8a8 100644 --- a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts @@ -12,7 +12,9 @@ import { Item } from '../../../../../core/shared/item.model'; selector: 'ds-base-item-page-title-field', templateUrl: './item-page-title-field.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * This component is used for displaying the title (defined by the {@link DSONameService}) of an item diff --git a/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts index 385a98d47f..c047ab1223 100644 --- a/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts @@ -15,7 +15,9 @@ import { ItemPageTitleFieldComponent } from './item-page-title-field.component'; styleUrls: [], templateUrl: '../../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [ItemPageTitleFieldComponent], + imports: [ + ItemPageTitleFieldComponent, + ], }) export class ThemedItemPageTitleFieldComponent extends ThemedComponent { diff --git a/src/app/item-page/simple/item-page.component.spec.ts b/src/app/item-page/simple/item-page.component.spec.ts index 6254a3181d..0f3b4b72eb 100644 --- a/src/app/item-page/simple/item-page.component.spec.ts +++ b/src/app/item-page/simple/item-page.component.spec.ts @@ -18,7 +18,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; @@ -89,21 +89,21 @@ describe('ItemPageComponent', () => { let notifyInfoService: jasmine.SpyObj; const mockRoute = Object.assign(new ActivatedRouteStub(), { - data: observableOf({ dso: createSuccessfulRemoteDataObject(mockItem) }), + data: of({ dso: createSuccessfulRemoteDataObject(mockItem) }), }); const getCoarLdnLocalInboxUrls = ['http://InboxUrls.org', 'http://InboxUrls2.org']; beforeEach(waitForAsync(() => { authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(false), + isAuthorized: of(false), }); serverResponseService = jasmine.createSpyObj('ServerResponseService', { setHeader: jasmine.createSpy('setHeader'), }); signpostingDataService = jasmine.createSpyObj('SignpostingDataService', { - getLinks: observableOf([mocklink, mocklink2]), + getLinks: of([mocklink, mocklink2]), }); linkHeadService = jasmine.createSpyObj('LinkHeadService', { @@ -113,8 +113,8 @@ describe('ItemPageComponent', () => { notifyInfoService = jasmine.createSpyObj('NotifyInfoService', { getInboxRelationLink: 'http://www.w3.org/ns/ldp#inbox', - isCoarConfigEnabled: observableOf(true), - getCoarLdnLocalInboxUrls: observableOf(getCoarLdnLocalInboxUrls), + isCoarConfigEnabled: of(true), + getCoarLdnLocalInboxUrls: of(getCoarLdnLocalInboxUrls), }); TestBed.configureTestingModule({ @@ -184,7 +184,7 @@ describe('ItemPageComponent', () => { describe('when the item is withdrawn and the user is an admin', () => { beforeEach(() => { - comp.isAdmin$ = observableOf(true); + comp.isAdmin$ = of(true); comp.itemRD$ = createSuccessfulRemoteDataObject$(mockWithdrawnItem); fixture.detectChanges(); }); @@ -234,7 +234,7 @@ describe('ItemPageComponent', () => { describe('when the item is not withdrawn and the user is an admin', () => { beforeEach(() => { - comp.isAdmin$ = observableOf(true); + comp.isAdmin$ = of(true); comp.itemRD$ = createSuccessfulRemoteDataObject$(mockItem); fixture.detectChanges(); }); diff --git a/src/app/item-page/simple/item-page.component.ts b/src/app/item-page/simple/item-page.component.ts index b61ceebfc0..01917e7147 100644 --- a/src/app/item-page/simple/item-page.component.ts +++ b/src/app/item-page/simple/item-page.component.ts @@ -72,18 +72,18 @@ import { QaEventNotificationComponent } from './qa-event-notification/qa-event-n animations: [fadeInOut], standalone: true, imports: [ - VarDirective, - ThemedItemAlertsComponent, + AccessByTokenNotificationComponent, + AsyncPipe, + ErrorComponent, + ItemVersionsComponent, ItemVersionsNoticeComponent, ListableObjectComponentLoaderComponent, - ItemVersionsComponent, - ErrorComponent, - ThemedLoadingComponent, - TranslateModule, - AsyncPipe, NotifyRequestsStatusComponent, QaEventNotificationComponent, - AccessByTokenNotificationComponent, + ThemedItemAlertsComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], }) export class ItemPageComponent implements OnInit, OnDestroy { diff --git a/src/app/item-page/simple/item-types/publication/publication.component.ts b/src/app/item-page/simple/item-types/publication/publication.component.ts index 3a9a1443c4..b12527002e 100644 --- a/src/app/item-page/simple/item-types/publication/publication.component.ts +++ b/src/app/item-page/simple/item-types/publication/publication.component.ts @@ -37,7 +37,27 @@ import { ItemComponent } from '../shared/item.component'; templateUrl: './publication.component.html', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule, GeospatialItemPageFieldComponent], + imports: [ + AsyncPipe, + CollectionsComponent, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + GeospatialItemPageFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageDateFieldComponent, + ItemPageUriFieldComponent, + MetadataFieldWrapperComponent, + MiradorViewerComponent, + RelatedItemsComponent, + RouterLink, + ThemedFileSectionComponent, + ThemedItemPageTitleFieldComponent, + ThemedMediaViewerComponent, + ThemedMetadataRepresentationListComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) export class PublicationComponent extends ItemComponent { diff --git a/src/app/item-page/simple/item-types/shared/item-relationships-utils.ts b/src/app/item-page/simple/item-types/shared/item-relationships-utils.ts index 6b9f100df4..10b4c4bd32 100644 --- a/src/app/item-page/simple/item-types/shared/item-relationships-utils.ts +++ b/src/app/item-page/simple/item-types/shared/item-relationships-utils.ts @@ -2,7 +2,7 @@ import { InjectionToken } from '@angular/core'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, zip as observableZip, } from 'rxjs'; import { @@ -60,7 +60,7 @@ export const relationsToItems = (thisId: string): (source: Observable { if (relationships.length === 0) { - return observableOf([]); + return of([]); } return observableZip( ...relationships.map((rel: Relationship) => observableCombineLatest([rel.leftItem, rel.rightItem])), diff --git a/src/app/item-page/simple/item-types/shared/item.component.spec.ts b/src/app/item-page/simple/item-types/shared/item.component.spec.ts index e1ae24ff4d..82a98a7f88 100644 --- a/src/app/item-page/simple/item-types/shared/item.component.spec.ts +++ b/src/app/item-page/simple/item-types/shared/item.component.spec.ts @@ -21,7 +21,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -100,13 +100,13 @@ export function getIIIFEnabled(enabled: boolean): MetadataValue { export const mockRouteService = { getPreviousUrl(): Observable { - return observableOf(''); + return of(''); }, getQueryParameterValue(): Observable { - return observableOf(''); + return of(''); }, getRouteParameterValue(): Observable { - return observableOf(''); + return of(''); }, }; @@ -131,7 +131,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) { }; const authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); relationshipService = jasmine.createSpyObj('relationshipService', { @@ -535,28 +535,28 @@ describe('ItemComponent', () => { })); it('should hide back button', () => { - spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(observableOf('/item')); + spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(of('/item')); comp.ngOnInit(); comp.showBackButton$.subscribe((val) => { expect(val).toBeFalse(); }); }); it('should show back button for search', () => { - spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(observableOf(searchUrl)); + spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(of(searchUrl)); comp.ngOnInit(); comp.showBackButton$.subscribe((val) => { expect(val).toBeTrue(); }); }); it('should show back button for browse', () => { - spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(observableOf(browseUrl)); + spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(of(browseUrl)); comp.ngOnInit(); comp.showBackButton$.subscribe((val) => { expect(val).toBeTrue(); }); }); it('should show back button for recent submissions', () => { - spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(observableOf(recentSubmissionsUrl)); + spyOn(mockRouteService, 'getPreviousUrl').and.returnValue(of(recentSubmissionsUrl)); comp.ngOnInit(); comp.showBackButton$.subscribe((val) => { expect(val).toBeTrue(); diff --git a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index 815a86525f..a5b7f396ce 100644 --- a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -39,25 +39,25 @@ import { ItemComponent } from '../shared/item.component'; changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - ThemedResultsBackButtonComponent, - MiradorViewerComponent, - ThemedItemPageTitleFieldComponent, - DsoEditMenuComponent, - MetadataFieldWrapperComponent, - ThemedThumbnailComponent, - ThemedMediaViewerComponent, - ThemedFileSectionComponent, - ItemPageDateFieldComponent, - ThemedMetadataRepresentationListComponent, - GenericItemPageFieldComponent, - ItemPageAbstractFieldComponent, - ItemPageUriFieldComponent, - CollectionsComponent, - RouterLink, AsyncPipe, - TranslateModule, - ItemPageCcLicenseFieldComponent, + CollectionsComponent, + DsoEditMenuComponent, + GenericItemPageFieldComponent, GeospatialItemPageFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageCcLicenseFieldComponent, + ItemPageDateFieldComponent, + ItemPageUriFieldComponent, + MetadataFieldWrapperComponent, + MiradorViewerComponent, + RouterLink, + ThemedFileSectionComponent, + ThemedItemPageTitleFieldComponent, + ThemedMediaViewerComponent, + ThemedMetadataRepresentationListComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, ], }) export class UntypedItemComponent extends ItemComponent {} diff --git a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts index 4fa800c39d..52943c7238 100644 --- a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts +++ b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { BrowseDefinitionDataService } from '../../../core/browse/browse-definition-data.service'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; @@ -99,16 +99,16 @@ describe('MetadataRepresentationListComponent', () => { relationshipService = { resolveMetadataRepresentation: (metadatum: MetadataValue, parent: DSpaceObject, type: string) => { if (metadatum.value === 'Related Author with authority') { - return observableOf(Object.assign(new ItemMetadataRepresentation(metadatum), relatedAuthor)); + return of(Object.assign(new ItemMetadataRepresentation(metadatum), relatedAuthor)); } if (metadatum.value === 'Author without authority') { - return observableOf(Object.assign(new MetadatumRepresentation(type), metadatum)); + return of(Object.assign(new MetadatumRepresentation(type), metadatum)); } if (metadatum.value === 'Related Creator with authority') { - return observableOf(Object.assign(new ItemMetadataRepresentation(metadatum), relatedCreator)); + return of(Object.assign(new ItemMetadataRepresentation(metadatum), relatedCreator)); } if (metadatum.value === 'Related Creator with authority - unauthorized') { - return observableOf(Object.assign(new MetadatumRepresentation(type), metadatum)); + return of(Object.assign(new MetadatumRepresentation(type), metadatum)); } }, }; @@ -157,7 +157,7 @@ describe('MetadataRepresentationListComponent', () => { describe('when decrease is called', () => { beforeEach(() => { // Add a second page - comp.objects.push(observableOf(undefined)); + comp.objects.push(of(undefined)); comp.decrease(); }); diff --git a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts index f222fc42f6..33d981adcc 100644 --- a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts +++ b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts @@ -29,7 +29,14 @@ import { AbstractIncrementalListComponent } from '../abstract-incremental-list/a selector: 'ds-base-metadata-representation-list', templateUrl: './metadata-representation-list.component.html', standalone: true, - imports: [MetadataFieldWrapperComponent, VarDirective, MetadataRepresentationLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + MetadataFieldWrapperComponent, + MetadataRepresentationLoaderComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** * This component is used for displaying metadata diff --git a/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts b/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts index 4f8756d957..72ffe9ea7d 100644 --- a/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts +++ b/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts @@ -12,7 +12,9 @@ import { MetadataRepresentationListComponent } from './metadata-representation-l styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [MetadataRepresentationListComponent], + imports: [ + MetadataRepresentationListComponent, + ], }) export class ThemedMetadataRepresentationListComponent extends ThemedComponent { protected inAndOutputNames: (keyof MetadataRepresentationListComponent & keyof this)[] = ['parentItem', 'itemType', 'metadataFields', 'label', 'incrementBy']; diff --git a/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts b/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts index ffaf8ab000..d170238598 100644 --- a/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts +++ b/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts @@ -34,9 +34,9 @@ import { RequestStatusAlertBoxComponent } from '../request-status-alert-box/requ changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - RequestStatusAlertBoxComponent, AsyncPipe, KeyValuePipe, + RequestStatusAlertBoxComponent, ], }) diff --git a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts index e5b6fc6cb6..3e2bf7ced9 100644 --- a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts +++ b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts @@ -19,10 +19,10 @@ import { RequestStatusEnum } from '../notify-status.enum'; changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - TruncatablePartComponent, - TruncatableComponent, - TranslateModule, NgClass, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, ], }) /** diff --git a/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts b/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts index e681db4a0a..caae8a4b28 100644 --- a/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts +++ b/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts @@ -34,8 +34,8 @@ import { SplitPipe } from '../../../shared/utils/split.pipe'; imports: [ AsyncPipe, RouterLink, - TranslateModule, SplitPipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts index 5f4966587b..824b384924 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts @@ -13,7 +13,9 @@ import { getFilterByRelation } from '../../../../shared/utils/relation-query.uti selector: 'ds-related-entities-search', templateUrl: './related-entities-search.component.html', standalone: true, - imports: [ThemedConfigurationSearchPageComponent], + imports: [ + ThemedConfigurationSearchPageComponent, + ], }) /** * A component to show related items as search results. diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts index 66e5319020..9a00ea3e40 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { RouterMock } from '../../../../shared/mocks/router.mock'; @@ -43,7 +43,7 @@ describe('TabbedRelatedEntitiesSearchComponent', () => { { provide: ActivatedRoute, useValue: { - queryParams: observableOf({ tab: mockRelationType }), + queryParams: of({ tab: mockRelationType }), }, }, { provide: Router, useValue: router }, diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts index b41f00e104..f0a8228537 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts @@ -21,7 +21,13 @@ import { RelatedEntitiesSearchComponent } from '../related-entities-search/relat selector: 'ds-tabbed-related-entities-search', templateUrl: './tabbed-related-entities-search.component.html', standalone: true, - imports: [NgbNavModule, RelatedEntitiesSearchComponent, VarDirective, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbNavModule, + RelatedEntitiesSearchComponent, + TranslateModule, + VarDirective, + ], }) /** * A component to show related items as search results, split into tabs by relationship-type diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index e6132661fd..085bf7ebf8 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -36,7 +36,15 @@ import { AbstractIncrementalListComponent } from '../abstract-incremental-list/a styleUrls: ['./related-items.component.scss'], templateUrl: './related-items.component.html', standalone: true, - imports: [MetadataFieldWrapperComponent, NgClass, VarDirective, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ListableObjectComponentLoaderComponent, + MetadataFieldWrapperComponent, + NgClass, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** * This component is used for displaying relations between items diff --git a/src/app/item-page/simple/related-items/related-items.component.spec.ts b/src/app/item-page/simple/related-items/related-items.component.spec.ts index 3d8a314597..229cf03505 100644 --- a/src/app/item-page/simple/related-items/related-items.component.spec.ts +++ b/src/app/item-page/simple/related-items/related-items.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../config/app-config.interface'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; @@ -126,7 +126,7 @@ describe('RelatedItemsComponent', () => { describe('when decrease is called', () => { beforeEach(() => { // Add a second page - comp.objects.push(observableOf(undefined)); + comp.objects.push(of(undefined)); comp.decrease(); }); diff --git a/src/app/item-page/simple/themed-item-page.component.ts b/src/app/item-page/simple/themed-item-page.component.ts index 25830dbe5c..0507c518e8 100644 --- a/src/app/item-page/simple/themed-item-page.component.ts +++ b/src/app/item-page/simple/themed-item-page.component.ts @@ -11,7 +11,9 @@ import { ItemPageComponent } from './item-page.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [ItemPageComponent], + imports: [ + ItemPageComponent, + ], }) export class ThemedItemPageComponent extends ThemedComponent { diff --git a/src/app/item-page/version-page/version-page/version-page.component.spec.ts b/src/app/item-page/version-page/version-page/version-page.component.spec.ts index 07325bc6cb..92526eb43b 100644 --- a/src/app/item-page/version-page/version-page/version-page.component.spec.ts +++ b/src/app/item-page/version-page/version-page/version-page.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; import { VersionDataService } from '../../../core/data/version-data.service'; @@ -46,12 +46,12 @@ describe('VersionPageComponent', () => { let authService: AuthService; const mockRoute = Object.assign(new ActivatedRouteStub(), { - data: observableOf({ dso: createSuccessfulRemoteDataObject(mockVersion) }), + data: of({ dso: createSuccessfulRemoteDataObject(mockVersion) }), }); beforeEach(waitForAsync(() => { authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); TestBed.configureTestingModule({ diff --git a/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts b/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts index ae87689503..015370c55d 100644 --- a/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts +++ b/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts @@ -11,7 +11,9 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './item-versions-delete-modal.component.html', styleUrls: ['./item-versions-delete-modal.component.scss'], standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class ItemVersionsDeleteModalComponent { /** diff --git a/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.spec.ts b/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.spec.ts index 4a1e448889..40c2692989 100644 --- a/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.spec.ts +++ b/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.spec.ts @@ -20,7 +20,6 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { EMPTY, - of as observableOf, of, } from 'rxjs'; @@ -86,7 +85,7 @@ describe('ItemVersionsRowElementVersionComponent', () => { getLatestVersionItemFromHistory$: of(item), }); const authorizationServiceSpy = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); const workspaceItemDataServiceSpy = jasmine.createSpyObj('workspaceItemDataService', { findByItem: EMPTY, diff --git a/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.ts b/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.ts index 92597c044f..6d1b8f8e9f 100644 --- a/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.ts +++ b/src/app/item-page/versions/item-versions-row-element-version/item-versions-row-element-version.component.ts @@ -63,10 +63,10 @@ import { ItemVersionsSummaryModalComponent } from '../item-versions-summary-moda standalone: true, imports: [ AsyncPipe, + BtnDisabledDirective, + NgClass, RouterLink, TranslateModule, - NgClass, - BtnDisabledDirective, ], templateUrl: './item-versions-row-element-version.component.html', styleUrl: './item-versions-row-element-version.component.scss', diff --git a/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts b/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts index 45d0878586..55bc8c951e 100644 --- a/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts +++ b/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts @@ -18,7 +18,12 @@ import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.c templateUrl: './item-versions-summary-modal.component.html', styleUrls: ['./item-versions-summary-modal.component.scss'], standalone: true, - imports: [FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FormsModule, + ThemedLoadingComponent, + TranslateModule, + ], }) export class ItemVersionsSummaryModalComponent implements OnInit, ModalBeforeDismiss { diff --git a/src/app/item-page/versions/item-versions.component.spec.ts b/src/app/item-page/versions/item-versions.component.spec.ts index b6ef946815..f72547882a 100644 --- a/src/app/item-page/versions/item-versions.component.spec.ts +++ b/src/app/item-page/versions/item-versions.component.spec.ts @@ -24,7 +24,6 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { EMPTY, - of as observableOf, of, } from 'rxjs'; @@ -128,11 +127,11 @@ describe('ItemVersionsComponent', () => { getLatestVersionItemFromHistory$: of(item1), // called when version2 is deleted }); const authenticationServiceSpy = jasmine.createSpyObj('authenticationService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); const authorizationServiceSpy = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); const workspaceItemDataServiceSpy = jasmine.createSpyObj('workspaceItemDataService', { findByItem: EMPTY, diff --git a/src/app/item-page/versions/item-versions.component.ts b/src/app/item-page/versions/item-versions.component.ts index 6ae2af1438..daddb5e3a1 100644 --- a/src/app/item-page/versions/item-versions.component.ts +++ b/src/app/item-page/versions/item-versions.component.ts @@ -76,13 +76,13 @@ interface VersionDTO { imports: [ AlertComponent, AsyncPipe, + BtnDisabledDirective, DatePipe, FormsModule, ItemVersionsRowElementVersionComponent, NgClass, PaginationComponent, TranslateModule, - BtnDisabledDirective, ], }) diff --git a/src/app/item-page/versions/notice/item-versions-notice.component.ts b/src/app/item-page/versions/notice/item-versions-notice.component.ts index adbc41b511..2f50671897 100644 --- a/src/app/item-page/versions/notice/item-versions-notice.component.ts +++ b/src/app/item-page/versions/notice/item-versions-notice.component.ts @@ -38,7 +38,11 @@ import { getItemPageRoute } from '../../item-page-routing-paths'; selector: 'ds-item-versions-notice', templateUrl: './item-versions-notice.component.html', standalone: true, - imports: [AlertComponent, AsyncPipe, TranslateModule], + imports: [ + AlertComponent, + AsyncPipe, + TranslateModule, + ], }) /** * Component for displaying a warning notice when the item is not the latest version within its version history diff --git a/src/app/login-page/login-page.component.spec.ts b/src/app/login-page/login-page.component.spec.ts index 6cb4098c4d..94416492f3 100644 --- a/src/app/login-page/login-page.component.spec.ts +++ b/src/app/login-page/login-page.component.spec.ts @@ -8,7 +8,7 @@ import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../config/app-config.interface'; import { AuthService } from '../core/auth/auth.service'; @@ -21,14 +21,14 @@ describe('LoginPageComponent', () => { let comp: LoginPageComponent; let fixture: ComponentFixture; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - params: observableOf({}), + params: of({}), }); const store: Store = jasmine.createSpyObj('store', { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - select: observableOf(true), + select: of(true), }); beforeEach(waitForAsync(() => { diff --git a/src/app/login-page/login-page.component.ts b/src/app/login-page/login-page.component.ts index fad35b84b6..2138c8efb3 100644 --- a/src/app/login-page/login-page.component.ts +++ b/src/app/login-page/login-page.component.ts @@ -38,7 +38,10 @@ import { ThemedLogInComponent } from '../shared/log-in/themed-log-in.component'; styleUrls: ['./login-page.component.scss'], templateUrl: './login-page.component.html', standalone: true, - imports: [ThemedLogInComponent, TranslateModule], + imports: [ + ThemedLogInComponent, + TranslateModule, + ], }) export class LoginPageComponent implements OnDestroy, OnInit { diff --git a/src/app/login-page/themed-login-page.component.ts b/src/app/login-page/themed-login-page.component.ts index 1584c479d5..707fb2c2f8 100644 --- a/src/app/login-page/themed-login-page.component.ts +++ b/src/app/login-page/themed-login-page.component.ts @@ -11,7 +11,9 @@ import { LoginPageComponent } from './login-page.component'; styleUrls: [], templateUrl: './../shared/theme-support/themed.component.html', standalone: true, - imports: [LoginPageComponent], + imports: [ + LoginPageComponent, + ], }) export class ThemedLoginPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/logout-page/logout-page.component.ts b/src/app/logout-page/logout-page.component.ts index 8859a92a8b..6b987c8e5e 100644 --- a/src/app/logout-page/logout-page.component.ts +++ b/src/app/logout-page/logout-page.component.ts @@ -8,7 +8,10 @@ import { LogOutComponent } from '../shared/log-out/log-out.component'; styleUrls: ['./logout-page.component.scss'], templateUrl: './logout-page.component.html', standalone: true, - imports: [LogOutComponent, TranslateModule], + imports: [ + LogOutComponent, + TranslateModule, + ], }) export class LogoutPageComponent { diff --git a/src/app/logout-page/themed-logout-page.component.ts b/src/app/logout-page/themed-logout-page.component.ts index 72be4a053b..720b563441 100644 --- a/src/app/logout-page/themed-logout-page.component.ts +++ b/src/app/logout-page/themed-logout-page.component.ts @@ -11,7 +11,9 @@ import { LogoutPageComponent } from './logout-page.component'; styleUrls: [], templateUrl: './../shared/theme-support/themed.component.html', standalone: true, - imports: [LogoutPageComponent], + imports: [ + LogoutPageComponent, + ], }) export class ThemedLogoutPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/lookup-by-id/lookup-guard.spec.ts b/src/app/lookup-by-id/lookup-guard.spec.ts index 90a7e62738..b3a5ad6ccd 100644 --- a/src/app/lookup-by-id/lookup-guard.spec.ts +++ b/src/app/lookup-by-id/lookup-guard.spec.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { IdentifierType } from '../core/data/request.models'; import { lookupGuard } from './lookup-guard'; @@ -9,7 +9,7 @@ describe('lookupGuard', () => { beforeEach(() => { dsoService = { - findByIdAndIDType: jasmine.createSpy('findByIdAndIDType').and.returnValue(observableOf({ hasFailed: false, + findByIdAndIDType: jasmine.createSpy('findByIdAndIDType').and.returnValue(of({ hasFailed: false, hasSucceeded: true })), }; guard = lookupGuard; diff --git a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts index 5e7194fbd5..9a01c5747d 100644 --- a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts +++ b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ServerResponseService } from 'src/app/core/services/server-response.service'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; @@ -20,14 +20,14 @@ describe('ObjectNotFoundComponent', () => { const handlePrefix = '123456789'; const handleId = '22'; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - params: observableOf({ id: testUUID, idType: uuidType }), + params: of({ id: testUUID, idType: uuidType }), }); const serverResponseServiceStub = jasmine.createSpyObj('ServerResponseService', { setNotFound: jasmine.createSpy('setNotFound'), }); const activatedRouteStubHandle = Object.assign(new ActivatedRouteStub(), { - params: observableOf({ id: handleId, idType: handlePrefix }), + params: of({ id: handleId, idType: handlePrefix }), }); describe('uuid request', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts index e8ab615e9e..6f450ce358 100644 --- a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts @@ -20,7 +20,10 @@ import { ServerResponseService } from 'src/app/core/services/server-response.ser templateUrl: './objectnotfound.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) export class ObjectNotFoundComponent implements OnInit { diff --git a/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts index 9b46f0efd2..9a4431f0a6 100644 --- a/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts @@ -11,7 +11,9 @@ import { ObjectNotFoundComponent } from './objectnotfound.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [ObjectNotFoundComponent], + imports: [ + ObjectNotFoundComponent, + ], }) export class ThemedObjectNotFoundComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/my-dspace-page/my-dspace-configuration.service.spec.ts b/src/app/my-dspace-page/my-dspace-configuration.service.spec.ts index fd6096b847..098e1f51cc 100644 --- a/src/app/my-dspace-page/my-dspace-configuration.service.spec.ts +++ b/src/app/my-dspace-page/my-dspace-configuration.service.spec.ts @@ -2,7 +2,7 @@ import { cold, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { environment } from '../../environments/environment.test'; import { @@ -42,10 +42,10 @@ describe('MyDSpaceConfigurationService', () => { ]; const spy = jasmine.createSpyObj('RouteService', { - getQueryParameterValue: observableOf(value1), - getQueryParamsWithPrefix: observableOf(prefixFilter), - getRouteParameterValue: observableOf(''), - getRouteDataValue: observableOf({}), + getQueryParameterValue: of(value1), + getQueryParamsWithPrefix: of(prefixFilter), + getRouteParameterValue: of(''), + getRouteDataValue: of({}), }); const paginationService = new PaginationServiceStub(); diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts index 2d39ef241d..4b5563836c 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts @@ -13,7 +13,7 @@ import { import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; @@ -53,7 +53,7 @@ export function getMockEntityTypeService(): EntityTypeDataService { const rd$ = createSuccessfulRemoteDataObject$(createPaginatedList([type1, type2, type3])); return jasmine.createSpyObj('entityTypeService', { getAllAuthorizedRelationshipTypeImport: rd$, - hasMoreThanOneAuthorizedImport: observableOf(true), + hasMoreThanOneAuthorizedImport: of(true), }); } @@ -69,7 +69,7 @@ export function getMockEmptyEntityTypeService(): EntityTypeDataService { const rd$ = createSuccessfulRemoteDataObject$(createPaginatedList([type1])); return jasmine.createSpyObj('entityTypeService', { getAllAuthorizedRelationshipTypeImport: rd$, - hasMoreThanOneAuthorizedImport: observableOf(false), + hasMoreThanOneAuthorizedImport: of(false), }); } diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts index 7a89089051..f5f3f4f314 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts @@ -10,7 +10,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -37,12 +37,12 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; styleUrls: ['./my-dspace-new-external-dropdown.component.scss'], templateUrl: './my-dspace-new-external-dropdown.component.html', imports: [ - EntityDropdownComponent, - NgbDropdownModule, AsyncPipe, - TranslateModule, BrowserOnlyPipe, BtnDisabledDirective, + EntityDropdownComponent, + NgbDropdownModule, + TranslateModule, ], standalone: true, }) @@ -104,7 +104,7 @@ export class MyDSpaceNewExternalDropdownComponent implements OnInit, OnDestroy { ); } else { this.initialized$.next(true); - return observableOf(null); + return of(null); } }), take(1), diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts index 3da919a009..d698f02f42 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts @@ -13,7 +13,7 @@ import { import { By } from '@angular/platform-browser'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; @@ -51,7 +51,7 @@ export function getMockEntityTypeService(): EntityTypeDataService { const rd$ = createSuccessfulRemoteDataObject$(createPaginatedList([type1, type2, type3])); return jasmine.createSpyObj('entityTypeService', { getAllAuthorizedRelationshipType: rd$, - hasMoreThanOneAuthorized: observableOf(true), + hasMoreThanOneAuthorized: of(true), }); } @@ -67,7 +67,7 @@ export function getMockEmptyEntityTypeService(): EntityTypeDataService { const rd$ = createSuccessfulRemoteDataObject$(createPaginatedList([type1])); return jasmine.createSpyObj('entityTypeService', { getAllAuthorizedRelationshipType: rd$, - hasMoreThanOneAuthorized: observableOf(false), + hasMoreThanOneAuthorized: of(false), }); } diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts index 25cfe437bd..4c5ac8e7f3 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts @@ -11,7 +11,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -39,12 +39,12 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; styleUrls: ['./my-dspace-new-submission-dropdown.component.scss'], templateUrl: './my-dspace-new-submission-dropdown.component.html', imports: [ - EntityDropdownComponent, - NgbDropdownModule, AsyncPipe, - TranslateModule, BrowserOnlyPipe, BtnDisabledDirective, + EntityDropdownComponent, + NgbDropdownModule, + TranslateModule, ], standalone: true, }) @@ -89,7 +89,7 @@ export class MyDSpaceNewSubmissionDropdownComponent implements OnInit, OnDestroy * Initialize entity type list */ ngOnInit() { - this.initialized$ = observableOf(false); + this.initialized$ = of(false); this.moreThanOne$ = this.entityTypeService.hasMoreThanOneAuthorized(); this.singleEntity$ = this.moreThanOne$.pipe( mergeMap((response: boolean) => { @@ -100,14 +100,14 @@ export class MyDSpaceNewSubmissionDropdownComponent implements OnInit, OnDestroy }; return this.entityTypeService.getAllAuthorizedRelationshipType(findListOptions).pipe( map((entities: RemoteData>) => { - this.initialized$ = observableOf(true); + this.initialized$ = of(true); return entities.payload.page[0]; }), take(1), ); } else { - this.initialized$ = observableOf(true); - return observableOf(null); + this.initialized$ = of(true); + return of(null); } }), take(1), diff --git a/src/app/my-dspace-page/my-dspace-page.component.spec.ts b/src/app/my-dspace-page/my-dspace-page.component.spec.ts index 77636089a6..bc0ea5e88c 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-page.component.spec.ts @@ -11,7 +11,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RoleService } from '../core/roles/role.service'; import { Context } from '../core/shared/context.model'; @@ -65,7 +65,7 @@ describe('MyDSpacePageComponent', () => { beforeEach(waitForAsync(() => { roleService = jasmine.createSpyObj('roleService', { - checkRole: ()=> observableOf(true), + checkRole: ()=> of(true), }); TestBed.configureTestingModule({ imports: [ @@ -114,7 +114,7 @@ describe('MyDSpacePageComponent', () => { fixture = TestBed.createComponent(MyDSpacePageComponent); comp = fixture.componentInstance; // SearchPageComponent test instance myDSpaceConfigurationServiceStub.getAvailableConfigurationOptions.and.returnValue( - observableOf(configurationList), + of(configurationList), ); fixture.detectChanges(); diff --git a/src/app/my-dspace-page/my-dspace-page.component.ts b/src/app/my-dspace-page/my-dspace-page.component.ts index 315b5562d2..0e2598e201 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.ts +++ b/src/app/my-dspace-page/my-dspace-page.component.ts @@ -42,12 +42,12 @@ export const MYDSPACE_ROUTE = '/mydspace'; }, ], imports: [ - ThemedSearchComponent, - MyDSpaceNewSubmissionComponent, AsyncPipe, + MyDSpaceNewSubmissionComponent, + MyDspaceQaEventsNotificationsComponent, RoleDirective, SuggestionsNotificationComponent, - MyDspaceQaEventsNotificationsComponent, + ThemedSearchComponent, ], standalone: true, }) diff --git a/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts b/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts index 8bc141e258..d9a2247884 100644 --- a/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts +++ b/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts @@ -28,8 +28,8 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, imports: [ AsyncPipe, - TranslateModule, RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/my-dspace-page/themed-my-dspace-page.component.ts b/src/app/my-dspace-page/themed-my-dspace-page.component.ts index d6979b3956..97486bc86f 100644 --- a/src/app/my-dspace-page/themed-my-dspace-page.component.ts +++ b/src/app/my-dspace-page/themed-my-dspace-page.component.ts @@ -11,7 +11,9 @@ import { MyDSpacePageComponent } from './my-dspace-page.component'; styleUrls: [], templateUrl: './../shared/theme-support/themed.component.html', standalone: true, - imports: [MyDSpacePageComponent], + imports: [ + MyDSpacePageComponent, + ], }) export class ThemedMyDSpacePageComponent extends ThemedComponent { diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts index be66314ff1..2217429cc9 100644 --- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts +++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { HostWindowService } from '../../shared/host-window.service'; import { MenuService } from '../../shared/menu/menu.service'; @@ -49,7 +49,7 @@ describe('ExpandableNavbarSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([{ id: 'test', visible: true, model: {} as MenuItemModels }])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([{ id: 'test', visible: true, model: {} as MenuItemModels }])); fixture = TestBed.createComponent(ExpandableNavbarSectionComponent); component = fixture.componentInstance; @@ -63,7 +63,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'activateSection').and.callThrough(); spyOn(menuService, 'activateSection'); // Make sure section is 'inactive'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(false)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(false)); component.ngOnInit(); fixture.detectChanges(); @@ -90,7 +90,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'deactivateSection').and.callThrough(); spyOn(menuService, 'deactivateSection'); // Make sure section is 'active'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(true)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(true)); component.ngOnInit(); component.mouseEntered = true; fixture.detectChanges(); @@ -117,7 +117,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'toggleSection').and.callThrough(); spyOn(menuService, 'toggleActiveSection'); // Make sure section is 'inactive'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(false)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(false)); component.ngOnInit(); fixture.detectChanges(); @@ -137,7 +137,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'toggleSection').and.callThrough(); spyOn(menuService, 'toggleActiveSection'); // Make sure section is 'active'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(true)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(true)); component.ngOnInit(); fixture.detectChanges(); @@ -159,7 +159,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'toggleSection').and.callThrough(); spyOn(menuService, 'toggleActiveSection'); // Make sure section is 'inactive'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(false)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(false)); component.ngOnInit(); fixture.detectChanges(); @@ -191,7 +191,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'toggleSection').and.callThrough(); spyOn(menuService, 'toggleActiveSection'); // Make sure section is 'active'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(true)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(true)); component.ngOnInit(); fixture.detectChanges(); @@ -213,7 +213,7 @@ describe('ExpandableNavbarSectionComponent', () => { spyOn(component, 'toggleSection').and.callThrough(); spyOn(menuService, 'toggleActiveSection'); // Make sure section is 'inactive'. Requires calling ngOnInit() to update component 'active' property. - spyOn(menuService, 'isSectionActive').and.returnValue(observableOf(false)); + spyOn(menuService, 'isSectionActive').and.returnValue(of(false)); component.ngOnInit(); fixture.detectChanges(); @@ -260,7 +260,7 @@ describe('ExpandableNavbarSectionComponent', () => { describe('navigateDropdown', () => { beforeEach(fakeAsync(() => { jasmine.getEnv().allowRespy(true); - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([ + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([ { id: 'subSection1', model: Object.assign(new LinkMenuItemModel(), { @@ -326,7 +326,7 @@ describe('ExpandableNavbarSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([{ id: 'test', visible: true, model: {} as MenuItemModels }])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([{ id: 'test', visible: true, model: {} as MenuItemModels }])); fixture = TestBed.createComponent(ExpandableNavbarSectionComponent); component = fixture.componentInstance; diff --git a/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts b/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts index 7b0efb8123..8295ff1909 100644 --- a/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts +++ b/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts @@ -11,7 +11,9 @@ import { ExpandableNavbarSectionComponent } from './expandable-navbar-section.co styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [ExpandableNavbarSectionComponent], + imports: [ + ExpandableNavbarSectionComponent, + ], }) export class ThemedExpandableNavbarSectionComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/navbar/navbar-section/navbar-section.component.spec.ts b/src/app/navbar/navbar-section/navbar-section.component.spec.ts index c98082cad5..f5e3eaff22 100644 --- a/src/app/navbar/navbar-section/navbar-section.component.spec.ts +++ b/src/app/navbar/navbar-section/navbar-section.component.spec.ts @@ -5,7 +5,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { HostWindowService } from '../../shared/host-window.service'; import { MenuService } from '../../shared/menu/menu.service'; @@ -30,7 +30,7 @@ describe('NavbarSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([])); fixture = TestBed.createComponent(NavbarSectionComponent); component = fixture.componentInstance; diff --git a/src/app/navbar/navbar-section/navbar-section.component.ts b/src/app/navbar/navbar-section/navbar-section.component.ts index fdeca1ade9..de2b856dc2 100644 --- a/src/app/navbar/navbar-section/navbar-section.component.ts +++ b/src/app/navbar/navbar-section/navbar-section.component.ts @@ -22,7 +22,10 @@ import { AbstractMenuSectionComponent } from '../../shared/menu/menu-section/abs templateUrl: './navbar-section.component.html', styleUrls: ['./navbar-section.component.scss'], standalone: true, - imports: [NgComponentOutlet, AsyncPipe], + imports: [ + AsyncPipe, + NgComponentOutlet, + ], }) export class NavbarSectionComponent extends AbstractMenuSectionComponent implements OnInit { /** diff --git a/src/app/navbar/navbar.component.spec.ts b/src/app/navbar/navbar.component.spec.ts index 7d4500ec07..0521301505 100644 --- a/src/app/navbar/navbar.component.spec.ts +++ b/src/app/navbar/navbar.component.spec.ts @@ -17,7 +17,7 @@ import { } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AppState, @@ -52,7 +52,7 @@ let store: Store; let initialState: any; const authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); const mockItem = Object.assign(new Item(), { @@ -68,7 +68,7 @@ const mockItem = Object.assign(new Item(), { }); const routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), children: [], diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index eb5fb89ffa..db5ee65fc4 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -41,7 +41,14 @@ import { ThemeService } from '../shared/theme-support/theme.service'; templateUrl: './navbar.component.html', animations: [slideMobileNav], standalone: true, - imports: [NgbDropdownModule, NgClass, ThemedUserMenuComponent, NgComponentOutlet, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbDropdownModule, + NgClass, + NgComponentOutlet, + ThemedUserMenuComponent, + TranslateModule, + ], }) export class NavbarComponent extends MenuComponent implements OnInit { /** diff --git a/src/app/navbar/themed-navbar.component.ts b/src/app/navbar/themed-navbar.component.ts index 5186c618a6..e1d2b7a47a 100644 --- a/src/app/navbar/themed-navbar.component.ts +++ b/src/app/navbar/themed-navbar.component.ts @@ -11,7 +11,9 @@ import { NavbarComponent } from './navbar.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [NavbarComponent], + imports: [ + NavbarComponent, + ], }) export class ThemedNavbarComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts index bcefd317c8..8190ed225c 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts @@ -19,7 +19,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; import { ItemDataService } from 'src/app/core/data/item-data.service'; @@ -228,7 +228,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { componentInstance: { externalSourceEntry: null, label: null, - importedObject: observableOf({ + importedObject: of({ indexableObject: NotificationsMockDspaceObject, }), }, @@ -247,7 +247,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { describe('executeAction', () => { it('should call getQualityAssuranceEvents on 200 response from REST', () => { const action = 'ACCEPTED'; - spyOn(compAsAny, 'getQualityAssuranceEvents').and.returnValue(observableOf([ + spyOn(compAsAny, 'getQualityAssuranceEvents').and.returnValue(of([ getQualityAssuranceEventData1(), getQualityAssuranceEventData2(), ])); @@ -323,8 +323,8 @@ describe('QualityAssuranceEventsComponent test suite', () => { ]; const paginatedList = buildPaginatedList(pageInfo, array); const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); - qualityAssuranceEventRestServiceStub.getEventsByTopic.and.returnValue(observableOf(paginatedListRD)); - spyOn(compAsAny, 'fetchEvents').and.returnValue(observableOf([ + qualityAssuranceEventRestServiceStub.getEventsByTopic.and.returnValue(of(paginatedListRD)); + spyOn(compAsAny, 'fetchEvents').and.returnValue(of([ getQualityAssuranceEventData1(), getQualityAssuranceEventData2(), ])); diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts index 6adaf9dea9..ab382594cc 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts @@ -83,7 +83,17 @@ import { EPersonDataComponent } from './ePerson-data/ePerson-data.component'; templateUrl: './quality-assurance-events.component.html', styleUrls: ['./quality-assurance-events.component.scss'], standalone: true, - imports: [AlertComponent, ThemedLoadingComponent, PaginationComponent, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule, EPersonDataComponent, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + EPersonDataComponent, + NgbTooltipModule, + PaginationComponent, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + ], }) export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { /** diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts index bc0fb62326..0bd7ba2f93 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts @@ -12,7 +12,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; import { Item } from '../../../core/shared/item.model'; @@ -122,7 +122,7 @@ describe('ProjectEntryImportModalComponent test suite', () => { // synchronous beforeEach beforeEach(() => { - searchServiceStub.search.and.returnValue(observableOf(paginatedListRD)); + searchServiceStub.search.and.returnValue(of(paginatedListRD)); const html = ` `; testFixture = createTestComponent(html, TestComponent) as ComponentFixture; @@ -156,7 +156,7 @@ describe('ProjectEntryImportModalComponent test suite', () => { describe('search', () => { it('should call SearchService.search', () => { - (searchServiceStub as any).search.and.returnValue(observableOf(paginatedListRD)); + (searchServiceStub as any).search.and.returnValue(of(paginatedListRD)); comp.pagination = pagination; comp.search(searchString); diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts index 63e9848020..ff7c9b53fa 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts @@ -12,7 +12,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; @@ -103,7 +103,16 @@ export interface QualityAssuranceEventData { styleUrls: ['./project-entry-import-modal.component.scss'], templateUrl: './project-entry-import-modal.component.html', standalone: true, - imports: [RouterLink, FormsModule, ThemedLoadingComponent, ThemedSearchResultsComponent, AlertComponent, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + FormsModule, + RouterLink, + ThemedLoadingComponent, + ThemedSearchResultsComponent, + TranslateModule, + ], }) /** * Component to display a modal window for linking a project to an Quality Assurance event @@ -141,7 +150,7 @@ export class ProjectEntryImportModalComponent implements OnInit, OnDestroy { /** * Information about the data loading status */ - isLoading$ = observableOf(true); + isLoading$ = of(true); /** * Search options to use for fetching projects */ @@ -215,7 +224,7 @@ export class ProjectEntryImportModalComponent implements OnInit, OnDestroy { this.localEntitiesRD$ = this.searchService.search(this.searchOptions); this.subs.push( this.localEntitiesRD$.subscribe( - () => this.isLoading$ = observableOf(false), + () => this.isLoading$ = of(false), ), ); } @@ -234,7 +243,7 @@ export class ProjectEntryImportModalComponent implements OnInit, OnDestroy { public search(searchTitle): void { if (isNotEmpty(searchTitle)) { const filterRegEx = /[:]/g; - this.isLoading$ = observableOf(true); + this.isLoading$ = of(true); this.searchOptions = Object.assign(new PaginatedSearchOptions( { configuration: this.configuration, @@ -245,7 +254,7 @@ export class ProjectEntryImportModalComponent implements OnInit, OnDestroy { this.localEntitiesRD$ = this.searchService.search(this.searchOptions); this.subs.push( this.localEntitiesRD$.subscribe( - () => this.isLoading$ = observableOf(false), + () => this.isLoading$ = of(false), ), ); } diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts index 226630c0f1..302d768076 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts @@ -12,7 +12,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { AlertComponent } from '../../../shared/alert/alert.component'; @@ -53,7 +53,7 @@ describe('QualityAssuranceSourceComponent test suite', () => { ], providers: [ { provide: NotificationsStateService, useValue: mockNotificationsStateService }, - { provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), params: observableOf({}) } }, + { provide: ActivatedRoute, useValue: { data: of(activatedRouteParams), params: of({}) } }, { provide: PaginationService, useValue: paginationService }, QualityAssuranceSourceComponent, ], @@ -68,16 +68,16 @@ describe('QualityAssuranceSourceComponent test suite', () => { }, }) .compileComponents().then(() => { - mockNotificationsStateService.getQualityAssuranceSource.and.returnValue(observableOf([ + mockNotificationsStateService.getQualityAssuranceSource.and.returnValue(of([ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract, ])); - mockNotificationsStateService.getQualityAssuranceSourceTotalPages.and.returnValue(observableOf(1)); - mockNotificationsStateService.getQualityAssuranceSourceCurrentPage.and.returnValue(observableOf(0)); - mockNotificationsStateService.getQualityAssuranceSourceTotals.and.returnValue(observableOf(2)); - mockNotificationsStateService.isQualityAssuranceSourceLoaded.and.returnValue(observableOf(true)); - mockNotificationsStateService.isQualityAssuranceSourceLoading.and.returnValue(observableOf(false)); - mockNotificationsStateService.isQualityAssuranceSourceProcessing.and.returnValue(observableOf(false)); + mockNotificationsStateService.getQualityAssuranceSourceTotalPages.and.returnValue(of(1)); + mockNotificationsStateService.getQualityAssuranceSourceCurrentPage.and.returnValue(of(0)); + mockNotificationsStateService.getQualityAssuranceSourceTotals.and.returnValue(of(2)); + mockNotificationsStateService.isQualityAssuranceSourceLoaded.and.returnValue(of(true)); + mockNotificationsStateService.isQualityAssuranceSourceLoading.and.returnValue(of(false)); + mockNotificationsStateService.isQualityAssuranceSourceProcessing.and.returnValue(of(false)); }); })); diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.ts b/src/app/notifications/qa/source/quality-assurance-source.component.ts index 0a5cf37c8d..eb0fa02bf0 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.ts @@ -47,7 +47,16 @@ import { templateUrl: './quality-assurance-source.component.html', styleUrls: ['./quality-assurance-source.component.scss'], standalone: true, - imports: [AlertComponent, ThemedLoadingComponent, PaginationComponent, RouterLink, AsyncPipe, TranslateModule, DatePipe, SourceListComponent], + imports: [ + AlertComponent, + AsyncPipe, + DatePipe, + PaginationComponent, + RouterLink, + SourceListComponent, + ThemedLoadingComponent, + TranslateModule, + ], }) export class QualityAssuranceSourceComponent implements OnDestroy, OnInit, AfterViewInit { diff --git a/src/app/notifications/qa/source/quality-assurance-source.effects.ts b/src/app/notifications/qa/source/quality-assurance-source.effects.ts index d866d43365..7e0585e3a8 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.effects.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.effects.ts @@ -6,7 +6,7 @@ import { } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { catchError, map, @@ -53,7 +53,7 @@ export class QualityAssuranceSourceEffects { } else { console.error('Unexpected object thrown', error); } - return observableOf(new RetrieveAllSourceErrorAction()); + return of(new RetrieveAllSourceErrorAction()); }), ); }), diff --git a/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts index 12e0ab9a29..97e148080c 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -43,7 +43,7 @@ describe('QualityAssuranceSourceService', () => { beforeEach(() => { restService = TestBed.inject(QualityAssuranceSourceDataService); restServiceAsAny = restService; - restServiceAsAny.getSources.and.returnValue(observableOf(paginatedListRD)); + restServiceAsAny.getSources.and.returnValue(of(paginatedListRD)); service = new QualityAssuranceSourceService(restService); serviceAsAny = service; }); diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts index 38792eb632..c24e8c73a5 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts @@ -13,7 +13,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from 'src/app/core/data/item-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; @@ -53,7 +53,7 @@ describe('QualityAssuranceTopicsComponent test suite', () => { ], providers: [ { provide: NotificationsStateService, useValue: mockNotificationsStateService }, - { provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), snapshot: { + { provide: ActivatedRoute, useValue: { data: of(activatedRouteParams), snapshot: { params: { sourceId: 'openaire', targetId: null, @@ -75,16 +75,16 @@ describe('QualityAssuranceTopicsComponent test suite', () => { }, }) .compileComponents().then(() => { - mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([ + mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(of([ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract, ])); - mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1)); - mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0)); - mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(observableOf(2)); - mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(observableOf(true)); - mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(observableOf(false)); - mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(observableOf(false)); + mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(of(1)); + mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(of(0)); + mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(of(2)); + mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(of(true)); + mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(of(false)); + mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(of(false)); }); })); diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts index f700b68689..1b8bb8c34a 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts @@ -52,7 +52,15 @@ import { NotificationsStateService } from '../../notifications-state.service'; templateUrl: './quality-assurance-topics.component.html', styleUrls: ['./quality-assurance-topics.component.scss'], standalone: true, - imports: [AlertComponent, ThemedLoadingComponent, PaginationComponent, RouterLink, AsyncPipe, TranslateModule, DatePipe], + imports: [ + AlertComponent, + AsyncPipe, + DatePipe, + PaginationComponent, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + ], }) export class QualityAssuranceTopicsComponent implements OnInit, OnDestroy, AfterViewInit { /** diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts b/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts index 0009df0ef5..3fd4aa5dfe 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts @@ -6,7 +6,7 @@ import { } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { catchError, map, @@ -55,7 +55,7 @@ export class QualityAssuranceTopicsEffects { } else { console.error('Unexpected object thrown', error); } - return observableOf(new RetrieveAllTopicsErrorAction()); + return of(new RetrieveAllTopicsErrorAction()); }), ); }), diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts index a1ae542352..42da310756 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestParam } from '../../../core/cache/models/request-param.model'; import { @@ -44,8 +44,8 @@ describe('QualityAssuranceTopicsService', () => { beforeEach(() => { restService = TestBed.inject(QualityAssuranceTopicDataService); restServiceAsAny = restService; - restServiceAsAny.searchTopicsBySource.and.returnValue(observableOf(paginatedListRD)); - restServiceAsAny.searchTopicsByTarget.and.returnValue(observableOf(paginatedListRD)); + restServiceAsAny.searchTopicsBySource.and.returnValue(of(paginatedListRD)); + restServiceAsAny.searchTopicsByTarget.and.returnValue(of(paginatedListRD)); service = new QualityAssuranceTopicsService(restService); serviceAsAny = service; }); diff --git a/src/app/notifications/shared/source-list.component.ts b/src/app/notifications/shared/source-list.component.ts index d49d7977fe..8958760142 100644 --- a/src/app/notifications/shared/source-list.component.ts +++ b/src/app/notifications/shared/source-list.component.ts @@ -30,7 +30,15 @@ export interface SourceObject { templateUrl: './source-list.component.html', styleUrls: ['./source-list.component.scss'], standalone: true, - imports: [AlertComponent, ThemedLoadingComponent, PaginationComponent, RouterLink, AsyncPipe, TranslateModule, DatePipe], + imports: [ + AlertComponent, + AsyncPipe, + DatePipe, + PaginationComponent, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + ], }) export class SourceListComponent { diff --git a/src/app/notifications/suggestions/actions/suggestion-actions.component.ts b/src/app/notifications/suggestions/actions/suggestion-actions.component.ts index f3b0e5387f..d52db2b557 100644 --- a/src/app/notifications/suggestions/actions/suggestion-actions.component.ts +++ b/src/app/notifications/suggestions/actions/suggestion-actions.component.ts @@ -28,10 +28,10 @@ import { SuggestionApproveAndImport } from '../list-element/suggestion-approve-a styleUrls: ['./suggestion-actions.component.scss'], templateUrl: './suggestion-actions.component.html', imports: [ - EntityDropdownComponent, - TranslateModule, - NgbDropdownModule, BtnDisabledDirective, + EntityDropdownComponent, + NgbDropdownModule, + TranslateModule, ], standalone: true, }) diff --git a/src/app/notifications/suggestions/list-element/suggestion-evidences/suggestion-evidences.component.ts b/src/app/notifications/suggestions/list-element/suggestion-evidences/suggestion-evidences.component.ts index 8214a794c5..5b2b895d4a 100644 --- a/src/app/notifications/suggestions/list-element/suggestion-evidences/suggestion-evidences.component.ts +++ b/src/app/notifications/suggestions/list-element/suggestion-evidences/suggestion-evidences.component.ts @@ -18,8 +18,8 @@ import { ObjectKeysPipe } from '../../../../shared/utils/object-keys-pipe'; templateUrl: './suggestion-evidences.component.html', animations: [fadeIn], imports: [ - TranslateModule, ObjectKeysPipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/notifications/suggestions/list-element/suggestion-list-element.component.ts b/src/app/notifications/suggestions/list-element/suggestion-list-element.component.ts index 07d68f4367..c8bd7f3e3e 100644 --- a/src/app/notifications/suggestions/list-element/suggestion-list-element.component.ts +++ b/src/app/notifications/suggestions/list-element/suggestion-list-element.component.ts @@ -26,10 +26,10 @@ import { SuggestionEvidencesComponent } from './suggestion-evidences/suggestion- templateUrl: './suggestion-list-element.component.html', animations: [fadeIn], imports: [ - TranslateModule, ItemSearchResultListElementComponent, SuggestionActionsComponent, SuggestionEvidencesComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/notifications/suggestions/notification/suggestions-notification.component.ts b/src/app/notifications/suggestions/notification/suggestions-notification.component.ts index ca81d5d419..ba97498af4 100644 --- a/src/app/notifications/suggestions/notification/suggestions-notification.component.ts +++ b/src/app/notifications/suggestions/notification/suggestions-notification.component.ts @@ -19,9 +19,9 @@ import { SuggestionTargetsStateService } from '../targets/suggestion-targets.sta templateUrl: './suggestions-notification.component.html', standalone: true, imports: [ + AsyncPipe, RouterLink, TranslateModule, - AsyncPipe, ], styleUrls: ['./suggestions-notification.component.scss'], }) diff --git a/src/app/notifications/suggestions/popup/suggestions-popup.component.spec.ts b/src/app/notifications/suggestions/popup/suggestions-popup.component.spec.ts index 3710500552..496bdbf19f 100644 --- a/src/app/notifications/suggestions/popup/suggestions-popup.component.spec.ts +++ b/src/app/notifications/suggestions/popup/suggestions-popup.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { mockSuggestionTargetsObjectOne } from '../../../shared/mocks/publication-claim-targets.mock'; import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; @@ -63,10 +63,10 @@ describe('SuggestionsPopupComponent', () => { describe('when there are publication suggestions', () => { beforeEach(() => { - suggestionStateService.hasUserVisitedSuggestions.and.returnValue(observableOf(false)); - suggestionStateService.getCurrentUserSuggestionTargets.and.returnValue(observableOf([mockSuggestionTargetsObjectOne])); - suggestionStateService.dispatchMarkUserSuggestionsAsVisitedAction.and.returnValue(observableOf(null)); - suggestionStateService.dispatchRefreshUserSuggestionsAction.and.returnValue(observableOf(null)); + suggestionStateService.hasUserVisitedSuggestions.and.returnValue(of(false)); + suggestionStateService.getCurrentUserSuggestionTargets.and.returnValue(of([mockSuggestionTargetsObjectOne])); + suggestionStateService.dispatchMarkUserSuggestionsAsVisitedAction.and.returnValue(of(null)); + suggestionStateService.dispatchRefreshUserSuggestionsAction.and.returnValue(of(null)); fixture = TestBed.createComponent(SuggestionsPopupComponent); component = fixture.componentInstance; diff --git a/src/app/notifications/suggestions/popup/suggestions-popup.component.ts b/src/app/notifications/suggestions/popup/suggestions-popup.component.ts index eeef8b4dde..276b6821f7 100644 --- a/src/app/notifications/suggestions/popup/suggestions-popup.component.ts +++ b/src/app/notifications/suggestions/popup/suggestions-popup.component.ts @@ -39,8 +39,8 @@ import { SuggestionTargetsStateService } from '../targets/suggestion-targets.sta ], imports: [ AsyncPipe, - TranslateModule, RouterLink, + TranslateModule, ], standalone: true, }) diff --git a/src/app/notifications/suggestions/sources/suggestion-sources.component.ts b/src/app/notifications/suggestions/sources/suggestion-sources.component.ts index b6da20683a..512f925442 100644 --- a/src/app/notifications/suggestions/sources/suggestion-sources.component.ts +++ b/src/app/notifications/suggestions/sources/suggestion-sources.component.ts @@ -34,9 +34,9 @@ import { selector: 'ds-suggestion-sources', standalone: true, imports: [ - SourceListComponent, - AsyncPipe, AlertComponent, + AsyncPipe, + SourceListComponent, TranslatePipe, ], templateUrl: './suggestion-sources.component.html', diff --git a/src/app/notifications/suggestions/suggestions.service.spec.ts b/src/app/notifications/suggestions/suggestions.service.spec.ts index 6e6ede9e05..1ba23f642a 100644 --- a/src/app/notifications/suggestions/suggestions.service.spec.ts +++ b/src/app/notifications/suggestions/suggestions.service.spec.ts @@ -1,5 +1,5 @@ import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { @@ -56,21 +56,21 @@ describe('SuggestionsService test', () => { researcherProfileService = jasmine.createSpyObj('researcherProfileService', { findById: createSuccessfulRemoteDataObject$(mockResercherProfile as ResearcherProfile), - findRelatedItemId: observableOf('1234'), + findRelatedItemId: of('1234'), }); suggestionTargetDataService = jasmine.createSpyObj('suggestionTargetsDataService', { - getTargetsBySource: observableOf(null), - findById: observableOf(null), + getTargetsBySource: of(null), + findById: of(null), }); suggestionsDataService = jasmine.createSpyObj('suggestionsDataService', { - searchBy: observableOf(null), - delete: observableOf(null), + searchBy: of(null), + delete: of(null), deleteSuggestion: createSuccessfulRemoteDataObject$({}), - getSuggestionsByTargetAndSource : observableOf(null), + getSuggestionsByTargetAndSource : of(null), clearSuggestionRequests : null, - getTargetsByUser: observableOf(null), + getTargetsByUser: of(null), }); service = initTestService(); @@ -121,14 +121,14 @@ describe('SuggestionsService test', () => { it('should approve and import suggestion', () => { spyOn(service, 'resolveCollectionId'); - const workspaceitemService = { importExternalSourceEntry: (x,y) => observableOf(null) }; + const workspaceitemService = { importExternalSourceEntry: (x,y) => of(null) }; service.approveAndImport(workspaceitemService as unknown as WorkspaceitemDataService, mockSuggestionPublicationOne, '1234'); expect(service.resolveCollectionId).toHaveBeenCalled(); }); it('should approve and import suggestions', () => { spyOn(service, 'approveAndImport'); - const workspaceitemService = { importExternalSourceEntry: (x,y) => observableOf(null) }; + const workspaceitemService = { importExternalSourceEntry: (x,y) => of(null) }; service.approveAndImportMultiple(workspaceitemService as unknown as WorkspaceitemDataService, [mockSuggestionPublicationOne], '1234'); expect(service.approveAndImport).toHaveBeenCalledWith(workspaceitemService as unknown as WorkspaceitemDataService, mockSuggestionPublicationOne, '1234'); }); diff --git a/src/app/notifications/suggestions/targets/publication-claim/publication-claim.component.ts b/src/app/notifications/suggestions/targets/publication-claim/publication-claim.component.ts index f3bebecc56..f9e0f8b2de 100644 --- a/src/app/notifications/suggestions/targets/publication-claim/publication-claim.component.ts +++ b/src/app/notifications/suggestions/targets/publication-claim/publication-claim.component.ts @@ -38,11 +38,11 @@ import { SuggestionTargetsStateService } from '../suggestion-targets.state.servi templateUrl: './publication-claim.component.html', styleUrls: ['./publication-claim.component.scss'], imports: [ - ThemedLoadingComponent, AsyncPipe, - TranslateModule, PaginationComponent, RouterLink, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/page-error/page-error.component.spec.ts b/src/app/page-error/page-error.component.spec.ts index 47ce42c950..6035e8d160 100644 --- a/src/app/page-error/page-error.component.spec.ts +++ b/src/app/page-error/page-error.component.spec.ts @@ -9,7 +9,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; import { TranslateLoaderMock } from '../shared/testing/translate-loader.mock'; @@ -19,7 +19,7 @@ describe('PageErrorComponent', () => { let component: PageErrorComponent; let fixture: ComponentFixture; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - queryParams: observableOf({ + queryParams: of({ status: 401, code: 'orcid.generic-error', }), diff --git a/src/app/page-error/page-error.component.ts b/src/app/page-error/page-error.component.ts index 5a8f87ed59..ecf0a1d68e 100644 --- a/src/app/page-error/page-error.component.ts +++ b/src/app/page-error/page-error.component.ts @@ -14,7 +14,9 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './page-error.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class PageErrorComponent { status: number; diff --git a/src/app/page-error/themed-page-error.component.ts b/src/app/page-error/themed-page-error.component.ts index a3ee38fd60..1d595d8ff7 100644 --- a/src/app/page-error/themed-page-error.component.ts +++ b/src/app/page-error/themed-page-error.component.ts @@ -11,7 +11,9 @@ import { PageErrorComponent } from './page-error.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [PageErrorComponent], + imports: [ + PageErrorComponent, + ], }) export class ThemedPageErrorComponent extends ThemedComponent { diff --git a/src/app/page-internal-server-error/page-internal-server-error.component.ts b/src/app/page-internal-server-error/page-internal-server-error.component.ts index c51757c4e1..ab0ddede58 100644 --- a/src/app/page-internal-server-error/page-internal-server-error.component.ts +++ b/src/app/page-internal-server-error/page-internal-server-error.component.ts @@ -15,7 +15,9 @@ import { ServerResponseService } from '../core/services/server-response.service' templateUrl: './page-internal-server-error.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class PageInternalServerErrorComponent { diff --git a/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts b/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts index 01146b2a88..82623706a6 100644 --- a/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts +++ b/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts @@ -11,7 +11,9 @@ import { PageInternalServerErrorComponent } from './page-internal-server-error.c styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [PageInternalServerErrorComponent], + imports: [ + PageInternalServerErrorComponent, + ], }) export class ThemedPageInternalServerErrorComponent extends ThemedComponent { diff --git a/src/app/pagenotfound/pagenotfound.component.ts b/src/app/pagenotfound/pagenotfound.component.ts index 8fd738c882..e69884b2a1 100644 --- a/src/app/pagenotfound/pagenotfound.component.ts +++ b/src/app/pagenotfound/pagenotfound.component.ts @@ -18,7 +18,10 @@ import { ServerResponseService } from '../core/services/server-response.service' templateUrl: './pagenotfound.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) export class PageNotFoundComponent implements OnInit { diff --git a/src/app/pagenotfound/themed-pagenotfound.component.ts b/src/app/pagenotfound/themed-pagenotfound.component.ts index d7308908ce..e4330a223c 100644 --- a/src/app/pagenotfound/themed-pagenotfound.component.ts +++ b/src/app/pagenotfound/themed-pagenotfound.component.ts @@ -11,7 +11,9 @@ import { PageNotFoundComponent } from './pagenotfound.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [PageNotFoundComponent], + imports: [ + PageNotFoundComponent, + ], }) export class ThemedPageNotFoundComponent extends ThemedComponent { diff --git a/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts b/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts index 3a3926340d..d6088c0b86 100644 --- a/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts +++ b/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts @@ -8,7 +8,9 @@ import { TranslateModule } from '@ngx-translate/core'; selector: 'ds-process-detail-field', templateUrl: './process-detail-field.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * A component displaying a single detail about a DSpace Process diff --git a/src/app/process-page/detail/process-detail.component.spec.ts b/src/app/process-page/detail/process-detail.component.spec.ts index 6f3cd96dc3..0b33187363 100644 --- a/src/app/process-page/detail/process-detail.component.spec.ts +++ b/src/app/process-page/detail/process-detail.component.spec.ts @@ -20,7 +20,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -131,7 +131,7 @@ describe('ProcessDetailComponent', () => { getName: fileName, }); httpClient = jasmine.createSpyObj('httpClient', { - get: observableOf(processOutput), + get: of(processOutput), }); modalService = jasmine.createSpyObj('modalService', { @@ -241,7 +241,7 @@ describe('ProcessDetailComponent', () => { describe('if press show output logs and process has no output logs', () => { beforeEach(fakeAsync(() => { jasmine.getEnv().allowRespy(true); - spyOn(httpClient, 'get').and.returnValue(observableOf(null)); + spyOn(httpClient, 'get').and.returnValue(of(null)); fixture = TestBed.createComponent(ProcessDetailComponent); component = fixture.componentInstance; spyOn(component, 'showProcessOutputLogs').and.callThrough(); diff --git a/src/app/process-page/detail/process-detail.component.ts b/src/app/process-page/detail/process-detail.component.ts index 0be0a69454..537578ebc8 100644 --- a/src/app/process-page/detail/process-detail.component.ts +++ b/src/app/process-page/detail/process-detail.component.ts @@ -74,7 +74,18 @@ import { ProcessDetailFieldComponent } from './process-detail-field/process-deta selector: 'ds-process-detail', templateUrl: './process-detail.component.html', standalone: true, - imports: [ProcessDetailFieldComponent, VarDirective, ThemedFileDownloadLinkComponent, ThemedLoadingComponent, RouterLink, AsyncPipe, DatePipe, FileSizePipe, TranslateModule, HasNoValuePipe], + imports: [ + AsyncPipe, + DatePipe, + FileSizePipe, + HasNoValuePipe, + ProcessDetailFieldComponent, + RouterLink, + ThemedFileDownloadLinkComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** * A component displaying detailed information about a DSpace Process diff --git a/src/app/process-page/form/process-form.component.spec.ts b/src/app/process-page/form/process-form.component.spec.ts index c8f49b514c..889d27e98b 100644 --- a/src/app/process-page/form/process-form.component.spec.ts +++ b/src/app/process-page/form/process-form.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ScriptDataService } from '../../core/data/processes/script-data.service'; import { RequestService } from '../../core/data/request.service'; @@ -48,7 +48,7 @@ describe('ProcessFormComponent', () => { scriptService = jasmine.createSpyObj( 'scriptService', { - invoke: observableOf({ + invoke: of({ response: { isSuccessful: true, diff --git a/src/app/process-page/form/process-form.component.ts b/src/app/process-page/form/process-form.component.ts index 65c1f20a8c..6e60d1b9db 100644 --- a/src/app/process-page/form/process-form.component.ts +++ b/src/app/process-page/form/process-form.component.ts @@ -40,7 +40,14 @@ import { ScriptsSelectComponent } from './scripts-select/scripts-select.componen templateUrl: './process-form.component.html', styleUrls: ['./process-form.component.scss'], standalone: true, - imports: [FormsModule, ScriptsSelectComponent, ProcessParametersComponent, RouterLink, ScriptHelpComponent, TranslateModule], + imports: [ + FormsModule, + ProcessParametersComponent, + RouterLink, + ScriptHelpComponent, + ScriptsSelectComponent, + TranslateModule, + ], }) export class ProcessFormComponent implements OnInit { /** diff --git a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts index 09bb0adece..841cca45a7 100644 --- a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ScriptParameter } from '../../../scripts/script-parameter.model'; import { ScriptParameterType } from '../../../scripts/script-parameter-type.model'; @@ -23,7 +23,7 @@ describe('ParameterSelectComponent', () => { let scriptParams: ScriptParameter[]; const translateServiceStub = { - get: () => observableOf('---'), + get: () => of('---'), }; function init() { diff --git a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts index 73cb655267..077295037e 100644 --- a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts @@ -31,7 +31,11 @@ import { ParameterValueInputComponent } from '../parameter-value-input/parameter deps: [[new Optional(), NgForm]], }], standalone: true, - imports: [FormsModule, ParameterValueInputComponent, TranslateModule], + imports: [ + FormsModule, + ParameterValueInputComponent, + TranslateModule, + ], }) export class ParameterSelectComponent { @Input() index: number; diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts index 1c3289f4e8..9fddfdea20 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts @@ -19,7 +19,9 @@ import { ValueInputComponent } from '../value-input.component'; selector: 'ds-boolean-value-input', templateUrl: './boolean-value-input.component.html', styleUrls: ['./boolean-value-input.component.scss'], - imports: [TranslateModule], + imports: [ + TranslateModule, + ], viewProviders: [{ provide: ControlContainer, useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts index f87fdeab55..7fd82037b5 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts @@ -26,7 +26,10 @@ import { ValueInputComponent } from '../value-input.component'; useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, - imports: [FormsModule, TranslateModule], + imports: [ + FormsModule, + TranslateModule, + ], }) export class DateValueInputComponent extends ValueInputComponent implements OnInit { /** diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts index 6cf098f983..93751ed35f 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts @@ -26,7 +26,12 @@ import { ValueInputComponent } from '../value-input.component'; useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, - imports: [FileValueAccessorDirective, FormsModule, FileValidator, TranslateModule], + imports: [ + FileValidator, + FileValueAccessorDirective, + FormsModule, + TranslateModule, + ], }) export class FileValueInputComponent extends ValueInputComponent { /** diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/number-value-input/integer-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/number-value-input/integer-value-input.component.ts index 0ae56c7062..e68272fe24 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/number-value-input/integer-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/number-value-input/integer-value-input.component.ts @@ -25,7 +25,10 @@ import { ValueInputComponent } from '../value-input.component'; useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, - imports: [FormsModule, TranslateModule], + imports: [ + FormsModule, + TranslateModule, + ], }) export class IntegerValueInputComponent extends ValueInputComponent implements OnInit { /** diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts index 32c8355b9a..defb2c8ee0 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts @@ -31,7 +31,13 @@ import { StringValueInputComponent } from './string-value-input/string-value-inp useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, - imports: [StringValueInputComponent, DateValueInputComponent, FileValueInputComponent, BooleanValueInputComponent, IntegerValueInputComponent], + imports: [ + BooleanValueInputComponent, + DateValueInputComponent, + FileValueInputComponent, + IntegerValueInputComponent, + StringValueInputComponent, + ], }) export class ParameterValueInputComponent { @Input() index: number; diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts index 1e718379eb..9241cb6335 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts @@ -26,7 +26,10 @@ import { ValueInputComponent } from '../value-input.component'; useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, - imports: [FormsModule, TranslateModule], + imports: [ + FormsModule, + TranslateModule, + ], }) export class StringValueInputComponent extends ValueInputComponent implements OnInit { /** diff --git a/src/app/process-page/form/process-parameters/process-parameters.component.ts b/src/app/process-page/form/process-parameters/process-parameters.component.ts index 81d260577b..16a54ea31d 100644 --- a/src/app/process-page/form/process-parameters/process-parameters.component.ts +++ b/src/app/process-page/form/process-parameters/process-parameters.component.ts @@ -35,7 +35,10 @@ import { ParameterSelectComponent } from './parameter-select/parameter-select.co deps: [[new Optional(), NgForm]], }], standalone: true, - imports: [ParameterSelectComponent, TranslateModule], + imports: [ + ParameterSelectComponent, + TranslateModule, + ], }) export class ProcessParametersComponent implements OnChanges, OnInit { /** diff --git a/src/app/process-page/form/script-help/script-help.component.ts b/src/app/process-page/form/script-help/script-help.component.ts index 81bd9d710b..69d2c0c832 100644 --- a/src/app/process-page/form/script-help/script-help.component.ts +++ b/src/app/process-page/form/script-help/script-help.component.ts @@ -16,7 +16,10 @@ import { ScriptParameterType } from '../../scripts/script-parameter-type.model'; templateUrl: './script-help.component.html', styleUrls: ['./script-help.component.scss'], standalone: true, - imports: [NgTemplateOutlet, TranslateModule], + imports: [ + NgTemplateOutlet, + TranslateModule, + ], }) export class ScriptHelpComponent { /** diff --git a/src/app/process-page/form/scripts-select/scripts-select.component.ts b/src/app/process-page/form/scripts-select/scripts-select.component.ts index 9216a8cfc2..bad9394b3f 100644 --- a/src/app/process-page/form/scripts-select/scripts-select.component.ts +++ b/src/app/process-page/form/scripts-select/scripts-select.component.ts @@ -54,7 +54,14 @@ const SCRIPT_QUERY_PARAMETER = 'script'; useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, - imports: [FormsModule, AsyncPipe, TranslateModule, InfiniteScrollModule, ThemedLoadingComponent, NgbDropdownModule], + imports: [ + AsyncPipe, + FormsModule, + InfiniteScrollModule, + NgbDropdownModule, + ThemedLoadingComponent, + TranslateModule, + ], }) export class ScriptsSelectComponent implements OnInit, OnDestroy { /** diff --git a/src/app/process-page/new/new-process.component.spec.ts b/src/app/process-page/new/new-process.component.spec.ts index b6782dcf26..faffefc7cc 100644 --- a/src/app/process-page/new/new-process.component.spec.ts +++ b/src/app/process-page/new/new-process.component.spec.ts @@ -10,7 +10,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LinkService } from '../../core/cache/builders/link.service'; import { ProcessDataService } from '../../core/data/processes/process-data.service'; @@ -47,7 +47,7 @@ describe('NewProcessComponent', () => { scriptService = jasmine.createSpyObj( 'scriptService', { - invoke: observableOf({ + invoke: of({ response: { isSuccessful: true, diff --git a/src/app/process-page/new/new-process.component.ts b/src/app/process-page/new/new-process.component.ts index bed8ddbd6c..868ec5dd0c 100644 --- a/src/app/process-page/new/new-process.component.ts +++ b/src/app/process-page/new/new-process.component.ts @@ -28,7 +28,12 @@ import { Script } from '../scripts/script.model'; templateUrl: './new-process.component.html', styleUrls: ['./new-process.component.scss'], standalone: true, - imports: [VarDirective, ProcessFormComponent, AsyncPipe, HasValuePipe], + imports: [ + AsyncPipe, + HasValuePipe, + ProcessFormComponent, + VarDirective, + ], }) export class NewProcessComponent implements OnInit { /** diff --git a/src/app/process-page/overview/process-overview.component.ts b/src/app/process-page/overview/process-overview.component.ts index 776b1de9ff..56f5a7edcf 100644 --- a/src/app/process-page/overview/process-overview.component.ts +++ b/src/app/process-page/overview/process-overview.component.ts @@ -33,7 +33,17 @@ import { ProcessOverviewTableComponent } from './table/process-overview-table.co selector: 'ds-process-overview', templateUrl: './process-overview.component.html', standalone: true, - imports: [RouterLink, PaginationComponent, VarDirective, AsyncPipe, DatePipe, TranslateModule, NgTemplateOutlet, ProcessOverviewTableComponent, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + DatePipe, + NgTemplateOutlet, + PaginationComponent, + ProcessOverviewTableComponent, + RouterLink, + TranslateModule, + VarDirective, + ], }) /** * Component displaying a list of all processes in a paginated table diff --git a/src/app/process-page/overview/table/process-overview-table.component.ts b/src/app/process-page/overview/table/process-overview-table.component.ts index d1c1f27f52..bcb4a59bb9 100644 --- a/src/app/process-page/overview/table/process-overview-table.component.ts +++ b/src/app/process-page/overview/table/process-overview-table.component.ts @@ -83,13 +83,13 @@ export interface ProcessOverviewTableEntry { templateUrl: './process-overview-table.component.html', standalone: true, imports: [ - NgClass, - NgbCollapseModule, AsyncPipe, - TranslateModule, + NgbCollapseModule, + NgClass, PaginationComponent, RouterLink, ThemedLoadingComponent, + TranslateModule, VarDirective, ], }) diff --git a/src/app/process-page/process-breadcrumbs.service.ts b/src/app/process-page/process-breadcrumbs.service.ts index e6db4c87fd..e4024d5008 100644 --- a/src/app/process-page/process-breadcrumbs.service.ts +++ b/src/app/process-page/process-breadcrumbs.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { Breadcrumb } from '../breadcrumbs/breadcrumb/breadcrumb.model'; @@ -22,9 +22,9 @@ export class ProcessBreadcrumbsService implements BreadcrumbsProviderService { if (hasValue(key)) { - return observableOf([new Breadcrumb(key.processId + ' - ' + key.scriptName, url)]); + return of([new Breadcrumb(key.processId + ' - ' + key.scriptName, url)]); } else { - return observableOf([]); + return of([]); } } } diff --git a/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts b/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts index 6adca2cbe7..5d1dcf67f2 100644 --- a/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts +++ b/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts @@ -36,10 +36,10 @@ import { ProfileClaimService } from '../profile-claim/profile-claim.service'; selector: 'ds-profile-claim-item-modal', templateUrl: './profile-claim-item-modal.component.html', imports: [ - ListableObjectComponentLoaderComponent, AsyncPipe, - TranslateModule, BtnDisabledDirective, + ListableObjectComponentLoaderComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/profile-page/profile-claim/profile-claim.service.spec.ts b/src/app/profile-page/profile-claim/profile-claim.service.spec.ts index e84521a85d..360b979749 100644 --- a/src/app/profile-page/profile-claim/profile-claim.service.spec.ts +++ b/src/app/profile-page/profile-claim/profile-claim.service.spec.ts @@ -2,7 +2,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { EPerson } from '../../core/eperson/models/eperson.model'; @@ -132,7 +132,7 @@ describe('ProfileClaimService', () => { describe('when has suggestions', () => { beforeEach(() => { - spyOn(service, 'searchForSuggestions').and.returnValue(observableOf(searchResultRD)); + spyOn(service, 'searchForSuggestions').and.returnValue(of(searchResultRD)); }); it('should return true', () => { @@ -147,7 +147,7 @@ describe('ProfileClaimService', () => { describe('when has not suggestions', () => { beforeEach(() => { - spyOn(service, 'searchForSuggestions').and.returnValue(observableOf(emptySearchResultRD)); + spyOn(service, 'searchForSuggestions').and.returnValue(of(emptySearchResultRD)); }); it('should return false', () => { @@ -177,7 +177,7 @@ describe('ProfileClaimService', () => { describe('when has search results', () => { beforeEach(() => { - searchService.search.and.returnValue(observableOf(searchResultRD)); + searchService.search.and.returnValue(of(searchResultRD)); }); it('should return the proper search object', () => { @@ -192,7 +192,7 @@ describe('ProfileClaimService', () => { describe('when has not suggestions', () => { beforeEach(() => { - searchService.search.and.returnValue(observableOf(emptySearchResultRD)); + searchService.search.and.returnValue(of(emptySearchResultRD)); }); it('should return null', () => { diff --git a/src/app/profile-page/profile-page-metadata-form/themed-profile-page-metadata-form.component.ts b/src/app/profile-page/profile-page-metadata-form/themed-profile-page-metadata-form.component.ts index abf6d39e4b..c1de6a83a0 100644 --- a/src/app/profile-page/profile-page-metadata-form/themed-profile-page-metadata-form.component.ts +++ b/src/app/profile-page/profile-page-metadata-form/themed-profile-page-metadata-form.component.ts @@ -14,7 +14,9 @@ import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form.c selector: 'ds-profile-page-metadata-form', templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [ProfilePageMetadataFormComponent], + imports: [ + ProfilePageMetadataFormComponent, + ], }) export class ThemedProfilePageMetadataFormComponent extends ThemedComponent { diff --git a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts index c8f18fc300..bf76cf1b2c 100644 --- a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts +++ b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts @@ -8,7 +8,7 @@ import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; @@ -55,21 +55,21 @@ describe('ProfilePageResearcherFormComponent', () => { }); authService = jasmine.createSpyObj('authService', { - getAuthenticatedUserFromStore: observableOf(user), + getAuthenticatedUserFromStore: of(user), }); researcherProfileService = jasmine.createSpyObj('researcherProfileService', { findById: createSuccessfulRemoteDataObject$(profile), - create: observableOf(profile), + create: of(profile), setVisibility: jasmine.createSpy('setVisibility'), - delete: observableOf(true), - findRelatedItemId: observableOf('a42557ca-cbb8-4442-af9c-3bb5cad2d075'), + delete: of(true), + findRelatedItemId: of('a42557ca-cbb8-4442-af9c-3bb5cad2d075'), }); notificationsServiceStub = new NotificationsServiceStub(); profileClaimService = jasmine.createSpyObj('profileClaimService', { - hasProfilesToSuggest: observableOf(false), + hasProfilesToSuggest: of(false), }); } @@ -163,7 +163,7 @@ describe('ProfilePageResearcherFormComponent', () => { describe('deleteProfile', () => { beforeEach(() => { const modalService = (component as any).modalService; - spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) })); + spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) })); component.deleteProfile(profile); fixture.detectChanges(); }); diff --git a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts index 3b4c359310..07f6dc0275 100644 --- a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts +++ b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts @@ -44,10 +44,10 @@ import { ProfileClaimItemModalComponent } from '../profile-claim-item-modal/prof templateUrl: './profile-page-researcher-form.component.html', imports: [ AsyncPipe, + BtnDisabledDirective, TranslateModule, UiSwitchModule, VarDirective, - BtnDisabledDirective, ], standalone: true, }) diff --git a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts index c4f22f4dd7..d73d632130 100644 --- a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts +++ b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts @@ -9,7 +9,7 @@ import { import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RestResponse } from '../../core/cache/response.models'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; @@ -29,7 +29,7 @@ describe('ProfilePageSecurityFormComponent', () => { function init() { epersonService = jasmine.createSpyObj('epersonService', { - patch: observableOf(new RestResponse(true, 200, 'OK')), + patch: of(new RestResponse(true, 200, 'OK')), }); notificationsService = jasmine.createSpyObj('notificationsService', { success: {}, diff --git a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts index 228535297f..11f57d535b 100644 --- a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts +++ b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts @@ -34,8 +34,8 @@ import { NotificationsService } from '../../shared/notifications/notifications.s selector: 'ds-profile-page-security-form', templateUrl: './profile-page-security-form.component.html', imports: [ - FormComponent, AlertComponent, + FormComponent, TranslateModule, ], standalone: true, diff --git a/src/app/profile-page/profile-page.component.spec.ts b/src/app/profile-page/profile-page.component.spec.ts index ddb8964327..315310934a 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -17,7 +17,7 @@ import { } from 'jasmine-marbles'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { storeModuleConfig } from '../app.reducer'; @@ -95,12 +95,12 @@ describe('ProfilePageComponent', () => { }; authorizationService = jasmine.createSpyObj('authorizationService', { isAuthorized: canChangePassword }); authService = jasmine.createSpyObj('authService', { - getAuthenticatedUserFromStore: observableOf(user), + getAuthenticatedUserFromStore: of(user), getSpecialGroupsFromAuthStatus: SpecialGroupDataMock$, }); epersonService = jasmine.createSpyObj('epersonService', { findById: createSuccessfulRemoteDataObject$(user), - patch: observableOf(Object.assign(new RestResponse(true, 200, 'Success'))), + patch: of(Object.assign(new RestResponse(true, 200, 'Success'))), }); notificationsService = jasmine.createSpyObj('notificationsService', { success: {}, @@ -297,7 +297,7 @@ describe('ProfilePageComponent', () => { let operations; it('should return call epersonService.patch', (done) => { - epersonService.patch.and.returnValue(observableOf(Object.assign(new RestResponse(false, 403, 'Error')))); + epersonService.patch.and.returnValue(of(Object.assign(new RestResponse(false, 403, 'Error')))); component.setPasswordValue('testest'); component.setInvalid(false); component.setCurrentPasswordValue('current-password'); diff --git a/src/app/profile-page/profile-page.component.ts b/src/app/profile-page/profile-page.component.ts index db727eed16..9b887ca473 100644 --- a/src/app/profile-page/profile-page.component.ts +++ b/src/app/profile-page/profile-page.component.ts @@ -63,19 +63,19 @@ import { ProfilePageSecurityFormComponent } from './profile-page-security-form/p styleUrls: ['./profile-page.component.scss'], templateUrl: './profile-page.component.html', imports: [ - ThemedProfilePageMetadataFormComponent, - ProfilePageSecurityFormComponent, + AlertComponent, AsyncPipe, - TranslateModule, - ProfilePageResearcherFormComponent, - VarDirective, - SuggestionsNotificationComponent, + ErrorComponent, NgTemplateOutlet, PaginationComponent, - ThemedLoadingComponent, - ErrorComponent, + ProfilePageResearcherFormComponent, + ProfilePageSecurityFormComponent, RouterModule, - AlertComponent, + SuggestionsNotificationComponent, + ThemedLoadingComponent, + ThemedProfilePageMetadataFormComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/profile-page/themed-profile-page.component.ts b/src/app/profile-page/themed-profile-page.component.ts index 83149ff9f1..a93ddbb9aa 100644 --- a/src/app/profile-page/themed-profile-page.component.ts +++ b/src/app/profile-page/themed-profile-page.component.ts @@ -11,7 +11,9 @@ import { ProfilePageComponent } from './profile-page.component'; styleUrls: [], templateUrl: './../shared/theme-support/themed.component.html', standalone: true, - imports: [ProfilePageComponent], + imports: [ + ProfilePageComponent, + ], }) export class ThemedProfilePageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts index e586260d3e..8df6fef9d8 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts @@ -9,7 +9,9 @@ import { QualityAssuranceEventsComponent } from '../../notifications/qa/events/q selector: 'ds-quality-assurance-events-page', templateUrl: './quality-assurance-events-page.component.html', standalone: true, - imports: [QualityAssuranceEventsComponent], + imports: [ + QualityAssuranceEventsComponent, + ], }) export class QualityAssuranceEventsPageComponent { diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts index 3329788731..d7b77934f8 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts @@ -9,7 +9,9 @@ import { QualityAssuranceTopicsComponent } from '../../notifications/qa/topics/q selector: 'ds-notification-qa-page', templateUrl: './quality-assurance-topics-page.component.html', standalone: true, - imports: [QualityAssuranceTopicsComponent], + imports: [ + QualityAssuranceTopicsComponent, + ], }) export class QualityAssuranceTopicsPageComponent { diff --git a/src/app/register-email-form/register-email-form.component.spec.ts b/src/app/register-email-form/register-email-form.component.spec.ts index eda9110dc7..163ef017f5 100644 --- a/src/app/register-email-form/register-email-form.component.spec.ts +++ b/src/app/register-email-form/register-email-form.component.spec.ts @@ -16,10 +16,7 @@ import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { RestResponse } from '../core/cache/response.models'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; @@ -171,7 +168,7 @@ describe('RegisterEmailFormComponent', () => { expect(router.navigate).toHaveBeenCalledWith(['/home']); }); it('should send a registration to the service and on error display a message', () => { - (epersonRegistrationService.registerEmail as jasmine.Spy).and.returnValue(observableOf(new RestResponse(false, 400, 'Bad Request'))); + (epersonRegistrationService.registerEmail as jasmine.Spy).and.returnValue(of(new RestResponse(false, 400, 'Bad Request'))); comp.form.patchValue({ email: 'valid@email.org' }); @@ -199,7 +196,7 @@ describe('RegisterEmailFormComponent', () => { expect(router.navigate).toHaveBeenCalledWith(['/home']); })); it('should send a registration to the service and on error display a message', fakeAsync(() => { - (epersonRegistrationService.registerEmail as jasmine.Spy).and.returnValue(observableOf(new RestResponse(false, 400, 'Bad Request'))); + (epersonRegistrationService.registerEmail as jasmine.Spy).and.returnValue(of(new RestResponse(false, 400, 'Bad Request'))); comp.form.patchValue({ email: 'valid@email.org' }); diff --git a/src/app/register-email-form/register-email-form.component.ts b/src/app/register-email-form/register-email-form.component.ts index cb2bb0b176..62c6a3a657 100644 --- a/src/app/register-email-form/register-email-form.component.ts +++ b/src/app/register-email-form/register-email-form.component.ts @@ -64,7 +64,15 @@ export const TYPE_REQUEST_REGISTER = 'register'; selector: 'ds-base-register-email-form', templateUrl: './register-email-form.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, AlertComponent, GoogleRecaptchaComponent, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + FormsModule, + GoogleRecaptchaComponent, + ReactiveFormsModule, + TranslateModule, + ], }) /** * Component responsible to render an email registration form. diff --git a/src/app/register-email-form/themed-registry-email-form.component.ts b/src/app/register-email-form/themed-registry-email-form.component.ts index 8f95d3d707..3a4ffbfb28 100644 --- a/src/app/register-email-form/themed-registry-email-form.component.ts +++ b/src/app/register-email-form/themed-registry-email-form.component.ts @@ -14,7 +14,9 @@ import { RegisterEmailFormComponent } from './register-email-form.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [RegisterEmailFormComponent], + imports: [ + RegisterEmailFormComponent, + ], }) export class ThemedRegisterEmailFormComponent extends ThemedComponent { diff --git a/src/app/register-page/create-profile/create-profile.component.spec.ts b/src/app/register-page/create-profile/create-profile.component.spec.ts index 1b770e1cd6..ef650c4691 100644 --- a/src/app/register-page/create-profile/create-profile.component.spec.ts +++ b/src/app/register-page/create-profile/create-profile.component.spec.ts @@ -17,7 +17,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthenticateAction } from '../../core/auth/auth.actions'; import { CoreState } from '../../core/core-state.model'; @@ -122,7 +122,7 @@ describe('CreateProfileComponent', () => { }; epersonWithAgreement = Object.assign(new EPerson(), valuesWithAgreement); - route = { data: observableOf({ registration: createSuccessfulRemoteDataObject(registration) }) }; + route = { data: of({ registration: createSuccessfulRemoteDataObject(registration) }) }; router = new RouterStub(); notificationsService = new NotificationsServiceStub(); diff --git a/src/app/register-page/create-profile/create-profile.component.ts b/src/app/register-page/create-profile/create-profile.component.ts index e1c523427a..f73fdab1d1 100644 --- a/src/app/register-page/create-profile/create-profile.component.ts +++ b/src/app/register-page/create-profile/create-profile.component.ts @@ -51,11 +51,11 @@ import { NotificationsService } from '../../shared/notifications/notifications.s styleUrls: ['./create-profile.component.scss'], templateUrl: './create-profile.component.html', imports: [ - ProfilePageSecurityFormComponent, - TranslateModule, AsyncPipe, - ReactiveFormsModule, BtnDisabledDirective, + ProfilePageSecurityFormComponent, + ReactiveFormsModule, + TranslateModule, ], standalone: true, }) diff --git a/src/app/register-page/create-profile/themed-create-profile.component.ts b/src/app/register-page/create-profile/themed-create-profile.component.ts index 54f12a9d16..b8a6ef621a 100644 --- a/src/app/register-page/create-profile/themed-create-profile.component.ts +++ b/src/app/register-page/create-profile/themed-create-profile.component.ts @@ -11,7 +11,9 @@ import { CreateProfileComponent } from './create-profile.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [CreateProfileComponent], + imports: [ + CreateProfileComponent, + ], }) export class ThemedCreateProfileComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/register-page/register-email/themed-register-email.component.ts b/src/app/register-page/register-email/themed-register-email.component.ts index 3f557f564c..3d09f2ccb9 100644 --- a/src/app/register-page/register-email/themed-register-email.component.ts +++ b/src/app/register-page/register-email/themed-register-email.component.ts @@ -11,7 +11,9 @@ import { RegisterEmailComponent } from './register-email.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [RegisterEmailComponent], + imports: [ + RegisterEmailComponent, + ], }) export class ThemedRegisterEmailComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/register-page/registration.guard.spec.ts b/src/app/register-page/registration.guard.spec.ts index aeb53bcf2b..be0162bc7d 100644 --- a/src/app/register-page/registration.guard.spec.ts +++ b/src/app/register-page/registration.guard.spec.ts @@ -3,7 +3,7 @@ import { Router, RouterStateSnapshot, } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../core/auth/auth.service'; import { EpersonRegistrationService } from '../core/data/eperson-registration.service'; @@ -53,7 +53,7 @@ describe('registrationGuard', () => { }); epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', { - searchByTokenAndUpdateData: observableOf(registrationRD), + searchByTokenAndUpdateData: of(registrationRD), }); router = jasmine.createSpyObj('router', { navigateByUrl: Promise.resolve(), @@ -61,7 +61,7 @@ describe('registrationGuard', () => { url: currentUrl, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(false), + isAuthenticated: of(false), setRedirectUrl: {}, }); @@ -71,7 +71,7 @@ describe('registrationGuard', () => { describe('canActivate', () => { describe('when searchByToken returns a successful response', () => { beforeEach(() => { - (epersonRegistrationService.searchByTokenAndUpdateData as jasmine.Spy).and.returnValue(observableOf(registrationRD)); + (epersonRegistrationService.searchByTokenAndUpdateData as jasmine.Spy).and.returnValue(of(registrationRD)); }); it('should return true', (done) => { diff --git a/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts b/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts index ea2848f67b..e83d70c27e 100644 --- a/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts +++ b/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -95,13 +95,13 @@ describe('DenyRequestCopyComponent', () => { navigateByUrl: jasmine.createSpy('navigateByUrl'), }); route = jasmine.createSpyObj('route', {}, { - data: observableOf({ + data: of({ request: createSuccessfulRemoteDataObject(itemRequest), }), }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), - getAuthenticatedUserFromStore: observableOf(user), + isAuthenticated: of(true), + getAuthenticatedUserFromStore: of(user), }); itemDataService = jasmine.createSpyObj('itemDataService', { findById: createSuccessfulRemoteDataObject$(item), @@ -133,7 +133,7 @@ describe('DenyRequestCopyComponent', () => { fixture.detectChanges(); translateService = (component as any).translateService; - spyOn(translateService, 'get').and.returnValue(observableOf('translated-message')); + spyOn(translateService, 'get').and.returnValue(of('translated-message')); }); it('message$ should be parameterized correctly', (done) => { diff --git a/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts b/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts index 745516ea66..18f23690de 100644 --- a/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts +++ b/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts @@ -45,7 +45,13 @@ import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-em styleUrls: ['./deny-request-copy.component.scss'], templateUrl: './deny-request-copy.component.html', standalone: true, - imports: [VarDirective, ThemedEmailRequestCopyComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ThemedEmailRequestCopyComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** * Component for denying an item request diff --git a/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts b/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts index aebcdd2b06..45d434dcda 100644 --- a/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts +++ b/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts @@ -11,7 +11,9 @@ import { DenyRequestCopyComponent } from './deny-request-copy.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [DenyRequestCopyComponent], + imports: [ + DenyRequestCopyComponent, + ], }) export class ThemedDenyRequestCopyComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/request-copy/email-request-copy/email-request-copy.component.ts b/src/app/request-copy/email-request-copy/email-request-copy.component.ts index b174cb0ea8..3d7b2ec298 100644 --- a/src/app/request-copy/email-request-copy/email-request-copy.component.ts +++ b/src/app/request-copy/email-request-copy/email-request-copy.component.ts @@ -29,7 +29,14 @@ import { RequestCopyEmail } from './request-copy-email.model'; styleUrls: ['./email-request-copy.component.scss'], templateUrl: './email-request-copy.component.html', standalone: true, - imports: [FormsModule, NgClass, TranslateModule, BtnDisabledDirective, NgbDropdownModule, AsyncPipe], + imports: [ + AsyncPipe, + BtnDisabledDirective, + FormsModule, + NgbDropdownModule, + NgClass, + TranslateModule, + ], }) /** * A form component for an email to send back to the user requesting an item diff --git a/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts b/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts index 4590e15e05..fe60f1b897 100644 --- a/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts +++ b/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts @@ -18,7 +18,9 @@ import { RequestCopyEmail } from './request-copy-email.model'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [EmailRequestCopyComponent], + imports: [ + EmailRequestCopyComponent, + ], }) export class ThemedEmailRequestCopyComponent extends ThemedComponent { /** diff --git a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts index 023e2df4a2..919702911b 100644 --- a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts +++ b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts @@ -13,7 +13,7 @@ import { } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -71,12 +71,12 @@ describe('GrantDenyRequestCopyComponent', () => { itemUrl = getItemPageRoute(item); route = jasmine.createSpyObj('route', {}, { - data: observableOf({ + data: of({ request: createSuccessfulRemoteDataObject(itemRequest), }), }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); itemDataService = jasmine.createSpyObj('itemDataService', { findById: createSuccessfulRemoteDataObject$(item), diff --git a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts index 53ec4b7eec..7d5a39315f 100644 --- a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts +++ b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts @@ -39,7 +39,13 @@ import { styleUrls: ['./grant-deny-request-copy.component.scss'], templateUrl: './grant-deny-request-copy.component.html', standalone: true, - imports: [VarDirective, RouterLink, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** * Component for an author to decide to grant or deny an item request diff --git a/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts b/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts index 7d5e92e87e..a1a3ebcf4e 100644 --- a/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts +++ b/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -96,26 +96,26 @@ describe('GrantRequestCopyComponent', () => { navigateByUrl: jasmine.createSpy('navigateByUrl'), }); route = jasmine.createSpyObj('route', {}, { - data: observableOf({ + data: of({ request: createSuccessfulRemoteDataObject(itemRequest), }), }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), - getAuthenticatedUserFromStore: observableOf(user), + isAuthenticated: of(true), + getAuthenticatedUserFromStore: of(user), }); itemDataService = jasmine.createSpyObj('itemDataService', { findById: createSuccessfulRemoteDataObject$(item), }); itemRequestService = jasmine.createSpyObj('ItemRequestDataService', { - getSanitizedRequestByAccessToken: observableOf(createSuccessfulRemoteDataObject(itemRequest)), + getSanitizedRequestByAccessToken: of(createSuccessfulRemoteDataObject(itemRequest)), grant: createSuccessfulRemoteDataObject$(itemRequest), - getConfiguredAccessPeriods: observableOf([3600, 7200, 14400]), // Common access periods in seconds + getConfiguredAccessPeriods: of([3600, 7200, 14400]), // Common access periods in seconds }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), - getAuthenticatedUserFromStore: observableOf(user), + isAuthenticated: of(true), + getAuthenticatedUserFromStore: of(user), }); notificationsService = jasmine.createSpyObj('notificationsService', ['success', 'error']); return TestBed.configureTestingModule({ @@ -141,7 +141,7 @@ describe('GrantRequestCopyComponent', () => { fixture.detectChanges(); translateService = (component as any).translateService; - spyOn(translateService, 'get').and.returnValue(observableOf('translated-message')); + spyOn(translateService, 'get').and.returnValue(of('translated-message')); }); describe('grant', () => { diff --git a/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts b/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts index 44d8711fd9..c548457b47 100644 --- a/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts +++ b/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts @@ -1,7 +1,6 @@ import { AsyncPipe, CommonModule, - NgClass, } from '@angular/common'; import { Component, @@ -14,7 +13,7 @@ import { RouterLink, } from '@angular/router'; import { - TranslateModule, + TranslatePipe, TranslateService, } from '@ngx-translate/core'; import { Observable } from 'rxjs'; @@ -48,7 +47,16 @@ import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-em styleUrls: ['./grant-request-copy.component.scss'], templateUrl: './grant-request-copy.component.html', standalone: true, - imports: [CommonModule, VarDirective, ThemedEmailRequestCopyComponent, FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule, RouterLink, NgClass], + imports: [ + AsyncPipe, + CommonModule, + FormsModule, + RouterLink, + ThemedEmailRequestCopyComponent, + ThemedLoadingComponent, + TranslatePipe, + VarDirective, + ], }) /** * Component for granting an item request diff --git a/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts b/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts index 654f7588bb..a31cf9f48a 100644 --- a/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts +++ b/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts @@ -11,7 +11,9 @@ import { GrantRequestCopyComponent } from './grant-request-copy.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [GrantRequestCopyComponent], + imports: [ + GrantRequestCopyComponent, + ], }) export class ThemedGrantRequestCopyComponent extends ThemedComponent { diff --git a/src/app/root/root.component.ts b/src/app/root/root.component.ts index 69cc73547a..9c33116b6c 100644 --- a/src/app/root/root.component.ts +++ b/src/app/root/root.component.ts @@ -55,18 +55,18 @@ import { SystemWideAlertBannerComponent } from '../system-wide-alert/alert-banne animations: [slideSidebarPadding], standalone: true, imports: [ - TranslateModule, - ThemedAdminSidebarComponent, - SystemWideAlertBannerComponent, - ThemedHeaderNavbarWrapperComponent, - ThemedBreadcrumbsComponent, - NgClass, - ThemedLoadingComponent, - RouterOutlet, - ThemedFooterComponent, - NotificationsBoardComponent, AsyncPipe, LiveRegionComponent, + NgClass, + NotificationsBoardComponent, + RouterOutlet, + SystemWideAlertBannerComponent, + ThemedAdminSidebarComponent, + ThemedBreadcrumbsComponent, + ThemedFooterComponent, + ThemedHeaderNavbarWrapperComponent, + ThemedLoadingComponent, + TranslateModule, ], }) export class RootComponent implements OnInit { diff --git a/src/app/root/themed-root.component.ts b/src/app/root/themed-root.component.ts index fe88efa546..da539a0056 100644 --- a/src/app/root/themed-root.component.ts +++ b/src/app/root/themed-root.component.ts @@ -11,7 +11,9 @@ import { RootComponent } from './root.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [RootComponent], + imports: [ + RootComponent, + ], }) export class ThemedRootComponent extends ThemedComponent { /** diff --git a/src/app/search-navbar/search-navbar.component.ts b/src/app/search-navbar/search-navbar.component.ts index 3aca706ade..ca90d477bf 100644 --- a/src/app/search-navbar/search-navbar.component.ts +++ b/src/app/search-navbar/search-navbar.component.ts @@ -25,7 +25,13 @@ import { ClickOutsideDirective } from '../shared/utils/click-outside.directive'; styleUrls: ['./search-navbar.component.scss'], animations: [expandSearchInput], standalone: true, - imports: [ClickOutsideDirective, FormsModule, ReactiveFormsModule, TranslateModule, BrowserOnlyPipe], + imports: [ + BrowserOnlyPipe, + ClickOutsideDirective, + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class SearchNavbarComponent { diff --git a/src/app/search-navbar/themed-search-navbar.component.ts b/src/app/search-navbar/themed-search-navbar.component.ts index 82348f7943..4d5e504d71 100644 --- a/src/app/search-navbar/themed-search-navbar.component.ts +++ b/src/app/search-navbar/themed-search-navbar.component.ts @@ -8,7 +8,9 @@ import { SearchNavbarComponent } from './search-navbar.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [SearchNavbarComponent], + imports: [ + SearchNavbarComponent, + ], }) export class ThemedSearchNavbarComponent extends ThemedComponent { diff --git a/src/app/search-page/configuration-search-page.component.ts b/src/app/search-page/configuration-search-page.component.ts index 61d7776594..5458d9a1b4 100644 --- a/src/app/search-page/configuration-search-page.component.ts +++ b/src/app/search-page/configuration-search-page.component.ts @@ -46,7 +46,17 @@ import { ViewModeSwitchComponent } from '../shared/view-mode-switch/view-mode-sw }, ], standalone: true, - imports: [NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgTemplateOutlet, + PageWithSidebarComponent, + SearchLabelsComponent, + ThemedSearchFormComponent, + ThemedSearchResultsComponent, + ThemedSearchSidebarComponent, + TranslateModule, + ViewModeSwitchComponent, + ], }) export class ConfigurationSearchPageComponent extends SearchComponent { diff --git a/src/app/search-page/search-page.component.ts b/src/app/search-page/search-page.component.ts index 817cc6818e..f9ae3c60c9 100644 --- a/src/app/search-page/search-page.component.ts +++ b/src/app/search-page/search-page.component.ts @@ -14,7 +14,9 @@ import { ThemedSearchComponent } from '../shared/search/themed-search.component' }, ], standalone: true, - imports: [ThemedSearchComponent], + imports: [ + ThemedSearchComponent, + ], }) /** * This component represents the whole search page diff --git a/src/app/search-page/themed-configuration-search-page.component.ts b/src/app/search-page/themed-configuration-search-page.component.ts index cf84c9c9d4..a455ddf5fe 100644 --- a/src/app/search-page/themed-configuration-search-page.component.ts +++ b/src/app/search-page/themed-configuration-search-page.component.ts @@ -18,7 +18,9 @@ import { ConfigurationSearchPageComponent } from './configuration-search-page.co selector: 'ds-configuration-search-page', templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [ConfigurationSearchPageComponent], + imports: [ + ConfigurationSearchPageComponent, + ], }) export class ThemedConfigurationSearchPageComponent extends ThemedComponent { /** diff --git a/src/app/search-page/themed-search-page.component.ts b/src/app/search-page/themed-search-page.component.ts index 649ad8a246..b4afa7cd42 100644 --- a/src/app/search-page/themed-search-page.component.ts +++ b/src/app/search-page/themed-search-page.component.ts @@ -11,7 +11,9 @@ import { SearchPageComponent } from './search-page.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [SearchPageComponent], + imports: [ + SearchPageComponent, + ], }) export class ThemedSearchPageComponent extends ThemedComponent { diff --git a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts index a396c5a72c..3528912288 100644 --- a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts +++ b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts @@ -23,7 +23,13 @@ import { ToDatePipe } from './to-date.pipe'; styleUrls: ['./access-control-array-form.component.scss'], exportAs: 'accessControlArrayForm', standalone: true, - imports: [FormsModule, NgbDatepickerModule, TranslateModule, ToDatePipe, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + FormsModule, + NgbDatepickerModule, + ToDatePipe, + TranslateModule, + ], }) export class AccessControlArrayFormComponent implements OnInit { @Input() dropdownOptions: AccessesConditionOption[] = []; diff --git a/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts b/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts index 0fc12a7889..e835fc50e4 100644 --- a/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts +++ b/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts @@ -32,7 +32,11 @@ describe('AccessControlFormContainerComponent', () => { @Component({ selector: 'ds-ngb-modal', template: '', standalone: true, - imports: [FormsModule, NgbDatepickerModule, UiSwitchModule], + imports: [ + FormsModule, + NgbDatepickerModule, + UiSwitchModule, + ], }) class MockNgbModalComponent { } diff --git a/src/app/shared/access-control-form-container/access-control-form-container.component.ts b/src/app/shared/access-control-form-container/access-control-form-container.component.ts index e1aa7dae38..102c370022 100644 --- a/src/app/shared/access-control-form-container/access-control-form-container.component.ts +++ b/src/app/shared/access-control-form-container/access-control-form-container.component.ts @@ -44,7 +44,15 @@ import { styleUrls: ['./access-control-form-container.component.scss'], exportAs: 'dsAccessControlForm', standalone: true, - imports: [AlertComponent, UiSwitchModule, FormsModule, AccessControlArrayFormComponent, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AccessControlArrayFormComponent, + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + FormsModule, + TranslateModule, + UiSwitchModule, + ], }) export class AccessControlFormContainerComponent implements OnDestroy { diff --git a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts index decf0af856..5415b5748b 100644 --- a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts +++ b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts @@ -11,7 +11,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; @@ -41,7 +41,7 @@ describe('ItemAccessControlSelectBitstreamsModalComponent', () => { const mockPaginationService = new PaginationServiceStub(); const translateServiceStub = { - get: () => observableOf('test-message'), + get: () => of('test-message'), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), onDefaultLangChange: new EventEmitter(), diff --git a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts index 6a9b2336d7..d22d44e85b 100644 --- a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts +++ b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts @@ -30,7 +30,11 @@ export const ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID = 'item-access-contro templateUrl: './item-access-control-select-bitstreams-modal.component.html', styleUrls: ['./item-access-control-select-bitstreams-modal.component.scss'], standalone: true, - imports: [ObjectCollectionComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ObjectCollectionComponent, + TranslateModule, + ], }) export class ItemAccessControlSelectBitstreamsModalComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/alert/alert.component.ts b/src/app/shared/alert/alert.component.ts index 7cad34f592..8176798bbd 100644 --- a/src/app/shared/alert/alert.component.ts +++ b/src/app/shared/alert/alert.component.ts @@ -29,7 +29,9 @@ import { AlertType } from './alert-type'; templateUrl: './alert.component.html', styleUrls: ['./alert.component.scss'], standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class AlertComponent { diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts index c5ede5aff7..6622093a24 100644 --- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts +++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts @@ -19,7 +19,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -57,7 +57,17 @@ import { ThemedUserMenuComponent } from './user-menu/themed-user-menu.component' styleUrls: ['./auth-nav-menu.component.scss'], animations: [fadeInOut, fadeOut], standalone: true, - imports: [NgClass, NgbDropdownModule, ThemedLogInComponent, RouterLink, RouterLinkActive, ThemedUserMenuComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + NgbDropdownModule, + NgClass, + RouterLink, + RouterLinkActive, + ThemedLogInComponent, + ThemedUserMenuComponent, + TranslateModule, + ], }) export class AuthNavMenuComponent implements OnInit { /** @@ -74,7 +84,7 @@ export class AuthNavMenuComponent implements OnInit { public isMobile$: Observable; - public showAuth$ = observableOf(false); + public showAuth$ = of(false); public user: Observable; diff --git a/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts b/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts index 9ed244a929..fced405691 100644 --- a/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts +++ b/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts @@ -11,7 +11,9 @@ import { AuthNavMenuComponent } from './auth-nav-menu.component'; styleUrls: [], templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [AuthNavMenuComponent], + imports: [ + AuthNavMenuComponent, + ], }) export class ThemedAuthNavMenuComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts b/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts index 6b5e509393..a54f02cae6 100644 --- a/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts +++ b/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts @@ -16,7 +16,9 @@ import { UserMenuComponent } from './user-menu.component'; templateUrl: './../../theme-support/themed.component.html', styleUrls: [], standalone: true, - imports: [UserMenuComponent], + imports: [ + UserMenuComponent, + ], }) export class ThemedUserMenuComponent extends ThemedComponent{ diff --git a/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts index af59028ced..7b16ac5373 100644 --- a/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts +++ b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts @@ -41,7 +41,15 @@ import { LogOutComponent } from '../../log-out/log-out.component'; templateUrl: './user-menu.component.html', styleUrls: ['./user-menu.component.scss'], standalone: true, - imports: [ThemedLoadingComponent, RouterLinkActive, NgClass, RouterLink, LogOutComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + LogOutComponent, + NgClass, + RouterLink, + RouterLinkActive, + ThemedLoadingComponent, + TranslateModule, + ], }) export class UserMenuComponent implements OnInit { diff --git a/src/app/shared/browse-by/browse-by.component.spec.ts b/src/app/shared/browse-by/browse-by.component.spec.ts index 57f69cc2f7..8b93151611 100644 --- a/src/app/shared/browse-by/browse-by.component.spec.ts +++ b/src/app/shared/browse-by/browse-by.component.spec.ts @@ -16,7 +16,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -184,7 +184,7 @@ describe('BrowseByComponent', () => { describe('when theme is base', () => { beforeEach(async () => { themeService.getThemeName.and.returnValue('base'); - themeService.getThemeName$.and.returnValue(observableOf('base')); + themeService.getThemeName$.and.returnValue(of('base')); fixture.detectChanges(); await fixture.whenStable(); fixture.detectChanges(); @@ -203,7 +203,7 @@ describe('BrowseByComponent', () => { describe('when theme is dspace', () => { beforeEach(async () => { themeService.getThemeName.and.returnValue('dspace'); - themeService.getThemeName$.and.returnValue(observableOf('dspace')); + themeService.getThemeName$.and.returnValue(of('dspace')); fixture.detectChanges(); await fixture.whenStable(); fixture.detectChanges(); @@ -235,7 +235,7 @@ describe('BrowseByComponent', () => { count: 1, }), ])); - comp.shouldDisplayResetButton$ = observableOf(true); + comp.shouldDisplayResetButton$ = of(true); fixture.detectChanges(); const button = fixture.debugElement.query(By.css('.reset')); diff --git a/src/app/shared/browse-by/browse-by.component.ts b/src/app/shared/browse-by/browse-by.component.ts index 84a48172df..6938168ca4 100644 --- a/src/app/shared/browse-by/browse-by.component.ts +++ b/src/app/shared/browse-by/browse-by.component.ts @@ -1,8 +1,4 @@ -import { - AsyncPipe, - NgClass, - NgComponentOutlet, -} from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { Component, EventEmitter, @@ -58,7 +54,16 @@ import { VarDirective } from '../utils/var.directive'; fadeInOut, ], standalone: true, - imports: [VarDirective, NgClass, NgComponentOutlet, ThemedResultsBackButtonComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent], + imports: [ + AsyncPipe, + ErrorComponent, + ObjectCollectionComponent, + StartsWithLoaderComponent, + ThemedLoadingComponent, + ThemedResultsBackButtonComponent, + TranslateModule, + VarDirective, + ], }) /** * Component to display a browse-by page for any ListableObject diff --git a/src/app/shared/browse-by/themed-browse-by.component.ts b/src/app/shared/browse-by/themed-browse-by.component.ts index 69c6f2327e..130d5f51c5 100644 --- a/src/app/shared/browse-by/themed-browse-by.component.ts +++ b/src/app/shared/browse-by/themed-browse-by.component.ts @@ -26,7 +26,9 @@ import { BrowseByComponent } from './browse-by.component'; styleUrls: [], templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [BrowseByComponent], + imports: [ + BrowseByComponent, + ], }) export class ThemedBrowseByComponent extends ThemedComponent { diff --git a/src/app/shared/collection-dropdown/collection-dropdown.component.ts b/src/app/shared/collection-dropdown/collection-dropdown.component.ts index a55b0b9558..e574110370 100644 --- a/src/app/shared/collection-dropdown/collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/collection-dropdown.component.ts @@ -21,7 +21,7 @@ import { BehaviorSubject, from as observableFrom, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -72,7 +72,14 @@ export interface CollectionListEntry { templateUrl: './collection-dropdown.component.html', styleUrls: ['./collection-dropdown.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FormsModule, + InfiniteScrollModule, + ReactiveFormsModule, + ThemedLoadingComponent, + TranslateModule, + ], }) export class CollectionDropdownComponent implements OnInit, OnDestroy { @@ -268,7 +275,7 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy { ); } else { this.hasNextPage = false; - return observableOf([]); + return of([]); } }), ); diff --git a/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts b/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts index 643cd1f711..81a552524c 100644 --- a/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts @@ -16,7 +16,9 @@ import { styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [CollectionDropdownComponent], + imports: [ + CollectionDropdownComponent, + ], }) export class ThemedCollectionDropdownComponent extends ThemedComponent { diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts index 2035c313fe..e5c7b9ef3e 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts @@ -18,7 +18,7 @@ import { } from '@ng-dynamic-forms/core'; import { TranslateModule } from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../../core/auth/auth.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; @@ -75,7 +75,7 @@ describe('ComColFormComponent', () => { }; const logoEndpoint = 'rest/api/logo/endpoint'; const dsoService = Object.assign({ - getLogoEndpoint: () => observableOf(logoEndpoint), + getLogoEndpoint: () => of(logoEndpoint), deleteLogo: () => createSuccessfulRemoteDataObject$({}), findById: () => createSuccessfulRemoteDataObject$({}), }); diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts index 23b58cad34..2744a7d0fd 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts @@ -75,12 +75,12 @@ import { ComcolPageLogoComponent } from '../../comcol-page-logo/comcol-page-logo styleUrls: ['./comcol-form.component.scss'], templateUrl: './comcol-form.component.html', imports: [ - FormComponent, - TranslateModule, - UploaderComponent, AsyncPipe, ComcolPageLogoComponent, + FormComponent, NgClass, + TranslateModule, + UploaderComponent, VarDirective, ], standalone: true, diff --git a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts index 4d5eb04e8c..1765063ff9 100644 --- a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts @@ -9,7 +9,7 @@ import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ComColDataService } from '../../../../core/data/comcol-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; @@ -81,7 +81,7 @@ describe('CreateComColPageComponent', () => { }], })), create: (com, uuid?) => createSuccessfulRemoteDataObject$(newCommunity), - getLogoEndpoint: () => observableOf(logoEndpoint), + getLogoEndpoint: () => of(logoEndpoint), findByHref: () => null, refreshCache: () => { return; @@ -89,7 +89,7 @@ describe('CreateComColPageComponent', () => { }; routeServiceStub = { - getQueryParameterValue: (param) => observableOf(community.uuid), + getQueryParameterValue: (param) => of(community.uuid), }; routerStub = { navigate: (commands) => commands, diff --git a/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts index a860ba7c17..07c553cbc5 100644 --- a/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts @@ -15,7 +15,7 @@ import { TranslateService, } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ComColDataService } from '../../../../core/data/comcol-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; @@ -87,7 +87,7 @@ describe('DeleteComColPageComponent', () => { }; routeStub = { - data: observableOf(community), + data: of(community), }; translateServiceStub = jasmine.createSpyObj('TranslateService', { diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts index e2b71b3941..bdfa42e777 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ComColDataService } from '../../../../../core/data/comcol-data.service'; import { Community } from '../../../../../core/shared/community.model'; @@ -64,7 +64,7 @@ describe('ComColMetadataComponent', () => { routeStub = { parent: { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(community), }), }, diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts index b81e759a86..2972cf1656 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts @@ -11,7 +11,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../../../../core/data/request.service'; @@ -36,12 +36,12 @@ describe('ComcolRoleComponent', () => { let comcolRole; let notificationsService; - const requestService = { hasByHref$: () => observableOf(true) }; + const requestService = { hasByHref$: () => of(true) }; const groupService = { findByHref: jasmine.createSpy('findByHref'), - createComcolGroup: jasmine.createSpy('createComcolGroup').and.returnValue(observableOf({})), - deleteComcolGroup: jasmine.createSpy('deleteComcolGroup').and.returnValue(observableOf({})), + createComcolGroup: jasmine.createSpy('createComcolGroup').and.returnValue(of({})), + deleteComcolGroup: jasmine.createSpy('deleteComcolGroup').and.returnValue(of({})), }; beforeEach(waitForAsync(() => { @@ -82,7 +82,7 @@ describe('ComcolRoleComponent', () => { href: 'test role link', }; comp.comcolRole = comcolRole; - comp.roleName$ = observableOf(comcolRole.name); + comp.roleName$ = of(comcolRole.name); fixture.detectChanges(); }); diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts index 0dddb2a4dd..c0ddbd6cc2 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts @@ -51,13 +51,13 @@ import { VarDirective } from '../../../../utils/var.directive'; styleUrls: ['./comcol-role.component.scss'], templateUrl: './comcol-role.component.html', imports: [ - ThemedLoadingComponent, AlertComponent, AsyncPipe, - TranslateModule, - RouterLink, - VarDirective, HasNoValuePipe, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts index 682bc339a2..1a8e9560ea 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Community } from '../../../../core/shared/community.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; @@ -37,12 +37,12 @@ describe('EditComColPageComponent', () => { routerStub = { navigate: (commands) => commands, - events: observableOf({}), + events: of({}), url: 'mockUrl', }; routeStub = { - data: observableOf({ + data: of({ dso: community, }), routeConfig: { diff --git a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts index 5b8f12a75d..a81e74fca9 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -12,7 +12,6 @@ import { NavigationEnd, Router, RouterLink, - RouterLinkActive, Scroll, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -59,11 +58,10 @@ export interface ComColPageNavOption { styleUrls: ['./comcol-page-browse-by.component.scss'], templateUrl: './comcol-page-browse-by.component.html', imports: [ + AsyncPipe, FormsModule, RouterLink, - RouterLinkActive, TranslateModule, - AsyncPipe, ], standalone: true, }) diff --git a/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts index 7e8ff06404..e21947f89d 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts @@ -14,7 +14,9 @@ import { ComcolPageBrowseByComponent } from './comcol-page-browse-by.component'; styleUrls: [], templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [ComcolPageBrowseByComponent], + imports: [ + ComcolPageBrowseByComponent, + ], }) export class ThemedComcolPageBrowseByComponent extends ThemedComponent { /** diff --git a/src/app/shared/comcol/comcol-page-content/themed-comcol-page-content.component.ts b/src/app/shared/comcol/comcol-page-content/themed-comcol-page-content.component.ts index 1c63349533..40ca0652e7 100644 --- a/src/app/shared/comcol/comcol-page-content/themed-comcol-page-content.component.ts +++ b/src/app/shared/comcol/comcol-page-content/themed-comcol-page-content.component.ts @@ -13,7 +13,9 @@ import { ComcolPageContentComponent } from './comcol-page-content.component'; selector: 'ds-comcol-page-content', templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [ComcolPageContentComponent], + imports: [ + ComcolPageContentComponent, + ], }) export class ThemedComcolPageContentComponent extends ThemedComponent { diff --git a/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts b/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts index 98f137f934..de520b2169 100644 --- a/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts +++ b/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts @@ -14,7 +14,9 @@ import { ComcolPageHandleComponent } from './comcol-page-handle.component'; styleUrls: [], templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [ComcolPageHandleComponent], + imports: [ + ComcolPageHandleComponent, + ], }) diff --git a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts index 0b29f7710a..360881f0b7 100644 --- a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts +++ b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts @@ -34,7 +34,9 @@ class BrowseByTestComponent { selector: 'ds-browse-by-switcher', template: ``, standalone: true, - imports: [DynamicComponentLoaderDirective], + imports: [ + DynamicComponentLoaderDirective, + ], }) class TestBrowseBySwitcherComponent extends BrowseBySwitcherComponent { getComponent(): GenericConstructor { diff --git a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts index 67fc9ae792..7b93de6b9f 100644 --- a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts +++ b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts @@ -19,8 +19,8 @@ import { BrowseDefinition } from '../../../../core/shared/browse-definition.mode templateUrl: './comcol-browse-by.component.html', styleUrls: ['./comcol-browse-by.component.scss'], imports: [ - BrowseBySwitcherComponent, AsyncPipe, + BrowseBySwitcherComponent, ], standalone: true, }) diff --git a/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts b/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts index d0f88ae54e..6ed0984356 100644 --- a/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts +++ b/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts @@ -37,8 +37,8 @@ import { ThemedSearchComponent } from '../../../search/themed-search.component'; }, ], imports: [ - ThemedSearchComponent, AsyncPipe, + ThemedSearchComponent, ], standalone: true, }) diff --git a/src/app/shared/confirmation-modal/confirmation-modal.component.ts b/src/app/shared/confirmation-modal/confirmation-modal.component.ts index aa05c09c24..3e5e930fc6 100644 --- a/src/app/shared/confirmation-modal/confirmation-modal.component.ts +++ b/src/app/shared/confirmation-modal/confirmation-modal.component.ts @@ -12,7 +12,9 @@ import { TranslateModule } from '@ngx-translate/core'; selector: 'ds-confirmation-modal', templateUrl: 'confirmation-modal.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class ConfirmationModalComponent { @Input() headerLabel: string; diff --git a/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts b/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts index a23708dfc6..0268bfb5d4 100644 --- a/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts +++ b/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts @@ -14,7 +14,7 @@ import { PlacementArray } from '@ng-bootstrap/ng-bootstrap/util/positioning'; import { TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { ContextHelp } from '../context-help.model'; @@ -37,7 +37,10 @@ import { PlacementDir } from './placement-dir.model'; `, standalone: true, - imports: [NgbTooltipModule, ContextHelpWrapperComponent], + imports: [ + ContextHelpWrapperComponent, + NgbTooltipModule, + ], }) class TemplateComponent { @Input() content: string; @@ -100,7 +103,7 @@ describe('ContextHelpWrapperComponent', () => { shouldShowIcons$ = new BehaviorSubject(false); contextHelpService.getContextHelp$.and.returnValue(getContextHelp$); contextHelpService.shouldShowIcons$.and.returnValue(shouldShowIcons$); - translateService.get.and.callFake((content) => observableOf(messages[content])); + translateService.get.and.callFake((content) => of(messages[content])); getContextHelp$.next(exampleContextHelp); shouldShowIcons$.next(false); diff --git a/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts b/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts index 57fcb888cb..ce5b8852b4 100644 --- a/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts +++ b/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts @@ -45,7 +45,12 @@ type ParsedContent = ({href?: string, text: string})[]; templateUrl: './context-help-wrapper.component.html', styleUrls: ['./context-help-wrapper.component.scss'], standalone: true, - imports: [NgClass, NgbTooltipModule, NgTemplateOutlet, AsyncPipe], + imports: [ + AsyncPipe, + NgbTooltipModule, + NgClass, + NgTemplateOutlet, + ], }) export class ContextHelpWrapperComponent implements OnInit, OnDestroy { /** diff --git a/src/app/shared/context-help.directive.spec.ts b/src/app/shared/context-help.directive.spec.ts index 5b12579250..8deb7b97ab 100644 --- a/src/app/shared/context-help.directive.spec.ts +++ b/src/app/shared/context-help.directive.spec.ts @@ -11,7 +11,7 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { @@ -25,7 +25,10 @@ import { ContextHelpWrapperComponent } from './context-help-wrapper/context-help @Component({ template: `
some text
`, standalone: true, - imports: [NgbTooltipModule, ContextHelpDirective], + imports: [ + ContextHelpDirective, + NgbTooltipModule, + ], }) class TestComponent { @Input() content = ''; @@ -84,7 +87,7 @@ describe('ContextHelpDirective', () => { shouldShowIcons$ = new BehaviorSubject(false); contextHelpService.getContextHelp$.and.returnValue(getContextHelp$); contextHelpService.shouldShowIcons$.and.returnValue(shouldShowIcons$); - translateService.get.and.callFake((content) => observableOf(messages[content])); + translateService.get.and.callFake((content) => of(messages[content])); // Set up fixture and component. fixture = TestBed.createComponent(TestComponent); diff --git a/src/app/shared/cookies/browser-orejime.service.spec.ts b/src/app/shared/cookies/browser-orejime.service.spec.ts index ce87591a1d..9fbe395af2 100644 --- a/src/app/shared/cookies/browser-orejime.service.spec.ts +++ b/src/app/shared/cookies/browser-orejime.service.spec.ts @@ -3,7 +3,7 @@ import { TranslateService } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; import clone from 'lodash/clone'; import cloneDeep from 'lodash/cloneDeep'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { environment } from '../../../environments/environment'; @@ -62,13 +62,13 @@ describe('BrowserOrejimeService', () => { translateService = getMockTranslateService(); ePersonService = jasmine.createSpyObj('ePersonService', { - createPatchFromCache: observableOf([]), - patch: observableOf(new RestResponse(true, 200, 'Ok')), + createPatchFromCache: of([]), + patch: of(new RestResponse(true, 200, 'Ok')), }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), - getAuthenticatedUserFromStore: observableOf(user), - getAuthenticatedUserIdFromStore: observableOf(user.id), + isAuthenticated: of(true), + getAuthenticatedUserFromStore: of(user), + getAuthenticatedUserIdFromStore: of(user.id), }); configurationDataService = createConfigSuccessSpy(recaptchaValue); findByPropertyName = configurationDataService.findByPropertyName; @@ -140,9 +140,9 @@ describe('BrowserOrejimeService', () => { describe('initialize with user', () => { beforeEach(() => { - spyOn((service as any), 'getUserId$').and.returnValue(observableOf(user.uuid)); - spyOn((service as any), 'getUser$').and.returnValue(observableOf(user)); - translateService.get.and.returnValue(observableOf('loading...')); + spyOn((service as any), 'getUserId$').and.returnValue(of(user.uuid)); + spyOn((service as any), 'getUser$').and.returnValue(of(user)); + translateService.get.and.returnValue(of('loading...')); spyOn(service, 'addAppMessages'); spyOn((service as any), 'initializeUser'); spyOn(service, 'translateConfiguration'); @@ -157,9 +157,9 @@ describe('BrowserOrejimeService', () => { describe('to not call the initialize user method, but the other methods', () => { beforeEach(() => { - spyOn((service as any), 'getUserId$').and.returnValue(observableOf(undefined)); - spyOn((service as any), 'getUser$').and.returnValue(observableOf(undefined)); - translateService.get.and.returnValue(observableOf('loading...')); + spyOn((service as any), 'getUserId$').and.returnValue(of(undefined)); + spyOn((service as any), 'getUser$').and.returnValue(of(undefined)); + translateService.get.and.returnValue(of('loading...')); spyOn(service, 'addAppMessages'); spyOn((service as any), 'initializeUser'); spyOn(service, 'translateConfiguration'); @@ -211,7 +211,7 @@ describe('BrowserOrejimeService', () => { describe('getUserId$ when there is no one authenticated', () => { beforeEach(() => { - (service as any).authService.isAuthenticated.and.returnValue(observableOf(false)); + (service as any).authService.isAuthenticated.and.returnValue(of(false)); }); it('should return undefined', () => { getTestScheduler().expectObservable((service as any).getUserId$()).toBe('(a|)', { a: undefined }); @@ -220,8 +220,8 @@ describe('BrowserOrejimeService', () => { describe('getUserId$ when there someone is authenticated', () => { beforeEach(() => { - (service as any).authService.isAuthenticated.and.returnValue(observableOf(true)); - (service as any).authService.getAuthenticatedUserIdFromStore.and.returnValue(observableOf(user.id)); + (service as any).authService.isAuthenticated.and.returnValue(of(true)); + (service as any).authService.getAuthenticatedUserIdFromStore.and.returnValue(of(user.id)); }); it('should return the user id', () => { getTestScheduler().expectObservable((service as any).getUserId$()).toBe('(a|)', { a: user.id }); @@ -249,7 +249,7 @@ describe('BrowserOrejimeService', () => { describe('when no user is autheticated', () => { beforeEach(() => { - spyOn(service as any, 'getUserId$').and.returnValue(observableOf(undefined)); + spyOn(service as any, 'getUserId$').and.returnValue(of(undefined)); }); it('should return the cookie consents object', () => { @@ -262,7 +262,7 @@ describe('BrowserOrejimeService', () => { describe('when user is autheticated', () => { beforeEach(() => { - spyOn(service as any, 'getUserId$').and.returnValue(observableOf(user.uuid)); + spyOn(service as any, 'getUserId$').and.returnValue(of(user.uuid)); }); it('should return the cookie consents object', () => { @@ -286,7 +286,7 @@ describe('BrowserOrejimeService', () => { spyOn(updatedUser, 'setMetadata'); spyOn(JSON, 'stringify').and.returnValue(cookieConsentString); - ePersonService.createPatchFromCache.and.returnValue(observableOf([operation])); + ePersonService.createPatchFromCache.and.returnValue(of([operation])); }); it('should call patch on the data service', () => { service.setSettingsForUser(updatedUser, cookieConsent); @@ -305,7 +305,7 @@ describe('BrowserOrejimeService', () => { spyOn(updatedUser, 'setMetadata'); spyOn(JSON, 'stringify').and.returnValue(cookieConsentString); - ePersonService.createPatchFromCache.and.returnValue(observableOf([])); + ePersonService.createPatchFromCache.and.returnValue(of([])); }); it('should not call patch on the data service', () => { service.setSettingsForUser(updatedUser, cookieConsent); @@ -322,8 +322,8 @@ describe('BrowserOrejimeService', () => { GOOGLE_ANALYTICS_KEY = clone((service as any).GOOGLE_ANALYTICS_KEY); REGISTRATION_VERIFICATION_ENABLED_KEY = clone((service as any).REGISTRATION_VERIFICATION_ENABLED_KEY); MATOMO_ENABLED = clone((service as any).MATOMO_ENABLED); - spyOn((service as any), 'getUserId$').and.returnValue(observableOf(user.uuid)); - translateService.get.and.returnValue(observableOf('loading...')); + spyOn((service as any), 'getUserId$').and.returnValue(of(user.uuid)); + translateService.get.and.returnValue(of('loading...')); spyOn(service, 'addAppMessages'); spyOn((service as any), 'initializeUser'); spyOn(service, 'translateConfiguration'); diff --git a/src/app/shared/cookies/browser-orejime.service.ts b/src/app/shared/cookies/browser-orejime.service.ts index 632eb897ea..092e996bc3 100644 --- a/src/app/shared/cookies/browser-orejime.service.ts +++ b/src/app/shared/cookies/browser-orejime.service.ts @@ -10,7 +10,7 @@ import debounce from 'lodash/debounce'; import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -272,7 +272,7 @@ export class BrowserOrejimeService extends OrejimeService { if (loggedIn) { return this.authService.getAuthenticatedUserIdFromStore(); } - return observableOf(undefined); + return of(undefined); }), take(1), ); @@ -290,7 +290,7 @@ export class BrowserOrejimeService extends OrejimeService { if (loggedIn) { return this.authService.getAuthenticatedUserFromStore(); } - return observableOf(undefined); + return of(undefined); }), take(1), ); @@ -414,7 +414,7 @@ export class BrowserOrejimeService extends OrejimeService { if (isNotEmpty(operations)) { return this.ePersonService.patch(user, operations); } - return observableOf(undefined); + return of(undefined); }, ), ).subscribe(); diff --git a/src/app/shared/correction-suggestion/item-withdrawn-reinstate-modal.component.ts b/src/app/shared/correction-suggestion/item-withdrawn-reinstate-modal.component.ts index bdf76bfa20..8e16cec8e9 100644 --- a/src/app/shared/correction-suggestion/item-withdrawn-reinstate-modal.component.ts +++ b/src/app/shared/correction-suggestion/item-withdrawn-reinstate-modal.component.ts @@ -18,10 +18,10 @@ import { ThemedLoadingComponent } from '../loading/themed-loading.component'; templateUrl: './item-withdrawn-reinstate-modal.component.html', styleUrls: ['./item-withdrawn-reinstate-modal.component.scss'], imports: [ - TranslateModule, - ThemedLoadingComponent, - FormsModule, AsyncPipe, + FormsModule, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/ds-select/ds-select.component.ts b/src/app/shared/ds-select/ds-select.component.ts index 7ee3ab5d87..d7eb65a0d0 100644 --- a/src/app/shared/ds-select/ds-select.component.ts +++ b/src/app/shared/ds-select/ds-select.component.ts @@ -18,7 +18,11 @@ import { BtnDisabledDirective } from '../btn-disabled.directive'; templateUrl: './ds-select.component.html', styleUrls: ['./ds-select.component.scss'], standalone: true, - imports: [NgbDropdownModule, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + NgbDropdownModule, + TranslateModule, + ], }) export class DsSelectComponent { diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts index fa11538526..0e62d45a09 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts @@ -7,7 +7,7 @@ import { import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { MenuService } from '../../../menu/menu.service'; import { MenuItemType } from '../../../menu/menu-item-type.model'; @@ -50,7 +50,7 @@ describe('DsoEditMenuExpandableSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([{ + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([{ id: 'test', visible: true, model: {} as MenuItemModels, @@ -85,7 +85,7 @@ describe('DsoEditMenuExpandableSectionComponent', () => { })); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([])); fixture = TestBed.createComponent(DsoEditMenuExpandableSectionComponent); component = fixture.componentInstance; spyOn(component as any, 'getMenuItemComponent').and.returnValue(TestComponent); diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts index b5feb9689e..d388ce6c33 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts @@ -35,7 +35,14 @@ import { MenuService } from '../../../menu/menu.service'; templateUrl: './dso-edit-menu-expandable-section.component.html', styleUrls: ['./dso-edit-menu-expandable-section.component.scss'], standalone: true, - imports: [NgbDropdownModule, NgbTooltipModule, NgComponentOutlet, TranslateModule, AsyncPipe, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + NgbDropdownModule, + NgbTooltipModule, + NgComponentOutlet, + TranslateModule, + ], }) export class DsoEditMenuExpandableSectionComponent extends AbstractMenuSectionComponent implements OnInit { diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts index 6f08fe93d5..ae684d3280 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts @@ -10,7 +10,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { MenuItemType } from 'src/app/shared/menu/menu-item-type.model'; import { MenuService } from '../../../menu/menu.service'; @@ -93,7 +93,7 @@ describe('DsoEditMenuSectionComponent', () => { initAsync(dummySectionText, menuService); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([])); fixture = TestBed.createComponent(DsoEditMenuSectionComponent); component = fixture.componentInstance; spyOn(component as any, 'getMenuItemComponent').and.returnValue(TestComponent); @@ -119,7 +119,7 @@ describe('DsoEditMenuSectionComponent', () => { describe('on click model', () => { initAsync(dummySectionClick, menuService); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([])); fixture = TestBed.createComponent(DsoEditMenuSectionComponent); component = fixture.componentInstance; spyOn(component as any, 'getMenuItemComponent').and.returnValue(TestComponent); @@ -162,7 +162,7 @@ describe('DsoEditMenuSectionComponent', () => { describe('when the section model in a non disabled link', () => { initAsync(dummySectionLink, menuService); beforeEach(() => { - spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([])); + spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([])); fixture = TestBed.createComponent(DsoEditMenuSectionComponent); component = fixture.componentInstance; spyOn(component as any, 'getMenuItemComponent').and.returnValue(TestComponent); diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts index d622822a18..34897c1703 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts @@ -24,7 +24,12 @@ import { MenuSection } from '../../../menu/menu-section.model'; templateUrl: './dso-edit-menu-section.component.html', styleUrls: ['./dso-edit-menu-section.component.scss'], standalone: true, - imports: [NgbTooltipModule, RouterLink, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + NgbTooltipModule, + RouterLink, + TranslateModule, + ], }) export class DsoEditMenuSectionComponent extends AbstractMenuSectionComponent implements OnInit { diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts index ff32d461d5..57d82a36ba 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts @@ -10,7 +10,7 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -48,9 +48,9 @@ describe('DsoEditMenuComponent', () => { beforeEach(waitForAsync(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); - spyOn(menuService, 'getMenuTopSections').and.returnValue(observableOf([section])); + spyOn(menuService, 'getMenuTopSections').and.returnValue(of([section])); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), RouterTestingModule, DsoEditMenuComponent], providers: [ @@ -68,7 +68,7 @@ describe('DsoEditMenuComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(DsoEditMenuComponent); comp = fixture.componentInstance; - comp.sections = observableOf([]); + comp.sections = of([]); fixture.detectChanges(); }); diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts index fa3d07ae5d..634d94353e 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts @@ -22,7 +22,10 @@ import { ThemeService } from '../../theme-support/theme.service'; styleUrls: ['./dso-edit-menu.component.scss'], templateUrl: './dso-edit-menu.component.html', standalone: true, - imports: [NgComponentOutlet, AsyncPipe], + imports: [ + AsyncPipe, + NgComponentOutlet, + ], }) export class DsoEditMenuComponent extends MenuComponent { /** diff --git a/src/app/shared/dso-page/dso-versioning-modal-service/dso-versioning-modal.service.spec.ts b/src/app/shared/dso-page/dso-versioning-modal-service/dso-versioning-modal.service.spec.ts index 8f011580cf..4039b2440f 100644 --- a/src/app/shared/dso-page/dso-versioning-modal-service/dso-versioning-modal.service.spec.ts +++ b/src/app/shared/dso-page/dso-versioning-modal-service/dso-versioning-modal.service.spec.ts @@ -1,7 +1,7 @@ import { waitForAsync } from '@angular/core/testing'; import { EMPTY, - of as observableOf, + of, } from 'rxjs'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; @@ -46,7 +46,7 @@ describe('DsoVersioningModalService', () => { }); versionHistoryService = jasmine.createSpyObj('versionHistoryService', { createVersion: createSuccessfulRemoteDataObject$(new Version()), - hasDraftVersion$: observableOf(false), + hasDraftVersion$: of(false), }); itemVersionShared = jasmine.createSpyObj('itemVersionShared', ['notifyCreateNewVersion']); router = jasmine.createSpyObj('router', ['navigateByUrl']); @@ -79,14 +79,14 @@ describe('DsoVersioningModalService', () => { describe('getVersioningTooltipMessage', () => { it('should return the create message when isNewVersionButtonDisabled returns false', (done) => { - spyOn(service, 'isNewVersionButtonDisabled').and.returnValue(observableOf(false)); + spyOn(service, 'isNewVersionButtonDisabled').and.returnValue(of(false)); service.getVersioningTooltipMessage(mockItem, 'draft-message', 'create-message').subscribe((message) => { expect(message).toEqual('create-message'); done(); }); }); it('should return the draft message when isNewVersionButtonDisabled returns true', (done) => { - spyOn(service, 'isNewVersionButtonDisabled').and.returnValue(observableOf(true)); + spyOn(service, 'isNewVersionButtonDisabled').and.returnValue(of(true)); service.getVersioningTooltipMessage(mockItem, 'draft-message', 'create-message').subscribe((message) => { expect(message).toEqual('draft-message'); done(); diff --git a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts index 7f5bf3664b..7ee16ffedb 100644 --- a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts @@ -45,7 +45,17 @@ import { DSOSelectorComponent } from '../dso-selector.component'; styleUrls: ['../dso-selector.component.scss'], templateUrl: '../dso-selector.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, HoverClassDirective, NgClass, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FormsModule, + HoverClassDirective, + InfiniteScrollModule, + ListableObjectComponentLoaderComponent, + NgClass, + ReactiveFormsModule, + ThemedLoadingComponent, + TranslateModule, + ], }) /** * Component rendering a list of collections to select from diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts index 52436e3975..5af72a3374 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts @@ -27,7 +27,7 @@ import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -77,7 +77,17 @@ import { SearchResult } from '../../search/models/search-result.model'; styleUrls: ['./dso-selector.component.scss'], templateUrl: './dso-selector.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, HoverClassDirective, NgClass, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FormsModule, + HoverClassDirective, + InfiniteScrollModule, + ListableObjectComponentLoaderComponent, + NgClass, + ReactiveFormsModule, + ThemedLoadingComponent, + TranslateModule, + ], }) /** @@ -201,7 +211,7 @@ export class DSOSelectorComponent implements OnInit, OnDestroy { if (isNotEmpty(this.currentDSOId)) { currentDSOResult$ = this.search(this.getCurrentDSOQuery(), 1).pipe(getFirstSucceededRemoteDataPayload()); } else { - currentDSOResult$ = observableOf(buildPaginatedList(undefined, [])); + currentDSOResult$ = of(buildPaginatedList(undefined, [])); } // Combine current DSO, query and page diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts index 52dad5a9a4..830a4e75cb 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts @@ -36,7 +36,10 @@ import { selector: 'ds-base-create-collection-parent-selector', templateUrl: '../dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class CreateCollectionParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.COLLECTION; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts index d521d981ca..d6938a39c5 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts @@ -11,7 +11,9 @@ import { CreateCollectionParentSelectorComponent } from './create-collection-par styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [CreateCollectionParentSelectorComponent], + imports: [ + CreateCollectionParentSelectorComponent, + ], }) export class ThemedCreateCollectionParentSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts index 04922d4deb..f072237656 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts @@ -14,7 +14,7 @@ import { } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { Community } from '../../../../core/shared/community.model'; @@ -42,7 +42,7 @@ describe('CreateCommunityParentSelectorComponent', () => { const modalStub = jasmine.createSpyObj('modalStub', ['close']); const createPath = '/communities/create'; const mockAuthorizationDataService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -92,7 +92,7 @@ describe('CreateCommunityParentSelectorComponent', () => { }); it('should show the div when user is an admin', (waitForAsync(() => { - component.isAdmin$ = observableOf(true); + component.isAdmin$ = of(true); fixture.detectChanges(); const divElement = fixture.debugElement.query(By.css('div[data-test="admin-div"]')); @@ -100,7 +100,7 @@ describe('CreateCommunityParentSelectorComponent', () => { }))); it('should hide the div when user is not an admin', (waitForAsync(() => { - component.isAdmin$ = observableOf(false); + component.isAdmin$ = of(false); fixture.detectChanges(); const divElement = fixture.debugElement.query(By.css('div[data-test="admin-div"]')); diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts index e9f6609966..7d0b8744cb 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts @@ -11,7 +11,9 @@ import { CreateCommunityParentSelectorComponent } from './create-community-paren styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [CreateCommunityParentSelectorComponent], + imports: [ + CreateCommunityParentSelectorComponent, + ], }) export class ThemedCreateCommunityParentSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts index efc79596b0..37af0fd409 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts @@ -36,7 +36,10 @@ import { // templateUrl: '../dso-selector-modal-wrapper.component.html', templateUrl: './create-item-parent-selector.component.html', standalone: true, - imports: [AuthorizedCollectionSelectorComponent, TranslateModule], + imports: [ + AuthorizedCollectionSelectorComponent, + TranslateModule, + ], }) export class CreateItemParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.ITEM; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts index bfeeb7df0a..1af44b71c8 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts @@ -1,5 +1,4 @@ import { - ChangeDetectorRef, Component, EventEmitter, Input, @@ -7,8 +6,8 @@ import { } from '@angular/core'; import { ThemedComponent } from 'src/app/shared/theme-support/themed.component'; +import { RemoteData } from '../../../../core/data/remote-data'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { ThemeService } from '../../../theme-support/theme.service'; import { CreateItemParentSelectorComponent } from './create-item-parent-selector.component'; /** @@ -19,22 +18,29 @@ import { CreateItemParentSelectorComponent } from './create-item-parent-selector styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [CreateItemParentSelectorComponent], + imports: [ + CreateItemParentSelectorComponent, + ], }) -export class ThemedCreateItemParentSelectorComponent - extends ThemedComponent { +export class ThemedCreateItemParentSelectorComponent extends ThemedComponent { + + @Input() dsoRD: RemoteData; + + @Input() emitOnly: boolean; + + @Input() header: string; + @Input() entityType: string; - @Output() select: EventEmitter = new EventEmitter(); - @Input() emitOnly = false; - protected inAndOutputNames: (keyof CreateItemParentSelectorComponent & keyof this)[] = ['entityType', 'select', 'emitOnly']; + @Output() select: EventEmitter = new EventEmitter(); - constructor( - protected cdr: ChangeDetectorRef, - protected themeService: ThemeService, - ) { - super(cdr, themeService); - } + protected inAndOutputNames: (keyof CreateItemParentSelectorComponent & keyof this)[] = [ + 'dsoRD', + 'emitOnly', + 'header', + 'entityType', + 'select', + ]; protected getComponentName(): string { return 'CreateItemParentSelectorComponent'; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts index 107e250b48..0e269c81b9 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts @@ -32,7 +32,10 @@ import { selector: 'ds-base-edit-collection-selector', templateUrl: '../dso-selector-modal-wrapper.component.html', standalone: true, - imports: [ DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class EditCollectionSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.COLLECTION; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts index 28604c18b6..77d33534d3 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts @@ -11,7 +11,9 @@ import { EditCollectionSelectorComponent } from './edit-collection-selector.comp styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [EditCollectionSelectorComponent], + imports: [ + EditCollectionSelectorComponent, + ], }) export class ThemedEditCollectionSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts index e2e498f3a4..7db4509ad3 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts @@ -32,7 +32,10 @@ import { selector: 'ds-base-edit-community-selector', templateUrl: '../dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class EditCommunitySelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts index 0e33746edc..1b8e6dcc8f 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts @@ -11,7 +11,9 @@ import { EditCommunitySelectorComponent } from './edit-community-selector.compon styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [EditCommunitySelectorComponent], + imports: [ + EditCommunitySelectorComponent, + ], }) export class ThemedEditCommunitySelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts index d5ac19c392..7887d3205b 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts @@ -29,7 +29,10 @@ import { selector: 'ds-base-edit-item-selector', templateUrl: 'edit-item-selector.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class EditItemSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.ITEM; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts index fbb6850a02..49b2182616 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts @@ -11,7 +11,9 @@ import { EditItemSelectorComponent } from './edit-item-selector.component'; styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [EditItemSelectorComponent], + imports: [ + EditItemSelectorComponent, + ], }) export class ThemedEditItemSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts index 25f26f3d6a..ef1084bdc8 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts @@ -22,7 +22,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { @@ -105,7 +105,7 @@ describe('ExportBatchSelectorComponent', () => { }, ); authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule, ExportBatchSelectorComponent], @@ -142,7 +142,7 @@ describe('ExportBatchSelectorComponent', () => { debugElement = fixture.debugElement; const modalService = TestBed.inject(NgbModal); modalRef = modalService.open(ConfirmationModalComponent); - modalRef.componentInstance.response = observableOf(true); + modalRef.componentInstance.response = of(true); fixture.detectChanges(); }); @@ -190,7 +190,7 @@ describe('ExportBatchSelectorComponent', () => { describe('if collection is selected and is not admin', () => { let scriptRequestSucceeded; beforeEach((done) => { - (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); spyOn((component as any).modalService, 'open').and.returnValue(modalRef); component.navigate(mockCollection).subscribe((succeeded: boolean) => { scriptRequestSucceeded = succeeded; diff --git a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts index 627baaba1f..9a198e1a81 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts @@ -16,7 +16,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -56,7 +56,10 @@ import { selector: 'ds-export-batch-selector', templateUrl: '../dso-selector-modal-wrapper.component.html', standalone: true, - imports: [ DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class ExportBatchSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.DSPACEOBJECT; @@ -90,7 +93,7 @@ export class ExportBatchSelectorComponent extends DSOSelectorModalWrapperCompone const startScriptSucceeded$ = this.startScriptNotifyAndRedirect(dso); return startScriptSucceeded$.pipe( switchMap((r: boolean) => { - return observableOf(r); + return of(r); }), ); } else { @@ -101,7 +104,7 @@ export class ExportBatchSelectorComponent extends DSOSelectorModalWrapperCompone resp$.subscribe(); return resp$; } else { - return observableOf(false); + return of(false); } } diff --git a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts index e2d32e0fea..90d5f46771 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts @@ -22,7 +22,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { @@ -119,7 +119,7 @@ describe('ExportMetadataSelectorComponent', () => { }, ); authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule, ExportMetadataSelectorComponent], @@ -159,7 +159,7 @@ describe('ExportMetadataSelectorComponent', () => { debugElement = fixture.debugElement; const modalService = TestBed.inject(NgbModal); modalRef = modalService.open(ConfirmationModalComponent); - modalRef.componentInstance.response = observableOf(true); + modalRef.componentInstance.response = of(true); fixture.detectChanges(); }); @@ -207,7 +207,7 @@ describe('ExportMetadataSelectorComponent', () => { describe('if collection is selected and is not admin', () => { let scriptRequestSucceeded; beforeEach((done) => { - (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); spyOn((component as any).modalService, 'open').and.returnValue(modalRef); component.navigate(mockCollection).subscribe((succeeded: boolean) => { scriptRequestSucceeded = succeeded; @@ -256,7 +256,7 @@ describe('ExportMetadataSelectorComponent', () => { describe('if community is selected and is not an admin', () => { let scriptRequestSucceeded; beforeEach((done) => { - (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); spyOn((component as any).modalService, 'open').and.returnValue(modalRef); component.navigate(mockCommunity).subscribe((succeeded: boolean) => { scriptRequestSucceeded = succeeded; diff --git a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts index d2afb176fe..0d3bd2d128 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts @@ -16,7 +16,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -57,7 +57,10 @@ import { selector: 'ds-export-metadata-selector', templateUrl: '../dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class ExportMetadataSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.DSPACEOBJECT; @@ -91,7 +94,7 @@ export class ExportMetadataSelectorComponent extends DSOSelectorModalWrapperComp const startScriptSucceeded$ = this.startScriptNotifyAndRedirect(dso); return startScriptSucceeded$.pipe( switchMap((r: boolean) => { - return observableOf(r); + return of(r); }), ); } else { @@ -102,7 +105,7 @@ export class ExportMetadataSelectorComponent extends DSOSelectorModalWrapperComp resp$.subscribe(); return resp$; } else { - return observableOf(false); + return of(false); } } diff --git a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts index bf68cb87a3..b648efda1b 100644 --- a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts @@ -29,7 +29,10 @@ import { selector: 'ds-import-batch-selector', templateUrl: '../dso-selector-modal-wrapper.component.html', standalone: true, - imports: [ DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class ImportBatchSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.DSPACEOBJECT; diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.ts index 37d5a40155..42c65ab8b8 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.ts @@ -37,7 +37,12 @@ import { ThemedLoadingComponent } from '../loading/themed-loading.component'; templateUrl: './entity-dropdown.component.html', styleUrls: ['./entity-dropdown.component.scss'], standalone: true, - imports: [InfiniteScrollModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + InfiniteScrollModule, + ThemedLoadingComponent, + TranslateModule, + ], }) export class EntityDropdownComponent implements OnInit, OnDestroy { /** diff --git a/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts b/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts index f06179e450..72b06a2582 100644 --- a/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts +++ b/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts @@ -15,7 +15,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { hot } from 'jasmine-marbles'; import uniqueId from 'lodash/uniqueId'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP, @@ -132,7 +132,7 @@ describe('EpersonGroupListComponent', () => { // synchronous beforeEach beforeEach(() => { - mockEpersonService.searchByScope.and.returnValue(observableOf(epersonPaginatedListRD)); + mockEpersonService.searchByScope.and.returnValue(of(epersonPaginatedListRD)); const html = ` `; @@ -188,7 +188,7 @@ describe('EpersonGroupListComponent', () => { })); it('should init the list of eperson', fakeAsync(async () => { - epersonService.searchByScope.and.returnValue(observableOf(epersonPaginatedListRD)); + epersonService.searchByScope.and.returnValue(of(epersonPaginatedListRD)); fixture.detectChanges(); @@ -252,7 +252,7 @@ describe('EpersonGroupListComponent', () => { })); it('should init the list of group', fakeAsync(async () => { - groupService.searchGroups.and.returnValue(observableOf(groupPaginatedListRD)); + groupService.searchGroups.and.returnValue(of(groupPaginatedListRD)); fixture.detectChanges(); await fixture.whenStable(); diff --git a/src/app/shared/eperson-group-list/eperson-group-list.component.ts b/src/app/shared/eperson-group-list/eperson-group-list.component.ts index ac67cf9e6a..ed9de60bd0 100644 --- a/src/app/shared/eperson-group-list/eperson-group-list.component.ts +++ b/src/app/shared/eperson-group-list/eperson-group-list.component.ts @@ -53,7 +53,13 @@ import { GroupSearchBoxComponent } from './group-search-box/group-search-box.com fadeInOut, ], standalone: true, - imports: [EpersonSearchBoxComponent, GroupSearchBoxComponent, PaginationComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + EpersonSearchBoxComponent, + GroupSearchBoxComponent, + PaginationComponent, + TranslateModule, + ], }) /** * Component that shows a list of eperson or group diff --git a/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts b/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts index 2abf209297..9653fe99a3 100644 --- a/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts +++ b/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts @@ -21,7 +21,11 @@ import { SearchEvent } from '../eperson-group-list-event-type'; selector: 'ds-eperson-search-box', templateUrl: './eperson-search-box.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class EpersonSearchBoxComponent { diff --git a/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts b/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts index 0aa7955559..7959c0aff7 100644 --- a/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts +++ b/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts @@ -21,7 +21,11 @@ import { SearchEvent } from '../eperson-group-list-event-type'; selector: 'ds-group-search-box', templateUrl: './group-search-box.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class GroupSearchBoxComponent { diff --git a/src/app/shared/error/error.component.ts b/src/app/shared/error/error.component.ts index 168415c0b1..71dd9f813c 100644 --- a/src/app/shared/error/error.component.ts +++ b/src/app/shared/error/error.component.ts @@ -15,7 +15,9 @@ import { AlertType } from '../alert/alert-type'; styleUrls: ['./error.component.scss'], templateUrl: './error.component.html', standalone: true, - imports: [AlertComponent], + imports: [ + AlertComponent, + ], }) export class ErrorComponent implements OnDestroy, OnInit { diff --git a/src/app/shared/file-download-link/file-download-link.component.spec.ts b/src/app/shared/file-download-link/file-download-link.component.spec.ts index 189ce60445..f16135fe43 100644 --- a/src/app/shared/file-download-link/file-download-link.component.spec.ts +++ b/src/app/shared/file-download-link/file-download-link.component.spec.ts @@ -14,7 +14,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from 'src/config/app-config.interface'; import { getBitstreamModuleRoute } from '../../app-routing-paths'; @@ -68,7 +68,7 @@ describe('FileDownloadLinkComponent', () => { storeMock = jasmine.createSpyObj('store', { dispatch: jasmine.createSpy('dispatch'), select: jasmine.createSpy('select'), - pipe: observableOf(true), + pipe: of(true), }); } diff --git a/src/app/shared/file-download-link/file-download-link.component.ts b/src/app/shared/file-download-link/file-download-link.component.ts index 09e03f8dac..2d8d0e4e89 100644 --- a/src/app/shared/file-download-link/file-download-link.component.ts +++ b/src/app/shared/file-download-link/file-download-link.component.ts @@ -19,7 +19,7 @@ import { import { combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -45,7 +45,14 @@ import { ThemedAccessStatusBadgeComponent } from '../object-collection/shared/ba templateUrl: './file-download-link.component.html', styleUrls: ['./file-download-link.component.scss'], standalone: true, - imports: [RouterLink, NgClass, NgTemplateOutlet, AsyncPipe, TranslateModule, ThemedAccessStatusBadgeComponent], + imports: [ + AsyncPipe, + NgClass, + NgTemplateOutlet, + RouterLink, + ThemedAccessStatusBadgeComponent, + TranslateModule, + ], }) /** * Component displaying a download link @@ -108,15 +115,15 @@ export class FileDownloadLinkComponent implements OnInit { this.itemRequest = this.route.snapshot.data.itemRequest; // Set up observables to test access rights to a normal bitstream download, a valid token download, and the request-a-copy feature this.canDownload$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(this.bitstream) ? this.bitstream.self : undefined); - this.canDownloadWithToken$ = observableOf((this.itemRequest && this.itemRequest.acceptRequest && !this.itemRequest.accessExpired) ? (this.itemRequest.allfiles !== false || this.itemRequest.bitstreamId === this.bitstream.uuid) : false); + this.canDownloadWithToken$ = of((this.itemRequest && this.itemRequest.acceptRequest && !this.itemRequest.accessExpired) ? (this.itemRequest.allfiles !== false || this.itemRequest.bitstreamId === this.bitstream.uuid) : false); this.canRequestACopy$ = this.authorizationService.isAuthorized(FeatureID.CanRequestACopy, isNotEmpty(this.bitstream) ? this.bitstream.self : undefined); // Set up observable to determine the path to the bitstream based on the user's access rights and features as above this.bitstreamPath$ = observableCombineLatest([this.canDownload$, this.canDownloadWithToken$, this.canRequestACopy$]).pipe( map(([canDownload, canDownloadWithToken, canRequestACopy]) => this.getBitstreamPath(canDownload, canDownloadWithToken, canRequestACopy)), ); } else { - this.bitstreamPath$ = observableOf(this.getBitstreamDownloadPath()); - this.canDownload$ = observableOf(true); + this.bitstreamPath$ = of(this.getBitstreamDownloadPath()); + this.canDownload$ = of(true); } } diff --git a/src/app/shared/file-download-link/themed-file-download-link.component.ts b/src/app/shared/file-download-link/themed-file-download-link.component.ts index 52add33069..b2c683360d 100644 --- a/src/app/shared/file-download-link/themed-file-download-link.component.ts +++ b/src/app/shared/file-download-link/themed-file-download-link.component.ts @@ -13,7 +13,9 @@ import { FileDownloadLinkComponent } from './file-download-link.component'; styleUrls: [], templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [FileDownloadLinkComponent], + imports: [ + FileDownloadLinkComponent, + ], }) export class ThemedFileDownloadLinkComponent extends ThemedComponent { @@ -29,7 +31,7 @@ export class ThemedFileDownloadLinkComponent extends ThemedComponent { let testElement: DebugElement; const testItem: Item = new Item(); const testWSI: WorkspaceItem = new WorkspaceItem(); - testWSI.item = observableOf(createSuccessfulRemoteDataObject(testItem)); + testWSI.item = of(createSuccessfulRemoteDataObject(testItem)); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -234,7 +234,7 @@ describe('DsDynamicFormControlContainerComponent test suite', () => { { provide: SubmissionObjectDataService, useValue: { - findById: () => observableOf(createSuccessfulRemoteDataObject(testWSI)), + findById: () => of(createSuccessfulRemoteDataObject(testWSI)), }, }, { provide: APP_CONFIG, useValue: environment }, diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index c6853eb34b..0a2e46a2d3 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -131,16 +131,16 @@ import { DsDynamicLookupRelationModalComponent } from './relation-lookup-modal/d templateUrl: './ds-dynamic-form-control-container.component.html', changeDetection: ChangeDetectionStrategy.Default, imports: [ - ExistingMetadataListElementComponent, - NgClass, AsyncPipe, - TranslateModule, - ReactiveFormsModule, + BtnDisabledDirective, + ExistingMetadataListElementComponent, + ExistingRelationListElementComponent, FormsModule, NgbTooltipModule, + NgClass, NgTemplateOutlet, - ExistingRelationListElementComponent, - BtnDisabledDirective, + ReactiveFormsModule, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts index bedaacf883..63327d46f5 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model'; @@ -71,14 +71,14 @@ describe('ExistingMetadataListElementComponent', () => { rightItemRD$ = createSuccessfulRemoteDataObject$(submissionItem); relatedSearchResult = Object.assign(new ItemSearchResult(), { indexableObject: relatedItem }); relationshipService = { - updatePlace: () => observableOf({}), + updatePlace: () => of({}), } as any; relationship = Object.assign(new Relationship(), { leftItem: leftItemRD$, rightItem: rightItemRD$ }); submissionId = '1234'; reoRel = new ReorderableRelationship(relationship, true, {} as any, {} as any, submissionId); submissionServiceStub = new SubmissionServiceStub(); - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf({})); + submissionServiceStub.getSubmissionObject.and.returnValue(of({})); } beforeEach(waitForAsync(() => { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts index 9f0ecf91cc..1b71215d6c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts @@ -163,9 +163,9 @@ export class ReorderableRelationship extends Reorderable { templateUrl: './existing-metadata-list-element.component.html', styleUrls: ['./existing-metadata-list-element.component.scss'], imports: [ - ThemedLoadingComponent, AsyncPipe, MetadataRepresentationLoaderComponent, + ThemedLoadingComponent, TranslateModule, ], standalone: true, diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts index 0930fc9b49..9dc8c0fb52 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model'; @@ -60,7 +60,7 @@ describe('ExistingRelationListElementComponent', () => { rightItemRD$ = createSuccessfulRemoteDataObject$(submissionItem); relatedSearchResult = Object.assign(new ItemSearchResult(), { indexableObject: relatedItem }); relationshipService = { - updatePlace: () => observableOf({}), + updatePlace: () => of({}), } as any; relationship = Object.assign(new Relationship(), { leftItem: leftItemRD$, rightItem: rightItemRD$ }); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts index ffbaef8664..15623682f2 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts @@ -77,9 +77,9 @@ export abstract class Reorderable { templateUrl: './existing-relation-list-element.component.html', styleUrls: ['./existing-relation-list-element.component.scss'], imports: [ - ThemedLoadingComponent, AsyncPipe, ListableObjectComponentLoaderComponent, + ThemedLoadingComponent, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts index 1385859b94..34cac3f6db 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts @@ -47,13 +47,13 @@ import { DynamicRowArrayModel } from '../ds-dynamic-row-array-model'; templateUrl: './dynamic-form-array.component.html', styleUrls: ['./dynamic-form-array.component.scss'], imports: [ - ReactiveFormsModule, - CdkDropList, - NgClass, CdkDrag, CdkDragHandle, + CdkDropList, forwardRef(() => DsDynamicFormControlContainerComponent), + NgClass, NgTemplateOutlet, + ReactiveFormsModule, TranslateModule, ], standalone: true, diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts index 0cecc8e676..c3480f37b2 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts @@ -29,10 +29,10 @@ import { BtnDisabledDirective } from '../../../../../btn-disabled.directive'; selector: 'ds-dynamic-date-picker-inline', templateUrl: './dynamic-date-picker-inline.component.html', imports: [ - NgClass, - NgbDatepickerModule, - ReactiveFormsModule, BtnDisabledDirective, + NgbDatepickerModule, + NgClass, + ReactiveFormsModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts index 54bec75f0f..40dc164381 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts @@ -28,7 +28,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { mockDynamicFormLayoutService, @@ -72,7 +72,7 @@ describe('DsDatePickerComponent test suite', () => { beforeEach(waitForAsync(() => { const translateServiceStub = { - get: () => observableOf('test-message'), + get: () => of('test-message'), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), onDefaultLangChange: new EventEmitter(), @@ -376,7 +376,9 @@ describe('DsDatePickerComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [NgbModule], + imports: [ + NgbModule, + ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts index e246cf0c7e..f20b9bc43e 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts @@ -38,11 +38,11 @@ export const DS_DATE_PICKER_SEPARATOR = '-'; styleUrls: ['./date-picker.component.scss'], templateUrl: './date-picker.component.html', imports: [ + BtnDisabledDirective, + FormsModule, NgClass, NumberPickerComponent, - FormsModule, TranslateModule, - BtnDisabledDirective, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts index cb429dd7e4..9a1374b4a5 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts @@ -22,8 +22,8 @@ import { DynamicDisabledModel } from './dynamic-disabled.model'; selector: 'ds-dynamic-disabled', templateUrl: './dynamic-disabled.component.html', imports: [ - TranslateModule, BtnDisabledDirective, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts index 0ca22da9f7..6984e61769 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts @@ -12,7 +12,7 @@ import { } from '@ng-dynamic-forms/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -91,7 +91,7 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom } })); } else if (isNotEmpty(this.model.value) && (this.model.value instanceof VocabularyEntry)) { - initValue$ = observableOf( + initValue$ = of( new FormFieldMetadataValueObject( this.model.value.value, null, @@ -103,7 +103,7 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom ), ); } else { - initValue$ = observableOf(new FormFieldMetadataValueObject(this.model.value)); + initValue$ = of(new FormFieldMetadataValueObject(this.model.value)); } return initValue$; } diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts index 828824df54..00ae708f7c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts @@ -32,9 +32,9 @@ import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-co templateUrl: './dynamic-form-group.component.html', changeDetection: ChangeDetectionStrategy.Default, imports: [ - ReactiveFormsModule, - NgClass, forwardRef(() => DsDynamicFormControlContainerComponent), + NgClass, + ReactiveFormsModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts index 87f87d357a..9ead88a276 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts @@ -312,7 +312,9 @@ describe('DsDynamicListComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [DsDynamicListComponent], + imports: [ + DsDynamicListComponent, + ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts index 11db7e75de..576cdef20b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts @@ -65,12 +65,12 @@ export interface ListItem { styleUrls: ['./dynamic-list.component.scss'], templateUrl: './dynamic-list.component.html', imports: [ - NgClass, - NgbButtonsModule, - ReactiveFormsModule, AsyncPipe, - TranslateModule, + NgbButtonsModule, + NgClass, + ReactiveFormsModule, ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts index 493c56e29d..87434f3996 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts @@ -28,7 +28,7 @@ import { import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; import { VocabularyOptions } from '../../../../../../core/submission/vocabularies/models/vocabulary-options.model'; @@ -330,7 +330,7 @@ describe('Dynamic Lookup component', () => { lookupComp = lookupFixture.componentInstance; // FormComponent test instance lookupComp.group = LOOKUP_TEST_GROUP; lookupComp.model = new DynamicLookupModel(LOOKUP_TEST_MODEL_CONFIG); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: null, value: 'test', display: 'testDisplay', @@ -373,7 +373,7 @@ describe('Dynamic Lookup component', () => { lookupComp = lookupFixture.componentInstance; // FormComponent test instance lookupComp.group = LOOKUP_TEST_GROUP; lookupComp.model = new DynamicLookupModel(LOOKUP_TEST_MODEL_CONFIG); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: 'test001', value: 'test', display: 'testDisplay', @@ -506,7 +506,7 @@ describe('Dynamic Lookup component', () => { lookupComp.group = LOOKUP_TEST_GROUP; lookupComp.model = new DynamicLookupNameModel(LOOKUP_NAME_TEST_MODEL_CONFIG); lookupComp.model.value = new FormFieldMetadataValueObject('Name, Lastname', null, 'test001'); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: null, value: 'Name, Lastname', display: 'Name, Lastname', @@ -551,7 +551,7 @@ describe('Dynamic Lookup component', () => { lookupComp.group = LOOKUP_TEST_GROUP; lookupComp.model = new DynamicLookupNameModel(LOOKUP_NAME_TEST_MODEL_CONFIG); lookupComp.model.value = new FormFieldMetadataValueObject('Name, Lastname', null, 'test001'); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: 'test001', value: 'Name, Lastname', display: 'Name, Lastname', @@ -596,12 +596,14 @@ describe('Dynamic Lookup component', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [DynamicFormsCoreModule, + imports: [ + DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, InfiniteScrollModule, + NgbModule, ReactiveFormsModule, - NgbModule], + ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts index 7ca4dbedb5..7175f5fa2e 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts @@ -27,7 +27,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -64,16 +64,16 @@ import { DynamicLookupNameModel } from './dynamic-lookup-name.model'; styleUrls: ['./dynamic-lookup.component.scss'], templateUrl: './dynamic-lookup.component.html', imports: [ - TranslateModule, - NgbTooltipModule, - NgbDropdownModule, AuthorityConfidenceStateDirective, + BtnDisabledDirective, FormsModule, - NgClass, InfiniteScrollModule, + NgbDropdownModule, + NgbTooltipModule, + NgClass, NgTemplateOutlet, ObjNgFor, - BtnDisabledDirective, + TranslateModule, ], standalone: true, }) @@ -274,7 +274,7 @@ export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent imple ).pipe( getFirstSucceededRemoteDataPayload(), catchError(() => - observableOf(buildPaginatedList( + of(buildPaginatedList( new PageInfo(), [], )), diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts index 8cdb1d6718..bf2723eda5 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts @@ -32,7 +32,7 @@ import { import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; @@ -227,7 +227,7 @@ describe('DsDynamicOneboxComponent test suite', () => { spyOn((oneboxComponent as any).vocabularyService, 'getVocabularyEntriesByValue').and.callThrough(); - oneboxComponent.search(observableOf('test')).subscribe(); + oneboxComponent.search(of('test')).subscribe(); tick(300); oneboxCompFixture.detectChanges(); @@ -326,7 +326,7 @@ describe('DsDynamicOneboxComponent test suite', () => { oneboxComponent = oneboxCompFixture.componentInstance; // FormComponent test instance oneboxComponent.group = ONEBOX_TEST_GROUP; oneboxComponent.model = new DynamicOneboxModel(ONEBOX_TEST_MODEL_CONFIG); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: null, value: 'test', display: 'testDisplay', @@ -363,7 +363,7 @@ describe('DsDynamicOneboxComponent test suite', () => { oneboxComponent = oneboxCompFixture.componentInstance; // FormComponent test instance oneboxComponent.group = ONEBOX_TEST_GROUP; oneboxComponent.model = new DynamicOneboxModel(ONEBOX_TEST_MODEL_CONFIG); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: 'test001', value: 'test001', display: 'test', @@ -435,7 +435,7 @@ describe('DsDynamicOneboxComponent test suite', () => { beforeEach(() => { oneboxComponent.group = ONEBOX_TEST_GROUP; oneboxComponent.model = new DynamicOneboxModel(ONEBOX_TEST_MODEL_CONFIG); - const entry = observableOf(Object.assign(new VocabularyEntry(), { + const entry = of(Object.assign(new VocabularyEntry(), { authority: null, value: 'test', display: 'testDisplay', @@ -474,12 +474,14 @@ describe('DsDynamicOneboxComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [DynamicFormsCoreModule, + imports: [ + CdkTreeModule, + DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, NgbModule, ReactiveFormsModule, - CdkTreeModule], + ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts index 93f6e80f32..5b2cfd01a8 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts @@ -30,7 +30,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subject, Subscription, } from 'rxjs'; @@ -80,14 +80,14 @@ import { DynamicOneboxModel } from './dynamic-onebox.model'; styleUrls: ['./dynamic-onebox.component.scss'], templateUrl: './dynamic-onebox.component.html', imports: [ - NgbTypeaheadModule, AsyncPipe, AuthorityConfidenceStateDirective, - NgTemplateOutlet, - TranslateModule, - ObjNgFor, - FormsModule, BtnDisabledDirective, + FormsModule, + NgbTypeaheadModule, + NgTemplateOutlet, + ObjNgFor, + TranslateModule, ], standalone: true, }) @@ -144,7 +144,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple tap(() => this.changeSearchingStatus(true)), switchMap((term) => { if (term === '' || term.length < this.model.minChars) { - return observableOf({ list: [] }); + return of({ list: [] }); } else { return this.vocabularyService.getVocabularyEntriesByValue( term, @@ -155,7 +155,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple tap(() => this.searchFailed = false), catchError(() => { this.searchFailed = true; - return observableOf(buildPaginatedList( + return of(buildPaginatedList( new PageInfo(), [], )); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts index faecacd12d..1354614699 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts @@ -372,11 +372,11 @@ describe('DsDynamicRelationGroupComponent test suite', () => { template: ``, standalone: true, imports: [ - DsDynamicRelationGroupComponent, AsyncPipe, + DsDynamicRelationGroupComponent, NgbTooltipModule, - TranslateModule, NgClass, + TranslateModule, ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts index 096f1b7004..d227ed3f5b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts @@ -29,7 +29,7 @@ import isObject from 'lodash/isObject'; import { combineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -74,13 +74,13 @@ import { DynamicRelationGroupModel } from './dynamic-relation-group.model'; animations: [shrinkInOut], imports: [ AsyncPipe, - NgbTooltipModule, - TranslateModule, - NgClass, - ThemedLoadingComponent, + BtnDisabledDirective, ChipsComponent, forwardRef(() => FormComponent), - BtnDisabledDirective, + NgbTooltipModule, + NgClass, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) @@ -95,7 +95,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent @Output() focus: EventEmitter = new EventEmitter(); public chips: Chips; - public formCollapsed = observableOf(false); + public formCollapsed = of(false); public formModel: DynamicFormControlModel[]; public editMode = false; @@ -117,7 +117,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent ngOnInit() { const config = { rows: this.model.formConfiguration } as SubmissionFormsModel; if (!this.model.isEmpty()) { - this.formCollapsed = observableOf(true); + this.formCollapsed = of(true); } this.model.valueChanges.subscribe((value: any[]) => { if ((isNotEmpty(value) && !(value.length === 1 && hasOnlyEmptyProperties(value[0])))) { @@ -182,12 +182,12 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent } collapseForm() { - this.formCollapsed = observableOf(true); + this.formCollapsed = of(true); this.clear(); } expandForm() { - this.formCollapsed = observableOf(false); + this.formCollapsed = of(false); } clear() { @@ -198,7 +198,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent } this.resetForm(); if (!this.model.isEmpty()) { - this.formCollapsed = observableOf(true); + this.formCollapsed = of(true); } } @@ -267,7 +267,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent if (this.model.isEmpty()) { this.initChips([]); } else { - initChipsValue$ = observableOf(this.model.value as any[]); + initChipsValue$ = of(this.model.value as any[]); // If authority this.subs.push(initChipsValue$.pipe( @@ -292,7 +292,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent }), )); } else { - return$ = observableOf(valueObj[fieldName]); + return$ = of(valueObj[fieldName]); } return return$.pipe(map((entry) => ({ [fieldName]: entry }))); }); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts index b7e974ce69..3dfa0ac15c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts @@ -243,12 +243,14 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [DynamicFormsCoreModule, + imports: [ + DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, InfiniteScrollModule, + NgbModule, ReactiveFormsModule, - NgbModule], + ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts index f3cbf8fb20..85f6c923cc 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts @@ -24,7 +24,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { Observable, - of as observableOf, of, } from 'rxjs'; import { @@ -67,11 +66,11 @@ import { DynamicScrollableDropdownModel } from './dynamic-scrollable-dropdown.mo styleUrls: ['./dynamic-scrollable-dropdown.component.scss'], templateUrl: './dynamic-scrollable-dropdown.component.html', imports: [ - NgbDropdownModule, AsyncPipe, - InfiniteScrollModule, - TranslateModule, BtnDisabledDirective, + InfiniteScrollModule, + NgbDropdownModule, + TranslateModule, ], standalone: true, }) @@ -156,7 +155,7 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom this.loading = true; this.getDataFromService().pipe( getFirstSucceededRemoteDataPayload(), - catchError(() => observableOf(buildPaginatedList(new PageInfo(), []))), + catchError(() => of(buildPaginatedList(new PageInfo(), []))), tap(() => this.loading = false), ).subscribe((list: PaginatedList) => { this.optionsList = list.page; @@ -283,7 +282,7 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom ); this.getDataFromService().pipe( getFirstSucceededRemoteDataPayload(), - catchError(() => observableOf(buildPaginatedList( + catchError(() => of(buildPaginatedList( new PageInfo(), [], )), @@ -326,13 +325,13 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom ); } else { if (isEmpty(value)) { - result = observableOf(''); + result = of(''); } else if (typeof value === 'string') { - result = observableOf(value); + result = of(value); } else if (this.useFindAllService) { - result = observableOf(value[this.model.displayKey]); + result = of(value[this.model.displayKey]); } else { - result = observableOf(value.display); + result = of(value.display); } } diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts index 78e50de898..e76d37b89b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts @@ -29,7 +29,7 @@ import { } from '@ng-dynamic-forms/core'; import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; import { VocabularyOptions } from '../../../../../../core/submission/vocabularies/models/vocabulary-options.model'; @@ -167,7 +167,7 @@ describe('DsDynamicTagComponent test suite', () => { it('should search when 3+ characters typed', fakeAsync(() => { spyOn((tagComp as any).vocabularyService, 'getVocabularyEntriesByValue').and.callThrough(); - tagComp.search(observableOf('test')).subscribe(() => { + tagComp.search(of('test')).subscribe(() => { expect((tagComp as any).vocabularyService.getVocabularyEntriesByValue).toHaveBeenCalled(); }); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts index 7b133ded9b..203f02d4af 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts @@ -24,7 +24,7 @@ import { import isEqual from 'lodash/isEqual'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { catchError, @@ -62,9 +62,9 @@ import { DynamicTagModel } from './dynamic-tag.model'; styleUrls: ['./dynamic-tag.component.scss'], templateUrl: './dynamic-tag.component.html', imports: [ - NgbTypeaheadModule, - FormsModule, ChipsComponent, + FormsModule, + NgbTypeaheadModule, ], standalone: true, }) @@ -113,14 +113,14 @@ export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implemen tap(() => this.changeSearchingStatus(true)), switchMap((term) => { if (term === '' || term.length < this.model.minChars) { - return observableOf({ list: [] }); + return of({ list: [] }); } else { return this.vocabularyService.getVocabularyEntriesByValue(term, false, this.model.vocabularyOptions, new PageInfo()).pipe( getFirstSucceededRemoteDataPayload(), tap(() => this.searchFailed = false), catchError(() => { this.searchFailed = true; - return observableOf(buildPaginatedList( + return of(buildPaginatedList( new PageInfo(), [], )); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts index 2660675211..484551ae18 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts @@ -18,7 +18,7 @@ import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { - of as observableOf, + of, Subscription, } from 'rxjs'; @@ -95,7 +95,7 @@ describe('DsDynamicLookupRelationModalComponent', () => { searchResult1 = Object.assign(new ItemSearchResult(), { indexableObject: item1 }); searchResult2 = Object.assign(new ItemSearchResult(), { indexableObject: item2 }); listID = '6b0c8221-fcb4-47a8-b483-ca32363fffb3'; - selection$ = observableOf([searchResult1, searchResult2]); + selection$ = of([searchResult1, searchResult2]); selectableListService = { getSelectableList: () => selection$ }; relationship = Object.assign(new RelationshipOptions(), { filter: 'filter', @@ -112,8 +112,8 @@ describe('DsDynamicLookupRelationModalComponent', () => { findById: createSuccessfulRemoteDataObject$(externalSources[0]), }); lookupRelationService = jasmine.createSpyObj('lookupRelationService', { - getTotalLocalResults: observableOf(totalLocal), - getTotalExternalResults: observableOf(totalExternal), + getTotalLocalResults: of(totalLocal), + getTotalExternalResults: of(totalExternal), }); rdbService = jasmine.createSpyObj('rdbService', { aggregate: createSuccessfulRemoteDataObject$(externalSources), @@ -128,7 +128,7 @@ describe('DsDynamicLookupRelationModalComponent', () => { providers: [ { provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions), + paginatedSearchOptions: of(pSearchOptions), }, }, { provide: ExternalSourceDataService, useValue: externalSourceService }, @@ -137,7 +137,7 @@ describe('DsDynamicLookupRelationModalComponent', () => { provide: SelectableListService, useValue: selectableListService, }, { - provide: RelationshipDataService, useValue: { getNameVariant: () => observableOf(nameVariant) }, + provide: RelationshipDataService, useValue: { getNameVariant: () => of(nameVariant) }, }, { provide: RemoteDataBuildService, useValue: rdbService }, { @@ -168,7 +168,7 @@ describe('DsDynamicLookupRelationModalComponent', () => { component.metadataFields = metadataField; component.submissionId = submissionId; component.isEditRelationship = true; - component.currentItemIsLeftItem$ = observableOf(true); + component.currentItemIsLeftItem$ = of(true); component.toAdd = []; component.toRemove = []; fixture.detectChanges(); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts index cec976267f..a1f8c9c7ad 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts @@ -79,14 +79,14 @@ import { DsDynamicLookupRelationSelectionTabComponent } from './selection-tab/dy }, ], imports: [ - ThemedDynamicLookupRelationExternalSourceTabComponent, - TranslateModule, - ThemedLoadingComponent, - NgbNavModule, - ThemedDynamicLookupRelationSearchTabComponent, AsyncPipe, - DsDynamicLookupRelationSelectionTabComponent, BtnDisabledDirective, + DsDynamicLookupRelationSelectionTabComponent, + NgbNavModule, + ThemedDynamicLookupRelationExternalSourceTabComponent, + ThemedDynamicLookupRelationSearchTabComponent, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts index 79831fe8ca..882e7c978e 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts @@ -14,7 +14,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { EMPTY, - of as observableOf, + of, } from 'rxjs'; import { ExternalSourceDataService } from '../../../../../../core/data/external-source-data.service'; @@ -120,7 +120,7 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { providers: [ { provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions), + paginatedSearchOptions: of(pSearchOptions), }, }, { provide: ExternalSourceDataService, useValue: externalSourceService }, diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts index c27acf337e..ec5ba8ff0c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts @@ -74,14 +74,14 @@ import { ThemedExternalSourceEntryImportModalComponent } from './external-source fadeInOut, ], imports: [ - ThemedSearchFormComponent, - PageSizeSelectorComponent, - ObjectCollectionComponent, - VarDirective, AsyncPipe, - TranslateModule, ErrorComponent, + ObjectCollectionComponent, + PageSizeSelectorComponent, ThemedLoadingComponent, + ThemedSearchFormComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts index edfd0f9b3d..51cdef260f 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts @@ -63,10 +63,10 @@ export enum ImportType { styleUrls: ['./external-source-entry-import-modal.component.scss'], templateUrl: './external-source-entry-import-modal.component.html', imports: [ - TranslateModule, - ThemedSearchResultsComponent, AsyncPipe, BtnDisabledDirective, + ThemedSearchResultsComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts index 35dba9ca54..bf76f5caef 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts @@ -8,7 +8,9 @@ import { ExternalSourceEntryImportModalComponent } from './external-source-entry styleUrls: [], templateUrl: '../../../../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [ExternalSourceEntryImportModalComponent], + imports: [ + ExternalSourceEntryImportModalComponent, + ], }) export class ThemedExternalSourceEntryImportModalComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts index 9e4df4f5f8..590871d5bf 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts @@ -19,7 +19,9 @@ import { DsDynamicLookupRelationExternalSourceTabComponent } from './dynamic-loo styleUrls: [], templateUrl: '../../../../../theme-support/themed.component.html', standalone: true, - imports: [DsDynamicLookupRelationExternalSourceTabComponent], + imports: [ + DsDynamicLookupRelationExternalSourceTabComponent, + ], }) export class ThemedDynamicLookupRelationExternalSourceTabComponent extends ThemedComponent { protected inAndOutputNames: (keyof DsDynamicLookupRelationExternalSourceTabComponent & keyof this)[] = ['label', 'listId', diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.spec.ts index 0588bab7d1..8ff3d7d968 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.spec.ts @@ -12,7 +12,7 @@ import { import { BehaviorSubject, Observable, - of as observableOf, + of, } from 'rxjs'; import { last } from 'rxjs/operators'; @@ -106,21 +106,21 @@ describe('RelationshipEffects', () => { mockRelationshipService = { getRelationshipByItemsAndLabel: - () => observableOf(relationship), - deleteRelationship: () => observableOf(new RestResponse(true, 200, 'OK')), - addRelationship: () => observableOf(new RestResponse(true, 200, 'OK')), + () => of(relationship), + deleteRelationship: () => of(new RestResponse(true, 200, 'OK')), + addRelationship: () => of(new RestResponse(true, 200, 'OK')), }; mockRelationshipTypeService = { getRelationshipTypeByLabelAndTypes: - () => observableOf(relationshipType), + () => of(relationshipType), }; notificationsService = jasmine.createSpyObj('notificationsService', ['error']); translateService = jasmine.createSpyObj('translateService', { instant: 'translated-message', }); selectableListService = jasmine.createSpyObj('selectableListService', { - findSelectedByCondition: observableOf({}), + findSelectedByCondition: of({}), deselectSingle: {}, }); } @@ -137,7 +137,7 @@ describe('RelationshipEffects', () => { provide: SubmissionObjectDataService, useValue: { findById: () => createSuccessfulRemoteDataObject$(new WorkspaceItem()), }, - getHrefByID: () => observableOf(''), + getHrefByID: () => of(''), }, { provide: Store, useValue: jasmine.createSpyObj('store', ['dispatch']) }, { provide: ObjectCacheService, useValue: {} }, diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts index e21f8328d2..288749ba8e 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LookupRelationService } from '../../../../../../core/data/lookup-relation.service'; import { buildPaginatedList } from '../../../../../../core/data/paginated-list.model'; @@ -50,7 +50,7 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => { let selectableListService; let lookupRelationService; const relationshipService = jasmine.createSpyObj('searchByItemsAndType',{ - searchByItemsAndType: observableOf(relatedRelationships), + searchByItemsAndType: of(relatedRelationships), }); const relationshipType = { @@ -82,7 +82,7 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => { searchResult3 = Object.assign(new ItemSearchResult(), { indexableObject: item3 }); searchResult4 = Object.assign(new ItemSearchResult(), { indexableObject: item4 }); listID = '6b0c8221-fcb4-47a8-b483-ca32363fffb3'; - selection$ = observableOf([searchResult1, searchResult2]); + selection$ = of([searchResult1, searchResult2]); results = buildPaginatedList(undefined, [searchResult1, searchResult2, searchResult3]); searchResult = Object.assign(new SearchObjects(), { @@ -106,7 +106,7 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => { }, { provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions), + paginatedSearchOptions: of(pSearchOptions), }, }, { provide: LookupRelationService, useValue: lookupRelationService }, diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index d3903fbc54..2890765673 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -54,10 +54,10 @@ import { RelationshipOptions } from '../../../models/relationship-options.model' ], imports: [ AsyncPipe, - VarDirective, - TranslateModule, NgbDropdownModule, ThemedSearchComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts index 6a4cca6bc6..835fe0bc4d 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts @@ -22,7 +22,9 @@ import { DsDynamicLookupRelationSearchTabComponent } from './dynamic-lookup-rela styleUrls: [], templateUrl: '../../../../../theme-support/themed.component.html', standalone: true, - imports: [DsDynamicLookupRelationSearchTabComponent], + imports: [ + DsDynamicLookupRelationSearchTabComponent, + ], }) export class ThemedDynamicLookupRelationSearchTabComponent extends ThemedComponent { protected inAndOutputNames: (keyof DsDynamicLookupRelationSearchTabComponent & keyof this)[] = ['relationship', 'listId', diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts index 04d29090e0..6b709bce94 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts @@ -9,7 +9,7 @@ import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -51,7 +51,7 @@ describe('DsDynamicLookupRelationSelectionTabComponent', () => { searchResult1 = Object.assign(new ItemSearchResult(), { indexableObject: item1 }); searchResult2 = Object.assign(new ItemSearchResult(), { indexableObject: item2 }); listID = '6b0c8221-fcb4-47a8-b483-ca32363fffb3'; - selection$ = observableOf([searchResult1, searchResult2]); + selection$ = of([searchResult1, searchResult2]); selectionRD$ = createSelection([searchResult1, searchResult2]); router = jasmine.createSpyObj('router', ['navigate']); } @@ -63,7 +63,7 @@ describe('DsDynamicLookupRelationSelectionTabComponent', () => { providers: [ { provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions), + paginatedSearchOptions: of(pSearchOptions), }, }, { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts index a92720fc7c..c55fdea153 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts @@ -45,9 +45,9 @@ import { SearchResult } from '../../../../../search/models/search-result.model'; }, ], imports: [ - PageSizeSelectorComponent, - ObjectCollectionComponent, AsyncPipe, + ObjectCollectionComponent, + PageSizeSelectorComponent, TranslateModule, ], standalone: true, diff --git a/src/app/shared/form/chips/chips.component.spec.ts b/src/app/shared/form/chips/chips.component.spec.ts index 7d4ba95345..6fb6232048 100644 --- a/src/app/shared/form/chips/chips.component.spec.ts +++ b/src/app/shared/form/chips/chips.component.spec.ts @@ -191,7 +191,9 @@ describe('ChipsComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [NgbModule], + imports: [ + NgbModule, + ], }) class TestComponent { diff --git a/src/app/shared/form/chips/chips.component.ts b/src/app/shared/form/chips/chips.component.ts index c7d607cbf9..c79d71ddc1 100644 --- a/src/app/shared/form/chips/chips.component.ts +++ b/src/app/shared/form/chips/chips.component.ts @@ -37,13 +37,13 @@ import { ChipsItem } from './models/chips-item.model'; styleUrls: ['./chips.component.scss'], templateUrl: './chips.component.html', imports: [ - NgbTooltipModule, - NgClass, AsyncPipe, AuthorityConfidenceStateDirective, - TranslateModule, CdkDrag, CdkDropList, + NgbTooltipModule, + NgClass, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/form.component.spec.ts b/src/app/shared/form/form.component.spec.ts index b8933a64cc..1a0a801022 100644 --- a/src/app/shared/form/form.component.spec.ts +++ b/src/app/shared/form/form.component.spec.ts @@ -473,12 +473,12 @@ describe('FormComponent test suite', () => { template: ``, standalone: true, imports: [ - FormComponent, DsDynamicFormComponent, - FormsModule, - ReactiveFormsModule, - NgbModule, DynamicFormsCoreModule, + FormComponent, + FormsModule, + NgbModule, + ReactiveFormsModule, ], }) class TestComponent { diff --git a/src/app/shared/form/form.component.ts b/src/app/shared/form/form.component.ts index b755d4a449..8754b1bec1 100644 --- a/src/app/shared/form/form.component.ts +++ b/src/app/shared/form/form.component.ts @@ -61,12 +61,12 @@ import { FormService } from './form.service'; styleUrls: ['form.component.scss'], templateUrl: 'form.component.html', imports: [ - DsDynamicFormComponent, - ReactiveFormsModule, - TranslateModule, - DynamicFormsCoreModule, AsyncPipe, BtnDisabledDirective, + DsDynamicFormComponent, + DynamicFormsCoreModule, + ReactiveFormsModule, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/number-picker/number-picker.component.spec.ts b/src/app/shared/form/number-picker/number-picker.component.spec.ts index 5a1174ecf5..e254fabbb6 100644 --- a/src/app/shared/form/number-picker/number-picker.component.spec.ts +++ b/src/app/shared/form/number-picker/number-picker.component.spec.ts @@ -160,10 +160,12 @@ describe('NumberPickerComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [FormsModule, - ReactiveFormsModule, + imports: [ + FormsModule, NgbModule, - NumberPickerComponent], + NumberPickerComponent, + ReactiveFormsModule, + ], }) class TestComponent { diff --git a/src/app/shared/form/number-picker/number-picker.component.ts b/src/app/shared/form/number-picker/number-picker.component.ts index ef35e1ee79..270207916e 100644 --- a/src/app/shared/form/number-picker/number-picker.component.ts +++ b/src/app/shared/form/number-picker/number-picker.component.ts @@ -31,10 +31,10 @@ import { isEmpty } from '../../empty.util'; { provide: NG_VALUE_ACCESSOR, useExisting: NumberPickerComponent, multi: true }, ], imports: [ - NgClass, - FormsModule, - TranslateModule, BtnDisabledDirective, + FormsModule, + NgClass, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts index aabb9ab3af..c9a598a007 100644 --- a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts +++ b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts @@ -20,8 +20,8 @@ import { VocabularyTreeviewComponent } from '../vocabulary-treeview/vocabulary-t templateUrl: './vocabulary-treeview-modal.component.html', styleUrls: ['./vocabulary-treeview-modal.component.scss'], imports: [ - VocabularyTreeviewComponent, TranslateModule, + VocabularyTreeviewComponent, ], standalone: true, }) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts index 9197875ea4..2e95bdc267 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts @@ -14,7 +14,7 @@ import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { PageInfo } from '../../../core/shared/page-info.model'; import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model'; @@ -83,8 +83,8 @@ describe('VocabularyTreeviewComponent test suite', () => { ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents().then(() => { - vocabularyTreeviewServiceStub.getData.and.returnValue(observableOf([])); - vocabularyTreeviewServiceStub.isLoading.and.returnValue(observableOf(false)); + vocabularyTreeviewServiceStub.getData.and.returnValue(of([])); + vocabularyTreeviewServiceStub.isLoading.and.returnValue(of(false)); }); })); @@ -100,7 +100,7 @@ describe('VocabularyTreeviewComponent test suite', () => { testFixture = createTestComponent(html, TestComponent) as ComponentFixture; testComp = testFixture.componentInstance; - vocabularyTreeviewServiceStub.getData.and.returnValue(observableOf([])); + vocabularyTreeviewServiceStub.getData.and.returnValue(of([])); }); afterEach(() => { @@ -237,7 +237,7 @@ describe('VocabularyTreeviewComponent test suite', () => { describe('', () => { beforeEach(() => { - vocabularyTreeviewServiceStub.getData.and.returnValue(observableOf([ + vocabularyTreeviewServiceStub.getData.and.returnValue(of([ { 'item': { 'id': 'srsc:SCB11', @@ -285,7 +285,9 @@ describe('VocabularyTreeviewComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [CdkTreeModule], + imports: [ + CdkTreeModule, + ], }) class TestComponent { diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts index fcbc8413b9..efdc892930 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -57,14 +57,14 @@ export type VocabularyTreeItemType = FormFieldMetadataValueObject | VocabularyEn templateUrl: './vocabulary-treeview.component.html', styleUrls: ['./vocabulary-treeview.component.scss'], imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + CdkTreeModule, FormsModule, NgbTooltipModule, - CdkTreeModule, - TranslateModule, - AsyncPipe, ThemedLoadingComponent, - AlertComponent, - BtnDisabledDirective, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts index 83266b1b5f..a6e555fa09 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts @@ -3,7 +3,7 @@ import findIndex from 'lodash/findIndex'; import { BehaviorSubject, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -210,7 +210,7 @@ export class VocabularyTreeviewService { this.vocabularyService.getVocabularyEntriesByValue(query, false, this.vocabularyOptions, new PageInfo()).pipe( getFirstSucceededRemoteListPayload(), - mergeMap((result: VocabularyEntry[]) => (result.length > 0) ? result : observableOf(null)), + mergeMap((result: VocabularyEntry[]) => (result.length > 0) ? result : of(null)), mergeMap((entry: VocabularyEntry) => this.vocabularyService.findEntryDetailById(entry.otherInformation.id, this.vocabularyName).pipe( getFirstSucceededRemoteDataPayload(), @@ -362,7 +362,7 @@ export class VocabularyTreeviewService { */ private getNodeHierarchy(item: VocabularyEntryDetail, selectedItems: string[], children?: TreeviewNode[], toStore = true): Observable { if (isEmpty(item)) { - return observableOf(null); + return of(null); } const node = this._generateNode(item, selectedItems, toStore, toStore); @@ -382,7 +382,7 @@ export class VocabularyTreeviewService { mergeMap((parentItem: VocabularyEntryDetail) => this.getNodeHierarchy(parentItem, selectedItems, [node], toStore)), ); } else { - return observableOf(node); + return of(node); } } diff --git a/src/app/shared/google-recaptcha/google-recaptcha.component.ts b/src/app/shared/google-recaptcha/google-recaptcha.component.ts index c459576a68..669cc80c3f 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.ts @@ -22,7 +22,9 @@ import { isNotEmpty } from '../empty.util'; templateUrl: './google-recaptcha.component.html', styleUrls: ['./google-recaptcha.component.scss'], standalone: true, - imports: [AsyncPipe], + imports: [ + AsyncPipe, + ], }) export class GoogleRecaptchaComponent implements OnInit { diff --git a/src/app/shared/handle.service.ts b/src/app/shared/handle.service.ts index 0c4912c031..26e8cc5028 100644 --- a/src/app/shared/handle.service.ts +++ b/src/app/shared/handle.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -53,7 +53,7 @@ export class HandleService { */ normalizeHandle(handle: string): Observable { if (hasNoValue(handle)) { - return observableOf(null); + return of(null); } return this.configurationService.findByPropertyName(CANONICAL_PREFIX_KEY).pipe( getFirstCompletedRemoteData(), diff --git a/src/app/shared/hover-class.directive.spec.ts b/src/app/shared/hover-class.directive.spec.ts index 7232093fc7..9a3b8a297e 100644 --- a/src/app/shared/hover-class.directive.spec.ts +++ b/src/app/shared/hover-class.directive.spec.ts @@ -13,7 +13,9 @@ import { HoverClassDirective } from './hover-class.directive'; @Component({ template: `
`, standalone: true, - imports: [HoverClassDirective], + imports: [ + HoverClassDirective, + ], }) class TestComponent { } diff --git a/src/app/shared/idle-modal/idle-modal.component.ts b/src/app/shared/idle-modal/idle-modal.component.ts index 112ed7719c..1b4caaff02 100644 --- a/src/app/shared/idle-modal/idle-modal.component.ts +++ b/src/app/shared/idle-modal/idle-modal.component.ts @@ -18,7 +18,9 @@ import { hasValue } from '../empty.util'; selector: 'ds-idle-modal', templateUrl: 'idle-modal.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class IdleModalComponent implements OnInit { diff --git a/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts b/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts index 122bc603a3..46ce7e980c 100644 --- a/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts +++ b/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AppState, @@ -75,7 +75,7 @@ describe('ImpersonateNavbarComponent', () => { describe('when the user is impersonating another user', () => { beforeEach(() => { - component.isImpersonating$ = observableOf(true); + component.isImpersonating$ = of(true); fixture.detectChanges(); }); diff --git a/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts b/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts index 745d49a5cd..e2db520969 100644 --- a/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts +++ b/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts @@ -24,7 +24,11 @@ import { isAuthenticated } from '../../core/auth/selectors'; selector: 'ds-impersonate-navbar', templateUrl: 'impersonate-navbar.component.html', standalone: true, - imports: [NgbTooltipModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + TranslateModule, + ], }) /** * Navbar component for actions to take concerning impersonating users diff --git a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts index 5e9e1e58a1..00a66220d9 100644 --- a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts @@ -37,7 +37,15 @@ import { InputSuggestionsComponent } from '../input-suggestions.component'; }, ], standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, ListableObjectComponentLoaderComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + DebounceDirective, + FormsModule, + ListableObjectComponentLoaderComponent, + NgClass, + TranslateModule, + ], }) /** diff --git a/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts b/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts index bffbb966ea..4593ad4013 100644 --- a/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts @@ -33,7 +33,15 @@ import { InputSuggestion } from '../input-suggestions.model'; }, ], standalone: true, - imports: [FormsModule, ClickOutsideDirective, NgTemplateOutlet, DebounceDirective, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + DebounceDirective, + FormsModule, + NgClass, + NgTemplateOutlet, + TranslateModule, + ], }) /** diff --git a/src/app/shared/input-suggestions/input-suggestions.component.ts b/src/app/shared/input-suggestions/input-suggestions.component.ts index ce17f00718..7037a167b9 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/input-suggestions.component.ts @@ -32,7 +32,14 @@ import { DebounceDirective } from '../utils/debounce.directive'; selector: 'ds-input-suggestions', templateUrl: './input-suggestions.component.html', standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + DebounceDirective, + FormsModule, + NgClass, + TranslateModule, + ], }) /** diff --git a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts index bcfb4768fd..f9c17b521b 100644 --- a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts +++ b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts @@ -40,7 +40,15 @@ import { InputSuggestion } from '../input-suggestions.model'; }, ], standalone: true, - imports: [FormsModule, ReactiveFormsModule, ClickOutsideDirective, DebounceDirective, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClickOutsideDirective, + DebounceDirective, + FormsModule, + NgClass, + ReactiveFormsModule, + TranslateModule, + ], }) /** diff --git a/src/app/shared/lang-switch/lang-switch.component.ts b/src/app/shared/lang-switch/lang-switch.component.ts index c78ae18929..d0df4487f0 100644 --- a/src/app/shared/lang-switch/lang-switch.component.ts +++ b/src/app/shared/lang-switch/lang-switch.component.ts @@ -19,7 +19,10 @@ import { LocaleService } from '../../core/locale/locale.service'; styleUrls: ['lang-switch.component.scss'], templateUrl: 'lang-switch.component.html', standalone: true, - imports: [NgbDropdownModule, TranslateModule], + imports: [ + NgbDropdownModule, + TranslateModule, + ], }) /** diff --git a/src/app/shared/lang-switch/themed-lang-switch.component.ts b/src/app/shared/lang-switch/themed-lang-switch.component.ts index 685d0f1799..26be75f685 100644 --- a/src/app/shared/lang-switch/themed-lang-switch.component.ts +++ b/src/app/shared/lang-switch/themed-lang-switch.component.ts @@ -11,7 +11,9 @@ import { LangSwitchComponent } from './lang-switch.component'; styleUrls: [], templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [LangSwitchComponent], + imports: [ + LangSwitchComponent, + ], }) export class ThemedLangSwitchComponent extends ThemedComponent { diff --git a/src/app/shared/live-region/live-region.component.ts b/src/app/shared/live-region/live-region.component.ts index d62b0d6dd7..801f42dd22 100644 --- a/src/app/shared/live-region/live-region.component.ts +++ b/src/app/shared/live-region/live-region.component.ts @@ -21,7 +21,10 @@ import { LiveRegionService } from './live-region.service'; templateUrl: './live-region.component.html', styleUrls: ['./live-region.component.scss'], standalone: true, - imports: [NgClass, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + ], }) export class LiveRegionComponent implements OnInit { diff --git a/src/app/shared/loading/loading.component.ts b/src/app/shared/loading/loading.component.ts index 6d9008deaf..1845e80422 100644 --- a/src/app/shared/loading/loading.component.ts +++ b/src/app/shared/loading/loading.component.ts @@ -15,7 +15,6 @@ import { hasValue } from '../empty.util'; styleUrls: ['./loading.component.scss'], templateUrl: './loading.component.html', standalone: true, - imports: [], }) export class LoadingComponent implements OnDestroy, OnInit { diff --git a/src/app/shared/loading/themed-loading.component.ts b/src/app/shared/loading/themed-loading.component.ts index d16e0b988e..6feb72b41e 100644 --- a/src/app/shared/loading/themed-loading.component.ts +++ b/src/app/shared/loading/themed-loading.component.ts @@ -16,7 +16,9 @@ import { LoadingComponent } from './loading.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [LoadingComponent], + imports: [ + LoadingComponent, + ], }) export class ThemedLoadingComponent extends ThemedComponent { diff --git a/src/app/shared/log-in/container/log-in-container.component.ts b/src/app/shared/log-in/container/log-in-container.component.ts index ab95fb4745..fc9ad96fdd 100644 --- a/src/app/shared/log-in/container/log-in-container.component.ts +++ b/src/app/shared/log-in/container/log-in-container.component.ts @@ -19,7 +19,9 @@ import { rendersAuthMethodType } from '../methods/log-in.methods-decorator.utils templateUrl: './log-in-container.component.html', styleUrls: ['./log-in-container.component.scss'], standalone: true, - imports: [NgComponentOutlet], + imports: [ + NgComponentOutlet, + ], }) export class LogInContainerComponent implements OnInit { diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts index bfcb1f3198..8bae463f85 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -32,7 +32,11 @@ import { AUTH_METHOD_FOR_DECORATOR_MAP } from './methods/log-in.methods-decorato styleUrls: ['./log-in.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [ThemedLoadingComponent, LogInContainerComponent, AsyncPipe], + imports: [ + AsyncPipe, + LogInContainerComponent, + ThemedLoadingComponent, + ], }) export class LogInComponent implements OnInit { diff --git a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts index ab82a664a1..1c8871ffea 100644 --- a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts +++ b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts @@ -30,7 +30,9 @@ import { isEmpty } from '../../../empty.util'; templateUrl: './log-in-external-provider.component.html', styleUrls: ['./log-in-external-provider.component.scss'], standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class LogInExternalProviderComponent implements OnInit { diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index d075294fbb..45181910ba 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -60,7 +60,15 @@ import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; styleUrls: ['./log-in-password.component.scss'], animations: [fadeOut], standalone: true, - imports: [FormsModule, ReactiveFormsModule, RouterLink, AsyncPipe, TranslateModule, BrowserOnlyPipe, BtnDisabledDirective], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + BtnDisabledDirective, + FormsModule, + ReactiveFormsModule, + RouterLink, + TranslateModule, + ], }) export class LogInPasswordComponent implements OnInit { diff --git a/src/app/shared/log-in/themed-log-in.component.ts b/src/app/shared/log-in/themed-log-in.component.ts index ef9e0c9979..a297f7dd79 100644 --- a/src/app/shared/log-in/themed-log-in.component.ts +++ b/src/app/shared/log-in/themed-log-in.component.ts @@ -15,7 +15,9 @@ import { LogInComponent } from './log-in.component'; styleUrls: [], templateUrl: './../theme-support/themed.component.html', standalone: true, - imports: [LogInComponent], + imports: [ + LogInComponent, + ], }) export class ThemedLogInComponent extends ThemedComponent { @@ -23,7 +25,7 @@ export class ThemedLogInComponent extends ThemedComponent { @Input() excludedAuthMethod: AuthMethodType; - @Input() showRegisterLink = true; + @Input() showRegisterLink: boolean; protected inAndOutputNames: (keyof LogInComponent & keyof this)[] = [ 'isStandalonePage', 'excludedAuthMethod', 'showRegisterLink', diff --git a/src/app/shared/log-out/log-out.component.ts b/src/app/shared/log-out/log-out.component.ts index 3c629e250b..37e5fa1fa1 100644 --- a/src/app/shared/log-out/log-out.component.ts +++ b/src/app/shared/log-out/log-out.component.ts @@ -23,7 +23,11 @@ import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; styleUrls: ['./log-out.component.scss'], animations: [fadeOut], standalone: true, - imports: [AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + TranslateModule, + ], }) export class LogOutComponent implements OnInit { /** diff --git a/src/app/shared/menu/menu-item/external-link-menu-item.component.ts b/src/app/shared/menu/menu-item/external-link-menu-item.component.ts index 69693ceada..0c5ec0f878 100644 --- a/src/app/shared/menu/menu-item/external-link-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/external-link-menu-item.component.ts @@ -18,7 +18,11 @@ import { ExternalLinkMenuItemModel } from './models/external-link.model'; styleUrls: ['./menu-item.component.scss'], templateUrl: './external-link-menu-item.component.html', standalone: true, - imports: [NgClass, TranslateModule, RouterLinkActive], + imports: [ + NgClass, + RouterLinkActive, + TranslateModule, + ], }) export class ExternalLinkMenuItemComponent implements OnInit { item: ExternalLinkMenuItemModel; diff --git a/src/app/shared/menu/menu-item/link-menu-item.component.ts b/src/app/shared/menu/menu-item/link-menu-item.component.ts index 7eb750d108..cf1dab4cb4 100644 --- a/src/app/shared/menu/menu-item/link-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/link-menu-item.component.ts @@ -21,7 +21,11 @@ import { LinkMenuItemModel } from './models/link.model'; styleUrls: ['./menu-item.component.scss'], templateUrl: './link-menu-item.component.html', standalone: true, - imports: [NgClass, RouterLink, TranslateModule], + imports: [ + NgClass, + RouterLink, + TranslateModule, + ], }) export class LinkMenuItemComponent implements OnInit { item: LinkMenuItemModel; diff --git a/src/app/shared/menu/menu-item/onclick-menu-item.component.ts b/src/app/shared/menu/menu-item/onclick-menu-item.component.ts index 79497a76df..48fb68df03 100644 --- a/src/app/shared/menu/menu-item/onclick-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/onclick-menu-item.component.ts @@ -16,7 +16,10 @@ import { OnClickMenuItemModel } from './models/onclick.model'; styleUrls: ['./menu-item.component.scss', './onclick-menu-item.component.scss'], templateUrl: './onclick-menu-item.component.html', standalone: true, - imports: [TranslateModule, RouterLinkActive], + imports: [ + RouterLinkActive, + TranslateModule, + ], }) export class OnClickMenuItemComponent { item: OnClickMenuItemModel; diff --git a/src/app/shared/menu/menu-item/text-menu-item.component.ts b/src/app/shared/menu/menu-item/text-menu-item.component.ts index f767745dd8..6696622fa7 100644 --- a/src/app/shared/menu/menu-item/text-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/text-menu-item.component.ts @@ -14,7 +14,9 @@ import { TextMenuItemModel } from './models/text.model'; styleUrls: ['./menu-item.component.scss'], templateUrl: './text-menu-item.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class TextMenuItemComponent { item: TextMenuItemModel; diff --git a/src/app/shared/menu/menu-provider.service.spec.ts b/src/app/shared/menu/menu-provider.service.spec.ts index 3daa4d457b..ffa42fa8d2 100644 --- a/src/app/shared/menu/menu-provider.service.spec.ts +++ b/src/app/shared/menu/menu-provider.service.spec.ts @@ -5,7 +5,7 @@ import { RouterStateSnapshot, UrlSegment, } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { COMMUNITY_MODULE_PATH } from '../../community-page/community-page-routing-paths'; import { MenuService } from './menu.service'; @@ -37,7 +37,7 @@ describe('MenuProviderService', () => { } getSections(route?: ActivatedRouteSnapshot, state?: RouterStateSnapshot) { - return observableOf(this.sections); + return of(this.sections); } } @@ -46,7 +46,7 @@ describe('MenuProviderService', () => { let menuService: MenuService; const router = { - events: observableOf(new ResolveEnd(1, 'test-url', 'test-url-after-redirect', { + events: of(new ResolveEnd(1, 'test-url', 'test-url-after-redirect', { url: 'test-url', root: { url: [new UrlSegment('test-url', {})], data: {}, @@ -114,8 +114,8 @@ describe('MenuProviderService', () => { { addSection: {}, removeSection: {}, - getMenu: observableOf({ id: MenuID.PUBLIC }), - getNonPersistentMenuSections: observableOf([sectionToBeRemoved]), + getMenu: of({ id: MenuID.PUBLIC }), + getNonPersistentMenuSections: of([sectionToBeRemoved]), }); diff --git a/src/app/shared/menu/menu-section/menu-section.component.spec.ts b/src/app/shared/menu/menu-section/menu-section.component.spec.ts index 1cfaa1dd99..3958005641 100644 --- a/src/app/shared/menu/menu-section/menu-section.component.spec.ts +++ b/src/app/shared/menu/menu-section/menu-section.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { MenuServiceStub } from '../../testing/menu-service.stub'; import { MenuService } from '../menu.service'; @@ -65,7 +65,7 @@ describe('MenuSectionComponent', () => { comp = fixture.componentInstance; menuService = (comp as any).menuService; spyOn(comp as any, 'getMenuItemComponent').and.returnValue(LinkMenuItemComponent); - spyOn(comp as any, 'getItemModelInjector').and.returnValue(observableOf({})); + spyOn(comp as any, 'getItemModelInjector').and.returnValue(of({})); fixture.detectChanges(); }); diff --git a/src/app/shared/menu/menu.component.spec.ts b/src/app/shared/menu/menu.component.spec.ts index 59aaccb6f8..9e2dbf4c00 100644 --- a/src/app/shared/menu/menu.component.spec.ts +++ b/src/app/shared/menu/menu.component.spec.ts @@ -26,7 +26,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { @@ -105,7 +105,7 @@ describe('MenuComponent', () => { const routeStub = { - data: observableOf({ + data: of({ dso: createSuccessfulRemoteDataObject(mockItem), }), children: [], @@ -141,7 +141,7 @@ describe('MenuComponent', () => { beforeEach(waitForAsync(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(false), + isAuthorized: of(false), }); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/menu.service.spec.ts b/src/app/shared/menu/menu.service.spec.ts index dc5929e2e0..5308a04d3c 100644 --- a/src/app/shared/menu/menu.service.spec.ts +++ b/src/app/shared/menu/menu.service.spec.ts @@ -9,7 +9,7 @@ import { } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { storeModuleConfig } from '../../app.reducer'; import { @@ -179,7 +179,7 @@ describe('MenuService', () => { }; router = { - events: observableOf(new NavigationEnd(1, 'test-url', 'test-url')), + events: of(new NavigationEnd(1, 'test-url', 'test-url')), }; } @@ -311,7 +311,7 @@ describe('MenuService', () => { describe('isMenuCollapsed', () => { beforeEach(() => { - spyOn(service, 'getMenu').and.returnValue(observableOf(fakeMenu)); + spyOn(service, 'getMenu').and.returnValue(of(fakeMenu)); }); it('should return true when the menu is collapsed', () => { @@ -326,7 +326,7 @@ describe('MenuService', () => { describe('isMenuPreviewCollapsed', () => { beforeEach(() => { - spyOn(service, 'getMenu').and.returnValue(observableOf(fakeMenu)); + spyOn(service, 'getMenu').and.returnValue(of(fakeMenu)); }); it('should return true when the menu\'s preview is collapsed', () => { @@ -349,7 +349,7 @@ describe('MenuService', () => { previewCollapsed: false, sectionToSubsectionIndex: {}, } as any; - spyOn(service, 'getMenu').and.returnValue(observableOf(testMenu)); + spyOn(service, 'getMenu').and.returnValue(of(testMenu)); const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN); const expected = cold('(b|)', { @@ -377,7 +377,7 @@ describe('MenuService', () => { 'section_2': ['section_5'], }, } as any; - spyOn(service, 'getMenu').and.returnValue(observableOf(testMenu)); + spyOn(service, 'getMenu').and.returnValue(of(testMenu)); const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN); const expected = cold('(b|)', { @@ -406,7 +406,7 @@ describe('MenuService', () => { 'section_2': ['section_5'], }, } as any; - spyOn(service, 'getMenu').and.returnValue(observableOf(testMenu)); + spyOn(service, 'getMenu').and.returnValue(of(testMenu)); const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN); const expected = cold('(b|)', { @@ -419,7 +419,7 @@ describe('MenuService', () => { describe('isMenuVisible', () => { beforeEach(() => { - spyOn(service, 'getMenu').and.returnValue(observableOf(fakeMenu)); + spyOn(service, 'getMenu').and.returnValue(of(fakeMenu)); }); it('should return false when the menu is hidden', () => { @@ -435,7 +435,7 @@ describe('MenuService', () => { describe('isSectionActive', () => { beforeEach(() => { - spyOn(service, 'getMenuSection').and.returnValue(observableOf(visibleSection1 as MenuSection)); + spyOn(service, 'getMenuSection').and.returnValue(of(visibleSection1 as MenuSection)); }); it('should return false when the section is not active', () => { @@ -450,7 +450,7 @@ describe('MenuService', () => { describe('isSectionVisible', () => { beforeEach(() => { - spyOn(service, 'getMenuSection').and.returnValue(observableOf(hiddenSection3 as MenuSection)); + spyOn(service, 'getMenuSection').and.returnValue(of(hiddenSection3 as MenuSection)); }); it('should return false when the section is hidden', () => { diff --git a/src/app/shared/menu/providers/access-control.menu.spec.ts b/src/app/shared/menu/providers/access-control.menu.spec.ts index 63ade178cb..9b57f5813d 100644 --- a/src/app/shared/menu/providers/access-control.menu.spec.ts +++ b/src/app/shared/menu/providers/access-control.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; @@ -61,9 +61,9 @@ describe('AccessControlMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.callFake((id: FeatureID) => { if (id === FeatureID.CanManageGroups) { - return observableOf(false); + return of(false); } else { - return observableOf(true); + return of(true); } }); diff --git a/src/app/shared/menu/providers/access-control.menu.ts b/src/app/shared/menu/providers/access-control.menu.ts index 9b5c289c5d..ee1a915fc8 100644 --- a/src/app/shared/menu/providers/access-control.menu.ts +++ b/src/app/shared/menu/providers/access-control.menu.ts @@ -12,7 +12,7 @@ import { combineLatest as observableCombineLatest, map, Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -37,7 +37,7 @@ export class AccessControlMenuProvider extends AbstractExpandableMenuProvider { } public getTopSection(): Observable { - return observableOf({ + return of({ model: { type: MenuItemType.TEXT, text: 'menu.section.access_control', diff --git a/src/app/shared/menu/providers/admin-search.menu.spec.ts b/src/app/shared/menu/providers/admin-search.menu.spec.ts index a8e31e08b9..f33a66eee6 100644 --- a/src/app/shared/menu/providers/admin-search.menu.spec.ts +++ b/src/app/shared/menu/providers/admin-search.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -35,7 +35,7 @@ describe('AdminSearchMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/browse.menu.ts b/src/app/shared/menu/providers/browse.menu.ts index 4ad6314f9a..f67dec2085 100644 --- a/src/app/shared/menu/providers/browse.menu.ts +++ b/src/app/shared/menu/providers/browse.menu.ts @@ -12,7 +12,7 @@ import { } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -43,7 +43,7 @@ export class BrowseMenuProvider extends AbstractExpandableMenuProvider { } getTopSection(): Observable { - return observableOf( + return of( { model: { type: MenuItemType.TEXT, diff --git a/src/app/shared/menu/providers/coar-notify.menu.spec.ts b/src/app/shared/menu/providers/coar-notify.menu.spec.ts index e65b6a433f..d3d41ae757 100644 --- a/src/app/shared/menu/providers/coar-notify.menu.spec.ts +++ b/src/app/shared/menu/providers/coar-notify.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -52,7 +52,7 @@ describe('CoarNotifyMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ providers: [ diff --git a/src/app/shared/menu/providers/comcol-subscribe.menu.spec.ts b/src/app/shared/menu/providers/comcol-subscribe.menu.spec.ts index 137e6727c6..8450d56c49 100644 --- a/src/app/shared/menu/providers/comcol-subscribe.menu.spec.ts +++ b/src/app/shared/menu/providers/comcol-subscribe.menu.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Collection } from '../../../core/shared/collection.model'; @@ -33,7 +33,7 @@ describe('SubscribeMenuProvider', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - 'isAuthorized': observableOf(true), + 'isAuthorized': of(true), }); modalService = jasmine.createSpyObj('modalService', ['open']); diff --git a/src/app/shared/menu/providers/create-report.menu.spec.ts b/src/app/shared/menu/providers/create-report.menu.spec.ts index 1f1c09f594..270f14fcf7 100644 --- a/src/app/shared/menu/providers/create-report.menu.spec.ts +++ b/src/app/shared/menu/providers/create-report.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -60,9 +60,9 @@ describe('CreateReportMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.callFake((id: FeatureID) => { if (id === FeatureID.AdministratorOf) { - return observableOf(true); + return of(true); } else { - return observableOf(false); + return of(false); } }); diff --git a/src/app/shared/menu/providers/curation.menu.spec.ts b/src/app/shared/menu/providers/curation.menu.spec.ts index 0da4c1d93c..97995cb308 100644 --- a/src/app/shared/menu/providers/curation.menu.spec.ts +++ b/src/app/shared/menu/providers/curation.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -33,7 +33,7 @@ describe('CurationMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/dso-edit.menu.spec.ts b/src/app/shared/menu/providers/dso-edit.menu.spec.ts index b13cd1889a..4393da59e7 100644 --- a/src/app/shared/menu/providers/dso-edit.menu.spec.ts +++ b/src/app/shared/menu/providers/dso-edit.menu.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Collection } from '../../../core/shared/collection.model'; @@ -37,7 +37,7 @@ describe('DSpaceObjectEditMenuProvider', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - 'isAuthorized': observableOf(true), + 'isAuthorized': of(true), }); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/edit.menu.spec.ts b/src/app/shared/menu/providers/edit.menu.spec.ts index 5266eb0103..512560875c 100644 --- a/src/app/shared/menu/providers/edit.menu.spec.ts +++ b/src/app/shared/menu/providers/edit.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; @@ -61,9 +61,9 @@ describe('EditMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.callFake((id: FeatureID) => { if (id === FeatureID.IsCollectionAdmin) { - return observableOf(false); + return of(false); } else { - return observableOf(true); + return of(true); } }); diff --git a/src/app/shared/menu/providers/edit.menu.ts b/src/app/shared/menu/providers/edit.menu.ts index 38346729d4..02ec7a4afc 100644 --- a/src/app/shared/menu/providers/edit.menu.ts +++ b/src/app/shared/menu/providers/edit.menu.ts @@ -12,7 +12,7 @@ import { combineLatest, map, Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -37,7 +37,7 @@ export class EditMenuProvider extends AbstractExpandableMenuProvider { } public getTopSection(): Observable { - return observableOf( + return of( { accessibilityHandle: 'edit', model: { diff --git a/src/app/shared/menu/providers/export.menu.spec.ts b/src/app/shared/menu/providers/export.menu.spec.ts index c547e96692..df97a04269 100644 --- a/src/app/shared/menu/providers/export.menu.spec.ts +++ b/src/app/shared/menu/providers/export.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { ScriptDataService } from '../../../core/data/processes/script-data.service'; @@ -52,7 +52,7 @@ describe('ExportMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/export.menu.ts b/src/app/shared/menu/providers/export.menu.ts index aae7e39d1f..aeccbb1c5a 100644 --- a/src/app/shared/menu/providers/export.menu.ts +++ b/src/app/shared/menu/providers/export.menu.ts @@ -12,7 +12,7 @@ import { combineLatest as observableCombineLatest, map, Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -41,7 +41,7 @@ export class ExportMenuProvider extends AbstractExpandableMenuProvider { } public getTopSection(): Observable { - return observableOf( + return of( { accessibilityHandle: 'export', model: { diff --git a/src/app/shared/menu/providers/health.menu.spec.ts b/src/app/shared/menu/providers/health.menu.spec.ts index d36e7bbc18..3487ab70f6 100644 --- a/src/app/shared/menu/providers/health.menu.spec.ts +++ b/src/app/shared/menu/providers/health.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -33,7 +33,7 @@ describe('HealthMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/helper-providers/expandable-menu-provider.spec.ts b/src/app/shared/menu/providers/helper-providers/expandable-menu-provider.spec.ts index 9b829e7ff2..288514e57e 100644 --- a/src/app/shared/menu/providers/helper-providers/expandable-menu-provider.spec.ts +++ b/src/app/shared/menu/providers/helper-providers/expandable-menu-provider.spec.ts @@ -9,7 +9,7 @@ import { TestBed } from '@angular/core/testing'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { MenuID } from '../../menu-id.model'; @@ -46,11 +46,11 @@ describe('AbstractExpandableMenuProvider', () => { class TestClass extends AbstractExpandableMenuProvider { getTopSection(): Observable { - return observableOf(topSection); + return of(topSection); } getSubSections(): Observable { - return observableOf(subSections); + return of(subSections); } } diff --git a/src/app/shared/menu/providers/helper-providers/route-context.menu.spec.ts b/src/app/shared/menu/providers/helper-providers/route-context.menu.spec.ts index d4347f7564..37e33e0a0a 100644 --- a/src/app/shared/menu/providers/helper-providers/route-context.menu.spec.ts +++ b/src/app/shared/menu/providers/helper-providers/route-context.menu.spec.ts @@ -13,7 +13,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { CacheableObject } from '../../../../core/cache/cacheable-object.model'; @@ -26,11 +26,11 @@ describe('AbstractRouteContextMenuProvider', () => { class TestClass extends AbstractRouteContextMenuProvider { getRouteContext(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - return observableOf(object); + return of(object); } getSectionsForContext(routeContext: CacheableObject): Observable { - return observableOf(expectedSections); + return of(expectedSections); } } diff --git a/src/app/shared/menu/providers/helper-providers/route-context.menu.ts b/src/app/shared/menu/providers/helper-providers/route-context.menu.ts index 293cb23280..bd1feaf039 100644 --- a/src/app/shared/menu/providers/helper-providers/route-context.menu.ts +++ b/src/app/shared/menu/providers/helper-providers/route-context.menu.ts @@ -11,7 +11,7 @@ import { } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { switchMap } from 'rxjs/operators'; @@ -37,7 +37,7 @@ export abstract class AbstractRouteContextMenuProvider extends AbstractMenuPr if (this.isApplicable(routeContext)) { return this.getSectionsForContext(routeContext); } else { - return observableOf([]); + return of([]); } }), ); diff --git a/src/app/shared/menu/providers/import.menu.spec.ts b/src/app/shared/menu/providers/import.menu.spec.ts index 53d52394ac..8292445ade 100644 --- a/src/app/shared/menu/providers/import.menu.spec.ts +++ b/src/app/shared/menu/providers/import.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { ScriptDataService } from '../../../core/data/processes/script-data.service'; @@ -51,7 +51,7 @@ describe('ImportMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/import.menu.ts b/src/app/shared/menu/providers/import.menu.ts index 09d459d2c9..909fc9329d 100644 --- a/src/app/shared/menu/providers/import.menu.ts +++ b/src/app/shared/menu/providers/import.menu.ts @@ -12,7 +12,7 @@ import { combineLatest as observableCombineLatest, map, Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -39,7 +39,7 @@ export class ImportMenuProvider extends AbstractExpandableMenuProvider { } public getTopSection(): Observable { - return observableOf( + return of( { model: { type: MenuItemType.TEXT, diff --git a/src/app/shared/menu/providers/item-claim.menu.spec.ts b/src/app/shared/menu/providers/item-claim.menu.spec.ts index 195407f4fb..e28972bbfd 100644 --- a/src/app/shared/menu/providers/item-claim.menu.spec.ts +++ b/src/app/shared/menu/providers/item-claim.menu.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { ResearcherProfileDataService } from '../../../core/profile/researcher-profile-data.service'; @@ -64,7 +64,7 @@ describe('ClaimMenuProvider', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - 'isAuthorized': observableOf(true), + 'isAuthorized': of(true), 'invalidateAuthorizationsRequestCache': {}, }); @@ -73,7 +73,7 @@ describe('ClaimMenuProvider', () => { notificationsService = new NotificationsServiceStub(); researcherProfileService = jasmine.createSpyObj('authorizationService', { - 'createFromExternalSourceAndReturnRelatedItemId': observableOf('profile-id'), + 'createFromExternalSourceAndReturnRelatedItemId': of('profile-id'), }); modalService = jasmine.createSpyObj('modalService', ['open']); @@ -125,7 +125,7 @@ describe('ClaimMenuProvider', () => { expect(menuService.hideMenuSection).toHaveBeenCalled(); }); it('should show an error notification when no id is returned by the researcher profile service', () => { - (researcherProfileService.createFromExternalSourceAndReturnRelatedItemId as jasmine.Spy).and.returnValue(observableOf(null)); + (researcherProfileService.createFromExternalSourceAndReturnRelatedItemId as jasmine.Spy).and.returnValue(of(null)); (provider as any).claimResearcher(person); expect(notificationsService.error).toHaveBeenCalled(); expect(authorizationService.invalidateAuthorizationsRequestCache).not.toHaveBeenCalled(); diff --git a/src/app/shared/menu/providers/item-orcid.menu.spec.ts b/src/app/shared/menu/providers/item-orcid.menu.spec.ts index 028289bad0..6b348f22a1 100644 --- a/src/app/shared/menu/providers/item-orcid.menu.spec.ts +++ b/src/app/shared/menu/providers/item-orcid.menu.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -55,7 +55,7 @@ describe('OrcidMenuProvider', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - 'isAuthorized': observableOf(true), + 'isAuthorized': of(true), }); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/item-versioning.menu.spec.ts b/src/app/shared/menu/providers/item-versioning.menu.spec.ts index 4f2e0f7840..8b10643060 100644 --- a/src/app/shared/menu/providers/item-versioning.menu.spec.ts +++ b/src/app/shared/menu/providers/item-versioning.menu.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -55,12 +55,12 @@ describe('VersioningMenuProvider', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); dsoVersioningModalService = jasmine.createSpyObj('dsoVersioningModalService', { - isNewVersionButtonDisabled: observableOf(false), - getVersioningTooltipMessage: observableOf('item.page.version.create'), + isNewVersionButtonDisabled: of(false), + getVersioningTooltipMessage: of('item.page.version.create'), }); TestBed.configureTestingModule({ @@ -86,8 +86,8 @@ describe('VersioningMenuProvider', () => { }); }); it('should return the section to that a version is present when a version draft is present', (done) => { - (dsoVersioningModalService.isNewVersionButtonDisabled as jasmine.Spy).and.returnValue(observableOf(true)); - (dsoVersioningModalService.getVersioningTooltipMessage as jasmine.Spy).and.returnValue(observableOf('item.page.version.hasDraft')); + (dsoVersioningModalService.isNewVersionButtonDisabled as jasmine.Spy).and.returnValue(of(true)); + (dsoVersioningModalService.getVersioningTooltipMessage as jasmine.Spy).and.returnValue(of('item.page.version.hasDraft')); provider.getSectionsForContext(item).subscribe((sections) => { expect(sections).toEqual(expectedSectionsWhenVersionPresent); diff --git a/src/app/shared/menu/providers/new.menu.spec.ts b/src/app/shared/menu/providers/new.menu.spec.ts index 377e7c5196..be46c8609c 100644 --- a/src/app/shared/menu/providers/new.menu.spec.ts +++ b/src/app/shared/menu/providers/new.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; @@ -78,9 +78,9 @@ describe('NewMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.callFake((id: FeatureID) => { if (id === FeatureID.IsCollectionAdmin) { - return observableOf(false); + return of(false); } else { - return observableOf(true); + return of(true); } }); diff --git a/src/app/shared/menu/providers/new.menu.ts b/src/app/shared/menu/providers/new.menu.ts index 431622a769..685fe30f81 100644 --- a/src/app/shared/menu/providers/new.menu.ts +++ b/src/app/shared/menu/providers/new.menu.ts @@ -12,7 +12,7 @@ import { combineLatest, map, Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -39,7 +39,7 @@ export class NewMenuProvider extends AbstractExpandableMenuProvider { } public getTopSection(): Observable { - return observableOf( + return of( { accessibilityHandle: 'new', model: { diff --git a/src/app/shared/menu/providers/notifications.menu.spec.ts b/src/app/shared/menu/providers/notifications.menu.spec.ts index 3c04dce78f..c8d11eaf6e 100644 --- a/src/app/shared/menu/providers/notifications.menu.spec.ts +++ b/src/app/shared/menu/providers/notifications.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { PUBLICATION_CLAIMS_PATH } from '../../../admin/admin-notifications/admin-notifications-routing-paths'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -54,9 +54,9 @@ describe('NotificationsMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.callFake((id: FeatureID) => { if (id === FeatureID.CanSeeQA || id === FeatureID.AdministratorOf) { - return observableOf(true); + return of(true); } else { - return observableOf(false); + return of(false); } }); diff --git a/src/app/shared/menu/providers/processes.menu.spec.ts b/src/app/shared/menu/providers/processes.menu.spec.ts index 3babec16e2..47a40ab1f9 100644 --- a/src/app/shared/menu/providers/processes.menu.spec.ts +++ b/src/app/shared/menu/providers/processes.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -34,7 +34,7 @@ describe('ProcessesMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/registries.menu.spec.ts b/src/app/shared/menu/providers/registries.menu.spec.ts index 0903dc0f19..bc713f0d23 100644 --- a/src/app/shared/menu/providers/registries.menu.spec.ts +++ b/src/app/shared/menu/providers/registries.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { ScriptDataService } from '../../../core/data/processes/script-data.service'; @@ -52,7 +52,7 @@ describe('RegistriesMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/registries.menu.ts b/src/app/shared/menu/providers/registries.menu.ts index 9ab7d65d7e..335676cfd7 100644 --- a/src/app/shared/menu/providers/registries.menu.ts +++ b/src/app/shared/menu/providers/registries.menu.ts @@ -12,7 +12,7 @@ import { combineLatest, map, Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -36,7 +36,7 @@ export class RegistriesMenuProvider extends AbstractExpandableMenuProvider { } public getTopSection(): Observable { - return observableOf( + return of( { model: { type: MenuItemType.TEXT, diff --git a/src/app/shared/menu/providers/statistics.menu.spec.ts b/src/app/shared/menu/providers/statistics.menu.spec.ts index a50f8d3746..085595f65d 100644 --- a/src/app/shared/menu/providers/statistics.menu.spec.ts +++ b/src/app/shared/menu/providers/statistics.menu.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -75,7 +75,7 @@ describe('StatisticsMenuProvider', () => { beforeEach(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); TestBed.configureTestingModule({ @@ -106,7 +106,7 @@ describe('StatisticsMenuProvider', () => { }); }); it('should not return anything if not authorized to view statistics', (done) => { - (TestBed.inject(AuthorizationDataService) as any).isAuthorized.and.returnValue(observableOf(false)); + (TestBed.inject(AuthorizationDataService) as any).isAuthorized.and.returnValue(of(false)); provider.getSectionsForContext(item).subscribe((sections) => { expect(sections).toEqual(expectedSectionsForItemInvisible); done(); diff --git a/src/app/shared/menu/providers/system-wide-alert.menu.spec.ts b/src/app/shared/menu/providers/system-wide-alert.menu.spec.ts index cd5432ab69..0aca4befef 100644 --- a/src/app/shared/menu/providers/system-wide-alert.menu.spec.ts +++ b/src/app/shared/menu/providers/system-wide-alert.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -34,7 +34,7 @@ describe('SystemWideAlertMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/menu/providers/workflow.menu.spec.ts b/src/app/shared/menu/providers/workflow.menu.spec.ts index 2c8f193aa8..cce9ce3e99 100644 --- a/src/app/shared/menu/providers/workflow.menu.spec.ts +++ b/src/app/shared/menu/providers/workflow.menu.spec.ts @@ -7,7 +7,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; @@ -34,7 +34,7 @@ describe('WorkflowMenuProvider', () => { beforeEach(() => { spyOn(authorizationServiceStub, 'isAuthorized').and.returnValue( - observableOf(true), + of(true), ); TestBed.configureTestingModule({ diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts index df80edf474..b01bffc19a 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts @@ -16,7 +16,9 @@ import { MetadataFieldWrapperComponent } from './metadata-field-wrapper.componen template: '\n' + '', standalone: true, - imports: [MetadataFieldWrapperComponent], + imports: [ + MetadataFieldWrapperComponent, + ], }) class NoContentComponent { public hideIfNoTextContent = true; @@ -29,7 +31,9 @@ class NoContentComponent { ' \n' + '', standalone: true, - imports: [MetadataFieldWrapperComponent], + imports: [ + MetadataFieldWrapperComponent, + ], }) class SpanContentComponent { @Input() hideIfNoTextContent = true; @@ -41,7 +45,9 @@ class SpanContentComponent { ' The quick brown fox jumps over the lazy dog\n' + '', standalone: true, - imports: [MetadataFieldWrapperComponent], + imports: [ + MetadataFieldWrapperComponent, + ], }) class TextContentComponent { @Input() hideIfNoTextContent = true; diff --git a/src/app/shared/mocks/auth.service.mock.ts b/src/app/shared/mocks/auth.service.mock.ts index 249d51de3b..477b3256a5 100644 --- a/src/app/shared/mocks/auth.service.mock.ts +++ b/src/app/shared/mocks/auth.service.mock.ts @@ -1,7 +1,7 @@ /* eslint-disable no-empty, @typescript-eslint/no-empty-function */ import { Observable, - of as observableOf, + of, } from 'rxjs'; export class AuthServiceMock { @@ -13,11 +13,11 @@ export class AuthServiceMock { } public getShortlivedToken(): Observable { - return observableOf('token'); + return of('token'); } public isAuthenticated(): Observable { - return observableOf(true); + return of(true); } public setRedirectUrl(url: string) { @@ -27,7 +27,7 @@ export class AuthServiceMock { } public isUserIdle(): Observable { - return observableOf(false); + return of(false); } public getImpersonateID(): string { diff --git a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts index 84664b7b20..4a8aabce37 100644 --- a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts +++ b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts @@ -2,7 +2,7 @@ import { HttpHeaders, HttpResponse, } from '@angular/common/http'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RestRequestMethod } from '../../../core/data/rest-request-method'; import { EndpointMockingRestService } from './endpoint-mocking-rest.service'; @@ -27,8 +27,8 @@ describe('EndpointMockingRestService', () => { ]); const httpStub = jasmine.createSpyObj('http', { - get: observableOf(serverHttpResponse), - request: observableOf(serverHttpResponse), + get: of(serverHttpResponse), + request: of(serverHttpResponse), }); service = new EndpointMockingRestService(mockResponseMap, httpStub); diff --git a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts index bfdbe4d6d7..c3084f202b 100644 --- a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts +++ b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts @@ -8,7 +8,7 @@ import { } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { environment } from '../../../../environments/environment'; @@ -94,7 +94,7 @@ export class EndpointMockingRestService extends DspaceRestService { * an Observable containing the mock response */ private toMockResponse$(mockData: any): Observable { - return observableOf({ + return of({ payload: mockData, headers: new HttpHeaders(), statusCode: 200, diff --git a/src/app/shared/mocks/form-service.mock.ts b/src/app/shared/mocks/form-service.mock.ts index 5b6ef32814..39f7a2968d 100644 --- a/src/app/shared/mocks/form-service.mock.ts +++ b/src/app/shared/mocks/form-service.mock.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FormService } from '../form/form.service'; @@ -12,12 +12,12 @@ export function getMockFormService( getFormData: jasmine.createSpy('getFormData'), initForm: jasmine.createSpy('initForm'), removeForm: jasmine.createSpy('removeForm'), - getForm: observableOf({}), + getForm: of({}), getUniqueId: id$, resetForm: {}, validateAllFormFields: jasmine.createSpy('validateAllFormFields'), isValid: jasmine.createSpy('isValid'), - isFormInitialized: observableOf(true), + isFormInitialized: of(true), addError: jasmine.createSpy('addError'), removeError: jasmine.createSpy('removeError'), }); diff --git a/src/app/shared/mocks/host-window-service.mock.ts b/src/app/shared/mocks/host-window-service.mock.ts index 1e5bf222d7..d40f5cc452 100644 --- a/src/app/shared/mocks/host-window-service.mock.ts +++ b/src/app/shared/mocks/host-window-service.mock.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; // declare a stub service @@ -17,10 +17,10 @@ export class HostWindowServiceMock { } isXs(): Observable { - return observableOf(this.width < 576); + return of(this.width < 576); } isSm(): Observable { - return observableOf(this.width < 768); + return of(this.width < 768); } } diff --git a/src/app/shared/mocks/item.mock.ts b/src/app/shared/mocks/item.mock.ts index 7f723bfd61..0326014d98 100644 --- a/src/app/shared/mocks/item.mock.ts +++ b/src/app/shared/mocks/item.mock.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Bitstream } from '../../core/shared/bitstream.model'; import { BitstreamFormat } from '../../core/shared/bitstream-format.model'; @@ -124,7 +124,7 @@ export const MockBitstream3: Bitstream = Object.assign(new Bitstream(), { export const MockOriginalBundle: Bundle = Object.assign(new Bundle(), { name: 'ORIGINAL', primaryBitstream: createSuccessfulRemoteDataObject$(MockBitstream2), - bitstreams: observableOf(Object.assign({ + bitstreams: of(Object.assign({ _links: { self: { href: 'dspace-angular://aggregated/object/1507836003548', @@ -277,7 +277,7 @@ export const ItemMock: Item = Object.assign(new Item(), { }, ], }, - owningCollection: observableOf({ + owningCollection: of({ _links: { self: { href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb', diff --git a/src/app/shared/mocks/mock-trucatable.service.ts b/src/app/shared/mocks/mock-trucatable.service.ts index a0711015ed..e845c8f4af 100644 --- a/src/app/shared/mocks/mock-trucatable.service.ts +++ b/src/app/shared/mocks/mock-trucatable.service.ts @@ -1,12 +1,12 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; export const mockTruncatableService: any = { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ isCollapsed: (id: string) => { if (id === '1') { - return observableOf(true); + return of(true); } else { - return observableOf(false); + return of(false); } }, expand: (id: string) => { diff --git a/src/app/shared/mocks/notifications.mock.ts b/src/app/shared/mocks/notifications.mock.ts index 30237b6b79..0078b83a1b 100644 --- a/src/app/shared/mocks/notifications.mock.ts +++ b/src/app/shared/mocks/notifications.mock.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { QualityAssuranceEventDataService } from '../../core/notifications/qa/events/quality-assurance-event-data.service'; import { QualityAssuranceEventObject } from '../../core/notifications/qa/models/quality-assurance-event.model'; @@ -1487,8 +1487,8 @@ export const qualityAssuranceEventObjectMissingPid: QualityAssuranceEventObject href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174001/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid1)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid1)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject = { @@ -1525,8 +1525,8 @@ export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid2)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid2)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject = { @@ -1563,8 +1563,8 @@ export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid3)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid3)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject = { @@ -1601,8 +1601,8 @@ export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid4)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid4)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject = { @@ -1639,8 +1639,8 @@ export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid5)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid5)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject = { @@ -1677,8 +1677,8 @@ export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid6)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid6)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventObject = { @@ -1715,8 +1715,8 @@ export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventOb href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009/related', }, }, - target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid7)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), + target: of(createSuccessfulRemoteDataObject(ItemMockPid7)), + related: of(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingProjectFound: QualityAssuranceEventObject = { diff --git a/src/app/shared/mocks/request.service.mock.ts b/src/app/shared/mocks/request.service.mock.ts index fd6dd7fdfb..16054012b6 100644 --- a/src/app/shared/mocks/request.service.mock.ts +++ b/src/app/shared/mocks/request.service.mock.ts @@ -1,13 +1,13 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RequestService } from '../../core/data/request.service'; import SpyObj = jasmine.SpyObj; import { RequestEntry } from '../../core/data/request-entry.model'; -export function getMockRequestService(requestEntry$: Observable = observableOf(new RequestEntry())): SpyObj { +export function getMockRequestService(requestEntry$: Observable = of(new RequestEntry())): SpyObj { return jasmine.createSpyObj('requestService', { send: false, generateRequestId: 'clients/b186e8ce-e99c-4183-bc9a-42b4821bdb78', @@ -15,10 +15,10 @@ export function getMockRequestService(requestEntry$: Observable = getByUUID: requestEntry$, uriEncodeBody: jasmine.createSpy('uriEncodeBody'), isCachedOrPending: false, - removeByHrefSubstring: observableOf(true), - setStaleByHrefSubstring: observableOf(true), - setStaleByUUID: observableOf(true), - hasByHref$: observableOf(false), + removeByHrefSubstring: of(true), + setStaleByHrefSubstring: of(true), + setStaleByUUID: of(true), + hasByHref$: of(false), shouldDispatchRequest: true, }); } diff --git a/src/app/shared/mocks/router.mock.ts b/src/app/shared/mocks/router.mock.ts index 88048f7b82..cb639c61dd 100644 --- a/src/app/shared/mocks/router.mock.ts +++ b/src/app/shared/mocks/router.mock.ts @@ -1,10 +1,10 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; /** * Mock for [[RouterService]] */ export class RouterMock { - public events = observableOf({}); + public events = of({}); public routerState = { snapshot: { url: '', diff --git a/src/app/shared/mocks/search-service.mock.ts b/src/app/shared/mocks/search-service.mock.ts index 41db3cd8e2..434be75fae 100644 --- a/src/app/shared/mocks/search-service.mock.ts +++ b/src/app/shared/mocks/search-service.mock.ts @@ -1,13 +1,13 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SearchService } from '../../core/shared/search/search.service'; export function getMockSearchService(): SearchService { return jasmine.createSpyObj('searchService', { search: '', - getEndpoint: observableOf('discover/search/objects'), + getEndpoint: of('discover/search/objects'), getSearchLink: '/mydspace', - getScopes: observableOf(['test-scope']), + getScopes: of(['test-scope']), setServiceOptions: {}, }); } diff --git a/src/app/shared/mocks/section-accesses.service.mock.ts b/src/app/shared/mocks/section-accesses.service.mock.ts index e212bfccbb..227871e4c9 100644 --- a/src/app/shared/mocks/section-accesses.service.mock.ts +++ b/src/app/shared/mocks/section-accesses.service.mock.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SubmissionFormsModel } from '../../core/config/models/config-submission-forms.model'; @@ -9,6 +9,6 @@ const dataRes = Object.assign(new SubmissionFormsModel(), { export function getSectionAccessesService() { return jasmine.createSpyObj('SectionAccessesService', { - getAccessesData: observableOf(dataRes), + getAccessesData: of(dataRes), }); } diff --git a/src/app/shared/mocks/suggestion.mock.ts b/src/app/shared/mocks/suggestion.mock.ts index ff98426c37..bceaa93368 100644 --- a/src/app/shared/mocks/suggestion.mock.ts +++ b/src/app/shared/mocks/suggestion.mock.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; @@ -1352,10 +1352,10 @@ export function getMockSuggestionsService(): any { deleteReviewedSuggestion: jasmine.createSpy('deleteReviewedSuggestion'), retrieveCurrentUserSuggestions: jasmine.createSpy('retrieveCurrentUserSuggestions'), getTargetUuid: jasmine.createSpy('getTargetUuid'), - ignoreSuggestion: observableOf(null), - ignoreSuggestionMultiple: observableOf({ success: 1, fails: 0 }), - approveAndImportMultiple: observableOf({ success: 1, fails: 0 }), - approveAndImport: observableOf({ id: '1234' }), + ignoreSuggestion: of(null), + ignoreSuggestionMultiple: of({ success: 1, fails: 0 }), + approveAndImportMultiple: of({ success: 1, fails: 0 }), + approveAndImport: of({ id: '1234' }), isCollectionFixed: false, translateSuggestionSource: 'testSource', translateSuggestionType: 'testType', diff --git a/src/app/shared/mocks/theme-service.mock.ts b/src/app/shared/mocks/theme-service.mock.ts index 44d889c025..cefed00568 100644 --- a/src/app/shared/mocks/theme-service.mock.ts +++ b/src/app/shared/mocks/theme-service.mock.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ThemeConfig } from '../../../config/theme.config'; import { isNotEmpty } from '../empty.util'; @@ -7,7 +7,7 @@ import { ThemeService } from '../theme-support/theme.service'; export function getMockThemeService(themeName = 'base', themes?: ThemeConfig[]): ThemeService { const spy = jasmine.createSpyObj('themeService', { getThemeName: themeName, - getThemeName$: observableOf(themeName), + getThemeName$: of(themeName), getThemeConfigFor: undefined, listenForRouteChanges: undefined, }); diff --git a/src/app/shared/mocks/translate-loader.mock.ts b/src/app/shared/mocks/translate-loader.mock.ts index ea1ee7528e..2c636caab2 100644 --- a/src/app/shared/mocks/translate-loader.mock.ts +++ b/src/app/shared/mocks/translate-loader.mock.ts @@ -1,11 +1,11 @@ import { TranslateLoader } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; export class TranslateLoaderMock implements TranslateLoader { getTranslation(lang: string): Observable { - return observableOf({}); + return of({}); } } diff --git a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts index c890abaa1f..c05b778a57 100644 --- a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts @@ -14,7 +14,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../../core/data/request.service'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -44,13 +44,13 @@ let mockWorkflowItemDataService: WorkflowItemDataService; describe('ClaimedTaskActionsApproveComponent', () => { const object = Object.assign(new ClaimedTask(), { id: 'claimed-task-1' }); const claimedTaskService = jasmine.createSpyObj('claimedTaskService', { - submitTask: observableOf(new ProcessTaskResponse(true)), + submitTask: of(new ProcessTaskResponse(true)), }); beforeEach(waitForAsync(() => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); mockWorkflowItemDataService = jasmine.createSpyObj('WorkflowItemDataService', { - 'invalidateByHref': observableOf(false), + 'invalidateByHref': of(false), }); TestBed.configureTestingModule({ @@ -107,7 +107,7 @@ describe('ClaimedTaskActionsApproveComponent', () => { beforeEach(() => { spyOn(component.processCompleted, 'emit'); - spyOn(component, 'startActionExecution').and.returnValue(observableOf(null)); + spyOn(component, 'startActionExecution').and.returnValue(of(null)); expectedBody = { [component.option]: 'true', diff --git a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts index 8d56f55cbd..aec2aff282 100644 --- a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts @@ -31,7 +31,12 @@ export const WORKFLOW_TASK_OPTION_APPROVE = 'submit_approve'; styleUrls: ['./claimed-task-actions-approve.component.scss'], templateUrl: './claimed-task-actions-approve.component.html', standalone: true, - imports: [NgbTooltipModule, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + NgbTooltipModule, + TranslateModule, + ], }) /** * Component for displaying and processing the approve action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index 7db5b59e21..cc0506b26d 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; @@ -69,7 +69,7 @@ function init() { requestServce = getMockRequestService(); item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -98,9 +98,9 @@ function init() { }, }); rdItem = createSuccessfulRemoteDataObject(item); - workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem), id: '333' }); + workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem), id: '333' }); rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); - mockObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); + mockObject = Object.assign(new ClaimedTask(), { workflowitem: of(rdWorkflowitem), id: '1234' }); workflowAction = Object.assign(new WorkflowAction(), { id: 'action-1', options: ['option-1', 'option-2'] }); workflowActionService = jasmine.createSpyObj('workflowActionService', { diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts index 2cc71bfc74..1545ec9377 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts @@ -39,7 +39,14 @@ import { ClaimedTaskActionsLoaderComponent } from './switcher/claimed-task-actio styleUrls: ['./claimed-task-actions.component.scss'], templateUrl: './claimed-task-actions.component.html', standalone: true, - imports: [VarDirective, ClaimedTaskActionsLoaderComponent, NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ClaimedTaskActionsLoaderComponent, + NgbTooltipModule, + RouterLink, + TranslateModule, + VarDirective, + ], }) export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent implements OnInit { diff --git a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts index 8e8d1ebc50..421e8ab83c 100644 --- a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts @@ -11,7 +11,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RemoteData } from 'src/app/core/data/remote-data'; @@ -30,7 +30,12 @@ export const WORKFLOW_TASK_OPTION_DECLINE_TASK = 'submit_decline_task'; templateUrl: './claimed-task-actions-decline-task.component.html', styleUrls: ['./claimed-task-actions-decline-task.component.scss'], standalone: true, - imports: [NgbTooltipModule, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + NgbTooltipModule, + TranslateModule, + ], }) /** * Component for displaying and processing the decline task action on a workflow task item @@ -47,7 +52,7 @@ export class ClaimedTaskActionsDeclineTaskComponent extends ClaimedTaskActionsAb } reloadObjectExecution(): Observable | DSpaceObject> { - return observableOf(this.object); + return of(this.object); } convertReloadedObject(dso: DSpaceObject): DSpaceObject { diff --git a/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts b/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts index 5d2a80830a..78871ce57a 100644 --- a/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts @@ -25,7 +25,12 @@ export const WORKFLOW_TASK_OPTION_EDIT_METADATA = 'submit_edit_metadata'; styleUrls: ['./claimed-task-actions-edit-metadata.component.scss'], templateUrl: './claimed-task-actions-edit-metadata.component.html', standalone: true, - imports: [NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + RouterLink, + TranslateModule, + ], }) /** * Component for displaying the edit metadata action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts index 9fc8f5e289..6c0af3fe61 100644 --- a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts @@ -10,7 +10,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../../core/data/request.service'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -32,7 +32,7 @@ const workflowId = 'workflow-1'; describe('AdvancedClaimedTaskActionRatingComponent', () => { const object = Object.assign(new ClaimedTask(), { id: taskId, - workflowitem: observableOf(Object.assign(new WorkflowItem(), { + workflowitem: of(Object.assign(new WorkflowItem(), { id: workflowId, })), }); diff --git a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts index a29253c023..bb58baa8b0 100644 --- a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts @@ -26,7 +26,10 @@ import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advance templateUrl: './advanced-claimed-task-action-rating.component.html', styleUrls: ['./advanced-claimed-task-action-rating.component.scss'], standalone: true, - imports: [NgbTooltipModule, TranslateModule], + imports: [ + NgbTooltipModule, + TranslateModule, + ], }) export class AdvancedClaimedTaskActionRatingComponent extends AdvancedClaimedTaskActionsAbstractComponent { diff --git a/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts b/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts index 02e7d9e469..f8f7534987 100644 --- a/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts @@ -42,7 +42,14 @@ export const WORKFLOW_TASK_OPTION_REJECT = 'submit_reject'; styleUrls: ['./claimed-task-actions-reject.component.scss'], templateUrl: './claimed-task-actions-reject.component.html', standalone: true, - imports: [NgbTooltipModule, FormsModule, ReactiveFormsModule, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + FormsModule, + NgbTooltipModule, + ReactiveFormsModule, + TranslateModule, + ], }) /** * Component for displaying and processing the reject action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts b/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts index 40e75324de..1b99fa2cc8 100644 --- a/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts @@ -28,7 +28,12 @@ export const WORKFLOW_TASK_OPTION_RETURN_TO_POOL = 'return_to_pool'; styleUrls: ['./claimed-task-actions-return-to-pool.component.scss'], templateUrl: './claimed-task-actions-return-to-pool.component.html', standalone: true, - imports: [NgbTooltipModule, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + NgbTooltipModule, + TranslateModule, + ], }) /** * Component for displaying and processing the return to pool action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts index b8a1de8a6d..61d595d2c5 100644 --- a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts @@ -10,7 +10,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../../core/data/request.service'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -33,7 +33,7 @@ const workflowId = 'workflow-1'; describe('AdvancedClaimedTaskActionSelectReviewerComponent', () => { const object = Object.assign(new ClaimedTask(), { id: taskId, - workflowitem: observableOf(Object.assign(new WorkflowItem(), { + workflowitem: of(Object.assign(new WorkflowItem(), { id: workflowId, })), }); diff --git a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts index d892642da7..c1179c5454 100644 --- a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts @@ -26,7 +26,10 @@ import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advance templateUrl: './advanced-claimed-task-action-select-reviewer.component.html', styleUrls: ['./advanced-claimed-task-action-select-reviewer.component.scss'], standalone: true, - imports: [NgbTooltipModule, TranslateModule], + imports: [ + NgbTooltipModule, + TranslateModule, + ], }) export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedClaimedTaskActionsAbstractComponent { diff --git a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts index 4efbc01e48..0e9f8ab3d3 100644 --- a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts @@ -19,7 +19,9 @@ import { getComponentByWorkflowTaskOption } from './claimed-task-actions-decorat selector: 'ds-claimed-task-actions-loader', templateUrl: '../../../abstract-component-loader/abstract-component-loader.component.html', standalone: true, - imports: [ DynamicComponentLoaderDirective ], + imports: [ + DynamicComponentLoaderDirective, + ], }) /** * Component for loading a ClaimedTaskAction component depending on the "option" input diff --git a/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts b/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts index 066ec3df29..ef7ecb7082 100644 --- a/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts @@ -16,7 +16,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RequestService } from '../../../core/data/request.service'; @@ -38,7 +38,7 @@ let mockObject: Item; const mockDataService = {}; mockObject = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/shared/mydspace-actions/item/item-actions.component.ts b/src/app/shared/mydspace-actions/item/item-actions.component.ts index 469637b32e..e1bdff3cfc 100644 --- a/src/app/shared/mydspace-actions/item/item-actions.component.ts +++ b/src/app/shared/mydspace-actions/item/item-actions.component.ts @@ -30,7 +30,11 @@ import { MyDSpaceActionsComponent } from '../mydspace-actions'; styleUrls: ['./item-actions.component.scss'], templateUrl: './item-actions.component.html', standalone: true, - imports: [NgbTooltipModule, RouterLink, TranslateModule], + imports: [ + NgbTooltipModule, + RouterLink, + TranslateModule, + ], }) export class ItemActionsComponent extends MyDSpaceActionsComponent implements OnInit { diff --git a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts index b7a0a20219..5850e2969d 100644 --- a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts +++ b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts @@ -16,7 +16,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../core/data/request.service'; import { Item } from '../../core/shared/item.model'; @@ -54,7 +54,7 @@ const searchService = getMockSearchService(); const requestService = getMockRequestService(); const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -83,9 +83,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); +mockObject = Object.assign(new PoolTask(), { workflowitem: of(rdWorkflowitem), id: '1234' }); describe('MyDSpaceReloadableActionsComponent', () => { beforeEach(fakeAsync(() => { @@ -166,9 +166,9 @@ describe('MyDSpaceReloadableActionsComponent', () => { remoteClaimTaskErrorResponse = new ProcessTaskResponse(false, null, null); const remoteReloadedObjectResponse: any = createSuccessfulRemoteDataObject(new PoolTask()); - spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(observableOf(poolTaskHref)); - spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(observableOf(remoteReloadedObjectResponse)); - spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(observableOf(remoteClaimTaskErrorResponse)); + spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(of(poolTaskHref)); + spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(of(remoteReloadedObjectResponse)); + spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(of(remoteClaimTaskErrorResponse)); spyOn(component, 'reloadObjectExecution').and.callThrough(); spyOn(component.processCompleted, 'emit').and.callThrough(); @@ -213,9 +213,9 @@ describe('MyDSpaceReloadableActionsComponent', () => { const remoteClaimTaskResponse: any = new ProcessTaskResponse(true, null, null); const remoteReloadedObjectResponse: any = createSuccessfulRemoteDataObject(new PoolTask()); - spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(observableOf(poolTaskHref)); - spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(observableOf(remoteReloadedObjectResponse)); - spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(observableOf(remoteClaimTaskResponse)); + spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(of(poolTaskHref)); + spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(of(remoteReloadedObjectResponse)); + spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(of(remoteClaimTaskResponse)); spyOn(component, 'reloadObjectExecution').and.callThrough(); spyOn(component, 'convertReloadedObject').and.callThrough(); spyOn(component.processCompleted, 'emit').and.callThrough(); @@ -261,9 +261,9 @@ describe('MyDSpaceReloadableActionsComponent', () => { const remoteClaimTaskResponse: any = new ProcessTaskResponse(true, null, null); const remoteReloadedObjectResponse: any = createFailedRemoteDataObject(); - spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(observableOf(poolTaskHref)); - spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(observableOf(remoteReloadedObjectResponse)); - spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(observableOf(remoteClaimTaskResponse)); + spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(of(poolTaskHref)); + spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(of(remoteReloadedObjectResponse)); + spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(of(remoteClaimTaskResponse)); spyOn(component, 'convertReloadedObject').and.returnValue(null); spyOn(component, 'reload').and.returnValue(null); diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts index c469b91cc4..73ad4f8a96 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; import { Item } from '../../../core/shared/item.model'; @@ -53,7 +53,7 @@ const searchService = getMockSearchService(); const requestService = getMockRequestService(); const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -82,9 +82,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem), id: '1234' }); +mockObject = Object.assign(new PoolTask(), { workflowitem: of(rdWorkflowitem), id: '1234' }); describe('PoolTaskActionsComponent', () => { beforeEach(waitForAsync(() => { @@ -161,9 +161,9 @@ describe('PoolTaskActionsComponent', () => { const remoteClaimTaskResponse: any = new ProcessTaskResponse(true, null, null); const remoteReloadedObjectResponse: any = createSuccessfulRemoteDataObject(new PoolTask()); - spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(observableOf(poolTaskHref)); - spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(observableOf(remoteClaimTaskResponse)); - spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(observableOf(remoteReloadedObjectResponse)); + spyOn(mockDataService, 'getPoolTaskEndpointById').and.returnValue(of(poolTaskHref)); + spyOn(mockClaimedTaskDataService, 'claimTask').and.returnValue(of(remoteClaimTaskResponse)); + spyOn(mockClaimedTaskDataService, 'findByItem').and.returnValue(of(remoteReloadedObjectResponse)); (component as any).objectDataService = mockDataService; diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts index 18941b1a6c..98f39c0b48 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts @@ -43,7 +43,13 @@ import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actio styleUrls: ['./pool-task-actions.component.scss'], templateUrl: './pool-task-actions.component.html', standalone: true, - imports: [NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + NgbTooltipModule, + RouterLink, + TranslateModule, + ], }) export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent implements OnDestroy { diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts index 1662a946d7..9feb9a0d97 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; import { Item } from '../../../core/shared/item.model'; @@ -46,7 +46,7 @@ const searchService = getMockSearchService(); const requestServce = getMockRequestService(); const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -75,7 +75,7 @@ const item = Object.assign(new Item(), { }, }); const rd = createSuccessfulRemoteDataObject(item); -mockObject = Object.assign(new WorkflowItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); +mockObject = Object.assign(new WorkflowItem(), { item: of(rd), id: '1234', uuid: '1234' }); describe('WorkflowitemActionsComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts index 47972e6b5e..1f499551a4 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts @@ -29,7 +29,11 @@ import { MyDSpaceActionsComponent } from '../mydspace-actions'; styleUrls: ['./workflowitem-actions.component.scss'], templateUrl: './workflowitem-actions.component.html', standalone: true, - imports: [NgbTooltipModule, RouterLink, TranslateModule], + imports: [ + NgbTooltipModule, + RouterLink, + TranslateModule, + ], }) export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent { diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts index 12d00b27a7..95d86899c6 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts @@ -21,7 +21,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -62,7 +62,7 @@ const searchService = getMockSearchService(); const requestServce = getMockRequestService(); const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -91,7 +91,7 @@ const item = Object.assign(new Item(), { }, }); const rd = createSuccessfulRemoteDataObject(item); -mockObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd), id: '1234', uuid: '1234' }); +mockObject = Object.assign(new WorkspaceItem(), { item: of(rd), id: '1234', uuid: '1234' }); const ePersonMock: EPerson = Object.assign(new EPerson(), { handle: null, @@ -175,7 +175,7 @@ authService = jasmine.createSpyObj('authService', { describe('WorkspaceitemActionsComponent', () => { beforeEach(waitForAsync(async () => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); await TestBed.configureTestingModule({ imports: [ @@ -211,7 +211,7 @@ describe('WorkspaceitemActionsComponent', () => { component = fixture.componentInstance; component.object = mockObject; notificationsServiceStub = TestBed.inject(NotificationsService as any); - (authService.getAuthenticatedUserFromStore as jasmine.Spy).and.returnValue(observableOf(ePersonMock)); + (authService.getAuthenticatedUserFromStore as jasmine.Spy).and.returnValue(of(ePersonMock)); fixture.detectChanges(); }); @@ -247,7 +247,7 @@ describe('WorkspaceitemActionsComponent', () => { describe('on discard confirmation', () => { beforeEach((done) => { - mockDataService.delete.and.returnValue(observableOf(true)); + mockDataService.delete.and.returnValue(of(true)); spyOn(component, 'reload'); const btn = fixture.debugElement.query(By.css('.btn-danger')); btn.nativeElement.click(); diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts index 68f66b4986..ca35ced222 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -49,7 +49,12 @@ import { MyDSpaceActionsComponent } from '../mydspace-actions'; styleUrls: ['./workspaceitem-actions.component.scss'], templateUrl: './workspaceitem-actions.component.html', standalone: true, - imports: [NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + RouterLink, + TranslateModule, + ], }) export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent implements OnInit { diff --git a/src/app/shared/notification-box/notification-box.component.ts b/src/app/shared/notification-box/notification-box.component.ts index 56a63c44a5..4501e5f97d 100644 --- a/src/app/shared/notification-box/notification-box.component.ts +++ b/src/app/shared/notification-box/notification-box.component.ts @@ -20,8 +20,8 @@ import { listableObjectComponent } from '../object-collection/shared/listable-ob styleUrls: ['./notification-box.component.scss'], standalone: true, imports: [ - NgStyle, HoverClassDirective, + NgStyle, TranslateModule, ], }) diff --git a/src/app/shared/notifications/notification/notification.component.ts b/src/app/shared/notifications/notification/notification.component.ts index c56345534f..ac8123dae3 100644 --- a/src/app/shared/notifications/notification/notification.component.ts +++ b/src/app/shared/notifications/notification/notification.component.ts @@ -19,7 +19,7 @@ import { import { DomSanitizer } from '@angular/platform-browser'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { filter, @@ -91,7 +91,12 @@ import { NotificationsService } from '../notifications.service'; styleUrls: ['./notification.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [NgStyle, NgClass, NgTemplateOutlet, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + NgStyle, + NgTemplateOutlet, + ], }) export class NotificationComponent implements OnInit, OnDestroy { @@ -101,7 +106,7 @@ export class NotificationComponent implements OnInit, OnDestroy { /** * Whether this notification's countdown should be paused */ - @Input() public isPaused$: Observable = observableOf(false); + @Input() public isPaused$: Observable = of(false); // Progress bar variables public title: Observable; @@ -190,14 +195,14 @@ export class NotificationComponent implements OnInit, OnDestroy { let value = null; if (isNotEmpty(item)) { if (typeof item === 'string') { - value = observableOf(item); + value = of(item); } else if (item instanceof Observable) { value = item; } else if (typeof item === 'object' && isNotEmpty(item.value)) { // when notifications state is transferred from SSR to CSR, // Observables Object loses the instance type and become simply object, // so converts it again to Observable - value = observableOf(item.value); + value = of(item.value); } } this[key] = value; diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.ts b/src/app/shared/notifications/notifications-board/notifications-board.component.ts index 84843cf5d9..10fbe66fef 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.ts +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.ts @@ -16,7 +16,7 @@ import cloneDeep from 'lodash/cloneDeep'; import differenceWith from 'lodash/differenceWith'; import { BehaviorSubject, - of as observableOf, + of, Subscription, } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -42,7 +42,10 @@ import { notificationsStateSelector } from '../selectors'; styleUrls: ['./notifications-board.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [NgClass, NotificationComponent], + imports: [ + NgClass, + NotificationComponent, + ], }) export class NotificationsBoardComponent implements OnInit, OnDestroy { @@ -145,7 +148,7 @@ export class NotificationsBoardComponent implements OnInit, OnDestroy { } if (typeof content === 'string') { - content = observableOf(content); + content = of(content); } content.pipe( diff --git a/src/app/shared/notifications/notifications.service.spec.ts b/src/app/shared/notifications/notifications.service.spec.ts index 86ecdb663b..91eed633a8 100644 --- a/src/app/shared/notifications/notifications.service.spec.ts +++ b/src/app/shared/notifications/notifications.service.spec.ts @@ -11,7 +11,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { storeModuleConfig } from '../../app.reducer'; import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; @@ -30,7 +30,7 @@ import { NotificationsBoardComponent } from './notifications-board/notifications describe('NotificationsService test', () => { const store: Store = jasmine.createSpyObj('store', { dispatch: {}, - select: observableOf(true), + select: of(true), }); let service: NotificationsService; @@ -57,25 +57,25 @@ describe('NotificationsService test', () => { })); it('Success method should dispatch NewNotificationAction with proper parameter', () => { - const notification = service.success('Title', observableOf('Content')); + const notification = service.success('Title', of('Content')); expect(notification.type).toBe(NotificationType.Success); expect(store.dispatch).toHaveBeenCalledWith(new NewNotificationAction(notification)); }); it('Warning method should dispatch NewNotificationAction with proper parameter', () => { - const notification = service.warning('Title', observableOf('Content')); + const notification = service.warning('Title', of('Content')); expect(notification.type).toBe(NotificationType.Warning); expect(store.dispatch).toHaveBeenCalledWith(new NewNotificationAction(notification)); }); it('Info method should dispatch NewNotificationAction with proper parameter', () => { - const notification = service.info('Title', observableOf('Content')); + const notification = service.info('Title', of('Content')); expect(notification.type).toBe(NotificationType.Info); expect(store.dispatch).toHaveBeenCalledWith(new NewNotificationAction(notification)); }); it('Error method should dispatch NewNotificationAction with proper parameter', () => { - const notification = service.error('Title', observableOf('Content')); + const notification = service.error('Title', of('Content')); expect(notification.type).toBe(NotificationType.Error); expect(store.dispatch).toHaveBeenCalledWith(new NewNotificationAction(notification)); }); diff --git a/src/app/shared/notifications/notifications.service.ts b/src/app/shared/notifications/notifications.service.ts index 5f7939fd1c..b89762ab03 100644 --- a/src/app/shared/notifications/notifications.service.ts +++ b/src/app/shared/notifications/notifications.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import uniqueId from 'lodash/uniqueId'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { first } from 'rxjs/operators'; import { environment } from '../../../environments/environment'; @@ -30,8 +30,8 @@ export class NotificationsService { this.store.dispatch(notificationAction); } - success(title: any = observableOf(''), - content: any = observableOf(''), + success(title: any = of(''), + content: any = of(''), options: Partial = {}, html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; @@ -40,8 +40,8 @@ export class NotificationsService { return notification; } - error(title: any = observableOf(''), - content: any = observableOf(''), + error(title: any = of(''), + content: any = of(''), options: Partial = {}, html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; @@ -50,8 +50,8 @@ export class NotificationsService { return notification; } - info(title: any = observableOf(''), - content: any = observableOf(''), + info(title: any = of(''), + content: any = of(''), options: Partial = {}, html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; @@ -60,8 +60,8 @@ export class NotificationsService { return notification; } - warning(title: any = observableOf(''), - content: any = observableOf(''), + warning(title: any = of(''), + content: any = of(''), options: NotificationOptions = this.getDefaultOptions(), html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; diff --git a/src/app/shared/object-collection/object-collection.component.spec.ts b/src/app/shared/object-collection/object-collection.component.spec.ts index 9b1e3a0912..433fecc242 100644 --- a/src/app/shared/object-collection/object-collection.component.spec.ts +++ b/src/app/shared/object-collection/object-collection.component.spec.ts @@ -10,7 +10,7 @@ import { Router, } from '@angular/router'; import { provideMockStore } from '@ngrx/store/testing'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ViewMode } from '../../core/shared/view-mode.model'; import { getMockThemeService } from '../mocks/theme-service.mock'; @@ -28,7 +28,7 @@ describe('ObjectCollectionComponent', () => { const queryParam = 'test query'; const scopeParam = '7669c72a-3f2a-451f-a3b9-9210e7a4c02f'; const activatedRouteStub = { - queryParams: observableOf({ + queryParams: of({ query: queryParam, scope: scopeParam, }), @@ -60,7 +60,7 @@ describe('ObjectCollectionComponent', () => { }); it('should only show the grid component when the viewmode is set to grid', () => { - objectCollectionComponent.currentMode$ = observableOf(ViewMode.GridElement); + objectCollectionComponent.currentMode$ = of(ViewMode.GridElement); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('ds-object-grid'))).not.toBeNull(); @@ -68,7 +68,7 @@ describe('ObjectCollectionComponent', () => { }); it('should only show the list component when the viewmode is set to list', () => { - objectCollectionComponent.currentMode$ = observableOf(ViewMode.ListElement); + objectCollectionComponent.currentMode$ = of(ViewMode.ListElement); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('ds-object-list'))).not.toBeNull(); @@ -76,7 +76,7 @@ describe('ObjectCollectionComponent', () => { }); it('should set fallback placeholder font size during test', async () => { - objectCollectionComponent.currentMode$ = observableOf(ViewMode.ListElement); + objectCollectionComponent.currentMode$ = of(ViewMode.ListElement); fixture.detectChanges(); const comp = fixture.debugElement.query(By.css('ds-object-list')); diff --git a/src/app/shared/object-collection/object-collection.component.ts b/src/app/shared/object-collection/object-collection.component.ts index d44c0153b2..9a6c177590 100644 --- a/src/app/shared/object-collection/object-collection.component.ts +++ b/src/app/shared/object-collection/object-collection.component.ts @@ -52,7 +52,15 @@ import { ListableObject } from './shared/listable-object.model'; styleUrls: ['./object-collection.component.scss'], templateUrl: './object-collection.component.html', standalone: true, - imports: [ThemedObjectListComponent, NgClass, ObjectGridComponent, ObjectDetailComponent, AsyncPipe, ObjectTableComponent, ObjectGeospatialMapComponent], + imports: [ + AsyncPipe, + NgClass, + ObjectDetailComponent, + ObjectGeospatialMapComponent, + ObjectGridComponent, + ObjectTableComponent, + ThemedObjectListComponent, + ], }) export class ObjectCollectionComponent implements OnInit { /** diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index fc3ba0864a..88fcc4c3a1 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -8,7 +8,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -30,7 +30,10 @@ import { AccessStatusObject } from './access-status.model'; templateUrl: './access-status-badge.component.html', styleUrls: ['./access-status-badge.component.scss'], standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) /** * Component rendering the access status of an item as a badge @@ -101,7 +104,7 @@ export class AccessStatusBadgeComponent implements OnDestroy, OnInit { getFirstSucceededRemoteDataPayload(), map((accessStatus: AccessStatusObject) => hasValue(accessStatus.status) ? accessStatus.status : 'unknown'), map((status: string) => `access-status.${status.toLowerCase()}.listelement.badge`), - catchError(() => observableOf('access-status.unknown.listelement.badge')), + catchError(() => of('access-status.unknown.listelement.badge')), ); // stylesheet based on the access status value this.subs.push( @@ -125,12 +128,12 @@ export class AccessStatusBadgeComponent implements OnDestroy, OnInit { this.embargoDate$ = this.object.accessStatus.pipe( getFirstSucceededRemoteDataPayload(), map((accessStatus: AccessStatusObject) => hasValue(accessStatus.embargoDate) ? accessStatus.embargoDate : null), - catchError(() => observableOf(null)), + catchError(() => of(null)), ); this.subs.push( this.embargoDate$.pipe().subscribe((embargoDate: string) => { if (hasValue(embargoDate)) { - this.accessStatus$ = observableOf('embargo.listelement.badge'); + this.accessStatus$ = of('embargo.listelement.badge'); } }), ); diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts index 2fcf8346c6..10cf354548 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts @@ -15,7 +15,9 @@ import { AccessStatusBadgeComponent } from './access-status-badge.component'; styleUrls: [], templateUrl: '../../../../theme-support/themed.component.html', standalone: true, - imports: [AccessStatusBadgeComponent], + imports: [ + AccessStatusBadgeComponent, + ], }) export class ThemedAccessStatusBadgeComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/badges.component.ts b/src/app/shared/object-collection/shared/badges/badges.component.ts index df82dfe991..1196761ce0 100644 --- a/src/app/shared/object-collection/shared/badges/badges.component.ts +++ b/src/app/shared/object-collection/shared/badges/badges.component.ts @@ -32,7 +32,12 @@ const MY_DSPACE_STATUS_CONTEXTS = [ templateUrl: './badges.component.html', styleUrls: ['./badges.component.scss'], standalone: true, - imports: [ThemedStatusBadgeComponent, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent], + imports: [ + ThemedAccessStatusBadgeComponent, + ThemedMyDSpaceStatusBadgeComponent, + ThemedStatusBadgeComponent, + ThemedTypeBadgeComponent, + ], }) export class BadgesComponent { /** diff --git a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts index 1d53a9d763..2280c27ba5 100644 --- a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts @@ -12,7 +12,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Context } from '../../../../../core/shared/context.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; @@ -28,9 +28,9 @@ let fixture: ComponentFixture; let mockResultObject: PoolTask; const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock); -const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); +const workflowitem = Object.assign(new WorkflowItem(), { submitter: of(rdSumbitter) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject = Object.assign(new PoolTask(), { workflowitem: of(rdWorkflowitem) }); describe('MyDSpaceItemStatusComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts index b140e03b24..2b2483c038 100644 --- a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts @@ -14,7 +14,9 @@ import { Context } from 'src/app/core/shared/context.model'; styleUrls: ['./my-dspace-status-badge.component.scss'], templateUrl: './my-dspace-status-badge.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class MyDSpaceStatusBadgeComponent implements OnInit { diff --git a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts index af0fc17214..10fca3a9da 100644 --- a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts @@ -15,7 +15,9 @@ import { MyDSpaceStatusBadgeComponent } from './my-dspace-status-badge.component styleUrls: [], templateUrl: '../../../../theme-support/themed.component.html', standalone: true, - imports: [MyDSpaceStatusBadgeComponent], + imports: [ + MyDSpaceStatusBadgeComponent, + ], }) export class ThemedMyDSpaceStatusBadgeComponent extends ThemedComponent { @Input() context: Context; diff --git a/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts b/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts index eb9c372831..b757a460a6 100644 --- a/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts @@ -13,7 +13,9 @@ import { hasValue } from '../../../../empty.util'; selector: 'ds-base-status-badge', templateUrl: './status-badge.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * Component rendering the status of an item as a badge diff --git a/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts index 31eaaf1e28..34d735d063 100644 --- a/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts @@ -15,7 +15,9 @@ import { StatusBadgeComponent } from './status-badge.component'; styleUrls: [], templateUrl: '../../../../theme-support/themed.component.html', standalone: true, - imports: [StatusBadgeComponent], + imports: [ + StatusBadgeComponent, + ], }) export class ThemedStatusBadgeComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/themed-badges.component.ts b/src/app/shared/object-collection/shared/badges/themed-badges.component.ts index dbc9b45307..c1bb23f8cf 100644 --- a/src/app/shared/object-collection/shared/badges/themed-badges.component.ts +++ b/src/app/shared/object-collection/shared/badges/themed-badges.component.ts @@ -16,12 +16,14 @@ import { BadgesComponent } from './badges.component'; styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [BadgesComponent], + imports: [ + BadgesComponent, + ], }) export class ThemedBadgesComponent extends ThemedComponent { @Input() object: DSpaceObject; @Input() context: Context; - @Input() showAccessStatus = false; + @Input() showAccessStatus: boolean; protected inAndOutputNames: (keyof BadgesComponent & keyof this)[] = ['object', 'context', 'showAccessStatus']; diff --git a/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts b/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts index 9d8540216b..e3b7a871df 100644 --- a/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts @@ -15,7 +15,9 @@ import { TypeBadgeComponent } from './type-badge.component'; styleUrls: [], templateUrl: '../../../../theme-support/themed.component.html', standalone: true, - imports: [TypeBadgeComponent], + imports: [ + TypeBadgeComponent, + ], }) export class ThemedTypeBadgeComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts index 8fc0d9762b..7d0a7ef027 100644 --- a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; import { TruncatePipe } from '../../../../utils/truncate.pipe'; @@ -21,7 +21,7 @@ let fixture: ComponentFixture; const type = 'authorOfPublication'; const mockItemWithEntityType = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dspace.entity.type': [ { @@ -33,7 +33,7 @@ const mockItemWithEntityType = Object.assign(new Item(), { }); const mockItemWithoutEntityType = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts index 0cc00397a9..6da46dd176 100644 --- a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts @@ -16,7 +16,9 @@ import { selector: 'ds-base-type-badge', templateUrl: './type-badge.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * Component rendering the type of an item as a badge diff --git a/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts b/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts index 6862559ba3..1a5b334bd9 100644 --- a/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts +++ b/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts @@ -12,7 +12,9 @@ import { ListableObject } from '../listable-object.model'; selector: 'ds-importable-list-item-control', templateUrl: './importable-list-item-control.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * Component adding an import button to a list item diff --git a/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts b/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts index ef5a32f5fb..5cd1ff979a 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts @@ -32,7 +32,11 @@ import { followLink } from '../../../utils/follow-link-config.model'; styleUrls: ['./item-collection.component.scss'], templateUrl: './item-collection.component.html', standalone: true, - imports: [RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + TranslateModule, + ], }) export class ItemCollectionComponent implements OnInit { diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts index 26388cde60..42a106e478 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts @@ -14,7 +14,7 @@ import { TranslateModule, } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; @@ -30,9 +30,9 @@ let fixture: ComponentFixture; let mockResultObject: PoolTask; const rdSumbitter = createSuccessfulRemoteDataObject(EPersonMock); -const workflowitem = Object.assign(new WorkflowItem(), { submitter: observableOf(rdSumbitter) }); +const workflowitem = Object.assign(new WorkflowItem(), { submitter: of(rdSumbitter) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject = Object.assign(new PoolTask(), { workflowitem: of(rdWorkflowitem) }); describe('ItemSubmitterComponent', () => { beforeEach(waitForAsync(() => { @@ -72,7 +72,7 @@ describe('ItemSubmitterComponent', () => { }); it('should show N/A when submitter is null', () => { - component.submitter$ = observableOf(null); + component.submitter$ = of(null); fixture.detectChanges(); const badge: DebugElement = fixture.debugElement.query(By.css('.badge')); diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts index de44ce0ddb..431455eea2 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts @@ -31,7 +31,10 @@ import { followLink } from '../../../utils/follow-link-config.model'; styleUrls: ['./item-submitter.component.scss'], templateUrl: './item-submitter.component.html', standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) export class ItemSubmitterComponent implements OnInit { diff --git a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts index 8ed4a593ec..a9d057ae26 100644 --- a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts +++ b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../core/shared/item.model'; import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; @@ -44,8 +44,8 @@ describe('SelectableListItemControlComponent', () => { selectionService = jasmine.createSpyObj('selectionService', { selectSingle: jasmine.createSpy('selectSingle'), deselectSingle: jasmine.createSpy('deselectSingle'), - isObjectSelected: observableOf(true), - getSelectableList: observableOf({ selection }), + isObjectSelected: of(true), + getSelectableList: of({ selection }), }, ); } diff --git a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts index 7466da5967..c8d1fd2ce4 100644 --- a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts +++ b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts @@ -24,7 +24,12 @@ import { ListableObject } from '../listable-object.model'; // styleUrls: ['./selectable-list-item-control.component.scss'], templateUrl: './selectable-list-item-control.component.html', standalone: true, - imports: [VarDirective, FormsModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FormsModule, + TranslateModule, + VarDirective, + ], }) /** * Component for rendering list item that has a control (checkbox or radio button) because it's selectable diff --git a/src/app/shared/object-collection/shared/tabulatable-objects/tabulatable-objects-loader.component.ts b/src/app/shared/object-collection/shared/tabulatable-objects/tabulatable-objects-loader.component.ts index 5375d92f50..f1eb604493 100644 --- a/src/app/shared/object-collection/shared/tabulatable-objects/tabulatable-objects-loader.component.ts +++ b/src/app/shared/object-collection/shared/tabulatable-objects/tabulatable-objects-loader.component.ts @@ -14,7 +14,7 @@ import { import { combineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -183,7 +183,7 @@ export class TabulatableObjectsLoaderComponent implements OnInit, OnChanges, OnD if ((this.compRef.instance as any).reloadedObject) { combineLatest([ - observableOf(changes), + of(changes), (this.compRef.instance as any).reloadedObject.pipe(take(1)) as Observable>, ]).subscribe(([simpleChanges, reloadedObjects]: [SimpleChanges, PaginatedList]) => { if (reloadedObjects) { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts index 8bebd8834d..06fe04bfe8 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; @@ -39,7 +39,7 @@ const mockResultObject: ClaimedTaskSearchResult = new ClaimedTaskSearchResult(); mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -68,9 +68,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { remove: jasmine.createSpy('remove'), diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts index 482550c3f1..976da4ca52 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts @@ -43,7 +43,11 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem styleUrls: ['../search-result-detail-element.component.scss'], templateUrl: './claimed-task-search-result-detail-element.component.html', standalone: true, - imports: [ItemDetailPreviewComponent, ClaimedTaskActionsComponent, AsyncPipe], + imports: [ + AsyncPipe, + ClaimedTaskActionsComponent, + ItemDetailPreviewComponent, + ], }) @listableObjectComponent(ClaimedTaskSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts index 93a244a95a..e32774fe75 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; import { TranslateLoaderMock } from '../../../../mocks/translate-loader.mock'; @@ -24,7 +24,7 @@ let component: ItemDetailPreviewFieldComponent; let fixture: ComponentFixture; const mockItemWithAuthorAndDate: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.contributor.author': [ { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts index ebb283728a..7daf5cac93 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts @@ -15,7 +15,9 @@ import { ItemDetailPreviewFieldComponent } from './item-detail-preview-field.com selector: 'ds-item-detail-preview-field', templateUrl: '../../../../theme-support/themed.component.html', standalone: true, - imports: [ItemDetailPreviewFieldComponent], + imports: [ + ItemDetailPreviewFieldComponent, + ], }) export class ThemedItemDetailPreviewFieldComponent extends ThemedComponent { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts index cead47a179..31c228d162 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts @@ -38,7 +38,18 @@ import { ThemedItemDetailPreviewFieldComponent } from './item-detail-preview-fie templateUrl: './item-detail-preview.component.html', animations: [fadeInOut], standalone: true, - imports: [ThemedBadgesComponent, ThemedItemPageTitleFieldComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, VarDirective, ThemedItemDetailPreviewFieldComponent, ItemSubmitterComponent, AsyncPipe, FileSizePipe, TranslateModule], + imports: [ + AsyncPipe, + FileSizePipe, + ItemSubmitterComponent, + MetadataFieldWrapperComponent, + ThemedBadgesComponent, + ThemedItemDetailPreviewFieldComponent, + ThemedItemPageTitleFieldComponent, + ThemedThumbnailComponent, + TranslateModule, + VarDirective, + ], }) export class ItemDetailPreviewComponent implements OnChanges { /** diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts index eac6663140..fb4106f69d 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts @@ -8,7 +8,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Context } from '../../../../core/shared/context.model'; @@ -28,7 +28,7 @@ const mockResultObject: ItemSearchResult = new ItemSearchResult(); mockResultObject.hitHighlights = {}; mockResultObject.indexableObject = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts index 29ff35e895..6ef18dd511 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts @@ -17,7 +17,10 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem styleUrls: ['../search-result-detail-element.component.scss', './item-search-result-detail-element.component.scss'], templateUrl: './item-search-result-detail-element.component.html', standalone: true, - imports: [ItemDetailPreviewComponent, ItemActionsComponent], + imports: [ + ItemActionsComponent, + ItemDetailPreviewComponent, + ], }) @listableObjectComponent(ItemSearchResult, ViewMode.DetailedListElement, Context.Workspace) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts index a31b8c7648..f4a9da6953 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Context } from 'src/app/core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -39,7 +39,7 @@ const mockResultObject: PoolTaskSearchResult = new PoolTaskSearchResult(); mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -68,9 +68,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { remove: jasmine.createSpy('remove'), diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts index 7b0884f2ce..fff20d7a72 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts @@ -43,7 +43,11 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem styleUrls: ['../search-result-detail-element.component.scss'], templateUrl: './pool-search-result-detail-element.component.html', standalone: true, - imports: [ItemDetailPreviewComponent, PoolTaskActionsComponent, AsyncPipe], + imports: [ + AsyncPipe, + ItemDetailPreviewComponent, + PoolTaskActionsComponent, + ], }) @listableObjectComponent(PoolTaskSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts index 50d70943fd..bfa7fc9fe5 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts @@ -8,7 +8,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; @@ -33,7 +33,7 @@ mockResultObject.hitHighlights = {}; const linkService = getMockLinkService(); const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -62,7 +62,7 @@ const item = Object.assign(new Item(), { }, }); const rd = createSuccessfulRemoteDataObject(item); -mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: of(rd) }); describe('WorkflowItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts index 1453d9246e..a8f649d9e0 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts @@ -28,7 +28,10 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem styleUrls: ['../search-result-detail-element.component.scss'], templateUrl: './workflow-item-search-result-detail-element.component.html', standalone: true, - imports: [ItemDetailPreviewComponent, WorkflowitemActionsComponent], + imports: [ + ItemDetailPreviewComponent, + WorkflowitemActionsComponent, + ], }) @listableObjectComponent(WorkflowItemSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts index 40e83ed774..1c5d6beb7d 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts @@ -8,7 +8,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Context } from 'src/app/core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -33,7 +33,7 @@ mockResultObject.hitHighlights = {}; const linkService = getMockLinkService(); const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -62,7 +62,7 @@ const item = Object.assign(new Item(), { }, }); const rd = createSuccessfulRemoteDataObject(item); -mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: of(rd) }); describe('WorkspaceItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts index b88cef64b5..5318320bfa 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts @@ -28,7 +28,10 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem styleUrls: ['../search-result-detail-element.component.scss', './workspace-item-search-result-detail-element.component.scss'], templateUrl: './workspace-item-search-result-detail-element.component.html', standalone: true, - imports: [ItemDetailPreviewComponent, WorkspaceitemActionsComponent], + imports: [ + ItemDetailPreviewComponent, + WorkspaceitemActionsComponent, + ], }) @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/object-detail.component.ts b/src/app/shared/object-detail/object-detail.component.ts index 67037aa6bd..174b3b0dab 100644 --- a/src/app/shared/object-detail/object-detail.component.ts +++ b/src/app/shared/object-detail/object-detail.component.ts @@ -37,7 +37,13 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o templateUrl: './object-detail.component.html', animations: [fadeIn], standalone: true, - imports: [PaginationComponent, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, TranslateModule], + imports: [ + ErrorComponent, + ListableObjectComponentLoaderComponent, + PaginationComponent, + ThemedLoadingComponent, + TranslateModule, + ], }) export class ObjectDetailComponent { /** diff --git a/src/app/shared/object-geospatial-map/object-geospatial-map.component.ts b/src/app/shared/object-geospatial-map/object-geospatial-map.component.ts index e27d91c456..b194b5e9c8 100644 --- a/src/app/shared/object-geospatial-map/object-geospatial-map.component.ts +++ b/src/app/shared/object-geospatial-map/object-geospatial-map.component.ts @@ -33,7 +33,10 @@ import { parseGeoJsonFromMetadataValue } from '../utils/geospatial.functions'; templateUrl: './object-geospatial-map.component.html', animations: [fadeIn], standalone: true, - imports: [ GeospatialMapComponent, NgIf ], + imports: [ + GeospatialMapComponent, + NgIf, + ], }) /** diff --git a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts index 92df8ae9af..f7bad5ec75 100644 --- a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts +++ b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts @@ -27,7 +27,12 @@ import { followLink } from '../../utils/follow-link-config.model'; styleUrls: ['./collection-grid-element.component.scss'], templateUrl: './collection-grid-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedThumbnailComponent, + TranslateModule, + ], }) @listableObjectComponent(Collection, ViewMode.GridElement) export class CollectionGridElementComponent extends AbstractListableElementComponent< diff --git a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts index 2b4a028dc3..9ad7aaba75 100644 --- a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts +++ b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts @@ -27,7 +27,12 @@ import { followLink } from '../../utils/follow-link-config.model'; styleUrls: ['./community-grid-element.component.scss'], templateUrl: './community-grid-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedThumbnailComponent, + TranslateModule, + ], }) @listableObjectComponent(Community, ViewMode.GridElement) diff --git a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts index d1521c1989..7dcf196992 100644 --- a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { buildPaginatedList } from '../../../../../core/data/paginated-list.model'; @@ -58,7 +58,7 @@ describe('ItemGridElementComponent', () => { let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; beforeEach(waitForAsync(() => { diff --git a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts index e10ba86a9f..67b68195a3 100644 --- a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts +++ b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts @@ -15,7 +15,9 @@ import { ItemSearchResultGridElementComponent } from '../../../search-result-gri templateUrl: './item-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [ItemSearchResultGridElementComponent], + imports: [ + ItemSearchResultGridElementComponent, + ], }) /** * The component for displaying a grid element for an item of the type Publication diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index 25e42d5231..b055a5188a 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -54,7 +54,15 @@ import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; templateUrl: './object-grid.component.html', animations: [fadeIn], standalone: true, - imports: [PaginationComponent, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + ErrorComponent, + ListableObjectComponentLoaderComponent, + PaginationComponent, + ThemedLoadingComponent, + TranslateModule, + ], }) export class ObjectGridComponent implements OnInit { diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts index bfec6ebeac..0d879d7749 100644 --- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts @@ -12,7 +12,7 @@ import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../../core/auth/auth.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; @@ -39,7 +39,7 @@ let collectionSearchResultGridElementComponent: CollectionSearchResultGridElemen let fixture: ComponentFixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; const mockCollectionWithAbstract: CollectionSearchResult = new CollectionSearchResult(); diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts index 0e797175ba..3c22a15201 100644 --- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts @@ -28,7 +28,13 @@ import { SearchResultGridElementComponent } from '../search-result-grid-element. styleUrls: ['../search-result-grid-element.component.scss', 'collection-search-result-grid-element.component.scss'], templateUrl: 'collection-search-result-grid-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * Component representing a grid element for a collection search result diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts index 86d757a030..2a3105232a 100644 --- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts @@ -12,7 +12,7 @@ import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../../../core/auth/auth.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; @@ -42,7 +42,7 @@ let communitySearchResultGridElementComponent: CommunitySearchResultGridElementC let fixture: ComponentFixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; const mockCommunityWithAbstract: CommunitySearchResult = new CommunitySearchResult(); diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts index 9845ec10d5..1c7c961bb1 100644 --- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts @@ -31,7 +31,13 @@ import { SearchResultGridElementComponent } from '../search-result-grid-element. ], templateUrl: 'community-search-result-grid-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) /** * Component representing a grid element for a community search result diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts index d5c8ea42e8..86a4464082 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts @@ -14,7 +14,7 @@ import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; @@ -219,7 +219,7 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet let fixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; const mockBitstreamDataService = { diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts index 02b48d7e78..22df63e22b 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts @@ -29,7 +29,15 @@ import { SearchResultGridElementComponent } from '../../search-result-grid-eleme templateUrl: './item-search-result-grid-element.component.html', animations: [focusShadow], standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a grid element for an item search result of the type Publication diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts index 48887d59c3..ced169c741 100644 --- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts +++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; @@ -38,7 +38,7 @@ function init() { }); routeService = jasmine.createSpyObj('routeService', { - getQueryParameterValue: observableOf('1'), + getQueryParameterValue: of('1'), }); } describe('BrowseEntryListElementComponent', () => { diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts index d3379aedc2..03b4441e42 100644 --- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts +++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts @@ -24,7 +24,10 @@ import { AbstractListableElementComponent } from '../../object-collection/shared styleUrls: ['./browse-entry-list-element.component.scss'], templateUrl: './browse-entry-list-element.component.html', standalone: true, - imports: [RouterLink, AsyncPipe], + imports: [ + AsyncPipe, + RouterLink, + ], }) /** diff --git a/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts b/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts index edfecd2dda..7dc0c32990 100644 --- a/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts +++ b/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts @@ -12,7 +12,9 @@ import { AbstractListableElementComponent } from '../../object-collection/shared styleUrls: ['./collection-list-element.component.scss'], templateUrl: './collection-list-element.component.html', standalone: true, - imports: [RouterLink], + imports: [ + RouterLink, + ], }) /** * Component representing list element for a collection diff --git a/src/app/shared/object-list/community-list-element/community-list-element.component.ts b/src/app/shared/object-list/community-list-element/community-list-element.component.ts index c4ff30e268..af13d65cf7 100644 --- a/src/app/shared/object-list/community-list-element/community-list-element.component.ts +++ b/src/app/shared/object-list/community-list-element/community-list-element.component.ts @@ -13,7 +13,9 @@ import { AbstractListableElementComponent } from '../../object-collection/shared styleUrls: ['./community-list-element.component.scss'], templateUrl: './community-list-element.component.html', standalone: true, - imports: [RouterLink], + imports: [ + RouterLink, + ], }) /** * Component representing a list element for a community diff --git a/src/app/shared/object-list/identifier-data/identifier-data.component.ts b/src/app/shared/object-list/identifier-data/identifier-data.component.ts index 9c970c2934..79abef538a 100644 --- a/src/app/shared/object-list/identifier-data/identifier-data.component.ts +++ b/src/app/shared/object-list/identifier-data/identifier-data.component.ts @@ -17,8 +17,8 @@ import { IdentifierData } from './identifier-data.model'; selector: 'ds-identifier-data', templateUrl: './identifier-data.component.html', imports: [ - TranslateModule, AsyncPipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts b/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts index e5b7d56f66..527c152141 100644 --- a/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts +++ b/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts @@ -7,7 +7,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment.test'; @@ -28,7 +28,7 @@ import { TruncatePipe } from '../../../../utils/truncate.pipe'; import { ItemListElementComponent } from './item-list-element.component'; const mockItem: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts b/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts index 356ed950d3..1b4491318d 100644 --- a/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts +++ b/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts @@ -17,7 +17,9 @@ import { LISTABLE_NOTIFICATION_OBJECT } from './listable-notification-object.res templateUrl: './listable-notification-object.component.html', styleUrls: ['./listable-notification-object.component.scss'], standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class ListableNotificationObjectComponent extends AbstractListableElementComponent { } diff --git a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts index 0c4b007bf0..167e27f7f3 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts @@ -9,7 +9,9 @@ import { MetadataRepresentationListElementComponent } from '../metadata-represen selector: 'ds-browse-link-metadata-list-element', templateUrl: './browse-link-metadata-list-element.component.html', standalone: true, - imports: [RouterLink], + imports: [ + RouterLink, + ], }) /** * A component for displaying MetadataRepresentation objects in the form of plain text diff --git a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts index d635bb5ca0..3da7570016 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts @@ -8,7 +8,9 @@ import { MetadataRepresentationListElementComponent } from '../metadata-represen selector: 'ds-item-metadata-list-element', templateUrl: './item-metadata-list-element.component.html', standalone: true, - imports: [ListableObjectComponentLoaderComponent], + imports: [ + ListableObjectComponentLoaderComponent, + ], }) /** * A component for displaying MetadataRepresentation objects in the form of items diff --git a/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts index 4976029573..0132f9b05b 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts @@ -9,7 +9,9 @@ import { MetadataRepresentationListElementComponent } from '../metadata-represen selector: 'ds-plain-text-metadata-list-element', templateUrl: './plain-text-metadata-list-element.component.html', standalone: true, - imports: [RouterLink], + imports: [ + RouterLink, + ], }) /** * A component for displaying MetadataRepresentation objects in the form of plain text diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts index ac5cedb530..5264509feb 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; @@ -37,7 +37,7 @@ const mockResultObject: ClaimedApprovedTaskSearchResult = new ClaimedApprovedTas mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -66,9 +66,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); describe('ClaimedApprovedSearchResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts index b1d8afd365..f3652137d6 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts @@ -35,7 +35,12 @@ import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-i styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], templateUrl: './claimed-approved-search-result-list-element.component.html', standalone: true, - imports: [ThemedItemListPreviewComponent, AsyncPipe, TranslateModule, VarDirective], + imports: [ + AsyncPipe, + ThemedItemListPreviewComponent, + TranslateModule, + VarDirective, + ], }) @listableObjectComponent(ClaimedApprovedTaskSearchResult, ViewMode.ListElement) export class ClaimedApprovedSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts index b3f45093ba..3d3d57b5d1 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; @@ -37,7 +37,7 @@ const mockResultObject: ClaimedDeclinedTaskSearchResult = new ClaimedDeclinedTas mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -66,9 +66,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); describe('ClaimedDeclinedSearchResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts index 6f2529b45f..9fcf09ab5e 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts @@ -35,7 +35,12 @@ import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-i styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], templateUrl: './claimed-declined-search-result-list-element.component.html', standalone: true, - imports: [ThemedItemListPreviewComponent, AsyncPipe, TranslateModule, VarDirective], + imports: [ + AsyncPipe, + ThemedItemListPreviewComponent, + TranslateModule, + VarDirective, + ], }) @listableObjectComponent(ClaimedDeclinedTaskSearchResult, ViewMode.ListElement) export class ClaimedDeclinedSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts index f0cf9e1b8e..900fd4ac83 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; @@ -36,7 +36,7 @@ const mockResultObject: ClaimedDeclinedTaskTaskSearchResult = new ClaimedDecline mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -65,9 +65,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); describe('ClaimedDeclinedTaskSearchResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts index 1d3b99c37f..5a760cf19c 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts @@ -35,7 +35,12 @@ import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-i styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], templateUrl: './claimed-declined-task-search-result-list-element.component.html', standalone: true, - imports: [ThemedItemListPreviewComponent, AsyncPipe, TranslateModule, VarDirective], + imports: [ + AsyncPipe, + ThemedItemListPreviewComponent, + TranslateModule, + VarDirective, + ], }) @listableObjectComponent(ClaimedDeclinedTaskTaskSearchResult, ViewMode.ListElement) export class ClaimedDeclinedTaskSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts index 669c9ab55b..4e087e8770 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts @@ -13,7 +13,7 @@ import { import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment'; @@ -65,12 +65,12 @@ const configurationDataService = jasmine.createSpyObj('configurationDataService' })), }); const duplicateDataServiceStub = { - findListByHref: () => observableOf(emptyList), + findListByHref: () => of(emptyList), findDuplicates: () => createSuccessfulRemoteDataObject$({}), }; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -99,9 +99,9 @@ const item = Object.assign(new Item(), { }, }); const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { remove: jasmine.createSpy('remove'), diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts index d3adc9b3ab..affa6e3605 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts @@ -58,7 +58,14 @@ import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], templateUrl: './claimed-search-result-list-element.component.html', standalone: true, - imports: [ThemedItemListPreviewComponent, NgClass, ClaimedTaskActionsComponent, AsyncPipe, TranslateModule, VarDirective], + imports: [ + AsyncPipe, + ClaimedTaskActionsComponent, + NgClass, + ThemedItemListPreviewComponent, + TranslateModule, + VarDirective, + ], }) @listableObjectComponent(ClaimedTaskSearchResult, ViewMode.ListElement) export class ClaimedSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts index 3576af2fb9..f56ce20fae 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { Item } from '../../../../core/shared/item.model'; @@ -31,7 +31,7 @@ let component: ItemListPreviewComponent; let fixture: ComponentFixture; const mockItemWithAuthorAndDate: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.contributor.author': [ { @@ -48,7 +48,7 @@ const mockItemWithAuthorAndDate: Item = Object.assign(new Item(), { }, }); const mockItemWithoutAuthorAndDate: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -65,7 +65,7 @@ const mockItemWithoutAuthorAndDate: Item = Object.assign(new Item(), { }, }); const mockItemWithEntityType: Item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts index 598080786f..7ccc988ec6 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts @@ -18,7 +18,9 @@ import { ItemListPreviewComponent } from './item-list-preview.component'; styleUrls: [], templateUrl: '../../../theme-support/themed.component.html', standalone: true, - imports: [ItemListPreviewComponent], + imports: [ + ItemListPreviewComponent, + ], }) export class ThemedItemListPreviewComponent extends ThemedComponent { protected inAndOutputNames: (keyof ItemListPreviewComponent & keyof this)[] = ['item', 'object', 'badgeContext', 'showSubmitter', 'workflowItem']; diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts index 4093544ebb..242ba70be7 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -35,7 +35,7 @@ const mockResultObject: ItemSearchResult = new ItemSearchResult(); mockResultObject.hitHighlights = {}; mockResultObject.indexableObject = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts index 6be84181e5..fd13e9867f 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts @@ -21,7 +21,11 @@ import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss', './item-search-result-list-element-submission.component.scss'], templateUrl: './item-search-result-list-element-submission.component.html', standalone: true, - imports: [ThemedItemListPreviewComponent, NgClass, ItemActionsComponent], + imports: [ + ItemActionsComponent, + NgClass, + ThemedItemListPreviewComponent, + ], }) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Workspace) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts index 3456e2317a..19f4c97b83 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -58,13 +58,13 @@ const configurationDataService = jasmine.createSpyObj('configurationDataService' })), }); const duplicateDataServiceStub = { - findListByHref: () => observableOf(emptyList), + findListByHref: () => of(emptyList), findDuplicates: () => createSuccessfulRemoteDataObject$({}), }; const item = Object.assign(new Item(), { - duplicates: observableOf([]), - bundles: observableOf({}), + duplicates: of([]), + bundles: of({}), metadata: { 'dc.title': [ { @@ -100,9 +100,9 @@ const environmentUseThumbs = { }; const rdItem = createSuccessfulRemoteDataObject(item); -const workflowitem = Object.assign(new WorkflowItem(), { item: observableOf(rdItem) }); +const workflowitem = Object.assign(new WorkflowItem(), { item: of(rdItem) }); const rdWorkflowitem = createSuccessfulRemoteDataObject(workflowitem); -mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) }); +mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: of(rdWorkflowitem) }); const linkService = getMockLinkService(); const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { remove: jasmine.createSpy('remove'), diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts index e5327d9863..71d3fff59c 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts @@ -61,7 +61,14 @@ import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], templateUrl: './pool-search-result-list-element.component.html', standalone: true, - imports: [ThemedItemListPreviewComponent, NgClass, PoolTaskActionsComponent, AsyncPipe, TranslateModule, VarDirective], + imports: [ + AsyncPipe, + NgClass, + PoolTaskActionsComponent, + ThemedItemListPreviewComponent, + TranslateModule, + VarDirective, + ], }) @listableObjectComponent(PoolTaskSearchResult, ViewMode.ListElement) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts index 19d8cf5f65..3854f8406a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { take } from 'rxjs/operators'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -40,7 +40,7 @@ const mockResultObject: WorkflowItemSearchResult = new WorkflowItemSearchResult( mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -76,7 +76,7 @@ const environmentUseThumbs = { }; const rd = createSuccessfulRemoteDataObject(item); -mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: of(rd) }); let linkService; diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts index 504d1d7168..decfaa033f 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts @@ -39,7 +39,13 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], templateUrl: './workflow-item-search-result-list-element.component.html', standalone: true, - imports: [ListableObjectComponentLoaderComponent, NgClass, WorkflowitemActionsComponent, ThemedLoadingComponent, AsyncPipe], + imports: [ + AsyncPipe, + ListableObjectComponentLoaderComponent, + NgClass, + ThemedLoadingComponent, + WorkflowitemActionsComponent, + ], }) @listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts index 5b87fe24a7..b0739e739c 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { take } from 'rxjs/operators'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -42,7 +42,7 @@ const mockResultObject: WorkflowItemSearchResult = new WorkflowItemSearchResult( mockResultObject.hitHighlights = {}; const item = Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -78,7 +78,7 @@ const environmentUseThumbs = { }; const rd = createSuccessfulRemoteDataObject(item); -mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd) }); +mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: of(rd) }); let linkService; describe('WorkspaceItemSearchResultListElementComponent', () => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts index 2a71308c4b..377676ea8f 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts @@ -39,7 +39,13 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss', './workspace-item-search-result-list-element.component.scss'], templateUrl: './workspace-item-search-result-list-element.component.html', standalone: true, - imports: [ListableObjectComponentLoaderComponent, NgClass, WorkspaceitemActionsComponent, ThemedLoadingComponent, AsyncPipe], + imports: [ + AsyncPipe, + ListableObjectComponentLoaderComponent, + NgClass, + ThemedLoadingComponent, + WorkspaceitemActionsComponent, + ], }) @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.ListElement) diff --git a/src/app/shared/object-list/object-list.component.ts b/src/app/shared/object-list/object-list.component.ts index 3c0136fec9..3d72e95240 100644 --- a/src/app/shared/object-list/object-list.component.ts +++ b/src/app/shared/object-list/object-list.component.ts @@ -35,7 +35,14 @@ import { SelectableListService } from './selectable-list/selectable-list.service templateUrl: './object-list.component.html', animations: [fadeIn], standalone: true, - imports: [PaginationComponent, NgClass, SelectableListItemControlComponent, ImportableListItemControlComponent, ListableObjectComponentLoaderComponent, BrowserOnlyPipe], + imports: [ + BrowserOnlyPipe, + ImportableListItemControlComponent, + ListableObjectComponentLoaderComponent, + NgClass, + PaginationComponent, + SelectableListItemControlComponent, + ], }) export class ObjectListComponent { /** diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts index 911c0d355f..a4e319c747 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -28,7 +28,7 @@ let collectionSearchResultListElementComponent: CollectionSearchResultListElemen let fixture: ComponentFixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; const mockCollectionWithAbstract: CollectionSearchResult = new CollectionSearchResult(); diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index 550f235180..bb615635b3 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -17,7 +17,11 @@ import { SearchResultListElementComponent } from '../search-result-list-element. styleUrls: ['../search-result-list-element.component.scss', 'collection-search-result-list-element.component.scss'], templateUrl: 'collection-search-result-list-element.component.html', standalone: true, - imports: [NgClass, ThemedBadgesComponent, RouterLink], + imports: [ + NgClass, + RouterLink, + ThemedBadgesComponent, + ], }) /** * Component representing a collection search result in list view diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts index 3ef9f33d10..214b99231e 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -28,7 +28,7 @@ let communitySearchResultListElementComponent: CommunitySearchResultListElementC let fixture: ComponentFixture; const truncatableServiceStub: any = { - isCollapsed: (id: number) => observableOf(true), + isCollapsed: (id: number) => of(true), }; const mockCommunityWithAbstract: CommunitySearchResult = new CommunitySearchResult(); diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index 17e7631945..6b413ff14d 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -17,7 +17,11 @@ import { SearchResultListElementComponent } from '../search-result-list-element. styleUrls: ['../search-result-list-element.component.scss', 'community-search-result-list-element.component.scss'], templateUrl: 'community-search-result-list-element.component.html', standalone: true, - imports: [NgClass, ThemedBadgesComponent, RouterLink], + imports: [ + NgClass, + RouterLink, + ThemedBadgesComponent, + ], }) /** * Component representing a community search result in list view diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 96c7975301..f95bad14fb 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_CONFIG } from '../../../../../../../config/app-config.interface'; import { AuthService } from '../../../../../../core/auth/auth.service'; @@ -42,7 +42,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign(new ItemSearchResul }, indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: { 'dc.title': [ { @@ -80,7 +80,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign(new ItemSearchResul const mockItemWithoutMetadata: ItemSearchResult = Object.assign(new ItemSearchResult(), { indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), metadata: {}, }), }); @@ -92,7 +92,7 @@ const mockPerson: ItemSearchResult = Object.assign(new ItemSearchResult(), { }, indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), entityType: 'Person', metadata: { 'dc.title': [ @@ -146,7 +146,7 @@ const mockOrgUnit: ItemSearchResult = Object.assign(new ItemSearchResult(), { }, indexableObject: Object.assign(new Item(), { - bundles: observableOf({}), + bundles: of({}), entityType: 'OrgUnit', metadata: { 'dc.title': [ diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index cf7fa597b3..bc0a5c605f 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -26,7 +26,15 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el styleUrls: ['./item-search-result-list-element.component.scss'], templateUrl: './item-search-result-list-element.component.html', standalone: true, - imports: [RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TruncatableComponent, + TruncatablePartComponent, + ], }) /** * The component for displaying a list element for an item search result of the type Publication diff --git a/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts index d446416ca8..8fae0c84d0 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts @@ -21,7 +21,12 @@ import { SidebarSearchListElementComponent } from '../sidebar-search-list-elemen selector: 'ds-collection-sidebar-search-list-element', templateUrl: '../sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link CollectionSearchResult} within the context of a sidebar search modal diff --git a/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts index e019217ace..1ba3be3a06 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts @@ -21,7 +21,12 @@ import { SidebarSearchListElementComponent } from '../sidebar-search-list-elemen selector: 'ds-community-sidebar-search-list-element', templateUrl: '../sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link CommunitySearchResult} within the context of a sidebar search modal diff --git a/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts index 9577d2b2b1..30f99200a8 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts @@ -21,7 +21,12 @@ import { SidebarSearchListElementComponent } from '../../sidebar-search-list-ele selector: 'ds-publication-sidebar-search-list-element', templateUrl: '../../sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Publication" within the context of diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index 396790debd..9f7b1aadd2 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -9,7 +9,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { find, @@ -36,7 +36,12 @@ import { SearchResultListElementComponent } from '../search-result-list-element/ selector: 'ds-sidebar-search-list-element', templateUrl: './sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) /** * Component displaying a list element for a {@link SearchResult} in the sidebar search modal @@ -101,7 +106,7 @@ export class SidebarSearchListElementComponent, K exte find((parentRD: RemoteData) => parentRD.hasSucceeded || parentRD.statusCode === 204), ); } - return observableOf(undefined); + return of(undefined); } /** diff --git a/src/app/shared/object-list/themed-object-list.component.ts b/src/app/shared/object-list/themed-object-list.component.ts index df932e3a0f..d048f0488f 100644 --- a/src/app/shared/object-list/themed-object-list.component.ts +++ b/src/app/shared/object-list/themed-object-list.component.ts @@ -26,7 +26,9 @@ import { ObjectListComponent } from './object-list.component'; styleUrls: [], templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [ObjectListComponent], + imports: [ + ObjectListComponent, + ], }) export class ThemedObjectListComponent extends ThemedComponent { @@ -59,7 +61,7 @@ export class ThemedObjectListComponent extends ThemedComponent { }); const authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); const linkHeadService = jasmine.createSpyObj('linkHeadService', { diff --git a/src/app/shared/object-select/collection-select/collection-select.component.ts b/src/app/shared/object-select/collection-select/collection-select.component.ts index 9b05e53e46..b0aff98208 100644 --- a/src/app/shared/object-select/collection-select/collection-select.component.ts +++ b/src/app/shared/object-select/collection-select/collection-select.component.ts @@ -35,7 +35,18 @@ import { ObjectSelectComponent } from '../object-select/object-select.component' templateUrl: './collection-select.component.html', styleUrls: ['./collection-select.component.scss'], standalone: true, - imports: [VarDirective, PaginationComponent, FormsModule, RouterLink, ErrorComponent, ThemedLoadingComponent, NgClass, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + ErrorComponent, + FormsModule, + NgClass, + PaginationComponent, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** diff --git a/src/app/shared/object-select/item-select/item-select.component.ts b/src/app/shared/object-select/item-select/item-select.component.ts index c9a46a5ba4..f53ff5a2f1 100644 --- a/src/app/shared/object-select/item-select/item-select.component.ts +++ b/src/app/shared/object-select/item-select/item-select.component.ts @@ -33,7 +33,18 @@ import { ObjectSelectComponent } from '../object-select/object-select.component' selector: 'ds-item-select', templateUrl: './item-select.component.html', standalone: true, - imports: [VarDirective, PaginationComponent, FormsModule, RouterLink, ErrorComponent, ThemedLoadingComponent, NgClass, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + ErrorComponent, + FormsModule, + NgClass, + PaginationComponent, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** diff --git a/src/app/shared/object-table/object-table.component.ts b/src/app/shared/object-table/object-table.component.ts index 003534ddc1..42da109788 100644 --- a/src/app/shared/object-table/object-table.component.ts +++ b/src/app/shared/object-table/object-table.component.ts @@ -35,11 +35,11 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o styleUrls: ['./object-table.component.scss'], animations: [fadeIn], imports: [ - PaginationComponent, - ThemedLoadingComponent, ErrorComponent, - TranslateModule, + PaginationComponent, TabulatableObjectsLoaderComponent, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts index 90e0f5057a..7f3fb119e1 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts @@ -8,7 +8,7 @@ import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { first, take, @@ -49,7 +49,7 @@ describe('PageSizeSelectorComponent', () => { const paginationService = new PaginationServiceStub(pagination, sort); const activatedRouteStub = { - queryParams: observableOf({ + queryParams: of({ query: queryParam, scope: scopeParam, }), @@ -64,7 +64,7 @@ describe('PageSizeSelectorComponent', () => { { provide: SEARCH_CONFIG_SERVICE, useValue: { - paginatedSearchOptions: observableOf(paginatedSearchOptions), + paginatedSearchOptions: of(paginatedSearchOptions), }, }, ], diff --git a/src/app/shared/page-size-selector/page-size-selector.component.ts b/src/app/shared/page-size-selector/page-size-selector.component.ts index 02e9327911..8fcab457f7 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.ts @@ -27,7 +27,11 @@ import { SidebarDropdownComponent } from '../sidebar/sidebar-dropdown.component' styleUrls: ['./page-size-selector.component.scss'], templateUrl: './page-size-selector.component.html', standalone: true, - imports: [SidebarDropdownComponent, FormsModule, AsyncPipe], + imports: [ + AsyncPipe, + FormsModule, + SidebarDropdownComponent, + ], }) /** diff --git a/src/app/shared/pagination/pagination.component.spec.ts b/src/app/shared/pagination/pagination.component.spec.ts index 353ba05ad9..643f3a2c54 100644 --- a/src/app/shared/pagination/pagination.component.spec.ts +++ b/src/app/shared/pagination/pagination.component.spec.ts @@ -397,7 +397,11 @@ describe('Pagination component', () => { @Component({ selector: 'ds-test-cmp', template: '', standalone: true, - imports: [NgxPaginationModule, PaginationComponent, NgbModule], + imports: [ + NgbModule, + NgxPaginationModule, + PaginationComponent, + ], }) class TestComponent { diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts index fec5572b89..0d8ce2e0e8 100644 --- a/src/app/shared/pagination/pagination.component.ts +++ b/src/app/shared/pagination/pagination.component.ts @@ -23,7 +23,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -69,7 +69,17 @@ interface PaginationDetails { changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.Emulated, standalone: true, - imports: [NgbDropdownModule, NgClass, RSSComponent, NgbPaginationModule, NgbTooltipModule, AsyncPipe, TranslateModule, EnumKeysPipe, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + EnumKeysPipe, + NgbDropdownModule, + NgbPaginationModule, + NgbTooltipModule, + NgClass, + RSSComponent, + TranslateModule, + ], }) export class PaginationComponent implements OnChanges, OnDestroy, OnInit { /** @@ -361,7 +371,7 @@ export class PaginationComponent implements OnChanges, OnDestroy, OnInit { * Method to get pagination details of the current viewed page. */ public getShowingDetails(collectionSize: number): Observable { - return observableOf(collectionSize).pipe( + return of(collectionSize).pipe( hasValueOperator(), switchMap(() => this.paginationService.getCurrentPagination(this.id, this.paginationOptions)), map((currentPaginationOptions) => { diff --git a/src/app/shared/remote-data.utils.ts b/src/app/shared/remote-data.utils.ts index 044e50b360..236e808315 100644 --- a/src/app/shared/remote-data.utils.ts +++ b/src/app/shared/remote-data.utils.ts @@ -1,7 +1,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { environment } from '../../environments/environment'; @@ -36,7 +36,7 @@ export function createSuccessfulRemoteDataObject(object: T, timeCompleted = F * @param timeCompleted the moment when the remoteData was completed */ export function createSuccessfulRemoteDataObject$(object: T, timeCompleted?: number): Observable> { - return observableOf(createSuccessfulRemoteDataObject(object, timeCompleted)); + return of(createSuccessfulRemoteDataObject(object, timeCompleted)); } /** @@ -66,7 +66,7 @@ export function createFailedRemoteDataObject(errorMessage?: string, statusCod * @param timeCompleted the moment when the remoteData was completed */ export function createFailedRemoteDataObject$(errorMessage?: string, statusCode?: number, timeCompleted?: number): Observable> { - return observableOf(createFailedRemoteDataObject(errorMessage, statusCode, timeCompleted)); + return of(createFailedRemoteDataObject(errorMessage, statusCode, timeCompleted)); } /** @@ -90,7 +90,7 @@ export function createPendingRemoteDataObject(lastVerified = FIXED_TIMESTAMP) * @param lastVerified the moment when the remoteData was last verified */ export function createPendingRemoteDataObject$(lastVerified?: number): Observable> { - return observableOf(createPendingRemoteDataObject(lastVerified)); + return of(createPendingRemoteDataObject(lastVerified)); } /** @@ -130,5 +130,5 @@ export function createFailedRemoteDataObjectFromError(error: unknown): Remote * @param error */ export function createFailedRemoteDataObjectFromError$(error: unknown): Observable> { - return observableOf(createFailedRemoteDataObjectFromError(error)); + return of(createFailedRemoteDataObjectFromError(error)); } diff --git a/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts b/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts index 3f82eec5fc..9463aba768 100644 --- a/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts +++ b/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts @@ -19,7 +19,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { LinkService } from '../../../core/cache/builders/link.service'; @@ -79,8 +79,8 @@ describe('ResourcePolicyCreateComponent test suite', () => { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject({})), - group: observableOf(createSuccessfulRemoteDataObject(GroupMock)), + eperson: of(createSuccessfulRemoteDataObject({})), + group: of(createSuccessfulRemoteDataObject(GroupMock)), }; const item = Object.assign(new Item(), { @@ -100,7 +100,7 @@ describe('ResourcePolicyCreateComponent test suite', () => { const resourcePolicyService: any = getMockResourcePolicyService(); const linkService: any = getMockLinkService(); const routeStub = { - data: observableOf({ + data: of({ resourcePolicyTarget: createSuccessfulRemoteDataObject(item), }), }; @@ -221,7 +221,7 @@ describe('ResourcePolicyCreateComponent test suite', () => { }); it('should notify success when creation is successful', () => { - compAsAny.resourcePolicyService.create.and.returnValue(observableOf(createSuccessfulRemoteDataObject(resourcePolicy))); + compAsAny.resourcePolicyService.create.and.returnValue(of(createSuccessfulRemoteDataObject(resourcePolicy))); scheduler = getTestScheduler(); scheduler.schedule(() => comp.createResourcePolicy(eventPayload)); @@ -232,7 +232,7 @@ describe('ResourcePolicyCreateComponent test suite', () => { }); it('should notify error when creation is not successful', () => { - compAsAny.resourcePolicyService.create.and.returnValue(observableOf(createFailedRemoteDataObject())); + compAsAny.resourcePolicyService.create.and.returnValue(of(createFailedRemoteDataObject())); scheduler = getTestScheduler(); scheduler.schedule(() => comp.createResourcePolicy(eventPayload)); @@ -259,7 +259,7 @@ describe('ResourcePolicyCreateComponent test suite', () => { }); it('should notify success when creation is successful', () => { - compAsAny.resourcePolicyService.create.and.returnValue(observableOf(createSuccessfulRemoteDataObject(resourcePolicy))); + compAsAny.resourcePolicyService.create.and.returnValue(of(createSuccessfulRemoteDataObject(resourcePolicy))); scheduler = getTestScheduler(); scheduler.schedule(() => comp.createResourcePolicy(eventPayload)); @@ -270,7 +270,7 @@ describe('ResourcePolicyCreateComponent test suite', () => { }); it('should notify error when creation is not successful', () => { - compAsAny.resourcePolicyService.create.and.returnValue(observableOf(createFailedRemoteDataObject())); + compAsAny.resourcePolicyService.create.and.returnValue(of(createFailedRemoteDataObject())); scheduler = getTestScheduler(); scheduler.schedule(() => comp.createResourcePolicy(eventPayload)); diff --git a/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts b/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts index 85a608f9d2..33cc75912a 100644 --- a/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts +++ b/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts @@ -19,7 +19,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { LinkService } from '../../../core/cache/builders/link.service'; @@ -75,14 +75,14 @@ describe('ResourcePolicyEditComponent test suite', () => { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject({})), - group: observableOf(createSuccessfulRemoteDataObject(GroupMock)), + eperson: of(createSuccessfulRemoteDataObject({})), + group: of(createSuccessfulRemoteDataObject(GroupMock)), }; const resourcePolicyService: any = getMockResourcePolicyService(); const linkService: any = getMockLinkService(); const routeStub = { - data: observableOf({ + data: of({ resourcePolicy: createSuccessfulRemoteDataObject(resourcePolicy), }), }; @@ -188,7 +188,7 @@ describe('ResourcePolicyEditComponent test suite', () => { describe('', () => { beforeEach(() => { spyOn(comp, 'redirectToAuthorizationsPage').and.callThrough(); - compAsAny.resourcePolicyService.update.and.returnValue(observableOf(createSuccessfulRemoteDataObject(resourcePolicy))); + compAsAny.resourcePolicyService.update.and.returnValue(of(createSuccessfulRemoteDataObject(resourcePolicy))); compAsAny.targetResourceUUID = 'itemUUID'; @@ -209,7 +209,7 @@ describe('ResourcePolicyEditComponent test suite', () => { }); it('should notify success when update is successful', () => { - compAsAny.resourcePolicyService.update.and.returnValue(observableOf(createSuccessfulRemoteDataObject(resourcePolicy))); + compAsAny.resourcePolicyService.update.and.returnValue(of(createSuccessfulRemoteDataObject(resourcePolicy))); scheduler = getTestScheduler(); scheduler.schedule(() => comp.updateResourcePolicy(eventPayload)); @@ -220,7 +220,7 @@ describe('ResourcePolicyEditComponent test suite', () => { }); it('should notify error when update is not successful', () => { - compAsAny.resourcePolicyService.update.and.returnValue(observableOf(createFailedRemoteDataObject())); + compAsAny.resourcePolicyService.update.and.returnValue(of(createFailedRemoteDataObject())); scheduler = getTestScheduler(); scheduler.schedule(() => comp.updateResourcePolicy(eventPayload)); diff --git a/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts b/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts index 5c80afdbc9..cf75175fd3 100644 --- a/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts +++ b/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts @@ -18,7 +18,7 @@ import { } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { GroupDataService } from '../../../core/eperson/group-data.service'; @@ -53,8 +53,8 @@ const groupRP: any = { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject(undefined)), - group: observableOf(createSuccessfulRemoteDataObject(GroupMock)), + eperson: of(createSuccessfulRemoteDataObject(undefined)), + group: of(createSuccessfulRemoteDataObject(GroupMock)), }; const epersonRP: any = { @@ -78,8 +78,8 @@ const epersonRP: any = { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject(EPersonMock)), - group: observableOf(createSuccessfulRemoteDataObject(undefined)), + eperson: of(createSuccessfulRemoteDataObject(EPersonMock)), + group: of(createSuccessfulRemoteDataObject(undefined)), }; const item = Object.assign(new Item(), { @@ -112,7 +112,7 @@ describe('ResourcePolicyEntryComponent', () => { findByHref: jasmine.createSpy('findByHref'), }); routeStub = { - data: observableOf({ + data: of({ item: createSuccessfulRemoteDataObject(item), }), }; @@ -201,7 +201,7 @@ describe('ResourcePolicyEntryComponent', () => { }); it('should redirect to Group edit page', () => { - compAsAny.groupService.findByHref.and.returnValue(observableOf(createSuccessfulRemoteDataObject(GroupMock))); + compAsAny.groupService.findByHref.and.returnValue(of(createSuccessfulRemoteDataObject(GroupMock))); comp.redirectToGroupEditPage(); expect(compAsAny.router.navigate).toHaveBeenCalled(); diff --git a/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts b/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts index 8a9bed8726..777a5ddbd5 100644 --- a/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts +++ b/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts @@ -55,9 +55,9 @@ export interface ResourcePolicyCheckboxEntry { templateUrl: './resource-policy-entry.component.html', imports: [ AsyncPipe, - TranslateModule, FormsModule, HasValuePipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts index 678b893c87..2fb76b2d25 100644 --- a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts +++ b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts @@ -25,7 +25,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; import { NgxMaskModule } from 'ngx-mask'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { delay } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; import { @@ -181,8 +181,8 @@ describe('ResourcePolicyFormComponent test suite', () => { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject({})), - group: observableOf(createSuccessfulRemoteDataObject(GroupMock)), + eperson: of(createSuccessfulRemoteDataObject({})), + group: of(createSuccessfulRemoteDataObject(GroupMock)), }; const epersonService = jasmine.createSpyObj('epersonService', { @@ -198,7 +198,7 @@ describe('ResourcePolicyFormComponent test suite', () => { const mockPolicyRD: RemoteData = createSuccessfulRemoteDataObject(resourcePolicy); const activatedRouteStub = { parent: { - data: observableOf({ + data: of({ dso: mockPolicyRD, }), }, @@ -256,7 +256,7 @@ describe('ResourcePolicyFormComponent test suite', () => { // synchronous beforeEach beforeEach(() => { - formService.isValid.and.returnValue(observableOf(true)); + formService.isValid.and.returnValue(of(true)); const html = ` `; @@ -282,7 +282,7 @@ describe('ResourcePolicyFormComponent test suite', () => { comp = fixture.componentInstance; compAsAny = fixture.componentInstance; compAsAny.resourcePolicy = resourcePolicy; - comp.isProcessing = observableOf(false); + comp.isProcessing = of(false); }); afterEach(() => { @@ -293,9 +293,9 @@ describe('ResourcePolicyFormComponent test suite', () => { }); it('should init form model properly', () => { - epersonService.findByHref.and.returnValue(observableOf(undefined)); - groupService.findByHref.and.returnValue(observableOf(undefined)); - spyOn(compAsAny, 'isFormValid').and.returnValue(observableOf(false)); + epersonService.findByHref.and.returnValue(of(undefined)); + groupService.findByHref.and.returnValue(of(undefined)); + spyOn(compAsAny, 'isFormValid').and.returnValue(of(false)); spyOn(compAsAny, 'initModelsValue').and.callThrough(); spyOn(compAsAny, 'buildResourcePolicyForm').and.callThrough(); fixture.detectChanges(); @@ -344,11 +344,11 @@ describe('ResourcePolicyFormComponent test suite', () => { compAsAny = fixture.componentInstance; comp.resourcePolicy = resourcePolicy; compAsAny.resourcePolicy = resourcePolicy; - comp.isProcessing = observableOf(false); + comp.isProcessing = of(false); compAsAny.ePersonService.findByHref.and.returnValue( - observableOf(createSuccessfulRemoteDataObject({})).pipe(delay(100)), + of(createSuccessfulRemoteDataObject({})).pipe(delay(100)), ); - compAsAny.groupService.findByHref.and.returnValue(observableOf(createSuccessfulRemoteDataObject(GroupMock))); + compAsAny.groupService.findByHref.and.returnValue(of(createSuccessfulRemoteDataObject(GroupMock))); }); afterEach(() => { @@ -359,7 +359,7 @@ describe('ResourcePolicyFormComponent test suite', () => { }); it('should init form model properly', () => { - spyOn(compAsAny, 'isFormValid').and.returnValue(observableOf(false)); + spyOn(compAsAny, 'isFormValid').and.returnValue(of(false)); spyOn(compAsAny, 'initModelsValue').and.callThrough(); spyOn(compAsAny, 'buildResourcePolicyForm').and.callThrough(); fixture.detectChanges(); @@ -405,12 +405,12 @@ describe('ResourcePolicyFormComponent test suite', () => { comp = fixture.componentInstance; compAsAny = comp; comp.resourcePolicy = resourcePolicy; - comp.isProcessing = observableOf(false); + comp.isProcessing = of(false); compAsAny.ePersonService.findByHref.and.returnValue( - observableOf(createSuccessfulRemoteDataObject({})).pipe(delay(100)), + of(createSuccessfulRemoteDataObject({})).pipe(delay(100)), ); - compAsAny.groupService.findByHref.and.returnValue(observableOf(createSuccessfulRemoteDataObject(GroupMock))); - compAsAny.formService.isValid.and.returnValue(observableOf(true)); + compAsAny.groupService.findByHref.and.returnValue(of(createSuccessfulRemoteDataObject(GroupMock))); + compAsAny.formService.isValid.and.returnValue(of(true)); compAsAny.isActive = true; comp.resourcePolicyGrant = GroupMock; comp.resourcePolicyGrantType = 'group'; @@ -435,7 +435,7 @@ describe('ResourcePolicyFormComponent test suite', () => { it('should emit submit event', () => { spyOn(compAsAny.submit, 'emit'); spyOn(compAsAny, 'createResourcePolicyByFormData').and.callThrough(); - compAsAny.formService.getFormData.and.returnValue(observableOf(mockResourcePolicyFormData)); + compAsAny.formService.getFormData.and.returnValue(of(mockResourcePolicyFormData)); const eventPayload: ResourcePolicyEvent = Object.create({}); eventPayload.object = submittedResourcePolicy; eventPayload.target = { @@ -462,12 +462,12 @@ describe('ResourcePolicyFormComponent test suite', () => { comp = fixture.componentInstance; compAsAny = comp; comp.resourcePolicy = resourcePolicy; - comp.isProcessing = observableOf(false); + comp.isProcessing = of(false); compAsAny.ePersonService.findByHref.and.returnValue( - observableOf(createSuccessfulRemoteDataObject({})).pipe(delay(100)), + of(createSuccessfulRemoteDataObject({})).pipe(delay(100)), ); - compAsAny.groupService.findByHref.and.returnValue(observableOf(createSuccessfulRemoteDataObject(GroupMock))); - compAsAny.formService.isValid.and.returnValue(observableOf(false)); + compAsAny.groupService.findByHref.and.returnValue(of(createSuccessfulRemoteDataObject(GroupMock))); + compAsAny.formService.isValid.and.returnValue(of(false)); compAsAny.isActive = true; fixture.detectChanges(); }); @@ -504,5 +504,5 @@ describe('ResourcePolicyFormComponent test suite', () => { class TestComponent { resourcePolicy = null; - isProcessing = observableOf(false); + isProcessing = of(false); } diff --git a/src/app/shared/resource-policies/form/resource-policy-form.component.ts b/src/app/shared/resource-policies/form/resource-policy-form.component.ts index ce33a8e8c1..7cea9dbddc 100644 --- a/src/app/shared/resource-policies/form/resource-policy-form.component.ts +++ b/src/app/shared/resource-policies/form/resource-policy-form.component.ts @@ -25,7 +25,7 @@ import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -85,12 +85,12 @@ export interface ResourcePolicyEvent { selector: 'ds-resource-policy-form', templateUrl: './resource-policy-form.component.html', imports: [ - FormComponent, - NgbNavModule, - EpersonGroupListComponent, - TranslateModule, AsyncPipe, BtnDisabledDirective, + EpersonGroupListComponent, + FormComponent, + NgbNavModule, + TranslateModule, ], standalone: true, }) @@ -109,7 +109,7 @@ export class ResourcePolicyFormComponent implements OnInit, OnDestroy { * A boolean representing if form submit operation is processing * @type {boolean} */ - @Input() isProcessing: Observable = observableOf(false); + @Input() isProcessing: Observable = of(false); /** * An event fired when form is canceled. diff --git a/src/app/shared/resource-policies/resource-policies.component.spec.ts b/src/app/shared/resource-policies/resource-policies.component.spec.ts index 917aec5941..3ad0ee7acc 100644 --- a/src/app/shared/resource-policies/resource-policies.component.spec.ts +++ b/src/app/shared/resource-policies/resource-policies.component.spec.ts @@ -25,7 +25,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -93,8 +93,8 @@ describe('ResourcePoliciesComponent test suite', () => { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject({})), - group: observableOf(createSuccessfulRemoteDataObject(GroupMock)), + eperson: of(createSuccessfulRemoteDataObject({})), + group: of(createSuccessfulRemoteDataObject(GroupMock)), }; const anotherResourcePolicy: any = { @@ -118,8 +118,8 @@ describe('ResourcePoliciesComponent test suite', () => { href: 'https://rest.api/rest/api/resourcepolicies/1', }, }, - eperson: observableOf(createSuccessfulRemoteDataObject(EPersonMock)), - group: observableOf(createSuccessfulRemoteDataObject({})), + eperson: of(createSuccessfulRemoteDataObject(EPersonMock)), + group: of(createSuccessfulRemoteDataObject({})), }; const bitstream1 = Object.assign(new Bitstream(), { @@ -165,7 +165,7 @@ describe('ResourcePoliciesComponent test suite', () => { }); const routeStub = { - data: observableOf({ + data: of({ item: createSuccessfulRemoteDataObject(item), }), }; @@ -322,7 +322,7 @@ describe('ResourcePoliciesComponent test suite', () => { compAsAny.isActive = true; const initResourcePolicyEntries = getInitEntries(); compAsAny.resourcePoliciesEntries$.next(initResourcePolicyEntries); - resourcePolicyService.searchByResource.and.returnValue(observableOf({})); + resourcePolicyService.searchByResource.and.returnValue(of({})); spyOn(comp, 'initResourcePolicyList').and.callFake(() => ({})); fixture.detectChanges(); }); @@ -376,7 +376,7 @@ describe('ResourcePoliciesComponent test suite', () => { }); it('should call ResourcePolicyService.delete for the checked policies', () => { - resourcePolicyService.delete.and.returnValue(observableOf(true)); + resourcePolicyService.delete.and.returnValue(of(true)); scheduler = getTestScheduler(); scheduler.schedule(() => comp.deleteSelectedResourcePolicies()); scheduler.flush(); @@ -387,7 +387,7 @@ describe('ResourcePoliciesComponent test suite', () => { it('should notify success when delete is successful', () => { - resourcePolicyService.delete.and.returnValue(observableOf(true)); + resourcePolicyService.delete.and.returnValue(of(true)); scheduler = getTestScheduler(); scheduler.schedule(() => comp.deleteSelectedResourcePolicies()); scheduler.flush(); @@ -398,7 +398,7 @@ describe('ResourcePoliciesComponent test suite', () => { it('should notify error when delete is not successful', () => { - resourcePolicyService.delete.and.returnValue(observableOf(false)); + resourcePolicyService.delete.and.returnValue(of(false)); scheduler = getTestScheduler(); scheduler.schedule(() => comp.deleteSelectedResourcePolicies()); scheduler.flush(); @@ -447,7 +447,10 @@ describe('ResourcePoliciesComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [FormsModule, ReactiveFormsModule], + imports: [ + FormsModule, + ReactiveFormsModule, + ], }) class TestComponent { diff --git a/src/app/shared/resource-policies/resource-policies.component.ts b/src/app/shared/resource-policies/resource-policies.component.ts index 90e133dc41..213fe8b760 100644 --- a/src/app/shared/resource-policies/resource-policies.component.ts +++ b/src/app/shared/resource-policies/resource-policies.component.ts @@ -55,10 +55,10 @@ import { styleUrls: ['./resource-policies.component.scss'], templateUrl: './resource-policies.component.html', imports: [ - ResourcePolicyEntryComponent, - TranslateModule, AsyncPipe, BtnDisabledDirective, + ResourcePolicyEntryComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/shared/results-back-button/results-back-button.component.ts b/src/app/shared/results-back-button/results-back-button.component.ts index 3d237733a1..0d1c26436a 100644 --- a/src/app/shared/results-back-button/results-back-button.component.ts +++ b/src/app/shared/results-back-button/results-back-button.component.ts @@ -14,7 +14,9 @@ import { Observable } from 'rxjs'; templateUrl: './results-back-button.component.html', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [AsyncPipe], + imports: [ + AsyncPipe, + ], }) /** * Component for creating a back to result list button. diff --git a/src/app/shared/results-back-button/themed-results-back-button.component.ts b/src/app/shared/results-back-button/themed-results-back-button.component.ts index d280e9b849..501267193a 100644 --- a/src/app/shared/results-back-button/themed-results-back-button.component.ts +++ b/src/app/shared/results-back-button/themed-results-back-button.component.ts @@ -12,7 +12,9 @@ import { ResultsBackButtonComponent } from './results-back-button.component'; styleUrls: [], templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [ResultsBackButtonComponent], + imports: [ + ResultsBackButtonComponent, + ], }) export class ThemedResultsBackButtonComponent extends ThemedComponent { diff --git a/src/app/shared/rss-feed/rss.component.spec.ts b/src/app/shared/rss-feed/rss.component.spec.ts index 60de4caef6..7042fd8ff1 100644 --- a/src/app/shared/rss-feed/rss.component.spec.ts +++ b/src/app/shared/rss-feed/rss.component.spec.ts @@ -8,7 +8,7 @@ import { Router, } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -73,7 +73,7 @@ describe('RssComponent', () => { addTag: '', }); const mockCollectionRD: RemoteData = createSuccessfulRemoteDataObject(mockCollection); - const mockSearchOptions = observableOf(new PaginatedSearchOptions({ + const mockSearchOptions = of(new PaginatedSearchOptions({ pagination: Object.assign(new PaginationComponentOptions(), { id: 'search-page-configuration', pageSize: 10, diff --git a/src/app/shared/rss-feed/rss.component.ts b/src/app/shared/rss-feed/rss.component.ts index 1ed29697bf..6a9cecc7cc 100644 --- a/src/app/shared/rss-feed/rss.component.ts +++ b/src/app/shared/rss-feed/rss.component.ts @@ -51,7 +51,10 @@ import { SearchFilter } from '../search/models/search-filter.model'; changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.Emulated, standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) export class RSSComponent implements OnInit, OnDestroy, OnChanges { diff --git a/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts b/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts index c9008e2bc7..d6d12a15aa 100644 --- a/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts +++ b/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts @@ -32,7 +32,10 @@ import { styleUrls: ['./scope-selector-modal.component.scss'], templateUrl: './scope-selector-modal.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class ScopeSelectorModalComponent extends DSOSelectorModalWrapperComponent implements OnInit { diff --git a/src/app/shared/search-form/search-form.component.ts b/src/app/shared/search-form/search-form.component.ts index dba8c67ed8..700e3eb691 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -37,7 +37,13 @@ import { ScopeSelectorModalComponent } from './scope-selector-modal/scope-select styleUrls: ['./search-form.component.scss'], templateUrl: './search-form.component.html', standalone: true, - imports: [FormsModule, NgbTooltipModule, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + FormsModule, + NgbTooltipModule, + TranslateModule, + ], }) /** * Component that represents the search form diff --git a/src/app/shared/search-form/themed-search-form.component.ts b/src/app/shared/search-form/themed-search-form.component.ts index 52c4f80755..2413d0994b 100644 --- a/src/app/shared/search-form/themed-search-form.component.ts +++ b/src/app/shared/search-form/themed-search-form.component.ts @@ -16,7 +16,9 @@ import { SearchFormComponent } from './search-form.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [SearchFormComponent], + imports: [ + SearchFormComponent, + ], }) export class ThemedSearchFormComponent extends ThemedComponent { diff --git a/src/app/shared/search/advanced-search/advanced-search.component.ts b/src/app/shared/search/advanced-search/advanced-search.component.ts index 574ffb2c4f..921e5df283 100644 --- a/src/app/shared/search/advanced-search/advanced-search.component.ts +++ b/src/app/shared/search/advanced-search/advanced-search.component.ts @@ -17,7 +17,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -50,11 +50,11 @@ import { SearchFilterConfig } from '../models/search-filter-config.model'; standalone: true, imports: [ AsyncPipe, + BtnDisabledDirective, FilterInputSuggestionsComponent, FormsModule, KeyValuePipe, TranslateModule, - BtnDisabledDirective, ], }) export class AdvancedSearchComponent implements OnInit, OnDestroy { @@ -90,7 +90,7 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy { /** * Emits the result values for this filter found by the current filter query */ - filterSearchResults$: Observable = observableOf([]); + filterSearchResults$: Observable = of([]); subs: Subscription[] = []; diff --git a/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts b/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts index f067263712..64a3cf6487 100644 --- a/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts +++ b/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts @@ -7,7 +7,7 @@ import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -48,16 +48,16 @@ describe('SearchExportCsvComponent', () => { }); configurationDataService = jasmine.createSpyObj('ConfigurationDataService', { - findByPropertyName: observableOf({ payload: { value: '500' } }), + findByPropertyName: of({ payload: { value: '500' } }), }); function initBeforeEachAsync() { scriptDataService = jasmine.createSpyObj('scriptDataService', { - scriptWithNameExistsAndCanExecute: observableOf(true), + scriptWithNameExistsAndCanExecute: of(true), invoke: createSuccessfulRemoteDataObject$(process), }); authorizationDataService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); notificationsService = new NotificationsServiceStub(); @@ -109,7 +109,7 @@ describe('SearchExportCsvComponent', () => { describe('when the user is not an admin', () => { beforeEach(waitForAsync(() => { initBeforeEachAsync(); - (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); })); beforeEach(() => { initBeforeEach(); @@ -122,7 +122,7 @@ describe('SearchExportCsvComponent', () => { describe('when the metadata-export-search script is not present', () => { beforeEach(waitForAsync(() => { initBeforeEachAsync(); - (scriptDataService.scriptWithNameExistsAndCanExecute as jasmine.Spy).and.returnValue(observableOf(false)); + (scriptDataService.scriptWithNameExistsAndCanExecute as jasmine.Spy).and.returnValue(of(false)); })); it('should should not add the button', () => { @@ -133,7 +133,7 @@ describe('SearchExportCsvComponent', () => { }); it('should not call scriptWithNameExistsAndCanExecute when unauthorized', () => { - (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); + (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false)); initBeforeEach(); expect(scriptDataService.scriptWithNameExistsAndCanExecute).not.toHaveBeenCalled(); diff --git a/src/app/shared/search/search-export-csv/search-export-csv.component.ts b/src/app/shared/search/search-export-csv/search-export-csv.component.ts index 6544770931..df2e3ddba7 100644 --- a/src/app/shared/search/search-export-csv/search-export-csv.component.ts +++ b/src/app/shared/search/search-export-csv/search-export-csv.component.ts @@ -42,7 +42,11 @@ import { SearchFilter } from '../models/search-filter.model'; styleUrls: ['./search-export-csv.component.scss'], templateUrl: './search-export-csv.component.html', standalone: true, - imports: [NgbTooltipModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + TranslateModule, + ], }) /** * Display a button to export the current search results as csv diff --git a/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts index 309d75c42f..d1709d7991 100644 --- a/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts @@ -20,7 +20,14 @@ import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-optio templateUrl: './search-authority-filter.component.html', animations: [facetLoad], standalone: true, - imports: [SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FilterInputSuggestionsComponent, + FormsModule, + SearchFacetOptionComponent, + SearchFacetSelectedOptionComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts index 7fb5ec6019..70e8cff264 100644 --- a/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts @@ -18,7 +18,12 @@ import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-optio templateUrl: './search-boolean-filter.component.html', animations: [facetLoad], standalone: true, - imports: [SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + SearchFacetOptionComponent, + SearchFacetSelectedOptionComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts index d532652097..d761a8d95d 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts @@ -15,7 +15,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { SearchService } from '../../../../../../core/shared/search/search.service'; @@ -104,7 +104,7 @@ describe('SearchFacetOptionComponent', () => { describe('when isVisible emits true', () => { it('the facet option should be visible', () => { - comp.isVisible = observableOf(true); + comp.isVisible = of(true); fixture.detectChanges(); const linkEl = fixture.debugElement.query(By.css('a')); expect(linkEl).not.toBeNull(); @@ -113,7 +113,7 @@ describe('SearchFacetOptionComponent', () => { describe('when isVisible emits false', () => { it('the facet option should not be visible', () => { - comp.isVisible = observableOf(false); + comp.isVisible = of(false); fixture.detectChanges(); const linkEl = fixture.debugElement.query(By.css('a')); expect(linkEl).toBeNull(); diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts index b0b255615b..69f3a5fb7d 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts @@ -32,7 +32,12 @@ import { getFacetValueForType } from '../../../../search.utils'; styleUrls: ['./search-facet-option.component.scss'], templateUrl: './search-facet-option.component.html', standalone: true, - imports: [RouterLink, AsyncPipe, TranslateModule, ShortNumberPipe], + imports: [ + AsyncPipe, + RouterLink, + ShortNumberPipe, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts index 3797aaf2eb..4f46a5dd2a 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts @@ -15,7 +15,7 @@ import { RouterLink, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { SearchService } from '../../../../../../core/shared/search/search.service'; @@ -67,7 +67,7 @@ describe('SearchFacetRangeOptionComponent', () => { let filterService; let searchService; let router; - const page = observableOf(0); + const page = of(0); const pagination = Object.assign(new PaginationComponentOptions(), { id: 'page-id', currentPage: 1, pageSize: 20 }); const paginationService = new PaginationServiceStub(pagination); @@ -81,13 +81,13 @@ describe('SearchFacetRangeOptionComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: SearchConfigurationService, useValue: { - searchOptions: observableOf({}), + searchOptions: of({}), paginationId: 'page-id', }, }, { provide: SearchFilterService, useValue: { - isFilterActiveWithValue: (paramName: string, filterValue: string) => observableOf(true), + isFilterActiveWithValue: (paramName: string, filterValue: string) => of(true), getPage: (paramName: string) => page, /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ incrementPage: (filterName: string) => { @@ -145,7 +145,7 @@ describe('SearchFacetRangeOptionComponent', () => { describe('when isVisible emits true', () => { it('the facet option should be visible', () => { - comp.isVisible = observableOf(true); + comp.isVisible = of(true); fixture.detectChanges(); const linkEl = fixture.debugElement.query(By.css('a')); expect(linkEl).not.toBeNull(); @@ -154,7 +154,7 @@ describe('SearchFacetRangeOptionComponent', () => { describe('when isVisible emits false', () => { it('the facet option should not be visible', () => { - comp.isVisible = observableOf(false); + comp.isVisible = of(false); fixture.detectChanges(); const linkEl = fixture.debugElement.query(By.css('a')); expect(linkEl).toBeNull(); diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts index 893691fc0f..8e72b766bf 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts @@ -38,7 +38,11 @@ const rangeDelimiter = '-'; // templateUrl: './search-facet-range-option.component.html', templateUrl: './search-facet-range-option.component.html', standalone: true, - imports: [RouterLink, AsyncPipe, ShortNumberPipe], + imports: [ + AsyncPipe, + RouterLink, + ShortNumberPipe, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts index 832404d1d7..5ea39f4d53 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts @@ -14,7 +14,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; @@ -102,7 +102,7 @@ describe('SearchFacetFilterComponent', () => { { provide: SearchService, useValue: searchService }, { provide: SearchFilterService, useValue: filterService }, { provide: Router, useValue: router }, - { provide: RemoteDataBuildService, useValue: { aggregate: () => observableOf({}) } }, + { provide: RemoteDataBuildService, useValue: { aggregate: () => of({}) } }, { provide: SEARCH_CONFIG_SERVICE, useValue: searchConfigService }, ], schemas: [NO_ERRORS_SCHEMA], @@ -181,7 +181,7 @@ describe('SearchFacetFilterComponent', () => { const testValue = 'test'; beforeEach(() => { - comp.selectedAppliedFilters$ = observableOf(selectedValues.map((value) => + comp.selectedAppliedFilters$ = of(selectedValues.map((value) => Object.assign(new AppliedFilter(), { filter: filterName1, operator: 'equals', @@ -190,7 +190,7 @@ describe('SearchFacetFilterComponent', () => { }))); fixture.detectChanges(); spyOn(comp, 'getSearchLink').and.returnValue(searchUrl); - spyOn(searchConfigService, 'selectNewAppliedFilterParams').and.returnValue(observableOf({ [mockFilterConfig.paramName]: [...selectedValues.map((value) => `${value},equals`), `${testValue},equals`] })); + spyOn(searchConfigService, 'selectNewAppliedFilterParams').and.returnValue(of({ [mockFilterConfig.paramName]: [...selectedValues.map((value) => `${value},equals`), `${testValue},equals`] })); }); it('should call navigate on the router with the right searchlink and parameters when the filter is provided with a valid operator', () => { diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts index 0bb708db91..cc26851c09 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts @@ -20,7 +20,7 @@ import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -121,7 +121,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy { /** * Emits the result values for this filter found by the current filter query */ - filterSearchResults$: Observable = observableOf([]); + filterSearchResults$: Observable = of([]); /** * Emits the active values for this filter @@ -278,7 +278,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy { queryParams: params, }); this.filter = ''; - this.filterSearchResults$ = observableOf([]); + this.filterSearchResults$ = of([]); })); } } diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts index 955ac2a0e0..125713e76e 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { SearchFilterService } from 'src/app/core/shared/search/search-filter.service'; @@ -119,7 +119,7 @@ describe('SearchFilterComponent', () => { describe('when isCollapsed is called and the filter is collapsed', () => { let isActive: Observable; beforeEach(() => { - searchFilterService.isCollapsed = () => observableOf(true); + searchFilterService.isCollapsed = () => of(true); isActive = (comp as any).isCollapsed(); }); @@ -134,7 +134,7 @@ describe('SearchFilterComponent', () => { describe('when isCollapsed is called and the filter is not collapsed', () => { let isActive: Observable; beforeEach(() => { - searchFilterService.isCollapsed = () => observableOf(false); + searchFilterService.isCollapsed = () => of(false); isActive = (comp as any).isCollapsed(); }); @@ -153,7 +153,7 @@ describe('SearchFilterComponent', () => { totalElements: 5, }, } as FacetValues))); - comp.appliedFilters$ = observableOf([appliedFilter2]); + comp.appliedFilters$ = of([appliedFilter2]); expect(comp.isActive()).toBeObservable(cold('(tt)', { t: true, @@ -166,7 +166,7 @@ describe('SearchFilterComponent', () => { totalElements: 0, }, } as FacetValues))); - comp.appliedFilters$ = observableOf([appliedFilter2]); + comp.appliedFilters$ = of([appliedFilter2]); expect(comp.isActive()).toBeObservable(cold('(tf)', { t: true, @@ -180,7 +180,7 @@ describe('SearchFilterComponent', () => { totalElements: 0, }, } as FacetValues))); - comp.appliedFilters$ = observableOf([appliedFilter1, appliedFilter2]); + comp.appliedFilters$ = of([appliedFilter1, appliedFilter2]); expect(comp.isActive()).toBeObservable(cold('(tt)', { t: true, @@ -193,7 +193,7 @@ describe('SearchFilterComponent', () => { totalElements: 5, }, } as FacetValues))); - comp.appliedFilters$ = observableOf([appliedFilter1, appliedFilter2]); + comp.appliedFilters$ = of([appliedFilter1, appliedFilter2]); expect(comp.isActive()).toBeObservable(cold('(tt)', { t: true, diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts index 80238c56ad..2b740734f6 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts @@ -20,7 +20,7 @@ import { filter, map, Observable, - of as observableOf, + of, startWith, Subscription, switchMap, @@ -51,7 +51,14 @@ import { SearchFacetFilterWrapperComponent } from './search-facet-filter-wrapper templateUrl: './search-filter.component.html', animations: [slide], standalone: true, - imports: [NgClass, SearchFacetFilterWrapperComponent, AsyncPipe, LowerCasePipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + LowerCasePipe, + NgClass, + SearchFacetFilterWrapperComponent, + TranslateModule, + ], }) /** @@ -247,7 +254,7 @@ export class SearchFilterComponent implements OnInit, OnChanges, OnDestroy { ]).pipe( switchMap(([selectedValues, options, scope]: [AppliedFilter[], SearchOptions, string]) => { if (isNotEmpty(selectedValues.filter((appliedFilter: AppliedFilter) => FACET_OPERATORS.includes(appliedFilter.operator)))) { - return observableOf(true); + return of(true); } else { if (hasValue(scope)) { options.scope = scope; diff --git a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts index a2cf166fba..6d57335bbc 100644 --- a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts @@ -19,7 +19,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; @@ -52,7 +52,7 @@ describe('SearchHierarchyFilterComponent', () => { let searchService: SearchServiceStub; const searchFilterService = { - getPage: () => observableOf(0), + getPage: () => of(0), }; let searchConfigService: SearchConfigurationServiceStub; let router: RouterStub; @@ -107,7 +107,7 @@ describe('SearchHierarchyFilterComponent', () => { describe('if the vocabulary doesn\'t exist', () => { beforeEach(() => { - spyOn(vocabularyService, 'searchTopEntries').and.returnValue(observableOf(new RemoteData( + spyOn(vocabularyService, 'searchTopEntries').and.returnValue(of(new RemoteData( undefined, 0, 0, RequestEntryState.Error, undefined, undefined, 404, ))); init(); @@ -121,7 +121,7 @@ describe('SearchHierarchyFilterComponent', () => { describe('if the vocabulary exists', () => { beforeEach(() => { - spyOn(vocabularyService, 'searchTopEntries').and.returnValue(observableOf(new RemoteData( + spyOn(vocabularyService, 'searchTopEntries').and.returnValue(of(new RemoteData( undefined, 0, 0, RequestEntryState.Success, undefined, buildPaginatedList(new PageInfo(), []), 200, ))); init(); @@ -133,7 +133,7 @@ describe('SearchHierarchyFilterComponent', () => { describe('when clicking the vocabulary tree link', () => { beforeEach(async () => { - spyOn(searchConfigService, 'selectNewAppliedFilterParams').and.returnValue(observableOf({ + spyOn(searchConfigService, 'selectNewAppliedFilterParams').and.returnValue(of({ 'f.subject': [ 'definedBy_selectNewAppliedFilterParams', ], diff --git a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts index 1b0f88684e..c979b82828 100644 --- a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts @@ -59,7 +59,15 @@ import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-optio templateUrl: './search-hierarchy-filter.component.html', animations: [facetLoad], standalone: true, - imports: [SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, LowerCasePipe, TranslateModule], + imports: [ + AsyncPipe, + FilterInputSuggestionsComponent, + FormsModule, + LowerCasePipe, + SearchFacetOptionComponent, + SearchFacetSelectedOptionComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts index 263861d017..1f55941f00 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts @@ -13,7 +13,7 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, - of as observableOf, + of, } from 'rxjs'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; @@ -112,7 +112,7 @@ describe('SearchRangeFilterComponent', () => { { provide: SearchFilterService, useValue: filterService }, { provide: Router, useValue: router }, { provide: RouteService, useValue: routeServiceStub }, - { provide: RemoteDataBuildService, useValue: { aggregate: () => observableOf({}) } }, + { provide: RemoteDataBuildService, useValue: { aggregate: () => of({}) } }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, ], diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts index ded7d98c02..a546d1ba70 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts @@ -51,7 +51,14 @@ import { templateUrl: './search-range-filter.component.html', animations: [facetLoad], standalone: true, - imports: [FormsModule, NouisliderComponent, DebounceDirective, SearchFacetRangeOptionComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DebounceDirective, + FormsModule, + NouisliderComponent, + SearchFacetRangeOptionComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts index f478588415..832b73b6b6 100644 --- a/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts @@ -27,7 +27,14 @@ import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-optio templateUrl: './search-text-filter.component.html', animations: [facetLoad], standalone: true, - imports: [SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FilterInputSuggestionsComponent, + FormsModule, + SearchFacetOptionComponent, + SearchFacetSelectedOptionComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/search-filters.component.ts b/src/app/shared/search/search-filters/search-filters.component.ts index ed1e83b717..8532fcb3a1 100644 --- a/src/app/shared/search/search-filters/search-filters.component.ts +++ b/src/app/shared/search/search-filters/search-filters.component.ts @@ -40,7 +40,13 @@ import { SearchFilterComponent } from './search-filter/search-filter.component'; styleUrls: ['./search-filters.component.scss'], templateUrl: './search-filters.component.html', standalone: true, - imports: [SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule, NgxSkeletonLoaderModule], + imports: [ + AsyncPipe, + NgxSkeletonLoaderModule, + RouterLink, + SearchFilterComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-filters/themed-search-filters.component.ts b/src/app/shared/search/search-filters/themed-search-filters.component.ts index 69bd284e98..47dbc140d4 100644 --- a/src/app/shared/search/search-filters/themed-search-filters.component.ts +++ b/src/app/shared/search/search-filters/themed-search-filters.component.ts @@ -16,7 +16,9 @@ import { SearchFiltersComponent } from './search-filters.component'; selector: 'ds-search-filters', templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [SearchFiltersComponent], + imports: [ + SearchFiltersComponent, + ], }) export class ThemedSearchFiltersComponent extends ThemedComponent { diff --git a/src/app/shared/search/search-labels/search-label/search-label.component.ts b/src/app/shared/search/search-labels/search-label/search-label.component.ts index 63e3f1c9d4..22c63c71c3 100644 --- a/src/app/shared/search/search-labels/search-label/search-label.component.ts +++ b/src/app/shared/search/search-labels/search-label/search-label.component.ts @@ -27,7 +27,11 @@ import { AppliedFilter } from '../../models/applied-filter.model'; templateUrl: './search-label.component.html', styleUrls: ['./search-label.component.scss'], standalone: true, - imports: [RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + RouterLink, + TranslateModule, + ], }) export class SearchLabelComponent implements OnInit { @Input() inPlaceSearch: boolean; diff --git a/src/app/shared/search/search-labels/search-labels.component.spec.ts b/src/app/shared/search/search-labels/search-labels.component.spec.ts index abb65d9fc5..775077b2fa 100644 --- a/src/app/shared/search/search-labels/search-labels.component.spec.ts +++ b/src/app/shared/search/search-labels/search-labels.component.spec.ts @@ -11,7 +11,7 @@ import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SearchService } from '../../../core/shared/search/search.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; @@ -42,7 +42,7 @@ describe('SearchLabelsComponent', () => { imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, RouterTestingModule, SearchLabelsComponent, ObjectKeysPipe], providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, - { provide: SEARCH_CONFIG_SERVICE, useValue: { getCurrentFrontendFilters: () => observableOf(mockFilters) } }, + { provide: SEARCH_CONFIG_SERVICE, useValue: { getCurrentFrontendFilters: () => of(mockFilters) } }, ], schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(SearchLabelsComponent, { diff --git a/src/app/shared/search/search-labels/search-labels.component.ts b/src/app/shared/search/search-labels/search-labels.component.ts index b7a9b7a82c..14d2d5e86e 100644 --- a/src/app/shared/search/search-labels/search-labels.component.ts +++ b/src/app/shared/search/search-labels/search-labels.component.ts @@ -20,7 +20,13 @@ import { SearchLabelLoaderComponent } from './search-label-loader/search-label-l styleUrls: ['./search-labels.component.scss'], templateUrl: './search-labels.component.html', standalone: true, - imports: [SearchLabelComponent, AsyncPipe, ObjectKeysPipe, SearchLabelLoaderComponent, KeyValuePipe], + imports: [ + AsyncPipe, + KeyValuePipe, + ObjectKeysPipe, + SearchLabelComponent, + SearchLabelLoaderComponent, + ], }) /** diff --git a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts index 56742f75f5..c44bb9c2ac 100644 --- a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts +++ b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts @@ -15,8 +15,8 @@ import { hasValue } from '../../../empty.util'; selector: 'ds-search-results-skeleton', standalone: true, imports: [ - NgxSkeletonLoaderModule, AsyncPipe, + NgxSkeletonLoaderModule, ], templateUrl: './search-results-skeleton.component.html', styleUrl: './search-results-skeleton.component.scss', diff --git a/src/app/shared/search/search-results/themed-search-results.component.ts b/src/app/shared/search/search-results/themed-search-results.component.ts index 5f9f1975af..540615f309 100644 --- a/src/app/shared/search/search-results/themed-search-results.component.ts +++ b/src/app/shared/search/search-results/themed-search-results.component.ts @@ -29,7 +29,9 @@ import { styleUrls: [], templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [SearchResultsComponent], + imports: [ + SearchResultsComponent, + ], }) export class ThemedSearchResultsComponent extends ThemedComponent { diff --git a/src/app/shared/search/search-settings/search-settings.component.spec.ts b/src/app/shared/search/search-settings/search-settings.component.spec.ts index 17abbd7b02..3b80965376 100644 --- a/src/app/shared/search/search-settings/search-settings.component.spec.ts +++ b/src/app/shared/search/search-settings/search-settings.component.spec.ts @@ -8,7 +8,7 @@ import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -81,8 +81,8 @@ describe('SearchSettingsComponent', () => { { provide: SEARCH_CONFIG_SERVICE, useValue: { - paginatedSearchOptions: observableOf(paginatedSearchOptions), - getCurrentScope: observableOf('test-id'), + paginatedSearchOptions: of(paginatedSearchOptions), + getCurrentScope: of('test-id'), }, }, ], diff --git a/src/app/shared/search/search-settings/search-settings.component.ts b/src/app/shared/search/search-settings/search-settings.component.ts index 14e0b1a62a..058986c820 100644 --- a/src/app/shared/search/search-settings/search-settings.component.ts +++ b/src/app/shared/search/search-settings/search-settings.component.ts @@ -22,7 +22,12 @@ import { SidebarDropdownComponent } from '../../sidebar/sidebar-dropdown.compone styleUrls: ['./search-settings.component.scss'], templateUrl: './search-settings.component.html', standalone: true, - imports: [SidebarDropdownComponent, FormsModule, PageSizeSelectorComponent, TranslateModule], + imports: [ + FormsModule, + PageSizeSelectorComponent, + SidebarDropdownComponent, + TranslateModule, + ], }) /** diff --git a/src/app/shared/search/search-settings/themed-search-settings.component.ts b/src/app/shared/search/search-settings/themed-search-settings.component.ts index 22cd638b1a..4a6aeea235 100644 --- a/src/app/shared/search/search-settings/themed-search-settings.component.ts +++ b/src/app/shared/search/search-settings/themed-search-settings.component.ts @@ -15,7 +15,9 @@ import { SearchSettingsComponent } from './search-settings.component'; styleUrls: [], templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [SearchSettingsComponent], + imports: [ + SearchSettingsComponent, + ], }) export class ThemedSearchSettingsComponent extends ThemedComponent { @Input() currentSortOption: SortOptions; diff --git a/src/app/shared/search/search-sidebar/search-sidebar.component.ts b/src/app/shared/search/search-sidebar/search-sidebar.component.ts index 77b05ef0dd..2aa69a1483 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -43,7 +43,15 @@ import { SearchSwitchConfigurationComponent } from '../search-switch-configurati styleUrls: ['./search-sidebar.component.scss'], templateUrl: './search-sidebar.component.html', standalone: true, - imports: [ViewModeSwitchComponent, SearchSwitchConfigurationComponent, ThemedSearchFiltersComponent, ThemedSearchSettingsComponent, TranslateModule, AdvancedSearchComponent, AsyncPipe], + imports: [ + AdvancedSearchComponent, + AsyncPipe, + SearchSwitchConfigurationComponent, + ThemedSearchFiltersComponent, + ThemedSearchSettingsComponent, + TranslateModule, + ViewModeSwitchComponent, + ], }) /** diff --git a/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts b/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts index 1485e729dc..20a1208335 100644 --- a/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts @@ -25,7 +25,9 @@ import { SearchSidebarComponent } from './search-sidebar.component'; selector: 'ds-search-sidebar', templateUrl: '../../theme-support/themed.component.html', standalone: true, - imports: [SearchSidebarComponent], + imports: [ + SearchSidebarComponent, + ], }) export class ThemedSearchSidebarComponent extends ThemedComponent { diff --git a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts index 913b9cba0b..28fd6c793d 100644 --- a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts +++ b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Context } from '../../../core/shared/context.model'; import { SearchService } from '../../../core/shared/search/search.service'; @@ -73,7 +73,7 @@ describe('SearchSwitchConfigurationComponent', () => { comp = fixture.componentInstance; searchConfService = TestBed.inject(SEARCH_CONFIG_SERVICE as any); - spyOn(searchConfService, 'getCurrentConfiguration').and.returnValue(observableOf(MyDSpaceConfigurationValueType.Workspace)); + spyOn(searchConfService, 'getCurrentConfiguration').and.returnValue(of(MyDSpaceConfigurationValueType.Workspace)); comp.configurationList = configurationList; diff --git a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts index 5828e69c3b..0e244fdf22 100644 --- a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts +++ b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts @@ -30,7 +30,10 @@ import { SearchConfigurationOption } from './search-configuration-option.model'; styleUrls: ['./search-switch-configuration.component.scss'], templateUrl: './search-switch-configuration.component.html', standalone: true, - imports: [FormsModule, TranslateModule], + imports: [ + FormsModule, + TranslateModule, + ], }) /** * Represents a select that allow to switch over available search configurations diff --git a/src/app/shared/search/search.component.spec.ts b/src/app/shared/search/search.component.spec.ts index 8b533b4105..0a8d63f1ab 100644 --- a/src/app/shared/search/search.component.spec.ts +++ b/src/app/shared/search/search.component.spec.ts @@ -21,7 +21,7 @@ import { cold } from 'jasmine-marbles'; import { BehaviorSubject, Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -75,7 +75,7 @@ const store: Store = jasmine.createSpyObj('store', { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - select: observableOf(true), + select: of(true), }); const sortConfigList: SortConfig[] = [ { name: 'score', sortOrder: SortDirection.DESC }, @@ -130,11 +130,11 @@ const mockSearchResults: SearchObjects = Object.assign(new SearchO page: [mockDso, mockDso2], }); const mockResultsRD: RemoteData> = createSuccessfulRemoteDataObject(mockSearchResults); -const mockResultsRD$: Observable>> = observableOf(mockResultsRD); +const mockResultsRD$: Observable>> = of(mockResultsRD); const searchServiceStub = jasmine.createSpyObj('SearchService', { search: mockResultsRD$, getSearchLink: '/search', - getScopes: observableOf(['test-scope']), + getScopes: of(['test-scope']), getSearchConfigurationFor: createSuccessfulRemoteDataObject$(searchConfig), trackSearch: {}, }) as SearchService; @@ -153,7 +153,7 @@ const activatedRouteStub = { ['scope', scopeParam], ]), }, - queryParams: observableOf({ + queryParams: of({ query: queryParam, scope: scopeParam, }), @@ -175,14 +175,14 @@ const mockFilterConfig2: SearchFilterConfig = Object.assign(new SearchFilterConf }); const filtersConfigRD = createSuccessfulRemoteDataObject([mockFilterConfig, mockFilterConfig2]); -const filtersConfigRD$ = observableOf(filtersConfigRD); +const filtersConfigRD$ = of(filtersConfigRD); const routeServiceStub = { getQueryParameterValue: () => { - return observableOf(null); + return of(null); }, getQueryParamsWithPrefix: () => { - return observableOf(null); + return of(null); }, setParameter: (key: any, value: any) => { return; @@ -195,10 +195,10 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar searchConfigurationServiceStub = jasmine.createSpyObj('SearchConfigurationService', { getConfigurationSortOptions: sortOptionsList, getConfig: filtersConfigRD$, - getConfigurationSearchConfig: observableOf(searchConfig), - getCurrentConfiguration: observableOf('default'), - getCurrentScope: observableOf('test-id'), - getCurrentSort: observableOf(sortOptionsList[0]), + getConfigurationSearchConfig: of(searchConfig), + getCurrentConfiguration: of('default'), + getCurrentScope: of('test-id'), + getCurrentSort: of(sortOptionsList[0]), updateFixedFilter: jasmine.createSpy('updateFixedFilter'), setPaginationId: jasmine.createSpy('setPaginationId'), }); @@ -227,9 +227,9 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar }, { provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', { - isXs: observableOf(true), - isSm: observableOf(false), - isXsOrSm: observableOf(true), + isXs: of(true), + isSm: of(false), + isXsOrSm: of(true), }), }, { diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index aa1a37fe27..6969a741e4 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -94,11 +94,11 @@ import { SearchConfigurationOption } from './search-switch-configuration/search- AsyncPipe, NgTemplateOutlet, PageWithSidebarComponent, + SearchLabelsComponent, ThemedSearchFormComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, TranslateModule, - SearchLabelsComponent, ViewModeSwitchComponent, ], }) diff --git a/src/app/shared/search/themed-search.component.ts b/src/app/shared/search/themed-search.component.ts index dcd71ad655..e76a4d2f1a 100644 --- a/src/app/shared/search/themed-search.component.ts +++ b/src/app/shared/search/themed-search.component.ts @@ -23,7 +23,9 @@ import { SearchConfigurationOption } from './search-switch-configuration/search- selector: 'ds-search', templateUrl: '../theme-support/themed.component.html', standalone: true, - imports: [SearchComponent], + imports: [ + SearchComponent, + ], }) export class ThemedSearchComponent extends ThemedComponent { diff --git a/src/app/shared/sidebar/page-with-sidebar.component.spec.ts b/src/app/shared/sidebar/page-with-sidebar.component.spec.ts index d4cfdc951e..50f319e93a 100644 --- a/src/app/shared/sidebar/page-with-sidebar.component.spec.ts +++ b/src/app/shared/sidebar/page-with-sidebar.component.spec.ts @@ -5,7 +5,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { HostWindowService } from '../host-window.service'; import { SidebarServiceStub } from '../testing/sidebar-service.stub'; @@ -26,9 +26,9 @@ describe('PageWithSidebarComponent', () => { }, { provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', { - isXs: observableOf(true), - isSm: observableOf(false), - isXsOrSm: observableOf(true), + isXs: of(true), + isSm: of(false), + isXsOrSm: of(true), }), }, ], @@ -45,7 +45,7 @@ describe('PageWithSidebarComponent', () => { beforeEach(() => { menu = fixture.debugElement.query(By.css('#mock-id-sidebar-content')).nativeElement; - (comp as any).sidebarService.isCollapsed = observableOf(true); + (comp as any).sidebarService.isCollapsed = of(true); comp.ngOnInit(); fixture.detectChanges(); }); @@ -61,7 +61,7 @@ describe('PageWithSidebarComponent', () => { beforeEach(() => { menu = fixture.debugElement.query(By.css('#mock-id-sidebar-content')).nativeElement; - (comp as any).sidebarService.isCollapsed = observableOf(false); + (comp as any).sidebarService.isCollapsed = of(false); comp.ngOnInit(); fixture.detectChanges(); }); diff --git a/src/app/shared/sidebar/sidebar-dropdown.component.ts b/src/app/shared/sidebar/sidebar-dropdown.component.ts index b35fd12787..2dfb38424c 100644 --- a/src/app/shared/sidebar/sidebar-dropdown.component.ts +++ b/src/app/shared/sidebar/sidebar-dropdown.component.ts @@ -11,7 +11,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./sidebar-dropdown.component.scss'], templateUrl: './sidebar-dropdown.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) /** * This components renders a sidebar dropdown including the label. diff --git a/src/app/shared/sidebar/sidebar.service.spec.ts b/src/app/shared/sidebar/sidebar.service.spec.ts index f5c1b5c733..132b79f84e 100644 --- a/src/app/shared/sidebar/sidebar.service.spec.ts +++ b/src/app/shared/sidebar/sidebar.service.spec.ts @@ -3,7 +3,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { Store } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AppState } from '../../app.reducer'; import { HostWindowService } from '../host-window.service'; @@ -19,13 +19,13 @@ describe('SidebarService', () => { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - pipe: observableOf(true), + pipe: of(true), }); const windowService = jasmine.createSpyObj('hostWindowService', { - isXs: observableOf(true), - isSm: observableOf(false), - isXsOrSm: observableOf(true), + isXs: of(true), + isSm: of(false), + isXsOrSm: of(true), }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ diff --git a/src/app/shared/starts-with/date/starts-with-date.component.ts b/src/app/shared/starts-with/date/starts-with-date.component.ts index 53b9bb52f5..d3772cb711 100644 --- a/src/app/shared/starts-with/date/starts-with-date.component.ts +++ b/src/app/shared/starts-with/date/starts-with-date.component.ts @@ -21,7 +21,11 @@ import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; styleUrls: ['./starts-with-date.component.scss'], templateUrl: './starts-with-date.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class StartsWithDateComponent extends StartsWithAbstractComponent implements OnInit { diff --git a/src/app/shared/starts-with/text/starts-with-text.component.ts b/src/app/shared/starts-with/text/starts-with-text.component.ts index 7bd67cf399..e4d36f7c16 100644 --- a/src/app/shared/starts-with/text/starts-with-text.component.ts +++ b/src/app/shared/starts-with/text/starts-with-text.component.ts @@ -16,7 +16,11 @@ import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; styleUrls: ['./starts-with-text.component.scss'], templateUrl: './starts-with-text.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class StartsWithTextComponent extends StartsWithAbstractComponent { diff --git a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts index c6eee27e94..d03cb4d0d8 100644 --- a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts +++ b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts @@ -60,7 +60,16 @@ import { SubscriptionsDataService } from '../subscriptions-data.service'; templateUrl: './subscription-modal.component.html', styleUrls: ['./subscription-modal.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, ThemedTypeBadgeComponent, AlertComponent, AsyncPipe, KeyValuePipe, TranslateModule, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + FormsModule, + KeyValuePipe, + ReactiveFormsModule, + ThemedTypeBadgeComponent, + TranslateModule, + ], }) /** * Modal that allows to manage the subscriptions for the selected item diff --git a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts index ddd81830a4..e3479f3af0 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts @@ -20,7 +20,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { Item } from '../../../core/shared/item.model'; import { ITEM } from '../../../core/shared/item.resource-type'; @@ -47,7 +47,7 @@ describe('SubscriptionViewComponent', () => { let modalService; const subscriptionServiceStub = jasmine.createSpyObj('SubscriptionsDataService', { - getSubscriptionByPersonDSO: observableOf(findByEPersonAndDsoResEmpty), + getSubscriptionByPersonDSO: of(findByEPersonAndDsoResEmpty), deleteSubscription: createSuccessfulRemoteDataObject$({}), updateSubscription: createSuccessfulRemoteDataObject$({}), }); diff --git a/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts b/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts index ae590edb2a..7470ef5dab 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts @@ -30,7 +30,12 @@ import { SubscriptionsDataService } from '../subscriptions-data.service'; templateUrl: './subscription-view.component.html', styleUrls: ['./subscription-view.component.scss'], standalone: true, - imports: [ThemedTypeBadgeComponent, RouterLink, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + RouterLink, + ThemedTypeBadgeComponent, + TranslateModule, + ], }) /** * Table row representing a subscription that displays all information and action buttons to manage it diff --git a/src/app/shared/testing/auth-request-service.stub.ts b/src/app/shared/testing/auth-request-service.stub.ts index aeebc08df4..6a8f39f04e 100644 --- a/src/app/shared/testing/auth-request-service.stub.ts +++ b/src/app/shared/testing/auth-request-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { AuthStatus } from '../../core/auth/models/auth-status.model'; @@ -98,6 +98,6 @@ export class AuthRequestServiceStub { } public getShortlivedToken() { - return observableOf(this.mockShortLivedToken); + return of(this.mockShortLivedToken); } } diff --git a/src/app/shared/testing/auth-service.stub.ts b/src/app/shared/testing/auth-service.stub.ts index 56bfa98434..121b4bf16e 100644 --- a/src/app/shared/testing/auth-service.stub.ts +++ b/src/app/shared/testing/auth-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RetrieveAuthMethodsAction } from '../../core/auth/auth.actions'; @@ -37,7 +37,7 @@ export class AuthServiceStub { authStatus.authenticated = true; authStatus.token = this.token; authStatus.eperson = createSuccessfulRemoteDataObject$(EPersonMock); - return observableOf(authStatus); + return of(authStatus); } else { console.log('error'); throw (new Error('Message Error test')); @@ -46,22 +46,22 @@ export class AuthServiceStub { public authenticatedUser(token: AuthTokenInfo): Observable { if (token.accessToken === 'token_test') { - return observableOf(EPersonMock._links.self.href); + return of(EPersonMock._links.self.href); } else { throw (new Error('Message Error test')); } } public retrieveAuthenticatedUserByHref(href: string): Observable { - return observableOf(EPersonMock); + return of(EPersonMock); } public retrieveAuthenticatedUserById(id: string): Observable { - return observableOf(EPersonMock); + return of(EPersonMock); } getAuthenticatedUserFromStoreIfAuthenticated(): Observable { - return observableOf(EPersonMock); + return of(EPersonMock); } public buildAuthHeader(token?: AuthTokenInfo): string { @@ -73,11 +73,11 @@ export class AuthServiceStub { } public hasValidAuthenticationToken(): Observable { - return observableOf(this.token); + return of(this.token); } public logout(): Observable { - return observableOf(true); + return of(true); } public isTokenExpired(token?: AuthTokenInfo): boolean { @@ -99,11 +99,11 @@ export class AuthServiceStub { } public isTokenExpiring(): Observable { - return observableOf(false); + return of(false); } public refreshAuthenticationToken(token: AuthTokenInfo): Observable { - return observableOf(this.token); + return of(this.token); } public redirectToPreviousUrl() { @@ -119,7 +119,7 @@ export class AuthServiceStub { } getRedirectUrl() { - return observableOf(this.redirectUrl); + return of(this.redirectUrl); } public storeToken(token: AuthTokenInfo) { @@ -127,7 +127,7 @@ export class AuthServiceStub { } isAuthenticated() { - return observableOf(true); + return of(true); } checkAuthenticationCookie() { @@ -139,11 +139,11 @@ export class AuthServiceStub { } isExternalAuthentication(): Observable { - return observableOf(this._isExternalAuth); + return of(this._isExternalAuth); } retrieveAuthMethodsFromAuthStatus(status: AuthStatus) { - return observableOf(authMethodsMock); + return of(authMethodsMock); } impersonate(id: string) { diff --git a/src/app/shared/testing/authorization-service.stub.ts b/src/app/shared/testing/authorization-service.stub.ts index 8e7c0e586f..bafa8eefaf 100644 --- a/src/app/shared/testing/authorization-service.stub.ts +++ b/src/app/shared/testing/authorization-service.stub.ts @@ -1,12 +1,12 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; export class AuthorizationDataServiceStub { isAuthorized(featureId?: FeatureID, objectUrl?: string, ePersonUuid?: string): Observable { - return observableOf(false); + return of(false); } } diff --git a/src/app/shared/testing/base-data-service.stub.ts b/src/app/shared/testing/base-data-service.stub.ts index 65b761ba71..1dc6afe36b 100644 --- a/src/app/shared/testing/base-data-service.stub.ts +++ b/src/app/shared/testing/base-data-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { CacheableObject } from '../../core/cache/cacheable-object.model'; @@ -18,7 +18,7 @@ export abstract class BaseDataServiceStub { } invalidateByHref(_href: string): Observable { - return observableOf(true); + return of(true); } } diff --git a/src/app/shared/testing/bitstream-data-service.stub.ts b/src/app/shared/testing/bitstream-data-service.stub.ts index 932d20b323..5470486a19 100644 --- a/src/app/shared/testing/bitstream-data-service.stub.ts +++ b/src/app/shared/testing/bitstream-data-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; @@ -11,7 +11,7 @@ import { NoContent } from '../../core/shared/NoContent.model'; export class BitstreamDataServiceStub { removeMultiple(_bitstreams: Bitstream[]): Observable> { - return observableOf(new RemoteData(0, 0, 0, RequestEntryState.Success)); + return of(new RemoteData(0, 0, 0, RequestEntryState.Success)); } } diff --git a/src/app/shared/testing/browse-definition-data-service.stub.ts b/src/app/shared/testing/browse-definition-data-service.stub.ts index 3bad04b668..c24040edf5 100644 --- a/src/app/shared/testing/browse-definition-data-service.stub.ts +++ b/src/app/shared/testing/browse-definition-data-service.stub.ts @@ -1,7 +1,7 @@ import { EMPTY, Observable, - of as observableOf, + of, } from 'rxjs'; import { BrowseService } from '../../core/browse/browse.service'; @@ -46,14 +46,14 @@ export const BrowseDefinitionDataServiceStub: any = { * Get all BrowseDefinitions */ findAll(): Observable>> { - return observableOf(createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), mockData))); + return of(createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), mockData))); }, /** * Get all BrowseDefinitions with any link configuration */ findAllLinked(): Observable>> { - return observableOf(createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), mockData))); + return of(createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), mockData))); }, /** @@ -67,7 +67,7 @@ export const BrowseDefinitionDataServiceStub: any = { searchKeyArray = searchKeyArray.concat(BrowseService.toSearchKeyArray(metadataKey)); }); // Return just the first, as a pretend match - return observableOf(createSuccessfulRemoteDataObject(mockData[0])); + return of(createSuccessfulRemoteDataObject(mockData[0])); }, }; diff --git a/src/app/shared/testing/css-variable-service.stub.ts b/src/app/shared/testing/css-variable-service.stub.ts index 554bfaf179..75f647af72 100644 --- a/src/app/shared/testing/css-variable-service.stub.ts +++ b/src/app/shared/testing/css-variable-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { KeyValuePair } from '../key-value-pair.model'; @@ -14,11 +14,11 @@ const variables = { export class CSSVariableServiceStub { getVariable(name: string): Observable { - return observableOf('500px'); + return of('500px'); } getAllVariables(name: string): Observable { - return observableOf(variables); + return of(variables); } addCSSVariable(name: string, value: string): void { diff --git a/src/app/shared/testing/dso-edit-metadata-field.service.stub.ts b/src/app/shared/testing/dso-edit-metadata-field.service.stub.ts index 8c437e07c9..3e87348545 100644 --- a/src/app/shared/testing/dso-edit-metadata-field.service.stub.ts +++ b/src/app/shared/testing/dso-edit-metadata-field.service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; @@ -12,7 +12,7 @@ import { Vocabulary } from '../../core/submission/vocabularies/models/vocabulary export class DsoEditMetadataFieldServiceStub { findDsoFieldVocabulary(_dso: DSpaceObject, _mdField: string): Observable { - return observableOf(undefined); + return of(undefined); } } diff --git a/src/app/shared/testing/file-service.stub.ts b/src/app/shared/testing/file-service.stub.ts index c675df83e1..54ab933dfa 100644 --- a/src/app/shared/testing/file-service.stub.ts +++ b/src/app/shared/testing/file-service.stub.ts @@ -1,7 +1,7 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; export class FileServiceStub { retrieveFileDownloadLink() { - return observableOf(null); + return of(null); } } diff --git a/src/app/shared/testing/hal-endpoint-service.stub.ts b/src/app/shared/testing/hal-endpoint-service.stub.ts index f53eecb0bb..e5d26f4b69 100644 --- a/src/app/shared/testing/hal-endpoint-service.stub.ts +++ b/src/app/shared/testing/hal-endpoint-service.stub.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { hasValue } from '../empty.util'; @@ -7,8 +7,8 @@ export class HALEndpointServiceStub { constructor(private url: string) {} getEndpoint(path: string, startHref?: string) { if (hasValue(startHref)) { - return observableOf(startHref + '/' + path); + return of(startHref + '/' + path); } - return observableOf(this.url + '/' + path); + return of(this.url + '/' + path); } } diff --git a/src/app/shared/testing/host-window-service.stub.ts b/src/app/shared/testing/host-window-service.stub.ts index af1b159026..fd359d4c8f 100644 --- a/src/app/shared/testing/host-window-service.stub.ts +++ b/src/app/shared/testing/host-window-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { WidthCategory } from '../host-window.service'; @@ -19,7 +19,7 @@ export class HostWindowServiceStub { } isXs(): Observable { - return observableOf(this.width < 576); + return of(this.width < 576); } isXsOrSm(): Observable { diff --git a/src/app/shared/testing/menu-service.stub.ts b/src/app/shared/testing/menu-service.stub.ts index e2e1118021..4ef0210c50 100644 --- a/src/app/shared/testing/menu-service.stub.ts +++ b/src/app/shared/testing/menu-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { MenuID } from '../menu/menu-id.model'; @@ -70,42 +70,42 @@ export class MenuServiceStub { } isMenuVisible(id: MenuID): Observable { - return observableOf(true); + return of(true); } isMenuVisibleWithVisibleSections(id: MenuID): Observable { - return observableOf(true); + return of(true); } isMenuCollapsed(id: MenuID): Observable { - return observableOf(false); + return of(false); } isMenuPreviewCollapsed(id: MenuID): Observable { - return observableOf(true); + return of(true); } hasSubSections(id: MenuID, sectionID: string): Observable { - return observableOf(true); + return of(true); } getMenu(id: MenuID): Observable { // todo: resolve import - return observableOf({} as MenuState); + return of({} as MenuState); } getMenuTopSections(id: MenuID): Observable { - return observableOf([this.visibleSection1, this.visibleSection2]); + return of([this.visibleSection1, this.visibleSection2]); } getSubSectionsByParentID(id: MenuID): Observable { - return observableOf([this.subSection4]); + return of([this.subSection4]); } isSectionActive(id: MenuID, sectionID: string): Observable { - return observableOf(true); + return of(true); } isSectionVisible(id: MenuID, sectionID: string): Observable { - return observableOf(true); + return of(true); } } diff --git a/src/app/shared/testing/object-cache-service.stub.ts b/src/app/shared/testing/object-cache-service.stub.ts index d6b21b3922..d6b558c8d0 100644 --- a/src/app/shared/testing/object-cache-service.stub.ts +++ b/src/app/shared/testing/object-cache-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { CacheableObject } from '../../core/cache/cacheable-object.model'; @@ -19,11 +19,11 @@ export class ObjectCacheServiceStub { } getByHref(_href: string): Observable { - return observableOf(undefined); + return of(undefined); } hasByHref$(_href: string): Observable { - return observableOf(false); + return of(false); } addDependency(_href$: string | Observable, _dependsOnHref$: string | Observable): void { diff --git a/src/app/shared/testing/object-updates.service.stub.ts b/src/app/shared/testing/object-updates.service.stub.ts index c66cc3aa0d..69ec80d436 100644 --- a/src/app/shared/testing/object-updates.service.stub.ts +++ b/src/app/shared/testing/object-updates.service.stub.ts @@ -1,7 +1,7 @@ /* eslint-disable no-empty, @typescript-eslint/no-empty-function */ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { FieldUpdates } from '../../core/data/object-updates/field-updates.model'; @@ -18,7 +18,7 @@ export class ObjectUpdatesServiceStub { } getFieldUpdates(_url: string, _initialFields: Identifiable[], _ignoreStates?: boolean): Observable { - return observableOf({}); + return of({}); } } diff --git a/src/app/shared/testing/pagination-service.stub.ts b/src/app/shared/testing/pagination-service.stub.ts index 8755adc759..16a2f48ce7 100644 --- a/src/app/shared/testing/pagination-service.stub.ts +++ b/src/app/shared/testing/pagination-service.stub.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SortDirection, @@ -16,14 +16,14 @@ export class PaginationServiceStub { ) { } - getCurrentPagination = jasmine.createSpy('getCurrentPagination').and.returnValue(observableOf(this.pagination)); - getCurrentSort = jasmine.createSpy('getCurrentSort').and.returnValue(observableOf(this.sort)); - getFindListOptions = jasmine.createSpy('getFindListOptions').and.returnValue(observableOf(this.findlistOptions)); + getCurrentPagination = jasmine.createSpy('getCurrentPagination').and.returnValue(of(this.pagination)); + getCurrentSort = jasmine.createSpy('getCurrentSort').and.returnValue(of(this.sort)); + getFindListOptions = jasmine.createSpy('getFindListOptions').and.returnValue(of(this.findlistOptions)); resetPage = jasmine.createSpy('resetPage'); updateRoute = jasmine.createSpy('updateRoute'); updateRouteWithUrl = jasmine.createSpy('updateRouteWithUrl'); clearPagination = jasmine.createSpy('clearPagination'); - getRouteParameterValue = jasmine.createSpy('getRouteParameterValue').and.returnValue(observableOf('')); + getRouteParameterValue = jasmine.createSpy('getRouteParameterValue').and.returnValue(of('')); getPageParam = jasmine.createSpy('getPageParam').and.returnValue(`${this.pagination.id}.page`); } diff --git a/src/app/shared/testing/registry.service.stub.ts b/src/app/shared/testing/registry.service.stub.ts index 9d2ca1df42..a28ca7feef 100644 --- a/src/app/shared/testing/registry.service.stub.ts +++ b/src/app/shared/testing/registry.service.stub.ts @@ -1,7 +1,7 @@ /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { FindListOptions } from '../../core/data/find-list-options.model'; @@ -38,7 +38,7 @@ export class RegistryServiceStub { } getActiveMetadataSchema(): Observable { - return observableOf(undefined); + return of(undefined); } selectMetadataSchema(_schema: MetadataSchema): void { @@ -51,7 +51,7 @@ export class RegistryServiceStub { } getSelectedMetadataSchemas(): Observable { - return observableOf([]); + return of([]); } editMetadataField(_field: MetadataField): void { @@ -61,7 +61,7 @@ export class RegistryServiceStub { } getActiveMetadataField(): Observable { - return observableOf(undefined); + return of(undefined); } selectMetadataField(_field: MetadataField): void { @@ -74,11 +74,11 @@ export class RegistryServiceStub { } getSelectedMetadataFields(): Observable { - return observableOf([]); + return of([]); } createOrUpdateMetadataSchema(schema: MetadataSchema): Observable { - return observableOf(schema); + return of(schema); } deleteMetadataSchema(_id: number): Observable> { @@ -86,15 +86,15 @@ export class RegistryServiceStub { } clearMetadataSchemaRequests(): Observable { - return observableOf(''); + return of(''); } createMetadataField(field: MetadataField, _schema: MetadataSchema): Observable { - return observableOf(field); + return of(field); } updateMetadataField(field: MetadataField): Observable { - return observableOf(field); + return of(field); } deleteMetadataField(_id: number): Observable> { diff --git a/src/app/shared/testing/relationship-data.service.stub.ts b/src/app/shared/testing/relationship-data.service.stub.ts index f0463b3e6c..f520ddb1ff 100644 --- a/src/app/shared/testing/relationship-data.service.stub.ts +++ b/src/app/shared/testing/relationship-data.service.stub.ts @@ -1,7 +1,7 @@ /* eslint-disable no-empty, @typescript-eslint/no-empty-function */ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { FindListOptions } from '../../core/data/find-list-options.model'; @@ -33,11 +33,11 @@ export class RelationshipDataServiceStub { } getItemRelationshipsArray(_item: Item, ..._linksToFollow: FollowLinkConfig[]): Observable { - return observableOf([]); + return of([]); } getRelatedItems(_item: Item): Observable { - return observableOf([]); + return of([]); } getRelatedItemsByLabel(_item: Item, _label: string, _options?: FindListOptions): Observable>> { @@ -49,14 +49,14 @@ export class RelationshipDataServiceStub { } getRelationshipByItemsAndLabel(_item1: Item, _item2: Item, _label: string, _options?: FindListOptions): Observable { - return observableOf(new Relationship()); + return of(new Relationship()); } setNameVariant(_listID: string, _itemID: string, _nameVariant: string): void { } getNameVariant(_listID: string, _itemID: string): Observable { - return observableOf(''); + return of(''); } updateNameVariant(_item1: Item, _item2: Item, _relationshipLabel: string, _nameVariant: string): Observable> { @@ -64,7 +64,7 @@ export class RelationshipDataServiceStub { } isLeftItem(_relationship: Relationship, _item: Item): Observable { - return observableOf(false); + return of(false); } update(_object: Relationship): Observable> { @@ -80,7 +80,7 @@ export class RelationshipDataServiceStub { } resolveMetadataRepresentation(_metadatum: MetadataValue, _parentItem: DSpaceObject, _itemType: string): Observable { - return observableOf({} as MetadataRepresentation); + return of({} as MetadataRepresentation); } } diff --git a/src/app/shared/testing/request-service.stub.ts b/src/app/shared/testing/request-service.stub.ts index a0f05f4b50..9eef715488 100644 --- a/src/app/shared/testing/request-service.stub.ts +++ b/src/app/shared/testing/request-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; /** @@ -9,7 +9,7 @@ import { export class RequestServiceStub { removeByHrefSubstring(_href: string): Observable { - return observableOf(true); + return of(true); } } diff --git a/src/app/shared/testing/route-service.stub.ts b/src/app/shared/testing/route-service.stub.ts index 3098f9f91e..115b1d9692 100644 --- a/src/app/shared/testing/route-service.stub.ts +++ b/src/app/shared/testing/route-service.stub.ts @@ -1,6 +1,6 @@ import { EMPTY, - of as observableOf, + of, } from 'rxjs'; export const routeServiceStub: any = { @@ -18,28 +18,28 @@ export const routeServiceStub: any = { return EMPTY; }, getQueryParameterValues: (param: string) => { - return observableOf({}); + return of({}); }, getQueryParamsWithPrefix: (param: string) => { - return observableOf({}); + return of({}); }, getQueryParamMap: () => { - return observableOf(new Map()); + return of(new Map()); }, getQueryParameterValue: () => { - return observableOf({}); + return of({}); }, getRouteParameterValue: (param) => { - return observableOf(''); + return of(''); }, getRouteDataValue: (param) => { - return observableOf({}); + return of({}); }, getHistory: () => { - return observableOf(['/home', '/collection/123', '/home']); + return of(['/home', '/collection/123', '/home']); }, getPreviousUrl: () => { - return observableOf('/home'); + return of('/home'); }, setParameter: (key: any, value: any) => { return; diff --git a/src/app/shared/testing/router.stub.ts b/src/app/shared/testing/router.stub.ts index 4e7b0e460b..3fe64c481c 100644 --- a/src/app/shared/testing/router.stub.ts +++ b/src/app/shared/testing/router.stub.ts @@ -1,4 +1,4 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; export class RouterStub { url: string; @@ -6,7 +6,7 @@ export class RouterStub { //noinspection TypeScriptUnresolvedFunction navigate = jasmine.createSpy('navigate'); parseUrl = jasmine.createSpy('parseUrl'); - events = observableOf({}); + events = of({}); navigateByUrl(url): void { this.url = url; } diff --git a/src/app/shared/testing/script-service.stub.ts b/src/app/shared/testing/script-service.stub.ts index eafc5d36ff..747fdbc08e 100644 --- a/src/app/shared/testing/script-service.stub.ts +++ b/src/app/shared/testing/script-service.stub.ts @@ -8,7 +8,7 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; /** @@ -16,6 +16,6 @@ import { */ export class ScriptServiceStub { scriptWithNameExistsAndCanExecute(scriptName: string): Observable { - return observableOf(true); + return of(true); } } diff --git a/src/app/shared/testing/search-configuration-service.stub.ts b/src/app/shared/testing/search-configuration-service.stub.ts index 426dc72930..e06f2ab691 100644 --- a/src/app/shared/testing/search-configuration-service.stub.ts +++ b/src/app/shared/testing/search-configuration-service.stub.ts @@ -2,7 +2,7 @@ import { Params } from '@angular/router'; import { BehaviorSubject, Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -23,47 +23,47 @@ export class SearchConfigurationServiceStub { public paginatedSearchOptions: BehaviorSubject = new BehaviorSubject(new PaginatedSearchOptions({})); getCurrentFrontendFilters() { - return observableOf([]); + return of([]); } getCurrentFilters() { - return observableOf([]); + return of([]); } getCurrentScope(a) { - return observableOf('test-id'); + return of('test-id'); } getCurrentQuery(a) { - return observableOf(a); + return of(a); } getCurrentConfiguration(a) { - return observableOf(a); + return of(a); } getConfigurationAdvancedSearchFilters(_configuration: string, _scope?: string): Observable { - return observableOf([]); + return of([]); } getConfig () { - return observableOf({ hasSucceeded: true, payload: [] }); + return of({ hasSucceeded: true, payload: [] }); } getConfigurationSearchConfig(_configuration: string, _scope?: string): Observable { - return observableOf(new SearchConfig()); + return of(new SearchConfig()); } getAvailableConfigurationOptions() { - return observableOf([{ value: 'test', label: 'test' }]); + return of([{ value: 'test', label: 'test' }]); } unselectAppliedFilterParams(_filterName: string, _value: string, _operator?: string): Observable { - return observableOf({}); + return of({}); } selectNewAppliedFilterParams(_filterName: string, _value: string, _operator?: string): Observable { - return observableOf({}); + return of({}); } } diff --git a/src/app/shared/testing/search-filter-service.stub.ts b/src/app/shared/testing/search-filter-service.stub.ts index 1c82a44888..6600796e03 100644 --- a/src/app/shared/testing/search-filter-service.stub.ts +++ b/src/app/shared/testing/search-filter-service.stub.ts @@ -1,7 +1,7 @@ import { Params } from '@angular/router'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -18,19 +18,19 @@ import { SearchFilterConfig } from '../search/models/search-filter-config.model' export class SearchFilterServiceStub { isFilterActiveWithValue(_paramName: string, _filterValue: string): Observable { - return observableOf(true); + return of(true); } isFilterActive(_paramName: string): Observable { - return observableOf(true); + return of(true); } getCurrentScope(): Observable { - return observableOf(undefined); + return of(undefined); } getCurrentQuery(): Observable { - return observableOf(undefined); + return of(undefined); } getCurrentPagination(_pagination: any = {}): Observable { @@ -38,23 +38,23 @@ export class SearchFilterServiceStub { } getCurrentSort(_defaultSort: SortOptions): Observable { - return observableOf(new SortOptions('', SortDirection.ASC)); + return of(new SortOptions('', SortDirection.ASC)); } getCurrentFilters(): Observable { - return observableOf({}); + return of({}); } getCurrentView(): Observable { - return observableOf(undefined); + return of(undefined); } isCollapsed(_filterName: string): Observable { - return observableOf(true); + return of(true); } getPage(_filterName: string): Observable { - return observableOf(1); + return of(1); } collapse(_filterName: string): void { diff --git a/src/app/shared/testing/search-service.stub.ts b/src/app/shared/testing/search-service.stub.ts index 552fee9a05..68ffba74a0 100644 --- a/src/app/shared/testing/search-service.stub.ts +++ b/src/app/shared/testing/search-service.stub.ts @@ -1,7 +1,7 @@ import { BehaviorSubject, Observable, - of as observableOf, + of, } from 'rxjs'; import { ViewMode } from '../../core/shared/view-mode.model'; @@ -24,7 +24,7 @@ export class SearchServiceStub { } getSelectedValuesForFilter(_filterName: string): Observable { - return observableOf([]); + return of([]); } getViewMode(): Observable { @@ -53,10 +53,10 @@ export class SearchServiceStub { } getFilterLabels() { - return observableOf([]); + return of([]); } search() { - return observableOf({}); + return of({}); } } diff --git a/src/app/shared/testing/sidebar-service.stub.ts b/src/app/shared/testing/sidebar-service.stub.ts index d10eb71227..00e49a4d4b 100644 --- a/src/app/shared/testing/sidebar-service.stub.ts +++ b/src/app/shared/testing/sidebar-service.stub.ts @@ -1,14 +1,14 @@ -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; export class SidebarServiceStub { - isCollapsed = observableOf(true); + isCollapsed = of(true); collapse(): void { - this.isCollapsed = observableOf(true); + this.isCollapsed = of(true); } expand(): void { - this.isCollapsed = observableOf(false); + this.isCollapsed = of(false); } } diff --git a/src/app/shared/testing/submission-rest-service.stub.ts b/src/app/shared/testing/submission-rest-service.stub.ts index 677fb05026..9942d2c4fa 100644 --- a/src/app/shared/testing/submission-rest-service.stub.ts +++ b/src/app/shared/testing/submission-rest-service.stub.ts @@ -1,5 +1,5 @@ import { Store } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { CoreState } from '../../core/core-state.model'; import { RequestService } from '../../core/data/request.service'; @@ -17,6 +17,6 @@ export class SubmissionRestServiceStub { getDataByHref = jasmine.createSpy('getDataByHref'); getEndpointByIDHref = jasmine.createSpy('getEndpointByIDHref'); patchToEndpoint = jasmine.createSpy('patchToEndpoint'); - postToEndpoint = jasmine.createSpy('postToEndpoint').and.returnValue(observableOf({})); + postToEndpoint = jasmine.createSpy('postToEndpoint').and.returnValue(of({})); submitData = jasmine.createSpy('submitData'); } diff --git a/src/app/shared/testing/translate-loader.mock.ts b/src/app/shared/testing/translate-loader.mock.ts index ea1ee7528e..2c636caab2 100644 --- a/src/app/shared/testing/translate-loader.mock.ts +++ b/src/app/shared/testing/translate-loader.mock.ts @@ -1,11 +1,11 @@ import { TranslateLoader } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; export class TranslateLoaderMock implements TranslateLoader { getTranslation(lang: string): Observable { - return observableOf({}); + return of({}); } } diff --git a/src/app/shared/testing/truncatable-service.stub.ts b/src/app/shared/testing/truncatable-service.stub.ts index 05fcc36f87..074781d027 100644 --- a/src/app/shared/testing/truncatable-service.stub.ts +++ b/src/app/shared/testing/truncatable-service.stub.ts @@ -1,12 +1,12 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; export class TruncatableServiceStub { isCollapsed(_id: string): Observable { - return observableOf(false); + return of(false); } // eslint-disable-next-line no-empty, @typescript-eslint/no-empty-function diff --git a/src/app/shared/testing/utils.test.ts b/src/app/shared/testing/utils.test.ts index a318f0b547..134b2bc05d 100644 --- a/src/app/shared/testing/utils.test.ts +++ b/src/app/shared/testing/utils.test.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -97,7 +97,7 @@ export function spyOnExported(target: T, prop: keyof T): jasmine.Spy { * @param errorMessage */ export function createRequestEntry$(unCacheableObject?: UnCacheableObject, statusCode = 200, errorMessage?: string): Observable { - return observableOf({ + return of({ request: undefined, state: RequestEntryState.Success, response: { diff --git a/src/app/shared/testing/vocabulary-service.stub.ts b/src/app/shared/testing/vocabulary-service.stub.ts index 10f2978e32..d81a14a963 100644 --- a/src/app/shared/testing/vocabulary-service.stub.ts +++ b/src/app/shared/testing/vocabulary-service.stub.ts @@ -1,6 +1,6 @@ import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -38,11 +38,11 @@ export class VocabularyServiceStub { } getVocabularyEntryByValue(value: string, vocabularyOptions: VocabularyOptions): Observable { - return observableOf(Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 })); + return of(Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 })); } getVocabularyEntryByID(id: string, vocabularyOptions: VocabularyOptions): Observable { - return observableOf(Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 })); + return of(Object.assign(new VocabularyEntry(), { authority: 1, display: 'one', value: 1 })); } findVocabularyById(id: string): Observable> { diff --git a/src/app/shared/theme-support/theme.model.ts b/src/app/shared/theme-support/theme.model.ts index 07c200ce06..4ff81b96b0 100644 --- a/src/app/shared/theme-support/theme.model.ts +++ b/src/app/shared/theme-support/theme.model.ts @@ -3,7 +3,7 @@ import { Injector } from '@angular/core'; import { combineLatest, Observable, - of as observableOf, + of, } from 'rxjs'; import { map, @@ -32,7 +32,7 @@ export class Theme { } matches(url: string, dso: DSpaceObject): Observable { - return observableOf(true); + return of(true); } } @@ -56,7 +56,7 @@ export class RegExTheme extends Theme { match = url.match(this.regex); } - return observableOf(hasValue(match)); + return of(hasValue(match)); } } @@ -80,7 +80,7 @@ export class HandleTheme extends Theme { take(1), ); } else { - return observableOf(false); + return of(false); } } } @@ -91,7 +91,7 @@ export class UUIDTheme extends Theme { } matches(url: string, dso: DSpaceObject): Observable { - return observableOf(hasValue(dso) && dso.uuid === this.config.uuid); + return of(hasValue(dso) && dso.uuid === this.config.uuid); } } diff --git a/src/app/shared/theme-support/theme.service.spec.ts b/src/app/shared/theme-support/theme.service.spec.ts index c012932705..1bf761c7f9 100644 --- a/src/app/shared/theme-support/theme.service.spec.ts +++ b/src/app/shared/theme-support/theme.service.spec.ts @@ -11,7 +11,7 @@ import { provideMockActions } from '@ngrx/effects/testing'; import { ROUTER_NAVIGATED } from '@ngrx/router-store'; import { provideMockStore } from '@ngrx/store/testing'; import { hot } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LinkService } from '../../core/cache/builders/link.service'; import { ConfigurationDataService } from '../../core/data/configuration-data.service'; @@ -124,8 +124,8 @@ describe('ThemeService', () => { }); function spyOnPrivateMethods() { - spyOn((themeService as any), 'getAncestorDSOs').and.returnValue(() => observableOf([dso])); - spyOn((themeService as any), 'matchThemeToDSOs').and.returnValue(observableOf(new Theme({ name: 'custom' }))); + spyOn((themeService as any), 'getAncestorDSOs').and.returnValue(() => of([dso])); + spyOn((themeService as any), 'matchThemeToDSOs').and.returnValue(of(new Theme({ name: 'custom' }))); spyOn((themeService as any), 'getActionForMatch').and.returnValue(new SetThemeAction('custom')); } @@ -296,13 +296,13 @@ describe('ThemeService', () => { beforeEach(() => { nonMatchingTheme = Object.assign(new Theme({ name: 'non-matching-theme' }), { - matches: () => observableOf(false), + matches: () => of(false), }); itemMatchingTheme = Object.assign(new Theme({ name: 'item-matching-theme' }), { - matches: (url, dso) => observableOf((dso as any).type === ITEM.value), + matches: (url, dso) => of((dso as any).type === ITEM.value), }); communityMatchingTheme = Object.assign(new Theme({ name: 'community-matching-theme' }), { - matches: (url, dso) => observableOf((dso as any).type === COMMUNITY.value), + matches: (url, dso) => of((dso as any).type === COMMUNITY.value), }); dsos = [ Object.assign(new Item(), { @@ -377,7 +377,7 @@ describe('ThemeService', () => { _links: { owningCollection: { href: 'owning-collection-link' } }, }); - observableOf(dso).pipe( + of(dso).pipe( (themeService as any).getAncestorDSOs(), ).subscribe((result) => { expect(result).toEqual([dso, ...ancestorDSOs]); @@ -391,7 +391,7 @@ describe('ThemeService', () => { uuid: 'item-uuid', }; - observableOf(dso).pipe( + of(dso).pipe( (themeService as any).getAncestorDSOs(), ).subscribe((result) => { expect(result).toEqual([dso]); @@ -432,7 +432,7 @@ describe('ThemeService', () => { themeService = TestBed.inject(ThemeService); spyOn(themeService, 'getThemeName').and.returnValue('custom'); - spyOn(themeService, 'getThemeName$').and.returnValue(observableOf('custom')); + spyOn(themeService, 'getThemeName$').and.returnValue(of('custom')); }); it('should append a link element with the correct attributes to the head element', () => { diff --git a/src/app/shared/theme-support/theme.service.ts b/src/app/shared/theme-support/theme.service.ts index 6d0ba38b5b..197312777c 100644 --- a/src/app/shared/theme-support/theme.service.ts +++ b/src/app/shared/theme-support/theme.service.ts @@ -21,7 +21,7 @@ import { EMPTY, from, Observable, - of as observableOf, + of, } from 'rxjs'; import { defaultIfEmpty, @@ -346,7 +346,7 @@ export class ThemeService { const dsoRD: RemoteData = snapshotWithData.data.dso; if (dsoRD.hasSucceeded) { // Start with the resolved dso and go recursively through its parents until you reach the top-level community - return observableOf(dsoRD.payload).pipe( + return of(dsoRD.payload).pipe( this.getAncestorDSOs(), switchMap((dsos: DSpaceObject[]) => { return this.matchThemeToDSOs(dsos, currentRouteUrl); @@ -385,7 +385,7 @@ export class ThemeService { ); } else { // If there are no themes configured, do nothing - return observableOf(new NoOpAction()); + return of(new NoOpAction()); } }), take(1), diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index dbc237044d..9238347348 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -16,7 +16,7 @@ import { combineLatest, from as fromPromise, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -115,7 +115,7 @@ export abstract class ThemedComponent implements AfterViewInit if (hasNoValue(this.lazyLoadObs)) { this.lazyLoadObs = combineLatest([ - observableOf(changes), + of(changes), this.resolveThemedComponent(this.themeService.getThemeName()).pipe( switchMap((themedFile: any) => { if (hasValue(themedFile) && hasValue(themedFile[this.getComponentName()])) { @@ -194,7 +194,7 @@ export abstract class ThemedComponent implements AfterViewInit ); } else { // If we got here, we've failed to import this component from any ancestor theme → fall back to unthemed - return observableOf(null); + return of(null); } } } diff --git a/src/app/shared/trackable/abstract-trackable.component.spec.ts b/src/app/shared/trackable/abstract-trackable.component.spec.ts index 5667bc4b8b..2b295b8e9c 100644 --- a/src/app/shared/trackable/abstract-trackable.component.spec.ts +++ b/src/app/shared/trackable/abstract-trackable.component.spec.ts @@ -7,7 +7,7 @@ import { import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { ObjectUpdatesService } from '../../core/data/object-updates/object-updates.service'; @@ -46,11 +46,11 @@ describe('AbstractTrackableComponent', () => { { saveAddFieldUpdate: {}, discardFieldUpdates: {}, - reinstateFieldUpdates: observableOf(true), + reinstateFieldUpdates: of(true), initialize: {}, - hasUpdates: observableOf(true), - isReinstatable: observableOf(false), // should always return something --> its in ngOnInit - isValidPage: observableOf(true), + hasUpdates: of(true), + isReinstatable: of(false), // should always return something --> its in ngOnInit + isValidPage: of(true), }, ); router = new RouterStub(); @@ -90,7 +90,7 @@ describe('AbstractTrackableComponent', () => { describe('isReinstatable', () => { beforeEach(() => { - objectUpdatesService.isReinstatable.and.returnValue(observableOf(true)); + objectUpdatesService.isReinstatable.and.returnValue(of(true)); }); it('should return an observable that emits true', () => { @@ -101,7 +101,7 @@ describe('AbstractTrackableComponent', () => { describe('hasChanges', () => { beforeEach(() => { - objectUpdatesService.hasUpdates.and.returnValue(observableOf(true)); + objectUpdatesService.hasUpdates.and.returnValue(of(true)); }); it('should return an observable that emits true', () => { diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts index 7b3ac2242b..196c93d74d 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts @@ -14,7 +14,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { NativeWindowRef, @@ -40,9 +40,9 @@ describe('TruncatablePartComponent', () => { truncatableService = { isCollapsed: (id: string) => { if (id === id1) { - return observableOf(true); + return of(true); } else { - return observableOf(false); + return of(false); } }, }; diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts index 61f637c16a..4b628a12e3 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts @@ -19,7 +19,10 @@ import { TruncatableService } from '../truncatable.service'; templateUrl: './truncatable-part.component.html', styleUrls: ['./truncatable-part.component.scss'], standalone: true, - imports: [DragClickDirective, TranslateModule], + imports: [ + DragClickDirective, + TranslateModule, + ], }) /** diff --git a/src/app/shared/truncatable/truncatable.service.spec.ts b/src/app/shared/truncatable/truncatable.service.spec.ts index 9889b97883..94a8992f9c 100644 --- a/src/app/shared/truncatable/truncatable.service.spec.ts +++ b/src/app/shared/truncatable/truncatable.service.spec.ts @@ -3,7 +3,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { Store } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TruncatableCollapseAction, @@ -20,7 +20,7 @@ describe('TruncatableService', () => { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - select: observableOf(true), + select: of(true), }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts index e937b1ea0f..7ca1d6b98e 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts @@ -16,7 +16,7 @@ import { } from 'ng2-file-upload'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { FileValidator } from '../../utils/require-file.validator'; @@ -35,10 +35,10 @@ import { UploaderOptions } from '../uploader/uploader-options.model'; styleUrls: ['./file-dropzone-no-uploader.scss'], imports: [ CommonModule, - FormsModule, - TranslateModule, FileUploadModule, FileValidator, + FormsModule, + TranslateModule, ], standalone: true, }) @@ -75,7 +75,7 @@ export class FileDropzoneNoUploaderComponent implements OnInit { */ ngOnInit() { this.uploaderId = 'ds-drag-and-drop-uploader' + uniqueId(); - this.isOverDocumentDropZone = observableOf(false); + this.isOverDocumentDropZone = of(false); this.uploader = new FileUploader({ // required, but using onFileDrop, not uploader url: 'placeholder', @@ -94,7 +94,7 @@ export class FileDropzoneNoUploaderComponent implements OnInit { event.preventDefault(); event.stopPropagation(); if ((event.target as HTMLElement).tagName !== 'HTML') { - this.isOverDocumentDropZone = observableOf(true); + this.isOverDocumentDropZone = of(true); } } @@ -103,7 +103,7 @@ export class FileDropzoneNoUploaderComponent implements OnInit { */ public fileOverDocument(isOver: boolean) { if (!isOver) { - this.isOverDocumentDropZone = observableOf(isOver); + this.isOverDocumentDropZone = of(isOver); } } diff --git a/src/app/shared/upload/uploader/uploader.component.spec.ts b/src/app/shared/upload/uploader/uploader.component.spec.ts index 90563f1080..5b8bf98829 100644 --- a/src/app/shared/upload/uploader/uploader.component.spec.ts +++ b/src/app/shared/upload/uploader/uploader.component.spec.ts @@ -73,7 +73,10 @@ describe('Chips component', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [FileUploadModule, UploaderComponent], + imports: [ + FileUploadModule, + UploaderComponent, + ], }) class TestComponent { public uploadFilesOptions: UploaderOptions = Object.assign(new UploaderOptions(), { diff --git a/src/app/shared/upload/uploader/uploader.component.ts b/src/app/shared/upload/uploader/uploader.component.ts index 804200d220..6a80230e8a 100644 --- a/src/app/shared/upload/uploader/uploader.component.ts +++ b/src/app/shared/upload/uploader/uploader.component.ts @@ -18,7 +18,7 @@ import { FileUploader, FileUploadModule, } from 'ng2-file-upload'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { DragService } from '../../../core/drag.service'; import { CookieService } from '../../../core/services/cookie.service'; @@ -43,7 +43,12 @@ import { UploaderProperties } from './uploader-properties.model'; changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.Emulated, standalone: true, - imports: [TranslateModule, FileUploadModule, CommonModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + CommonModule, + FileUploadModule, + TranslateModule, + ], }) export class UploaderComponent implements OnInit, AfterViewInit { @@ -104,8 +109,8 @@ export class UploaderComponent implements OnInit, AfterViewInit { public uploader: FileUploader; public uploaderId: string; - public isOverBaseDropZone = observableOf(false); - public isOverDocumentDropZone = observableOf(false); + public isOverBaseDropZone = of(false); + public isOverDocumentDropZone = of(false); @HostListener('window:dragover', ['$event']) onDragOver(event: any) { @@ -114,7 +119,7 @@ export class UploaderComponent implements OnInit, AfterViewInit { // Show drop area on the page event.preventDefault(); if ((event.target as any).tagName !== 'HTML') { - this.isOverDocumentDropZone = observableOf(true); + this.isOverDocumentDropZone = of(true); } } } @@ -175,7 +180,7 @@ export class UploaderComponent implements OnInit, AfterViewInit { this.uploader.options.headers.push({ name: this.ON_BEHALF_HEADER, value: this.uploadFilesOptions.impersonatingID }); } this.onBeforeUpload(); - this.isOverDocumentDropZone = observableOf(false); + this.isOverDocumentDropZone = of(false); }; if (hasValue(this.uploadProperties)) { this.uploader.onBuildItemForm = (item, form) => { @@ -218,7 +223,7 @@ export class UploaderComponent implements OnInit, AfterViewInit { * Called when files are dragged on the base drop area. */ public fileOverBase(isOver: boolean): void { - this.isOverBaseDropZone = observableOf(isOver); + this.isOverBaseDropZone = of(isOver); } /** @@ -226,7 +231,7 @@ export class UploaderComponent implements OnInit, AfterViewInit { */ public fileOverDocument(isOver: boolean) { if (!isOver) { - this.isOverDocumentDropZone = observableOf(isOver); + this.isOverDocumentDropZone = of(isOver); } } diff --git a/src/app/shared/utils/markdown.directive.spec.ts b/src/app/shared/utils/markdown.directive.spec.ts index b984543c40..133a0de91f 100644 --- a/src/app/shared/utils/markdown.directive.spec.ts +++ b/src/app/shared/utils/markdown.directive.spec.ts @@ -16,7 +16,9 @@ import { MarkdownDirective } from './markdown.directive'; @Component({ template: `
`, standalone: true, - imports: [ MarkdownDirective ], + imports: [ + MarkdownDirective, + ], }) class TestComponent {} diff --git a/src/app/shared/utils/metadatafield-validator.directive.ts b/src/app/shared/utils/metadatafield-validator.directive.ts index 3112d4870b..0d45cd057e 100644 --- a/src/app/shared/utils/metadatafield-validator.directive.ts +++ b/src/app/shared/utils/metadatafield-validator.directive.ts @@ -10,7 +10,7 @@ import { } from '@angular/forms'; import { Observable, - of as observableOf, + of, timer as observableTimer, } from 'rxjs'; import { @@ -50,11 +50,11 @@ export class MetadataFieldValidator implements AsyncValidator { const resTimer = observableTimer(500).pipe( switchMap(() => { if (!control.value) { - return observableOf({ invalidMetadataField: { value: control.value } }); + return of({ invalidMetadataField: { value: control.value } }); } const mdFieldNameParts = control.value.split('.'); if (mdFieldNameParts.length < 2) { - return observableOf({ invalidMetadataField: { value: control.value } }); + return of({ invalidMetadataField: { value: control.value } }); } const res = this.metadataFieldService.findByExactFieldName(control.value) diff --git a/src/app/shared/view-mode-switch/view-mode-switch.component.ts b/src/app/shared/view-mode-switch/view-mode-switch.component.ts index 14f1248102..c47f55a267 100644 --- a/src/app/shared/view-mode-switch/view-mode-switch.component.ts +++ b/src/app/shared/view-mode-switch/view-mode-switch.component.ts @@ -34,7 +34,12 @@ import { currentPath } from '../utils/route.utils'; styleUrls: ['./view-mode-switch.component.scss'], templateUrl: './view-mode-switch.component.html', standalone: true, - imports: [RouterLink, RouterLinkActive, TranslateModule, BrowserOnlyPipe], + imports: [ + BrowserOnlyPipe, + RouterLink, + RouterLinkActive, + TranslateModule, + ], }) export class ViewModeSwitchComponent implements OnInit, OnDestroy { diff --git a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts index c78fef0521..3c481d40bd 100644 --- a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts +++ b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts @@ -11,7 +11,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -32,7 +32,7 @@ describe('CollectionStatisticsPageComponent', () => { beforeEach(waitForAsync(() => { const activatedRoute = { - data: observableOf({ + data: of({ scope: createSuccessfulRemoteDataObject( Object.assign(new Collection(), { id: 'collection_id', @@ -49,7 +49,7 @@ describe('CollectionStatisticsPageComponent', () => { }; spyOn(usageReportService, 'getStatistic').and.callFake( - (scope, type) => observableOf( + (scope, type) => of( Object.assign( new UsageReport(), { id: `${scope}-${type}-report`, @@ -60,11 +60,11 @@ describe('CollectionStatisticsPageComponent', () => { ); const nameService = { - getName: () => observableOf('test dso name'), + getName: () => of('test dso name'), }; const authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); diff --git a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts index e07a506b7c..c8ab417397 100644 --- a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts +++ b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts @@ -16,7 +16,13 @@ import { StatisticsTableComponent } from '../statistics-table/statistics-table.c templateUrl: '../statistics-page/statistics-page.component.html', styleUrls: ['./collection-statistics-page.component.scss'], standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class CollectionStatisticsPageComponent extends StatisticsPageDirective { diff --git a/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts b/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts index 2b4fa2f386..480d3274e6 100644 --- a/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts +++ b/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts @@ -11,7 +11,9 @@ import { CollectionStatisticsPageComponent } from './collection-statistics-page. styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [CollectionStatisticsPageComponent], + imports: [ + CollectionStatisticsPageComponent, + ], }) export class ThemedCollectionStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts index e29e37880f..6cd69c7da7 100644 --- a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts +++ b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts @@ -11,7 +11,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -32,7 +32,7 @@ describe('CommunityStatisticsPageComponent', () => { beforeEach(waitForAsync(() => { const activatedRoute = { - data: observableOf({ + data: of({ scope: createSuccessfulRemoteDataObject( Object.assign(new Community(), { id: 'community_id', @@ -49,7 +49,7 @@ describe('CommunityStatisticsPageComponent', () => { }; spyOn(usageReportService, 'getStatistic').and.callFake( - (scope, type) => observableOf( + (scope, type) => of( Object.assign( new UsageReport(), { id: `${scope}-${type}-report`, @@ -60,11 +60,11 @@ describe('CommunityStatisticsPageComponent', () => { ); const nameService = { - getName: () => observableOf('test dso name'), + getName: () => of('test dso name'), }; const authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); diff --git a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts index 72a2c46b9e..7ae4d3baef 100644 --- a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts +++ b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts @@ -16,7 +16,13 @@ import { StatisticsTableComponent } from '../statistics-table/statistics-table.c templateUrl: '../statistics-page/statistics-page.component.html', styleUrls: ['./community-statistics-page.component.scss'], standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class CommunityStatisticsPageComponent extends StatisticsPageDirective { diff --git a/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts b/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts index 88688ef137..8f0ab74eea 100644 --- a/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts +++ b/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts @@ -11,7 +11,9 @@ import { CommunityStatisticsPageComponent } from './community-statistics-page.co styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [CommunityStatisticsPageComponent], + imports: [ + CommunityStatisticsPageComponent, + ], }) export class ThemedCommunityStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts index f5f3361cce..422c9e3bfe 100644 --- a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts +++ b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts @@ -11,7 +11,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -32,7 +32,7 @@ describe('ItemStatisticsPageComponent', () => { beforeEach(waitForAsync(() => { const activatedRoute = { - data: observableOf({ + data: of({ scope: createSuccessfulRemoteDataObject( Object.assign(new Item(), { id: 'item_id', @@ -49,7 +49,7 @@ describe('ItemStatisticsPageComponent', () => { }; spyOn(usageReportService, 'getStatistic').and.callFake( - (scope, type) => observableOf( + (scope, type) => of( Object.assign( new UsageReport(), { id: `${scope}-${type}-report`, @@ -60,11 +60,11 @@ describe('ItemStatisticsPageComponent', () => { ); const nameService = { - getName: () => observableOf('test dso name'), + getName: () => of('test dso name'), }; const authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); diff --git a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts index 702e39806f..4d4c7b7d38 100644 --- a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts +++ b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts @@ -16,7 +16,13 @@ import { StatisticsTableComponent } from '../statistics-table/statistics-table.c templateUrl: '../statistics-page/statistics-page.component.html', styleUrls: ['./item-statistics-page.component.scss'], standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class ItemStatisticsPageComponent extends StatisticsPageDirective { diff --git a/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts b/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts index 88d4c04d15..6e49ac7cb2 100644 --- a/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts +++ b/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts @@ -11,7 +11,9 @@ import { ItemStatisticsPageComponent } from './item-statistics-page.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [ItemStatisticsPageComponent], + imports: [ + ItemStatisticsPageComponent, + ], }) export class ThemedItemStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts index 9b23afdd74..b7996bfadc 100644 --- a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts +++ b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts @@ -11,7 +11,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -38,7 +38,7 @@ describe('SiteStatisticsPageComponent', () => { }; const usageReportService = { - searchStatistics: () => observableOf([ + searchStatistics: () => of([ Object.assign( new UsageReport(), { id: `site_id-TotalVisits-report`, @@ -49,11 +49,11 @@ describe('SiteStatisticsPageComponent', () => { }; const nameService = { - getName: () => observableOf('test dso name'), + getName: () => of('test dso name'), }; const siteService = { - find: () => observableOf(Object.assign(new Site(), { + find: () => of(Object.assign(new Site(), { id: 'site_id', _links: { self: { @@ -64,7 +64,7 @@ describe('SiteStatisticsPageComponent', () => { }; const authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); diff --git a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts index eaed9f5401..7c188cd6f8 100644 --- a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts +++ b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts @@ -18,7 +18,13 @@ import { StatisticsTableComponent } from '../statistics-table/statistics-table.c templateUrl: '../statistics-page/statistics-page.component.html', styleUrls: ['./site-statistics-page.component.scss'], standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class SiteStatisticsPageComponent extends StatisticsPageDirective { diff --git a/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts b/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts index 3792b33c59..e73ca3c916 100644 --- a/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts +++ b/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts @@ -11,7 +11,9 @@ import { SiteStatisticsPageComponent } from './site-statistics-page.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [SiteStatisticsPageComponent], + imports: [ + SiteStatisticsPageComponent, + ], }) export class ThemedSiteStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/statistics-table/statistics-table.component.ts b/src/app/statistics-page/statistics-table/statistics-table.component.ts index d3cf80330e..b60a2cb317 100644 --- a/src/app/statistics-page/statistics-table/statistics-table.component.ts +++ b/src/app/statistics-page/statistics-table/statistics-table.component.ts @@ -18,7 +18,10 @@ import { UsageReport } from '../../core/statistics/models/usage-report.model'; templateUrl: './statistics-table.component.html', styleUrls: ['./statistics-table.component.scss'], standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) export class StatisticsTableComponent implements OnInit { diff --git a/src/app/statistics/angulartics/dspace-provider.spec.ts b/src/app/statistics/angulartics/dspace-provider.spec.ts index 80176c3e94..331b3973c3 100644 --- a/src/app/statistics/angulartics/dspace-provider.spec.ts +++ b/src/app/statistics/angulartics/dspace-provider.spec.ts @@ -1,5 +1,5 @@ import { Angulartics2 } from 'angulartics2'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { filter } from 'rxjs/operators'; import { StatisticsService } from '../statistics.service'; @@ -12,7 +12,7 @@ describe('Angulartics2DSpace', () => { beforeEach(() => { angulartics2 = { - eventTrack: observableOf({ action: 'page_view', properties: { + eventTrack: of({ action: 'page_view', properties: { object: 'mock-object', referrer: 'https://www.referrer.com', } }), diff --git a/src/app/store.effects.ts b/src/app/store.effects.ts index 4efb940c3d..c5c6874a96 100644 --- a/src/app/store.effects.ts +++ b/src/app/store.effects.ts @@ -8,7 +8,7 @@ import { Action, Store, } from '@ngrx/store'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { map } from 'rxjs/operators'; import { AppState } from './app.reducer'; @@ -25,7 +25,7 @@ export class StoreEffects { // replayAction.payload.forEach((action: Action) => { // this.store.dispatch(action); // }); - return observableOf({}); + return of({}); })), { dispatch: false }); resize = createEffect(() => this.actions.pipe( diff --git a/src/app/submission/edit/submission-edit.component.spec.ts b/src/app/submission/edit/submission-edit.component.spec.ts index 29d872f542..156bc200ac 100644 --- a/src/app/submission/edit/submission-edit.component.spec.ts +++ b/src/app/submission/edit/submission-edit.component.spec.ts @@ -12,10 +12,7 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; import { AuthService } from '../../core/auth/auth.service'; @@ -120,8 +117,8 @@ describe('SubmissionEditComponent Component', () => { submissionServiceStub.retrieveSubmission.and.returnValue( createSuccessfulRemoteDataObject$(submissionObject), ); - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionObject)); - submissionServiceStub.getSubmissionStatus.and.returnValue(observableOf(true)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionObject)); + submissionServiceStub.getSubmissionStatus.and.returnValue(of(true)); fixture.detectChanges(); @@ -149,7 +146,7 @@ describe('SubmissionEditComponent Component', () => { it('should not has effects when an invalid SubmissionObject has been retrieved',() => { route.testParams = { id: submissionId }; - submissionServiceStub.retrieveSubmission.and.returnValue(observableOf(null)); + submissionServiceStub.retrieveSubmission.and.returnValue(of(null)); fixture.detectChanges(); diff --git a/src/app/submission/edit/themed-submission-edit.component.ts b/src/app/submission/edit/themed-submission-edit.component.ts index e1abb0634e..7ba7fcdf8e 100644 --- a/src/app/submission/edit/themed-submission-edit.component.ts +++ b/src/app/submission/edit/themed-submission-edit.component.ts @@ -11,7 +11,9 @@ import { SubmissionEditComponent } from './submission-edit.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionEditComponent], + imports: [ + SubmissionEditComponent, + ], }) export class ThemedSubmissionEditComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/submission/form/collection/submission-form-collection.component.spec.ts b/src/app/submission/form/collection/submission-form-collection.component.spec.ts index 3a5ae8a18d..0d247ac2cf 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.spec.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.spec.ts @@ -317,9 +317,11 @@ describe('SubmissionFormCollectionComponent Component', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [FormsModule, + imports: [ + FormsModule, + NgbModule, ReactiveFormsModule, - NgbModule], + ], }) class TestComponent { diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index 1736b474d5..c9759d8160 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -16,7 +16,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -54,11 +54,11 @@ import { SubmissionService } from '../../submission.service'; templateUrl: './submission-form-collection.component.html', standalone: true, imports: [ + BtnDisabledDirective, CommonModule, - TranslateModule, NgbDropdownModule, ThemedCollectionDropdownComponent, - BtnDisabledDirective, + TranslateModule, ], }) export class SubmissionFormCollectionComponent implements OnDestroy, OnChanges, OnInit { @@ -201,7 +201,7 @@ export class SubmissionFormCollectionComponent implements OnDestroy, OnChanges, }), ).subscribe((submissionObject: SubmissionObject) => { this.selectedCollectionId = event.collection.id; - this.selectedCollectionName$ = observableOf(event.collection.name); + this.selectedCollectionName$ = of(event.collection.name); this.collectionChange.emit(submissionObject); this.submissionService.changeSubmissionCollection(this.submissionId, event.collection.id); this.processingChange$.next(false); diff --git a/src/app/submission/form/footer/submission-form-footer.component.spec.ts b/src/app/submission/form/footer/submission-form-footer.component.spec.ts index 82bc309cc8..d21982f325 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.spec.ts +++ b/src/app/submission/form/footer/submission-form-footer.component.spec.ts @@ -21,7 +21,7 @@ import { getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { SubmissionRestService } from '../../../core/submission/submission-rest.service'; @@ -71,7 +71,7 @@ describe('SubmissionFormFooterComponent', () => { // synchronous beforeEach beforeEach(() => { - submissionServiceStub.getSubmissionStatus.and.returnValue(observableOf(true)); + submissionServiceStub.getSubmissionStatus.and.returnValue(of(true)); const html = ` `; @@ -201,7 +201,7 @@ describe('SubmissionFormFooterComponent', () => { describe('on discard confirmation', () => { beforeEach((done) => { - comp.showDepositAndDiscard = observableOf(true); + comp.showDepositAndDiscard = of(true); fixture.detectChanges(); const modalBtn = fixture.debugElement.query(By.css('.btn-danger')); @@ -224,8 +224,8 @@ describe('SubmissionFormFooterComponent', () => { }); it('should not have deposit button disabled when submission is not valid', () => { - comp.showDepositAndDiscard = observableOf(true); - compAsAny.submissionIsInvalid = observableOf(true); + comp.showDepositAndDiscard = of(true); + compAsAny.submissionIsInvalid = of(true); fixture.detectChanges(); const depositBtn: any = fixture.debugElement.query(By.css('.btn-success')); @@ -234,8 +234,8 @@ describe('SubmissionFormFooterComponent', () => { }); it('should not have deposit button disabled when submission is valid', () => { - comp.showDepositAndDiscard = observableOf(true); - compAsAny.submissionIsInvalid = observableOf(false); + comp.showDepositAndDiscard = of(true); + compAsAny.submissionIsInvalid = of(false); fixture.detectChanges(); const depositBtn: any = fixture.debugElement.query(By.css('.btn-success')); @@ -244,7 +244,7 @@ describe('SubmissionFormFooterComponent', () => { }); it('should disable save button when all modifications had been saved', () => { - comp.hasUnsavedModification = observableOf(false); + comp.hasUnsavedModification = of(false); fixture.detectChanges(); const saveBtn: any = fixture.debugElement.query(By.css('#save')); @@ -253,7 +253,7 @@ describe('SubmissionFormFooterComponent', () => { }); it('should enable save button when there are not saved modifications', () => { - comp.hasUnsavedModification = observableOf(true); + comp.hasUnsavedModification = of(true); fixture.detectChanges(); const saveBtn: any = fixture.debugElement.query(By.css('#save')); @@ -269,7 +269,9 @@ describe('SubmissionFormFooterComponent', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [NgbModule], + imports: [ + NgbModule, + ], }) class TestComponent { diff --git a/src/app/submission/form/footer/submission-form-footer.component.ts b/src/app/submission/form/footer/submission-form-footer.component.ts index a61e2599a2..a6a5f2099a 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.ts +++ b/src/app/submission/form/footer/submission-form-footer.component.ts @@ -9,7 +9,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -28,7 +28,12 @@ import { SubmissionService } from '../../submission.service'; styleUrls: ['./submission-form-footer.component.scss'], templateUrl: './submission-form-footer.component.html', standalone: true, - imports: [CommonModule, BrowserOnlyPipe, TranslateModule, BtnDisabledDirective], + imports: [ + BrowserOnlyPipe, + BtnDisabledDirective, + CommonModule, + TranslateModule, + ], }) export class SubmissionFormFooterComponent implements OnChanges { @@ -60,7 +65,7 @@ export class SubmissionFormFooterComponent implements OnChanges { * A boolean representing if submission form is valid or not * @type {Observable} */ - public submissionIsInvalid: Observable = observableOf(true); + public submissionIsInvalid: Observable = of(true); /** * A boolean representing if submission form has unsaved modifications @@ -90,7 +95,7 @@ export class SubmissionFormFooterComponent implements OnChanges { this.processingSaveStatus = this.submissionService.getSubmissionSaveProcessingStatus(this.submissionId); this.processingDepositStatus = this.submissionService.getSubmissionDepositProcessingStatus(this.submissionId); - this.showDepositAndDiscard = observableOf(this.submissionService.getSubmissionScope() === SubmissionScopeType.WorkspaceItem); + this.showDepositAndDiscard = of(this.submissionService.getSubmissionScope() === SubmissionScopeType.WorkspaceItem); this.hasUnsavedModification = this.submissionService.hasUnsavedModification(); } } diff --git a/src/app/submission/form/footer/themed-submission-form-footer.component.ts b/src/app/submission/form/footer/themed-submission-form-footer.component.ts index 82240abcf5..8d69803493 100644 --- a/src/app/submission/form/footer/themed-submission-form-footer.component.ts +++ b/src/app/submission/form/footer/themed-submission-form-footer.component.ts @@ -11,7 +11,9 @@ import { SubmissionFormFooterComponent } from './submission-form-footer.componen styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionFormFooterComponent], + imports: [ + SubmissionFormFooterComponent, + ], }) export class ThemedSubmissionFormFooterComponent extends ThemedComponent { @Input() submissionId: string; diff --git a/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts b/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts index 5aaf9203c0..ccadeccb90 100644 --- a/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts +++ b/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts @@ -16,7 +16,7 @@ import { By } from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { HostWindowService } from '../../../shared/host-window.service'; import { @@ -95,7 +95,7 @@ describe('SubmissionFormSectionAddComponent Component', () => { // synchronous beforeEach beforeEach(() => { - submissionServiceStub.getDisabledSectionsList.and.returnValue(observableOf([])); + submissionServiceStub.getDisabledSectionsList.and.returnValue(of([])); const html = ` @@ -137,7 +137,7 @@ describe('SubmissionFormSectionAddComponent Component', () => { }); it('should init sectionList properly', () => { - submissionServiceStub.getDisabledSectionsList.and.returnValue(observableOf(mockAvailableSections)); + submissionServiceStub.getDisabledSectionsList.and.returnValue(of(mockAvailableSections)); fixture.detectChanges(); @@ -151,7 +151,7 @@ describe('SubmissionFormSectionAddComponent Component', () => { }); it('should call addSection', () => { - submissionServiceStub.getDisabledSectionsList.and.returnValue(observableOf(mockAvailableSections)); + submissionServiceStub.getDisabledSectionsList.and.returnValue(of(mockAvailableSections)); comp.addSection(mockAvailableSections[1].id); @@ -167,7 +167,7 @@ describe('SubmissionFormSectionAddComponent Component', () => { beforeEach(() => { - submissionServiceStub.getDisabledSectionsList.and.returnValue(observableOf(mockAvailableSections)); + submissionServiceStub.getDisabledSectionsList.and.returnValue(of(mockAvailableSections)); comp.ngOnInit(); fixture.detectChanges(); dropdowBtn = fixture.debugElement.query(By.css('#sectionControls')); @@ -222,7 +222,9 @@ describe('SubmissionFormSectionAddComponent Component', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [NgbModule], + imports: [ + NgbModule, + ], }) class TestComponent { diff --git a/src/app/submission/form/section-add/submission-form-section-add.component.ts b/src/app/submission/form/section-add/submission-form-section-add.component.ts index 35c52d2450..2df2fbb4bd 100644 --- a/src/app/submission/form/section-add/submission-form-section-add.component.ts +++ b/src/app/submission/form/section-add/submission-form-section-add.component.ts @@ -23,7 +23,12 @@ import { SubmissionService } from '../../submission.service'; styleUrls: ['./submission-form-section-add.component.scss'], templateUrl: './submission-form-section-add.component.html', standalone: true, - imports: [CommonModule, TranslateModule, NgbDropdownModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + CommonModule, + NgbDropdownModule, + TranslateModule, + ], }) export class SubmissionFormSectionAddComponent implements OnInit { diff --git a/src/app/submission/form/submission-form.component.spec.ts b/src/app/submission/form/submission-form.component.spec.ts index c399f9389b..86058bfada 100644 --- a/src/app/submission/form/submission-form.component.spec.ts +++ b/src/app/submission/form/submission-form.component.spec.ts @@ -14,7 +14,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthService } from '../../core/auth/auth.service'; @@ -74,7 +74,7 @@ describe('SubmissionFormComponent', () => { { provide: AuthService, useClass: AuthServiceStub }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') }, { provide: SubmissionService, useValue: submissionServiceStub }, - { provide: SectionsService, useValue: { isSectionTypeAvailable: () => observableOf(true) } }, + { provide: SectionsService, useValue: { isSectionTypeAvailable: () => of(true) } }, ChangeDetectorRef, SubmissionFormComponent, ], @@ -99,7 +99,7 @@ describe('SubmissionFormComponent', () => { // synchronous beforeEach beforeEach(() => { - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); const html = ` { comp.submissionErrors = null; comp.item = new Item(); - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); - submissionServiceStub.getSubmissionSections.and.returnValue(observableOf(sectionsList)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); + submissionServiceStub.getSubmissionSections.and.returnValue(of(sectionsList)); spyOn(authServiceStub, 'buildAuthHeader').and.returnValue('token'); scheduler.schedule(() => { diff --git a/src/app/submission/form/submission-form.component.ts b/src/app/submission/form/submission-form.component.ts index 10539839d9..348c1770e4 100644 --- a/src/app/submission/form/submission-form.component.ts +++ b/src/app/submission/form/submission-form.component.ts @@ -11,7 +11,7 @@ import { TranslatePipe } from '@ngx-translate/core'; import isEqual from 'lodash/isEqual'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -59,12 +59,12 @@ import { ThemedSubmissionUploadFilesComponent } from './submission-upload-files/ templateUrl: './submission-form.component.html', imports: [ CommonModule, - ThemedLoadingComponent, - ThemedSubmissionSectionContainerComponent, - ThemedSubmissionFormFooterComponent, - ThemedSubmissionUploadFilesComponent, SubmissionFormCollectionComponent, SubmissionFormSectionAddComponent, + ThemedLoadingComponent, + ThemedSubmissionFormFooterComponent, + ThemedSubmissionSectionContainerComponent, + ThemedSubmissionUploadFilesComponent, TranslatePipe, ], standalone: true, @@ -126,7 +126,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { * A boolean representing if a submission form is pending * @type {Observable} */ - public isLoading$: Observable = observableOf(true); + public isLoading$: Observable = of(true); /** * Emits true when the submission config has bitstream uploading enabled in submission @@ -192,7 +192,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { if (!isLoading) { return this.getSectionsList(); } else { - return observableOf([]); + return of([]); } })); this.uploadEnabled$ = this.sectionsService.isSectionTypeAvailable(this.submissionId, SectionsType.Upload); diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts index 72ae72b846..75bdb4e109 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts @@ -18,7 +18,7 @@ import { cold, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; import { @@ -116,7 +116,7 @@ describe('SubmissionUploadFilesComponent Component', () => { compAsAny = comp; submissionServiceStub = TestBed.inject(SubmissionService as any); sectionsServiceStub = TestBed.inject(SectionsService as any); - sectionsServiceStub.isSectionTypeAvailable.and.returnValue(observableOf(true)); + sectionsServiceStub.isSectionTypeAvailable.and.returnValue(of(true)); notificationsServiceStub = TestBed.inject(NotificationsService as any); translateService = TestBed.inject(TranslateService); comp.submissionId = submissionId; @@ -159,8 +159,8 @@ describe('SubmissionUploadFilesComponent Component', () => { describe('on upload complete', () => { beforeEach(() => { - sectionsServiceStub.isSectionType.and.callFake((_, sectionId, __) => observableOf(sectionId === 'upload')); - compAsAny.uploadEnabled = observableOf(true); + sectionsServiceStub.isSectionType.and.callFake((_, sectionId, __) => of(sectionId === 'upload')); + compAsAny.uploadEnabled = of(true); }); it('should show a success notification and call updateSectionData if successful', () => { diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts index 13d7bf8fb8..44562b29c2 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts @@ -8,7 +8,7 @@ import { import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -91,7 +91,7 @@ export class SubmissionUploadFilesComponent implements OnChanges, OnDestroy { * A boolean representing if upload functionality is enabled * @type {boolean} */ - private uploadEnabled: Observable = observableOf(false); + private uploadEnabled: Observable = of(false); /** * Save submission before to upload a file diff --git a/src/app/submission/form/submission-upload-files/themed-submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/themed-submission-upload-files.component.ts index cfa913297c..c1192b9b43 100644 --- a/src/app/submission/form/submission-upload-files/themed-submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/themed-submission-upload-files.component.ts @@ -14,7 +14,9 @@ import { SubmissionUploadFilesComponent } from './submission-upload-files.compon selector: 'ds-submission-upload-files', templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionUploadFilesComponent], + imports: [ + SubmissionUploadFilesComponent, + ], }) export class ThemedSubmissionUploadFilesComponent extends ThemedComponent { diff --git a/src/app/submission/form/themed-submission-form.component.ts b/src/app/submission/form/themed-submission-form.component.ts index 4a6f8d67cd..514ab9c317 100644 --- a/src/app/submission/form/themed-submission-form.component.ts +++ b/src/app/submission/form/themed-submission-form.component.ts @@ -15,7 +15,9 @@ import { SubmissionFormComponent } from './submission-form.component'; styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionFormComponent], + imports: [ + SubmissionFormComponent, + ], }) export class ThemedSubmissionFormComponent extends ThemedComponent { @Input() collectionId: string; diff --git a/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts b/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts index 57171ebe8e..caf07eb5a5 100644 --- a/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts +++ b/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts @@ -19,10 +19,10 @@ import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.c styleUrls: ['./submission-import-external-collection.component.scss'], templateUrl: './submission-import-external-collection.component.html', imports: [ - ThemedLoadingComponent, - ThemedCollectionDropdownComponent, - TranslateModule, NgClass, + ThemedCollectionDropdownComponent, + ThemedLoadingComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts b/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts index 06a048709a..44a822d3ea 100644 --- a/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts +++ b/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts @@ -15,7 +15,7 @@ import { } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { ExternalSourceEntry } from '../../../core/shared/external-source-entry.model'; @@ -147,13 +147,13 @@ describe('SubmissionImportExternalPreviewComponent test suite', () => { ]; comp.externalSourceEntry = externalEntry; ngbModal.open.and.returnValue({ - componentInstance: { selectedEvent: observableOf(emittedEvent) }, + componentInstance: { selectedEvent: of(emittedEvent) }, close: () => { return; }, }); spyOn(comp, 'closeMetadataModal'); - submissionServiceStub.createSubmissionFromExternalSource.and.returnValue(observableOf(submissionObjects)); + submissionServiceStub.createSubmissionFromExternalSource.and.returnValue(of(submissionObjects)); spyOn(compAsAny.router, 'navigateByUrl'); scheduler.schedule(() => comp.import()); scheduler.flush(); diff --git a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts index 9005dc1589..6a51ba28be 100644 --- a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts +++ b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { RequestParam } from '../../../core/cache/models/request-param.model'; @@ -75,7 +75,7 @@ describe('SubmissionImportExternalSearchbarComponent test suite', () => { // synchronous beforeEach beforeEach(() => { - mockExternalSourceService.searchBy.and.returnValue(observableOf(paginatedListRD)); + mockExternalSourceService.searchBy.and.returnValue(of(paginatedListRD)); const html = ` `; testFixture = createTestComponent(html, TestComponent) as ComponentFixture; @@ -100,7 +100,7 @@ describe('SubmissionImportExternalSearchbarComponent test suite', () => { const pageInfo = new PageInfo(); paginatedList = buildPaginatedList(pageInfo, [externalSourceOrcid, externalSourceCiencia, externalSourceMyStaffDb]); paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); - compAsAny.externalService.searchBy.and.returnValue(observableOf(paginatedListRD)); + compAsAny.externalService.searchBy.and.returnValue(of(paginatedListRD)); sourceList = [ { id: 'orcid', name: 'orcid' }, { id: 'ciencia', name: 'ciencia' }, diff --git a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts index eb7a703cc2..23f0bffaaf 100644 --- a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts +++ b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts @@ -14,7 +14,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -66,12 +66,12 @@ export interface ExternalSourceData { styleUrls: ['./submission-import-external-searchbar.component.scss'], templateUrl: './submission-import-external-searchbar.component.html', imports: [ + BtnDisabledDirective, CommonModule, - TranslateModule, + FormsModule, InfiniteScrollModule, NgbDropdownModule, - FormsModule, - BtnDisabledDirective, + TranslateModule, ], standalone: true, }) @@ -154,7 +154,7 @@ export class SubmissionImportExternalSearchbarComponent implements OnInit, OnDes const pageInfo = new PageInfo(); const paginatedList = buildPaginatedList(pageInfo, []); const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); - return observableOf(paginatedListRD); + return of(paginatedListRD); }), getFirstSucceededRemoteDataPayload(), ).subscribe((externalSource: PaginatedList) => { @@ -199,7 +199,7 @@ export class SubmissionImportExternalSearchbarComponent implements OnInit, OnDes const pageInfo = new PageInfo(); const paginatedList = buildPaginatedList(pageInfo, []); const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); - return observableOf(paginatedListRD); + return of(paginatedListRD); }), getFirstSucceededRemoteData(), tap(() => this.sourceListLoading = false), diff --git a/src/app/submission/import-external/submission-import-external.component.spec.ts b/src/app/submission/import-external/submission-import-external.component.spec.ts index 02450ee7f8..dc7e0e290d 100644 --- a/src/app/submission/import-external/submission-import-external.component.spec.ts +++ b/src/app/submission/import-external/submission-import-external.component.spec.ts @@ -17,7 +17,7 @@ import { import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { ExternalSourceDataService } from '../../core/data/external-source-data.service'; @@ -57,7 +57,7 @@ describe('SubmissionImportExternalComponent test suite', () => { let fixture: ComponentFixture; let scheduler: TestScheduler; const ngbModal = jasmine.createSpyObj('modal', ['open']); - const mockSearchOptions = observableOf(new PaginatedSearchOptions({ + const mockSearchOptions = of(new PaginatedSearchOptions({ pagination: Object.assign(new PaginationComponentOptions(), { pageSize: 10, currentPage: 0, @@ -144,7 +144,7 @@ describe('SubmissionImportExternalComponent test suite', () => { it('Should init component properly (without route data)', () => { const expectedEntries = createSuccessfulRemoteDataObject(createPaginatedList([])); comp.routeData = { entity: '', sourceId: '', query: '' }; - spyOn(compAsAny.routeService, 'getQueryParameterValue').and.returnValue(observableOf('')); + spyOn(compAsAny.routeService, 'getQueryParameterValue').and.returnValue(of('')); fixture.detectChanges(); expect(comp.routeData).toEqual({ entity: '', sourceId: '', query: '' }); @@ -155,7 +155,7 @@ describe('SubmissionImportExternalComponent test suite', () => { it('Should init component properly (with route data)', () => { comp.routeData = { entity: '', sourceId: '', query: '' }; spyOn(compAsAny, 'retrieveExternalSources'); - spyOn(compAsAny.routeService, 'getQueryParameterValue').and.returnValues(observableOf('entity'), observableOf('source'), observableOf('dummy')); + spyOn(compAsAny.routeService, 'getQueryParameterValue').and.returnValues(of('entity'), of('source'), of('dummy')); fixture.detectChanges(); expect(compAsAny.retrieveExternalSources).toHaveBeenCalled(); @@ -164,11 +164,11 @@ describe('SubmissionImportExternalComponent test suite', () => { it('Should call \'getExternalSourceEntries\' properly', () => { spyOn(routeServiceStub, 'getQueryParameterValue').and.callFake((param) => { if (param === 'sourceId') { - return observableOf('orcidV2'); + return of('orcidV2'); } else if (param === 'query') { - return observableOf('test'); + return of('test'); } - return observableOf({}); + return of({}); }); fixture.detectChanges(); @@ -480,13 +480,13 @@ describe('SubmissionImportExternalComponent test suite', () => { const expectedEntries = createSuccessfulRemoteDataObject(paginatedData.payload); spyOn(routeServiceStub, 'getQueryParameterValue').and.callFake((param) => { if (param === 'entity') { - return observableOf('Publication'); + return of('Publication'); } else if (param === 'sourceId') { - return observableOf('scopus'); + return of('scopus'); } else if (param === 'query') { - return observableOf('test'); + return of('test'); } - return observableOf({}); + return of({}); }); fixture.detectChanges(); @@ -501,15 +501,15 @@ describe('SubmissionImportExternalComponent test suite', () => { const expectedEntries = createSuccessfulRemoteDataObject(createPaginatedList([])); spyOn(routeServiceStub, 'getQueryParameterValue').and.callFake((param) => { if (param === 'entity') { - return observableOf('Publication'); + return of('Publication'); } if (param === 'query') { - return observableOf('test'); + return of('test'); } if (param === 'sourceId') { - return observableOf('pubmed'); + return of('pubmed'); } - return observableOf({}); + return of({}); }); fixture.detectChanges(); @@ -527,13 +527,13 @@ describe('SubmissionImportExternalComponent test suite', () => { )); spyOn(routeServiceStub, 'getQueryParameterValue').and.callFake((param) => { if (param === 'entity') { - return observableOf('Publication'); + return of('Publication'); } else if (param === 'sourceId') { - return observableOf('pubmed'); + return of('pubmed'); } else if (param === 'query') { - return observableOf('test'); + return of('test'); } - return observableOf({}); + return of({}); }); fixture.detectChanges(); diff --git a/src/app/submission/import-external/submission-import-external.component.ts b/src/app/submission/import-external/submission-import-external.component.ts index a67520b636..8a7c7cdd5f 100644 --- a/src/app/submission/import-external/submission-import-external.component.ts +++ b/src/app/submission/import-external/submission-import-external.component.ts @@ -66,14 +66,14 @@ import { templateUrl: './submission-import-external.component.html', animations: [fadeIn], imports: [ - ObjectCollectionComponent, - ThemedLoadingComponent, AlertComponent, AsyncPipe, + ObjectCollectionComponent, + RouterLink, SubmissionImportExternalSearchbarComponent, + ThemedLoadingComponent, TranslateModule, VarDirective, - RouterLink, ], standalone: true, }) diff --git a/src/app/submission/import-external/themed-submission-import-external.component.ts b/src/app/submission/import-external/themed-submission-import-external.component.ts index bd7242293d..12176eab4b 100644 --- a/src/app/submission/import-external/themed-submission-import-external.component.ts +++ b/src/app/submission/import-external/themed-submission-import-external.component.ts @@ -11,7 +11,9 @@ import { SubmissionImportExternalComponent } from './submission-import-external. styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionImportExternalComponent], + imports: [ + SubmissionImportExternalComponent, + ], }) export class ThemedSubmissionImportExternalComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/submission/objects/submission-objects.effects.spec.ts b/src/app/submission/objects/submission-objects.effects.spec.ts index a16dc365f2..4076a92679 100644 --- a/src/app/submission/objects/submission-objects.effects.spec.ts +++ b/src/app/submission/objects/submission-objects.effects.spec.ts @@ -15,7 +15,7 @@ import { } from 'jasmine-marbles'; import { Observable, - of as observableOf, + of, throwError as observableThrowError, } from 'rxjs'; @@ -98,10 +98,10 @@ describe('SubmissionObjectEffects test suite', () => { submissionJsonPatchOperationsServiceStub = new SubmissionJsonPatchOperationsServiceStub(); submissionObjectDataServiceStub = mockSubmissionObjectDataService; - submissionServiceStub.hasUnsavedModification.and.returnValue(observableOf(true)); + submissionServiceStub.hasUnsavedModification.and.returnValue(of(true)); workspaceItemDataService = jasmine.createSpyObj('WorkspaceItemDataService', { - invalidateById: observableOf(true), + invalidateById: of(true), }); TestBed.configureTestingModule({ @@ -234,7 +234,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new SaveSubmissionFormSuccessAction( submissionId, @@ -256,7 +256,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new SaveSubmissionFormSuccessAction( submissionId, @@ -280,7 +280,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new SaveSubmissionFormSuccessAction( submissionId, @@ -327,7 +327,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new SaveForLaterSubmissionFormSuccessAction( submissionId, @@ -852,7 +852,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceID.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceID.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new SaveSubmissionSectionFormSuccessAction( submissionId, @@ -902,7 +902,7 @@ describe('SubmissionObjectEffects test suite', () => { sections: mockSectionsDataTwo, })]; - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(response)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(of(response)); const expected = cold('--b-', { b: new DepositSubmissionAction( submissionId, @@ -934,7 +934,7 @@ describe('SubmissionObjectEffects test suite', () => { errors: mockSectionsErrors, })]; - submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(response)); + submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(of(response)); const expected = cold('--b-', { b: new SaveSubmissionFormSuccessAction(submissionId, response as any[], false, true), @@ -984,7 +984,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionServiceStub.depositSubmission.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionServiceStub.depositSubmission.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new DepositSubmissionSuccessAction( submissionId, @@ -1126,7 +1126,7 @@ describe('SubmissionObjectEffects test suite', () => { }, }); - submissionServiceStub.discardSubmission.and.returnValue(observableOf(mockSubmissionRestResponse)); + submissionServiceStub.discardSubmission.and.returnValue(of(mockSubmissionRestResponse)); const expected = cold('--b-', { b: new DiscardSubmissionSuccessAction( submissionId, diff --git a/src/app/submission/objects/submission-objects.effects.ts b/src/app/submission/objects/submission-objects.effects.ts index ef1610794c..2d35593354 100644 --- a/src/app/submission/objects/submission-objects.effects.ts +++ b/src/app/submission/objects/submission-objects.effects.ts @@ -12,7 +12,7 @@ import union from 'lodash/union'; import { from as observableFrom, Observable, - of as observableOf, + of, } from 'rxjs'; import { catchError, @@ -161,7 +161,7 @@ export class SubmissionObjectEffects { action.payload.submissionId, 'sections').pipe( map((response: SubmissionObject[]) => new SaveSubmissionFormSuccessAction(action.payload.submissionId, response, action.payload.isManual, action.payload.isManual)), - catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); + catchError(() => of(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); }))); /** @@ -175,7 +175,7 @@ export class SubmissionObjectEffects { action.payload.submissionId, 'sections').pipe( map((response: SubmissionObject[]) => new SaveForLaterSubmissionFormSuccessAction(action.payload.submissionId, response)), - catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); + catchError(() => of(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); }))); /** @@ -216,7 +216,7 @@ export class SubmissionObjectEffects { 'sections', action.payload.sectionId).pipe( map((response: SubmissionObject[]) => new SaveSubmissionSectionFormSuccessAction(action.payload.submissionId, response)), - catchError(() => observableOf(new SaveSubmissionSectionFormErrorAction(action.payload.submissionId)))); + catchError(() => of(new SaveSubmissionSectionFormErrorAction(action.payload.submissionId)))); }))); /** @@ -260,7 +260,7 @@ export class SubmissionObjectEffects { return new SaveSubmissionFormSuccessAction(action.payload.submissionId, response, false, true); } }), - catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); + catchError(() => of(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); }))); /** @@ -272,7 +272,7 @@ export class SubmissionObjectEffects { switchMap(([action, state]: [DepositSubmissionAction, any]) => { return this.submissionService.depositSubmission(state.submission.objects[action.payload.submissionId].selfUrl).pipe( map(() => new DepositSubmissionSuccessAction(action.payload.submissionId)), - catchError((error: unknown) => observableOf(new DepositSubmissionErrorAction(action.payload.submissionId)))); + catchError((error: unknown) => of(new DepositSubmissionErrorAction(action.payload.submissionId)))); }))); /** @@ -307,7 +307,7 @@ export class SubmissionObjectEffects { switchMap((action: DepositSubmissionAction) => { return this.submissionService.discardSubmission(action.payload.submissionId).pipe( map(() => new DiscardSubmissionSuccessAction(action.payload.submissionId)), - catchError(() => observableOf(new DiscardSubmissionErrorAction(action.payload.submissionId)))); + catchError(() => of(new DiscardSubmissionErrorAction(action.payload.submissionId)))); }))); /** @@ -338,7 +338,7 @@ export class SubmissionObjectEffects { map((metadata: any) => new UpdateSectionDataAction(action.payload.submissionId, action.payload.sectionId, metadata, action.payload.errorsToShow, action.payload.serverValidationErrors, action.payload.metadata)), ); } else { - return observableOf(new UpdateSectionDataSuccessAction()); + return of(new UpdateSectionDataSuccessAction()); } }), )); diff --git a/src/app/submission/sections/accesses/section-accesses.component.spec.ts b/src/app/submission/sections/accesses/section-accesses.component.spec.ts index 95e8b00bec..56857ec3ec 100644 --- a/src/app/submission/sections/accesses/section-accesses.component.spec.ts +++ b/src/app/submission/sections/accesses/section-accesses.component.spec.ts @@ -13,7 +13,7 @@ import { import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { LiveRegionService } from 'src/app/shared/live-region/live-region.service'; import { APP_CONFIG, @@ -141,8 +141,8 @@ describe('SubmissionSectionAccessesComponent', () => { formService = TestBed.inject(FormService); formbuilderService = TestBed.inject(FormBuilderService); formService.validateAllFormFields.and.callFake(() => null); - formService.isValid.and.returnValue(observableOf(true)); - formService.getFormData.and.returnValue(observableOf(mockAccessesFormData)); + formService.isValid.and.returnValue(of(true)); + formService.getFormData.and.returnValue(of(mockAccessesFormData)); fixture.detectChanges(); }); @@ -238,8 +238,8 @@ describe('SubmissionSectionAccessesComponent', () => { fixture = TestBed.createComponent(SubmissionSectionAccessesComponent); component = fixture.componentInstance; formService.validateAllFormFields.and.callFake(() => null); - formService.isValid.and.returnValue(observableOf(true)); - formService.getFormData.and.returnValue(observableOf(mockAccessesFormData)); + formService.isValid.and.returnValue(of(true)); + formService.getFormData.and.returnValue(of(mockAccessesFormData)); fixture.detectChanges(); }); diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts index 2e82948c14..568ef820b2 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts @@ -7,7 +7,7 @@ import { import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; @@ -151,7 +151,7 @@ describe('SubmissionSectionCcLicensesComponent', () => { const sectionService = { getSectionState: () => { - return observableOf({}); + return of({}); }, setSectionStatus: () => undefined, updateSectionData: (submissionId, sectionId, updatedData) => { diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts index e67586b495..fcee83e036 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts @@ -17,7 +17,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; import { @@ -66,14 +66,14 @@ import { SectionsType } from '../sections-type'; templateUrl: './submission-section-cc-licenses.component.html', styleUrls: ['./submission-section-cc-licenses.component.scss'], imports: [ - TranslateModule, - ThemedLoadingComponent, AsyncPipe, - VarDirective, DsSelectComponent, - NgbDropdownModule, FormsModule, InfiniteScrollModule, + NgbDropdownModule, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], standalone: true, }) @@ -274,7 +274,7 @@ export class SubmissionSectionCcLicensesComponent extends SectionModelComponent getCcLicenseLink$(): Observable { if (this.storedCcLicenseLink) { - return observableOf(this.storedCcLicenseLink); + return of(this.storedCcLicenseLink); } if (!this.getSelectedCcLicense() || this.getSelectedCcLicense().fields.some( (field) => !this.getSelectedOption(this.getSelectedCcLicense(), field))) { @@ -311,7 +311,7 @@ export class SubmissionSectionCcLicensesComponent extends SectionModelComponent * the section status */ getSectionStatus(): Observable { - return observableOf(this.accepted); + return of(this.accepted); } /** diff --git a/src/app/submission/sections/container/section-container.component.spec.ts b/src/app/submission/sections/container/section-container.component.spec.ts index 4dfa65a13b..4a0ce9651e 100644 --- a/src/app/submission/sections/container/section-container.component.spec.ts +++ b/src/app/submission/sections/container/section-container.component.spec.ts @@ -12,7 +12,7 @@ import { import { By } from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { mockSubmissionCollectionId, @@ -66,10 +66,10 @@ describe('SubmissionSectionContainerComponent test suite', () => { const collectionId = mockSubmissionCollectionId; function init() { - sectionsServiceStub.isSectionValid.and.returnValue(observableOf(true)); - sectionsServiceStub.getSectionState.and.returnValue(observableOf(sectionState)); - sectionsServiceStub.getShownSectionErrors.and.returnValue(observableOf([])); - submissionServiceStub.getActiveSectionId.and.returnValue(observableOf('traditionalpageone')); + sectionsServiceStub.isSectionValid.and.returnValue(of(true)); + sectionsServiceStub.getSectionState.and.returnValue(of(sectionState)); + sectionsServiceStub.getShownSectionErrors.and.returnValue(of([])); + submissionServiceStub.getActiveSectionId.and.returnValue(of('traditionalpageone')); } // waitForAsync beforeEach @@ -137,7 +137,7 @@ describe('SubmissionSectionContainerComponent test suite', () => { }); it('should inject section properly', () => { - spyOn(comp.sectionRef, 'isEnabled').and.returnValue(observableOf(true)); + spyOn(comp.sectionRef, 'isEnabled').and.returnValue(of(true)); spyOn(comp.sectionRef, 'hasGenericErrors').and.returnValue(false); comp.ngOnInit(); @@ -166,7 +166,7 @@ describe('SubmissionSectionContainerComponent test suite', () => { let sectionErrorsDiv = fixture.debugElement.query(By.css('[id^=\'sectionGenericError_\']')); expect(sectionErrorsDiv).toBeNull(); - spyOn(comp.sectionRef, 'isEnabled').and.returnValue(observableOf(true)); + spyOn(comp.sectionRef, 'isEnabled').and.returnValue(of(true)); spyOn(comp.sectionRef, 'hasGenericErrors').and.returnValue(true); comp.ngOnInit(); @@ -178,8 +178,8 @@ describe('SubmissionSectionContainerComponent test suite', () => { it('should display warning icon', () => { - spyOn(comp.sectionRef, 'isEnabled').and.returnValue(observableOf(true)); - spyOn(comp.sectionRef, 'isValid').and.returnValue(observableOf(false)); + spyOn(comp.sectionRef, 'isEnabled').and.returnValue(of(true)); + spyOn(comp.sectionRef, 'isValid').and.returnValue(of(false)); spyOn(comp.sectionRef, 'hasErrors').and.returnValue(false); comp.ngOnInit(); @@ -195,8 +195,8 @@ describe('SubmissionSectionContainerComponent test suite', () => { it('should display error icon', () => { - spyOn(comp.sectionRef, 'isEnabled').and.returnValue(observableOf(true)); - spyOn(comp.sectionRef, 'isValid').and.returnValue(observableOf(false)); + spyOn(comp.sectionRef, 'isEnabled').and.returnValue(of(true)); + spyOn(comp.sectionRef, 'isValid').and.returnValue(of(false)); spyOn(comp.sectionRef, 'hasErrors').and.returnValue(true); comp.ngOnInit(); @@ -212,8 +212,8 @@ describe('SubmissionSectionContainerComponent test suite', () => { it('should display success icon', () => { - spyOn(comp.sectionRef, 'isEnabled').and.returnValue(observableOf(true)); - spyOn(comp.sectionRef, 'isValid').and.returnValue(observableOf(true)); + spyOn(comp.sectionRef, 'isEnabled').and.returnValue(of(true)); + spyOn(comp.sectionRef, 'isValid').and.returnValue(of(true)); spyOn(comp.sectionRef, 'hasErrors').and.returnValue(false); comp.ngOnInit(); @@ -236,7 +236,9 @@ describe('SubmissionSectionContainerComponent test suite', () => { selector: '', template: ``, standalone: true, - imports: [NgbModule], + imports: [ + NgbModule, + ], }) class TestComponent { diff --git a/src/app/submission/sections/container/section-container.component.ts b/src/app/submission/sections/container/section-container.component.ts index 174aed93b5..315ab99895 100644 --- a/src/app/submission/sections/container/section-container.component.ts +++ b/src/app/submission/sections/container/section-container.component.ts @@ -28,12 +28,12 @@ import { rendersSectionType } from '../sections-decorator'; styleUrls: ['./section-container.component.scss'], imports: [ AlertComponent, - NgbAccordionModule, - NgComponentOutlet, - TranslateModule, - NgClass, AsyncPipe, + NgbAccordionModule, + NgClass, + NgComponentOutlet, SectionsDirective, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/sections/container/themed-section-container.component.ts b/src/app/submission/sections/container/themed-section-container.component.ts index 951fb2bdcb..37eb44a4e9 100644 --- a/src/app/submission/sections/container/themed-section-container.component.ts +++ b/src/app/submission/sections/container/themed-section-container.component.ts @@ -12,7 +12,9 @@ import { SubmissionSectionContainerComponent } from './section-container.compone styleUrls: [], templateUrl: '../../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionSectionContainerComponent], + imports: [ + SubmissionSectionContainerComponent, + ], }) export class ThemedSubmissionSectionContainerComponent extends ThemedComponent { @Input() collectionId: string; diff --git a/src/app/submission/sections/duplicates/section-duplicates.component.spec.ts b/src/app/submission/sections/duplicates/section-duplicates.component.spec.ts index 8aa2cfee24..c911fe84ed 100644 --- a/src/app/submission/sections/duplicates/section-duplicates.component.spec.ts +++ b/src/app/submission/sections/duplicates/section-duplicates.component.spec.ts @@ -20,7 +20,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { NgxPaginationModule } from 'ngx-pagination'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SubmissionFormsConfigDataService } from '../../../core/config/submission-forms-config-data.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; @@ -184,9 +184,9 @@ describe('SubmissionSectionDuplicatesComponent test suite', () => { // synchronous beforeEach beforeEach(() => { - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); - sectionsServiceStub.getSectionData.and.returnValue(observableOf(sectionObject)); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of([])); + sectionsServiceStub.getSectionData.and.returnValue(of(sectionObject)); testFixture = TestBed.createComponent(SubmissionSectionDuplicatesComponent); testComp = testFixture.componentInstance; @@ -212,10 +212,10 @@ describe('SubmissionSectionDuplicatesComponent test suite', () => { formOperationsService = TestBed.inject(SectionFormOperationsService); collectionDataService = TestBed.inject(CollectionDataService); compAsAny.pathCombiner = new JsonPatchOperationPathCombiner('sections', sectionObject.id); - spyOn(comp, 'getDuplicateData').and.returnValue(observableOf({ potentialDuplicates: duplicates })); + spyOn(comp, 'getDuplicateData').and.returnValue(of({ potentialDuplicates: duplicates })); collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of([])); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); compAsAny.submissionService.getSubmissionScope.and.returnValue(SubmissionScopeType.WorkspaceItem); }); @@ -227,7 +227,7 @@ describe('SubmissionSectionDuplicatesComponent test suite', () => { // Test initialisation of the submission section it('Should init section properly', fakeAsync(() => { - spyOn(comp, 'getSectionStatus').and.returnValue(observableOf(true)); + spyOn(comp, 'getSectionStatus').and.returnValue(of(true)); expect(comp.isLoading).toBeTruthy(); comp.onSectionInit(); tick(100); @@ -257,7 +257,12 @@ describe('SubmissionSectionDuplicatesComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [BrowserModule, FormsModule, ReactiveFormsModule, NgxPaginationModule], + imports: [ + BrowserModule, + FormsModule, + NgxPaginationModule, + ReactiveFormsModule, + ], }) class TestComponent { diff --git a/src/app/submission/sections/duplicates/section-duplicates.component.ts b/src/app/submission/sections/duplicates/section-duplicates.component.ts index cd7f0b4bea..edcf099333 100644 --- a/src/app/submission/sections/duplicates/section-duplicates.component.ts +++ b/src/app/submission/sections/duplicates/section-duplicates.component.ts @@ -11,7 +11,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, } from 'rxjs'; @@ -36,9 +36,9 @@ import { SectionsService } from '../sections.service'; templateUrl: './section-duplicates.component.html', changeDetection: ChangeDetectionStrategy.Default, imports: [ - VarDirective, AsyncPipe, TranslateModule, + VarDirective, ], standalone: true, }) @@ -116,7 +116,7 @@ export class SubmissionSectionDuplicatesComponent extends SectionModelComponent * the section status */ public getSectionStatus(): Observable { - return observableOf(!this.isLoading); + return of(!this.isLoading); } /** diff --git a/src/app/submission/sections/form/section-form.component.spec.ts b/src/app/submission/sections/form/section-form.component.spec.ts index 4cce0daa7b..dccdcac6e2 100644 --- a/src/app/submission/sections/form/section-form.component.spec.ts +++ b/src/app/submission/sections/form/section-form.component.spec.ts @@ -23,7 +23,7 @@ import { TranslateService, } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; import { FormRowModel } from '../../../core/config/models/config-submission-form.model'; @@ -198,13 +198,13 @@ describe('SubmissionSectionFormComponent test suite', () => { { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: TranslateService, useValue: getMockTranslateService() }, // eslint-disable-next-line @typescript-eslint/no-empty-function - { provide: ObjectCacheService, useValue: { remove: () => { }, hasBySelfLinkObservable: () => observableOf(false), hasByHref$: () => observableOf(false) } }, + { provide: ObjectCacheService, useValue: { remove: () => { }, hasBySelfLinkObservable: () => of(false), hasByHref$: () => of(false) } }, // eslint-disable-next-line @typescript-eslint/no-empty-function - { provide: RequestService, useValue: { removeByHrefSubstring: () => { }, hasByHref$: () => observableOf(false) } }, + { provide: RequestService, useValue: { removeByHrefSubstring: () => { }, hasByHref$: () => of(false) } }, { provide: 'collectionIdProvider', useValue: collectionId }, { provide: 'sectionDataProvider', useValue: Object.assign({}, sectionObject) }, { provide: 'submissionIdProvider', useValue: submissionId }, - { provide: SubmissionObjectDataService, useValue: { getHrefByID: () => observableOf('testUrl'), findById: () => createSuccessfulRemoteDataObject$(new WorkspaceItem()) } }, + { provide: SubmissionObjectDataService, useValue: { getHrefByID: () => of('testUrl'), findById: () => createSuccessfulRemoteDataObject$(new WorkspaceItem()) } }, ChangeDetectorRef, SubmissionSectionFormComponent, ], @@ -219,10 +219,10 @@ describe('SubmissionSectionFormComponent test suite', () => { // synchronous beforeEach beforeEach(() => { const sectionData = {}; - formService.isValid.and.returnValue(observableOf(true)); - formConfigService.findByHref.and.returnValue(observableOf(testFormConfiguration)); - sectionsServiceStub.getSectionData.and.returnValue(observableOf(sectionData)); - sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); + formService.isValid.and.returnValue(of(true)); + formConfigService.findByHref.and.returnValue(of(testFormConfiguration)); + sectionsServiceStub.getSectionData.and.returnValue(of(sectionData)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(of([])); const html = ` `; @@ -254,7 +254,7 @@ describe('SubmissionSectionFormComponent test suite', () => { translateService = TestBed.inject(TranslateService); notificationsServiceStub = TestBed.inject(NotificationsService as any); - translateService.get.and.returnValue(observableOf('test')); + translateService.get.and.returnValue(of('test')); compAsAny.pathCombiner = new JsonPatchOperationPathCombiner('sections', sectionObject.id); }); @@ -266,11 +266,11 @@ describe('SubmissionSectionFormComponent test suite', () => { it('should init section properly', () => { const sectionData = {}; - formService.isValid.and.returnValue(observableOf(true)); + formService.isValid.and.returnValue(of(true)); formConfigService.findByHref.and.returnValue(createSuccessfulRemoteDataObject$(testFormConfiguration)); - sectionsServiceStub.getSectionData.and.returnValue(observableOf(sectionData)); - sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); + sectionsServiceStub.getSectionData.and.returnValue(of(sectionData)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(of([])); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); spyOn(comp, 'initForm'); spyOn(comp, 'subscriptions'); @@ -527,8 +527,8 @@ describe('SubmissionSectionFormComponent test suite', () => { }); it('should return a valid status when form is valid and there are no server validation errors', () => { - formService.isValid.and.returnValue(observableOf(true)); - sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); + formService.isValid.and.returnValue(of(true)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(of([])); const expected = cold('(b|)', { b: true, }); @@ -537,8 +537,8 @@ describe('SubmissionSectionFormComponent test suite', () => { }); it('should return an invalid status when form is valid and there are server validation errors', () => { - formService.isValid.and.returnValue(observableOf(true)); - sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf(parsedSectionErrors)); + formService.isValid.and.returnValue(of(true)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(of(parsedSectionErrors)); const expected = cold('(b|)', { b: false, }); @@ -547,8 +547,8 @@ describe('SubmissionSectionFormComponent test suite', () => { }); it('should return an invalid status when form is not valid and there are no server validation errors', () => { - formService.isValid.and.returnValue(observableOf(false)); - sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); + formService.isValid.and.returnValue(of(false)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(of([])); const expected = cold('(b|)', { b: false, }); @@ -569,8 +569,8 @@ describe('SubmissionSectionFormComponent test suite', () => { errorsToShow: parsedSectionErrors, } as any; - formService.getFormData.and.returnValue(observableOf(formData)); - sectionsServiceStub.getSectionState.and.returnValue(observableOf(sectionState)); + formService.getFormData.and.returnValue(of(formData)); + sectionsServiceStub.getSectionState.and.returnValue(of(sectionState)); comp.subscriptions(); @@ -659,6 +659,9 @@ describe('SubmissionSectionFormComponent test suite', () => { selector: 'ds-test-cmp', template: ``, standalone: true, - imports: [FormsModule, ReactiveFormsModule], + imports: [ + FormsModule, + ReactiveFormsModule, + ], }) class TestComponent {} diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts b/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts index 85cda85241..fbeee4091b 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts @@ -18,7 +18,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { NgxPaginationModule } from 'ngx-pagination'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { SubmissionFormsConfigDataService } from '../../../core/config/submission-forms-config-data.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; @@ -202,9 +202,9 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { // synchronous beforeEach beforeEach(() => { - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); - sectionsServiceStub.getSectionData.and.returnValue(observableOf(identifierData)); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of([])); + sectionsServiceStub.getSectionData.and.returnValue(of(identifierData)); const html = ``; testFixture = createTestComponent(html, TestComponent) as ComponentFixture; testComp = testFixture.componentInstance; @@ -241,11 +241,11 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { // Test initialisation of the submission section it('Should init section properly', () => { collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of([])); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); compAsAny.submissionService.getSubmissionScope.and.returnValue(SubmissionScopeType.WorkspaceItem); - spyOn(comp, 'getSectionStatus').and.returnValue(observableOf(true)); - spyOn(comp, 'getIdentifierData').and.returnValue(observableOf(identifierData)); + spyOn(comp, 'getSectionStatus').and.returnValue(of(true)); + spyOn(comp, 'getIdentifierData').and.returnValue(of(identifierData)); expect(comp.isLoading).toBeTruthy(); comp.onSectionInit(); fixture.detectChanges(); @@ -277,8 +277,8 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { standalone: true, imports: [ FormsModule, - ReactiveFormsModule, NgxPaginationModule, + ReactiveFormsModule, ], }) class TestComponent { diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.ts b/src/app/submission/sections/identifiers/section-identifiers.component.ts index 0a726cbf74..04dfbfac85 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.ts @@ -11,7 +11,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { WorkspaceitemSectionIdentifiersObject } from '../../../core/submission/models/workspaceitem-section-identifiers.model'; @@ -33,8 +33,8 @@ import { SectionsService } from '../sections.service'; templateUrl: './section-identifiers.component.html', changeDetection: ChangeDetectionStrategy.Default, imports: [ - TranslateModule, AsyncPipe, + TranslateModule, VarDirective, ], standalone: true, @@ -97,7 +97,7 @@ export class SubmissionSectionIdentifiersComponent extends SectionModelComponent * the section status */ public getSectionStatus(): Observable { - return observableOf(!this.isLoading); + return of(!this.isLoading); } /** diff --git a/src/app/submission/sections/license/section-license.component.spec.ts b/src/app/submission/sections/license/section-license.component.spec.ts index 5c274d0a59..3b8054c067 100644 --- a/src/app/submission/sections/license/section-license.component.spec.ts +++ b/src/app/submission/sections/license/section-license.component.spec.ts @@ -23,7 +23,8 @@ import { import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; +import { take } from 'rxjs/operators'; import { DsDynamicTypeBindRelationService } from 'src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; import { APP_CONFIG, @@ -189,7 +190,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { { provide: SubmissionObjectDataService, useValue: { - findById: () => observableOf(createSuccessfulRemoteDataObject(mockSubmissionObject)), + findById: () => of(createSuccessfulRemoteDataObject(mockSubmissionObject)), }, }, { provide: XSRFService, useValue: {} }, @@ -206,8 +207,8 @@ describe('SubmissionSectionLicenseComponent test suite', () => { // synchronous beforeEach beforeEach(() => { mockCollectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of([])); const html = ` `; @@ -250,8 +251,8 @@ describe('SubmissionSectionLicenseComponent test suite', () => { describe('', () => { beforeEach(() => { mockCollectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf([])); - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of([])); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); spyOn(formBuilderService, 'findById').and.returnValue(new DynamicCheckboxModel({ id: 'granted' })); }); @@ -293,7 +294,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { const model = formBuilderService.findById('granted', comp.formModel); (model as DynamicCheckboxModel).value = true; - compAsAny.getSectionStatus().subscribe((status) => { + compAsAny.getSectionStatus().pipe(take(1)).subscribe((status) => { expect(status).toBeTruthy(); done(); }); @@ -314,8 +315,8 @@ describe('SubmissionSectionLicenseComponent test suite', () => { describe('', () => { beforeEach(() => { mockCollectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); - sectionsServiceStub.getSectionErrors.and.returnValue(observableOf(mockLicenseParsedErrors.license)); - sectionsServiceStub.isSectionReadOnly.and.returnValue(observableOf(false)); + sectionsServiceStub.getSectionErrors.and.returnValue(of(mockLicenseParsedErrors.license)); + sectionsServiceStub.isSectionReadOnly.and.returnValue(of(false)); }); it('should set section errors properly', () => { @@ -376,10 +377,10 @@ describe('SubmissionSectionLicenseComponent test suite', () => { template: ``, standalone: true, imports: [ - SubmissionSectionLicenseComponent, - FormsModule, FormComponent, + FormsModule, ReactiveFormsModule, + SubmissionSectionLicenseComponent, ], }) class TestComponent { diff --git a/src/app/submission/sections/license/section-license.component.ts b/src/app/submission/sections/license/section-license.component.ts index c3fbb3946f..0bd786424c 100644 --- a/src/app/submission/sections/license/section-license.component.ts +++ b/src/app/submission/sections/license/section-license.component.ts @@ -63,8 +63,8 @@ import { templateUrl: './section-license.component.html', providers: [], imports: [ - FormComponent, AsyncPipe, + FormComponent, ], standalone: true, }) diff --git a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts index ed0ee65994..5c1af7ff87 100644 --- a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts +++ b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts @@ -58,10 +58,10 @@ import { LdnPattern } from './submission-coar-notify.config'; standalone: true, imports: [ AsyncPipe, - TranslateModule, + InfiniteScrollModule, NgbDropdownModule, NgClass, - InfiniteScrollModule, + TranslateModule, ], providers: [NgbDropdown], }) diff --git a/src/app/submission/sections/sections.service.spec.ts b/src/app/submission/sections/sections.service.spec.ts index 0241564ab7..765715b605 100644 --- a/src/app/submission/sections/sections.service.spec.ts +++ b/src/app/submission/sections/sections.service.spec.ts @@ -16,7 +16,7 @@ import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { storeModuleConfig } from '../../app.reducer'; import { SubmissionScopeType } from '../../core/submission/submission-scope-type'; @@ -171,7 +171,7 @@ describe('SectionsService test suite', () => { describe('getSectionData', () => { it('should return an observable with section\'s data', () => { - store.select.and.returnValue(observableOf(sectionData[sectionId])); + store.select.and.returnValue(of(sectionData[sectionId])); const expected = cold('(b|)', { b: sectionData[sectionId], @@ -183,7 +183,7 @@ describe('SectionsService test suite', () => { describe('getSectionErrors', () => { it('should return an observable with section\'s errors', () => { - store.select.and.returnValue(observableOf(sectionErrors[sectionId])); + store.select.and.returnValue(of(sectionErrors[sectionId])); const expected = cold('(b|)', { b: sectionErrors[sectionId], @@ -195,7 +195,7 @@ describe('SectionsService test suite', () => { describe('getSectionState', () => { it('should return an observable with section\'s state', () => { - store.select.and.returnValue(observableOf(sectionState)); + store.select.and.returnValue(of(sectionState)); const expected = cold('(b|)', { b: sectionState, @@ -207,7 +207,7 @@ describe('SectionsService test suite', () => { describe('isSectionValid', () => { it('should return an observable of boolean', () => { - store.select.and.returnValue(observableOf({ isValid: false })); + store.select.and.returnValue(of({ isValid: false })); let expected = cold('(b|)', { b: false, @@ -215,7 +215,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionValid(submissionId, sectionId)).toBeObservable(expected); - store.select.and.returnValue(observableOf({ isValid: true })); + store.select.and.returnValue(of({ isValid: true })); expected = cold('(b|)', { b: true, @@ -227,7 +227,7 @@ describe('SectionsService test suite', () => { describe('isSectionActive', () => { it('should return an observable of boolean', () => { - submissionServiceStub.getActiveSectionId.and.returnValue(observableOf(sectionId)); + submissionServiceStub.getActiveSectionId.and.returnValue(of(sectionId)); let expected = cold('(b|)', { b: true, @@ -235,7 +235,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionActive(submissionId, sectionId)).toBeObservable(expected); - submissionServiceStub.getActiveSectionId.and.returnValue(observableOf('test')); + submissionServiceStub.getActiveSectionId.and.returnValue(of('test')); expected = cold('(b|)', { b: false, @@ -247,7 +247,7 @@ describe('SectionsService test suite', () => { describe('isSectionEnabled', () => { it('should return an observable of boolean', () => { - store.select.and.returnValue(observableOf({ enabled: false })); + store.select.and.returnValue(of({ enabled: false })); let expected = cold('(b|)', { b: false, @@ -255,7 +255,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionEnabled(submissionId, sectionId)).toBeObservable(expected); - store.select.and.returnValue(observableOf({ enabled: true })); + store.select.and.returnValue(of({ enabled: true })); expected = cold('(b|)', { b: true, @@ -269,7 +269,7 @@ describe('SectionsService test suite', () => { describe('when submission scope is workspace', () => { describe('and section scope is workspace', () => { it('should return an observable of true when visibility main is READONLY and visibility other is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: { main: 'READONLY', @@ -284,7 +284,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkspaceItem)).toBeObservable(expected); }); it('should return an observable of true when both visibility main and other are READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: { main: 'READONLY', @@ -299,7 +299,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkspaceItem)).toBeObservable(expected); }); it('should return an observable of false when visibility main is null and visibility other is READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: { main: null, @@ -314,7 +314,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkspaceItem)).toBeObservable(expected); }); it('should return an observable of false when visibility is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: null, })); @@ -330,7 +330,7 @@ describe('SectionsService test suite', () => { describe('and section scope is workflow', () => { it('should return an observable of false when visibility main is READONLY and visibility other is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: { main: 'READONLY', @@ -345,7 +345,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkspaceItem)).toBeObservable(expected); }); it('should return an observable of true when both visibility main and other are READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: { main: 'READONLY', @@ -360,7 +360,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkspaceItem)).toBeObservable(expected); }); it('should return an observable of true when visibility main is null and visibility other is READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: { main: null, @@ -375,7 +375,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkspaceItem)).toBeObservable(expected); }); it('should return an observable of false when visibility is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: null, })); @@ -391,7 +391,7 @@ describe('SectionsService test suite', () => { describe('and section scope is null', () => { it('should return an observable of false', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: null, visibility: null, })); @@ -408,7 +408,7 @@ describe('SectionsService test suite', () => { describe('when submission scope is workflow', () => { describe('and section scope is workspace', () => { it('should return an observable of false when visibility main is READONLY and visibility other is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: { main: 'READONLY', @@ -423,7 +423,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkflowItem)).toBeObservable(expected); }); it('should return an observable of true when both visibility main and other are READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: { main: 'READONLY', @@ -438,7 +438,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkflowItem)).toBeObservable(expected); }); it('should return an observable of true when visibility main is null and visibility other is READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: { main: null, @@ -453,7 +453,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkflowItem)).toBeObservable(expected); }); it('should return an observable of false when visibility is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Submission, visibility: null, })); @@ -469,7 +469,7 @@ describe('SectionsService test suite', () => { describe('and section scope is workflow', () => { it('should return an observable of true when visibility main is READONLY and visibility other is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: { main: 'READONLY', @@ -484,7 +484,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkflowItem)).toBeObservable(expected); }); it('should return an observable of true when both visibility main and other is READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: { main: 'READONLY', @@ -499,7 +499,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkflowItem)).toBeObservable(expected); }); it('should return an observable of false when visibility main is null and visibility other is READONLY', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: { main: null, @@ -514,7 +514,7 @@ describe('SectionsService test suite', () => { expect(service.isSectionReadOnly(submissionId, sectionId, SubmissionScopeType.WorkflowItem)).toBeObservable(expected); }); it('should return an observable of false when visibility is null', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: SectionScope.Workflow, visibility: null, })); @@ -530,7 +530,7 @@ describe('SectionsService test suite', () => { describe('and section scope is null', () => { it('should return an observable of false', () => { - store.select.and.returnValue(observableOf({ + store.select.and.returnValue(of({ scope: null, visibility: null, })); @@ -547,7 +547,7 @@ describe('SectionsService test suite', () => { describe('isSectionAvailable', () => { it('should return an observable of true when section is available', () => { - store.select.and.returnValue(observableOf(submissionState)); + store.select.and.returnValue(of(submissionState)); const expected = cold('(b|)', { b: true, @@ -557,7 +557,7 @@ describe('SectionsService test suite', () => { }); it('should return an observable of false when section is not available', () => { - store.select.and.returnValue(observableOf(submissionState)); + store.select.and.returnValue(of(submissionState)); const expected = cold('(b|)', { b: false, @@ -569,7 +569,7 @@ describe('SectionsService test suite', () => { describe('isSectionTypeAvailable', () => { it('should return an observable of true when section is available', () => { - store.select.and.returnValue(observableOf(submissionState)); + store.select.and.returnValue(of(submissionState)); const expected = cold('(b|)', { b: true, @@ -579,7 +579,7 @@ describe('SectionsService test suite', () => { }); it('should return an observable of false when section is not available', () => { - store.select.and.returnValue(observableOf(submissionStateWithoutUpload)); + store.select.and.returnValue(of(submissionStateWithoutUpload)); const expected = cold('(b|)', { b: false, @@ -591,7 +591,7 @@ describe('SectionsService test suite', () => { describe('isSectionType', () => { it('should return true if the section matches the provided type', () => { - store.select.and.returnValue(observableOf(submissionState)); + store.select.and.returnValue(of(submissionState)); const expected = cold('(b|)', { b: true, @@ -601,7 +601,7 @@ describe('SectionsService test suite', () => { }); it('should return false if the section doesn\'t match the provided type', () => { - store.select.and.returnValue(observableOf(submissionState)); + store.select.and.returnValue(of(submissionState)); const expected = cold('(b|)', { b: false, @@ -611,7 +611,7 @@ describe('SectionsService test suite', () => { }); it('should return false if the provided sectionId doesn\'t exist', () => { - store.select.and.returnValue(observableOf(submissionState)); + store.select.and.returnValue(of(submissionState)); const expected = cold('(b|)', { b: false, @@ -667,8 +667,8 @@ describe('SectionsService test suite', () => { it('should dispatch a new UpdateSectionDataAction', () => { const scheduler = getTestScheduler(); const data: any = { test: 'test' }; - spyOn(service, 'isSectionAvailable').and.returnValue(observableOf(true)); - spyOn(service, 'isSectionEnabled').and.returnValue(observableOf(true)); + spyOn(service, 'isSectionAvailable').and.returnValue(of(true)); + spyOn(service, 'isSectionEnabled').and.returnValue(of(true)); scheduler.schedule(() => service.updateSectionData(submissionId, sectionId, data, [])); scheduler.flush(); @@ -678,9 +678,9 @@ describe('SectionsService test suite', () => { it('should dispatch a new UpdateSectionDataAction and display a new notification when section is not enabled', () => { const scheduler = getTestScheduler(); const data: any = { test: 'test' }; - spyOn(service, 'isSectionAvailable').and.returnValue(observableOf(true)); - spyOn(service, 'isSectionEnabled').and.returnValue(observableOf(false)); - translateService.get.and.returnValue(observableOf('test')); + spyOn(service, 'isSectionAvailable').and.returnValue(of(true)); + spyOn(service, 'isSectionEnabled').and.returnValue(of(false)); + translateService.get.and.returnValue(of('test')); scheduler.schedule(() => service.updateSectionData(submissionId, sectionId, data, [])); scheduler.flush(); diff --git a/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts b/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts index 29d947fdef..fd38f7b3e5 100644 --- a/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts +++ b/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts @@ -16,9 +16,9 @@ import { PermittedVersions } from '../../../../core/submission/models/sherpa-pol templateUrl: './content-accordion.component.html', styleUrls: ['./content-accordion.component.scss'], imports: [ - TranslateModule, NgbCollapseModule, TitleCasePipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts index 27e5939083..127c4810f9 100644 --- a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts +++ b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts @@ -15,8 +15,8 @@ import { Metadata } from '../../../../core/submission/models/sherpa-policies-det templateUrl: './metadata-information.component.html', styleUrls: ['./metadata-information.component.scss'], imports: [ - TranslateModule, DatePipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts index e2fd37f645..be6cef65f1 100644 --- a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts +++ b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts @@ -18,8 +18,8 @@ import { ContentAccordionComponent } from '../content-accordion/content-accordio styleUrls: ['./publisher-policy.component.scss'], imports: [ ContentAccordionComponent, - TranslateModule, KeyValuePipe, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts index 5882a277e6..086b6ab064 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts @@ -15,7 +15,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { AppState } from '../../../app.reducer'; @@ -102,7 +102,7 @@ describe('SubmissionSectionSherpaPoliciesComponent', () => { fixture = TestBed.createComponent(SubmissionSectionSherpaPoliciesComponent); component = fixture.componentInstance; de = fixture.debugElement; - sectionsServiceStub.getSectionData.and.returnValue(observableOf(SherpaDataResponse)); + sectionsServiceStub.getSectionData.and.returnValue(of(SherpaDataResponse)); fixture.detectChanges(); })); diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts index 88f72ef94e..4d444e8ac4 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts @@ -38,13 +38,13 @@ import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.co templateUrl: './section-sherpa-policies.component.html', styleUrls: ['./section-sherpa-policies.component.scss'], imports: [ + AlertComponent, + AsyncPipe, MetadataInformationComponent, NgbCollapseModule, - AlertComponent, - TranslateModule, - PublisherPolicyComponent, PublicationInformationComponent, - AsyncPipe, + PublisherPolicyComponent, + TranslateModule, VarDirective, ], standalone: true, diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts index 70bb064aee..4ada2792a1 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts @@ -402,10 +402,10 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { template: ``, standalone: true, imports: [ - SubmissionSectionUploadFileEditComponent, - FormsModule, FormComponent, + FormsModule, ReactiveFormsModule, + SubmissionSectionUploadFileEditComponent, ], }) class TestComponent { diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 1dc4c1ee52..4a70381fd6 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -78,9 +78,9 @@ import { styleUrls: ['./section-upload-file-edit.component.scss'], templateUrl: './section-upload-file-edit.component.html', imports: [ + BtnDisabledDirective, FormComponent, TranslateModule, - BtnDisabledDirective, ], standalone: true, }) diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts b/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts index 996ee34cd2..8bf9b94474 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts @@ -18,10 +18,7 @@ import { NgbModule, } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { - of as observableOf, - of, -} from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../../../../config/app-config.interface'; import { JsonPatchOperationPathCombiner } from '../../../../core/json-patch/builder/json-patch-operation-path-combiner'; @@ -201,7 +198,7 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { }); it('should init file data properly', () => { - uploadService.getFileData.and.returnValue(observableOf(fileData)); + uploadService.getFileData.and.returnValue(of(fileData)); comp.ngOnChanges({}); @@ -231,7 +228,7 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { it('should delete primary if file we delete is primary', () => { compAsAny.isPrimary = true; compAsAny.pathCombiner = pathCombiner; - operationsService.jsonPatchByResourceID.and.returnValue(observableOf({})); + operationsService.jsonPatchByResourceID.and.returnValue(of({})); compAsAny.deleteFile(); expect(operationsBuilder.remove).toHaveBeenCalledWith(pathCombiner.getPath('primary')); expect(uploadService.updateFilePrimaryBitstream).toHaveBeenCalledWith(submissionId, sectionId, null); @@ -240,14 +237,14 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { it('should NOT delete primary if file we delete is NOT primary', () => { compAsAny.isPrimary = false; compAsAny.pathCombiner = pathCombiner; - operationsService.jsonPatchByResourceID.and.returnValue(observableOf({})); + operationsService.jsonPatchByResourceID.and.returnValue(of({})); compAsAny.deleteFile(); expect(uploadService.updateFilePrimaryBitstream).not.toHaveBeenCalledTimes(1); }); it('should delete file properly', () => { compAsAny.pathCombiner = pathCombiner; - operationsService.jsonPatchByResourceID.and.returnValue(observableOf({})); + operationsService.jsonPatchByResourceID.and.returnValue(of({})); submissionServiceStub.getSubmissionObjectLinkName.and.returnValue('workspaceitems'); compAsAny.deleteFile(); @@ -285,9 +282,9 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { template: ``, standalone: true, imports: [ - ThemedSubmissionSectionUploadFileComponent, AsyncPipe, NgbModule, + ThemedSubmissionSectionUploadFileComponent, ], }) class TestComponent { diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.ts b/src/app/submission/sections/upload/file/section-upload-file.component.ts index cda5d429b5..0ef67333be 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.ts @@ -32,7 +32,6 @@ import { } from '../../../../shared/empty.util'; import { ThemedFileDownloadLinkComponent } from '../../../../shared/file-download-link/themed-file-download-link.component'; import { FormService } from '../../../../shared/form/form.service'; -import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { SubmissionService } from '../../../submission.service'; import { SectionUploadService } from '../section-upload.service'; import { SubmissionSectionUploadFileEditComponent } from './edit/section-upload-file-edit.component'; @@ -46,12 +45,11 @@ import { SubmissionSectionUploadFileViewComponent } from './view/section-upload- styleUrls: ['./section-upload-file.component.scss'], templateUrl: './section-upload-file.component.html', imports: [ - TranslateModule, - SubmissionSectionUploadFileViewComponent, AsyncPipe, - ThemedFileDownloadLinkComponent, - FileSizePipe, BtnDisabledDirective, + SubmissionSectionUploadFileViewComponent, + ThemedFileDownloadLinkComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts index 39de40d85c..f2cf0112ab 100644 --- a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts @@ -12,7 +12,9 @@ import { SubmissionSectionUploadFileComponent } from './section-upload-file.comp styleUrls: [], templateUrl: '../../../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionSectionUploadFileComponent], + imports: [ + SubmissionSectionUploadFileComponent, + ], }) export class ThemedSubmissionSectionUploadFileComponent extends ThemedComponent { diff --git a/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts b/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts index 0bb7cab947..8574c2c8c9 100644 --- a/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts +++ b/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts @@ -24,10 +24,10 @@ import { SubmissionSectionUploadAccessConditionsComponent } from '../../accessCo selector: 'ds-submission-section-upload-file-view', templateUrl: './section-upload-file-view.component.html', imports: [ + FileSizePipe, SubmissionSectionUploadAccessConditionsComponent, TranslateModule, TruncatePipe, - FileSizePipe, ], standalone: true, }) diff --git a/src/app/submission/sections/upload/section-upload.component.spec.ts b/src/app/submission/sections/upload/section-upload.component.spec.ts index 36f1bd4a4d..67058ba0f8 100644 --- a/src/app/submission/sections/upload/section-upload.component.spec.ts +++ b/src/app/submission/sections/upload/section-upload.component.spec.ts @@ -12,7 +12,7 @@ import { } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { SubmissionUploadsModel } from '../../../core/config/models/config-submission-uploads.model'; @@ -154,7 +154,7 @@ describe('SubmissionSectionUploadComponent test suite', () => { uploadsConfigService = getMockSubmissionUploadsConfigService(); prepareComp = () => { - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(Object.assign(new Collection(), mockCollection, { defaultAccessConditions: createSuccessfulRemoteDataObject$(mockDefaultAccessCondition), @@ -171,8 +171,8 @@ describe('SubmissionSectionUploadComponent test suite', () => { createSuccessfulRemoteDataObject$(Object.assign(new Group(), mockGroup)), ); - bitstreamService.getUploadedFileList.and.returnValue(observableOf([])); - bitstreamService.getUploadedFilesData.and.returnValue(observableOf({ primary: null, files: [] })); + bitstreamService.getUploadedFileList.and.returnValue(of([])); + bitstreamService.getUploadedFilesData.and.returnValue(of({ primary: null, files: [] })); }; TestBed.configureTestingModule({ @@ -248,8 +248,8 @@ describe('SubmissionSectionUploadComponent test suite', () => { }); it('should init component properly', () => { - bitstreamService.getUploadedFilesData.and.returnValue(observableOf({ primary: null, files: [] })); - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); + bitstreamService.getUploadedFilesData.and.returnValue(of({ primary: null, files: [] })); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(Object.assign(new Collection(), mockCollection, { defaultAccessConditions: createSuccessfulRemoteDataObject$(mockDefaultAccessCondition), @@ -278,9 +278,9 @@ describe('SubmissionSectionUploadComponent test suite', () => { }); it('should init file list properly', () => { - bitstreamService.getUploadedFilesData.and.returnValue(observableOf({ primary: null, files: [] })); + bitstreamService.getUploadedFilesData.and.returnValue(of({ primary: null, files: [] })); - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); @@ -293,7 +293,7 @@ describe('SubmissionSectionUploadComponent test suite', () => { createSuccessfulRemoteDataObject$(Object.assign(new Group(), mockGroup)), ); - bitstreamService.getUploadedFilesData.and.returnValue(observableOf(mockUploadFilesData)); + bitstreamService.getUploadedFilesData.and.returnValue(of(mockUploadFilesData)); comp.onSectionInit(); @@ -315,9 +315,9 @@ describe('SubmissionSectionUploadComponent test suite', () => { }); it('should properly read the section status when required is true', () => { - bitstreamService.getUploadedFilesData.and.returnValue(observableOf({ primary: null, files: [] })); + bitstreamService.getUploadedFilesData.and.returnValue(of({ primary: null, files: [] })); - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); @@ -346,9 +346,9 @@ describe('SubmissionSectionUploadComponent test suite', () => { }); it('should properly read the section status when required is false', () => { - submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); + submissionServiceStub.getSubmissionObject.and.returnValue(of(submissionState)); - bitstreamService.getUploadedFilesData.and.returnValue(observableOf({ primary: null, files: [] })); + bitstreamService.getUploadedFilesData.and.returnValue(of({ primary: null, files: [] })); collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection)); resourcePolicyService.findByHref.and.returnValue(createSuccessfulRemoteDataObject$(mockDefaultAccessCondition)); diff --git a/src/app/submission/sections/upload/section-upload.component.ts b/src/app/submission/sections/upload/section-upload.component.ts index 16075f83b3..6a690ebc10 100644 --- a/src/app/submission/sections/upload/section-upload.component.ts +++ b/src/app/submission/sections/upload/section-upload.component.ts @@ -68,11 +68,11 @@ export interface AccessConditionGroupsMapEntry { styleUrls: ['./section-upload.component.scss'], templateUrl: './section-upload.component.html', imports: [ - ThemedSubmissionSectionUploadFileComponent, - SubmissionSectionUploadAccessConditionsComponent, AlertComponent, - TranslateModule, AsyncPipe, + SubmissionSectionUploadAccessConditionsComponent, + ThemedSubmissionSectionUploadFileComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/submission/server-submission.service.ts b/src/app/submission/server-submission.service.ts index 993e38cdaa..a993c5fe35 100644 --- a/src/app/submission/server-submission.service.ts +++ b/src/app/submission/server-submission.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RemoteData } from '../core/data/remote-data'; @@ -21,7 +21,7 @@ export class ServerSubmissionService extends SubmissionService { * observable of SubmissionObject */ createSubmission(): Observable { - return observableOf(null); + return of(null); } /** @@ -31,7 +31,7 @@ export class ServerSubmissionService extends SubmissionService { * observable of SubmissionObject */ retrieveSubmission(submissionId): Observable> { - return observableOf(null); + return of(null); } /** diff --git a/src/app/submission/submission.service.spec.ts b/src/app/submission/submission.service.spec.ts index b8f982101c..df55824066 100644 --- a/src/app/submission/submission.service.spec.ts +++ b/src/app/submission/submission.service.spec.ts @@ -22,7 +22,7 @@ import { hot, } from 'jasmine-marbles'; import { - of as observableOf, + of, throwError as observableThrowError, } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -813,7 +813,7 @@ describe('SubmissionService test suite', () => { describe('hasUnsavedModification', () => { it('should call jsonPatchOperationService hasPendingOperation observable', () => { (service as any).jsonPatchOperationService.hasPendingOperations = jasmine.createSpy('hasPendingOperations') - .and.returnValue(observableOf(true)); + .and.returnValue(of(true)); scheduler = getTestScheduler(); scheduler.schedule(() => service.hasUnsavedModification()); @@ -1030,7 +1030,7 @@ describe('SubmissionService test suite', () => { describe('isSubmissionLoading', () => { it('should return true/false when section is loading/not loading', () => { - const spy = spyOn(service, 'getSubmissionObject').and.returnValue(observableOf({ isLoading: true })); + const spy = spyOn(service, 'getSubmissionObject').and.returnValue(of({ isLoading: true })); let expected = cold('(b|)', { b: true, @@ -1038,7 +1038,7 @@ describe('SubmissionService test suite', () => { expect(service.isSubmissionLoading(submissionId)).toBeObservable(expected); - spy.and.returnValue(observableOf({ isLoading: false })); + spy.and.returnValue(of({ isLoading: false })); expected = cold('(b|)', { b: false, @@ -1050,7 +1050,7 @@ describe('SubmissionService test suite', () => { describe('notifyNewSection', () => { it('should return true/false when section is loading/not loading', fakeAsync(() => { - spyOn((service as any).translate, 'get').and.returnValue(observableOf('test')); + spyOn((service as any).translate, 'get').and.returnValue(of('test')); spyOn((service as any).notificationsService, 'info'); @@ -1066,19 +1066,19 @@ describe('SubmissionService test suite', () => { scheduler = getTestScheduler(); const spy = spyOn((service as any).routeService, 'getPreviousUrl'); - spy.and.returnValue(observableOf('/mydspace?configuration=workflow')); + spy.and.returnValue(of('/mydspace?configuration=workflow')); scheduler.schedule(() => service.redirectToMyDSpace()); scheduler.flush(); expect((service as any).router.navigateByUrl).toHaveBeenCalledWith('/mydspace?configuration=workflow'); - spy.and.returnValue(observableOf('')); + spy.and.returnValue(of('')); scheduler.schedule(() => service.redirectToMyDSpace()); scheduler.flush(); expect((service as any).router.navigate).toHaveBeenCalledWith(['/mydspace']); - spy.and.returnValue(observableOf('/home')); + spy.and.returnValue(of('/home')); scheduler.schedule(() => service.redirectToMyDSpace()); scheduler.flush(); diff --git a/src/app/submission/submission.service.ts b/src/app/submission/submission.service.ts index ba8eff4f38..e5b0a62233 100644 --- a/src/app/submission/submission.service.ts +++ b/src/app/submission/submission.service.ts @@ -10,7 +10,7 @@ import { import { TranslateService } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, Subscription, timer as observableTimer, } from 'rxjs'; @@ -164,7 +164,7 @@ export class SubmissionService { createSubmission(collectionId?: string): Observable { return this.restService.postToEndpoint(this.workspaceLinkPath, {}, null, null, collectionId).pipe( map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject), - catchError(() => observableOf({} as SubmissionObject))); + catchError(() => of({} as SubmissionObject))); } /** diff --git a/src/app/submission/submit/submission-submit.component.spec.ts b/src/app/submission/submit/submission-submit.component.spec.ts index d54eaaeccb..82b9819fb6 100644 --- a/src/app/submission/submit/submission-submit.component.spec.ts +++ b/src/app/submission/submit/submission-submit.component.spec.ts @@ -16,7 +16,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { ItemDataService } from '../../core/data/item-data.service'; import { mockSubmissionObject } from '../../shared/mocks/submission.mock'; @@ -80,7 +80,7 @@ describe('SubmissionSubmitComponent Component', () => { it('should redirect to mydspace when an empty SubmissionObject has been retrieved',() => { - submissionServiceStub.createSubmission.and.returnValue(observableOf({})); + submissionServiceStub.createSubmission.and.returnValue(of({})); fixture.detectChanges(); @@ -90,7 +90,7 @@ describe('SubmissionSubmitComponent Component', () => { it('should redirect to workspaceitem edit when a not empty SubmissionObject has been retrieved',() => { - submissionServiceStub.createSubmission.and.returnValue(observableOf({ id: '1234' })); + submissionServiceStub.createSubmission.and.returnValue(of({ id: '1234' })); fixture.detectChanges(); @@ -100,7 +100,7 @@ describe('SubmissionSubmitComponent Component', () => { it('should not has effects when an invalid SubmissionObject has been retrieved',() => { - submissionServiceStub.createSubmission.and.returnValue(observableOf(null)); + submissionServiceStub.createSubmission.and.returnValue(of(null)); fixture.detectChanges(); diff --git a/src/app/submission/submit/themed-submission-submit.component.ts b/src/app/submission/submit/themed-submission-submit.component.ts index ee5ee74746..198462936c 100644 --- a/src/app/submission/submit/themed-submission-submit.component.ts +++ b/src/app/submission/submit/themed-submission-submit.component.ts @@ -11,7 +11,9 @@ import { SubmissionSubmitComponent } from './submission-submit.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [SubmissionSubmitComponent], + imports: [ + SubmissionSubmitComponent, + ], }) export class ThemedSubmissionSubmitComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/subscriptions-page/subscriptions-page.component.spec.ts b/src/app/subscriptions-page/subscriptions-page.component.spec.ts index cd582ddf41..932698f4f9 100644 --- a/src/app/subscriptions-page/subscriptions-page.component.spec.ts +++ b/src/app/subscriptions-page/subscriptions-page.component.spec.ts @@ -19,7 +19,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../core/auth/auth.service'; import { buildPaginatedList } from '../core/data/paginated-list.model'; @@ -48,7 +48,7 @@ describe('SubscriptionsPageComponent', () => { let de: DebugElement; const authServiceStub = jasmine.createSpyObj('authorizationService', { - getAuthenticatedUserFromStore: observableOf(mockSubscriptionEperson), + getAuthenticatedUserFromStore: of(mockSubscriptionEperson), }); const subscriptionServiceStub = jasmine.createSpyObj('SubscriptionsDataService', { diff --git a/src/app/subscriptions-page/subscriptions-page.component.ts b/src/app/subscriptions-page/subscriptions-page.component.ts index 1d967d3332..0840c3a153 100644 --- a/src/app/subscriptions-page/subscriptions-page.component.ts +++ b/src/app/subscriptions-page/subscriptions-page.component.ts @@ -45,7 +45,15 @@ import { VarDirective } from '../shared/utils/var.directive'; templateUrl: './subscriptions-page.component.html', styleUrls: ['./subscriptions-page.component.scss'], standalone: true, - imports: [ThemedLoadingComponent, VarDirective, PaginationComponent, SubscriptionViewComponent, AlertComponent, AsyncPipe, TranslateModule], + imports: [ + AlertComponent, + AsyncPipe, + PaginationComponent, + SubscriptionViewComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) /** * List and allow to manage all the active subscription for the current user diff --git a/src/app/suggestions-page/suggestions-page.component.spec.ts b/src/app/suggestions-page/suggestions-page.component.spec.ts index a8c725f416..e39f17c35c 100644 --- a/src/app/suggestions-page/suggestions-page.component.spec.ts +++ b/src/app/suggestions-page/suggestions-page.component.spec.ts @@ -16,7 +16,7 @@ import { TranslateService, } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthService } from '../core/auth/auth.service'; @@ -54,17 +54,17 @@ describe('SuggestionPageComponent', () => { const mockSuggestionsTargetStateService = getMockSuggestionNotificationsStateService(); const router = new RouterStub(); const routeStub = { - data: observableOf({ + data: of({ suggestionTargets: createSuccessfulRemoteDataObject(mockSuggestionTargetsObjectOne), }), - queryParams: observableOf({}), + queryParams: of({}), }; const workspaceitemServiceMock = jasmine.createSpyObj('WorkspaceitemDataService', { importExternalSourceEntry: jasmine.createSpy('importExternalSourceEntry'), }); const authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), setRedirectUrl: {}, }); const paginationService = new PaginationServiceStub(); @@ -118,7 +118,7 @@ describe('SuggestionPageComponent', () => { it('should update page on pagination change', () => { spyOn(component, 'updatePage').and.callThrough(); - component.targetId$ = observableOf('testid'); + component.targetId$ = of('testid'); scheduler.schedule(() => component.onPaginationChange()); scheduler.flush(); @@ -130,7 +130,7 @@ describe('SuggestionPageComponent', () => { spyOn(component.processing$, 'next'); spyOn(component.suggestionsRD$, 'next'); - component.targetId$ = observableOf('testid'); + component.targetId$ = of('testid'); scheduler.schedule(() => component.updatePage().subscribe()); scheduler.flush(); @@ -142,7 +142,7 @@ describe('SuggestionPageComponent', () => { it('should flag suggestion for deletion', fakeAsync(() => { spyOn(component, 'updatePage').and.callThrough(); - component.targetId$ = observableOf('testid'); + component.targetId$ = of('testid'); scheduler.schedule(() => component.ignoreSuggestion('1')); scheduler.flush(); @@ -154,7 +154,7 @@ describe('SuggestionPageComponent', () => { it('should flag all suggestion for deletion', () => { spyOn(component, 'updatePage').and.callThrough(); - component.targetId$ = observableOf('testid'); + component.targetId$ = of('testid'); scheduler.schedule(() => component.ignoreSuggestionAllSelected()); scheduler.flush(); @@ -166,7 +166,7 @@ describe('SuggestionPageComponent', () => { it('should approve and import', () => { spyOn(component, 'updatePage').and.callThrough(); - component.targetId$ = observableOf('testid'); + component.targetId$ = of('testid'); scheduler.schedule(() => component.approveAndImport({ collectionId: '1234' } as unknown as SuggestionApproveAndImport)); scheduler.flush(); @@ -178,7 +178,7 @@ describe('SuggestionPageComponent', () => { it('should approve and import multiple suggestions', () => { spyOn(component, 'updatePage').and.callThrough(); - component.targetId$ = observableOf('testid'); + component.targetId$ = of('testid'); scheduler.schedule(() => component.approveAndImportAllSelected({ collectionId: '1234' } as unknown as SuggestionApproveAndImport)); scheduler.flush(); diff --git a/src/app/suggestions-page/suggestions-page.component.ts b/src/app/suggestions-page/suggestions-page.component.ts index 32b1212b0c..bf2a901a3b 100644 --- a/src/app/suggestions-page/suggestions-page.component.ts +++ b/src/app/suggestions-page/suggestions-page.component.ts @@ -64,15 +64,15 @@ import { getWorkspaceItemEditRoute } from '../workflowitems-edit-page/workflowit templateUrl: './suggestions-page.component.html', styleUrls: ['./suggestions-page.component.scss'], imports: [ - AsyncPipe, - VarDirective, - RouterLink, - TranslateModule, - SuggestionActionsComponent, - ThemedLoadingComponent, - PaginationComponent, - SuggestionListElementComponent, AlertComponent, + AsyncPipe, + PaginationComponent, + RouterLink, + SuggestionActionsComponent, + SuggestionListElementComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], standalone: true, }) diff --git a/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts b/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts index cf98fe9339..85448aed2d 100644 --- a/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts +++ b/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts @@ -41,7 +41,10 @@ import { SystemWideAlert } from '../system-wide-alert.model'; styleUrls: ['./system-wide-alert-banner.component.scss'], templateUrl: './system-wide-alert-banner.component.html', standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) export class SystemWideAlertBannerComponent implements OnInit, OnDestroy { diff --git a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts index 428839a057..265a583e42 100644 --- a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts +++ b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts @@ -57,7 +57,16 @@ import { SystemWideAlert } from '../system-wide-alert.model'; styleUrls: ['./system-wide-alert-form.component.scss'], templateUrl: './system-wide-alert-form.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, UiSwitchModule, NgbDatepickerModule, NgbTimepickerModule, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AsyncPipe, + BtnDisabledDirective, + FormsModule, + NgbDatepickerModule, + NgbTimepickerModule, + ReactiveFormsModule, + TranslateModule, + UiSwitchModule, + ], }) export class SystemWideAlertFormComponent implements OnInit { diff --git a/src/app/thumbnail/themed-thumbnail.component.ts b/src/app/thumbnail/themed-thumbnail.component.ts index 6d14378d3a..54d73071bf 100644 --- a/src/app/thumbnail/themed-thumbnail.component.ts +++ b/src/app/thumbnail/themed-thumbnail.component.ts @@ -13,7 +13,9 @@ import { ThumbnailComponent } from './thumbnail.component'; styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', standalone: true, - imports: [ThumbnailComponent], + imports: [ + ThumbnailComponent, + ], }) export class ThemedThumbnailComponent extends ThemedComponent { diff --git a/src/app/thumbnail/thumbnail.component.spec.ts b/src/app/thumbnail/thumbnail.component.spec.ts index dfe4285d40..51d3793b6d 100644 --- a/src/app/thumbnail/thumbnail.component.spec.ts +++ b/src/app/thumbnail/thumbnail.component.spec.ts @@ -11,7 +11,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { AuthService } from '../core/auth/auth.service'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; @@ -54,15 +54,15 @@ describe('ThumbnailComponent', () => { describe('when platform is browser', () => { beforeEach(waitForAsync(() => { authService = jasmine.createSpyObj('AuthService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); authorizationService = jasmine.createSpyObj('AuthorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); fileService = jasmine.createSpyObj('FileService', { retrieveFileDownloadLink: null, }); - fileService.retrieveFileDownloadLink.and.callFake((url) => observableOf(`${url}?authentication-token=fake`)); + fileService.retrieveFileDownloadLink.and.callFake((url) => of(`${url}?authentication-token=fake`)); TestBed.configureTestingModule({ imports: [ @@ -180,7 +180,7 @@ describe('ThumbnailComponent', () => { describe('if not logged in', () => { beforeEach(() => { - authService.isAuthenticated.and.returnValue(observableOf(false)); + authService.isAuthenticated.and.returnValue(of(false)); }); it('should fall back to default', () => { @@ -191,12 +191,12 @@ describe('ThumbnailComponent', () => { describe('if logged in', () => { beforeEach(() => { - authService.isAuthenticated.and.returnValue(observableOf(true)); + authService.isAuthenticated.and.returnValue(of(true)); }); describe('and authorized to download the thumbnail', () => { beforeEach(() => { - authorizationService.isAuthorized.and.returnValue(observableOf(true)); + authorizationService.isAuthorized.and.returnValue(of(true)); }); it('should add an authentication token to the thumbnail URL', () => { @@ -213,7 +213,7 @@ describe('ThumbnailComponent', () => { describe('but not authorized to download the thumbnail', () => { beforeEach(() => { - authorizationService.isAuthorized.and.returnValue(observableOf(false)); + authorizationService.isAuthorized.and.returnValue(of(false)); }); it('should fall back to default', () => { @@ -373,15 +373,15 @@ describe('ThumbnailComponent', () => { beforeEach(waitForAsync(() => { authService = jasmine.createSpyObj('AuthService', { - isAuthenticated: observableOf(true), + isAuthenticated: of(true), }); authorizationService = jasmine.createSpyObj('AuthorizationService', { - isAuthorized: observableOf(true), + isAuthorized: of(true), }); fileService = jasmine.createSpyObj('FileService', { retrieveFileDownloadLink: null, }); - fileService.retrieveFileDownloadLink.and.callFake((url) => observableOf(`${url}?authentication-token=fake`)); + fileService.retrieveFileDownloadLink.and.callFake((url) => of(`${url}?authentication-token=fake`)); TestBed.configureTestingModule({ imports: [ diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 73f55de15c..d0fb308adf 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -13,7 +13,7 @@ import { WritableSignal, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { AuthService } from '../core/auth/auth.service'; @@ -39,7 +39,12 @@ import { SafeUrlPipe } from '../shared/utils/safe-url-pipe'; styleUrls: ['./thumbnail.component.scss'], templateUrl: './thumbnail.component.html', standalone: true, - imports: [CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe], + imports: [ + CommonModule, + SafeUrlPipe, + ThemedLoadingComponent, + TranslateModule, + ], }) export class ThumbnailComponent implements OnChanges { /** @@ -150,14 +155,14 @@ export class ThumbnailComponent implements OnChanges { if (isLoggedIn) { return this.authorizationService.isAuthorized(FeatureID.CanDownload, thumbnail.self); } else { - return observableOf(false); + return of(false); } }), switchMap((isAuthorized) => { if (isAuthorized) { return this.fileService.retrieveFileDownloadLink(thumbnailSrc); } else { - return observableOf(null); + return of(null); } }), ).subscribe((url: string) => { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts index fe45023718..1b470b458c 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts @@ -14,7 +14,7 @@ import { } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; @@ -77,7 +77,7 @@ describe('AdvancedWorkflowActionRatingComponent', () => { { provide: ActivatedRoute, useValue: { - data: observableOf({ + data: of({ id: workflowId, wfi: createSuccessfulRemoteDataObject(workflowItem), }), @@ -130,7 +130,7 @@ describe('AdvancedWorkflowActionRatingComponent', () => { }); it('should call the claimedTaskDataService with the rating and the required description when it has been rated and return to the mydspace page', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true))); component.ratingForm.setValue({ review: 'Good job!', rating: 4, @@ -148,7 +148,7 @@ describe('AdvancedWorkflowActionRatingComponent', () => { }); it('should not call the claimedTaskDataService when the required description is empty', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true))); component.ratingForm.setValue({ review: '', rating: 4, @@ -169,7 +169,7 @@ describe('AdvancedWorkflowActionRatingComponent', () => { }); it('should call the claimedTaskDataService with the optional review when provided and return to the mydspace page', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true))); component.ratingForm.setValue({ review: 'Good job!', rating: 4, @@ -187,7 +187,7 @@ describe('AdvancedWorkflowActionRatingComponent', () => { }); it('should call the claimedTaskDataService when the optional description is empty and return to the mydspace page', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true))); component.ratingForm.setValue({ review: '', rating: 4, diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts index 1e12a6390c..1b95ffcd61 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts @@ -33,12 +33,12 @@ export const ADVANCED_WORKFLOW_ACTION_RATING = 'scorereviewaction'; styleUrls: ['./advanced-workflow-action-rating.component.scss'], preserveWhitespaces: false, imports: [ - ModifyItemOverviewComponent, AsyncPipe, - TranslateModule, + ModifyItemOverviewComponent, NgbRatingModule, NgClass, ReactiveFormsModule, + TranslateModule, VarDirective, ], standalone: true, diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts index eb79aa390c..0916f27f16 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts @@ -9,7 +9,7 @@ import { Router, } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; @@ -74,7 +74,7 @@ describe('AdvancedWorkflowActionSelectReviewerComponent', () => { { provide: ActivatedRoute, useValue: { - data: observableOf({ + data: of({ id: workflowId, wfi: createSuccessfulRemoteDataObject(workflowItem), }), @@ -137,7 +137,7 @@ describe('AdvancedWorkflowActionSelectReviewerComponent', () => { }); it('should call the claimedTaskDataService with the list of selected ePersons', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true))); component.selectedReviewers = [EPersonMock, EPersonMock2]; component.performAction(); @@ -151,7 +151,7 @@ describe('AdvancedWorkflowActionSelectReviewerComponent', () => { }); it('should not call the claimedTaskDataService with the list of selected ePersons when it\'s empty', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true))); component.selectedReviewers = []; component.performAction(); @@ -160,7 +160,7 @@ describe('AdvancedWorkflowActionSelectReviewerComponent', () => { }); it('should not call the return to mydspace page when the request failed', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(false))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(false))); component.selectedReviewers = [EPersonMock, EPersonMock2]; component.performAction(); diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts index 72f5623626..b14feb2f22 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts @@ -46,8 +46,8 @@ export const ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER = 'selectrevieweraction'; imports: [ CommonModule, ModifyItemOverviewComponent, - TranslateModule, ReviewersListComponent, + TranslateModule, ], standalone: true, }) diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts index e826de1c0e..9e66703d6c 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts @@ -31,7 +31,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RestResponse } from '../../../../core/cache/response.models'; @@ -116,7 +116,7 @@ describe('ReviewersListComponent', () => { epersonMembers: epersonMembers, epersonNonMembers: epersonNonMembers, getActiveGroup(): Observable { - return observableOf(activeGroup); + return of(activeGroup); }, getEPersonMembers() { return this.epersonMembers; @@ -130,7 +130,7 @@ describe('ReviewersListComponent', () => { this.epersonNonMembers.splice(index, 1); } }); - return observableOf(new RestResponse(true, 200, 'Success')); + return of(new RestResponse(true, 200, 'Success')); }, clearGroupsRequests() { // empty @@ -150,7 +150,7 @@ describe('ReviewersListComponent', () => { }); // Add eperson to list of non-members this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete]; - return observableOf(new RestResponse(true, 200, 'Success')); + return of(new RestResponse(true, 200, 'Success')); }, // Used to find the currently active group findById(id: string) { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts index 1644d22697..20945e8061 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts @@ -26,7 +26,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -66,14 +66,14 @@ enum SubKey { templateUrl: '../../../../access-control/group-registry/group-form/members-list/members-list.component.html', standalone: true, imports: [ - TranslateModule, - ContextHelpDirective, - ReactiveFormsModule, - PaginationComponent, AsyncPipe, - RouterLink, - NgClass, BtnDisabledDirective, + ContextHelpDirective, + NgClass, + PaginationComponent, + ReactiveFormsModule, + RouterLink, + TranslateModule, ], }) export class ReviewersListComponent extends MembersListComponent implements OnInit, OnChanges, OnDestroy { @@ -158,7 +158,7 @@ export class ReviewersListComponent extends MembersListComponent implements OnIn * @param possibleMember The {@link EPerson} that needs to be checked */ isMemberOfGroup(possibleMember: EPerson): Observable { - return observableOf(hasValue(this.selectedReviewers.find((reviewer: EPerson) => reviewer.id === possibleMember.id))); + return of(hasValue(this.selectedReviewers.find((reviewer: EPerson) => reviewer.id === possibleMember.id))); } /** diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts index ab1494341e..0f277651e1 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts @@ -8,7 +8,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { MockComponent } from 'ng-mocks'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; @@ -58,7 +58,7 @@ describe('AdvancedWorkflowActionComponent', () => { { provide: ActivatedRoute, useValue: { - data: observableOf({ + data: of({ id: workflowId, }), snapshot: { @@ -89,7 +89,7 @@ describe('AdvancedWorkflowActionComponent', () => { describe('sendRequest', () => { it('should return true if the request succeeded', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(true, 200))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(true, 200))); spyOn(workflowActionDataService, 'findById'); const result = component.sendRequest(workflowId); @@ -103,7 +103,7 @@ describe('AdvancedWorkflowActionComponent', () => { }); it('should return false if the request didn\'t succeeded', () => { - spyOn(claimedTaskDataService, 'submitTask').and.returnValue(observableOf(new ProcessTaskResponse(false, 404))); + spyOn(claimedTaskDataService, 'submitTask').and.returnValue(of(new ProcessTaskResponse(false, 404))); spyOn(workflowActionDataService, 'findById'); const result = component.sendRequest(workflowId); @@ -123,7 +123,9 @@ describe('AdvancedWorkflowActionComponent', () => { selector: '', template: '', standalone: true, - imports: [RouterTestingModule], + imports: [ + RouterTestingModule, + ], }) class TestComponent extends AdvancedWorkflowActionComponent { diff --git a/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts index 64fb97147b..13d2322430 100644 --- a/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts @@ -23,7 +23,7 @@ import { } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { RequestService } from '../core/data/request.service'; @@ -56,7 +56,7 @@ describe('WorkflowItemActionPageComponent', () => { function init() { wfiService = jasmine.createSpyObj('workflowItemService', { - sendBack: observableOf(true), + sendBack: of(true), }); itemRD$ = createSuccessfulRemoteDataObject$(itemRD$); wfi = new WorkflowItem(); @@ -131,7 +131,12 @@ describe('WorkflowItemActionPageComponent', () => { @Component({ selector: 'ds-workflow-item-test-action-page', templateUrl: 'workflow-item-action-page.component.html', - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], + imports: [ + CommonModule, + ModifyItemOverviewComponent, + TranslateModule, + VarDirective, + ], standalone: true, }) class TestComponent extends WorkflowItemActionPageDirective { @@ -152,6 +157,6 @@ class TestComponent extends WorkflowItemActionPageDirective { } sendRequest(id: string): Observable { - return observableOf(true); + return of(true); } } diff --git a/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts b/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts index 39180d1c7b..3d3859f101 100644 --- a/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts @@ -12,7 +12,9 @@ import { WorkflowItemDeleteComponent } from './workflow-item-delete.component'; styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [WorkflowItemDeleteComponent], + imports: [ + WorkflowItemDeleteComponent, + ], }) export class ThemedWorkflowItemDeleteComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts index 801113c4ce..978ae267fd 100644 --- a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../core/data/request.service'; import { RouteService } from '../../core/services/route.service'; @@ -43,7 +43,7 @@ describe('WorkflowItemDeleteComponent', () => { function init() { wfiService = jasmine.createSpyObj('workflowItemService', { - delete: observableOf(true), + delete: of(true), }); itemRD$ = createSuccessfulRemoteDataObject$(itemRD$); wfi = new WorkflowItem(); diff --git a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts index 0352eba098..1a30d0cedf 100644 --- a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts @@ -29,7 +29,12 @@ import { WorkflowItemActionPageDirective } from '../workflow-item-action-page.co selector: 'ds-base-workflow-item-delete', templateUrl: '../workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], + imports: [ + CommonModule, + ModifyItemOverviewComponent, + TranslateModule, + VarDirective, + ], }) /** * Component representing a page to delete a workflow item diff --git a/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts b/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts index 72edd8147e..a911578a80 100644 --- a/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts @@ -12,7 +12,9 @@ import { WorkflowItemSendBackComponent } from './workflow-item-send-back.compone styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [WorkflowItemSendBackComponent], + imports: [ + WorkflowItemSendBackComponent, + ], }) export class ThemedWorkflowItemSendBackComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts index 2a25bc0cc6..af74f39f5d 100644 --- a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts @@ -13,7 +13,7 @@ import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RequestService } from '../../core/data/request.service'; import { RouteService } from '../../core/services/route.service'; @@ -43,7 +43,7 @@ describe('WorkflowItemSendBackComponent', () => { function init() { wfiService = jasmine.createSpyObj('workflowItemService', { - sendBack: observableOf(true), + sendBack: of(true), }); itemRD$ = createSuccessfulRemoteDataObject$(itemRD$); wfi = new WorkflowItem(); diff --git a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts index ad0b1d91a8..52cf7c8678 100644 --- a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts @@ -25,7 +25,12 @@ import { WorkflowItemActionPageDirective } from '../workflow-item-action-page.co selector: 'ds-base-workflow-item-send-back', templateUrl: '../workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], + imports: [ + CommonModule, + ModifyItemOverviewComponent, + TranslateModule, + VarDirective, + ], }) /** * Component representing a page to send back a workflow item to the submitter diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts index b7e1858b79..c0ddf70f5e 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts @@ -11,7 +11,9 @@ import { WorkspaceItemsDeletePageComponent } from './workspaceitems-delete-page. styleUrls: [], templateUrl: './../../shared/theme-support/themed.component.html', standalone: true, - imports: [WorkspaceItemsDeletePageComponent], + imports: [ + WorkspaceItemsDeletePageComponent, + ], }) export class ThemedWorkspaceItemsDeletePageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts index 2dd564ac56..5baef9c800 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts @@ -17,7 +17,7 @@ import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { of } from 'rxjs'; import { RouteService } from '../../core/services/route.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; @@ -37,7 +37,7 @@ describe('WorkspaceitemsDeletePageComponent', () => { let fixture: ComponentFixture; const workspaceitemDataServiceSpy = jasmine.createSpyObj('WorkspaceitemDataService', { - delete: observableOf(createSuccessfulRemoteDataObject({})), + delete: of(createSuccessfulRemoteDataObject({})), }); const wsi = new WorkspaceItem(); @@ -46,7 +46,7 @@ describe('WorkspaceitemsDeletePageComponent', () => { dso.uuid = '1234'; const translateServiceStub = { - get: () => observableOf('test-message'), + get: () => of('test-message'), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), onDefaultLangChange: new EventEmitter(), diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts index 00ab6e969c..41e0d5f051 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts @@ -42,9 +42,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s templateUrl: './workspaceitems-delete-page.component.html', styleUrls: ['./workspaceitems-delete-page.component.scss'], imports: [ + CommonModule, ModifyItemOverviewComponent, TranslateModule, - CommonModule, ], standalone: true, }) diff --git a/src/ngx-translate-loaders/translate-browser.loader.ts b/src/ngx-translate-loaders/translate-browser.loader.ts index 56c856e741..7487560eec 100644 --- a/src/ngx-translate-loaders/translate-browser.loader.ts +++ b/src/ngx-translate-loaders/translate-browser.loader.ts @@ -3,7 +3,7 @@ import { TransferState } from '@angular/core'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -39,7 +39,7 @@ export class TranslateBrowserLoader implements TranslateLoader { const state = this.transferState.get(NGX_TRANSLATE_STATE, {}); const messages = state[lang]; if (hasValue(messages)) { - return observableOf(messages); + return of(messages); } else { const translationHash: string = environment.production ? `.${(process.env.languageHashes as any)[lang + '.json5']}` : ''; // If they're not available on the transfer state (e.g. when running in dev mode), retrieve diff --git a/src/ngx-translate-loaders/translate-server.loader.ts b/src/ngx-translate-loaders/translate-server.loader.ts index 8950b91a6b..e17784ecfb 100644 --- a/src/ngx-translate-loaders/translate-server.loader.ts +++ b/src/ngx-translate-loaders/translate-server.loader.ts @@ -3,7 +3,7 @@ import { TranslateLoader } from '@ngx-translate/core'; import { readFileSync } from 'fs'; import { Observable, - of as observableOf, + of, } from 'rxjs'; import { @@ -37,7 +37,7 @@ export class TranslateServerLoader implements TranslateLoader { // app loads on the client this.storeInTransferState(lang, messages); // Return the parsed messages to translate things server side - return observableOf(messages); + return of(messages); } /** diff --git a/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts index f09e8a2340..b844c41c64 100644 --- a/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts +++ b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts @@ -10,7 +10,9 @@ import { ThemedConfigurationSearchPageComponent } from '../../../../../app/searc // templateUrl: './admin-search-page.component.html', templateUrl: '../../../../../app/admin/admin-search-page/admin-search-page.component.html', standalone: true, - imports: [ThemedConfigurationSearchPageComponent], + imports: [ + ThemedConfigurationSearchPageComponent, + ], }) export class AdminSearchPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts b/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts index 237d107083..f41fabbc43 100644 --- a/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -5,14 +5,11 @@ import { } from '@angular/common'; import { Component } from '@angular/core'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslatePipe } from '@ngx-translate/core'; import { AdminSidebarComponent as BaseComponent } from '../../../../../app/admin/admin-sidebar/admin-sidebar.component'; import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; -/** - * Component representing the admin sidebar - */ @Component({ selector: 'ds-themed-admin-sidebar', // templateUrl: './admin-sidebar.component.html', @@ -20,7 +17,14 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi // styleUrls: ['./admin-sidebar.component.scss'] styleUrls: ['../../../../../app/admin/admin-sidebar/admin-sidebar.component.scss'], standalone: true, - imports: [ NgbDropdownModule, NgClass, NgComponentOutlet, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + NgbDropdownModule, + NgClass, + NgComponentOutlet, + TranslatePipe, + ], }) export class AdminSidebarComponent extends BaseComponent { } diff --git a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 989e6535aa..c98d7db47f 100644 --- a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -23,15 +23,15 @@ import { ThemedThumbnailComponent } from '../../../../../app/thumbnail/themed-th changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - FormComponent, - VarDirective, - ThemedThumbnailComponent, AsyncPipe, - RouterLink, ErrorComponent, - ThemedLoadingComponent, - TranslateModule, FileSizePipe, + FormComponent, + RouterLink, + ThemedLoadingComponent, + ThemedThumbnailComponent, + TranslateModule, + VarDirective, ], }) export class EditBitstreamPageComponent extends BaseComponent { diff --git a/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts b/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts index e2589ba238..a7d1b940e4 100644 --- a/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts +++ b/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts @@ -10,9 +10,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { BreadcrumbsComponent as BaseComponent } from '../../../../app/breadcrumbs/breadcrumbs.component'; import { VarDirective } from '../../../../app/shared/utils/var.directive'; -/** - * Component representing the breadcrumbs of a page - */ @Component({ selector: 'ds-themed-breadcrumbs', // templateUrl: './breadcrumbs.component.html', @@ -20,7 +17,14 @@ import { VarDirective } from '../../../../app/shared/utils/var.directive'; // styleUrls: ['./breadcrumbs.component.scss'] styleUrls: ['../../../../app/breadcrumbs/breadcrumbs.component.scss'], standalone: true, - imports: [VarDirective, NgTemplateOutlet, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbTooltipModule, + NgTemplateOutlet, + RouterLink, + TranslateModule, + VarDirective, + ], }) export class BreadcrumbsComponent extends BaseComponent { } diff --git a/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts index e6f40363da..aa9dc9d29c 100644 --- a/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -15,9 +15,9 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed standalone: true, imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, ThemedBrowseByComponent, + ThemedLoadingComponent, + TranslateModule, ], }) export class BrowseByDateComponent extends BaseComponent { diff --git a/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index 2d3137541e..68288aaecf 100644 --- a/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -15,9 +15,9 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed standalone: true, imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, ThemedBrowseByComponent, + ThemedLoadingComponent, + TranslateModule, ], }) export class BrowseByMetadataComponent extends BaseComponent { diff --git a/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts b/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts index 4c4dc0a332..1f81b21dca 100644 --- a/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts @@ -1,19 +1,9 @@ -import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslatePipe } from '@ngx-translate/core'; import { BrowseByTaxonomyComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component'; -import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/themed-browse-by.component'; -import { ThemedComcolPageBrowseByComponent } from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { ThemedComcolPageContentComponent } from '../../../../../app/shared/comcol/comcol-page-content/themed-comcol-page-content.component'; -import { ThemedComcolPageHandleComponent } from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageHeaderComponent } from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { VocabularyTreeviewComponent } from '../../../../../app/shared/form/vocabulary-treeview/vocabulary-treeview.component'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-browse-by-taxonomy', @@ -23,19 +13,9 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; styleUrls: ['../../../../../app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.scss'], standalone: true, imports: [ - VarDirective, - AsyncPipe, - ComcolPageHeaderComponent, - ComcolPageLogoComponent, - ThemedComcolPageHandleComponent, - ThemedComcolPageContentComponent, - DsoEditMenuComponent, - ThemedComcolPageBrowseByComponent, - TranslateModule, - ThemedLoadingComponent, - ThemedBrowseByComponent, - VocabularyTreeviewComponent, RouterLink, + TranslatePipe, + VocabularyTreeviewComponent, ], }) export class BrowseByTaxonomyComponent extends BaseComponent { diff --git a/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts b/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts index 96e3dec322..a712f8ccc1 100644 --- a/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts @@ -15,9 +15,9 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed standalone: true, imports: [ AsyncPipe, - TranslateModule, - ThemedLoadingComponent, ThemedBrowseByComponent, + ThemedLoadingComponent, + TranslateModule, ], }) export class BrowseByTitleComponent extends BaseComponent { diff --git a/src/themes/custom/app/collection-page/collection-page.component.ts b/src/themes/custom/app/collection-page/collection-page.component.ts index ea08313508..8f4ede93c2 100644 --- a/src/themes/custom/app/collection-page/collection-page.component.ts +++ b/src/themes/custom/app/collection-page/collection-page.component.ts @@ -19,7 +19,6 @@ import { ComcolPageLogoComponent } from '../../../../app/shared/comcol/comcol-pa import { DsoEditMenuComponent } from '../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { ErrorComponent } from '../../../../app/shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; -import { ObjectCollectionComponent } from '../../../../app/shared/object-collection/object-collection.component'; import { VarDirective } from '../../../../app/shared/utils/var.directive'; @Component({ @@ -35,23 +34,19 @@ import { VarDirective } from '../../../../app/shared/utils/var.directive'; ], standalone: true, imports: [ - ThemedComcolPageContentComponent, - ErrorComponent, - ThemedLoadingComponent, - TranslateModule, - VarDirective, AsyncPipe, ComcolPageHeaderComponent, ComcolPageLogoComponent, - ThemedComcolPageHandleComponent, DsoEditMenuComponent, - ThemedComcolPageBrowseByComponent, - ObjectCollectionComponent, + ErrorComponent, RouterOutlet, + ThemedComcolPageBrowseByComponent, + ThemedComcolPageContentComponent, + ThemedComcolPageHandleComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], }) -/** - * This component represents a detail page for a single collection - */ export class CollectionPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts b/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts index e33ee21978..7240f59221 100644 --- a/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts +++ b/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts @@ -16,17 +16,14 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; templateUrl: '../../../../../app/collection-page/edit-item-template-page/edit-item-template-page.component.html', standalone: true, imports: [ - ThemedDsoEditMetadataComponent, - RouterLink, - AsyncPipe, - VarDirective, - TranslateModule, - ThemedLoadingComponent, AlertComponent, + AsyncPipe, + RouterLink, + ThemedDsoEditMetadataComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], }) -/** - * Component for editing the item template of a collection - */ export class EditItemTemplatePageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/community-list-page/community-list-page.component.ts b/src/themes/custom/app/community-list-page/community-list-page.component.ts index 571964d5de..189931e43e 100644 --- a/src/themes/custom/app/community-list-page/community-list-page.component.ts +++ b/src/themes/custom/app/community-list-page/community-list-page.component.ts @@ -10,12 +10,10 @@ import { CommunityListPageComponent as BaseComponent } from '../../../../app/com // templateUrl: './community-list-page.component.html' templateUrl: '../../../../app/community-list-page/community-list-page.component.html', standalone: true, - imports: [ThemedCommunityListComponent, TranslateModule], + imports: [ + ThemedCommunityListComponent, + TranslateModule, + ], }) - -/** - * Page with title and the community list tree, as described in community-list.component; - * navigated to with community-list.page.routing.module - */ -export class CommunityListPageComponent extends BaseComponent {} - +export class CommunityListPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/community-list-page/community-list/community-list.component.ts b/src/themes/custom/app/community-list-page/community-list/community-list.component.ts index 334829942a..9bf7efcffb 100644 --- a/src/themes/custom/app/community-list-page/community-list/community-list.component.ts +++ b/src/themes/custom/app/community-list-page/community-list/community-list.component.ts @@ -1,8 +1,5 @@ import { CdkTreeModule } from '@angular/cdk/tree'; -import { - AsyncPipe, - NgClass, -} from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -12,20 +9,21 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed import { TruncatableComponent } from '../../../../../app/shared/truncatable/truncatable.component'; import { TruncatablePartComponent } from '../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; -/** - * A tree-structured list of nodes representing the communities, their subCommunities and collections. - * Initially only the page-restricted top communities are shown. - * Each node can be expanded to show its children and all children are also page-limited. - * More pages of a page-limited result can be shown by pressing a show more node/link. - * Which nodes were expanded is kept in the store, so this persists across pages. - */ @Component({ selector: 'ds-themed-community-list', // styleUrls: ['./community-list.component.scss'], // templateUrl: './community-list.component.html' templateUrl: '../../../../../app/community-list-page/community-list/community-list.component.html', standalone: true, - imports: [ ThemedLoadingComponent, CdkTreeModule, NgClass, RouterLink, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + CdkTreeModule, + RouterLink, + ThemedLoadingComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], }) -export class CommunityListComponent extends BaseComponent {} - +export class CommunityListComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/community-page/community-page.component.ts b/src/themes/custom/app/community-page/community-page.component.ts index 3efb12163d..c64c726b05 100644 --- a/src/themes/custom/app/community-page/community-page.component.ts +++ b/src/themes/custom/app/community-page/community-page.component.ts @@ -10,8 +10,6 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { CommunityPageComponent as BaseComponent } from '../../../../app/community-page/community-page.component'; -import { ThemedCollectionPageSubCollectionListComponent } from '../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; -import { ThemedCommunityPageSubCommunityListComponent } from '../../../../app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; import { fadeInOut } from '../../../../app/shared/animations/fade'; import { ThemedComcolPageBrowseByComponent } from '../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { ThemedComcolPageContentComponent } from '../../../../app/shared/comcol/comcol-page-content/themed-comcol-page-content.component'; @@ -33,25 +31,20 @@ import { VarDirective } from '../../../../app/shared/utils/var.directive'; animations: [fadeInOut], standalone: true, imports: [ - ThemedComcolPageContentComponent, + AsyncPipe, + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + DsoEditMenuComponent, ErrorComponent, + RouterModule, + RouterOutlet, + ThemedComcolPageBrowseByComponent, + ThemedComcolPageContentComponent, + ThemedComcolPageHandleComponent, ThemedLoadingComponent, TranslateModule, - ThemedCommunityPageSubCommunityListComponent, - ThemedCollectionPageSubCollectionListComponent, - ThemedComcolPageBrowseByComponent, - DsoEditMenuComponent, - ThemedComcolPageHandleComponent, - ComcolPageLogoComponent, - ComcolPageHeaderComponent, - AsyncPipe, VarDirective, - RouterOutlet, - RouterModule, ], }) -/** - * This component represents a detail page for a single community - */ export class CommunityPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts index 0f890f3a32..1455bc6598 100644 --- a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts @@ -15,11 +15,11 @@ import { VarDirective } from '../../../../../../../app/shared/utils/var.directiv // templateUrl: './community-page-sub-collection-list.component.html', templateUrl: '../../../../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html', imports: [ - ObjectCollectionComponent, + AsyncPipe, ErrorComponent, + ObjectCollectionComponent, ThemedLoadingComponent, TranslateModule, - AsyncPipe, VarDirective, ], standalone: true, diff --git a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts index fb68aa911e..6750c324c5 100644 --- a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts @@ -16,15 +16,11 @@ import { VarDirective } from '../../../../../../../app/shared/utils/var.directiv templateUrl: '../../../../../../../app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html', standalone: true, imports: [ - ErrorComponent, - ThemedLoadingComponent, - VarDirective, - ObjectCollectionComponent, AsyncPipe, - TranslateModule, - ObjectCollectionComponent, ErrorComponent, + ObjectCollectionComponent, ThemedLoadingComponent, + TranslateModule, VarDirective, ], }) diff --git a/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts b/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts index fbafb647bb..dcc5093dd0 100644 --- a/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts +++ b/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts @@ -19,7 +19,18 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed // templateUrl: './dso-edit-metadata.component.html', templateUrl: '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.html', standalone: true, - imports: [ DsoEditMetadataHeadersComponent, MetadataFieldSelectorComponent, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, DsoEditMetadataFieldValuesComponent, AlertComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + DsoEditMetadataFieldValuesComponent, + DsoEditMetadataHeadersComponent, + DsoEditMetadataValueComponent, + DsoEditMetadataValueHeadersComponent, + MetadataFieldSelectorComponent, + ThemedLoadingComponent, + TranslateModule, + ], }) export class DsoEditMetadataComponent extends BaseComponent { } diff --git a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts index 237a457b0a..4438a2c1d2 100644 --- a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts +++ b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts @@ -23,10 +23,18 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the // templateUrl: './journal-issue.component.html', templateUrl: '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html', standalone: true, - imports: [ ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) -/** - * The component for displaying metadata and relations of an item of the type Journal Issue - */ export class JournalIssueComponent extends BaseComponent { } diff --git a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts index c370c7afa9..130bd7b9ee 100644 --- a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts +++ b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts @@ -23,10 +23,18 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the // templateUrl: './journal-volume.component.html', templateUrl: '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html', standalone: true, - imports: [ ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) -/** - * The component for displaying metadata and relations of an item of the type Journal Volume - */ export class JournalVolumeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts index 5389f75d43..0094ef55dd 100644 --- a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts +++ b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts @@ -24,10 +24,19 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the // templateUrl: './journal.component.html', templateUrl: '../../../../../../../app/entity-groups/journal-entities/item-pages/journal/journal.component.html', standalone: true, - imports: [ ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + TabbedRelatedEntitiesSearchComponent, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) -/** - * The component for displaying metadata and relations of an item of the type Journal - */ export class JournalComponent extends BaseComponent { } diff --git a/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts b/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts index c537835117..ea1ecbc64f 100644 --- a/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts +++ b/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts @@ -24,7 +24,19 @@ import { listableObjectComponent } from '../../../../../../../app/shared/object- // templateUrl: './person.component.html', templateUrl: '../../../../../../../app/entity-groups/research-entities/item-pages/person/person.component.html', standalone: true, - imports: [ ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + MetadataFieldWrapperComponent, + RelatedItemsComponent, + RouterLink, + TabbedRelatedEntitiesSearchComponent, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) export class PersonComponent extends BaseComponent { } diff --git a/src/themes/custom/app/footer/footer.component.ts b/src/themes/custom/app/footer/footer.component.ts index 04b4f69f14..158960f1a0 100644 --- a/src/themes/custom/app/footer/footer.component.ts +++ b/src/themes/custom/app/footer/footer.component.ts @@ -15,7 +15,12 @@ import { FooterComponent as BaseComponent } from '../../../../app/footer/footer. // templateUrl: './footer.component.html' templateUrl: '../../../../app/footer/footer.component.html', standalone: true, - imports: [ RouterLink, AsyncPipe, DatePipe, TranslateModule], + imports: [ + AsyncPipe, + DatePipe, + RouterLink, + TranslateModule, + ], }) export class FooterComponent extends BaseComponent { } diff --git a/src/themes/custom/app/forbidden/forbidden.component.ts b/src/themes/custom/app/forbidden/forbidden.component.ts index 58c32581c1..b5803a41c5 100644 --- a/src/themes/custom/app/forbidden/forbidden.component.ts +++ b/src/themes/custom/app/forbidden/forbidden.component.ts @@ -4,7 +4,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { ForbiddenComponent as BaseComponent } from '../../../../app/forbidden/forbidden.component'; - @Component({ selector: 'ds-themed-forbidden', // templateUrl: './forbidden.component.html', @@ -12,9 +11,10 @@ import { ForbiddenComponent as BaseComponent } from '../../../../app/forbidden/f // styleUrls: ['./forbidden.component.scss'] styleUrls: ['../../../../app/forbidden/forbidden.component.scss'], standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) -/** - * This component representing the `Forbidden` DSpace page. - */ -export class ForbiddenComponent extends BaseComponent {} +export class ForbiddenComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts b/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts index ac334902a3..e334c5b9e9 100644 --- a/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts +++ b/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts @@ -14,8 +14,5 @@ import { ForgotEmailComponent as BaseComponent } from '../../../../../app/forgot ThemedRegisterEmailFormComponent, ], }) -/** - * Component responsible the forgot password email step - */ export class ForgotEmailComponent extends BaseComponent { } diff --git a/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts b/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts index 21169b8797..6fc8202634 100644 --- a/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts +++ b/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts @@ -15,15 +15,12 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi templateUrl: '../../../../../app/forgot-password/forgot-password-form/forgot-password-form.component.html', standalone: true, imports: [ - TranslateModule, - BrowserOnlyPipe, - ProfilePageSecurityFormComponent, AsyncPipe, + BrowserOnlyPipe, BtnDisabledDirective, + ProfilePageSecurityFormComponent, + TranslateModule, ], }) -/** - * Component for a user to enter a new password for a forgot token. - */ export class ForgotPasswordFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts index ac1ac94140..587f7471ea 100644 --- a/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -8,9 +8,6 @@ import { ThemedHeaderComponent } from '../../../../app/header/themed-header.comp import { HeaderNavbarWrapperComponent as BaseComponent } from '../../../../app/header-nav-wrapper/header-navbar-wrapper.component'; import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; -/** - * This component represents a wrapper for the horizontal navbar and the header - */ @Component({ selector: 'ds-themed-header-navbar-wrapper', // styleUrls: ['./header-navbar-wrapper.component.scss'], @@ -18,7 +15,12 @@ import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.comp // templateUrl: './header-navbar-wrapper.component.html', templateUrl: '../../../../app/header-nav-wrapper/header-navbar-wrapper.component.html', standalone: true, - imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe], + imports: [ + AsyncPipe, + NgClass, + ThemedHeaderComponent, + ThemedNavbarComponent, + ], }) export class HeaderNavbarWrapperComponent extends BaseComponent { } diff --git a/src/themes/custom/app/header/header.component.ts b/src/themes/custom/app/header/header.component.ts index b337939ecd..5a2caba71f 100644 --- a/src/themes/custom/app/header/header.component.ts +++ b/src/themes/custom/app/header/header.component.ts @@ -11,9 +11,6 @@ import { ThemedSearchNavbarComponent } from '../../../../app/search-navbar/theme import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; -/** - * Represents the header with the logo and simple navigation - */ @Component({ selector: 'ds-themed-header', // styleUrls: ['header.component.scss'], @@ -21,7 +18,17 @@ import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-n // templateUrl: 'header.component.html', templateUrl: '../../../../app/header/header.component.html', standalone: true, - imports: [RouterLink, ThemedLangSwitchComponent, NgbDropdownModule, ThemedSearchNavbarComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule, AsyncPipe], + imports: [ + AsyncPipe, + ContextHelpToggleComponent, + ImpersonateNavbarComponent, + NgbDropdownModule, + RouterLink, + ThemedAuthNavMenuComponent, + ThemedLangSwitchComponent, + ThemedSearchNavbarComponent, + TranslateModule, + ], }) export class HeaderComponent extends BaseComponent { } diff --git a/src/themes/custom/app/home-page/home-news/home-news.component.ts b/src/themes/custom/app/home-page/home-news/home-news.component.ts index 9827589e8b..646320d281 100644 --- a/src/themes/custom/app/home-page/home-news/home-news.component.ts +++ b/src/themes/custom/app/home-page/home-news/home-news.component.ts @@ -10,9 +10,5 @@ import { HomeNewsComponent as BaseComponent } from '../../../../../app/home-page templateUrl: '../../../../../app/home-page/home-news/home-news.component.html', standalone: true, }) - -/** - * Component to render the news section on the home page - */ -export class HomeNewsComponent extends BaseComponent {} - +export class HomeNewsComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/home-page/home-page.component.ts b/src/themes/custom/app/home-page/home-page.component.ts index 0a0de095a0..754f6feb27 100644 --- a/src/themes/custom/app/home-page/home-page.component.ts +++ b/src/themes/custom/app/home-page/home-page.component.ts @@ -1,6 +1,5 @@ import { AsyncPipe, - NgClass, NgTemplateOutlet, } from '@angular/common'; import { Component } from '@angular/core'; @@ -14,7 +13,6 @@ import { ThemedTopLevelCommunityListComponent } from '../../../../app/home-page/ import { SuggestionsPopupComponent } from '../../../../app/notifications/suggestions/popup/suggestions-popup.component'; import { ThemedConfigurationSearchPageComponent } from '../../../../app/search-page/themed-configuration-search-page.component'; import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; -import { PageWithSidebarComponent } from '../../../../app/shared/sidebar/page-with-sidebar.component'; @Component({ selector: 'ds-themed-home-page', @@ -23,8 +21,18 @@ import { PageWithSidebarComponent } from '../../../../app/shared/sidebar/page-wi // templateUrl: './home-page.component.html' templateUrl: '../../../../app/home-page/home-page.component.html', standalone: true, - imports: [ThemedHomeNewsComponent, NgTemplateOutlet, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, RecentItemListComponent, AsyncPipe, TranslateModule, NgClass, SuggestionsPopupComponent, ThemedConfigurationSearchPageComponent, PageWithSidebarComponent, HomeCoarComponent], + imports: [ + AsyncPipe, + HomeCoarComponent, + NgTemplateOutlet, + RecentItemListComponent, + SuggestionsPopupComponent, + ThemedConfigurationSearchPageComponent, + ThemedHomeNewsComponent, + ThemedSearchFormComponent, + ThemedTopLevelCommunityListComponent, + TranslateModule, + ], }) export class HomePageComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts b/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts index 18ec70e0bf..83b9baa822 100644 --- a/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts +++ b/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts @@ -15,8 +15,14 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; // templateUrl: './top-level-community-list.component.html' templateUrl: '../../../../../app/home-page/top-level-community-list/top-level-community-list.component.html', standalone: true, - imports: [VarDirective, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ErrorComponent, + ObjectCollectionComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) - -export class TopLevelCommunityListComponent extends BaseComponent {} - +export class TopLevelCommunityListComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts b/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts index 2b78006f65..a382d32553 100644 --- a/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts +++ b/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts @@ -13,11 +13,12 @@ import { BtnDisabledDirective } from '../../../../../app/shared/btn-disabled.dir // templateUrl: './end-user-agreement.component.html' templateUrl: '../../../../../app/info/end-user-agreement/end-user-agreement.component.html', standalone: true, - imports: [EndUserAgreementContentComponent, FormsModule, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + EndUserAgreementContentComponent, + FormsModule, + TranslateModule, + ], }) - -/** - * Component displaying the End User Agreement and an option to accept it - */ -export class EndUserAgreementComponent extends BaseComponent {} - +export class EndUserAgreementComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts b/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts index 27365901d1..74459c8d58 100644 --- a/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts +++ b/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts @@ -16,7 +16,13 @@ import { ErrorComponent } from '../../../../../../app/shared/error/error.compone // styleUrls: ['./feedback-form.component.scss'], styleUrls: ['../../../../../../app/info/feedback/feedback-form/feedback-form.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, ErrorComponent, TranslateModule, BtnDisabledDirective], + imports: [ + BtnDisabledDirective, + ErrorComponent, + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class FeedbackFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/info/feedback/feedback.component.ts b/src/themes/custom/app/info/feedback/feedback.component.ts index e31cfd46cf..4d89f73ace 100644 --- a/src/themes/custom/app/info/feedback/feedback.component.ts +++ b/src/themes/custom/app/info/feedback/feedback.component.ts @@ -10,10 +10,9 @@ import { ThemedFeedbackFormComponent } from '../../../../../app/info/feedback/fe // templateUrl: './feedback.component.html' templateUrl: '../../../../../app/info/feedback/feedback.component.html', standalone: true, - imports: [ThemedFeedbackFormComponent], + imports: [ + ThemedFeedbackFormComponent, + ], }) - -/** - * Component displaying the feedback Statement - */ -export class FeedbackComponent extends BaseComponent { } +export class FeedbackComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/info/privacy/privacy.component.ts b/src/themes/custom/app/info/privacy/privacy.component.ts index 463a89a092..058663faf8 100644 --- a/src/themes/custom/app/info/privacy/privacy.component.ts +++ b/src/themes/custom/app/info/privacy/privacy.component.ts @@ -10,10 +10,9 @@ import { PrivacyContentComponent } from '../../../../../app/info/privacy/privacy // templateUrl: './privacy.component.html' templateUrl: '../../../../../app/info/privacy/privacy.component.html', standalone: true, - imports: [PrivacyContentComponent], + imports: [ + PrivacyContentComponent, + ], }) - -/** - * Component displaying the Privacy Statement - */ -export class PrivacyComponent extends BaseComponent {} +export class PrivacyComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/item-page/alerts/item-alerts.component.ts b/src/themes/custom/app/item-page/alerts/item-alerts.component.ts index bf8396e7c0..aefef3725c 100644 --- a/src/themes/custom/app/item-page/alerts/item-alerts.component.ts +++ b/src/themes/custom/app/item-page/alerts/item-alerts.component.ts @@ -15,9 +15,9 @@ import { AlertComponent } from '../../../../../app/shared/alert/alert.component' standalone: true, imports: [ AlertComponent, - TranslateModule, - RouterLink, AsyncPipe, + RouterLink, + TranslateModule, ], }) export class ItemAlertsComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts index 07b3d28e14..8c354f7c2e 100644 --- a/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts +++ b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -27,11 +27,11 @@ import { ], standalone: true, imports: [ - TranslateModule, AsyncPipe, - RouterLink, ItemOperationComponent, NgClass, + RouterLink, + TranslateModule, ], }) export class ItemStatusComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts index 4c71a9eb23..e6b33d0b63 100644 --- a/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts @@ -18,14 +18,14 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the templateUrl: '../../../../../../../app/item-page/full/field-components/file-section/full-file-section.component.html', standalone: true, imports: [ - PaginationComponent, - TranslateModule, AsyncPipe, - VarDirective, - ThemedThumbnailComponent, - ThemedFileDownloadLinkComponent, FileSizePipe, MetadataFieldWrapperComponent, + PaginationComponent, + ThemedFileDownloadLinkComponent, + ThemedThumbnailComponent, + TranslateModule, + VarDirective, ], }) export class FullFileSectionComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/full/full-item-page.component.ts b/src/themes/custom/app/item-page/full/full-item-page.component.ts index c879530343..6cde548e05 100644 --- a/src/themes/custom/app/item-page/full/full-item-page.component.ts +++ b/src/themes/custom/app/item-page/full/full-item-page.component.ts @@ -22,11 +22,6 @@ import { ErrorComponent } from '../../../../../app/shared/error/error.component' import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -/** - * This component renders a full item page. - * The route parameter 'id' is used to request the item it represents. - */ - @Component({ selector: 'ds-themed-full-item-page', // styleUrls: ['./full-item-page.component.scss'], @@ -37,19 +32,19 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; animations: [fadeInOut], standalone: true, imports: [ - ErrorComponent, - ThemedLoadingComponent, - TranslateModule, - ThemedFullFileSectionComponent, - CollectionsComponent, - ItemVersionsComponent, AsyncPipe, + CollectionsComponent, + DsoEditMenuComponent, + ErrorComponent, + ItemVersionsComponent, + ItemVersionsNoticeComponent, KeyValuePipe, RouterLink, - ThemedItemPageTitleFieldComponent, - DsoEditMenuComponent, - ItemVersionsNoticeComponent, + ThemedFullFileSectionComponent, ThemedItemAlertsComponent, + ThemedItemPageTitleFieldComponent, + ThemedLoadingComponent, + TranslateModule, VarDirective, ], }) diff --git a/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts b/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts index da2f62eb9b..a319b733ec 100644 --- a/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts +++ b/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts @@ -12,8 +12,8 @@ import { MediaViewerImageComponent as BaseComponent } from '../../../../../../ap styleUrls: ['../../../../../../app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.scss'], standalone: true, imports: [ - NgxGalleryModule, AsyncPipe, + NgxGalleryModule, ], }) export class MediaViewerImageComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts b/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts index bb50876c97..eb43e3eb1a 100644 --- a/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts +++ b/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts @@ -13,9 +13,9 @@ import { BtnDisabledDirective } from '../../../../../../app/shared/btn-disabled. styleUrls: ['../../../../../../app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.scss'], standalone: true, imports: [ + BtnDisabledDirective, NgbDropdownModule, TranslateModule, - BtnDisabledDirective, ], }) export class MediaViewerVideoComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts b/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts index b74e9abb2c..b8437bab16 100644 --- a/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts +++ b/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts @@ -17,12 +17,12 @@ import { ThemedThumbnailComponent } from '../../../../../app/thumbnail/themed-th styleUrls: ['../../../../../app/item-page/media-viewer/media-viewer.component.scss'], standalone: true, imports: [ - ThemedMediaViewerImageComponent, - ThemedThumbnailComponent, AsyncPipe, - ThemedMediaViewerVideoComponent, - TranslateModule, ThemedLoadingComponent, + ThemedMediaViewerImageComponent, + ThemedMediaViewerVideoComponent, + ThemedThumbnailComponent, + TranslateModule, VarDirective, ], }) diff --git a/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts index e39f7536eb..ce59e80d98 100644 --- a/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -18,14 +18,13 @@ import { VarDirective } from '../../../../../../../app/shared/utils/var.directiv standalone: true, imports: [ CommonModule, - ThemedFileDownloadLinkComponent, + FileSizePipe, MetadataFieldWrapperComponent, + ThemedFileDownloadLinkComponent, ThemedLoadingComponent, TranslateModule, - FileSizePipe, VarDirective, ], }) export class FileSectionComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts b/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts index f710884d48..faf40fab24 100644 --- a/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts +++ b/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts @@ -8,7 +8,9 @@ import { ItemPageTitleFieldComponent as BaseComponent } from '../../../../../../ // templateUrl: './item-page-title-field.component.html', templateUrl: '../../../../../../../../app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.html', standalone: true, - imports: [ TranslateModule], + imports: [ + TranslateModule, + ], }) export class ItemPageTitleFieldComponent extends BaseComponent { } diff --git a/src/themes/custom/app/item-page/simple/item-page.component.ts b/src/themes/custom/app/item-page/simple/item-page.component.ts index 33f5b973eb..caccf729ca 100644 --- a/src/themes/custom/app/item-page/simple/item-page.component.ts +++ b/src/themes/custom/app/item-page/simple/item-page.component.ts @@ -18,11 +18,6 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed import { ListableObjectComponentLoaderComponent } from '../../../../../app/shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -/** - * This component renders a simple item page. - * The route parameter 'id' is used to request the item it represents. - * All fields of the item that should be displayed, are defined in its template. - */ @Component({ selector: 'ds-themed-item-page', // styleUrls: ['./item-page.component.scss'], @@ -33,20 +28,19 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; animations: [fadeInOut], standalone: true, imports: [ - VarDirective, - ThemedItemAlertsComponent, + AccessByTokenNotificationComponent, + AsyncPipe, + ErrorComponent, + ItemVersionsComponent, ItemVersionsNoticeComponent, ListableObjectComponentLoaderComponent, - ItemVersionsComponent, - ErrorComponent, - ThemedLoadingComponent, - TranslateModule, - AsyncPipe, NotifyRequestsStatusComponent, QaEventNotificationComponent, - AccessByTokenNotificationComponent, + ThemedItemAlertsComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, ], }) export class ItemPageComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts b/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts index 7025de3e76..02d0026261 100644 --- a/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts @@ -27,10 +27,6 @@ import { listableObjectComponent } from '../../../../../../../app/shared/object- import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -/** - * Component that represents a publication Item page - */ - @listableObjectComponent('Publication', ViewMode.StandalonePage, Context.Any, 'custom') @Component({ selector: 'ds-publication', @@ -40,8 +36,27 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the templateUrl: '../../../../../../../app/item-page/simple/item-types/publication/publication.component.html', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule, GeospatialItemPageFieldComponent], + imports: [ + AsyncPipe, + CollectionsComponent, + DsoEditMenuComponent, + GenericItemPageFieldComponent, + GeospatialItemPageFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageDateFieldComponent, + ItemPageUriFieldComponent, + MetadataFieldWrapperComponent, + MiradorViewerComponent, + RelatedItemsComponent, + RouterLink, + ThemedFileSectionComponent, + ThemedItemPageTitleFieldComponent, + ThemedMediaViewerComponent, + ThemedMetadataRepresentationListComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, + ], }) export class PublicationComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index f6d19320c6..381cdf7b2f 100644 --- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -28,9 +28,6 @@ import { listableObjectComponent } from '../../../../../../../app/shared/object- import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -/** - * Component that represents an untyped Item page - */ @listableObjectComponent(Item, ViewMode.StandalonePage, Context.Any, 'custom') @Component({ selector: 'ds-untyped-item', @@ -44,25 +41,26 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ - ThemedResultsBackButtonComponent, - MiradorViewerComponent, - ThemedItemPageTitleFieldComponent, - DsoEditMenuComponent, - MetadataFieldWrapperComponent, - ThemedThumbnailComponent, - ThemedMediaViewerComponent, - ThemedFileSectionComponent, - ItemPageDateFieldComponent, - ThemedMetadataRepresentationListComponent, - GenericItemPageFieldComponent, - ItemPageAbstractFieldComponent, - ItemPageUriFieldComponent, - CollectionsComponent, - RouterLink, AsyncPipe, - TranslateModule, - ItemPageCcLicenseFieldComponent, + CollectionsComponent, + DsoEditMenuComponent, + GenericItemPageFieldComponent, GeospatialItemPageFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageCcLicenseFieldComponent, + ItemPageDateFieldComponent, + ItemPageUriFieldComponent, + MetadataFieldWrapperComponent, + MiradorViewerComponent, + RouterLink, + ThemedFileSectionComponent, + ThemedItemPageTitleFieldComponent, + ThemedMediaViewerComponent, + ThemedMetadataRepresentationListComponent, + ThemedResultsBackButtonComponent, + ThemedThumbnailComponent, + TranslateModule, ], }) -export class UntypedItemComponent extends BaseComponent {} +export class UntypedItemComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts b/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts index 919930dc11..d73e117e3a 100644 --- a/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts +++ b/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts @@ -13,8 +13,14 @@ import { VarDirective } from '../../../../../../app/shared/utils/var.directive'; // templateUrl: './metadata-representation-list.component.html' templateUrl: '../../../../../../app/item-page/simple/metadata-representation-list/metadata-representation-list.component.html', standalone: true, - imports: [MetadataFieldWrapperComponent, VarDirective, MetadataRepresentationLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + MetadataFieldWrapperComponent, + MetadataRepresentationLoaderComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) export class MetadataRepresentationListComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/login-page/login-page.component.ts b/src/themes/custom/app/login-page/login-page.component.ts index 1e7daae653..0fefe68409 100644 --- a/src/themes/custom/app/login-page/login-page.component.ts +++ b/src/themes/custom/app/login-page/login-page.component.ts @@ -4,9 +4,6 @@ import { ThemedLogInComponent } from 'src/app/shared/log-in/themed-log-in.compon import { LoginPageComponent as BaseComponent } from '../../../../app/login-page/login-page.component'; -/** - * This component represents the login page - */ @Component({ selector: 'ds-themed-login-page', // styleUrls: ['./login-page.component.scss'], @@ -14,7 +11,10 @@ import { LoginPageComponent as BaseComponent } from '../../../../app/login-page/ // templateUrl: './login-page.component.html' templateUrl: '../../../../app/login-page/login-page.component.html', standalone: true, - imports: [ThemedLogInComponent, TranslateModule], + imports: [ + ThemedLogInComponent, + TranslateModule, + ], }) export class LoginPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/logout-page/logout-page.component.ts b/src/themes/custom/app/logout-page/logout-page.component.ts index 97f82c1728..5e711c1440 100644 --- a/src/themes/custom/app/logout-page/logout-page.component.ts +++ b/src/themes/custom/app/logout-page/logout-page.component.ts @@ -11,7 +11,10 @@ import { LogOutComponent } from '../../../../app/shared/log-out/log-out.componen // templateUrl: './logout-page.component.html' templateUrl: '../../../../app/logout-page/logout-page.component.html', standalone: true, - imports: [LogOutComponent, TranslateModule], + imports: [ + LogOutComponent, + TranslateModule, + ], }) export class LogoutPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts b/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts index ea599d8a61..07049849aa 100644 --- a/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts +++ b/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts @@ -15,11 +15,10 @@ import { ObjectNotFoundComponent as BaseComponent } from '../../../../../app/loo templateUrl: '../../../../../app/lookup-by-id/objectnotfound/objectnotfound.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) - -/** - * This component representing the `PageNotFound` DSpace page. - */ -export class ObjectNotFoundComponent extends BaseComponent {} - +export class ObjectNotFoundComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts b/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts index 8e177886b5..e39d636f89 100644 --- a/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts +++ b/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts @@ -16,9 +16,6 @@ import { pushInOut } from '../../../../app/shared/animations/push'; import { RoleDirective } from '../../../../app/shared/roles/role.directive'; import { ThemedSearchComponent } from '../../../../app/shared/search/themed-search.component'; -/** - * This component represents the whole mydspace page - */ @Component({ selector: 'ds-themed-my-dspace-page', // styleUrls: ['./my-dspace-page.component.scss'], @@ -35,12 +32,12 @@ import { ThemedSearchComponent } from '../../../../app/shared/search/themed-sear ], standalone: true, imports: [ - ThemedSearchComponent, - MyDSpaceNewSubmissionComponent, AsyncPipe, + MyDSpaceNewSubmissionComponent, + MyDspaceQaEventsNotificationsComponent, RoleDirective, SuggestionsNotificationComponent, - MyDspaceQaEventsNotificationsComponent, + ThemedSearchComponent, ], }) export class MyDSpacePageComponent extends BaseComponent { diff --git a/src/themes/custom/app/navbar/navbar.component.ts b/src/themes/custom/app/navbar/navbar.component.ts index 09bed20ad4..1b906626f5 100644 --- a/src/themes/custom/app/navbar/navbar.component.ts +++ b/src/themes/custom/app/navbar/navbar.component.ts @@ -11,9 +11,6 @@ import { ThemedUserMenuComponent } from 'src/app/shared/auth-nav-menu/user-menu/ import { NavbarComponent as BaseComponent } from '../../../../app/navbar/navbar.component'; import { slideMobileNav } from '../../../../app/shared/animations/slide'; -/** - * Component representing the public navbar - */ @Component({ selector: 'ds-themed-navbar', // styleUrls: ['./navbar.component.scss'], @@ -22,7 +19,14 @@ import { slideMobileNav } from '../../../../app/shared/animations/slide'; templateUrl: '../../../../app/navbar/navbar.component.html', animations: [slideMobileNav], standalone: true, - imports: [NgbDropdownModule, NgClass, ThemedUserMenuComponent, NgComponentOutlet, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbDropdownModule, + NgClass, + NgComponentOutlet, + ThemedUserMenuComponent, + TranslateModule, + ], }) export class NavbarComponent extends BaseComponent { } diff --git a/src/themes/custom/app/pagenotfound/pagenotfound.component.ts b/src/themes/custom/app/pagenotfound/pagenotfound.component.ts index f74af21914..fba6c72959 100644 --- a/src/themes/custom/app/pagenotfound/pagenotfound.component.ts +++ b/src/themes/custom/app/pagenotfound/pagenotfound.component.ts @@ -15,11 +15,10 @@ import { PageNotFoundComponent as BaseComponent } from '../../../../app/pagenotf templateUrl: '../../../../app/pagenotfound/pagenotfound.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [RouterLink, TranslateModule], + imports: [ + RouterLink, + TranslateModule, + ], }) - -/** - * This component representing the `PageNotFound` DSpace page. - */ -export class PageNotFoundComponent extends BaseComponent {} - +export class PageNotFoundComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/profile-page/profile-page.component.ts b/src/themes/custom/app/profile-page/profile-page.component.ts index 1468684c48..98586991cc 100644 --- a/src/themes/custom/app/profile-page/profile-page.component.ts +++ b/src/themes/custom/app/profile-page/profile-page.component.ts @@ -25,24 +25,20 @@ import { VarDirective } from '../../../../app/shared/utils/var.directive'; templateUrl: '../../../../app/profile-page/profile-page.component.html', standalone: true, imports: [ - ThemedProfilePageMetadataFormComponent, - ProfilePageSecurityFormComponent, + AlertComponent, AsyncPipe, - TranslateModule, - ProfilePageResearcherFormComponent, - VarDirective, - SuggestionsNotificationComponent, + ErrorComponent, NgTemplateOutlet, PaginationComponent, - ThemedLoadingComponent, - ErrorComponent, + ProfilePageResearcherFormComponent, + ProfilePageSecurityFormComponent, RouterModule, - AlertComponent, + SuggestionsNotificationComponent, + ThemedLoadingComponent, + ThemedProfilePageMetadataFormComponent, + TranslateModule, + VarDirective, ], }) -/** - * Component for a user to edit their profile information - */ export class ProfilePageComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/register-email-form/register-email-form.component.ts b/src/themes/custom/app/register-email-form/register-email-form.component.ts index 4819880ff3..58b74047ae 100644 --- a/src/themes/custom/app/register-email-form/register-email-form.component.ts +++ b/src/themes/custom/app/register-email-form/register-email-form.component.ts @@ -16,7 +16,15 @@ import { BtnDisabledDirective } from '../../../../app/shared/btn-disabled.direct // templateUrl: './register-email-form.component.html', templateUrl: '../../../../app/register-email-form/register-email-form.component.html', standalone: true, - imports: [ FormsModule, ReactiveFormsModule, AlertComponent, GoogleRecaptchaComponent, AsyncPipe, TranslateModule, BtnDisabledDirective], + imports: [ + AlertComponent, + AsyncPipe, + BtnDisabledDirective, + FormsModule, + GoogleRecaptchaComponent, + ReactiveFormsModule, + TranslateModule, + ], }) export class RegisterEmailFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/register-page/create-profile/create-profile.component.ts b/src/themes/custom/app/register-page/create-profile/create-profile.component.ts index 893afb50d2..9e58ac03bd 100644 --- a/src/themes/custom/app/register-page/create-profile/create-profile.component.ts +++ b/src/themes/custom/app/register-page/create-profile/create-profile.component.ts @@ -7,9 +7,6 @@ import { ProfilePageSecurityFormComponent } from '../../../../../app/profile-pag import { CreateProfileComponent as BaseComponent } from '../../../../../app/register-page/create-profile/create-profile.component'; import { BtnDisabledDirective } from '../../../../../app/shared/btn-disabled.directive'; -/** - * Component that renders the create profile page to be used by a user registering through a token - */ @Component({ selector: 'ds-themed-create-profile', // styleUrls: ['./create-profile.component.scss'], @@ -18,11 +15,11 @@ import { BtnDisabledDirective } from '../../../../../app/shared/btn-disabled.dir templateUrl: '../../../../../app/register-page/create-profile/create-profile.component.html', standalone: true, imports: [ - ProfilePageSecurityFormComponent, - TranslateModule, AsyncPipe, - ReactiveFormsModule, BtnDisabledDirective, + ProfilePageSecurityFormComponent, + ReactiveFormsModule, + TranslateModule, ], }) export class CreateProfileComponent extends BaseComponent { diff --git a/src/themes/custom/app/register-page/register-email/register-email.component.ts b/src/themes/custom/app/register-page/register-email/register-email.component.ts index 7296e1eebb..857b144650 100644 --- a/src/themes/custom/app/register-page/register-email/register-email.component.ts +++ b/src/themes/custom/app/register-page/register-email/register-email.component.ts @@ -14,8 +14,5 @@ import { RegisterEmailComponent as BaseComponent } from '../../../../../app/regi ThemedRegisterEmailFormComponent, ], }) -/** - * Component responsible the email registration step when registering as a new user - */ export class RegisterEmailComponent extends BaseComponent { } diff --git a/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts b/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts index b885bcd06a..9785ef0367 100644 --- a/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts @@ -10,12 +10,17 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-themed-deny-request-copy', // styleUrls: ['./deny-request-copy.component.scss'], - styleUrls: [], + styleUrls: ['../../../../../app/request-copy/deny-request-copy/deny-request-copy.component.scss'], // templateUrl: './deny-request-copy.component.html', - templateUrl: './../../../../../app/request-copy/deny-request-copy/deny-request-copy.component.html', + templateUrl: '../../../../../app/request-copy/deny-request-copy/deny-request-copy.component.html', standalone: true, - imports: [VarDirective, ThemedEmailRequestCopyComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ThemedEmailRequestCopyComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) -export class DenyRequestCopyComponent - extends BaseComponent { +export class DenyRequestCopyComponent extends BaseComponent { } diff --git a/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts b/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts index 87fff15215..65fb25557b 100644 --- a/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts @@ -13,12 +13,18 @@ import { BtnDisabledDirective } from '../../../../../app/shared/btn-disabled.dir @Component({ selector: 'ds-themed-email-request-copy', // styleUrls: ['./email-request-copy.component.scss'], - styleUrls: [], + styleUrls: ['../../../../../app/request-copy/email-request-copy/email-request-copy.component.scss'], // templateUrl: './email-request-copy.component.html', - templateUrl: './../../../../../app/request-copy/email-request-copy/email-request-copy.component.html', + templateUrl: '../../../../../app/request-copy/email-request-copy/email-request-copy.component.html', standalone: true, - imports: [FormsModule, NgClass, TranslateModule, BtnDisabledDirective, AsyncPipe, NgbDropdownModule], + imports: [ + AsyncPipe, + BtnDisabledDirective, + FormsModule, + NgbDropdownModule, + NgClass, + TranslateModule, + ], }) -export class EmailRequestCopyComponent - extends BaseComponent { +export class EmailRequestCopyComponent extends BaseComponent { } diff --git a/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts b/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts index e7ed8935c3..a128a99ee4 100644 --- a/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts @@ -1,7 +1,11 @@ -import { AsyncPipe } from '@angular/common'; +import { + AsyncPipe, + CommonModule, +} from '@angular/common'; import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; +import { TranslatePipe } from '@ngx-translate/core'; import { GrantRequestCopyComponent as BaseComponent } from 'src/app/request-copy/grant-request-copy/grant-request-copy.component'; import { ThemedEmailRequestCopyComponent } from '../../../../../app/request-copy/email-request-copy/themed-email-request-copy.component'; @@ -11,10 +15,20 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-themed-grant-request-copy', // styleUrls: ['./grant-request-copy.component.scss'], - styleUrls: [], + styleUrls: ['../../../../../app/request-copy/grant-request-copy/grant-request-copy.component.scss'], // templateUrl: './grant-request-copy.component.html', - templateUrl: './../../../../../app/request-copy/grant-request-copy/grant-request-copy.component.html', + templateUrl: '../../../../../app/request-copy/grant-request-copy/grant-request-copy.component.html', standalone: true, - imports: [VarDirective, ThemedEmailRequestCopyComponent, FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + CommonModule, + FormsModule, + RouterLink, + ThemedEmailRequestCopyComponent, + ThemedLoadingComponent, + TranslatePipe, + VarDirective, + ], }) -export class GrantRequestCopyComponent extends BaseComponent {} +export class GrantRequestCopyComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/root/root.component.ts b/src/themes/custom/app/root/root.component.ts index a3e75ad630..a200982bf0 100644 --- a/src/themes/custom/app/root/root.component.ts +++ b/src/themes/custom/app/root/root.component.ts @@ -26,20 +26,19 @@ import { SystemWideAlertBannerComponent } from '../../../../app/system-wide-aler animations: [slideSidebarPadding], standalone: true, imports: [ - TranslateModule, - ThemedAdminSidebarComponent, - SystemWideAlertBannerComponent, - ThemedHeaderNavbarWrapperComponent, - ThemedBreadcrumbsComponent, - NgClass, - ThemedLoadingComponent, - RouterOutlet, - ThemedFooterComponent, - NotificationsBoardComponent, AsyncPipe, LiveRegionComponent, + NgClass, + NotificationsBoardComponent, + RouterOutlet, + SystemWideAlertBannerComponent, + ThemedAdminSidebarComponent, + ThemedBreadcrumbsComponent, + ThemedFooterComponent, + ThemedHeaderNavbarWrapperComponent, + ThemedLoadingComponent, + TranslateModule, ], }) export class RootComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/search-navbar/search-navbar.component.ts b/src/themes/custom/app/search-navbar/search-navbar.component.ts index 59f6bf08a1..877d051aaa 100644 --- a/src/themes/custom/app/search-navbar/search-navbar.component.ts +++ b/src/themes/custom/app/search-navbar/search-navbar.component.ts @@ -16,8 +16,13 @@ import { ClickOutsideDirective } from '../../../../app/shared/utils/click-outsid // templateUrl: './search-navbar.component.html' templateUrl: '../../../../app/search-navbar/search-navbar.component.html', standalone: true, - imports: [ClickOutsideDirective, FormsModule, ReactiveFormsModule, TranslateModule, BrowserOnlyPipe], + imports: [ + BrowserOnlyPipe, + ClickOutsideDirective, + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class SearchNavbarComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/search-page/configuration-search-page.component.ts b/src/themes/custom/app/search-page/configuration-search-page.component.ts index 5fe918703e..5470c56c0c 100644 --- a/src/themes/custom/app/search-page/configuration-search-page.component.ts +++ b/src/themes/custom/app/search-page/configuration-search-page.component.ts @@ -34,11 +34,17 @@ import { ViewModeSwitchComponent } from '../../../../app/shared/view-mode-switch }, ], standalone: true, - imports: [ NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgTemplateOutlet, + PageWithSidebarComponent, + SearchLabelsComponent, + ThemedSearchFormComponent, + ThemedSearchResultsComponent, + ThemedSearchSidebarComponent, + TranslateModule, + ViewModeSwitchComponent, + ], }) - -/** - * This component renders a search page using a configuration as input. - */ -export class ConfigurationSearchPageComponent extends BaseComponent {} - +export class ConfigurationSearchPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/search-page/search-page.component.ts b/src/themes/custom/app/search-page/search-page.component.ts index 2d8093c754..016b92910a 100644 --- a/src/themes/custom/app/search-page/search-page.component.ts +++ b/src/themes/custom/app/search-page/search-page.component.ts @@ -17,11 +17,9 @@ import { ThemedSearchComponent } from '../../../../app/shared/search/themed-sear }, ], standalone: true, - imports: [ThemedSearchComponent], + imports: [ + ThemedSearchComponent, + ], }) -/** - * This component represents the whole search page - * It renders search results depending on the current search options - */ -export class SearchPageComponent extends BaseComponent {} - +export class SearchPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts b/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts index 627c0582a5..323cbc7d0f 100644 --- a/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts +++ b/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts @@ -19,9 +19,6 @@ import { import { AuthNavMenuComponent as BaseComponent } from '../../../../../app/shared/auth-nav-menu/auth-nav-menu.component'; import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; -/** - * Component representing the {@link AuthNavMenuComponent} of a page - */ @Component({ selector: 'ds-themed-auth-nav-menu', // templateUrl: './auth-nav-menu.component.html', @@ -30,7 +27,17 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi styleUrls: ['../../../../../app/shared/auth-nav-menu/auth-nav-menu.component.scss'], animations: [fadeInOut, fadeOut], standalone: true, - imports: [NgClass, NgbDropdownModule, ThemedLogInComponent, RouterLink, RouterLinkActive, ThemedUserMenuComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + NgbDropdownModule, + NgClass, + RouterLink, + RouterLinkActive, + ThemedLogInComponent, + ThemedUserMenuComponent, + TranslateModule, + ], }) export class AuthNavMenuComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts b/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts index b230b53a3c..7e9ef7dc76 100644 --- a/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts +++ b/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts @@ -13,9 +13,6 @@ import { LogOutComponent } from 'src/app/shared/log-out/log-out.component'; import { UserMenuComponent as BaseComponent } from '../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; -/** - * Component representing the {@link UserMenuComponent} of a page - */ @Component({ selector: 'ds-themed-user-menu', // templateUrl: 'user-menu.component.html', @@ -23,8 +20,15 @@ import { UserMenuComponent as BaseComponent } from '../../../../../../app/shared // styleUrls: ['user-menu.component.scss'], styleUrls: ['../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component.scss'], standalone: true, - imports: [ ThemedLoadingComponent, RouterLinkActive, NgClass, RouterLink, LogOutComponent, AsyncPipe, TranslateModule], - + imports: [ + AsyncPipe, + LogOutComponent, + NgClass, + RouterLink, + RouterLinkActive, + ThemedLoadingComponent, + TranslateModule, + ], }) export class UserMenuComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/browse-by/browse-by.component.ts b/src/themes/custom/app/shared/browse-by/browse-by.component.ts index 929b7721f3..98988d6943 100644 --- a/src/themes/custom/app/shared/browse-by/browse-by.component.ts +++ b/src/themes/custom/app/shared/browse-by/browse-by.component.ts @@ -1,8 +1,4 @@ -import { - AsyncPipe, - NgClass, - NgComponentOutlet, -} from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { ErrorComponent } from 'src/app/shared/error/error.component'; @@ -29,7 +25,16 @@ import { StartsWithLoaderComponent } from '../../../../../app/shared/starts-with fadeInOut, ], standalone: true, - imports: [VarDirective, NgClass, NgComponentOutlet, ThemedResultsBackButtonComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent], + imports: [ + AsyncPipe, + ErrorComponent, + ObjectCollectionComponent, + StartsWithLoaderComponent, + ThemedLoadingComponent, + ThemedResultsBackButtonComponent, + TranslateModule, + VarDirective, + ], }) export class BrowseByComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/collection-dropdown/collection-dropdown.component.ts b/src/themes/custom/app/shared/collection-dropdown/collection-dropdown.component.ts index 88c7fea4ad..d84b112b30 100644 --- a/src/themes/custom/app/shared/collection-dropdown/collection-dropdown.component.ts +++ b/src/themes/custom/app/shared/collection-dropdown/collection-dropdown.component.ts @@ -17,8 +17,14 @@ import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed styleUrls: ['../../../../../app/shared/collection-dropdown/collection-dropdown.component.scss'], // styleUrls: ['./collection-dropdown.component.scss'] standalone: true, - imports: [ FormsModule, ReactiveFormsModule, InfiniteScrollModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + FormsModule, + InfiniteScrollModule, + ReactiveFormsModule, + ThemedLoadingComponent, + TranslateModule, + ], }) export class CollectionDropdownComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/themes/custom/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts index bf5a5005d5..fcd8659229 100644 --- a/src/themes/custom/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/themes/custom/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -1,10 +1,7 @@ import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { - RouterLink, - RouterLinkActive, -} from '@angular/router'; +import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { ComcolPageBrowseByComponent as BaseComponent } from '../../../../../../app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component'; @@ -17,11 +14,10 @@ import { ComcolPageBrowseByComponent as BaseComponent } from '../../../../../../ templateUrl: '../../../../../../app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html', standalone: true, imports: [ + AsyncPipe, FormsModule, RouterLink, - RouterLinkActive, TranslateModule, - AsyncPipe, ], }) export class ComcolPageBrowseByComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.html b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.html index b858b6dc2c..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.html +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.html @@ -1,12 +0,0 @@ -
- - -
diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts index 19a5eb8f19..a64da8d95e 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts @@ -10,7 +10,10 @@ import { CreateCollectionParentSelectorComponent as BaseComponent } from '../../ // templateUrl: './create-collection-parent-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class CreateCollectionParentSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.html b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.html index e75cf05c5a..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.html +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.html @@ -1,18 +0,0 @@ -
- - -
diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.scss b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.scss index 0daf4cfa5f..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.scss +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.scss @@ -1,3 +0,0 @@ -#create-community-or-separator { - top: 0; -} \ No newline at end of file diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html index 88d3051d8b..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html @@ -1,16 +0,0 @@ -
- - -
diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts index c04d9ccbdb..c057648f2d 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts @@ -10,7 +10,10 @@ import { CreateItemParentSelectorComponent as BaseComponent } from '../../../../ // templateUrl: './create-item-parent-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html', standalone: true, - imports: [AuthorizedCollectionSelectorComponent, TranslateModule], + imports: [ + AuthorizedCollectionSelectorComponent, + TranslateModule, + ], }) export class CreateItemParentSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.html b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.html index b858b6dc2c..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.html +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.html @@ -1,12 +0,0 @@ -
- - -
diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts index b53cf4fac0..3b1279ea80 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts @@ -10,7 +10,10 @@ import { EditCollectionSelectorComponent as BaseComponent } from '../../../../.. // templateUrl: './edit-collection-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class EditCollectionSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.html b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.html index b858b6dc2c..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.html +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.html @@ -1,12 +0,0 @@ -
- - -
diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts index 63428a021b..a164541beb 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts @@ -10,7 +10,10 @@ import { EditCommunitySelectorComponent as BaseComponent } from '../../../../../ // templateUrl: './edit-community-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class EditCommunitySelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.html b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.html index 7a7611da4f..e69de29bb2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.html +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.html @@ -1,12 +0,0 @@ -
- - -
diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts index 6a069bd5fa..e508fc0854 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts @@ -10,7 +10,10 @@ import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-select // templateUrl: './edit-item-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule], + imports: [ + DSOSelectorComponent, + TranslateModule, + ], }) export class EditItemSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts b/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts index b1c1c5f81a..cfdbfe29d4 100644 --- a/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts +++ b/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts @@ -17,7 +17,14 @@ import { FileDownloadLinkComponent as BaseComponent } from '../../../../../app/s // styleUrls: ['./file-download-link.component.scss'], styleUrls: ['../../../../../app/shared/file-download-link/file-download-link.component.scss'], standalone: true, - imports: [RouterLink, NgClass, NgTemplateOutlet, AsyncPipe, TranslateModule, ThemedAccessStatusBadgeComponent], + imports: [ + AsyncPipe, + NgClass, + NgTemplateOutlet, + RouterLink, + ThemedAccessStatusBadgeComponent, + TranslateModule, + ], }) export class FileDownloadLinkComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts index d85a4130fc..e97490d703 100644 --- a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts +++ b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts @@ -34,16 +34,15 @@ import { VarDirective } from '../../../../../../../../../app/shared/utils/var.di ], standalone: true, imports: [ - ThemedSearchFormComponent, - PageSizeSelectorComponent, - ObjectCollectionComponent, - VarDirective, AsyncPipe, - TranslateModule, ErrorComponent, + ObjectCollectionComponent, + PageSizeSelectorComponent, ThemedLoadingComponent, + ThemedSearchFormComponent, + TranslateModule, + VarDirective, ], }) export class DsDynamicLookupRelationExternalSourceTabComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts index fb29b8f526..dee51c922c 100644 --- a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts +++ b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts @@ -13,12 +13,11 @@ import { ThemedSearchResultsComponent } from '../../../../../../../../../../app/ templateUrl: '../../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.html', standalone: true, imports: [ - TranslateModule, - ThemedSearchResultsComponent, AsyncPipe, BtnDisabledDirective, + ThemedSearchResultsComponent, + TranslateModule, ], }) export class ExternalSourceEntryImportModalComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index e010faafac..ad8d65430e 100644 --- a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -24,12 +24,11 @@ import { VarDirective } from '../../../../../../../../../app/shared/utils/var.di standalone: true, imports: [ AsyncPipe, - VarDirective, - TranslateModule, NgbDropdownModule, ThemedSearchComponent, + TranslateModule, + VarDirective, ], }) export class DsDynamicLookupRelationSearchTabComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts b/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts index 0568c5fc73..f39278eb99 100644 --- a/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts +++ b/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts @@ -11,7 +11,10 @@ import { LangSwitchComponent as BaseComponent } from '../../../../../app/shared/ // templateUrl: './lang-switch.component.html', templateUrl: '../../../../../app/shared/lang-switch/lang-switch.component.html', standalone: true, - imports: [NgbDropdownModule, TranslateModule], + imports: [ + NgbDropdownModule, + TranslateModule, + ], }) export class LangSwitchComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/loading/loading.component.ts b/src/themes/custom/app/shared/loading/loading.component.ts index 8bd9dba45a..c11f13b4cd 100644 --- a/src/themes/custom/app/shared/loading/loading.component.ts +++ b/src/themes/custom/app/shared/loading/loading.component.ts @@ -11,5 +11,4 @@ import { LoadingComponent as BaseComponent } from '../../../../../app/shared/loa standalone: true, }) export class LoadingComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/shared/log-in/log-in.component.ts b/src/themes/custom/app/shared/log-in/log-in.component.ts index 77703d8fec..b026857e07 100644 --- a/src/themes/custom/app/shared/log-in/log-in.component.ts +++ b/src/themes/custom/app/shared/log-in/log-in.component.ts @@ -1,9 +1,8 @@ import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; -import { LogInContainerComponent } from 'src/app/shared/log-in/container/log-in-container.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { LogInContainerComponent } from '../../../../../app/shared/log-in/container/log-in-container.component'; import { LogInComponent as BaseComponent } from '../../../../../app/shared/log-in/log-in.component'; @Component({ @@ -13,7 +12,11 @@ import { LogInComponent as BaseComponent } from '../../../../../app/shared/log-i // styleUrls: ['./log-in.component.scss'], styleUrls: ['../../../../../app/shared/log-in/log-in.component.scss'], standalone: true, - imports: [ ThemedLoadingComponent, LogInContainerComponent, AsyncPipe, TranslateModule ], + imports: [ + AsyncPipe, + LogInContainerComponent, + ThemedLoadingComponent, + ], }) export class LogInComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index c1684a7689..d74685fbc2 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -9,7 +9,10 @@ import { AccessStatusBadgeComponent as BaseComponent } from 'src/app/shared/obje // templateUrl: './access-status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.html', standalone: true, - imports: [AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + TranslateModule, + ], }) export class AccessStatusBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts index 2ae0161c27..b6e233721b 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts @@ -13,7 +13,12 @@ import { ThemedTypeBadgeComponent } from '../../../../../../../app/shared/object // templateUrl: './badges.component.html', templateUrl: '../../../../../../../app/shared/object-collection/shared/badges/badges.component.html', standalone: true, - imports: [ThemedStatusBadgeComponent, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent], + imports: [ + ThemedAccessStatusBadgeComponent, + ThemedMyDSpaceStatusBadgeComponent, + ThemedStatusBadgeComponent, + ThemedTypeBadgeComponent, + ], }) export class BadgesComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts index 428f51711b..1462c2901f 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts @@ -9,7 +9,9 @@ import { MyDSpaceStatusBadgeComponent as BaseComponent } from 'src/app/shared/ob // templateUrl: './my-dspace-status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class MyDSpaceStatusBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts index 7af7de024e..3f527fdbf3 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts @@ -8,7 +8,9 @@ import { StatusBadgeComponent as BaseComponent } from 'src/app/shared/object-col // templateUrl: './status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/status-badge/status-badge.component.html', standalone: true, - imports: [ TranslateModule], + imports: [ + TranslateModule, + ], }) export class StatusBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts index 4d3a5a01dd..bd4ed12191 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts @@ -8,7 +8,9 @@ import { TypeBadgeComponent as BaseComponent } from 'src/app/shared/object-colle // templateUrl: './type-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/type-badge/type-badge.component.html', standalone: true, - imports: [TranslateModule], + imports: [ + TranslateModule, + ], }) export class TypeBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts b/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts index faf006518f..544987eb59 100644 --- a/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts @@ -15,7 +15,10 @@ import { BrowseEntryListElementComponent as BaseComponent } from '../../../../.. // templateUrl: './browse-entry-list-element.component.html', templateUrl: '../../../../../../app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.html', standalone: true, - imports: [RouterLink, AsyncPipe], + imports: [ + AsyncPipe, + RouterLink, + ], }) @listableObjectComponent(BrowseEntry, ViewMode.ListElement, Context.Any, 'custom') export class BrowseEntryListElementComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.html b/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts b/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts index a0e8ecb542..9801bece65 100644 --- a/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts @@ -7,8 +7,6 @@ import { ViewMode } from '../../../../../../app/core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; import { CollectionListElementComponent as BaseComponent } from '../../../../../../app/shared/object-list/collection-list-element/collection-list-element.component'; -@listableObjectComponent(Collection, ViewMode.ListElement, Context.Any, 'custom') - @Component({ selector: 'ds-collection-list-element', // styleUrls: ['./collection-list-element.component.scss'], @@ -16,11 +14,10 @@ import { CollectionListElementComponent as BaseComponent } from '../../../../../ // templateUrl: './collection-list-element.component.html' templateUrl: '../../../../../../app/shared/object-list/collection-list-element/collection-list-element.component.html', standalone: true, - imports: [ RouterLink], + imports: [ + RouterLink, + ], }) -/** - * Component representing list element for a collection - */ -export class CollectionListElementComponent extends BaseComponent {} - - +@listableObjectComponent(Collection, ViewMode.ListElement, Context.Any, 'custom') +export class CollectionListElementComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts b/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts index 32be7bc306..7e32907cb1 100644 --- a/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts @@ -7,8 +7,6 @@ import { ViewMode } from '../../../../../../app/core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; import { CommunityListElementComponent as BaseComponent } from '../../../../../../app/shared/object-list/community-list-element/community-list-element.component'; -@listableObjectComponent(Community, ViewMode.ListElement, Context.Any, 'custom') - @Component({ selector: 'ds-community-list-element', // styleUrls: ['./community-list-element.component.scss'], @@ -16,9 +14,10 @@ import { CommunityListElementComponent as BaseComponent } from '../../../../../. // templateUrl: './community-list-element.component.html' templateUrl: '../../../../../../app/shared/object-list/community-list-element/community-list-element.component.html', standalone: true, - imports: [ RouterLink], + imports: [ + RouterLink, + ], }) -/** - * Component representing a list element for a community - */ -export class CommunityListElementComponent extends BaseComponent {} +@listableObjectComponent(Community, ViewMode.ListElement, Context.Any, 'custom') +export class CommunityListElementComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/shared/object-list/object-list.component.ts b/src/themes/custom/app/shared/object-list/object-list.component.ts index 10a83d02ec..7cf76e9d81 100644 --- a/src/themes/custom/app/shared/object-list/object-list.component.ts +++ b/src/themes/custom/app/shared/object-list/object-list.component.ts @@ -8,18 +8,21 @@ import { ObjectListComponent as BaseComponent } from '../../../../../app/shared/ import { PaginationComponent } from '../../../../../app/shared/pagination/pagination.component'; import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; -/** - * A component to display the "Browse By" section of a Community or Collection page - * It expects the ID of the Community or Collection as input to be passed on as a scope - */ @Component({ selector: 'ds-themed-object-list', // styleUrls: ['./object-list.component.scss'], styleUrls: ['../../../../../app/shared/object-list/object-list.component.scss'], // templateUrl: './object-list.component.html' templateUrl: '../../../../../app/shared/object-list/object-list.component.html', - imports: [PaginationComponent, NgClass, SelectableListItemControlComponent, ImportableListItemControlComponent, ListableObjectComponentLoaderComponent, BrowserOnlyPipe], + imports: [ + BrowserOnlyPipe, + ImportableListItemControlComponent, + ListableObjectComponentLoaderComponent, + NgClass, + PaginationComponent, + SelectableListItemControlComponent, + ], standalone: true, }) - -export class ObjectListComponent extends BaseComponent {} +export class ObjectListComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index cf81cc62ea..db6f4ae5c0 100644 --- a/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -24,8 +24,15 @@ import { ThemedThumbnailComponent } from '../../../../../../../../../app/thumbna // templateUrl: './item-search-result-list-element.component.html', templateUrl: '../../../../../../../../../app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html', standalone: true, - imports: [ RouterLink, ThemedThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe], - + imports: [ + AsyncPipe, + NgClass, + RouterLink, + ThemedBadgesComponent, + ThemedThumbnailComponent, + TruncatableComponent, + TruncatablePartComponent, + ], }) export class ItemSearchResultListElementComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts b/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts index a31bcc80c3..d88fb9f9b7 100644 --- a/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts @@ -21,7 +21,12 @@ import { TruncatablePartComponent } from '../../../../../../../../app/shared/tru // templateUrl: './publication-sidebar-search-list-element.component.html', templateUrl: '../../../../../../../../app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgClass, + TranslateModule, + TruncatablePartComponent, + ], }) export class PublicationSidebarSearchListElementComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts b/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts index 2ec6d7d6ab..42ec08b149 100644 --- a/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts +++ b/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts @@ -10,6 +10,9 @@ import { ResultsBackButtonComponent as BaseComponent } from '../../../../../app/ //templateUrl: './results-back-button.component.html', templateUrl: '../../../../../app/shared/results-back-button/results-back-button.component.html', standalone: true, - imports: [AsyncPipe], + imports: [ + AsyncPipe, + ], }) -export class ResultsBackButtonComponent extends BaseComponent {} +export class ResultsBackButtonComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/shared/search-form/search-form.component.ts b/src/themes/custom/app/shared/search-form/search-form.component.ts index f9c5b1d910..1872b84aea 100644 --- a/src/themes/custom/app/shared/search-form/search-form.component.ts +++ b/src/themes/custom/app/shared/search-form/search-form.component.ts @@ -14,7 +14,13 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi // templateUrl: './search-form.component.html', templateUrl: '../../../../../app/shared/search-form/search-form.component.html', standalone: true, - imports: [FormsModule, NgbTooltipModule, AsyncPipe, TranslateModule, BrowserOnlyPipe], + imports: [ + AsyncPipe, + BrowserOnlyPipe, + FormsModule, + NgbTooltipModule, + TranslateModule, + ], }) export class SearchFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts b/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts index 3e86e16c01..a91183d02e 100644 --- a/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts +++ b/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts @@ -1,10 +1,3 @@ -/** - * The contents of this file are subject to the license and copyright - * detailed in the LICENSE_ATMIRE and NOTICE_ATMIRE files at the root of the source - * tree and available online at - * - * https://www.atmire.com/software-license/ - */ import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; @@ -16,7 +9,6 @@ import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-d import { SearchFilterComponent } from '../../../../../../app/shared/search/search-filters/search-filter/search-filter.component'; import { SearchFiltersComponent as BaseComponent } from '../../../../../../app/shared/search/search-filters/search-filters.component'; - @Component({ selector: 'ds-themed-search-filters', // styleUrls: ['./search-filters.component.scss'], @@ -30,8 +22,13 @@ import { SearchFiltersComponent as BaseComponent } from '../../../../../../app/s }, ], standalone: true, - imports: [SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule, NgxSkeletonLoaderModule], + imports: [ + AsyncPipe, + NgxSkeletonLoaderModule, + RouterLink, + SearchFilterComponent, + TranslateModule, + ], }) - export class SearchFiltersComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/search/search-results/search-results.component.ts b/src/themes/custom/app/shared/search/search-results/search-results.component.ts index 0c831f7520..b4a594015d 100644 --- a/src/themes/custom/app/shared/search/search-results/search-results.component.ts +++ b/src/themes/custom/app/shared/search/search-results/search-results.component.ts @@ -36,5 +36,4 @@ import { SearchResultsSkeletonComponent } from '../../../../../../app/shared/sea ], }) export class SearchResultsComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts b/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts index 2f1455f33d..12522f21a1 100644 --- a/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts +++ b/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts @@ -1,10 +1,3 @@ -/** - * The contents of this file are subject to the license and copyright - * detailed in the LICENSE_ATMIRE and NOTICE_ATMIRE files at the root of the source - * tree and available online at - * - * https://www.atmire.com/software-license/ - */ import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; @@ -15,7 +8,6 @@ import { PageSizeSelectorComponent } from '../../../../../../app/shared/page-siz import { SearchSettingsComponent as BaseComponent } from '../../../../../../app/shared/search/search-settings/search-settings.component'; import { SidebarDropdownComponent } from '../../../../../../app/shared/sidebar/sidebar-dropdown.component'; - @Component({ selector: 'ds-themed-search-settings', // styleUrls: ['./search-settings.component.scss'], @@ -29,7 +21,12 @@ import { SidebarDropdownComponent } from '../../../../../../app/shared/sidebar/s }, ], standalone: true, - imports: [ SidebarDropdownComponent, FormsModule, PageSizeSelectorComponent, TranslateModule], + imports: [ + FormsModule, + PageSizeSelectorComponent, + SidebarDropdownComponent, + TranslateModule, + ], }) - -export class SearchSettingsComponent extends BaseComponent {} +export class SearchSettingsComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts b/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts index 3281359f30..d1f8b33a90 100644 --- a/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -1,10 +1,3 @@ -/** - * The contents of this file are subject to the license and copyright - * detailed in the LICENSE_ATMIRE and NOTICE_ATMIRE files at the root of the source - * tree and available online at - * - * https://www.atmire.com/software-license/ - */ import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; @@ -18,7 +11,6 @@ import { SearchSidebarComponent as BaseComponent } from '../../../../../../app/s import { SearchSwitchConfigurationComponent } from '../../../../../../app/shared/search/search-switch-configuration/search-switch-configuration.component'; import { ViewModeSwitchComponent } from '../../../../../../app/shared/view-mode-switch/view-mode-switch.component'; - @Component({ selector: 'ds-themed-search-sidebar', // styleUrls: ['./search-sidebar.component.scss'], @@ -32,7 +24,15 @@ import { ViewModeSwitchComponent } from '../../../../../../app/shared/view-mode- }, ], standalone: true, - imports: [ ViewModeSwitchComponent, SearchSwitchConfigurationComponent, ThemedSearchFiltersComponent, ThemedSearchSettingsComponent, TranslateModule, AdvancedSearchComponent, AsyncPipe], + imports: [ + AdvancedSearchComponent, + AsyncPipe, + SearchSwitchConfigurationComponent, + ThemedSearchFiltersComponent, + ThemedSearchSettingsComponent, + TranslateModule, + ViewModeSwitchComponent, + ], }) export class SearchSidebarComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/search/search.component.ts b/src/themes/custom/app/shared/search/search.component.ts index 4b2810ad73..b39c301cee 100644 --- a/src/themes/custom/app/shared/search/search.component.ts +++ b/src/themes/custom/app/shared/search/search.component.ts @@ -30,11 +30,11 @@ import { ViewModeSwitchComponent } from '../../../../../app/shared/view-mode-swi AsyncPipe, NgTemplateOutlet, PageWithSidebarComponent, + SearchLabelsComponent, ThemedSearchFormComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, TranslateModule, - SearchLabelsComponent, ViewModeSwitchComponent, ], }) diff --git a/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts b/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts index f14d1f39c5..3c78aaf3bf 100644 --- a/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts +++ b/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts @@ -14,7 +14,11 @@ import { StartsWithDateComponent as BaseComponent } from '../../../../../../app/ // templateUrl: './starts-with-date.component.html', templateUrl: '../../../../../../app/shared/starts-with/date/starts-with-date.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class StartsWithDateComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts b/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts index d893b3f4d2..b16cb4805b 100644 --- a/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts +++ b/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts @@ -14,7 +14,11 @@ import { StartsWithTextComponent as BaseComponent } from '../../../../../../app/ // templateUrl: './starts-with-text.component.html', templateUrl: '../../../../../../app/shared/starts-with/text/starts-with-text.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule], + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateModule, + ], }) export class StartsWithTextComponent extends BaseComponent { } diff --git a/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts b/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts index 3fbd6d0bca..1ce3458bb2 100644 --- a/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts @@ -14,11 +14,13 @@ import { StatisticsTableComponent } from '../../../../../app/statistics-page/sta // templateUrl: './collection-statistics-page.component.html', templateUrl: '../../../../../app/statistics-page/statistics-page/statistics-page.component.html', standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) - -/** - * Component representing the statistics page for a collection. - */ -export class CollectionStatisticsPageComponent extends BaseComponent {} - +export class CollectionStatisticsPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts b/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts index 7c76eeac7d..cc8ac40912 100644 --- a/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts @@ -14,11 +14,13 @@ import { StatisticsTableComponent } from '../../../../../app/statistics-page/sta // templateUrl: './community-statistics-page.component.html', templateUrl: '../../../../../app/statistics-page/statistics-page/statistics-page.component.html', standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) - -/** - * Component representing the statistics page for a community. - */ -export class CommunityStatisticsPageComponent extends BaseComponent {} - +export class CommunityStatisticsPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts b/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts index fe9d0a0a3a..466280e5e7 100644 --- a/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts @@ -14,11 +14,13 @@ import { StatisticsTableComponent } from '../../../../../app/statistics-page/sta // templateUrl: './item-statistics-page.component.html', templateUrl: '../../../../../app/statistics-page/statistics-page/statistics-page.component.html', standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) - -/** - * Component representing the statistics page for an item. - */ -export class ItemStatisticsPageComponent extends BaseComponent {} - +export class ItemStatisticsPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts b/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts index 1301949963..83669b8869 100644 --- a/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts @@ -14,11 +14,13 @@ import { StatisticsTableComponent } from '../../../../../app/statistics-page/sta // templateUrl: './site-statistics-page.component.html', templateUrl: '../../../../../app/statistics-page/statistics-page/statistics-page.component.html', standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + imports: [ + CommonModule, + StatisticsTableComponent, + ThemedLoadingComponent, + TranslateModule, + VarDirective, + ], }) - -/** - * Component representing the site-wide statistics page. - */ -export class SiteStatisticsPageComponent extends BaseComponent {} - +export class SiteStatisticsPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/submission/edit/submission-edit.component.ts b/src/themes/custom/app/submission/edit/submission-edit.component.ts index 1afe61b44a..fd20e77c57 100644 --- a/src/themes/custom/app/submission/edit/submission-edit.component.ts +++ b/src/themes/custom/app/submission/edit/submission-edit.component.ts @@ -3,9 +3,6 @@ import { Component } from '@angular/core'; import { SubmissionEditComponent as BaseComponent } from '../../../../../app/submission/edit/submission-edit.component'; import { ThemedSubmissionFormComponent } from '../../../../../app/submission/form/themed-submission-form.component'; -/** - * This component allows to edit an existing workspaceitem/workflowitem. - */ @Component({ selector: 'ds-themed-submission-edit', // styleUrls: ['./submission-edit.component.scss'], diff --git a/src/themes/custom/app/submission/form/footer/submission-form-footer.component.ts b/src/themes/custom/app/submission/form/footer/submission-form-footer.component.ts index 350a6204f3..346a122b13 100644 --- a/src/themes/custom/app/submission/form/footer/submission-form-footer.component.ts +++ b/src/themes/custom/app/submission/form/footer/submission-form-footer.component.ts @@ -13,7 +13,12 @@ import { SubmissionFormFooterComponent as BaseComponent } from '../../../../../. // templateUrl: './submission-form-footer.component.html' templateUrl: '../../../../../../app/submission/form/footer/submission-form-footer.component.html', standalone: true, - imports: [CommonModule, BrowserOnlyPipe, TranslateModule, BtnDisabledDirective], + imports: [ + BrowserOnlyPipe, + BtnDisabledDirective, + CommonModule, + TranslateModule, + ], }) export class SubmissionFormFooterComponent extends BaseComponent { diff --git a/src/themes/custom/app/submission/form/submission-form.component.ts b/src/themes/custom/app/submission/form/submission-form.component.ts index 084673acdc..35f7e373dc 100644 --- a/src/themes/custom/app/submission/form/submission-form.component.ts +++ b/src/themes/custom/app/submission/form/submission-form.component.ts @@ -19,12 +19,12 @@ import { ThemedSubmissionSectionContainerComponent } from '../../../../../app/su standalone: true, imports: [ CommonModule, - ThemedLoadingComponent, - ThemedSubmissionSectionContainerComponent, - ThemedSubmissionFormFooterComponent, - ThemedSubmissionUploadFilesComponent, SubmissionFormCollectionComponent, SubmissionFormSectionAddComponent, + ThemedLoadingComponent, + ThemedSubmissionFormFooterComponent, + ThemedSubmissionSectionContainerComponent, + ThemedSubmissionUploadFilesComponent, TranslatePipe, ], }) diff --git a/src/themes/custom/app/submission/import-external/submission-import-external.component.ts b/src/themes/custom/app/submission/import-external/submission-import-external.component.ts index 9222fbd5c3..96e03e9c0c 100644 --- a/src/themes/custom/app/submission/import-external/submission-import-external.component.ts +++ b/src/themes/custom/app/submission/import-external/submission-import-external.component.ts @@ -11,9 +11,6 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; import { SubmissionImportExternalSearchbarComponent } from '../../../../../app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component'; import { SubmissionImportExternalComponent as BaseComponent } from '../../../../../app/submission/import-external/submission-import-external.component'; -/** - * This component allows to submit a new workspaceitem importing the data from an external source. - */ @Component({ selector: 'ds-themed-submission-import-external', // styleUrls: ['./submission-import-external.component.scss'], @@ -23,16 +20,15 @@ import { SubmissionImportExternalComponent as BaseComponent } from '../../../../ animations: [fadeIn], standalone: true, imports: [ - ObjectCollectionComponent, - ThemedLoadingComponent, AlertComponent, AsyncPipe, + ObjectCollectionComponent, + RouterLink, SubmissionImportExternalSearchbarComponent, + ThemedLoadingComponent, TranslateModule, VarDirective, - RouterLink, ], }) export class SubmissionImportExternalComponent extends BaseComponent { - } diff --git a/src/themes/custom/app/submission/sections/container/section-container.component.ts b/src/themes/custom/app/submission/sections/container/section-container.component.ts index aa548c0a9c..0bf6a940d2 100644 --- a/src/themes/custom/app/submission/sections/container/section-container.component.ts +++ b/src/themes/custom/app/submission/sections/container/section-container.component.ts @@ -20,12 +20,12 @@ import { SectionsDirective } from '../../../../../../app/submission/sections/sec standalone: true, imports: [ AlertComponent, - NgbAccordionModule, - NgComponentOutlet, - TranslateModule, - NgClass, AsyncPipe, + NgbAccordionModule, + NgClass, + NgComponentOutlet, SectionsDirective, + TranslateModule, ], }) export class SubmissionSectionContainerComponent extends BaseComponent { diff --git a/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts b/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts index c8440ccf72..6015bb99f7 100644 --- a/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts @@ -5,12 +5,8 @@ import { SubmissionSectionUploadFileComponent as BaseComponent } from 'src/app/s import { BtnDisabledDirective } from '../../../../../../../app/shared/btn-disabled.directive'; import { ThemedFileDownloadLinkComponent } from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; -import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pipe'; import { SubmissionSectionUploadFileViewComponent } from '../../../../../../../app/submission/sections/upload/file/view/section-upload-file-view.component'; -/** - * This component represents a single bitstream contained in the submission - */ @Component({ selector: 'ds-themed-submission-upload-section-file', // styleUrls: ['./section-upload-file.component.scss'], @@ -19,14 +15,12 @@ import { SubmissionSectionUploadFileViewComponent } from '../../../../../../../a templateUrl: '../../../../../../../app/submission/sections/upload/file/section-upload-file.component.html', standalone: true, imports: [ - TranslateModule, - SubmissionSectionUploadFileViewComponent, AsyncPipe, - ThemedFileDownloadLinkComponent, - FileSizePipe, BtnDisabledDirective, + SubmissionSectionUploadFileViewComponent, + ThemedFileDownloadLinkComponent, + TranslateModule, ], }) -export class SubmissionSectionUploadFileComponent - extends BaseComponent { +export class SubmissionSectionUploadFileComponent extends BaseComponent { } diff --git a/src/themes/custom/app/submission/submit/submission-submit.component.ts b/src/themes/custom/app/submission/submit/submission-submit.component.ts index 9c84aeedc3..dd1fe3ca85 100644 --- a/src/themes/custom/app/submission/submit/submission-submit.component.ts +++ b/src/themes/custom/app/submission/submit/submission-submit.component.ts @@ -2,9 +2,6 @@ import { Component } from '@angular/core'; import { SubmissionSubmitComponent as BaseComponent } from '../../../../../app/submission/submit/submission-submit.component'; -/** - * This component allows to submit a new workspaceitem. - */ @Component({ selector: 'ds-themed-submission-submit', // styleUrls: ['./submission-submit.component.scss'], diff --git a/src/themes/custom/app/thumbnail/thumbnail.component.ts b/src/themes/custom/app/thumbnail/thumbnail.component.ts index fbd2e22cd1..65da2c4c50 100644 --- a/src/themes/custom/app/thumbnail/thumbnail.component.ts +++ b/src/themes/custom/app/thumbnail/thumbnail.component.ts @@ -4,7 +4,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; import { SafeUrlPipe } from '../../../../app/shared/utils/safe-url-pipe'; -import { VarDirective } from '../../../../app/shared/utils/var.directive'; import { ThumbnailComponent as BaseComponent } from '../../../../app/thumbnail/thumbnail.component'; @Component({ @@ -14,7 +13,12 @@ import { ThumbnailComponent as BaseComponent } from '../../../../app/thumbnail/t // templateUrl: './thumbnail.component.html', templateUrl: '../../../../app/thumbnail/thumbnail.component.html', standalone: true, - imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe], + imports: [ + CommonModule, + SafeUrlPipe, + ThemedLoadingComponent, + TranslateModule, + ], }) export class ThumbnailComponent extends BaseComponent { } diff --git a/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts b/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts index 591ff5dd44..9105ef9f30 100644 --- a/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts +++ b/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts @@ -12,10 +12,12 @@ import { WorkflowItemDeleteComponent as BaseComponent } from '../../../../../app // templateUrl: './workflow-item-delete.component.html' templateUrl: '../../../../../app/workflowitems-edit-page/workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], + imports: [ + CommonModule, + ModifyItemOverviewComponent, + TranslateModule, + VarDirective, + ], }) -/** - * Component representing a page to delete a workflow item - */ export class WorkflowItemDeleteComponent extends BaseComponent { } diff --git a/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts b/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts index 9d3ea16193..b96b2b44ce 100644 --- a/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts +++ b/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts @@ -8,17 +8,16 @@ import { WorkflowItemSendBackComponent as BaseComponent } from '../../../../../a @Component({ selector: 'ds-themed-workflow-item-send-back', - // NOTE: the SCSS file for workflow-item-action-page does not have a corresponding file in the original - // implementation, so this commented out line below is a stub, here if you - // need it, but you probably don't need it. // styleUrls: ['./workflow-item-send-back.component.scss'], // templateUrl: './workflow-item-send-back.component.html' templateUrl: '../../../../../app/workflowitems-edit-page/workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], + imports: [ + CommonModule, + ModifyItemOverviewComponent, + TranslateModule, + VarDirective, + ], }) -/** - * Component representing a page to send back a workflow item to the submitter - */ export class WorkflowItemSendBackComponent extends BaseComponent { } diff --git a/src/themes/custom/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts b/src/themes/custom/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts index aeecb081d7..91d1c05add 100644 --- a/src/themes/custom/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts +++ b/src/themes/custom/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts @@ -5,15 +5,14 @@ import { TranslateModule } from '@ngx-translate/core'; import { ModifyItemOverviewComponent } from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { WorkspaceItemsDeletePageComponent as BaseComponent } from '../../../../../app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component'; - @Component({ selector: 'ds-themed-workspaceitems-delete-page', templateUrl: '../../../../../app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.html', standalone: true, imports: [ + CommonModule, ModifyItemOverviewComponent, TranslateModule, - CommonModule, ], }) export class WorkspaceItemsDeletePageComponent extends BaseComponent { diff --git a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts index 18de5dae5a..2e59b7677a 100644 --- a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -15,7 +15,12 @@ import { slideMobileNav } from '../../../../app/shared/animations/slide'; styleUrls: ['header-navbar-wrapper.component.scss'], templateUrl: 'header-navbar-wrapper.component.html', standalone: true, - imports: [ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + ThemedHeaderComponent, + ThemedNavbarComponent, + TranslateModule, + ], animations: [slideMobileNav], }) export class HeaderNavbarWrapperComponent extends BaseComponent { diff --git a/src/themes/dspace/app/header/header.component.ts b/src/themes/dspace/app/header/header.component.ts index 791959dd9c..8f95f38f93 100644 --- a/src/themes/dspace/app/header/header.component.ts +++ b/src/themes/dspace/app/header/header.component.ts @@ -24,7 +24,18 @@ import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-n styleUrls: ['header.component.scss'], templateUrl: 'header.component.html', standalone: true, - imports: [NgbDropdownModule, ThemedLangSwitchComponent, RouterLink, ThemedSearchNavbarComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, ThemedNavbarComponent, TranslateModule, AsyncPipe], + imports: [ + AsyncPipe, + ContextHelpToggleComponent, + ImpersonateNavbarComponent, + NgbDropdownModule, + RouterLink, + ThemedAuthNavMenuComponent, + ThemedLangSwitchComponent, + ThemedNavbarComponent, + ThemedSearchNavbarComponent, + TranslateModule, + ], }) export class HeaderComponent extends BaseComponent implements OnInit { public isNavBarCollapsed$: Observable; diff --git a/src/themes/dspace/app/navbar/navbar.component.ts b/src/themes/dspace/app/navbar/navbar.component.ts index 50ef8e21cf..ec0c2a240f 100644 --- a/src/themes/dspace/app/navbar/navbar.component.ts +++ b/src/themes/dspace/app/navbar/navbar.component.ts @@ -20,7 +20,14 @@ import { ThemedUserMenuComponent } from '../../../../app/shared/auth-nav-menu/us templateUrl: './navbar.component.html', animations: [slideMobileNav], standalone: true, - imports: [NgbDropdownModule, NgClass, ThemedUserMenuComponent, NgComponentOutlet, AsyncPipe, TranslateModule], + imports: [ + AsyncPipe, + NgbDropdownModule, + NgClass, + NgComponentOutlet, + ThemedUserMenuComponent, + TranslateModule, + ], }) export class NavbarComponent extends BaseComponent { }