From 928d7a45a372003547b86be1ff3725288da43ad4 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 27 Jun 2023 15:26:49 +0200 Subject: [PATCH 001/101] 103176: Fix vcr not being defined yet in OnInit hook --- src/app/shared/theme-support/themed.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 2ff0713f46..920fbba6e5 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -1,10 +1,10 @@ import { + AfterViewInit, Component, ViewChild, ViewContainerRef, ComponentRef, SimpleChanges, - OnInit, OnDestroy, ComponentFactoryResolver, ChangeDetectorRef, @@ -21,7 +21,7 @@ import { GenericConstructor } from '../../core/shared/generic-constructor'; styleUrls: ['./themed.component.scss'], templateUrl: './themed.component.html', }) -export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges { +export abstract class ThemedComponent implements AfterViewInit, OnDestroy, OnChanges { @ViewChild('vcr', { read: ViewContainerRef }) vcr: ViewContainerRef; protected compRef: ComponentRef; @@ -49,7 +49,7 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges } } - ngOnInit(): void { + ngAfterViewInit(): void { this.destroyComponentInstance(); this.themeSub = this.themeService.getThemeName$().subscribe(() => { this.renderComponentInstance(); From a35b7d8356e17f4cdd8568389695b1685b27eb84 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Thu, 29 Jun 2023 16:09:54 +0200 Subject: [PATCH 002/101] catch and handle unsuccessful "convert rels to items" responses --- .../shared/item-relationships-utils.ts | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) 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 b4c3da2cdc..0c4e82178f 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 @@ -5,8 +5,7 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { Relationship } from '../../../../core/shared/item-relationships/relationship.model'; import { Item } from '../../../../core/shared/item.model'; import { - getFirstSucceededRemoteDataPayload, - getFirstSucceededRemoteData + getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { hasValue } from '../../../../shared/empty.util'; import { InjectionToken } from '@angular/core'; @@ -77,24 +76,42 @@ export const relationsToItems = (thisId: string) => * @param {string} thisId The item's id of which the relations belong to * @returns {(source: Observable) => Observable} */ -export const paginatedRelationsToItems = (thisId: string) => - (source: Observable>>): Observable>> => +export const paginatedRelationsToItems = (thisId: string) => (source: Observable>>): Observable>> => source.pipe( - getFirstSucceededRemoteData(), + getFirstCompletedRemoteData(), switchMap((relationshipsRD: RemoteData>) => { return observableCombineLatest( relationshipsRD.payload.page.map((rel: Relationship) => observableCombineLatest([ - rel.leftItem.pipe(getFirstSucceededRemoteDataPayload()), - rel.rightItem.pipe(getFirstSucceededRemoteDataPayload())] + rel.leftItem.pipe( + getFirstCompletedRemoteData(), + map((rd: RemoteData) => { + if (rd.hasSucceeded) { + return rd.payload; + } else { + return null; + } + }) + ), + rel.rightItem.pipe( + getFirstCompletedRemoteData(), + map((rd: RemoteData) => { + if (rd.hasSucceeded) { + return rd.payload; + } else { + return null; + } + }) + ), + ] ) - )).pipe( + ) + ).pipe( map((arr) => - arr - .map(([leftItem, rightItem]) => { - if (leftItem.id === thisId) { + arr.map(([leftItem, rightItem]) => { + if (hasValue(leftItem) && leftItem.id === thisId) { return rightItem; - } else if (rightItem.id === thisId) { + } else if (hasValue(rightItem) && rightItem.id === thisId) { return leftItem; } }) From ae6b183faec9cda0d2932143a52e14ef94bd945c Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Wed, 14 Jun 2023 18:51:42 +0200 Subject: [PATCH 003/101] 103236: fix issue where setStaleByHrefSubtring wouldn't emit after all requests were stale --- src/app/core/data/request.service.ts | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/app/core/data/request.service.ts b/src/app/core/data/request.service.ts index 2d5acb2cb3..3b7ee80ffb 100644 --- a/src/app/core/data/request.service.ts +++ b/src/app/core/data/request.service.ts @@ -2,8 +2,8 @@ import { Injectable } from '@angular/core'; import { HttpHeaders } from '@angular/common/http'; import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store'; -import { Observable } from 'rxjs'; -import { filter, map, take, tap } from 'rxjs/operators'; +import { Observable, from as observableFrom } from 'rxjs'; +import { filter, find, map, mergeMap, switchMap, take, tap, toArray } from 'rxjs/operators'; import { cloneDeep } from 'lodash'; import { hasValue, isEmpty, isNotEmpty, hasNoValue } from '../../shared/empty.util'; import { ObjectCacheEntry } from '../cache/object-cache.reducer'; @@ -292,22 +292,42 @@ export class RequestService { * Set all requests that match (part of) the href to stale * * @param href A substring of the request(s) href - * @return Returns an observable emitting whether or not the cache is removed + * @return Returns an observable emitting when those requests are all stale */ setStaleByHrefSubstring(href: string): Observable { - this.store.pipe( + const requestUUIDs$ = this.store.pipe( select(uuidsFromHrefSubstringSelector(requestIndexSelector, href)), take(1) - ).subscribe((uuids: string[]) => { + ); + requestUUIDs$.subscribe((uuids: string[]) => { for (const uuid of uuids) { this.store.dispatch(new RequestStaleAction(uuid)); } }); this.requestsOnTheirWayToTheStore = this.requestsOnTheirWayToTheStore.filter((reqHref: string) => reqHref.indexOf(href) < 0); - return this.store.pipe( - select(uuidsFromHrefSubstringSelector(requestIndexSelector, href)), - map((uuids) => isEmpty(uuids)) + // emit true after all requests are stale + return requestUUIDs$.pipe( + switchMap((uuids: string[]) => { + if (isEmpty(uuids)) { + // if there were no matching requests, emit true immediately + return [true]; + } else { + // otherwise emit all request uuids in order + return observableFrom(uuids).pipe( + // retrieve the RequestEntry for each uuid + mergeMap((uuid: string) => this.getByUUID(uuid)), + // check whether it is undefined or stale + map((request: RequestEntry) => hasNoValue(request) || isStale(request.state)), + // if it is, complete + find((stale: boolean) => stale === true), + // after all observables above are completed, emit them as a single array + toArray(), + // when the array comes in, emit true + map(() => true) + ); + } + }) ); } From 02a20c8862ca4d93919ca07e900d70a722ebbb5d Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 30 Jun 2023 16:56:37 +0200 Subject: [PATCH 004/101] 103236: Added tests for setStaleByHrefSubstring --- src/app/core/data/request.service.spec.ts | 46 ++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/app/core/data/request.service.spec.ts b/src/app/core/data/request.service.spec.ts index fe35d840d7..4493c61a69 100644 --- a/src/app/core/data/request.service.spec.ts +++ b/src/app/core/data/request.service.spec.ts @@ -1,6 +1,6 @@ import { Store, StoreModule } from '@ngrx/store'; import { cold, getTestScheduler } from 'jasmine-marbles'; -import { EMPTY, of as observableOf } from 'rxjs'; +import { EMPTY, Observable, of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getMockObjectCacheService } from '../../shared/mocks/object-cache.service.mock'; @@ -625,4 +625,48 @@ describe('RequestService', () => { expect(done$).toBeObservable(cold('-----(t|)', { t: true })); })); }); + + describe('setStaleByHrefSubstring', () => { + let dispatchSpy: jasmine.Spy; + let getByUUIDSpy: jasmine.Spy; + + beforeEach(() => { + dispatchSpy = spyOn(store, 'dispatch'); + getByUUIDSpy = spyOn(service, 'getByUUID').and.callThrough(); + }); + + describe('with an empty/no matching requests in the state', () => { + it('should return true', () => { + const done$: Observable = service.setStaleByHrefSubstring('https://rest.api/endpoint/selfLink'); + expect(done$).toBeObservable(cold('(a|)', { a: true })); + }); + }); + + describe('with a matching request in the state', () => { + beforeEach(() => { + const state = Object.assign({}, initialState, { + core: Object.assign({}, initialState.core, { + 'index': { + 'get-request/href-to-uuid': { + 'https://rest.api/endpoint/selfLink': '5f2a0d2a-effa-4d54-bd54-5663b960f9eb' + } + } + }) + }); + mockStore.setState(state); + }); + + it('should return an Observable that emits true as soon as the request is stale', () => { + dispatchSpy.and.callFake(() => { /* empty */ }); // don't actually set as stale + getByUUIDSpy.and.returnValue(cold('a-b--c--d-', { // but fake the state in the cache + a: { state: RequestEntryState.ResponsePending }, + b: { state: RequestEntryState.Success }, + c: { state: RequestEntryState.SuccessStale }, + d: { state: RequestEntryState.Error }, + })); + const done$: Observable = service.setStaleByHrefSubstring('https://rest.api/endpoint/selfLink'); + expect(done$).toBeObservable(cold('-----(a|)', { a: true })); + }); + }); + }); }); From b2b1782cd8505cf079782811bab4238e5cc0a359 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 30 Jun 2023 20:23:51 +0200 Subject: [PATCH 005/101] Hide entity field in collection form when entities aren't initialized --- .../collection-form/collection-form.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 23698de84e..b52d282f63 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -79,9 +79,8 @@ export class CollectionFormComponent extends ComColFormComponent imp // retrieve all entity types to populate the dropdowns selection entities$.subscribe((entityTypes: ItemType[]) => { - entityTypes - .filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE) - .forEach((type: ItemType, index: number) => { + entityTypes = entityTypes.filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE); + entityTypes.forEach((type: ItemType, index: number) => { this.entityTypeSelection.add({ disabled: false, label: type.label, @@ -93,7 +92,7 @@ export class CollectionFormComponent extends ComColFormComponent imp } }); - this.formModel = [...collectionFormModels, this.entityTypeSelection]; + this.formModel = entityTypes.length === 0 ? collectionFormModels : [...collectionFormModels, this.entityTypeSelection]; super.ngOnInit(); }); From cf777268666587d5980408d7bc3872260606ae71 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 30 Jun 2023 22:41:07 +0200 Subject: [PATCH 006/101] Fix enter not submitting collection form correctly Fixed it for communities, collections, ePersons & groups --- .../eperson-form/eperson-form.component.html | 10 +++++----- .../group-form/group-form.component.html | 4 ++-- .../comcol-form/comcol-form.component.html | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html index e9cc48aee3..156f2e776d 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html @@ -15,23 +15,23 @@ [displayCancel]="false" (submitForm)="onSubmit()">
-
-
- -
- diff --git a/src/app/access-control/group-registry/group-form/group-form.component.html b/src/app/access-control/group-registry/group-form/group-form.component.html index 0fc5a574b7..e50a479090 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.html +++ b/src/app/access-control/group-registry/group-form/group-form.component.html @@ -25,12 +25,12 @@ [displayCancel]="false" (submitForm)="onSubmit()">
-
diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html index 5d7b092f74..b7b3d344b1 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html @@ -42,7 +42,7 @@ [formModel]="formModel" [displayCancel]="false" (submitForm)="onSubmit()"> - From b5a70e8f95d1046bed0e33d5b0bdc8109d645676 Mon Sep 17 00:00:00 2001 From: Nona Luypaert Date: Sat, 8 Jul 2023 00:20:30 +0200 Subject: [PATCH 007/101] Fix VocabularyTreeview not updating + i18n for nsi --- .../vocabulary-treeview/vocabulary-treeview.component.ts | 9 +++++++-- src/assets/i18n/en.json5 | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) 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 017416e8c2..13d4495e61 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -1,5 +1,5 @@ import { FlatTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core'; import { map } from 'rxjs/operators'; import { Observable, Subscription } from 'rxjs'; @@ -28,7 +28,7 @@ import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operato templateUrl: './vocabulary-treeview.component.html', styleUrls: ['./vocabulary-treeview.component.scss'] }) -export class VocabularyTreeviewComponent implements OnDestroy, OnInit { +export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges { /** * The {@link VocabularyOptions} object @@ -322,4 +322,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit { private getEntryId(entry: VocabularyEntry): string { return entry.authority || entry.otherInformation.id || undefined; } + + ngOnChanges(changes: SimpleChanges): void { + this.reset(); + this.vocabularyTreeviewService.initialize(this.vocabularyOptions, new PageInfo(), this.selectedItems, null); + } } diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 6c91bae4c1..ee594a9cb2 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -782,6 +782,8 @@ "browse.comcol.by.srsc": "By Subject Category", + "browse.comcol.by.nsi": "By Norwegian Science Index", + "browse.comcol.by.title": "By Title", "browse.comcol.head": "Browse", @@ -804,6 +806,8 @@ "browse.metadata.srsc.breadcrumbs": "Browse by Subject Category", + "browse.metadata.nsi.breadcrumbs": "Browse by Norwegian Science Index", + "browse.metadata.title.breadcrumbs": "Browse by Title", "pagination.next.button": "Next", @@ -2826,6 +2830,8 @@ "menu.section.browse_global_by_srsc": "By Subject Category", + "menu.section.browse_global_by_nsi": "By Norwegian Science Index", + "menu.section.browse_global_by_title": "By Title", "menu.section.browse_global_communities_and_collections": "Communities & Collections", From cac1407f08290adbc1a827fb1769011d3ecba803 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 12 Jul 2023 15:11:38 +0200 Subject: [PATCH 008/101] 104189: Allow CSV export on related entity search --- .../related-entities-search.component.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html index 2a08efeb2c..36340bebfa 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html @@ -2,5 +2,6 @@ [fixedFilterQuery]="fixedFilter" [configuration]="configuration" [searchEnabled]="searchEnabled" - [sideBarWidth]="sideBarWidth"> + [sideBarWidth]="sideBarWidth" + [showCsvExport]="true"> From 45ad5f73168ccdf3d4f7ab617d44a0e28c94545a Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 12 Jul 2023 16:32:56 +0200 Subject: [PATCH 009/101] 104189: CSV export add fixedFilter --- .../search-export-csv.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 6ad105342f..1997a663a1 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 @@ -94,6 +94,19 @@ export class SearchExportCsvComponent implements OnInit { } }); } + if (isNotEmpty(this.searchConfig.fixedFilter)) { + const fixedFilter = this.searchConfig.fixedFilter.substring(2); + const keyAndValue = fixedFilter.split('='); + if (keyAndValue.length > 1) { + const key = keyAndValue[0]; + const valueAndOperator = keyAndValue[1].split(','); + if (valueAndOperator.length > 1) { + const value = valueAndOperator[0]; + const operator = valueAndOperator[1]; + parameters.push({name: '-f', value: `${key},${operator}=${value}`}); + } + } + } } this.scriptDataService.invoke('metadata-export-search', parameters, []).pipe( From 03e1f677b610498b6dbb54b1f3e6310bef5a1407 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Mon, 17 Jul 2023 15:08:54 +0200 Subject: [PATCH 010/101] 104126: ProcessDetailComponent test improvement --- .../detail/process-detail.component.spec.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 9552f9a092..9a0d89a882 100644 --- a/src/app/process-page/detail/process-detail.component.spec.ts +++ b/src/app/process-page/detail/process-detail.component.spec.ts @@ -147,7 +147,7 @@ describe('ProcessDetailComponent', () => { providers: [ { provide: ActivatedRoute, - useValue: { data: observableOf({ process: createSuccessfulRemoteDataObject(process) }) } + useValue: { data: observableOf({ process: createSuccessfulRemoteDataObject(process) }), snapshot: { params: { id: 1 } } }, }, { provide: ProcessDataService, useValue: processService }, { provide: BitstreamDataService, useValue: bitstreamDataService }, @@ -310,10 +310,11 @@ describe('ProcessDetailComponent', () => { }); it('should call refresh method every 5 seconds, until process is completed', fakeAsync(() => { - spyOn(component, 'refresh'); - spyOn(component, 'stopRefreshTimer'); + spyOn(component, 'refresh').and.callThrough(); + spyOn(component, 'stopRefreshTimer').and.callThrough(); - process.processStatus = ProcessStatus.COMPLETED; + // start off with a running process in order for the refresh counter starts counting up + process.processStatus = ProcessStatus.RUNNING; // set findbyId to return a completed process (processService.findById as jasmine.Spy).and.returnValue(observableOf(createSuccessfulRemoteDataObject(process))); @@ -336,6 +337,10 @@ describe('ProcessDetailComponent', () => { tick(1001); // 1 second + 1 ms by the setTimeout expect(component.refreshCounter$.value).toBe(0); // 1 - 1 + // set the process to completed right before the counter checks the process + process.processStatus = ProcessStatus.COMPLETED; + (processService.findById as jasmine.Spy).and.returnValue(observableOf(createSuccessfulRemoteDataObject(process))); + tick(1000); // 1 second expect(component.refresh).toHaveBeenCalledTimes(1); From 648925f3e1c0a51fc3eb61b7257e7a44ea57fee6 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 19 Jul 2023 14:01:41 +0200 Subject: [PATCH 011/101] 104312: DsDynamicLookupRelationExternalSourceTabComponent should have the form value already filled in the search input --- .../dynamic-lookup-relation-modal.component.html | 1 + ...ookup-relation-external-source-tab.component.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html index f95cd98c65..4c635b931f 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html @@ -42,6 +42,7 @@ [collection]="collection" [relationship]="relationshipOptions" [context]="context" + [query]="query" [externalSource]="source" (importedObject)="imported($event)" class="d-block pt-3"> 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 ca2535cb91..ef646c28eb 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,6 +74,12 @@ export class DsDynamicLookupRelationExternalSourceTabComponent implements OnInit * The context to displaying lists for */ @Input() context: Context; + + /** + * The search query + */ + @Input() query: string; + @Input() repeatable: boolean; /** * Emit an event when an object has been imported (or selected from similar local entries) @@ -147,8 +153,12 @@ export class DsDynamicLookupRelationExternalSourceTabComponent implements OnInit this.resetRoute(); this.entriesRD$ = this.searchConfigService.paginatedSearchOptions.pipe( - switchMap((searchOptions: PaginatedSearchOptions) => - this.externalSourceService.getExternalSourceEntries(this.externalSource.id, searchOptions).pipe(startWith(undefined))) + switchMap((searchOptions: PaginatedSearchOptions) => { + if (searchOptions.query === '') { + searchOptions.query = this.query; + } + return this.externalSourceService.getExternalSourceEntries(this.externalSource.id, searchOptions).pipe(startWith(undefined)); + }) ); this.currentPagination$ = this.paginationService.getCurrentPagination(this.searchConfigService.paginationID, this.initialPagination); this.importConfig = { From 8bf4ba812614e5ed34b2808b79d7e364fd01c2db Mon Sep 17 00:00:00 2001 From: Mirko Scherf Date: Thu, 20 Jul 2023 14:53:28 +0200 Subject: [PATCH 012/101] refactor: rename aletr-type.ts to alert-type.ts --- .../group-registry/group-form/group-form.component.ts | 2 +- .../edit-item-template-page.component.ts | 2 +- .../dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts | 2 +- .../health-panel/health-component/health-component.component.ts | 2 +- src/app/item-page/alerts/item-alerts.component.ts | 2 +- .../item-version-history/item-version-history.component.ts | 2 +- .../item-page/orcid-page/orcid-queue/orcid-queue.component.ts | 2 +- src/app/item-page/versions/item-versions.component.ts | 2 +- .../item-page/versions/notice/item-versions-notice.component.ts | 2 +- src/app/process-page/detail/process-detail.component.ts | 2 +- src/app/register-email-form/register-email-form.component.ts | 2 +- .../access-control-form-container.component.ts | 2 +- src/app/shared/alert/{aletr-type.ts => alert-type.ts} | 0 src/app/shared/alert/alert.component.spec.ts | 2 +- src/app/shared/alert/alert.component.ts | 2 +- src/app/shared/error/error.component.ts | 2 +- .../sections/container/section-container.component.ts | 2 +- .../sections/identifiers/section-identifiers.component.ts | 2 +- .../publisher-policy/publisher-policy.component.ts | 2 +- .../sherpa-policies/section-sherpa-policies.component.ts | 2 +- src/app/submission/sections/upload/section-upload.component.ts | 2 +- 21 files changed, 20 insertions(+), 20 deletions(-) rename src/app/shared/alert/{aletr-type.ts => alert-type.ts} (100%) 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 3c0547cca5..693e283b4a 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 @@ -37,7 +37,7 @@ import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component'; import { hasValue, isNotEmpty, hasValueOperator } from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; 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 6425996fd2..238ec5e37a 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 @@ -8,7 +8,7 @@ import { ItemTemplateDataService } from '../../core/data/item-template-data.serv import { getCollectionEditRoute } from '../collection-page-routing-paths'; import { Item } from '../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; -import { AlertType } from '../../shared/alert/aletr-type'; +import { AlertType } from '../../shared/alert/alert-type'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ 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 d67a7ea738..d44817be84 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 @@ -1,5 +1,5 @@ import { Component, Inject, Injector, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'; -import { AlertType } from '../../shared/alert/aletr-type'; +import { AlertType } from '../../shared/alert/alert-type'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { DsoEditMetadataForm } from './dso-edit-metadata-form'; import { map } from 'rxjs/operators'; 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 e212a07289..f2391c9c4c 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 @@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { HealthComponent } from '../../models/health-component.model'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; /** * A component to render a "health component" object. diff --git a/src/app/item-page/alerts/item-alerts.component.ts b/src/app/item-page/alerts/item-alerts.component.ts index d7a84db015..2b1df58c9f 100644 --- a/src/app/item-page/alerts/item-alerts.component.ts +++ b/src/app/item-page/alerts/item-alerts.component.ts @@ -1,6 +1,6 @@ import { Component, Input } from '@angular/core'; import { Item } from '../../core/shared/item.model'; -import { AlertType } from '../../shared/alert/aletr-type'; +import { AlertType } from '../../shared/alert/alert-type'; @Component({ selector: 'ds-item-alerts', 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 18878109c2..3845c03578 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 @@ -5,7 +5,7 @@ import { Item } from '../../../core/shared/item.model'; import { map } from 'rxjs/operators'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { ActivatedRoute } from '@angular/router'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; @Component({ selector: 'ds-item-version-history', 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 6079287f71..3e88826952 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 @@ -15,7 +15,7 @@ import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; import { Item } from '../../../core/shared/item.model'; import { OrcidAuthService } from '../../../core/orcid/orcid-auth.service'; diff --git a/src/app/item-page/versions/item-versions.component.ts b/src/app/item-page/versions/item-versions.component.ts index 700a35552c..e7ee9d5ea2 100644 --- a/src/app/item-page/versions/item-versions.component.ts +++ b/src/app/item-page/versions/item-versions.component.ts @@ -23,7 +23,7 @@ import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { VersionHistoryDataService } from '../../core/data/version-history-data.service'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; -import { AlertType } from '../../shared/alert/aletr-type'; +import { AlertType } from '../../shared/alert/alert-type'; import { followLink } from '../../shared/utils/follow-link-config.model'; import { hasValue, hasValueOperator } from '../../shared/empty.util'; import { PaginationService } from '../../core/pagination/pagination.service'; 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 8a8f5ff76f..0e5e45806b 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 @@ -12,7 +12,7 @@ import { } from '../../../core/shared/operators'; import { map, startWith, switchMap } from 'rxjs/operators'; import { VersionHistoryDataService } from '../../../core/data/version-history-data.service'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; import { getItemPageRoute } from '../../item-page-routing-paths'; @Component({ diff --git a/src/app/process-page/detail/process-detail.component.ts b/src/app/process-page/detail/process-detail.component.ts index a379dfe337..be0b6ad0f6 100644 --- a/src/app/process-page/detail/process-detail.component.ts +++ b/src/app/process-page/detail/process-detail.component.ts @@ -17,7 +17,7 @@ import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { URLCombiner } from '../../core/url-combiner/url-combiner'; -import { AlertType } from '../../shared/alert/aletr-type'; +import { AlertType } from '../../shared/alert/alert-type'; import { hasValue } from '../../shared/empty.util'; import { ProcessStatus } from '../processes/process-status.model'; import { Process } from '../processes/process.model'; 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 ddb77b669c..df7e9bea5e 100644 --- a/src/app/register-email-form/register-email-form.component.ts +++ b/src/app/register-email-form/register-email-form.component.ts @@ -13,7 +13,7 @@ import {isNotEmpty} from '../shared/empty.util'; import {BehaviorSubject, combineLatest, Observable, of, switchMap} from 'rxjs'; import {map, startWith, take} from 'rxjs/operators'; import {CAPTCHA_NAME, GoogleRecaptchaService} from '../core/google-recaptcha/google-recaptcha.service'; -import {AlertType} from '../shared/alert/aletr-type'; +import {AlertType} from '../shared/alert/alert-type'; import {KlaroService} from '../shared/cookies/klaro.service'; import {CookieService} from '../core/services/cookie.service'; import { Subscription } from 'rxjs'; 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 69a598f7ce..cddd1b1a29 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 @@ -15,7 +15,7 @@ import { import { BulkAccessConfigDataService } from '../../core/config/bulk-access-config-data.service'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { BulkAccessConditionOptions } from '../../core/config/models/bulk-access-condition-options.model'; -import { AlertType } from '../alert/aletr-type'; +import { AlertType } from '../alert/alert-type'; import { createAccessControlInitialFormState } from './access-control-form-container-intial-state'; diff --git a/src/app/shared/alert/aletr-type.ts b/src/app/shared/alert/alert-type.ts similarity index 100% rename from src/app/shared/alert/aletr-type.ts rename to src/app/shared/alert/alert-type.ts diff --git a/src/app/shared/alert/alert.component.spec.ts b/src/app/shared/alert/alert.component.spec.ts index 21e4d197b7..11411c7de0 100644 --- a/src/app/shared/alert/alert.component.spec.ts +++ b/src/app/shared/alert/alert.component.spec.ts @@ -8,7 +8,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { AlertComponent } from './alert.component'; import { createTestComponent } from '../testing/utils.test'; -import { AlertType } from './aletr-type'; +import { AlertType } from './alert-type'; describe('AlertComponent test suite', () => { diff --git a/src/app/shared/alert/alert.component.ts b/src/app/shared/alert/alert.component.ts index 93535d2057..07a8efbd7d 100644 --- a/src/app/shared/alert/alert.component.ts +++ b/src/app/shared/alert/alert.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { trigger } from '@angular/animations'; -import { AlertType } from './aletr-type'; +import { AlertType } from './alert-type'; import { fadeOutLeave, fadeOutState } from '../animations/fade'; /** diff --git a/src/app/shared/error/error.component.ts b/src/app/shared/error/error.component.ts index 9a6b0660bb..6572598c8b 100644 --- a/src/app/shared/error/error.component.ts +++ b/src/app/shared/error/error.component.ts @@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { AlertType } from '../alert/aletr-type'; +import { AlertType } from '../alert/alert-type'; @Component({ selector: 'ds-error', diff --git a/src/app/submission/sections/container/section-container.component.ts b/src/app/submission/sections/container/section-container.component.ts index 8f9ebfbfda..3331629f33 100644 --- a/src/app/submission/sections/container/section-container.component.ts +++ b/src/app/submission/sections/container/section-container.component.ts @@ -3,7 +3,7 @@ import { Component, Injector, Input, OnInit, ViewChild } from '@angular/core'; import { SectionsDirective } from '../sections.directive'; import { SectionDataObject } from '../models/section-data.model'; import { rendersSectionType } from '../sections-decorator'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; /** * This component represents a section that contains the submission license form. diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.ts b/src/app/submission/sections/identifiers/section-identifiers.component.ts index 2dc70f668e..ac4af63adb 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.ts @@ -7,7 +7,7 @@ import { SectionModelComponent } from '../models/section.model'; import { renderSectionFor } from '../sections-decorator'; import { SectionDataObject } from '../models/section-data.model'; import { SubmissionService } from '../../submission.service'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; import { SectionsService } from '../sections.service'; import { WorkspaceitemSectionIdentifiersObject } from '../../../core/submission/models/workspaceitem-section-identifiers.model'; 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 96ada3904c..25407f5a7b 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 @@ -1,7 +1,7 @@ import { Component, Input } from '@angular/core'; import { Policy } from '../../../../core/submission/models/sherpa-policies-details.model'; -import { AlertType } from '../../../../shared/alert/aletr-type'; +import { AlertType } from '../../../../shared/alert/alert-type'; /** * This component represents a section that contains the publisher policy informations. 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 e55b75146f..eb273a8420 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 @@ -1,4 +1,4 @@ -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; import { Component, Inject } from '@angular/core'; import { BehaviorSubject, Observable, of, Subscription } from 'rxjs'; diff --git a/src/app/submission/sections/upload/section-upload.component.ts b/src/app/submission/sections/upload/section-upload.component.ts index eefed8a36b..10203adbc0 100644 --- a/src/app/submission/sections/upload/section-upload.component.ts +++ b/src/app/submission/sections/upload/section-upload.component.ts @@ -21,7 +21,7 @@ import { SectionsType } from '../sections-type'; import { renderSectionFor } from '../sections-decorator'; import { SectionDataObject } from '../models/section-data.model'; import { SubmissionObjectEntry } from '../../objects/submission-objects.reducer'; -import { AlertType } from '../../../shared/alert/aletr-type'; +import { AlertType } from '../../../shared/alert/alert-type'; import { RemoteData } from '../../../core/data/remote-data'; import { Group } from '../../../core/eperson/models/group.model'; import { SectionsService } from '../sections.service'; From c9558167b2dc2df22428b8d1fcfbd9b77e4b855e Mon Sep 17 00:00:00 2001 From: Yury Bondarenko Date: Thu, 20 Jul 2023 18:19:48 +0200 Subject: [PATCH 013/101] Move subscription button to DSO edit menu --- .../collection-page.component.html | 3 - .../community-page.component.html | 3 - .../shared/dso-page/dso-edit-menu.resolver.ts | 37 +++++++++ ...so-page-subscription-button.component.html | 8 -- ...so-page-subscription-button.component.scss | 0 ...page-subscription-button.component.spec.ts | 83 ------------------- .../dso-page-subscription-button.component.ts | 57 ------------- src/app/shared/shared.module.ts | 4 - 8 files changed, 37 insertions(+), 158 deletions(-) delete mode 100644 src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.html delete mode 100644 src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.scss delete mode 100644 src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts delete mode 100644 src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts diff --git a/src/app/collection-page/collection-page.component.html b/src/app/collection-page/collection-page.component.html index 02c63d316d..3cbd08f132 100644 --- a/src/app/collection-page/collection-page.component.html +++ b/src/app/collection-page/collection-page.component.html @@ -34,9 +34,6 @@ -
- -
diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html index 6d5262d933..671bf28fd1 100644 --- a/src/app/community-page/community-page.component.html +++ b/src/app/community-page/community-page.component.html @@ -21,9 +21,6 @@ -
- -
diff --git a/src/app/shared/dso-page/dso-edit-menu.resolver.ts b/src/app/shared/dso-page/dso-edit-menu.resolver.ts index 80a69c2830..1ade457840 100644 --- a/src/app/shared/dso-page/dso-edit-menu.resolver.ts +++ b/src/app/shared/dso-page/dso-edit-menu.resolver.ts @@ -21,6 +21,9 @@ import { getDSORoute } from '../../app-routing-paths'; import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service'; import { NotificationsService } from '../notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { SubscriptionModalComponent } from '../subscriptions/subscription-modal/subscription-modal.component'; +import { Community } from '../../core/shared/community.model'; +import { Collection } from '../../core/shared/collection.model'; /** * Creates the menus for the dspace object pages @@ -84,6 +87,7 @@ export class DSOEditMenuResolver implements Resolve<{ [key: string]: MenuSection getDsoMenus(dso, route, state): Observable[] { return [ this.getItemMenu(dso), + this.getComColMenu(dso), this.getCommonMenu(dso, state) ]; } @@ -178,6 +182,39 @@ export class DSOEditMenuResolver implements Resolve<{ [key: string]: MenuSection } } + /** + * Get Community/Collection-specific menus + */ + protected getComColMenu(dso): Observable { + if (dso instanceof Community || dso instanceof Collection) { + return combineLatest([ + this.authorizationService.isAuthorized(FeatureID.CanSubscribe, dso.self), + ]).pipe( + map(([canSubscribe]) => { + return [ + { + id: 'subscribe', + active: false, + visible: canSubscribe, + model: { + type: MenuItemType.ONCLICK, + text: 'subscriptions.tooltip', + function: () => { + const modalRef = this.modalService.open(SubscriptionModalComponent); + modalRef.componentInstance.dso = dso; + } + } as OnClickMenuItemModel, + icon: 'bell', + index: 4 + }, + ]; + }) + ); + } else { + return observableOf([]); + } + } + /** * Claim a researcher by creating a profile * Shows notifications and/or hides the menu section on success/error diff --git a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.html b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.html deleted file mode 100644 index 15135009fc..0000000000 --- a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.html +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.scss b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts deleted file mode 100644 index 726854778d..0000000000 --- a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DsoPageSubscriptionButtonComponent } from './dso-page-subscription-button.component'; -import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; -import { of as observableOf } from 'rxjs'; -import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; -import { Item } from '../../../core/shared/item.model'; -import { ITEM } from '../../../core/shared/item.resource-type'; -import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; -import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; - -describe('DsoPageSubscriptionButtonComponent', () => { - let component: DsoPageSubscriptionButtonComponent; - let fixture: ComponentFixture; - let de: DebugElement; - - const authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: jasmine.createSpy('isAuthorized') // observableOf(true) - }); - - const mockItem = Object.assign(new Item(), { - id: 'fake-id', - uuid: 'fake-id', - handle: 'fake/handle', - lastModified: '2018', - type: ITEM, - _links: { - self: { - href: 'https://localhost:8000/items/fake-id' - } - } - }); - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ - NgbModalModule, - TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ DsoPageSubscriptionButtonComponent ], - providers: [ - { provide: AuthorizationDataService, useValue: authorizationService }, - ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(DsoPageSubscriptionButtonComponent); - component = fixture.componentInstance; - de = fixture.debugElement; - component.dso = mockItem; - }); - - describe('when is authorized', () => { - beforeEach(() => { - authorizationService.isAuthorized.and.returnValue(observableOf(true)); - fixture.detectChanges(); - }); - - it('should display subscription button', () => { - expect(de.query(By.css(' [data-test="subscription-button"]'))).toBeTruthy(); - }); - }); - - describe('when is not authorized', () => { - beforeEach(() => { - authorizationService.isAuthorized.and.returnValue(observableOf(false)); - fixture.detectChanges(); - }); - - it('should not display subscription button', () => { - expect(de.query(By.css(' [data-test="subscription-button"]'))).toBeNull(); - }); - }); -}); diff --git a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts deleted file mode 100644 index 54cd9e6bb0..0000000000 --- a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import { Observable, of } from 'rxjs'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; - -import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; -import { SubscriptionModalComponent } from '../../subscriptions/subscription-modal/subscription-modal.component'; -import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; - -@Component({ - selector: 'ds-dso-page-subscription-button', - templateUrl: './dso-page-subscription-button.component.html', - styleUrls: ['./dso-page-subscription-button.component.scss'] -}) -/** - * Display a button that opens the modal to manage subscriptions - */ -export class DsoPageSubscriptionButtonComponent implements OnInit { - - /** - * Whether the current user is authorized to edit the DSpaceObject - */ - isAuthorized$: Observable = of(false); - - /** - * Reference to NgbModal - */ - public modalRef: NgbModalRef; - - /** - * DSpaceObject that is being viewed - */ - @Input() dso: DSpaceObject; - - constructor( - protected authorizationService: AuthorizationDataService, - private modalService: NgbModal, - ) { - } - - /** - * check if the current DSpaceObject can be subscribed by the user - */ - ngOnInit(): void { - this.isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanSubscribe, this.dso.self); - } - - /** - * Open the modal to subscribe to the related DSpaceObject - */ - public openSubscriptionModal() { - this.modalRef = this.modalService.open(SubscriptionModalComponent); - this.modalRef.componentInstance.dso = this.dso; - } - -} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 0f7871f7f9..c6e2ddc3f3 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -273,9 +273,6 @@ import { AdvancedClaimedTaskActionRatingComponent } from './mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component'; import { ClaimedTaskActionsDeclineTaskComponent } from './mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component'; -import { - DsoPageSubscriptionButtonComponent -} from './dso-page/dso-page-subscription-button/dso-page-subscription-button.component'; import { EpersonGroupListComponent } from './eperson-group-list/eperson-group-list.component'; import { EpersonSearchBoxComponent } from './eperson-group-list/eperson-search-box/eperson-search-box.component'; import { GroupSearchBoxComponent } from './eperson-group-list/group-search-box/group-search-box.component'; @@ -395,7 +392,6 @@ const COMPONENTS = [ ItemPageTitleFieldComponent, ThemedSearchNavbarComponent, ListableNotificationObjectComponent, - DsoPageSubscriptionButtonComponent, MetadataFieldWrapperComponent, ContextHelpWrapperComponent, EpersonGroupListComponent, From b1df1251663b162a6fbc3555bcb5e7cfca4c12b4 Mon Sep 17 00:00:00 2001 From: Mirko Scherf Date: Fri, 21 Jul 2023 10:43:13 +0200 Subject: [PATCH 014/101] fix(i18n): add and update missing status strings New strings for status filter entries: search.filters.namedresourcetype.* Refactored strings introduced with #2068 (refactor badged), e.g. mydspace.status.archived -> mydspace.status.mydspaceArchived --- src/assets/i18n/ar.json5 | 20 ++++++++++---------- src/assets/i18n/bn.json5 | 20 ++++++++++---------- src/assets/i18n/ca.json5 | 20 ++++++++++---------- src/assets/i18n/cs.json5 | 20 ++++++++++---------- src/assets/i18n/de.json5 | 35 +++++++++++++++++++++++++---------- src/assets/i18n/el.json5 | 10 +++++----- src/assets/i18n/en.json5 | 10 ++++++++++ src/assets/i18n/es.json5 | 20 ++++++++++---------- src/assets/i18n/fi.json5 | 20 ++++++++++---------- src/assets/i18n/fr.json5 | 20 ++++++++++---------- src/assets/i18n/gd.json5 | 20 ++++++++++---------- src/assets/i18n/hi.json5 | 10 +++++----- src/assets/i18n/hu.json5 | 20 ++++++++++---------- src/assets/i18n/it.json5 | 20 ++++++++++---------- src/assets/i18n/ja.json5 | 20 ++++++++++---------- src/assets/i18n/kk.json5 | 20 ++++++++++---------- src/assets/i18n/lv.json5 | 20 ++++++++++---------- src/assets/i18n/nl.json5 | 20 ++++++++++---------- src/assets/i18n/pl.json5 | 10 +++++----- src/assets/i18n/pt-BR.json5 | 20 ++++++++++---------- src/assets/i18n/pt-PT.json5 | 20 ++++++++++---------- src/assets/i18n/sv.json5 | 20 ++++++++++---------- src/assets/i18n/sw.json5 | 20 ++++++++++---------- src/assets/i18n/tr.json5 | 20 ++++++++++---------- src/assets/i18n/uk.json5 | 20 ++++++++++---------- src/assets/i18n/vi.json5 | 10 +++++----- 26 files changed, 255 insertions(+), 230 deletions(-) diff --git a/src/assets/i18n/ar.json5 b/src/assets/i18n/ar.json5 index 70f5fdadb1..3069104dd9 100644 --- a/src/assets/i18n/ar.json5 +++ b/src/assets/i18n/ar.json5 @@ -4276,25 +4276,25 @@ // TODO New key - Add a translation "mydspace.show.workspace": "Your Submissions", - // "mydspace.status.archived": "Archived", + // "mydspace.status.mydspaceArchived": "Archived", // TODO New key - Add a translation - "mydspace.status.archived": "Archived", + "mydspace.status.mydspaceArchived": "Archived", - // "mydspace.status.validation": "Validation", + // "mydspace.status.mydspaceValidation": "Validation", // TODO New key - Add a translation - "mydspace.status.validation": "Validation", + "mydspace.status.mydspaceValidation": "Validation", - // "mydspace.status.waiting-for-controller": "Waiting for controller", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", // TODO New key - Add a translation - "mydspace.status.waiting-for-controller": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Waiting for controller", - // "mydspace.status.workflow": "Workflow", + // "mydspace.status.mydspaceWorkflow": "Workflow", // TODO New key - Add a translation - "mydspace.status.workflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Workflow", - // "mydspace.status.workspace": "Workspace", + // "mydspace.status.mydspaceWorkspace": "Workspace", // TODO New key - Add a translation - "mydspace.status.workspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Workspace", // "mydspace.title": "MyDSpace", // TODO New key - Add a translation diff --git a/src/assets/i18n/bn.json5 b/src/assets/i18n/bn.json5 index cc05d12828..c70cc6f459 100644 --- a/src/assets/i18n/bn.json5 +++ b/src/assets/i18n/bn.json5 @@ -3880,20 +3880,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "আপনার জমাগুলো", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "সংরক্ষণাগারভুক্ত", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "সংরক্ষণাগারভুক্ত", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "বৈধতা", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "বৈধতা", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "নিয়ামক জন্য অপেক্ষা করছে", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "নিয়ামক জন্য অপেক্ষা করছে", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "ওয়ার্কফ্লো", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "ওয়ার্কফ্লো", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "কর্মক্ষেত্র", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "কর্মক্ষেত্র", // "mydspace.title": "MyDSpace", "mydspace.title": "আমার ডিস্পেস", diff --git a/src/assets/i18n/ca.json5 b/src/assets/i18n/ca.json5 index 34279548bb..ad8fe49424 100644 --- a/src/assets/i18n/ca.json5 +++ b/src/assets/i18n/ca.json5 @@ -4190,20 +4190,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Els seus enviaments", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Arxivat", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Arxivat", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validació", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validació", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Esperant el controlador", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Esperant el controlador", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Flux de treball", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Flux de treball", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Espai de treball", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Espai de treball", // "mydspace.title": "MyDSpace", "mydspace.title": "El meu DSpace", diff --git a/src/assets/i18n/cs.json5 b/src/assets/i18n/cs.json5 index f3155e9f57..7f9583a50e 100644 --- a/src/assets/i18n/cs.json5 +++ b/src/assets/i18n/cs.json5 @@ -4187,25 +4187,25 @@ // TODO New key - Add a translation "mydspace.show.workspace": "Your Submissions", - // "mydspace.status.archived": "Archived", + // "mydspace.status.mydspaceArchived": "Archived", // TODO New key - Add a translation - "mydspace.status.archived": "Archived", + "mydspace.status.mydspaceArchived": "Archived", - // "mydspace.status.validation": "Validation", + // "mydspace.status.mydspaceValidation": "Validation", // TODO New key - Add a translation - "mydspace.status.validation": "Validation", + "mydspace.status.mydspaceValidation": "Validation", - // "mydspace.status.waiting-for-controller": "Waiting for controller", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", // TODO New key - Add a translation - "mydspace.status.waiting-for-controller": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Waiting for controller", - // "mydspace.status.workflow": "Workflow", + // "mydspace.status.mydspaceWorkflow": "Workflow", // TODO New key - Add a translation - "mydspace.status.workflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Workflow", - // "mydspace.status.workspace": "Workspace", + // "mydspace.status.mydspaceWorkspace": "Workspace", // TODO New key - Add a translation - "mydspace.status.workspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Workspace", // "mydspace.title": "MyDSpace", // TODO New key - Add a translation diff --git a/src/assets/i18n/de.json5 b/src/assets/i18n/de.json5 index b03dc21e5a..4ebce8012d 100644 --- a/src/assets/i18n/de.json5 +++ b/src/assets/i18n/de.json5 @@ -3484,20 +3484,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Ihre Veröffentlichungen", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Archiviert", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Archiviert", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validierung", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validierung", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Warten auf die Überprüfung", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Warten auf die Überprüfung", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Geschäftsgang", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Geschäftsgang", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Arbeitsbereich", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Arbeitsbereich", // "mydspace.title": "MyDSpace", "mydspace.title": "Mein DSpace", @@ -4487,6 +4487,21 @@ // "search.filters.discoverable.false": "Yes", "search.filters.discoverable.false": "Ja", + // "search.filters.namedresourcetype.Archived": "Archived", + "search.filters.namedresourcetype.Archived": "Archiviert", + + // "search.filters.namedresourcetype.Validation": "Validation", + "search.filters.namedresourcetype.Validation": "Validierung", + + // "search.filters.namedresourcetype.Waiting for Controller": "Waiting for Controller", + "search.filters.namedresourcetype.Waiting for Controller": "Warten auf die Überprüfung", + + // "search.filters.namedresourcetype.Workflow": "Workflow", + "search.filters.namedresourcetype.Workflow": "Geschäftsgang", + + // "search.filters.namedresourcetype.Workspace": "Workspace", + "search.filters.namedresourcetype.Workspace": "Arbeitsbereich", + // "search.filters.withdrawn.true": "Yes", "search.filters.withdrawn.true": "Ja", diff --git a/src/assets/i18n/el.json5 b/src/assets/i18n/el.json5 index af8a4fce49..176eadff62 100644 --- a/src/assets/i18n/el.json5 +++ b/src/assets/i18n/el.json5 @@ -1315,11 +1315,11 @@ "mydspace.search-form.placeholder": "Αναζήτηση στο mydspace...", "mydspace.show.workflow": "Εργασίες ροής εργασιών", "mydspace.show.workspace": "Οι Υποβολές σας", - "mydspace.status.archived": "Αρχειοθετημένα", - "mydspace.status.validation": "Επικύρωση", - "mydspace.status.waiting-for-controller": "Αναμονή για τον ελεγκτή", - "mydspace.status.workflow": "Ροή εργασιών", - "mydspace.status.workspace": "Χώρος εργασίας", + "mydspace.status.mydspaceArchived": "Αρχειοθετημένα", + "mydspace.status.mydspaceValidation": "Επικύρωση", + "mydspace.status.mydspaceWaitingController": "Αναμονή για τον ελεγκτή", + "mydspace.status.mydspaceWorkflow": "Ροή εργασιών", + "mydspace.status.mydspaceWorkspace": "Χώρος εργασίας", "mydspace.title": "MyDSpace", "mydspace.upload.upload-failed": "Σφάλμα κατά τη δημιουργία νέου χώρου εργασίας. Επαληθεύστε το περιεχόμενο που ανεβάσατε πριν δοκιμάσετε ξανά.", "mydspace.upload.upload-failed-manyentries": "Μη επεξεργάσιμο αρχείο. Εντοπίστηκαν πάρα πολλές καταχωρίσεις, αλλά επιτρέπεται μόνο μία για αρχείο.", diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 6c91bae4c1..5c17fc8e42 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -3812,6 +3812,16 @@ "search.filters.discoverable.false": "Yes", + "search.filters.namedresourcetype.Archived": "Archived", + + "search.filters.namedresourcetype.Validation": "Validation", + + "search.filters.namedresourcetype.Waiting for Controller": "Waiting for Controller", + + "search.filters.namedresourcetype.Workflow": "Workflow", + + "search.filters.namedresourcetype.Workspace": "Workspace", + "search.filters.withdrawn.true": "Yes", "search.filters.withdrawn.false": "No", diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 7a2f2fa3db..5a0e40af42 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -4560,20 +4560,20 @@ // "mydspace.show.supervisedWorkspace": "Supervised items", "mydspace.show.supervisedWorkspace": "Ítems supervisados", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Archivado", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Archivado", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validación", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validación", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Esperando al controlador", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Esperando al controlador", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Flujo de trabajo", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Flujo de trabajo", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Espacio de trabajo", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Espacio de trabajo", // "mydspace.title": "MyDSpace", "mydspace.title": "Mi DSpace", diff --git a/src/assets/i18n/fi.json5 b/src/assets/i18n/fi.json5 index 62e7e6bffe..4c6116276e 100644 --- a/src/assets/i18n/fi.json5 +++ b/src/assets/i18n/fi.json5 @@ -3261,20 +3261,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Tallennuksesi", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Arkistoitu", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Arkistoitu", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Tarkastaminen", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Tarkastaminen", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Odotetaan tarkastajaa", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Odotetaan tarkastajaa", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Työnkulku", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Työnkulku", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Työtila", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Työtila", // "mydspace.title": "MyDSpace", "mydspace.title": "Oma DSpace", diff --git a/src/assets/i18n/fr.json5 b/src/assets/i18n/fr.json5 index 8ee4dc7d22..699ca5cc27 100644 --- a/src/assets/i18n/fr.json5 +++ b/src/assets/i18n/fr.json5 @@ -3822,20 +3822,20 @@ //"mydspace.show.supervisedWorkspace": "Supervised items", "mydspace.show.supervisedWorkspace": "Items supervisés", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Archivés", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Archivés", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "En cours de validation", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "En cours de validation", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "En attente d'assignation", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "En attente d'assignation", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "En traitement", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "En traitement", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Dépôts en cours", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Dépôts en cours", // "mydspace.title": "MyDSpace", "mydspace.title": "Mon compte DSpace", diff --git a/src/assets/i18n/gd.json5 b/src/assets/i18n/gd.json5 index 6096073d56..55a53bc6f1 100644 --- a/src/assets/i18n/gd.json5 +++ b/src/assets/i18n/gd.json5 @@ -3867,20 +3867,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Do Chur-a-steachan", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "San Tasglann", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "San Tasglann", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Dearbhadh", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Dearbhadh", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "A' feitheamh riaghladair", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "A' feitheamh riaghladair", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Sruth-obrach", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Sruth-obrach", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Raon-obrach", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Raon-obrach", // "mydspace.title": "MyDSpace", "mydspace.title": "MoDSpace", diff --git a/src/assets/i18n/hi.json5 b/src/assets/i18n/hi.json5 index 53fc106187..68eb6c1f12 100644 --- a/src/assets/i18n/hi.json5 +++ b/src/assets/i18n/hi.json5 @@ -2677,15 +2677,15 @@ "mydspace.show.workspace": "आपकी प्रस्तुतियां", - "mydspace.status.archived": "संग्रहीत", + "mydspace.status.mydspaceArchived": "संग्रहीत", - "mydspace.status.validation": "सत्यापन", + "mydspace.status.mydspaceValidation": "सत्यापन", - "mydspace.status.waiting-for-controller": "नियंत्रक की प्रतीक्षा कर रहा है", + "mydspace.status.mydspaceWaitingController": "नियंत्रक की प्रतीक्षा कर रहा है", - "mydspace.status.workflow": "कार्यप्रवाह", + "mydspace.status.mydspaceWorkflow": "कार्यप्रवाह", - "mydspace.status.workspace": "कार्यस्थान", + "mydspace.status.mydspaceWorkspace": "कार्यस्थान", "mydspace.title": "मेरा डीस्पेस", diff --git a/src/assets/i18n/hu.json5 b/src/assets/i18n/hu.json5 index 373d73aec5..e1076c7512 100644 --- a/src/assets/i18n/hu.json5 +++ b/src/assets/i18n/hu.json5 @@ -4983,20 +4983,20 @@ // TODO New key - Add a translation "mydspace.show.supervisedWorkspace": "Supervised items", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Tárolva", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Tárolva", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Érvényesítés", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Érvényesítés", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Várakozás a kontrollerre", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Várakozás a kontrollerre", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Munkafolyamat", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Munkafolyamat", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Munkafelület", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Munkafelület", // "mydspace.title": "MyDSpace", "mydspace.title": "MyDSpace", diff --git a/src/assets/i18n/it.json5 b/src/assets/i18n/it.json5 index 4131d0bee6..1a97eca501 100644 --- a/src/assets/i18n/it.json5 +++ b/src/assets/i18n/it.json5 @@ -4813,20 +4813,20 @@ // TODO New key - Add a translation "mydspace.show.supervisedWorkspace": "Supervised items", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Archiviati", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Archiviati", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Convalida", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Convalida", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "In attesa del controllo", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "In attesa del controllo", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Workflow", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Workflow", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Workspace", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Workspace", // "mydspace.title": "MyDSpace", "mydspace.title": "MyDSpace", diff --git a/src/assets/i18n/ja.json5 b/src/assets/i18n/ja.json5 index 94dfc9aa98..da2385fd62 100644 --- a/src/assets/i18n/ja.json5 +++ b/src/assets/i18n/ja.json5 @@ -4276,25 +4276,25 @@ // TODO New key - Add a translation "mydspace.show.workspace": "Your Submissions", - // "mydspace.status.archived": "Archived", + // "mydspace.status.mydspaceArchived": "Archived", // TODO New key - Add a translation - "mydspace.status.archived": "Archived", + "mydspace.status.mydspaceArchived": "Archived", - // "mydspace.status.validation": "Validation", + // "mydspace.status.mydspaceValidation": "Validation", // TODO New key - Add a translation - "mydspace.status.validation": "Validation", + "mydspace.status.mydspaceValidation": "Validation", - // "mydspace.status.waiting-for-controller": "Waiting for controller", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", // TODO New key - Add a translation - "mydspace.status.waiting-for-controller": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Waiting for controller", - // "mydspace.status.workflow": "Workflow", + // "mydspace.status.mydspaceWorkflow": "Workflow", // TODO New key - Add a translation - "mydspace.status.workflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Workflow", - // "mydspace.status.workspace": "Workspace", + // "mydspace.status.mydspaceWorkspace": "Workspace", // TODO New key - Add a translation - "mydspace.status.workspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Workspace", // "mydspace.title": "MyDSpace", // TODO New key - Add a translation diff --git a/src/assets/i18n/kk.json5 b/src/assets/i18n/kk.json5 index 354eb1104a..d23dc23c47 100644 --- a/src/assets/i18n/kk.json5 +++ b/src/assets/i18n/kk.json5 @@ -4139,20 +4139,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Сіздің өтініштеріңіз", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Мұрағатталған", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Мұрағатталған", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Валидация", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Валидация", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Контроллерді күтуде", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Контроллерді күтуде", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Жұмыс барысы", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Жұмыс барысы", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Жұмыс кеңістігі", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Жұмыс кеңістігі", // "mydspace.title": "MyDSpace", "mydspace.title": "MyDSpace", diff --git a/src/assets/i18n/lv.json5 b/src/assets/i18n/lv.json5 index 9b4058a3e6..81e2383a1f 100644 --- a/src/assets/i18n/lv.json5 +++ b/src/assets/i18n/lv.json5 @@ -3492,20 +3492,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Jūsu Iesniegumi", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Arhivēts", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Arhivēts", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validācija", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validācija", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Gaida kontrolieri", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Gaida kontrolieri", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Darba plūsma", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Darba plūsma", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Darbavieta", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Darbavieta", // "mydspace.title": "MyDSpace", "mydspace.title": "Mans DSpace", diff --git a/src/assets/i18n/nl.json5 b/src/assets/i18n/nl.json5 index 520a8ca427..280a87b96f 100644 --- a/src/assets/i18n/nl.json5 +++ b/src/assets/i18n/nl.json5 @@ -3764,20 +3764,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Uw Submissions", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Opgeslagen", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Opgeslagen", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validatie", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validatie", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Wachten op controlleur", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Wachten op controlleur", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Workflow", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Workflow", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Workspace", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Workspace", // "mydspace.title": "MyDSpace", "mydspace.title": "MyDSpace", diff --git a/src/assets/i18n/pl.json5 b/src/assets/i18n/pl.json5 index d748b94888..3512653705 100644 --- a/src/assets/i18n/pl.json5 +++ b/src/assets/i18n/pl.json5 @@ -1207,11 +1207,11 @@ "mydspace.search-form.placeholder": "Wyszukaj w mydspace...", "mydspace.show.workflow": "Wszystkie zadania", "mydspace.show.workspace": "Twoje zadania", - "mydspace.status.archived": "Zarchiwizowano", - "mydspace.status.validation": "Walidacja", - "mydspace.status.waiting-for-controller": "Oczekiwanie na redaktora", - "mydspace.status.workflow": "Workflow", - "mydspace.status.workspace": "Wersja robocza", + "mydspace.status.mydspaceArchived": "Zarchiwizowano", + "mydspace.status.mydspaceValidation": "Walidacja", + "mydspace.status.mydspaceWaitingController": "Oczekiwanie na redaktora", + "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkspace": "Wersja robocza", "mydspace.title": "Mój DSpace", "mydspace.upload.upload-failed": "Bład podczas tworzenia nowej wersji roboczej. Sprawdź poprawność plików i spróbuj ponownie.", "mydspace.upload.upload-failed-manyentries": "Plik jest niemożliwy do przetworzenia. Wykryto wiele wejść, a dopuszczalne jest tylko jedno dla jednego pliku.", diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 25f1e0fb7c..5d852129bc 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -3972,20 +3972,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Minhas Submissões", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Arquivado", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Arquivado", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validação", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validação", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Esperando pelo controlador", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Esperando pelo controlador", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Fluxo de trabalho", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Fluxo de trabalho", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Espaço de trabalho", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Espaço de trabalho", // "mydspace.title": "MyDSpace", "mydspace.title": "MeuDSpace", diff --git a/src/assets/i18n/pt-PT.json5 b/src/assets/i18n/pt-PT.json5 index a187ff927c..622f8cc48b 100644 --- a/src/assets/i18n/pt-PT.json5 +++ b/src/assets/i18n/pt-PT.json5 @@ -7713,20 +7713,20 @@ // "browse.metadata.srsc": "Subject Category", "browse.metadata.srsc": "vocabulário controlado (SRSC)", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Depositado", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Depositado", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Em validação", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Em validação", - // "mydspace.status.waiting-for-controller": "Waiting for Controller", - "mydspace.status.waiting-for-controller": "Aguarda validador", + // "mydspace.status.mydspaceWaitingController": "Waiting for Controller", + "mydspace.status.mydspaceWaitingController": "Aguarda validador", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Em fluxo de trabalho", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Em fluxo de trabalho", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Depósito por terminar", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Depósito por terminar", // "search.filters.namedresourcetype.Archived": "Archived", "search.filters.namedresourcetype.Archived": "Depositado", diff --git a/src/assets/i18n/sv.json5 b/src/assets/i18n/sv.json5 index c988577c92..4e3576ccfc 100644 --- a/src/assets/i18n/sv.json5 +++ b/src/assets/i18n/sv.json5 @@ -3934,20 +3934,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Dina registreringar", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "I arkivet", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "I arkivet", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Validering", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Validering", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Väntar på kontrollant", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Väntar på kontrollant", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Arbetsflöde", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Arbetsflöde", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "I arbetsflödet", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "I arbetsflödet", // "mydspace.title": "MyDSpace", "mydspace.title": "Mitt DSpace", diff --git a/src/assets/i18n/sw.json5 b/src/assets/i18n/sw.json5 index 47253dea9f..a470ee4b58 100644 --- a/src/assets/i18n/sw.json5 +++ b/src/assets/i18n/sw.json5 @@ -4276,25 +4276,25 @@ // TODO New key - Add a translation "mydspace.show.workspace": "Your Submissions", - // "mydspace.status.archived": "Archived", + // "mydspace.status.mydspaceArchived": "Archived", // TODO New key - Add a translation - "mydspace.status.archived": "Archived", + "mydspace.status.mydspaceArchived": "Archived", - // "mydspace.status.validation": "Validation", + // "mydspace.status.mydspaceValidation": "Validation", // TODO New key - Add a translation - "mydspace.status.validation": "Validation", + "mydspace.status.mydspaceValidation": "Validation", - // "mydspace.status.waiting-for-controller": "Waiting for controller", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", // TODO New key - Add a translation - "mydspace.status.waiting-for-controller": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Waiting for controller", - // "mydspace.status.workflow": "Workflow", + // "mydspace.status.mydspaceWorkflow": "Workflow", // TODO New key - Add a translation - "mydspace.status.workflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Workflow", - // "mydspace.status.workspace": "Workspace", + // "mydspace.status.mydspaceWorkspace": "Workspace", // TODO New key - Add a translation - "mydspace.status.workspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Workspace", // "mydspace.title": "MyDSpace", // TODO New key - Add a translation diff --git a/src/assets/i18n/tr.json5 b/src/assets/i18n/tr.json5 index e9869e0019..153eaa1281 100644 --- a/src/assets/i18n/tr.json5 +++ b/src/assets/i18n/tr.json5 @@ -3257,20 +3257,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Gönderimleriniz", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Arşivlendi", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Arşivlendi", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Doğrulama", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Doğrulama", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Kontrolör bekleniyor", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Kontrolör bekleniyor", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "İş akışı", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "İş akışı", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Çalışma alanı", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Çalışma alanı", // "mydspace.title": "MyDSpace", "mydspace.title": "MyDSpace", diff --git a/src/assets/i18n/uk.json5 b/src/assets/i18n/uk.json5 index 5cbb480179..7df55fa236 100644 --- a/src/assets/i18n/uk.json5 +++ b/src/assets/i18n/uk.json5 @@ -3383,20 +3383,20 @@ // "mydspace.show.workspace": "Your Submissions", "mydspace.show.workspace": "Ваші надіслані документи ", - // "mydspace.status.archived": "Archived", - "mydspace.status.archived": "Заархівовані", + // "mydspace.status.mydspaceArchived": "Archived", + "mydspace.status.mydspaceArchived": "Заархівовані", - // "mydspace.status.validation": "Validation", - "mydspace.status.validation": "Перевірка", + // "mydspace.status.mydspaceValidation": "Validation", + "mydspace.status.mydspaceValidation": "Перевірка", - // "mydspace.status.waiting-for-controller": "Waiting for controller", - "mydspace.status.waiting-for-controller": "Чекаємо контролера", + // "mydspace.status.mydspaceWaitingController": "Waiting for controller", + "mydspace.status.mydspaceWaitingController": "Чекаємо контролера", - // "mydspace.status.workflow": "Workflow", - "mydspace.status.workflow": "Робочий процес", + // "mydspace.status.mydspaceWorkflow": "Workflow", + "mydspace.status.mydspaceWorkflow": "Робочий процес", - // "mydspace.status.workspace": "Workspace", - "mydspace.status.workspace": "Робоче середовище", + // "mydspace.status.mydspaceWorkspace": "Workspace", + "mydspace.status.mydspaceWorkspace": "Робоче середовище", // "mydspace.title": "MyDSpace", "mydspace.title": "Моє середовище", diff --git a/src/assets/i18n/vi.json5 b/src/assets/i18n/vi.json5 index 7627818978..f254df34fe 100644 --- a/src/assets/i18n/vi.json5 +++ b/src/assets/i18n/vi.json5 @@ -1449,11 +1449,11 @@ "mydspace.search-form.placeholder": "Tìm kiếm trong trang cá nhân của tôi...", "mydspace.show.workflow": "Tất cả nhiệm vụ", "mydspace.show.workspace": "Tài liệu của tôi", - "mydspace.status.archived": "Đã lưu trữ", - "mydspace.status.validation": "Đang kiểm tra", - "mydspace.status.waiting-for-controller": "Đợi nhận nhiệm vụ", - "mydspace.status.workflow": "Đang kiểm duyệt", - "mydspace.status.workspace": "Đang biên mục", + "mydspace.status.mydspaceArchived": "Đã lưu trữ", + "mydspace.status.mydspaceValidation": "Đang kiểm tra", + "mydspace.status.mydspaceWaitingController": "Đợi nhận nhiệm vụ", + "mydspace.status.mydspaceWorkflow": "Đang kiểm duyệt", + "mydspace.status.mydspaceWorkspace": "Đang biên mục", "mydspace.title": "Trang cá nhân", "mydspace.upload.upload-failed": "Có lỗi xảy ra khi tạo tài liệu mới. Vui lòng xác minh nội dung đã tải lên trước khi thử lại.", "mydspace.upload.upload-failed-manyentries": "Không thể xử lý tệp tin. Có quá nhiều mục trong khi hệ thống chỉ cho phép một mục trong tệp tin.", From 15656b03ce743461dadc5d093f5347a57f50fa61 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 21 Jul 2023 23:18:40 +0200 Subject: [PATCH 015/101] Fix mathjax code being displayed twice This was due to sanitizeHtml rendering the mjx-assistive-mml tag as text. This tag is used by screen readers and therefor we should allow it to be rendered --- src/app/shared/utils/markdown.pipe.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/shared/utils/markdown.pipe.ts b/src/app/shared/utils/markdown.pipe.ts index e494a82613..90b6d25731 100644 --- a/src/app/shared/utils/markdown.pipe.ts +++ b/src/app/shared/utils/markdown.pipe.ts @@ -67,7 +67,9 @@ export class MarkdownPipe implements PipeTransform { // sanitize-html doesn't let through SVG by default, so we extend its allowlists to cover MathJax SVG allowedTags: [ ...sanitizeHtml.defaults.allowedTags, - 'mjx-container', 'svg', 'g', 'path', 'rect', 'text' + 'mjx-container', 'svg', 'g', 'path', 'rect', 'text', + // Also let the mjx-assistive-mml tag (and it's children) through (for screen readers) + 'mjx-assistive-mml', 'math', 'mrow', 'mi', ], allowedAttributes: { ...sanitizeHtml.defaults.allowedAttributes, @@ -88,7 +90,16 @@ export class MarkdownPipe implements PipeTransform { ], text: [ 'transform', 'font-size' - ] + ], + 'mjx-assistive-mml': [ + 'unselectable', 'display', 'style', + ], + math: [ + 'xmlns', + ], + mrow: [ + 'data-mjx-texclass', + ], }, parser: { lowerCaseAttributeNames: false, From 08ae7bfdbad027c0888624fdbebb1a90704a8112 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 24 Jul 2023 16:10:23 -0500 Subject: [PATCH 016/101] Replace all old docker "dspace-7_x" tags with latest --- Dockerfile.dist | 2 +- docker/README.md | 6 +++--- docker/cli.yml | 2 +- docker/docker-compose-ci.yml | 2 +- docker/docker-compose-dist.yml | 2 +- docker/docker-compose-rest.yml | 4 ++-- docker/docker-compose.yml | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile.dist b/Dockerfile.dist index 2a6a66fc06..e4b467ae26 100644 --- a/Dockerfile.dist +++ b/Dockerfile.dist @@ -2,7 +2,7 @@ # See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details # Test build: -# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-7_x-dist . +# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist . FROM node:18-alpine as build diff --git a/docker/README.md b/docker/README.md index 42deb793f9..08801137b0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -23,14 +23,14 @@ the Docker compose scripts in this 'docker' folder. This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular' ``` -docker build -t dspace/dspace-angular:dspace-7_x . +docker build -t dspace/dspace-angular:latest . ``` This image is built *automatically* after each commit is made to the `main` branch. Admins to our DockerHub repo can manually publish with the following command. ``` -docker push dspace/dspace-angular:dspace-7_x +docker push dspace/dspace-angular:latest ``` ### Dockerfile.dist @@ -39,7 +39,7 @@ The `Dockerfile.dist` is used to generate a *production* build and runtime envir ```bash # build the latest image -docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-7_x-dist . +docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist . ``` A default/demo version of this image is built *automatically*. diff --git a/docker/cli.yml b/docker/cli.yml index 54b83d4503..223ec356b9 100644 --- a/docker/cli.yml +++ b/docker/cli.yml @@ -16,7 +16,7 @@ version: "3.7" services: dspace-cli: - image: "${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-dspace-7_x}" + image: "${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}" container_name: dspace-cli environment: # Below syntax may look odd, but it is how to override dspace.cfg settings via env variables. diff --git a/docker/docker-compose-ci.yml b/docker/docker-compose-ci.yml index 9ec8fe664a..edbb5b0759 100644 --- a/docker/docker-compose-ci.yml +++ b/docker/docker-compose-ci.yml @@ -35,7 +35,7 @@ services: solr__D__statistics__P__autoCommit: 'false' depends_on: - dspacedb - image: dspace/dspace:dspace-7_x-test + image: dspace/dspace:latest-test networks: dspacenet: ports: diff --git a/docker/docker-compose-dist.yml b/docker/docker-compose-dist.yml index 1c75539da9..a9ee4a2656 100644 --- a/docker/docker-compose-dist.yml +++ b/docker/docker-compose-dist.yml @@ -27,7 +27,7 @@ services: DSPACE_REST_HOST: api7.dspace.org DSPACE_REST_PORT: 443 DSPACE_REST_NAMESPACE: /server - image: dspace/dspace-angular:dspace-7_x-dist + image: dspace/dspace-angular:${DSPACE_VER:-latest}-dist build: context: .. dockerfile: Dockerfile.dist diff --git a/docker/docker-compose-rest.yml b/docker/docker-compose-rest.yml index e5f62600e7..ea766600ef 100644 --- a/docker/docker-compose-rest.yml +++ b/docker/docker-compose-rest.yml @@ -39,7 +39,7 @@ services: # proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests # from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above. proxies__P__trusted__P__ipranges: '172.23.0' - image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-test}" + image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}" depends_on: - dspacedb networks: @@ -82,7 +82,7 @@ services: # DSpace Solr container dspacesolr: container_name: dspacesolr - image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-7_x}" + image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}" # Needs main 'dspace' container to start first to guarantee access to solr_configs depends_on: - dspace diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1387b1de39..1071b8d6ce 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -24,7 +24,7 @@ services: DSPACE_REST_HOST: localhost DSPACE_REST_PORT: 8080 DSPACE_REST_NAMESPACE: /server - image: dspace/dspace-angular:dspace-7_x + image: dspace/dspace-angular:${DSPACE_VER:-latest} build: context: .. dockerfile: Dockerfile From 873a8e16a362794eab85d09afa73c9f6c787c169 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Mon, 24 Jul 2023 23:42:55 +0200 Subject: [PATCH 017/101] 101577: Ensure the component is always destroyed before rendering the new component --- src/app/shared/theme-support/themed.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 1df7f77f08..d67efcb5bd 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -60,7 +60,6 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges } ngOnInit(): void { - this.destroyComponentInstance(); this.initComponentInstance(); } @@ -81,8 +80,6 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges } if (hasNoValue(this.lazyLoadObs)) { - this.destroyComponentInstance(); - this.lazyLoadObs = combineLatest([ observableOf(changes), this.resolveThemedComponent(this.themeService.getThemeName()).pipe( @@ -104,6 +101,7 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges } this.lazyLoadSub = this.lazyLoadObs.subscribe(([simpleChanges, constructor]: [SimpleChanges, GenericConstructor]) => { + this.destroyComponentInstance(); const factory = this.resolver.resolveComponentFactory(constructor); this.compRef = this.vcr.createComponent(factory); if (hasValue(simpleChanges)) { From 5062e464337f08031b25b132cbf865a7c38dbfe1 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 19 Jul 2023 15:35:38 +0200 Subject: [PATCH 018/101] 104312: Add missing query @Input() to ThemedDynamicLookupRelationExternalSourceTabComponent --- ...d-dynamic-lookup-relation-external-source-tab.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 637941ce5b..113d902c3d 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 @@ -15,7 +15,7 @@ import { DsDynamicLookupRelationExternalSourceTabComponent } from './dynamic-loo }) export class ThemedDynamicLookupRelationExternalSourceTabComponent extends ThemedComponent { protected inAndOutputNames: (keyof DsDynamicLookupRelationExternalSourceTabComponent & keyof this)[] = ['label', 'listId', - 'item', 'collection', 'relationship', 'context', 'repeatable', 'importedObject', 'externalSource']; + 'item', 'collection', 'relationship', 'context', 'query', 'repeatable', 'importedObject', 'externalSource']; @Input() label: string; @@ -29,6 +29,8 @@ export class ThemedDynamicLookupRelationExternalSourceTabComponent extends Theme @Input() context: Context; + @Input() query: string; + @Input() repeatable: boolean; @Output() importedObject: EventEmitter = new EventEmitter(); From 0ec72f679bb8d1bb7611c1de2125f92cb718b1a9 Mon Sep 17 00:00:00 2001 From: Mirko Scherf Date: Wed, 26 Jul 2023 13:04:04 +0200 Subject: [PATCH 019/101] fix(i18m): curation-task.task.registerdoi.label changed curation-task.task.register-doi.label back to curation-task.task.registerdoi.label and added German translation --- src/assets/i18n/de.json5 | 3 ++- src/assets/i18n/en.json5 | 2 +- src/assets/i18n/es.json5 | 4 ++-- src/assets/i18n/hu.json5 | 4 ++-- src/assets/i18n/it.json5 | 4 ++-- src/assets/i18n/pt-PT.json5 | 4 ++-- src/assets/i18n/vi.json5 | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/assets/i18n/de.json5 b/src/assets/i18n/de.json5 index b03dc21e5a..7fedf4c85e 100644 --- a/src/assets/i18n/de.json5 +++ b/src/assets/i18n/de.json5 @@ -1712,7 +1712,8 @@ // "curation-task.task.vscan.label": "Virus Scan", "curation-task.task.vscan.label": "Virenscan", - + // "curation-task.task.registerdoi.label": "Register DOI", + "curation-task.task.registerdoi.label": "DOI registrieren", // "curation.form.task-select.label": "Task:", "curation.form.task-select.label": "Aufgabe:", diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 6c91bae4c1..165e56f494 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -1392,7 +1392,7 @@ "curation-task.task.vscan.label": "Virus Scan", - "curation-task.task.register-doi.label": "Register DOI", + "curation-task.task.registerdoi.label": "Register DOI", "curation.form.task-select.label": "Task:", diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 7a2f2fa3db..b03b202beb 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -2080,8 +2080,8 @@ // "curation-task.task.vscan.label": "Virus Scan", "curation-task.task.vscan.label": "Búsqueda de virus", - // "curation-task.task.register-doi.label": "Register DOI", - "curation-task.task.register-doi.label": "Registro DOI", + // "curation-task.task.registerdoi.label": "Register DOI", + "curation-task.task.registerdoi.label": "Registro DOI", diff --git a/src/assets/i18n/hu.json5 b/src/assets/i18n/hu.json5 index 373d73aec5..31bb701ee9 100644 --- a/src/assets/i18n/hu.json5 +++ b/src/assets/i18n/hu.json5 @@ -2228,9 +2228,9 @@ // "curation-task.task.vscan.label": "Virus Scan", "curation-task.task.vscan.label": "Virus ellenőrzés", - // "curation-task.task.register-doi.label": "Register DOI", + // "curation-task.task.registerdoi.label": "Register DOI", // TODO New key - Add a translation - "curation-task.task.register-doi.label": "Register DOI", + "curation-task.task.registerdoi.label": "Register DOI", diff --git a/src/assets/i18n/it.json5 b/src/assets/i18n/it.json5 index 4131d0bee6..0e554375a1 100644 --- a/src/assets/i18n/it.json5 +++ b/src/assets/i18n/it.json5 @@ -2160,9 +2160,9 @@ // "curation-task.task.vscan.label": "Virus Scan", "curation-task.task.vscan.label": "Scansione antivirus", - // "curation-task.task.register-doi.label": "Register DOI", + // "curation-task.task.registerdoi.label": "Register DOI", // TODO New key - Add a translation - "curation-task.task.register-doi.label": "Register DOI", + "curation-task.task.registerdoi.label": "Register DOI", diff --git a/src/assets/i18n/pt-PT.json5 b/src/assets/i18n/pt-PT.json5 index a187ff927c..773cb5c3b7 100644 --- a/src/assets/i18n/pt-PT.json5 +++ b/src/assets/i18n/pt-PT.json5 @@ -2054,8 +2054,8 @@ // "curation-task.task.vscan.label": "Virus Scan", "curation-task.task.vscan.label": "Scan de vírus", - // "curation-task.task.register-doi.label": "Register DOI", - "curation-task.task.register-doi.label": "Registo DOI", + // "curation-task.task.registerdoi.label": "Register DOI", + "curation-task.task.registerdoi.label": "Registo DOI", // "curation.form.task-select.label": "Task:", "curation.form.task-select.label": "Tarefa:", diff --git a/src/assets/i18n/vi.json5 b/src/assets/i18n/vi.json5 index 7627818978..2b90ee7ecf 100644 --- a/src/assets/i18n/vi.json5 +++ b/src/assets/i18n/vi.json5 @@ -671,7 +671,7 @@ "curation-task.task.citationpage.label": "Tạo trang trích dẫn", "curation-task.task.noop.label": "NOOP", "curation-task.task.profileformats.label": "Định dạng tệp tin", - "curation-task.task.register-doi.label": "Đăng ký DOI", + "curation-task.task.registerdoi.label": "Đăng ký DOI", "curation-task.task.requiredmetadata.label": "Kiểm tra các trường dữ liệu bắt buộc", "curation-task.task.translate.label": "Bộ dịch của Microsoft", "curation-task.task.vscan.label": "Quét Virus", From 338b63ebb8ed847dfd2d2d872b2bc0a4994c7b83 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 28 Jul 2023 14:10:44 -0500 Subject: [PATCH 020/101] Add action to automatically create a port PR when specified --- .../workflows/port_merged_pull_request.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/port_merged_pull_request.yml diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml new file mode 100644 index 0000000000..50faf3f886 --- /dev/null +++ b/.github/workflows/port_merged_pull_request.yml @@ -0,0 +1,44 @@ +# This workflow will attempt to port a merged pull request to +# the branch specified in a "port to" label (if exists) +name: Port merged Pull Request + +# Only run for merged PRs against the "main" or maintenance branches +# We allow this to run for `pull_request_target` so that github secrets are available +# (This is required when the PR comes from a forked repo) +on: + pull_request_target: + types: [ closed ] + branches: + - main + - 'dspace-**' + +permissions: + contents: write # so action can add comments + pull-requests: write # so action can create pull requests + +jobs: + port_pr: + runs-on: ubuntu-latest + # Don't run on closed *unmerged* pull requests + if: github.event.pull_request.merged + steps: + # Checkout code + - uses: actions/checkout@v3 + # Port PR to other branch (ONLY if labeled with "port to") + # See https://github.com/korthout/backport-action + - name: Create backport pull requests + uses: korthout/backport-action@v1 + with: + # Trigger based on a "port to [branch]" label on PR + # (This label must specify the branch name to port to) + label_pattern: '^port to ([^ ]+)$' + # Title to add to the (newly created) port PR + pull_title: '[Port ${target_branch}] ${pull_title}' + # Description to add to the (newly created) port PR + pull_description: 'Port of #${pull_number} by @${pull_author} to `${target_branch}`.' + # Copy all labels from original PR to (newly created) port PR + # NOTE: The labels matching 'label_pattern' are automatically excluded + copy_labels_pattern: '.*' + # Use a personal access token (PAT) to create PR as 'dspace-bot' user. + # A PAT is required in order for the new PR to trigger its own actions (for CI checks) + github_token: ${{ secrets.PR_PORT_TOKEN }} \ No newline at end of file From d75d12b423206e0261372b372c27c04c36336cff Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 28 Jul 2023 14:11:08 -0500 Subject: [PATCH 021/101] Minor update to label_merge_conflicts to ignore any errors (seem random at this time) --- .github/workflows/label_merge_conflicts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/label_merge_conflicts.yml b/.github/workflows/label_merge_conflicts.yml index 7ea3327741..ccc6c401c0 100644 --- a/.github/workflows/label_merge_conflicts.yml +++ b/.github/workflows/label_merge_conflicts.yml @@ -25,6 +25,8 @@ jobs: # See: https://github.com/prince-chrismc/label-merge-conflicts-action - name: Auto-label PRs with merge conflicts uses: prince-chrismc/label-merge-conflicts-action@v3 + # Ignore any failures -- may occur (randomly?) for older, outdated PRs. + continue-on-error: true # Add "merge conflict" label if a merge conflict is detected. Remove it when resolved. # Note, the authentication token is created automatically # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token From ea677bda741bdccee8422945fb9cd7caa4f1e450 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 30 Jul 2023 19:43:20 +0200 Subject: [PATCH 022/101] Reset to base theme when no default theme is set and leaving UUID/handle theme --- src/app/shared/theme-support/theme.service.ts | 9 +++++---- src/config/config.util.ts | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/shared/theme-support/theme.service.ts b/src/app/shared/theme-support/theme.service.ts index 6d2939a5f8..762aece729 100644 --- a/src/app/shared/theme-support/theme.service.ts +++ b/src/app/shared/theme-support/theme.service.ts @@ -29,7 +29,7 @@ export const themeStateSelector = createFeatureSelector('theme'); export const currentThemeSelector = createSelector( themeStateSelector, - (state: ThemeState): string => hasValue(state) ? state.currentTheme : undefined + (state: ThemeState): string => hasValue(state) ? state.currentTheme : BASE_THEME_NAME, ); @Injectable({ @@ -262,7 +262,7 @@ export class ThemeService { } // inherit the head tags of the default theme - return this.createHeadTags(defaultThemeConfig.name); + return this.createHeadTags(defaultThemeName); } return headTagConfigs.map(this.createHeadTag.bind(this)); @@ -425,9 +425,10 @@ export class ThemeService { * @private */ private getActionForMatch(newTheme: Theme, currentThemeName: string): SetThemeAction | NoOpAction { - if (hasValue(newTheme) && newTheme.config.name !== currentThemeName) { + const newThemeName: string = newTheme?.config.name ?? BASE_THEME_NAME; + if (newThemeName !== currentThemeName) { // If we have a match, and it isn't already the active theme, set it as the new theme - return new SetThemeAction(newTheme.config.name); + return new SetThemeAction(newThemeName); } else { // Otherwise, do nothing return new NoOpAction(); diff --git a/src/config/config.util.ts b/src/config/config.util.ts index c45282269c..cf744b2920 100644 --- a/src/config/config.util.ts +++ b/src/config/config.util.ts @@ -5,7 +5,8 @@ import { environment } from '../environments/environment'; import { hasNoValue } from '../app/shared/empty.util'; import { AppConfig } from './app-config.interface'; -import { ThemeConfig } from './theme.model'; +import { ThemeConfig, NamedThemeConfig } from './theme.model'; +import { BASE_THEME_NAME } from '../app/shared/theme-support/theme.constants'; /** * Extend Angular environment with app config. @@ -44,7 +45,9 @@ const getDefaultThemeConfig = (): ThemeConfig => { hasNoValue(themeConfig.regex) && hasNoValue(themeConfig.handle) && hasNoValue(themeConfig.uuid) - ); + ) ?? { + name: BASE_THEME_NAME, + } as NamedThemeConfig; }; export { From 18b7a9c7de6e399d5ed27ff22caa082ab7e8ef2a Mon Sep 17 00:00:00 2001 From: Yury Bondarenko Date: Mon, 31 Jul 2023 15:41:25 +0200 Subject: [PATCH 023/101] Update DSO edit menu resolver tests - Abstract away the different "subsections" ~ DSO type (the tests should not care about this) Instead, retrieve sections of interest by ID & assert whether they're there & how they should look - Test separately for Communities, Collections & Items - Test newly added menu section --- .../dso-page/dso-edit-menu.resolver.spec.ts | 254 ++++++++++++++---- 1 file changed, 199 insertions(+), 55 deletions(-) diff --git a/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts b/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts index abfe618174..e28a416f23 100644 --- a/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts @@ -1,6 +1,6 @@ import { TestBed, waitForAsync } from '@angular/core/testing'; import { MenuServiceStub } from '../testing/menu-service.stub'; -import { of as observableOf } from 'rxjs'; +import { combineLatest, map, of as observableOf } from 'rxjs'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; @@ -16,10 +16,13 @@ import { Item } from '../../core/shared/item.model'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; import { MenuID } from '../menu/menu-id.model'; import { MenuItemType } from '../menu/menu-item-type.model'; -import { TextMenuItemModel } from '../menu/menu-item/models/text.model'; import { LinkMenuItemModel } from '../menu/menu-item/models/link.model'; import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service'; import { NotificationsService } from '../notifications/notifications.service'; +import { DSpaceObject } from '../../core/shared/dspace-object.model'; +import { Community } from '../../core/shared/community.model'; +import { Collection } from '../../core/shared/collection.model'; +import flatten from 'lodash/flatten'; describe('DSOEditMenuResolver', () => { @@ -37,25 +40,44 @@ describe('DSOEditMenuResolver', () => { let notificationsService; let translate; - const route = { - data: { - menu: { - 'statistics': [{ - id: 'statistics-dummy-1', - active: false, - visible: true, - model: null - }] - } - }, - params: {id: 'test-uuid'}, + const dsoRoute = (dso: DSpaceObject) => { + return { + data: { + menu: { + 'statistics': [{ + id: 'statistics-dummy-1', + active: false, + visible: true, + model: null + }] + } + }, + params: {id: dso.uuid}, + }; }; const state = { url: 'test-url' }; - const testObject = Object.assign(new Item(), {uuid: 'test-uuid', type: 'item', _links: {self: {href: 'self-link'}}}); + const testCommunity: Community = Object.assign(new Community(), { + uuid: 'test-community-uuid', + type: 'community', + _links: {self: {href: 'self-link'}}, + }); + const testCollection: Collection = Object.assign(new Collection(), { + uuid: 'test-collection-uuid', + type: 'collection', + _links: {self: {href: 'self-link'}}, + }); + const testItem: Item = Object.assign(new Item(), { + uuid: 'test-item-uuid', + type: 'item', + _links: {self: {href: 'self-link'}}, + }); + + let testObject: DSpaceObject; + let route; const dummySections1 = [{ id: 'dummy-1', @@ -90,6 +112,10 @@ describe('DSOEditMenuResolver', () => { }]; beforeEach(waitForAsync(() => { + // test with Items unless specified otherwise + testObject = testItem; + route = dsoRoute(testItem); + menuService = new MenuServiceStub(); spyOn(menuService, 'getMenu').and.returnValue(observableOf(MENU_STATE)); @@ -154,16 +180,17 @@ describe('DSOEditMenuResolver', () => { { ...route.data.menu, [MenuID.DSO_EDIT]: [ - ...dummySections1.map((menu) => Object.assign(menu, {id: menu.id + '-test-uuid'})), - ...dummySections2.map((menu) => Object.assign(menu, {id: menu.id + '-test-uuid'})) + ...dummySections1.map((menu) => Object.assign(menu, {id: menu.id + '-test-item-uuid'})), + ...dummySections2.map((menu) => Object.assign(menu, {id: menu.id + '-test-item-uuid'})) ] } ); - expect(dSpaceObjectDataService.findById).toHaveBeenCalledWith('test-uuid', true, false); + expect(dSpaceObjectDataService.findById).toHaveBeenCalledWith('test-item-uuid', true, false); expect(resolver.getDsoMenus).toHaveBeenCalled(); done(); }); }); + it('should create all menus when a dso is found based on the route scope query param when no id param is present', (done) => { spyOn(resolver, 'getDsoMenus').and.returnValue( [observableOf(dummySections1), observableOf(dummySections2)] @@ -198,6 +225,7 @@ describe('DSOEditMenuResolver', () => { done(); }); }); + it('should return the statistics menu when no dso is found', (done) => { (dSpaceObjectDataService.findById as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$()); @@ -211,49 +239,165 @@ describe('DSOEditMenuResolver', () => { }); }); }); + describe('getDsoMenus', () => { - it('should return as first part the item version, orcid and claim list ', (done) => { - const result = resolver.getDsoMenus(testObject, route, state); - result[0].subscribe((menuList) => { - expect(menuList.length).toEqual(3); - expect(menuList[0].id).toEqual('orcid-dso'); - expect(menuList[0].active).toEqual(false); - // Visible should be false due to the item not being of type person - expect(menuList[0].visible).toEqual(false); - expect(menuList[0].model.type).toEqual(MenuItemType.LINK); - - expect(menuList[1].id).toEqual('version-dso'); - expect(menuList[1].active).toEqual(false); - expect(menuList[1].visible).toEqual(true); - expect(menuList[1].model.type).toEqual(MenuItemType.ONCLICK); - expect((menuList[1].model as TextMenuItemModel).text).toEqual('message'); - expect(menuList[1].model.disabled).toEqual(false); - expect(menuList[1].icon).toEqual('code-branch'); - - expect(menuList[2].id).toEqual('claim-dso'); - expect(menuList[2].active).toEqual(false); - // Visible should be false due to the item not being of type person - expect(menuList[2].visible).toEqual(false); - expect(menuList[2].model.type).toEqual(MenuItemType.ONCLICK); - expect((menuList[2].model as TextMenuItemModel).text).toEqual('item.page.claim.button'); - done(); + describe('for Communities', () => { + beforeEach(() => { + testObject = testCommunity; + dSpaceObjectDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(testCommunity)); + route = dsoRoute(testCommunity); }); + it('should not return Item-specific entries', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const orcidEntry = menu.find(entry => entry.id === 'orcid-dso'); + expect(orcidEntry).toBeFalsy(); + + const versionEntry = menu.find(entry => entry.id === 'version-dso'); + expect(versionEntry).toBeFalsy(); + + const claimEntry = menu.find(entry => entry.id === 'claim-dso'); + expect(claimEntry).toBeFalsy(); + + done(); + }); + }); + + it('should return Community/Collection-specific entries', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const subscribeEntry = menu.find(entry => entry.id === 'subscribe'); + expect(subscribeEntry).toBeTruthy(); + expect(subscribeEntry.active).toBeFalse(); + expect(subscribeEntry.visible).toBeTrue(); + expect(subscribeEntry.model.type).toEqual(MenuItemType.ONCLICK); + done(); + }); + }); + + it('should return as third part the common list ', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const editEntry = menu.find(entry => entry.id === 'edit-dso'); + expect(editEntry).toBeTruthy(); + expect(editEntry.active).toBeFalse(); + expect(editEntry.visible).toBeTrue(); + expect(editEntry.model.type).toEqual(MenuItemType.LINK); + expect((editEntry.model as LinkMenuItemModel).link).toEqual( + '/communities/test-community-uuid/edit/metadata' + ); + done(); + }); + }); }); - it('should return as second part the common list ', (done) => { - const result = resolver.getDsoMenus(testObject, route, state); - result[1].subscribe((menuList) => { - expect(menuList.length).toEqual(1); - expect(menuList[0].id).toEqual('edit-dso'); - expect(menuList[0].active).toEqual(false); - expect(menuList[0].visible).toEqual(true); - expect(menuList[0].model.type).toEqual(MenuItemType.LINK); - expect((menuList[0].model as LinkMenuItemModel).text).toEqual('item.page.edit'); - expect((menuList[0].model as LinkMenuItemModel).link).toEqual('/items/test-uuid/edit/metadata'); - expect(menuList[0].icon).toEqual('pencil-alt'); - done(); + + describe('for Collections', () => { + beforeEach(() => { + testObject = testCollection; + dSpaceObjectDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(testCollection)); + route = dsoRoute(testCollection); }); + it('should not return Item-specific entries', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const orcidEntry = menu.find(entry => entry.id === 'orcid-dso'); + expect(orcidEntry).toBeFalsy(); + + const versionEntry = menu.find(entry => entry.id === 'version-dso'); + expect(versionEntry).toBeFalsy(); + + const claimEntry = menu.find(entry => entry.id === 'claim-dso'); + expect(claimEntry).toBeFalsy(); + + done(); + }); + }); + + it('should return Community/Collection-specific entries', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const subscribeEntry = menu.find(entry => entry.id === 'subscribe'); + expect(subscribeEntry).toBeTruthy(); + expect(subscribeEntry.active).toBeFalse(); + expect(subscribeEntry.visible).toBeTrue(); + expect(subscribeEntry.model.type).toEqual(MenuItemType.ONCLICK); + done(); + }); + }); + + it('should return as third part the common list ', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const editEntry = menu.find(entry => entry.id === 'edit-dso'); + expect(editEntry).toBeTruthy(); + expect(editEntry.active).toBeFalse(); + expect(editEntry.visible).toBeTrue(); + expect(editEntry.model.type).toEqual(MenuItemType.LINK); + expect((editEntry.model as LinkMenuItemModel).link).toEqual( + '/collections/test-collection-uuid/edit/metadata' + ); + done(); + }); + }); + }); + + describe('for Items', () => { + beforeEach(() => { + testObject = testItem; + dSpaceObjectDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(testItem)); + route = dsoRoute(testItem); + }); + + it('should return Item-specific entries', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const orcidEntry = menu.find(entry => entry.id === 'orcid-dso'); + expect(orcidEntry).toBeTruthy(); + expect(orcidEntry.active).toBeFalse(); + expect(orcidEntry.visible).toBeFalse(); + expect(orcidEntry.model.type).toEqual(MenuItemType.LINK); + + const versionEntry = menu.find(entry => entry.id === 'version-dso'); + expect(versionEntry).toBeTruthy(); + expect(versionEntry.active).toBeFalse(); + expect(versionEntry.visible).toBeTrue(); + expect(versionEntry.model.type).toEqual(MenuItemType.ONCLICK); + expect(versionEntry.model.disabled).toBeFalse(); + + const claimEntry = menu.find(entry => entry.id === 'claim-dso'); + expect(claimEntry).toBeTruthy(); + expect(claimEntry.active).toBeFalse(); + expect(claimEntry.visible).toBeFalse(); + expect(claimEntry.model.type).toEqual(MenuItemType.ONCLICK); + done(); + }); + }); + + it('should not return Community/Collection-specific entries', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const subscribeEntry = menu.find(entry => entry.id === 'subscribe'); + expect(subscribeEntry).toBeFalsy(); + done(); + }); + }); + + it('should return as third part the common list ', (done) => { + const result = resolver.getDsoMenus(testObject, route, state); + combineLatest(result).pipe(map(flatten)).subscribe((menu) => { + const editEntry = menu.find(entry => entry.id === 'edit-dso'); + expect(editEntry).toBeTruthy(); + expect(editEntry.active).toBeFalse(); + expect(editEntry.visible).toBeTrue(); + expect(editEntry.model.type).toEqual(MenuItemType.LINK); + expect((editEntry.model as LinkMenuItemModel).link).toEqual( + '/items/test-item-uuid/edit/metadata' + ); + done(); + }); + }); }); }); }); From 0b0c60e38c1aecb690f15b1af20df655bd028c5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:23:09 +0000 Subject: [PATCH 024/101] Bump semver from 5.7.1 to 5.7.2 Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 730966fcdb..21de68a480 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10114,33 +10114,33 @@ selfsigned@^2.1.1: dependencies: node-forge "^1" -semver@7.3.8, semver@^7.3.5, semver@^7.3.8: +semver@7.3.8: version "7.3.8" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" semver@^5.3.0, semver@^5.6.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.7: - version "7.4.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.4.0.tgz" - integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== +semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" semver@~7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== send@0.16.2: From 2fec33e70af5de3a2533f4ff33aabaff4aae03fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:28:22 +0000 Subject: [PATCH 025/101] Bump word-wrap from 1.2.3 to 1.2.5 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 730966fcdb..3394bc6456 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11743,9 +11743,9 @@ wildcard@^2.0.0: integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== word-wrap@^1.2.3, word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== wrap-ansi@^6.2.0: version "6.2.0" From 71cf66ecf491870d8abe578408af3a1f7b5077c9 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 2 Aug 2023 00:00:37 +0200 Subject: [PATCH 026/101] Fix display order of authentication methods --- src/app/core/auth/auth.interceptor.ts | 6 +-- src/app/core/auth/auth.reducer.spec.ts | 8 ++-- src/app/core/auth/auth.reducer.ts | 2 +- src/app/core/auth/models/auth.method.ts | 5 ++- .../log-in-container.component.spec.ts | 12 ++++-- src/app/shared/log-in/log-in.component.html | 14 +++---- .../shared/log-in/log-in.component.spec.ts | 2 +- src/app/shared/log-in/log-in.component.ts | 34 +++++++-------- .../methods/oidc/log-in-oidc.component.html | 4 +- .../oidc/log-in-oidc.component.spec.ts | 42 ++++--------------- .../methods/orcid/log-in-orcid.component.html | 4 +- .../orcid/log-in-orcid.component.spec.ts | 39 +++-------------- .../password/log-in-password.component.html | 9 ++++ .../password/log-in-password.component.scss | 4 ++ .../log-in-password.component.spec.ts | 20 ++++----- .../password/log-in-password.component.ts | 25 +++++++---- .../log-in-shibboleth.component.html | 2 +- .../log-in-shibboleth.component.spec.ts | 39 +++-------------- src/app/shared/testing/auth-service.stub.ts | 7 ++-- src/assets/i18n/en.json5 | 2 - 20 files changed, 107 insertions(+), 173 deletions(-) diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index e55d0c0ff9..47ef0b11a5 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -152,12 +152,12 @@ export class AuthInterceptor implements HttpInterceptor { let authMethodModel: AuthMethod; if (splittedRealm.length === 1) { - authMethodModel = new AuthMethod(methodName); + authMethodModel = new AuthMethod(methodName, Number(j)); authMethodModels.push(authMethodModel); } else if (splittedRealm.length > 1) { let location = splittedRealm[1]; location = this.parseLocation(location); - authMethodModel = new AuthMethod(methodName, location); + authMethodModel = new AuthMethod(methodName, Number(j), location); authMethodModels.push(authMethodModel); } } @@ -165,7 +165,7 @@ export class AuthInterceptor implements HttpInterceptor { // make sure the email + password login component gets rendered first authMethodModels = this.sortAuthMethods(authMethodModels); } else { - authMethodModels.push(new AuthMethod(AuthMethodType.Password)); + authMethodModels.push(new AuthMethod(AuthMethodType.Password, 0)); } return authMethodModels; diff --git a/src/app/core/auth/auth.reducer.spec.ts b/src/app/core/auth/auth.reducer.spec.ts index 8ebc9f6cb0..770bcc8691 100644 --- a/src/app/core/auth/auth.reducer.spec.ts +++ b/src/app/core/auth/auth.reducer.spec.ts @@ -575,9 +575,9 @@ describe('authReducer', () => { authMethods: [], idle: false }; - const authMethods = [ - new AuthMethod(AuthMethodType.Password), - new AuthMethod(AuthMethodType.Shibboleth, 'location') + const authMethods: AuthMethod[] = [ + new AuthMethod(AuthMethodType.Password, 0), + new AuthMethod(AuthMethodType.Shibboleth, 1, 'location'), ]; const action = new RetrieveAuthMethodsSuccessAction(authMethods); const newState = authReducer(initialState, action); @@ -609,7 +609,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: false, - authMethods: [new AuthMethod(AuthMethodType.Password)], + authMethods: [new AuthMethod(AuthMethodType.Password, 0)], idle: false }; expect(newState).toEqual(state); diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index acdb8ef812..d09777c60f 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -228,7 +228,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut return Object.assign({}, state, { loading: false, blocking: false, - authMethods: [new AuthMethod(AuthMethodType.Password)] + authMethods: [new AuthMethod(AuthMethodType.Password, 0)] }); case AuthActionTypes.SET_REDIRECT_URL: diff --git a/src/app/core/auth/models/auth.method.ts b/src/app/core/auth/models/auth.method.ts index 0579ae0cd1..b84e7a308a 100644 --- a/src/app/core/auth/models/auth.method.ts +++ b/src/app/core/auth/models/auth.method.ts @@ -2,11 +2,12 @@ import { AuthMethodType } from './auth.method-type'; export class AuthMethod { authMethodType: AuthMethodType; + position: number; location?: string; - // isStandalonePage? = true; + constructor(authMethodName: string, position: number, location?: string) { + this.position = position; - constructor(authMethodName: string, location?: string) { switch (authMethodName) { case 'ip': { this.authMethodType = AuthMethodType.Ip; diff --git a/src/app/shared/log-in/container/log-in-container.component.spec.ts b/src/app/shared/log-in/container/log-in-container.component.spec.ts index 29598e422e..4700cf9307 100644 --- a/src/app/shared/log-in/container/log-in-container.component.spec.ts +++ b/src/app/shared/log-in/container/log-in-container.component.spec.ts @@ -13,13 +13,17 @@ import { AuthMethod } from '../../../core/auth/models/auth.method'; import { AuthServiceStub } from '../../testing/auth-service.stub'; import { createTestComponent } from '../../testing/utils.test'; import { HardRedirectService } from '../../../core/services/hard-redirect.service'; +import { AuthMethodType } from '../../../core/auth/models/auth.method-type'; +import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; +import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; +import { RouterTestingModule } from '@angular/router/testing'; describe('LogInContainerComponent', () => { let component: LogInContainerComponent; let fixture: ComponentFixture; - const authMethod = new AuthMethod('password'); + const authMethod = new AuthMethod(AuthMethodType.Password, 0); let hardRedirectService: HardRedirectService; @@ -35,13 +39,15 @@ describe('LogInContainerComponent', () => { ReactiveFormsModule, StoreModule.forRoot(authReducer), SharedModule, - TranslateModule.forRoot() + TranslateModule.forRoot(), + RouterTestingModule, ], declarations: [ TestComponent ], providers: [ { provide: AuthService, useClass: AuthServiceStub }, + { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: HardRedirectService, useValue: hardRedirectService }, LogInContainerComponent ], @@ -113,6 +119,6 @@ describe('LogInContainerComponent', () => { class TestComponent { isStandalonePage = true; - authMethod = new AuthMethod('password'); + authMethod = new AuthMethod(AuthMethodType.Password, 0); } diff --git a/src/app/shared/log-in/log-in.component.html b/src/app/shared/log-in/log-in.component.html index 6e4685a07b..173e0f8e30 100644 --- a/src/app/shared/log-in/log-in.component.html +++ b/src/app/shared/log-in/log-in.component.html @@ -1,13 +1,11 @@