diff --git a/src/app/access-control/access-control-routing.module.ts b/src/app/access-control/access-control-routing.module.ts index 6f6de6cb26..4366a7cd10 100644 --- a/src/app/access-control/access-control-routing.module.ts +++ b/src/app/access-control/access-control-routing.module.ts @@ -7,10 +7,10 @@ import { GROUP_EDIT_PATH } from './access-control-routing-paths'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { GroupPageGuard } from './group-registry/group-page.guard'; import { - GroupAdministratorGuard + GroupAdministratorGuard, } from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; import { - SiteAdministratorGuard + SiteAdministratorGuard, } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { BulkAccessComponent } from './bulk-access/bulk-access.component'; @@ -21,49 +21,49 @@ import { BulkAccessComponent } from './bulk-access/bulk-access.component'; path: 'epeople', component: EPeopleRegistryComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople' }, - canActivate: [SiteAdministratorGuard] + canActivate: [SiteAdministratorGuard], }, { path: GROUP_EDIT_PATH, component: GroupsRegistryComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups' }, - canActivate: [GroupAdministratorGuard] + canActivate: [GroupAdministratorGuard], }, { path: `${GROUP_EDIT_PATH}/newGroup`, component: GroupFormComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup' }, - canActivate: [GroupAdministratorGuard] + canActivate: [GroupAdministratorGuard], }, { path: `${GROUP_EDIT_PATH}/:groupId`, component: GroupFormComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'admin.access-control.groups.title.singleGroup', breadcrumbKey: 'admin.access-control.groups.singleGroup' }, - canActivate: [GroupPageGuard] + canActivate: [GroupPageGuard], }, { path: 'bulk-access', component: BulkAccessComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access' }, - canActivate: [SiteAdministratorGuard] + canActivate: [SiteAdministratorGuard], }, - ]) - ] + ]), + ], }) /** * Routing module for the AccessControl section of the admin sidebar diff --git a/src/app/access-control/access-control.module.ts b/src/app/access-control/access-control.module.ts index 3dc4b6cedc..a880bf2d34 100644 --- a/src/app/access-control/access-control.module.ts +++ b/src/app/access-control/access-control.module.ts @@ -55,9 +55,9 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher = providers: [ { provide: DYNAMIC_ERROR_MESSAGES_MATCHER, - useValue: ValidateEmailErrorStateMatcher + useValue: ValidateEmailErrorStateMatcher, }, - ] + ], }) /** * This module handles all components related to the access control pages diff --git a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts index 87b2a8d568..6d41c88678 100644 --- a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts +++ b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts @@ -31,13 +31,13 @@ describe('BulkAccessBrowseComponent', () => { imports: [ NgbAccordionModule, NgbNavModule, - TranslateModule.forRoot() + TranslateModule.forRoot(), ], declarations: [BulkAccessBrowseComponent], - providers: [ { provide: SelectableListService, useValue: selectableListService }, ], + providers: [ { provide: SelectableListService, useValue: selectableListService } ], schemas: [ - NO_ERRORS_SCHEMA - ] + NO_ERRORS_SCHEMA, + ], }).compileComponents(); })); @@ -72,7 +72,7 @@ describe('BulkAccessBrowseComponent', () => { 'elementsPerPage': 5, 'totalElements': 2, 'totalPages': 1, - 'currentPage': 1 + 'currentPage': 1, }), [selected1, selected2]) ; const rd = createSuccessfulRemoteDataObject(list); diff --git a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts index e806e729c8..a7bbe6f232 100644 --- a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts +++ b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts @@ -22,9 +22,9 @@ import { hasValue } from '../../../shared/empty.util'; providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } - ] + useClass: SearchConfigurationService, + }, + ], }) export class BulkAccessBrowseComponent implements OnInit, OnDestroy { @@ -49,7 +49,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy { paginationOptions$: BehaviorSubject = new BehaviorSubject(Object.assign(new PaginationComponentOptions(), { id: 'bas', pageSize: 5, - currentPage: 1 + currentPage: 1, })); /** @@ -67,20 +67,20 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy { this.subs.push( this.selectableListService.getSelectableList(this.listId).pipe( distinctUntilChanged(), - map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list)) - ).subscribe(this.objectsSelected$) + map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list)), + ).subscribe(this.objectsSelected$), ); } pageNext() { this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, { - currentPage: this.paginationOptions$.value.currentPage + 1 + currentPage: this.paginationOptions$.value.currentPage + 1, })); } pagePrev() { this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, { - currentPage: this.paginationOptions$.value.currentPage - 1 + currentPage: this.paginationOptions$.value.currentPage - 1, })); } @@ -99,12 +99,12 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy { elementsPerPage: this.paginationOptions$.value.pageSize, totalElements: list?.selection.length, totalPages: this.calculatePageCount(this.paginationOptions$.value.pageSize, list?.selection.length), - currentPage: this.paginationOptions$.value.currentPage + currentPage: this.paginationOptions$.value.currentPage, }); if (pageInfo.currentPage > pageInfo.totalPages) { pageInfo.currentPage = pageInfo.totalPages; this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, { - currentPage: pageInfo.currentPage + currentPage: pageInfo.currentPage, })); } return createSuccessfulRemoteDataObject(buildPaginatedList(pageInfo, list?.selection || [])); diff --git a/src/app/access-control/bulk-access/bulk-access.component.spec.ts b/src/app/access-control/bulk-access/bulk-access.component.spec.ts index e9b253147d..afc469ba80 100644 --- a/src/app/access-control/bulk-access/bulk-access.component.spec.ts +++ b/src/app/access-control/bulk-access/bulk-access.component.spec.ts @@ -31,35 +31,35 @@ describe('BulkAccessComponent', () => { 'startDate': { 'year': 2026, 'month': 5, - 'day': 31 + 'day': 31, }, - 'endDate': null - } + 'endDate': null, + }, ], 'state': { 'item': { 'toggleStatus': true, - 'accessMode': 'replace' + 'accessMode': 'replace', }, 'bitstream': { 'toggleStatus': false, 'accessMode': '', 'changesLimit': '', - 'selectedBitstreams': [] - } - } + 'selectedBitstreams': [], + }, + }, }; const mockFile = { 'uuids': [ - '1234', '5678' + '1234', '5678', ], - 'file': { } + 'file': { }, }; const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', { getValue: jasmine.createSpy('getValue'), - reset: jasmine.createSpy('reset') + reset: jasmine.createSpy('reset'), }); const selection: any[] = [{ indexableObject: { uuid: '1234' } }, { indexableObject: { uuid: '5678' } }]; const selectableListState: SelectableListState = { id: 'test', selection }; @@ -71,15 +71,15 @@ describe('BulkAccessComponent', () => { await TestBed.configureTestingModule({ imports: [ RouterTestingModule, - TranslateModule.forRoot() + TranslateModule.forRoot(), ], declarations: [ BulkAccessComponent ], providers: [ { provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock }, { provide: NotificationsService, useValue: NotificationsServiceStub }, - { provide: SelectableListService, useValue: selectableListServiceMock } + { provide: SelectableListService, useValue: selectableListServiceMock }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); }); diff --git a/src/app/access-control/bulk-access/bulk-access.component.ts b/src/app/access-control/bulk-access/bulk-access.component.ts index 04724614cb..e7095142ca 100644 --- a/src/app/access-control/bulk-access/bulk-access.component.ts +++ b/src/app/access-control/bulk-access/bulk-access.component.ts @@ -11,7 +11,7 @@ import { SelectableListService } from '../../shared/object-list/selectable-list/ @Component({ selector: 'ds-bulk-access', templateUrl: './bulk-access.component.html', - styleUrls: ['./bulk-access.component.scss'] + styleUrls: ['./bulk-access.component.scss'], }) export class BulkAccessComponent implements OnInit { @@ -37,7 +37,7 @@ export class BulkAccessComponent implements OnInit { constructor( private bulkAccessControlService: BulkAccessControlService, - private selectableListService: SelectableListService + private selectableListService: SelectableListService, ) { } @@ -45,8 +45,8 @@ export class BulkAccessComponent implements OnInit { this.subs.push( this.selectableListService.getSelectableList(this.listId).pipe( distinctUntilChanged(), - map((list: SelectableListState) => this.generateIdListBySelectedElements(list)) - ).subscribe(this.objectsSelected$) + map((list: SelectableListState) => this.generateIdListBySelectedElements(list)), + ).subscribe(this.objectsSelected$), ); } @@ -74,12 +74,12 @@ export class BulkAccessComponent implements OnInit { const { file } = this.bulkAccessControlService.createPayloadFile({ bitstreamAccess, itemAccess, - state: settings.state + state: settings.state, }); this.bulkAccessControlService.executeScript( this.objectsSelected$.value || [], - file + file, ).subscribe(); } diff --git a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts index 14e0fdefb2..d09607522e 100644 --- a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts +++ b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts @@ -15,35 +15,35 @@ describe('BulkAccessSettingsComponent', () => { 'startDate': { 'year': 2026, 'month': 5, - 'day': 31 + 'day': 31, }, - 'endDate': null - } + 'endDate': null, + }, ], 'state': { 'item': { 'toggleStatus': true, - 'accessMode': 'replace' + 'accessMode': 'replace', }, 'bitstream': { 'toggleStatus': false, 'accessMode': '', 'changesLimit': '', - 'selectedBitstreams': [] - } - } + 'selectedBitstreams': [], + }, + }, }; const mockControl: any = jasmine.createSpyObj('AccessControlFormContainerComponent', { getFormValue: jasmine.createSpy('getFormValue'), - reset: jasmine.createSpy('reset') + reset: jasmine.createSpy('reset'), }); beforeEach(async () => { await TestBed.configureTestingModule({ imports: [NgbAccordionModule, TranslateModule.forRoot()], declarations: [BulkAccessSettingsComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); }); diff --git a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts index eecc016245..a46d670e52 100644 --- a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts +++ b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts @@ -1,13 +1,13 @@ import { Component, ViewChild } from '@angular/core'; import { - AccessControlFormContainerComponent + AccessControlFormContainerComponent, } from '../../../shared/access-control-form-container/access-control-form-container.component'; @Component({ selector: 'ds-bulk-access-settings', templateUrl: 'bulk-access-settings.component.html', styleUrls: ['./bulk-access-settings.component.scss'], - exportAs: 'dsBulkSettings' + exportAs: 'dsBulkSettings', }) export class BulkAccessSettingsComponent { diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts index a2fb64b39d..b5a7efc0c9 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts @@ -52,7 +52,7 @@ describe('EPeopleRegistryComponent', () => { elementsPerPage: this.allEpeople.length, totalElements: this.allEpeople.length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), this.allEpeople)); }, getActiveEPerson(): Observable { @@ -67,7 +67,7 @@ describe('EPeopleRegistryComponent', () => { elementsPerPage: [result].length, totalElements: [result].length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), [result])); } if (scope === 'metadata') { @@ -76,7 +76,7 @@ describe('EPeopleRegistryComponent', () => { elementsPerPage: this.allEpeople.length, totalElements: this.allEpeople.length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), this.allEpeople)); } const result = this.allEpeople.find((ePerson: EPerson) => { @@ -86,14 +86,14 @@ describe('EPeopleRegistryComponent', () => { elementsPerPage: [result].length, totalElements: [result].length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), [result])); } return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ elementsPerPage: this.allEpeople.length, totalElements: this.allEpeople.length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), this.allEpeople)); }, deleteEPerson(ePerson: EPerson): Observable { @@ -113,10 +113,10 @@ describe('EPeopleRegistryComponent', () => { }, getEPeoplePageRouterLink(): string { return '/access-control/epeople'; - } + }, }; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); builderService = getMockFormBuilderService(); translateService = getMockTranslateService(); @@ -127,8 +127,8 @@ describe('EPeopleRegistryComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [EPeopleRegistryComponent], @@ -139,9 +139,9 @@ describe('EPeopleRegistryComponent', () => { { provide: FormBuilderService, useValue: builderService }, { provide: Router, useValue: new RouterStub() }, { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }, - { provide: PaginationService, useValue: paginationService } + { provide: PaginationService, useValue: paginationService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -209,7 +209,7 @@ describe('EPeopleRegistryComponent', () => { const editButtons = fixture.debugElement.queryAll(By.css('.access-control-editEPersonButton')); editButtons[0].triggerEventHandler('click', { preventDefault: () => {/**/ - } + }, }); tick(); fixture.detectChanges(); @@ -242,7 +242,7 @@ describe('EPeopleRegistryComponent', () => { const deleteButtons = fixture.debugElement.queryAll(By.css('.access-control-deleteEPersonButton')); deleteButtons[0].triggerEventHandler('click', { preventDefault: () => {/**/ - } + }, }); tick(); fixture.detectChanges(); diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.ts b/src/app/access-control/epeople-registry/epeople-registry.component.ts index e632f588a4..d7da87505c 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts @@ -61,7 +61,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'elp', pageSize: 5, - currentPage: 1 + currentPage: 1, }); /** @@ -131,7 +131,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { epersonDtoModel.ableToDelete = authorized; epersonDtoModel.eperson = eperson; return epersonDtoModel; - }) + }), ); })]).pipe(map((dtos: EpersonDtoModel[]) => { return buildPaginatedList(epeople.pageInfo, dtos); @@ -161,14 +161,14 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { const scope: string = data.scope; if (query != null && this.currentSearchQuery !== query) { this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], { - queryParamsHandling: 'merge' + queryParamsHandling: 'merge', }); this.currentSearchQuery = query; this.paginationService.resetPage(this.config.id); } if (scope != null && this.currentSearchScope !== scope) { this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], { - queryParamsHandling: 'merge' + queryParamsHandling: 'merge', }); this.currentSearchScope = scope; this.paginationService.resetPage(this.config.id); @@ -176,15 +176,15 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { } return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, { currentPage: findListOptions.currentPage, - elementsPerPage: findListOptions.pageSize + elementsPerPage: findListOptions.pageSize, }); - } + }, ), getAllSucceededRemoteData(), ).subscribe((peopleRD) => { this.ePeople$.next(peopleRD.payload); this.pageInfoState$.next(peopleRD.payload.pageInfo); - } + }, ); } @@ -194,7 +194,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { */ isActive(eperson: EPerson): Observable { return this.getActiveEPerson().pipe( - map((activeEPerson) => eperson === activeEPerson) + map((activeEPerson) => eperson === activeEPerson), ); } @@ -294,7 +294,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { return this.requestService.setStaleByHrefSubstring(href).pipe( take(1), ); - }) + }), ).subscribe(()=>{ this.epersonService.cancelEditEPerson(); this.isEPersonFormShown = false; diff --git a/src/app/access-control/epeople-registry/epeople-registry.reducers.ts b/src/app/access-control/epeople-registry/epeople-registry.reducers.ts index 1e0319f3ba..3bab6769e1 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.reducers.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.reducers.ts @@ -2,7 +2,7 @@ import { EPerson } from '../../core/eperson/models/eperson.model'; import { EPeopleRegistryAction, EPeopleRegistryActionTypes, - EPeopleRegistryEditEPersonAction + EPeopleRegistryEditEPersonAction, } from './epeople-registry.actions'; /** @@ -30,13 +30,13 @@ export function ePeopleRegistryReducer(state = initialState, action: EPeopleRegi case EPeopleRegistryActionTypes.EDIT_EPERSON: { return Object.assign({}, state, { - editEPerson: (action as EPeopleRegistryEditEPersonAction).eperson + editEPerson: (action as EPeopleRegistryEditEPersonAction).eperson, }); } case EPeopleRegistryActionTypes.CANCEL_EDIT_EPERSON: { return Object.assign({}, state, { - editEPerson: null + editEPerson: null, }); } diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts index b01f810a67..1be0fd711c 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts @@ -106,7 +106,7 @@ describe('EPersonFormComponent', () => { }, getEPersonByEmail(email): Observable> { return createSuccessfulRemoteDataObject$(null); - } + }, }; builderService = Object.assign(getMockFormBuilderService(),{ createFormGroup(formModel, options = null) { @@ -169,7 +169,7 @@ describe('EPersonFormComponent', () => { }, isObject(value) { return typeof value === 'object' && value !== null; - } + }, }); authService = new AuthServiceStub(); authorizationService = jasmine.createSpyObj('authorizationService', { @@ -178,7 +178,7 @@ describe('EPersonFormComponent', () => { }); groupsDataService = jasmine.createSpyObj('groupsDataService', { findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), - getGroupRegistryRouterLink: '' + getGroupRegistryRouterLink: '', }); paginationService = new PaginationServiceStub(); @@ -187,8 +187,8 @@ describe('EPersonFormComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [EPersonFormComponent], @@ -202,14 +202,14 @@ describe('EPersonFormComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])}, { provide: EpersonRegistrationService, useValue: epersonRegistrationService }, - EPeopleRegistryComponent + EPeopleRegistryComponent, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', { - registerEmail: createSuccessfulRemoteDataObject$(null) + registerEmail: createSuccessfulRemoteDataObject$(null), }); beforeEach(() => { @@ -241,12 +241,12 @@ describe('EPersonFormComponent', () => { metadata: { 'eperson.firstname': [ { - value: firstName - } + value: firstName, + }, ], 'eperson.lastname': [ { - value: lastName + value: lastName, }, ], }, @@ -329,7 +329,7 @@ describe('EPersonFormComponent', () => { const ePersonServiceWithEperson = Object.assign(ePersonDataServiceStub,{ getEPersonByEmail(): Observable> { return createSuccessfulRemoteDataObject$(EPersonMock); - } + }, }); component.formGroup.controls.email.setValue('test@test.com'); component.formGroup.controls.email.setAsyncValidators(ValidateEmailNotTaken.createValidator(ePersonServiceWithEperson)); @@ -366,12 +366,12 @@ describe('EPersonFormComponent', () => { metadata: { 'eperson.firstname': [ { - value: firstName - } + value: firstName, + }, ], 'eperson.lastname': [ { - value: lastName + value: lastName, }, ], }, @@ -409,19 +409,19 @@ describe('EPersonFormComponent', () => { metadata: { 'eperson.firstname': [ { - value: firstName - } + value: firstName, + }, ], 'eperson.lastname': [ { - value: lastName + value: lastName, }, ], }, email: email, canLogIn: canLogIn, requireCertificate: requireCertificate, - _links: undefined + _links: undefined, }); spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId)); component.onSubmit(); @@ -443,7 +443,7 @@ describe('EPersonFormComponent', () => { spyOn(authService, 'impersonate').and.callThrough(); ePersonId = 'testEPersonId'; component.epersonInitial = Object.assign(new EPerson(), { - id: ePersonId + id: ePersonId, }); component.impersonate(); }); @@ -531,7 +531,7 @@ describe('EPersonFormComponent', () => { ePersonEmail = 'person.email@4science.it'; component.epersonInitial = Object.assign(new EPerson(), { id: ePersonId, - email: ePersonEmail + email: ePersonEmail, }); component.resetPassword(); }); diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts index b83c8e6cf4..e222917d01 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts @@ -4,7 +4,7 @@ import { DynamicCheckboxModel, DynamicFormControlModel, DynamicFormLayout, - DynamicInputModel + DynamicInputModel, } from '@ng-dynamic-forms/core'; import { TranslateService } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs'; @@ -18,7 +18,7 @@ import { Group } from '../../../core/eperson/models/group.model'; import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; @@ -82,28 +82,28 @@ export class EPersonFormComponent implements OnInit, OnDestroy { formLayout: DynamicFormLayout = { firstName: { grid: { - host: 'row' - } + host: 'row', + }, }, lastName: { grid: { - host: 'row' - } + host: 'row', + }, }, email: { grid: { - host: 'row' - } + host: 'row', + }, }, canLogIn: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, requireCertificate: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, }; @@ -159,7 +159,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'gem', pageSize: 5, - currentPage: 1 + currentPage: 1, }); /** @@ -257,23 +257,23 @@ export class EPersonFormComponent implements OnInit, OnDestroy { required: true, errorMessages: { emailTaken: 'error.validation.emailTaken', - pattern: 'error.validation.NotValidEmail' + pattern: 'error.validation.NotValidEmail', }, - hint: emailHint + hint: emailHint, }); this.canLogIn = new DynamicCheckboxModel( { id: 'canLogIn', label: canLogIn, name: 'canLogIn', - value: (this.epersonInitial != null ? this.epersonInitial.canLogIn : true) + value: (this.epersonInitial != null ? this.epersonInitial.canLogIn : true), }); this.requireCertificate = new DynamicCheckboxModel( { id: 'requireCertificate', label: requireCertificate, name: 'requireCertificate', - value: (this.epersonInitial != null ? this.epersonInitial.requireCertificate : false) + value: (this.epersonInitial != null ? this.epersonInitial.requireCertificate : false), }); this.formModel = [ this.firstName, @@ -287,7 +287,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { if (eperson != null) { this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, { currentPage: 1, - elementsPerPage: this.config.pageSize + elementsPerPage: this.config.pageSize, }); } this.formGroup.patchValue({ @@ -295,7 +295,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { lastName: eperson != null ? eperson.firstMetadataValue('eperson.lastname') : '', email: eperson != null ? eperson.email : '', canLogIn: eperson != null ? eperson.canLogIn : true, - requireCertificate: eperson != null ? eperson.requireCertificate : false + requireCertificate: eperson != null ? eperson.requireCertificate : false, }); if (eperson === null && !!this.formGroup.controls.email) { @@ -312,7 +312,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { switchMap((eperson) => { return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, { currentPage: 1, - elementsPerPage: this.config.pageSize + elementsPerPage: this.config.pageSize, })]); }), switchMap(([eperson, findListOptions]) => { @@ -320,7 +320,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object')); } return observableOf(undefined); - }) + }), ); this.groupsPageInfoState$ = this.groups$.pipe( @@ -334,10 +334,10 @@ export class EPersonFormComponent implements OnInit, OnDestroy { } else { return observableOf(false); } - }) + }), ); this.canDelete$ = activeEPerson$.pipe( - switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)) + switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)), ); this.canReset$ = observableOf(true); }); @@ -364,12 +364,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy { metadata: { 'eperson.firstname': [ { - value: this.firstName.value - } + value: this.firstName.value, + }, ], 'eperson.lastname': [ { - value: this.lastName.value + value: this.lastName.value, }, ], }, @@ -382,7 +382,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { } else { this.editEPerson(ePerson, values); } - } + }, ); } @@ -395,7 +395,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { const response = this.epersonService.create(ePersonToCreate); response.pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ).subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.created.success', { name: this.dsoNameService.getName(ePersonToCreate) })); @@ -419,12 +419,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy { metadata: { 'eperson.firstname': [ { - value: (this.firstName.value ? this.firstName.value : ePerson.firstMetadataValue('eperson.firstname')) - } + value: (this.firstName.value ? this.firstName.value : ePerson.firstMetadataValue('eperson.firstname')), + }, ], 'eperson.lastname': [ { - value: (this.lastName.value ? this.lastName.value : ePerson.firstMetadataValue('eperson.lastname')) + value: (this.lastName.value ? this.lastName.value : ePerson.firstMetadataValue('eperson.lastname')), }, ], }, @@ -457,7 +457,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { onPageChange(event) { this.updateGroups({ currentPage: event, - elementsPerPage: this.config.pageSize + elementsPerPage: this.config.pageSize, }); } @@ -493,15 +493,15 @@ export class EPersonFormComponent implements OnInit, OnDestroy { this.canDelete$ = observableOf(false); return this.epersonService.deleteEPerson(eperson).pipe( getFirstCompletedRemoteData(), - map((restResponse: RemoteData) => ({ restResponse, eperson })) + map((restResponse: RemoteData) => ({ restResponse, eperson })), ); } else { return observableOf(null); } }), - finalize(() => this.canDelete$ = observableOf(true)) + finalize(() => this.canDelete$ = observableOf(true)), ); - }) + }), ).subscribe(({ restResponse, eperson }: { restResponse: RemoteData | null, eperson: EPerson }) => { if (restResponse?.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) })); @@ -535,7 +535,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'), this.translateService.get('forgot-email.form.error.content', {email: this.epersonInitial.email})); } - } + }, ); } } @@ -571,13 +571,13 @@ export class EPersonFormComponent implements OnInit, OnDestroy { // Relevant message for email in use this.subs.push(this.epersonService.searchByScope('email', ePerson.email, { currentPage: 1, - elementsPerPage: 0 + elementsPerPage: 0, }).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload()) .subscribe((list: PaginatedList) => { if (list.totalElements > 0) { this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.' + notificationSection + '.failure.emailInUse', { name: this.dsoNameService.getName(ePerson), - email: ePerson.email + email: ePerson.email, })); } })); diff --git a/src/app/access-control/epeople-registry/eperson-form/validators/email-taken.validator.ts b/src/app/access-control/epeople-registry/eperson-form/validators/email-taken.validator.ts index c3c5e60a0f..0cef96df85 100644 --- a/src/app/access-control/epeople-registry/eperson-form/validators/email-taken.validator.ts +++ b/src/app/access-control/epeople-registry/eperson-form/validators/email-taken.validator.ts @@ -3,7 +3,7 @@ import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { EPersonDataService } from '../../../../core/eperson/eperson-data.service'; -import { getFirstSucceededRemoteData, } from '../../../../core/shared/operators'; +import { getFirstSucceededRemoteData } from '../../../../core/shared/operators'; export class ValidateEmailNotTaken { @@ -18,7 +18,7 @@ export class ValidateEmailNotTaken { getFirstSucceededRemoteData(), map(res => { return res.payload ? { emailTaken: true } : null; - }) + }), ); }; } diff --git a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts index 7540ae0393..c0bdee1a33 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts @@ -65,8 +65,8 @@ describe('GroupFormComponent', () => { metadata: { 'dc.description': [ { - value: groupDescription - } + value: groupDescription, + }, ], }, }); @@ -105,7 +105,7 @@ describe('GroupFormComponent', () => { create(group: Group): Observable> { this.allGroups = [...this.allGroups, group]; this.createdGroup = Object.assign({}, group, { - _links: { self: { href: 'group-selflink' } } + _links: { self: { href: 'group-selflink' } }, }); return createSuccessfulRemoteDataObject$(this.createdGroup); }, @@ -114,15 +114,15 @@ describe('GroupFormComponent', () => { }, getGroupEditPageRouterLinkWithID(id: string) { return `group-edit-page-for-${id}`; - } + }, }; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); dsoDataServiceStub = { findByHref(href: string): Observable> { return null; - } + }, }; builderService = Object.assign(getMockFormBuilderService(),{ createFormGroup(formModel, options = null) { @@ -185,7 +185,7 @@ describe('GroupFormComponent', () => { }, isObject(value) { return typeof value === 'object' && value !== null; - } + }, }); translateService = getMockTranslateService(); router = new RouterMock(); @@ -195,8 +195,8 @@ describe('GroupFormComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [GroupFormComponent], @@ -216,12 +216,12 @@ describe('GroupFormComponent', () => { { provide: HALEndpointService, useValue: {} }, { provide: ActivatedRoute, - useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) } + useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) }, }, { provide: Router, useValue: router }, { provide: AuthorizationDataService, useValue: authorizationService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -257,8 +257,8 @@ describe('GroupFormComponent', () => { metadata: { 'dc.description': [ { - value: groupDescription - } + value: groupDescription, + }, ], }, }); @@ -273,11 +273,11 @@ describe('GroupFormComponent', () => { const operations = [{ op: 'add', path: '/metadata/dc.description', - value: 'testDescription' + value: 'testDescription', }, { op: 'replace', path: '/name', - value: 'newGroupName' + value: 'newGroupName', }]; expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations); }); @@ -289,7 +289,7 @@ describe('GroupFormComponent', () => { const operations = [{ op: 'add', path: '/metadata/dc.description', - value: 'testDescription' + value: 'testDescription', }]; expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations); }); @@ -301,7 +301,7 @@ describe('GroupFormComponent', () => { const operations = [{ op: 'replace', path: '/name', - value: 'newGroupName' + value: 'newGroupName', }]; expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations); }); @@ -338,8 +338,8 @@ describe('GroupFormComponent', () => { metadata: { 'dc.description': [ { - value: groupDescription - } + value: groupDescription, + }, ], }, }); @@ -376,7 +376,7 @@ describe('GroupFormComponent', () => { const groupsDataServiceStubWithGroup = Object.assign(groupsDataServiceStub,{ searchGroups(query: string): Observable>> { return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [expected])); - } + }, }); component.formGroup.controls.groupName.setValue('testName'); component.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(groupsDataServiceStubWithGroup)); @@ -400,7 +400,7 @@ describe('GroupFormComponent', () => { component.canEdit$ = observableOf(true); component.groupBeingEdited = { - permanent: false + permanent: false, } as Group; fixture.detectChanges(); 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 4f85f13b1c..b1e3916ec0 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 @@ -6,7 +6,7 @@ import { DynamicFormControlModel, DynamicFormLayout, DynamicInputModel, - DynamicTextAreaModel + DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; import { TranslateService } from '@ngx-translate/core'; import { @@ -35,7 +35,7 @@ import { getRemoteDataPayload, getFirstSucceededRemoteData, getFirstCompletedRemoteData, - getFirstSucceededRemoteDataPayload + getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; import { AlertType } from '../../../shared/alert/aletr-type'; import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component'; @@ -51,7 +51,7 @@ import { environment } from '../../../../environments/environment'; @Component({ selector: 'ds-group-form', - templateUrl: './group-form.component.html' + templateUrl: './group-form.component.html', }) /** * A form used for creating and editing groups @@ -83,13 +83,13 @@ export class GroupFormComponent implements OnInit, OnDestroy { formLayout: DynamicFormLayout = { groupName: { grid: { - host: 'row' - } + host: 'row', + }, }, groupDescription: { grid: { - host: 'row' - } + host: 'row', + }, }, }; @@ -171,12 +171,12 @@ export class GroupFormComponent implements OnInit, OnDestroy { (isAuthorized: ObservedValueOf>, hasLinkedDSO: ObservedValueOf>) => { return isAuthorized && !hasLinkedDSO; }); - }) + }), ); observableCombineLatest( this.translateService.get(`${this.messagePrefix}.groupName`), this.translateService.get(`${this.messagePrefix}.groupCommunity`), - this.translateService.get(`${this.messagePrefix}.groupDescription`) + this.translateService.get(`${this.messagePrefix}.groupDescription`), ).subscribe(([groupName, groupCommunity, groupDescription]) => { this.groupName = new DynamicInputModel({ id: 'groupName', @@ -219,7 +219,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { this.groupDataService.getActiveGroup(), this.canEdit$, this.groupDataService.getActiveGroup() - .pipe(filter((activeGroup) => hasValue(activeGroup)),switchMap((activeGroup) => this.getLinkedDSO(activeGroup).pipe(getFirstSucceededRemoteDataPayload()))) + .pipe(filter((activeGroup) => hasValue(activeGroup)),switchMap((activeGroup) => this.getLinkedDSO(activeGroup).pipe(getFirstSucceededRemoteDataPayload()))), ).subscribe(([activeGroup, canEdit, linkedObject]) => { if (activeGroup != null) { @@ -252,7 +252,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { } }, 200); } - }) + }), ); }); } @@ -280,9 +280,9 @@ export class GroupFormComponent implements OnInit, OnDestroy { metadata: { 'dc.description': [ { - value: this.groupDescription.value - } - ] + value: this.groupDescription.value, + }, + ], }, }; if (group === null) { @@ -290,7 +290,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { } else { this.editGroup(group); } - } + }, ); } @@ -301,7 +301,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { createNewGroup(values) { const groupToCreate = Object.assign(new Group(), values); this.groupDataService.create(groupToCreate).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ).subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.created.success', { name: groupToCreate.name })); @@ -330,7 +330,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { // Relevant message for group name in use this.subs.push(this.groupDataService.searchGroups(group.name, { currentPage: 1, - elementsPerPage: 0 + elementsPerPage: 0, }).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload()) .subscribe((list: PaginatedList) => { if (list.totalElements > 0) { @@ -352,7 +352,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { operations = [...operations, { op: 'add', path: '/metadata/dc.description', - value: this.groupDescription.value + value: this.groupDescription.value, }]; } @@ -360,12 +360,12 @@ export class GroupFormComponent implements OnInit, OnDestroy { operations = [...operations, { op: 'replace', path: '/name', - value: this.groupName.value + value: this.groupName.value, }]; } this.groupDataService.patch(group, operations).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ).subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.edited.success', { name: this.dsoNameService.getName(rd.payload) })); @@ -504,7 +504,7 @@ export class GroupFormComponent implements OnInit, OnDestroy { return getCollectionEditRolesRoute(rd.payload.id); } } - }) + }), ); } } diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts index 7c8db399bc..5f165cc7c1 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts @@ -72,7 +72,7 @@ describe('MembersListComponent', () => { }, getEPeoplePageRouterLink(): string { return '/access-control/epeople'; - } + }, }; groupsDataServiceStub = { activeGroup: activeGroup, @@ -114,7 +114,7 @@ describe('MembersListComponent', () => { this.epersonMembers = []; } return observableOf(new RestResponse(true, 200, 'Success')); - } + }, }; builderService = getMockFormBuilderService(); translateService = getMockTranslateService(); @@ -125,8 +125,8 @@ describe('MembersListComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [MembersListComponent], @@ -139,7 +139,7 @@ describe('MembersListComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: DSONameService, useValue: new DSONameServiceMock() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts index 0e0ef05d77..8b03909006 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts @@ -21,7 +21,7 @@ import { getFirstSucceededRemoteData, getFirstCompletedRemoteData, getAllCompletedRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../../../core/shared/operators'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; @@ -69,7 +69,7 @@ export interface EPersonListActionConfig { @Component({ selector: 'ds-members-list', - templateUrl: './members-list.component.html' + templateUrl: './members-list.component.html', }) /** * The list of members in the edit group page @@ -89,7 +89,7 @@ export class MembersListComponent implements OnInit, OnDestroy { remove: { css: 'btn-outline-danger', disabled: false, - icon: 'fas fa-trash-alt fa-fw' + icon: 'fas fa-trash-alt fa-fw', }, }; @@ -108,7 +108,7 @@ export class MembersListComponent implements OnInit, OnDestroy { configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'sml', pageSize: 5, - currentPage: 1 + currentPage: 1, }); /** * Pagination config used to display the list of EPerson Membes of active group being edited @@ -116,7 +116,7 @@ export class MembersListComponent implements OnInit, OnDestroy { config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'ml', pageSize: 5, - currentPage: 1 + currentPage: 1, }); /** @@ -177,8 +177,8 @@ export class MembersListComponent implements OnInit, OnDestroy { switchMap((currentPagination) => { return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, { currentPage: currentPagination.currentPage, - elementsPerPage: currentPagination.pageSize - } + elementsPerPage: currentPagination.pageSize, + }, ); }), getAllCompletedRemoteData(), @@ -219,7 +219,7 @@ export class MembersListComponent implements OnInit, OnDestroy { if (group != null) { return this.ePersonDataService.findListByHref(group._links.epersons.href, { currentPage: 1, - elementsPerPage: 9999 + elementsPerPage: 9999, }) .pipe( getFirstSucceededRemoteData(), @@ -292,14 +292,14 @@ export class MembersListComponent implements OnInit, OnDestroy { const scope: string = data.scope; if (query != null && this.currentSearchQuery !== query && this.groupBeingEdited) { this.router.navigate([], { - queryParamsHandling: 'merge' + queryParamsHandling: 'merge', }); this.currentSearchQuery = query; this.paginationService.resetPage(this.configSearch.id); } if (scope != null && this.currentSearchScope !== scope && this.groupBeingEdited) { this.router.navigate([], { - queryParamsHandling: 'merge' + queryParamsHandling: 'merge', }); this.currentSearchScope = scope; this.paginationService.resetPage(this.configSearch.id); @@ -308,7 +308,7 @@ export class MembersListComponent implements OnInit, OnDestroy { return this.ePersonDataService.searchByScope(this.currentSearchScope, this.currentSearchQuery, { currentPage: paginationOptions.currentPage, - elementsPerPage: paginationOptions.pageSize + elementsPerPage: paginationOptions.pageSize, }); }), getAllCompletedRemoteData(), diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts index ac5750dcac..6667b3f0c3 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts @@ -19,7 +19,7 @@ import { GroupMock, GroupMock2 } from '../../../../shared/testing/group-mock'; import { SubgroupsListComponent } from './subgroups-list.component'; import { createSuccessfulRemoteDataObject$, - createSuccessfulRemoteDataObject + createSuccessfulRemoteDataObject, } from '../../../../shared/remote-data.utils'; import { RouterMock } from '../../../../shared/mocks/router.mock'; import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; @@ -63,7 +63,7 @@ describe('SubgroupsListComponent', () => { return this.subgroups$.pipe( map((currentGroups: Group[]) => { return createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), currentGroups)); - }) + }), ); }, getGroupEditPageRouterLink(group: Group): string { @@ -92,7 +92,7 @@ describe('SubgroupsListComponent', () => { } })); return observableOf(new RestResponse(true, 200, 'Success')); - } + }, }; routerStub = new RouterMock(); builderService = getMockFormBuilderService(); @@ -104,8 +104,8 @@ describe('SubgroupsListComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [SubgroupsListComponent], @@ -117,7 +117,7 @@ describe('SubgroupsListComponent', () => { { provide: Router, useValue: routerStub }, { provide: PaginationService, useValue: paginationService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -153,7 +153,7 @@ describe('SubgroupsListComponent', () => { const addButton = fixture.debugElement.query(By.css('#subgroupsOfGroup tbody .deleteButton')); addButton.triggerEventHandler('click', { preventDefault: () => {/**/ - } + }, }); tick(); fixture.detectChanges(); diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts index dbd5da162c..bbdd2a8fb9 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts @@ -11,7 +11,7 @@ import { Group } from '../../../../core/eperson/models/group.model'; import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../../../core/shared/operators'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; @@ -32,7 +32,7 @@ enum SubKey { @Component({ selector: 'ds-subgroups-list', - templateUrl: './subgroups-list.component.html' + templateUrl: './subgroups-list.component.html', }) /** * The list of subgroups in the edit group page @@ -64,7 +64,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'ssgl', pageSize: 5, - currentPage: 1 + currentPage: 1, }); /** * Pagination config used to display the list of subgroups of currently active group being edited @@ -72,7 +72,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'sgl', pageSize: 5, - currentPage: 1 + currentPage: 1, }); // The search form @@ -126,12 +126,12 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( switchMap((config) => this.groupDataService.findListByHref(this.groupBeingEdited._links.subgroups.href, { currentPage: config.currentPage, - elementsPerPage: config.pageSize + elementsPerPage: config.pageSize, }, true, true, - followLink('object') - )) + followLink('object'), + )), ).subscribe((rd: RemoteData>) => { this.subGroups$.next(rd); })); @@ -150,7 +150,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { } else { return this.groupDataService.findListByHref(activeGroup._links.subgroups.href, { currentPage: 1, - elementsPerPage: 9999 + elementsPerPage: 9999, }) .pipe( getFirstSucceededRemoteData(), @@ -229,9 +229,9 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { this.subs.set(SubKey.SearchResults, this.paginationService.getCurrentPagination(this.configSearch.id, this.configSearch).pipe( switchMap((config) => this.groupDataService.searchGroups(this.currentSearchQuery, { currentPage: config.currentPage, - elementsPerPage: config.pageSize - }, true, true, followLink('object') - )) + elementsPerPage: config.pageSize, + }, true, true, followLink('object'), + )), ).subscribe((rd: RemoteData>) => { this.searchResults$.next(rd); })); diff --git a/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts b/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts index 421242d2b1..02e7b7079f 100644 --- a/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts +++ b/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts @@ -17,7 +17,7 @@ export class ValidateGroupExists { return (control: AbstractControl): Promise | Observable => { return groupDataService.searchGroups(control.value, { currentPage: 1, - elementsPerPage: 100 + elementsPerPage: 100, }) .pipe( getFirstSucceededRemoteListPayload(), diff --git a/src/app/access-control/group-registry/group-page.guard.spec.ts b/src/app/access-control/group-registry/group-page.guard.spec.ts index 48fa124c07..172fafc894 100644 --- a/src/app/access-control/group-registry/group-page.guard.spec.ts +++ b/src/app/access-control/group-registry/group-page.guard.spec.ts @@ -13,7 +13,7 @@ describe('GroupPageGuard', () => { const routeSnapshotWithGroupId = { params: { groupId: groupUuid, - } + }, } as unknown as ActivatedRouteSnapshot; let guard: GroupPageGuard; @@ -50,10 +50,10 @@ describe('GroupPageGuard', () => { it('should return true', (done) => { guard.canActivate( - routeSnapshotWithGroupId, { url: 'current-url'} as any + routeSnapshotWithGroupId, { url: 'current-url'} as any, ).subscribe((result) => { expect(authorizationService.isAuthorized).toHaveBeenCalledWith( - FeatureID.CanManageGroup, groupEndpointUrl, undefined + FeatureID.CanManageGroup, groupEndpointUrl, undefined, ); expect(result).toBeTrue(); done(); @@ -68,10 +68,10 @@ describe('GroupPageGuard', () => { it('should not return true', (done) => { guard.canActivate( - routeSnapshotWithGroupId, { url: 'current-url'} as any + routeSnapshotWithGroupId, { url: 'current-url'} as any, ).subscribe((result) => { expect(authorizationService.isAuthorized).toHaveBeenCalledWith( - FeatureID.CanManageGroup, groupEndpointUrl, undefined + FeatureID.CanManageGroup, groupEndpointUrl, undefined, ); expect(result).not.toBeTrue(); done(); diff --git a/src/app/access-control/group-registry/group-page.guard.ts b/src/app/access-control/group-registry/group-page.guard.ts index 057f67ddeb..d7bdf509c3 100644 --- a/src/app/access-control/group-registry/group-page.guard.ts +++ b/src/app/access-control/group-registry/group-page.guard.ts @@ -9,7 +9,7 @@ import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; import { map } from 'rxjs/operators'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class GroupPageGuard extends SomeFeatureAuthorizationGuard { @@ -28,7 +28,7 @@ export class GroupPageGuard extends SomeFeatureAuthorizationGuard { getObjectUrl(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { return this.halEndpointService.getEndpoint(this.groupsEndpoint).pipe( - map(groupsUrl => `${groupsUrl}/${route?.params?.groupId}`) + map(groupsUrl => `${groupsUrl}/${route?.params?.groupId}`), ); } diff --git a/src/app/access-control/group-registry/group-registry.reducers.ts b/src/app/access-control/group-registry/group-registry.reducers.ts index 8e288b7f3a..9bebda5db2 100644 --- a/src/app/access-control/group-registry/group-registry.reducers.ts +++ b/src/app/access-control/group-registry/group-registry.reducers.ts @@ -27,13 +27,13 @@ export function groupRegistryReducer(state = initialState, action: GroupRegistry case GroupRegistryActionTypes.EDIT_GROUP: { return Object.assign({}, state, { - editGroup: (action as GroupRegistryEditGroupAction).group + editGroup: (action as GroupRegistryEditGroupAction).group, }); } case GroupRegistryActionTypes.CANCEL_EDIT_GROUP: { return Object.assign({}, state, { - editGroup: null + editGroup: null, }); } diff --git a/src/app/access-control/group-registry/groups-registry.component.spec.ts b/src/app/access-control/group-registry/groups-registry.component.spec.ts index 635ba727c2..4a0ef67038 100644 --- a/src/app/access-control/group-registry/groups-registry.component.spec.ts +++ b/src/app/access-control/group-registry/groups-registry.component.spec.ts @@ -78,24 +78,24 @@ describe('GroupsRegistryComponent', () => { elementsPerPage: 1, totalElements: 0, totalPages: 0, - currentPage: 1 + currentPage: 1, }), [])); case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/epersons': return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ elementsPerPage: 1, totalElements: 1, totalPages: 1, - currentPage: 1 + currentPage: 1, }), [EPersonMock])); default: return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ elementsPerPage: 1, totalElements: 0, totalPages: 0, - currentPage: 1 + currentPage: 1, }), [])); } - } + }, }; groupsDataServiceStub = { allGroups: mockGroups, @@ -106,21 +106,21 @@ describe('GroupsRegistryComponent', () => { elementsPerPage: 1, totalElements: 0, totalPages: 0, - currentPage: 1 + currentPage: 1, }), [])); case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/groups': return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ elementsPerPage: 1, totalElements: 1, totalPages: 1, - currentPage: 1 + currentPage: 1, }), [GroupMock2])); default: return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ elementsPerPage: 1, totalElements: 0, totalPages: 0, - currentPage: 1 + currentPage: 1, }), [])); } }, @@ -136,7 +136,7 @@ describe('GroupsRegistryComponent', () => { elementsPerPage: this.allGroups.length, totalElements: this.allGroups.length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), this.allGroups)); } const result = this.allGroups.find((group: Group) => { @@ -146,7 +146,7 @@ describe('GroupsRegistryComponent', () => { elementsPerPage: [result].length, totalElements: [result].length, totalPages: 1, - currentPage: 1 + currentPage: 1, }), [result])); }, delete(objectId: string, copyVirtualMetadata?: string[]): Observable> { @@ -156,7 +156,7 @@ describe('GroupsRegistryComponent', () => { dsoDataServiceStub = { findByHref(href: string): Observable> { return createSuccessfulRemoteDataObject$(undefined); - } + }, }; authorizationService = jasmine.createSpyObj('authorizationService', ['isAuthorized']); @@ -167,8 +167,8 @@ describe('GroupsRegistryComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [GroupsRegistryComponent], @@ -182,9 +182,9 @@ describe('GroupsRegistryComponent', () => { { provide: Router, useValue: new RouterMock() }, { provide: AuthorizationDataService, useValue: authorizationService }, { provide: PaginationService, useValue: paginationService }, - { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) } + { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -237,16 +237,16 @@ describe('GroupsRegistryComponent', () => { it('should not check the canManageGroup permissions', () => { expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith( - FeatureID.CanManageGroup, mockGroups[0].self + FeatureID.CanManageGroup, mockGroups[0].self, ); expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith( - FeatureID.CanManageGroup, mockGroups[0].self, undefined // treated differently + FeatureID.CanManageGroup, mockGroups[0].self, undefined, // treated differently ); expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith( - FeatureID.CanManageGroup, mockGroups[1].self + FeatureID.CanManageGroup, mockGroups[1].self, ); expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith( - FeatureID.CanManageGroup, mockGroups[1].self, undefined // treated differently + FeatureID.CanManageGroup, mockGroups[1].self, undefined, // treated differently ); }); }); diff --git a/src/app/access-control/group-registry/groups-registry.component.ts b/src/app/access-control/group-registry/groups-registry.component.ts index 28c1f93336..3afc5571c4 100644 --- a/src/app/access-control/group-registry/groups-registry.component.ts +++ b/src/app/access-control/group-registry/groups-registry.component.ts @@ -8,7 +8,7 @@ import { EMPTY, Observable, of as observableOf, - Subscription + Subscription, } from 'rxjs'; import { catchError, defaultIfEmpty, map, switchMap, tap } from 'rxjs/operators'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; @@ -28,7 +28,7 @@ import { getAllSucceededRemoteData, getFirstCompletedRemoteData, getFirstSucceededRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../core/shared/operators'; import { PageInfo } from '../../core/shared/page-info.model'; import { hasValue } from '../../shared/empty.util'; @@ -57,7 +57,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'gl', pageSize: 5, - currentPage: 1 + currentPage: 1, }); /** @@ -155,7 +155,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { this.canManageGroup$(isSiteAdmin, group), this.hasLinkedDSO(group), this.getSubgroups(group), - this.getMembers(group) + this.getMembers(group), ]).pipe( map(([canDelete, canManageGroup, hasLinkedDSO, subgroups, members]: [boolean, boolean, boolean, RemoteData>, RemoteData>]) => { @@ -166,8 +166,8 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { groupDtoModel.subgroups = subgroups.payload; groupDtoModel.epersons = members.payload; return groupDtoModel; - } - ) + }, + ), ); } else { return EMPTY; @@ -175,9 +175,9 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { })]).pipe(defaultIfEmpty([]), map((dtos: GroupDtoModel[]) => { return buildPaginatedList(groups.pageInfo, dtos); })); - }) + }), ); - }) + }), ).subscribe((value: PaginatedList) => { this.groupsDto$.next(value); this.pageInfoState$.next(value.pageInfo); diff --git a/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts index 358bd0d01e..33c0f86a10 100644 --- a/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts +++ b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts @@ -11,7 +11,7 @@ describe('AdminCurationTasksComponent', () => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot()], declarations: [AdminCurationTasksComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts b/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts index 341aefb704..2c0819b091 100644 --- a/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts +++ b/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts @@ -10,7 +10,7 @@ import { FileValidator } from '../../shared/utils/require-file.validator'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { BATCH_IMPORT_SCRIPT_NAME, - ScriptDataService + ScriptDataService, } from '../../core/data/processes/script-data.service'; import { Router } from '@angular/router'; import { Location } from '@angular/common'; @@ -31,14 +31,14 @@ describe('BatchImportPageComponent', () => { notificationService = new NotificationsServiceStub(); scriptService = jasmine.createSpyObj('scriptService', { - invoke: createSuccessfulRemoteDataObject$({ processId: '46' }) - } + invoke: createSuccessfulRemoteDataObject$({ processId: '46' }), + }, ); router = jasmine.createSpyObj('router', { - navigateByUrl: jasmine.createSpy('navigateByUrl') + navigateByUrl: jasmine.createSpy('navigateByUrl'), }); locationStub = jasmine.createSpyObj('location', { - back: jasmine.createSpy('back') + back: jasmine.createSpy('back'), }); } @@ -48,7 +48,7 @@ describe('BatchImportPageComponent', () => { imports: [ FormsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [BatchImportPageComponent, FileValueAccessorDirective, FileValidator], providers: [ @@ -57,7 +57,7 @@ describe('BatchImportPageComponent', () => { { provide: Router, useValue: router }, { provide: Location, useValue: locationStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -108,7 +108,7 @@ describe('BatchImportPageComponent', () => { it('metadata-import script is invoked with --zip fileName and the mockFile', () => { const parameterValues: ProcessParameter[] = [ Object.assign(new ProcessParameter(), { name: '--add' }), - Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }) + Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }), ]; expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]); }); @@ -181,7 +181,7 @@ describe('BatchImportPageComponent', () => { it('metadata-import script is invoked with --url and the file url', () => { const parameterValues: ProcessParameter[] = [ Object.assign(new ProcessParameter(), { name: '--add' }), - Object.assign(new ProcessParameter(), { name: '--url', value: 'example.fileURL.com' }) + Object.assign(new ProcessParameter(), { name: '--url', value: 'example.fileURL.com' }), ]; expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [null]); }); diff --git a/src/app/admin/admin-import-batch-page/batch-import-page.component.ts b/src/app/admin/admin-import-batch-page/batch-import-page.component.ts index 673e1f23f5..585aeac4e4 100644 --- a/src/app/admin/admin-import-batch-page/batch-import-page.component.ts +++ b/src/app/admin/admin-import-batch-page/batch-import-page.component.ts @@ -11,7 +11,7 @@ import { Process } from '../../process-page/processes/process.model'; import { isEmpty, isNotEmpty } from '../../shared/empty.util'; import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths'; import { - ImportBatchSelectorComponent + ImportBatchSelectorComponent, } from '../../shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { take } from 'rxjs/operators'; @@ -20,7 +20,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-batch-import-page', - templateUrl: './batch-import-page.component.html' + templateUrl: './batch-import-page.component.html', }) export class BatchImportPageComponent { /** @@ -91,7 +91,7 @@ export class BatchImportPageComponent { } } else { const parameterValues: ProcessParameter[] = [ - Object.assign(new ProcessParameter(), { name: '--add' }) + Object.assign(new ProcessParameter(), { name: '--add' }), ]; if (this.isUpload) { parameterValues.push(Object.assign(new ProcessParameter(), { name: '--zip', value: this.fileObject.name })); diff --git a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts index 814757ec71..fd1c805595 100644 --- a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts +++ b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts @@ -28,14 +28,14 @@ describe('MetadataImportPageComponent', () => { notificationService = new NotificationsServiceStub(); scriptService = jasmine.createSpyObj('scriptService', { - invoke: createSuccessfulRemoteDataObject$({ processId: '45' }) - } + invoke: createSuccessfulRemoteDataObject$({ processId: '45' }), + }, ); router = jasmine.createSpyObj('router', { - navigateByUrl: jasmine.createSpy('navigateByUrl') + navigateByUrl: jasmine.createSpy('navigateByUrl'), }); locationStub = jasmine.createSpyObj('location', { - back: jasmine.createSpy('back') + back: jasmine.createSpy('back'), }); } @@ -45,7 +45,7 @@ describe('MetadataImportPageComponent', () => { imports: [ FormsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [MetadataImportPageComponent, FileValueAccessorDirective, FileValidator], providers: [ @@ -54,7 +54,7 @@ describe('MetadataImportPageComponent', () => { { provide: Router, useValue: router }, { provide: Location, useValue: locationStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts index 4236d152dc..7633773317 100644 --- a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts +++ b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts @@ -13,7 +13,7 @@ import { getProcessDetailRoute } from '../../process-page/process-page-routing.p @Component({ selector: 'ds-metadata-import-page', - templateUrl: './metadata-import-page.component.html' + templateUrl: './metadata-import-page.component.html', }) /** diff --git a/src/app/admin/admin-registries/admin-registries-routing.module.ts b/src/app/admin/admin-registries/admin-registries-routing.module.ts index 49a76708cc..9c566c92c8 100644 --- a/src/app/admin/admin-registries/admin-registries-routing.module.ts +++ b/src/app/admin/admin-registries/admin-registries-routing.module.ts @@ -15,25 +15,25 @@ import { BITSTREAMFORMATS_MODULE_PATH } from './admin-registries-routing-paths'; children: [ { path: '', - component: MetadataRegistryComponent + component: MetadataRegistryComponent, }, { path: ':schemaName', resolve: { breadcrumb: I18nBreadcrumbResolver }, component: MetadataSchemaComponent, - data: {title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema'} - } - ] + data: {title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema'}, + }, + ], }, { path: BITSTREAMFORMATS_MODULE_PATH, resolve: { breadcrumb: I18nBreadcrumbResolver }, loadChildren: () => import('./bitstream-formats/bitstream-formats.module') .then((m) => m.BitstreamFormatsModule), - data: {title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats'} + data: {title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats'}, }, - ]) - ] + ]), + ], }) export class AdminRegistriesRoutingModule { diff --git a/src/app/admin/admin-registries/admin-registries.module.ts b/src/app/admin/admin-registries/admin-registries.module.ts index 65f7b61419..9c03dc30b0 100644 --- a/src/app/admin/admin-registries/admin-registries.module.ts +++ b/src/app/admin/admin-registries/admin-registries.module.ts @@ -17,14 +17,14 @@ import { FormModule } from '../../shared/form/form.module'; RouterModule, BitstreamFormatsModule, AdminRegistriesRoutingModule, - FormModule + FormModule, ], declarations: [ MetadataRegistryComponent, MetadataSchemaComponent, MetadataSchemaFormComponent, - MetadataFieldFormComponent - ] + MetadataFieldFormComponent, + ], }) export class AdminRegistriesModule { diff --git a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts index 6787350d86..7ce8a7a6ad 100644 --- a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts @@ -38,7 +38,7 @@ describe('AddBitstreamFormatComponent', () => { notificationService = new NotificationsServiceStub(); bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', { createBitstreamFormat: createSuccessfulRemoteDataObject$({}), - clearBitStreamFormatRequests: observableOf(null) + clearBitStreamFormatRequests: observableOf(null), }); TestBed.configureTestingModule({ @@ -49,7 +49,7 @@ describe('AddBitstreamFormatComponent', () => { { provide: NotificationsService, useValue: notificationService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); }; @@ -78,7 +78,7 @@ describe('AddBitstreamFormatComponent', () => { notificationService = new NotificationsServiceStub(); bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', { createBitstreamFormat: createFailedRemoteDataObject$('Error', 500), - clearBitStreamFormatRequests: observableOf(null) + clearBitStreamFormatRequests: observableOf(null), }); TestBed.configureTestingModule({ @@ -89,7 +89,7 @@ describe('AddBitstreamFormatComponent', () => { { provide: NotificationsService, useValue: notificationService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); beforeEach(initBeforeEach); diff --git a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts index 5d48ea6ef9..788c0a8f24 100644 --- a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts @@ -44,7 +44,7 @@ export class AddBitstreamFormatComponent { this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'), this.translateService.get('admin.registries.bitstream-formats.create.failure.content')); } - } + }, ); } } diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-format.actions.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.actions.ts index c5bebb292b..7230518d31 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-format.actions.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.actions.ts @@ -15,7 +15,7 @@ export const BitstreamFormatsRegistryActionTypes = { SELECT_FORMAT: type('dspace/bitstream-formats-registry/SELECT_FORMAT'), DESELECT_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_FORMAT'), - DESELECT_ALL_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_ALL_FORMAT') + DESELECT_ALL_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_ALL_FORMAT'), }; /** diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts index 76576afc7a..268839446f 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts @@ -4,7 +4,7 @@ import { bitstreamFormatReducer, BitstreamFormatRegistryState } from './bitstrea import { BitstreamFormatsRegistryDeselectAction, BitstreamFormatsRegistryDeselectAllAction, - BitstreamFormatsRegistrySelectAction + BitstreamFormatsRegistrySelectAction, } from './bitstream-format.actions'; const bitstreamFormat1: BitstreamFormat = new BitstreamFormat(); @@ -16,15 +16,15 @@ bitstreamFormat2.id = 'test-uuid-2'; bitstreamFormat2.shortDescription = 'test-short-2'; const initialState: BitstreamFormatRegistryState = { - selectedBitstreamFormats: [] + selectedBitstreamFormats: [], }; const bitstream1SelectedState: BitstreamFormatRegistryState = { - selectedBitstreamFormats: [bitstreamFormat1] + selectedBitstreamFormats: [bitstreamFormat1], }; const bitstream1and2SelectedState: BitstreamFormatRegistryState = { - selectedBitstreamFormats: [bitstreamFormat1, bitstreamFormat2] + selectedBitstreamFormats: [bitstreamFormat1, bitstreamFormat2], }; describe('BitstreamFormatReducer', () => { diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts index 41880bf16c..40642a5fdb 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts @@ -3,7 +3,7 @@ import { BitstreamFormatsRegistryAction, BitstreamFormatsRegistryActionTypes, BitstreamFormatsRegistryDeselectAction, - BitstreamFormatsRegistrySelectAction + BitstreamFormatsRegistrySelectAction, } from './bitstream-format.actions'; /** @@ -32,21 +32,21 @@ export function bitstreamFormatReducer(state = initialState, action: BitstreamFo case BitstreamFormatsRegistryActionTypes.SELECT_FORMAT: { return Object.assign({}, state, { - selectedBitstreamFormats: [...state.selectedBitstreamFormats, (action as BitstreamFormatsRegistrySelectAction).bitstreamFormat] + selectedBitstreamFormats: [...state.selectedBitstreamFormats, (action as BitstreamFormatsRegistrySelectAction).bitstreamFormat], }); } case BitstreamFormatsRegistryActionTypes.DESELECT_FORMAT: { return Object.assign({}, state, { selectedBitstreamFormats: state.selectedBitstreamFormats.filter( - (selectedBitstreamFormats) => selectedBitstreamFormats !== (action as BitstreamFormatsRegistryDeselectAction).bitstreamFormat - ) + (selectedBitstreamFormats) => selectedBitstreamFormats !== (action as BitstreamFormatsRegistryDeselectAction).bitstreamFormat, + ), }); } case BitstreamFormatsRegistryActionTypes.DESELECT_ALL_FORMAT: { return Object.assign({}, state, { - selectedBitstreamFormats: [] + selectedBitstreamFormats: [], }); } default: diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts index 2f08f8257c..6ed822f774 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts @@ -14,28 +14,28 @@ const BITSTREAMFORMAT_ADD_PATH = 'add'; RouterModule.forChild([ { path: '', - component: BitstreamFormatsComponent + component: BitstreamFormatsComponent, }, { path: BITSTREAMFORMAT_ADD_PATH, resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AddBitstreamFormatComponent, - data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'} + data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'}, }, { path: BITSTREAMFORMAT_EDIT_PATH, component: EditBitstreamFormatComponent, resolve: { bitstreamFormat: BitstreamFormatsResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {breadcrumbKey: 'admin.registries.bitstream-formats.edit'} + data: {breadcrumbKey: 'admin.registries.bitstream-formats.edit'}, }, - ]) + ]), ], providers: [ BitstreamFormatsResolver, - ] + ], }) export class BitstreamFormatsRoutingModule { diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts index d598cdc4b2..6d28d363cd 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts @@ -21,7 +21,7 @@ import { createNoContentRemoteDataObject$, createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, - createFailedRemoteDataObject$ + createFailedRemoteDataObject$, } from '../../../shared/remote-data.utils'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { PaginationService } from '../../../core/pagination/pagination.service'; @@ -79,7 +79,7 @@ describe('BitstreamFormatsComponent', () => { bitstreamFormat1, bitstreamFormat2, bitstreamFormat3, - bitstreamFormat4 + bitstreamFormat4, ]; const mockFormatsRD = createSuccessfulRemoteDataObject(createPaginatedList(mockFormatsList)); @@ -96,7 +96,7 @@ describe('BitstreamFormatsComponent', () => { deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, delete: createSuccessfulRemoteDataObject$({}), - clearBitStreamFormatRequests: observableOf('cleared') + clearBitStreamFormatRequests: observableOf('cleared'), }); paginationService = new PaginationServiceStub(); @@ -108,8 +108,8 @@ describe('BitstreamFormatsComponent', () => { { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] + { provide: PaginationService, useValue: paginationService }, + ], }).compileComponents(); }; @@ -224,7 +224,7 @@ describe('BitstreamFormatsComponent', () => { deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, delete: createNoContentRemoteDataObject$(), - clearBitStreamFormatRequests: observableOf('cleared') + clearBitStreamFormatRequests: observableOf('cleared'), }); paginationService = new PaginationServiceStub(); @@ -236,10 +236,10 @@ describe('BitstreamFormatsComponent', () => { { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] + { provide: PaginationService, useValue: paginationService }, + ], }).compileComponents(); - } + }, )); beforeEach(initBeforeEach); @@ -273,7 +273,7 @@ describe('BitstreamFormatsComponent', () => { deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, delete: createFailedRemoteDataObject$(), - clearBitStreamFormatRequests: observableOf('cleared') + clearBitStreamFormatRequests: observableOf('cleared'), }); paginationService = new PaginationServiceStub(); @@ -285,10 +285,10 @@ describe('BitstreamFormatsComponent', () => { { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] + { provide: PaginationService, useValue: paginationService }, + ], }).compileComponents(); - } + }, )); beforeEach(initBeforeEach); diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts index 162bf2bdb2..bb3980b764 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts @@ -19,7 +19,7 @@ import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; */ @Component({ selector: 'ds-bitstream-formats', - templateUrl: './bitstream-formats.component.html' + templateUrl: './bitstream-formats.component.html', }) export class BitstreamFormatsComponent implements OnInit, OnDestroy { @@ -35,7 +35,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy { pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'rbp', pageSize: 20, - pageSizeOptions: [20, 40, 60, 80, 100] + pageSizeOptions: [20, 40, 60, 80, 100], }); constructor(private notificationsService: NotificationsService, @@ -64,7 +64,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy { map((response: RemoteData) => response.hasSucceeded), )), // wait for all responses to come in and return them as a single array - toArray() + toArray(), ).subscribe((results: boolean[]) => { // Count the number of succeeded and failed deletions const successResponses = results.filter((result: boolean) => result); @@ -101,7 +101,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy { return this.bitstreamFormatService.getSelectedBitstreamFormats().pipe( map((bitstreamFormats: BitstreamFormat[]) => { return bitstreamFormats.find((selectedFormat) => selectedFormat.id === bitstreamFormat.id) != null; - }) + }), ); } @@ -127,7 +127,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy { const messages = observableCombineLatest( this.translateService.get(`${prefix}.${suffix}.head`), - this.translateService.get(`${prefix}.${suffix}.amount`, {amount: amount}) + this.translateService.get(`${prefix}.${suffix}.amount`, {amount: amount}), ); messages.subscribe(([head, content]) => { @@ -144,7 +144,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy { this.bitstreamFormats = this.paginationService.getFindListOptions(this.pageConfig.id, this.pageConfig).pipe( switchMap((findListOptions: FindListOptions) => { return this.bitstreamFormatService.findAll(findListOptions); - }) + }), ); } diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts index afbe35a1f6..c7d21c74ba 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts @@ -15,14 +15,14 @@ import { FormModule } from '../../../shared/form/form.module'; SharedModule, RouterModule, BitstreamFormatsRoutingModule, - FormModule + FormModule, ], declarations: [ BitstreamFormatsComponent, EditBitstreamFormatComponent, AddBitstreamFormatComponent, - FormatFormComponent - ] + FormatFormComponent, + ], }) export class BitstreamFormatsModule { diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts index a00f660baf..0f38044593 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts @@ -24,7 +24,7 @@ export class BitstreamFormatsResolver implements Resolve> { return this.bitstreamFormatDataService.findById(route.params.id) .pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); } } diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts index b09c50c70a..17854c2182 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts @@ -17,7 +17,7 @@ import { EditBitstreamFormatComponent } from './edit-bitstream-format.component' import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, - createSuccessfulRemoteDataObject$ + createSuccessfulRemoteDataObject$, } from '../../../../shared/remote-data.utils'; describe('EditBitstreamFormatComponent', () => { @@ -36,8 +36,8 @@ describe('EditBitstreamFormatComponent', () => { const routeStub = { data: observableOf({ - bitstreamFormat: createSuccessfulRemoteDataObject(bitstreamFormat) - }) + bitstreamFormat: createSuccessfulRemoteDataObject(bitstreamFormat), + }), }; let router; @@ -48,7 +48,7 @@ describe('EditBitstreamFormatComponent', () => { router = new RouterStub(); notificationService = new NotificationsServiceStub(); bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', { - updateBitstreamFormat: createSuccessfulRemoteDataObject$({}) + updateBitstreamFormat: createSuccessfulRemoteDataObject$({}), }); TestBed.configureTestingModule({ @@ -60,7 +60,7 @@ describe('EditBitstreamFormatComponent', () => { { provide: NotificationsService, useValue: notificationService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); }; @@ -99,7 +99,7 @@ describe('EditBitstreamFormatComponent', () => { router = new RouterStub(); notificationService = new NotificationsServiceStub(); bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', { - updateBitstreamFormat: createFailedRemoteDataObject$('Error', 500) + updateBitstreamFormat: createFailedRemoteDataObject$('Error', 500), }); TestBed.configureTestingModule({ @@ -111,7 +111,7 @@ describe('EditBitstreamFormatComponent', () => { { provide: NotificationsService, useValue: notificationService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); beforeEach(initBeforeEach); diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts index 88dbcded7b..c48c1c12cf 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts @@ -36,7 +36,7 @@ export class EditBitstreamFormatComponent implements OnInit { ngOnInit(): void { this.bitstreamFormatRD$ = this.route.data.pipe( - map((data) => data.bitstreamFormat as RemoteData) + map((data) => data.bitstreamFormat as RemoteData), ); } @@ -57,7 +57,7 @@ export class EditBitstreamFormatComponent implements OnInit { this.notificationService.error('admin.registries.bitstream-formats.edit.failure.head', 'admin.registries.bitstream-formats.create.edit.content'); } - } + }, ); } } diff --git a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts index ca3fbcbc99..843d696eba 100644 --- a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts @@ -45,7 +45,7 @@ describe('FormatFormComponent', () => { providers: [ { provide: Router, useValue: router }, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); }; diff --git a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts index 142f6fb83d..043ed17da1 100644 --- a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts @@ -9,7 +9,7 @@ import { DynamicFormService, DynamicInputModel, DynamicSelectModel, - DynamicTextAreaModel + DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; import { Router } from '@angular/router'; import { hasValue, isEmpty } from '../../../../shared/empty.util'; @@ -22,7 +22,7 @@ import { environment } from '../../../../../environments/environment'; */ @Component({ selector: 'ds-bitstream-format-form', - templateUrl: './format-form.component.html' + templateUrl: './format-form.component.html', }) export class FormatFormComponent implements OnInit { @@ -58,8 +58,8 @@ export class FormatFormComponent implements OnInit { */ arrayInputElementLayout: DynamicFormControlLayout = { grid: { - host: 'col' - } + host: 'col', + }, }; /** @@ -73,10 +73,10 @@ export class FormatFormComponent implements OnInit { hint: 'admin.registries.bitstream-formats.edit.shortDescription.hint', required: true, validators: { - required: null + required: null, }, errorMessages: { - required: 'Please enter a name for this bitstream format' + required: 'Please enter a name for this bitstream format', }, }), new DynamicInputModel({ @@ -100,7 +100,7 @@ export class FormatFormComponent implements OnInit { options: this.supportLevelOptions, label: 'admin.registries.bitstream-formats.edit.supportLevel.label', hint: 'admin.registries.bitstream-formats.edit.supportLevel.hint', - value: this.supportLevelOptions[0].value + value: this.supportLevelOptions[0].value, }), new DynamicCheckboxModel({ @@ -117,8 +117,8 @@ export class FormatFormComponent implements OnInit { new DynamicInputModel({ id: 'extension', placeholder: 'admin.registries.bitstream-formats.edit.extensions.placeholder', - }, this.arrayInputElementLayout) - ] + }, this.arrayInputElementLayout), + ], }, this.arrayElementLayout), ]; @@ -146,7 +146,7 @@ export class FormatFormComponent implements OnInit { for (let i = 0; i < extenstions.length; i++) { formArray.insertGroup(i).group[0] = new DynamicInputModel({ id: `extension-${i}`, - value: extenstions[i] + value: extenstions[i], }, this.arrayInputElementLayout); } } @@ -165,7 +165,7 @@ export class FormatFormComponent implements OnInit { onSubmit() { const updatedBitstreamFormat = Object.assign(new BitstreamFormat(), { - id: this.bitstreamFormat.id + id: this.bitstreamFormat.id, }); this.formModel.forEach( diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.actions.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.actions.ts index 3fc872ca43..be87d6ae39 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.actions.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.actions.ts @@ -24,7 +24,7 @@ export const MetadataRegistryActionTypes = { CANCEL_EDIT_FIELD: type('dspace/metadata-registry/CANCEL_FIELD'), SELECT_FIELD: type('dspace/metadata-registry/SELECT_FIELD'), DESELECT_FIELD: type('dspace/metadata-registry/DESELECT_FIELD'), - DESELECT_ALL_FIELD: type('dspace/metadata-registry/DESELECT_ALL_FIELD') + DESELECT_ALL_FIELD: type('dspace/metadata-registry/DESELECT_ALL_FIELD'), }; /** diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts index 944288a7a5..23baafa4e1 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts @@ -31,22 +31,22 @@ describe('MetadataRegistryComponent', () => { id: 1, _links: { self: { - href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/1' + href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/1', }, }, prefix: 'dc', - namespace: 'http://dublincore.org/documents/dcmi-terms/' + namespace: 'http://dublincore.org/documents/dcmi-terms/', }, { id: 2, _links: { self: { - href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/2' + href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/2', }, }, prefix: 'mock', - namespace: 'http://dspace.org/mockschema' - } + namespace: 'http://dspace.org/mockschema', + }, ]; const mockSchemas = createSuccessfulRemoteDataObject$(buildPaginatedList(null, mockSchemasList)); /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ @@ -61,7 +61,7 @@ describe('MetadataRegistryComponent', () => { deleteMetadataSchema: () => observableOf(new RestResponse(true, 200, 'OK')), deselectAllMetadataSchema: () => { }, - clearMetadataSchemaRequests: () => observableOf(undefined) + clearMetadataSchemaRequests: () => observableOf(undefined), }; /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ @@ -75,11 +75,11 @@ describe('MetadataRegistryComponent', () => { { provide: RegistryService, useValue: registryServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, - { provide: NotificationsService, useValue: new NotificationsServiceStub() } + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(MetadataRegistryComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default } + set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts index 857034604e..346394201b 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts @@ -18,7 +18,7 @@ import { PaginationService } from '../../../core/pagination/pagination.service'; @Component({ selector: 'ds-metadata-registry', templateUrl: './metadata-registry.component.html', - styleUrls: ['./metadata-registry.component.scss'] + styleUrls: ['./metadata-registry.component.scss'], }) /** * A component used for managing all existing metadata schemas within the repository. @@ -36,7 +36,7 @@ export class MetadataRegistryComponent { */ config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'rm', - pageSize: 25 + pageSize: 25, }); /** @@ -60,7 +60,7 @@ export class MetadataRegistryComponent { this.metadataSchemas = this.needsUpdate$.pipe( filter((update) => update === true), switchMap(() => this.paginationService.getCurrentPagination(this.config.id, this.config)), - switchMap((currentPagination) => this.registryService.getMetadataSchemas(toFindListOptions(currentPagination))) + switchMap((currentPagination) => this.registryService.getMetadataSchemas(toFindListOptions(currentPagination))), ); } @@ -92,7 +92,7 @@ export class MetadataRegistryComponent { */ isActive(schema: MetadataSchema): Observable { return this.getActiveSchema().pipe( - map((activeSchema) => schema === activeSchema) + map((activeSchema) => schema === activeSchema), ); } @@ -120,7 +120,7 @@ export class MetadataRegistryComponent { */ isSelected(schema: MetadataSchema): Observable { return this.registryService.getSelectedMetadataSchemas().pipe( - map((schemas) => schemas.find((selectedSchema) => selectedSchema === schema) != null) + map((schemas) => schemas.find((selectedSchema) => selectedSchema === schema) != null), ); } @@ -148,7 +148,7 @@ export class MetadataRegistryComponent { this.registryService.deselectAllMetadataSchema(); this.registryService.cancelEditMetadataSchema(); }); - } + }, ); } @@ -162,7 +162,7 @@ export class MetadataRegistryComponent { const suffix = success ? 'success' : 'failure'; const messages = observableCombineLatest( this.translateService.get(success ? `${prefix}.${suffix}` : `${prefix}.${suffix}`), - this.translateService.get(`${prefix}.deleted.${suffix}`, {amount: amount}) + this.translateService.get(`${prefix}.deleted.${suffix}`, {amount: amount}), ); messages.subscribe(([head, content]) => { if (success) { diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts index 3e26a8fdc1..931f16a907 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts @@ -8,7 +8,7 @@ import { MetadataRegistryEditFieldAction, MetadataRegistryEditSchemaAction, MetadataRegistrySelectFieldAction, - MetadataRegistrySelectSchemaAction + MetadataRegistrySelectSchemaAction, } from './metadata-registry.actions'; import { metadataRegistryReducer, MetadataRegistryState } from './metadata-registry.reducers'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; @@ -27,11 +27,11 @@ const schema: MetadataSchema = Object.assign(new MetadataSchema(), id: 'schema-id', _links: { self: { - href: 'http://rest.self/schema/dc' + href: 'http://rest.self/schema/dc', }, }, prefix: 'dc', - namespace: 'http://dublincore.org/documents/dcmi-terms/' + namespace: 'http://dublincore.org/documents/dcmi-terms/', }); const schema2: MetadataSchema = Object.assign(new MetadataSchema(), @@ -43,7 +43,7 @@ const schema2: MetadataSchema = Object.assign(new MetadataSchema(), }, }, prefix: 'dcterms', - namespace: 'http://purl.org/dc/terms/' + namespace: 'http://purl.org/dc/terms/', }); const field: MetadataField = Object.assign(new MetadataField(), @@ -57,7 +57,7 @@ const field: MetadataField = Object.assign(new MetadataField(), element: 'contributor', qualifier: 'author', scopeNote: 'Author of an item', - schema: schema + schema: schema, }); const field2: MetadataField = Object.assign(new MetadataField(), @@ -71,35 +71,35 @@ const field2: MetadataField = Object.assign(new MetadataField(), element: 'title', qualifier: null, scopeNote: 'Title of an item', - schema: schema + schema: schema, }); const initialState: MetadataRegistryState = { editSchema: null, selectedSchemas: [], editField: null, - selectedFields: [] + selectedFields: [], }; const editState: MetadataRegistryState = { editSchema: schema, selectedSchemas: [], editField: field, - selectedFields: [] + selectedFields: [], }; const selectState: MetadataRegistryState = { editSchema: null, selectedSchemas: [schema2], editField: null, - selectedFields: [field2] + selectedFields: [field2], }; const moreSelectState: MetadataRegistryState = { editSchema: null, selectedSchemas: [schema, schema2], editField: null, - selectedFields: [field, field2] + selectedFields: [field, field2], }; describe('metadataRegistryReducer', () => { diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.ts index e805c8b8fc..4d3638fd99 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.ts @@ -6,7 +6,7 @@ import { MetadataRegistryEditFieldAction, MetadataRegistryEditSchemaAction, MetadataRegistrySelectFieldAction, - MetadataRegistrySelectSchemaAction + MetadataRegistrySelectSchemaAction, } from './metadata-registry.actions'; import { MetadataField } from '../../../core/metadata/metadata-field.model'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; @@ -29,7 +29,7 @@ const initialState: MetadataRegistryState = { editSchema: null, selectedSchemas: [], editField: null, - selectedFields: [] + selectedFields: [], }; /** @@ -43,65 +43,65 @@ export function metadataRegistryReducer(state = initialState, action: MetadataRe case MetadataRegistryActionTypes.EDIT_SCHEMA: { return Object.assign({}, state, { - editSchema: (action as MetadataRegistryEditSchemaAction).schema + editSchema: (action as MetadataRegistryEditSchemaAction).schema, }); } case MetadataRegistryActionTypes.CANCEL_EDIT_SCHEMA: { return Object.assign({}, state, { - editSchema: null + editSchema: null, }); } case MetadataRegistryActionTypes.SELECT_SCHEMA: { return Object.assign({}, state, { - selectedSchemas: [...state.selectedSchemas, (action as MetadataRegistrySelectSchemaAction).schema] + selectedSchemas: [...state.selectedSchemas, (action as MetadataRegistrySelectSchemaAction).schema], }); } case MetadataRegistryActionTypes.DESELECT_SCHEMA: { return Object.assign({}, state, { selectedSchemas: state.selectedSchemas.filter( - (selectedSchema) => selectedSchema !== (action as MetadataRegistryDeselectSchemaAction).schema - ) + (selectedSchema) => selectedSchema !== (action as MetadataRegistryDeselectSchemaAction).schema, + ), }); } case MetadataRegistryActionTypes.DESELECT_ALL_SCHEMA: { return Object.assign({}, state, { - selectedSchemas: [] + selectedSchemas: [], }); } case MetadataRegistryActionTypes.EDIT_FIELD: { return Object.assign({}, state, { - editField: (action as MetadataRegistryEditFieldAction).field + editField: (action as MetadataRegistryEditFieldAction).field, }); } case MetadataRegistryActionTypes.CANCEL_EDIT_FIELD: { return Object.assign({}, state, { - editField: null + editField: null, }); } case MetadataRegistryActionTypes.SELECT_FIELD: { return Object.assign({}, state, { - selectedFields: [...state.selectedFields, (action as MetadataRegistrySelectFieldAction).field] + selectedFields: [...state.selectedFields, (action as MetadataRegistrySelectFieldAction).field], }); } case MetadataRegistryActionTypes.DESELECT_FIELD: { return Object.assign({}, state, { selectedFields: state.selectedFields.filter( - (selectedField) => selectedField !== (action as MetadataRegistryDeselectFieldAction).field - ) + (selectedField) => selectedField !== (action as MetadataRegistryDeselectFieldAction).field, + ), }); } case MetadataRegistryActionTypes.DESELECT_ALL_FIELD: { return Object.assign({}, state, { - selectedFields: [] + selectedFields: [], }); } diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts index b758767ddb..dc82923b3a 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts @@ -22,7 +22,7 @@ describe('MetadataSchemaFormComponent', () => { createOrUpdateMetadataSchema: (schema: MetadataSchema) => observableOf(schema), cancelEditMetadataSchema: () => { }, - clearMetadataSchemaRequests: () => observableOf(undefined) + clearMetadataSchemaRequests: () => observableOf(undefined), }; const formBuilderServiceStub = { createFormGroup: () => { @@ -32,7 +32,7 @@ describe('MetadataSchemaFormComponent', () => { reset(_value?: any, _options?: { onlySelf?: boolean; emitEvent?: boolean; }): void { }, }; - } + }, }; /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ @@ -42,9 +42,9 @@ describe('MetadataSchemaFormComponent', () => { declarations: [MetadataSchemaFormComponent, EnumKeysPipe], providers: [ { provide: RegistryService, useValue: registryServiceStub }, - { provide: FormBuilderService, useValue: formBuilderServiceStub } + { provide: FormBuilderService, useValue: formBuilderServiceStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -64,7 +64,7 @@ describe('MetadataSchemaFormComponent', () => { const expected = Object.assign(new MetadataSchema(), { namespace: namespace, - prefix: prefix + prefix: prefix, } as MetadataSchema); beforeEach(() => { @@ -90,7 +90,7 @@ describe('MetadataSchemaFormComponent', () => { const expectedWithId = Object.assign(new MetadataSchema(), { id: 1, namespace: namespace, - prefix: prefix + prefix: prefix, } as MetadataSchema); beforeEach(() => { diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts index f318f6b2af..6c59d810e4 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts @@ -3,7 +3,7 @@ import { DynamicFormControlModel, DynamicFormGroupModel, DynamicFormLayout, - DynamicInputModel + DynamicInputModel, } from '@ng-dynamic-forms/core'; import { UntypedFormGroup } from '@angular/forms'; import { RegistryService } from '../../../../core/registry/registry.service'; @@ -15,7 +15,7 @@ import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model' @Component({ selector: 'ds-metadata-schema-form', - templateUrl: './metadata-schema-form.component.html' + templateUrl: './metadata-schema-form.component.html', }) /** * A form used for creating and editing metadata schemas @@ -53,14 +53,14 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy { formLayout: DynamicFormLayout = { name: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, namespace: { grid: { - host: 'col col-sm-6 d-inline-block' - } - } + host: 'col col-sm-6 d-inline-block', + }, + }, }; /** @@ -79,7 +79,7 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy { ngOnInit() { combineLatest([ this.translateService.get(`${this.messagePrefix}.name`), - this.translateService.get(`${this.messagePrefix}.namespace`) + this.translateService.get(`${this.messagePrefix}.namespace`), ]).subscribe(([name, namespace]) => { this.name = new DynamicInputModel({ id: 'name', @@ -113,8 +113,8 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy { new DynamicFormGroupModel( { id: 'metadatadataschemagroup', - group:[this.namespace, this.name] - }) + group:[this.namespace, this.name], + }), ]; this.formGroup = this.formBuilderService.createFormGroup(this.formModel); this.registryService.getActiveMetadataSchema().subscribe((schema: MetadataSchema) => { @@ -152,7 +152,7 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy { (schema: MetadataSchema) => { const values = { prefix: this.name.value, - namespace: this.namespace.value + namespace: this.namespace.value, }; if (schema == null) { this.registryService.createOrUpdateMetadataSchema(Object.assign(new MetadataSchema(), values)).subscribe((newSchema) => { @@ -169,7 +169,7 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy { } this.clearFields(); this.registryService.cancelEditMetadataSchema(); - } + }, ); } diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts index ad7b54945d..6f631640e4 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts @@ -21,7 +21,7 @@ describe('MetadataFieldFormComponent', () => { const metadataSchema = Object.assign(new MetadataSchema(), { id: 1, namespace: 'fake schema', - prefix: 'fake' + prefix: 'fake', }); /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ @@ -33,7 +33,7 @@ describe('MetadataFieldFormComponent', () => { }, cancelEditMetadataSchema: () => { }, - clearMetadataFieldRequests: () => observableOf(undefined) + clearMetadataFieldRequests: () => observableOf(undefined), }; const formBuilderServiceStub = { createFormGroup: () => { @@ -43,7 +43,7 @@ describe('MetadataFieldFormComponent', () => { reset(_value?: any, _options?: { onlySelf?: boolean; emitEvent?: boolean; }): void { }, }; - } + }, }; /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ @@ -53,9 +53,9 @@ describe('MetadataFieldFormComponent', () => { declarations: [MetadataFieldFormComponent, EnumKeysPipe], providers: [ { provide: RegistryService, useValue: registryServiceStub }, - { provide: FormBuilderService, useValue: formBuilderServiceStub } + { provide: FormBuilderService, useValue: formBuilderServiceStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -83,7 +83,7 @@ describe('MetadataFieldFormComponent', () => { const expected = Object.assign(new MetadataField(), { element: element, qualifier: qualifier, - scopeNote: scopeNote + scopeNote: scopeNote, }); beforeEach(() => { @@ -112,7 +112,7 @@ describe('MetadataFieldFormComponent', () => { schema: metadataSchema, element: element, qualifier: qualifier, - scopeNote: scopeNote + scopeNote: scopeNote, }); beforeEach(() => { diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts index db5a871e93..3765c7bf21 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts @@ -3,7 +3,7 @@ import { DynamicFormControlModel, DynamicFormGroupModel, DynamicFormLayout, - DynamicInputModel + DynamicInputModel, } from '@ng-dynamic-forms/core'; import { UntypedFormGroup } from '@angular/forms'; import { RegistryService } from '../../../../core/registry/registry.service'; @@ -16,7 +16,7 @@ import { MetadataField } from '../../../../core/metadata/metadata-field.model'; @Component({ selector: 'ds-metadata-field-form', - templateUrl: './metadata-field-form.component.html' + templateUrl: './metadata-field-form.component.html', }) /** * A form used for creating and editing metadata fields @@ -64,19 +64,19 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy { formLayout: DynamicFormLayout = { element: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, qualifier: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, scopeNote: { grid: { - host: 'col col-sm-12 d-inline-block' - } - } + host: 'col col-sm-12 d-inline-block', + }, + }, }; /** @@ -101,7 +101,7 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy { combineLatest([ this.translateService.get(`${this.messagePrefix}.element`), this.translateService.get(`${this.messagePrefix}.qualifier`), - this.translateService.get(`${this.messagePrefix}.scopenote`) + this.translateService.get(`${this.messagePrefix}.scopenote`), ]).subscribe(([element, qualifier, scopenote]) => { this.element = new DynamicInputModel({ id: 'element', @@ -142,8 +142,8 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy { new DynamicFormGroupModel( { id: 'metadatadatafieldgroup', - group:[this.element, this.qualifier, this.scopeNote] - }) + group:[this.element, this.qualifier, this.scopeNote], + }), ]; this.formGroup = this.formBuilderService.createFormGroup(this.formModel); this.registryService.getActiveMetadataField().subscribe((field: MetadataField): void => { @@ -200,7 +200,7 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy { } this.clearFields(); this.registryService.cancelEditMetadataField(); - } + }, ); } diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts index 2b660a6363..7f560d737e 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts @@ -39,7 +39,7 @@ describe('MetadataSchemaComponent', () => { }, }, prefix: 'dc', - namespace: 'http://dublincore.org/documents/dcmi-terms/' + namespace: 'http://dublincore.org/documents/dcmi-terms/', }, { id: 2, @@ -49,8 +49,8 @@ describe('MetadataSchemaComponent', () => { }, }, prefix: 'mock', - namespace: 'http://dspace.org/mockschema' - } + namespace: 'http://dspace.org/mockschema', + }, ]; const mockFieldsList = [ { @@ -63,7 +63,7 @@ describe('MetadataSchemaComponent', () => { element: 'contributor', qualifier: 'advisor', scopeNote: null, - schema: createSuccessfulRemoteDataObject$(mockSchemasList[0]) + schema: createSuccessfulRemoteDataObject$(mockSchemasList[0]), }, { id: 2, @@ -75,7 +75,7 @@ describe('MetadataSchemaComponent', () => { element: 'contributor', qualifier: 'author', scopeNote: null, - schema: createSuccessfulRemoteDataObject$(mockSchemasList[0]) + schema: createSuccessfulRemoteDataObject$(mockSchemasList[0]), }, { id: 3, @@ -87,7 +87,7 @@ describe('MetadataSchemaComponent', () => { element: 'contributor', qualifier: 'editor', scopeNote: 'test scope note', - schema: createSuccessfulRemoteDataObject$(mockSchemasList[1]) + schema: createSuccessfulRemoteDataObject$(mockSchemasList[1]), }, { id: 4, @@ -99,8 +99,8 @@ describe('MetadataSchemaComponent', () => { element: 'contributor', qualifier: 'illustrator', scopeNote: null, - schema: createSuccessfulRemoteDataObject$(mockSchemasList[1]) - } + schema: createSuccessfulRemoteDataObject$(mockSchemasList[1]), + }, ]; const mockSchemas = createSuccessfulRemoteDataObject$(buildPaginatedList(null, mockSchemasList)); /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ @@ -117,14 +117,14 @@ describe('MetadataSchemaComponent', () => { deleteMetadataField: () => observableOf(new RestResponse(true, 200, 'OK')), deselectAllMetadataField: () => { }, - clearMetadataFieldRequests: () => observableOf(undefined) + clearMetadataFieldRequests: () => observableOf(undefined), }; /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ const schemaNameParam = 'mock'; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { params: observableOf({ - schemaName: schemaNameParam - }) + schemaName: schemaNameParam, + }), }); const paginationService = new PaginationServiceStub(); @@ -139,9 +139,9 @@ describe('MetadataSchemaComponent', () => { { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: Router, useValue: new RouterStub() }, { provide: PaginationService, useValue: paginationService }, - { provide: NotificationsService, useValue: new NotificationsServiceStub() } + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts index d0827e6e4d..1175d3b3be 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts @@ -7,7 +7,7 @@ import { combineLatest, Observable, of as observableOf, - zip + zip, } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list.model'; @@ -26,7 +26,7 @@ import { PaginationService } from '../../../core/pagination/pagination.service'; @Component({ selector: 'ds-metadata-schema', templateUrl: './metadata-schema.component.html', - styleUrls: ['./metadata-schema.component.scss'] + styleUrls: ['./metadata-schema.component.scss'], }) /** * A component used for managing all existing metadata fields within the current metadata schema. @@ -49,7 +49,7 @@ export class MetadataSchemaComponent implements OnInit { config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'rm', pageSize: 25, - pageSizeOptions: [25, 50, 100, 200] + pageSizeOptions: [25, 50, 100, 200], }); /** @@ -92,7 +92,7 @@ export class MetadataSchemaComponent implements OnInit { this.needsUpdate$.next(false); } return this.registryService.getMetadataFieldsBySchema(schema, toFindListOptions(currentPagination), !update, true); - }) + }), ); } @@ -125,7 +125,7 @@ export class MetadataSchemaComponent implements OnInit { */ isActive(field: MetadataField): Observable { return this.getActiveField().pipe( - map((activeField) => field === activeField) + map((activeField) => field === activeField), ); } @@ -153,7 +153,7 @@ export class MetadataSchemaComponent implements OnInit { */ isSelected(field: MetadataField): Observable { return this.registryService.getSelectedMetadataFields().pipe( - map((fields) => fields.find((selectedField) => selectedField === field) != null) + map((fields) => fields.find((selectedField) => selectedField === field) != null), ); } @@ -181,7 +181,7 @@ export class MetadataSchemaComponent implements OnInit { this.registryService.deselectAllMetadataField(); this.registryService.cancelEditMetadataField(); }); - } + }, ); } @@ -195,7 +195,7 @@ export class MetadataSchemaComponent implements OnInit { const suffix = success ? 'success' : 'failure'; const messages = observableCombineLatest( this.translateService.get(success ? `${prefix}.${suffix}` : `${prefix}.${suffix}`), - this.translateService.get(`${prefix}.field.deleted.${suffix}`, { amount: amount }) + this.translateService.get(`${prefix}.field.deleted.${suffix}`, { amount: amount }), ); messages.subscribe(([head, content]) => { if (success) { diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts index 8e4f13b164..7f602b7179 100644 --- a/src/app/admin/admin-routing.module.ts +++ b/src/app/admin/admin-routing.module.ts @@ -21,44 +21,44 @@ import { BatchImportPageComponent } from './admin-import-batch-page/batch-import path: 'search', resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AdminSearchPageComponent, - data: { title: 'admin.search.title', breadcrumbKey: 'admin.search' } + data: { title: 'admin.search.title', breadcrumbKey: 'admin.search' }, }, { path: 'workflow', resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AdminWorkflowPageComponent, - data: { title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow' } + data: { title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow' }, }, { path: 'curation-tasks', resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AdminCurationTasksComponent, - data: { title: 'admin.curation-tasks.title', breadcrumbKey: 'admin.curation-tasks' } + data: { title: 'admin.curation-tasks.title', breadcrumbKey: 'admin.curation-tasks' }, }, { path: 'metadata-import', resolve: { breadcrumb: I18nBreadcrumbResolver }, component: MetadataImportPageComponent, - data: { title: 'admin.metadata-import.title', breadcrumbKey: 'admin.metadata-import' } + data: { title: 'admin.metadata-import.title', breadcrumbKey: 'admin.metadata-import' }, }, { path: 'batch-import', resolve: { breadcrumb: I18nBreadcrumbResolver }, component: BatchImportPageComponent, - data: { title: 'admin.batch-import.title', breadcrumbKey: 'admin.batch-import' } + data: { title: 'admin.batch-import.title', breadcrumbKey: 'admin.batch-import' }, }, { path: 'system-wide-alert', resolve: { breadcrumb: I18nBreadcrumbResolver }, loadChildren: () => import('../system-wide-alert/system-wide-alert.module').then((m) => m.SystemWideAlertModule), - data: {title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert'} + data: {title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert'}, }, - ]) + ]), ], providers: [ I18nBreadcrumbResolver, - I18nBreadcrumbsService - ] + I18nBreadcrumbsService, + ], }) export class AdminRoutingModule { diff --git a/src/app/admin/admin-search-page/admin-search-page.component.spec.ts b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts index 7be486d7da..15b52a7470 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts @@ -10,7 +10,7 @@ describe('AdminSearchPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [AdminSearchPageComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-page.component.ts b/src/app/admin/admin-search-page/admin-search-page.component.ts index c9c6b84245..dcb97cf8d8 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.ts @@ -4,7 +4,7 @@ import { Context } from '../../core/shared/context.model'; @Component({ selector: 'ds-admin-search-page', templateUrl: './admin-search-page.component.html', - styleUrls: ['./admin-search-page.component.scss'] + styleUrls: ['./admin-search-page.component.scss'], }) /** diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts index 1ea27b36b6..29c45a9b60 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts @@ -37,7 +37,7 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { } const linkService = jasmine.createSpyObj('linkService', { - resolveLink: {} + resolveLink: {}, }); beforeEach(waitForAsync(() => { @@ -47,7 +47,7 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - SharedModule + SharedModule, ], declarations: [CollectionAdminSearchResultGridElementComponent], providers: [ @@ -58,7 +58,7 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { { provide: FileService, useClass: FileServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, - ] + ], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts index 1412090e0f..afbea43e58 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts @@ -11,7 +11,7 @@ import { getCollectionEditRoute } from '../../../../../collection-page/collectio @Component({ selector: 'ds-collection-admin-search-result-list-element', styleUrls: ['./collection-admin-search-result-grid-element.component.scss'], - templateUrl: './collection-admin-search-result-grid-element.component.html' + templateUrl: './collection-admin-search-result-grid-element.component.html', }) /** * The component for displaying a list element for a collection search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts index 996366e20a..7c867606b4 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts @@ -39,7 +39,7 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { } const linkService = jasmine.createSpyObj('linkService', { - resolveLink: {} + resolveLink: {}, }); beforeEach(waitForAsync(() => { @@ -49,7 +49,7 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - SharedModule + SharedModule, ], declarations: [CommunityAdminSearchResultGridElementComponent], providers: [ @@ -61,7 +61,7 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts index b0d603338b..b5d161ed8b 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts @@ -11,7 +11,7 @@ import { getCommunityEditRoute } from '../../../../../community-page/community-p @Component({ selector: 'ds-community-admin-search-result-grid-element', styleUrls: ['./community-admin-search-result-grid-element.component.scss'], - templateUrl: './community-admin-search-result-grid-element.component.html' + templateUrl: './community-admin-search-result-grid-element.component.html', }) /** * The component for displaying a list element for a community search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts index ee3de42131..b14f09eb1b 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts @@ -36,13 +36,13 @@ describe('ItemAdminSearchResultGridElementComponent', () => { const mockBitstreamDataService = { getThumbnailFor(item: Item): Observable> { return createSuccessfulRemoteDataObject$(new Bitstream()); - } + }, }; const mockAccessStatusDataService = { findAccessStatusFor(item: Item): Observable> { return createSuccessfulRemoteDataObject$(new AccessStatusObject()); - } + }, }; const mockThemeService = getMockThemeService(); @@ -63,7 +63,7 @@ describe('ItemAdminSearchResultGridElementComponent', () => { NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - SharedModule + SharedModule, ], providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, @@ -74,7 +74,7 @@ describe('ItemAdminSearchResultGridElementComponent', () => { { provide: FileService, useClass: FileServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts index dab6694f36..95432217d2 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts @@ -3,7 +3,7 @@ import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { getListableObjectComponent, - listableObjectComponent + listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { Context } from '../../../../../core/shared/context.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; @@ -19,7 +19,7 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service @Component({ selector: 'ds-item-admin-search-result-grid-element', styleUrls: ['./item-admin-search-result-grid-element.component.scss'], - templateUrl: './item-admin-search-result-grid-element.component.html' + templateUrl: './item-admin-search-result-grid-element.component.html', }) /** * The component for displaying a list element for an item search result on the admin search page @@ -55,7 +55,7 @@ export class ItemAdminSearchResultGridElementComponent extends SearchResultGridE undefined, [ [this.badges.nativeElement], - [this.buttons.nativeElement] + [this.buttons.nativeElement], ]); (componentRef.instance as any).object = this.object; (componentRef.instance as any).index = this.index; diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts index 8937847ff5..69372607a8 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts @@ -34,13 +34,13 @@ describe('CollectionAdminSearchResultListElementComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [CollectionAdminSearchResultListElementComponent], providers: [{ provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts index 8bcf20b230..7e6f904549 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts @@ -11,7 +11,7 @@ import { getCollectionEditRoute } from '../../../../../collection-page/collectio @Component({ selector: 'ds-collection-admin-search-result-list-element', styleUrls: ['./collection-admin-search-result-list-element.component.scss'], - templateUrl: './collection-admin-search-result-list-element.component.html' + templateUrl: './collection-admin-search-result-list-element.component.html', }) /** * The component for displaying a list element for a collection search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts index 110d77b1e5..aeffe22d4c 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts @@ -34,13 +34,13 @@ describe('CommunityAdminSearchResultListElementComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [CommunityAdminSearchResultListElementComponent], providers: [{ provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts index 9419ae3f3f..59b096b436 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts @@ -11,7 +11,7 @@ import { getCommunityEditRoute } from '../../../../../community-page/community-p @Component({ selector: 'ds-community-admin-search-result-list-element', styleUrls: ['./community-admin-search-result-list-element.component.scss'], - templateUrl: './community-admin-search-result-list-element.component.html' + templateUrl: './community-admin-search-result-list-element.component.html', }) /** * The component for displaying a list element for a community search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts index 667e8edea9..9713925337 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts @@ -31,13 +31,13 @@ describe('ItemAdminSearchResultListElementComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [ItemAdminSearchResultListElementComponent], providers: [{ provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts index b1dea11341..2b735bc6e2 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts @@ -10,7 +10,7 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l @Component({ selector: 'ds-item-admin-search-result-list-element', styleUrls: ['./item-admin-search-result-list-element.component.scss'], - templateUrl: './item-admin-search-result-list-element.component.html' + templateUrl: './item-admin-search-result-list-element.component.html', }) /** * The component for displaying a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts index f354ac5f89..6e86802b57 100644 --- a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts @@ -14,7 +14,7 @@ import { ITEM_EDIT_PRIVATE_PATH, ITEM_EDIT_PUBLIC_PATH, ITEM_EDIT_REINSTATE_PATH, - ITEM_EDIT_WITHDRAW_PATH + ITEM_EDIT_WITHDRAW_PATH, } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; describe('ItemAdminSearchResultActionsComponent', () => { @@ -34,10 +34,10 @@ describe('ItemAdminSearchResultActionsComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [ItemAdminSearchResultActionsComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts index fcc3cf0f17..676c51bc36 100644 --- a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts @@ -8,13 +8,13 @@ import { ITEM_EDIT_PUBLIC_PATH, ITEM_EDIT_PRIVATE_PATH, ITEM_EDIT_REINSTATE_PATH, - ITEM_EDIT_WITHDRAW_PATH + ITEM_EDIT_WITHDRAW_PATH, } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; @Component({ selector: 'ds-item-admin-search-result-actions-element', styleUrls: ['./item-admin-search-result-actions.component.scss'], - templateUrl: './item-admin-search-result-actions.component.html' + templateUrl: './item-admin-search-result-actions.component.html', }) /** * The component for displaying the actions for a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search.module.ts b/src/app/admin/admin-search-page/admin-search.module.ts index 353d6dd498..7046688cdf 100644 --- a/src/app/admin/admin-search-page/admin-search.module.ts +++ b/src/app/admin/admin-search-page/admin-search.module.ts @@ -20,7 +20,7 @@ const ENTRY_COMPONENTS = [ ItemAdminSearchResultGridElementComponent, CommunityAdminSearchResultGridElementComponent, CollectionAdminSearchResultGridElementComponent, - ItemAdminSearchResultActionsComponent + ItemAdminSearchResultActionsComponent, ]; @NgModule({ @@ -28,12 +28,12 @@ const ENTRY_COMPONENTS = [ SearchModule, SharedModule.withEntryComponents(), JournalEntitiesModule.withEntryComponents(), - ResearchEntitiesModule.withEntryComponents() + ResearchEntitiesModule.withEntryComponents(), ], declarations: [ AdminSearchPageComponent, - ...ENTRY_COMPONENTS - ] + ...ENTRY_COMPONENTS, + ], }) export class AdminSearchModule { /** @@ -43,7 +43,7 @@ export class AdminSearchModule { static withEntryComponents() { return { ngModule: SharedModule, - providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) + providers: ENTRY_COMPONENTS.map((component) => ({provide: component})), }; } } diff --git a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts index 260a364d7a..914003be0c 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts @@ -27,11 +27,11 @@ describe('AdminSidebarSectionComponent', () => { {provide: 'sectionDataProvider', useValue: {model: {link: 'google.com'}, icon: iconString}}, {provide: MenuService, useValue: menuService}, {provide: CSSVariableService, useClass: CSSVariableServiceStub}, - ] + ], }).overrideComponent(AdminSidebarSectionComponent, { set: { - entryComponents: [TestComponent] - } + entryComponents: [TestComponent], + }, }) .compileComponents(); })); @@ -67,11 +67,11 @@ describe('AdminSidebarSectionComponent', () => { {provide: 'sectionDataProvider', useValue: {model: {link: 'google.com', disabled: true}, icon: iconString}}, {provide: MenuService, useValue: menuService}, {provide: CSSVariableService, useClass: CSSVariableServiceStub}, - ] + ], }).overrideComponent(AdminSidebarSectionComponent, { set: { - entryComponents: [TestComponent] - } + entryComponents: [TestComponent], + }, }) .compileComponents(); })); @@ -102,7 +102,7 @@ describe('AdminSidebarSectionComponent', () => { // declare a test component @Component({ selector: 'ds-test-cmp', - template: `` + template: ``, }) class TestComponent { } diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts index 88efd2a711..901d4954b1 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts @@ -37,23 +37,23 @@ describe('AdminSidebarComponent', () => { lastModified: '2018', _links: { self: { - href: 'https://localhost:8000/items/fake-id' - } - } + href: 'https://localhost:8000/items/fake-id', + }, + }, }); const routeStub = { data: observableOf({ - dso: createSuccessfulRemoteDataObject(mockItem) + dso: createSuccessfulRemoteDataObject(mockItem), }), - children: [] + children: [], }; beforeEach(waitForAsync(() => { authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) }); TestBed.configureTestingModule({ @@ -72,15 +72,15 @@ describe('AdminSidebarComponent', () => { { provide: NgbModal, useValue: { open: () => {/*comment*/ - } - } - } + }, + }, + }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(AdminSidebarComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, - } + }, }).compileComponents(); })); @@ -146,7 +146,7 @@ describe('AdminSidebarComponent', () => { const sidebarToggler = fixture.debugElement.query(By.css('#sidebar-collapse-toggle > a')); sidebarToggler.triggerEventHandler('click', { preventDefault: () => {/**/ - } + }, }); }); @@ -161,7 +161,7 @@ describe('AdminSidebarComponent', () => { const sidebarToggler = fixture.debugElement.query(By.css('nav.navbar')); sidebarToggler.triggerEventHandler('mouseenter', { preventDefault: () => {/**/ - } + }, }); tick(99); expect(menuService.expandMenuPreview).not.toHaveBeenCalled(); @@ -176,7 +176,7 @@ describe('AdminSidebarComponent', () => { const sidebarToggler = fixture.debugElement.query(By.css('nav.navbar')); sidebarToggler.triggerEventHandler('mouseleave', { preventDefault: () => {/**/ - } + }, }); tick(399); expect(menuService.collapseMenuPreview).not.toHaveBeenCalled(); diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.ts index 26ded965d4..e8e3e63361 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -18,7 +18,7 @@ import { ThemeService } from '../../shared/theme-support/theme.service'; selector: 'ds-admin-sidebar', templateUrl: './admin-sidebar.component.html', styleUrls: ['./admin-sidebar.component.scss'], - animations: [slideSidebar] + animations: [slideSidebar], }) export class AdminSidebarComponent extends MenuComponent implements OnInit { /** @@ -58,7 +58,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit { private authService: AuthService, public authorizationService: AuthorizationDataService, public route: ActivatedRoute, - protected themeService: ThemeService + protected themeService: ThemeService, ) { super(menuService, injector, authorizationService, route, themeService); this.inFocus$ = new BehaviorSubject(false); @@ -83,13 +83,13 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit { }); this.sidebarExpanded = combineLatest([this.menuCollapsed, this.menuPreviewCollapsed]) .pipe( - map(([collapsed, previewCollapsed]) => (!collapsed || !previewCollapsed)) + map(([collapsed, previewCollapsed]) => (!collapsed || !previewCollapsed)), ); this.inFocus$.pipe( debounceTime(50), distinctUntilChanged(), // disregard focusout in situations like --(focusout)-(focusin)-- withLatestFrom( - combineLatest([this.menuCollapsed, this.menuPreviewCollapsed]) + combineLatest([this.menuCollapsed, this.menuPreviewCollapsed]), ), ).subscribe(([inFocus, [collapsed, previewCollapsed]]) => { if (collapsed) { diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts index dd31f757c2..5975fb5d73 100644 --- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts +++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts @@ -27,11 +27,11 @@ describe('ExpandableAdminSidebarSectionComponent', () => { { provide: MenuService, useValue: menuService }, { provide: CSSVariableService, useClass: CSSVariableServiceStub }, { provide: Router, useValue: new RouterStub() }, - ] + ], }).overrideComponent(ExpandableAdminSidebarSectionComponent, { set: { - entryComponents: [TestComponent] - } + entryComponents: [TestComponent], + }, }) .compileComponents(); })); @@ -59,7 +59,7 @@ describe('ExpandableAdminSidebarSectionComponent', () => { const sidebarToggler = fixture.debugElement.query(By.css('.sidebar-section > div.nav-item')); sidebarToggler.triggerEventHandler('click', { preventDefault: () => {/**/ - } + }, }); }); @@ -72,7 +72,7 @@ describe('ExpandableAdminSidebarSectionComponent', () => { // declare a test component @Component({ selector: 'ds-test-cmp', - template: `` + template: ``, }) class TestComponent { } diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts index 4555c0fa93..f3e464e2f0 100644 --- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts +++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts @@ -19,7 +19,7 @@ import { Router } from '@angular/router'; selector: 'li[ds-expandable-admin-sidebar-section]', templateUrl: './expandable-admin-sidebar-section.component.html', styleUrls: ['./expandable-admin-sidebar-section.component.scss'], - animations: [rotate, slide, bgColor] + animations: [rotate, slide, bgColor], }) @rendersSectionForMenu(MenuID.ADMIN, true) @@ -70,7 +70,7 @@ export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionC this.sidebarPreviewCollapsed = this.menuService.isMenuPreviewCollapsed(this.menuID); this.expanded = combineLatestObservable(this.active, this.sidebarCollapsed, this.sidebarPreviewCollapsed) .pipe( - map(([active, sidebarCollapsed, sidebarPreviewCollapsed]) => (active && (!sidebarCollapsed || !sidebarPreviewCollapsed))) + map(([active, sidebarCollapsed, sidebarPreviewCollapsed]) => (active && (!sidebarCollapsed || !sidebarPreviewCollapsed))), ); } } diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts index c80bc677f2..834cc0acc5 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts @@ -10,7 +10,7 @@ describe('AdminSearchPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [AdminWorkflowPageComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts index c3ccc9555a..434255827f 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts @@ -4,7 +4,7 @@ import { Context } from '../../core/shared/context.model'; @Component({ selector: 'ds-admin-workflow-page', templateUrl: './admin-workflow-page.component.html', - styleUrls: ['./admin-workflow-page.component.scss'] + styleUrls: ['./admin-workflow-page.component.scss'], }) /** diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts index 04377fcc81..ea23c5666f 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts @@ -9,7 +9,7 @@ import { WorkflowItemAdminWorkflowActionsComponent } from './workflow-item-admin import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { getWorkflowItemDeleteRoute, - getWorkflowItemSendBackRoute + getWorkflowItemSendBackRoute, } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { of } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; @@ -37,10 +37,10 @@ describe('WorkflowItemAdminWorkflowActionsComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [WorkflowItemAdminWorkflowActionsComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts index 480c48f25e..e1c5b9dd2a 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts @@ -3,13 +3,13 @@ import { Component, Input } from '@angular/core'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { getWorkflowItemDeleteRoute, - getWorkflowItemSendBackRoute + getWorkflowItemSendBackRoute, } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; @Component({ selector: 'ds-workflow-item-admin-workflow-actions-element', styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'], - templateUrl: './workflow-item-admin-workflow-actions.component.html' + templateUrl: './workflow-item-admin-workflow-actions.component.html', }) /** * The component for displaying the actions for a list element for a workflow-item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts index 6e917ed088..7748c66011 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts @@ -17,7 +17,7 @@ describe('SupervisionOrderGroupSelectorComponent', () => { const modalStub = jasmine.createSpyObj('modalStub', ['close']); const supervisionOrderDataService: any = jasmine.createSpyObj('supervisionOrderDataService', { - create: of(new SupervisionOrder()) + create: of(new SupervisionOrder()), }); const selectedOrderType = 'NONE'; @@ -38,7 +38,7 @@ describe('SupervisionOrderGroupSelectorComponent', () => { { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, { provide: NotificationsService, useValue: {} }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts index 0671fc808b..2e3e6c64ea 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts @@ -21,14 +21,14 @@ describe('SupervisionOrderStatusComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) + useClass: TranslateLoaderMock, + }, + }), ], declarations: [ SupervisionOrderStatusComponent, VarDirective ], schemas: [ - NO_ERRORS_SCHEMA - ] + NO_ERRORS_SCHEMA, + ], }) .compileComponents(); }); @@ -38,7 +38,7 @@ describe('SupervisionOrderStatusComponent', () => { component = fixture.componentInstance; component.supervisionOrderList = supervisionOrderListMock; component.ngOnChanges( { - supervisionOrderList: new SimpleChange(null, supervisionOrderListMock, true) + supervisionOrderList: new SimpleChange(null, supervisionOrderListMock, true), }); fixture.detectChanges(); }); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts index 93c6441e92..5a4fe34fc0 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts @@ -18,7 +18,7 @@ export interface SupervisionOrderListEntry { @Component({ selector: 'ds-supervision-order-status', templateUrl: './supervision-order-status.component.html', - styleUrls: ['./supervision-order-status.component.scss'] + styleUrls: ['./supervision-order-status.component.scss'], }) export class SupervisionOrderStatusComponent implements OnChanges { @@ -61,13 +61,13 @@ export class SupervisionOrderStatusComponent implements OnChanges { if (sogRD.hasSucceeded) { const entry: SupervisionOrderListEntry = { supervisionOrder: so, - group: sogRD.payload + group: sogRD.payload, }; return entry; } else { return null; } - }) + }), )), reduce((acc: SupervisionOrderListEntry[], value: any) => { if (isNotEmpty(value)) { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts index 0c5ac008e4..0a6e0ba6ec 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts @@ -24,7 +24,7 @@ import { SupervisionOrderDataService } from '../../../../../core/supervision-ord import { ConfirmationModalComponent } from '../../../../../shared/confirmation-modal/confirmation-modal.component'; import { supervisionOrderEntryMock } from '../../../../../shared/testing/supervision-order.mock'; import { - SupervisionOrderGroupSelectorComponent + SupervisionOrderGroupSelectorComponent, } from './supervision-order-group-selector/supervision-order-group-selector.component'; describe('WorkspaceItemAdminWorkflowActionsComponent', () => { @@ -56,15 +56,15 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => { imports: [ NgbModalModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), ], declarations: [WorkspaceItemAdminWorkflowActionsComponent], providers: [ { provide: DSONameService, useClass: DSONameServiceMock }, { provide: NotificationsService, useValue: notificationService }, - { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService } + { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); @@ -97,7 +97,7 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => { beforeEach(() => { spyOn(component.delete, 'emit'); spyOn((component as any).modalService, 'open').and.returnValue({ - componentInstance: { response: of(true) } + componentInstance: { response: of(true) }, }); }); @@ -138,7 +138,7 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => { beforeEach(() => { spyOn(component.create, 'emit'); spyOn((component as any).modalService, 'open').and.returnValue({ - componentInstance: { create: of(true) } + componentInstance: { create: of(true) }, }); }); @@ -146,7 +146,7 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => { component.openSupervisionModal(); expect((component as any).modalService.open).toHaveBeenCalledWith(SupervisionOrderGroupSelectorComponent, { size: 'lg', - backdrop: 'static' + backdrop: 'static', }); expect(component.create.emit).toHaveBeenCalled(); }); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts index 7bf9c6d816..b51e2abeab 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts @@ -8,10 +8,10 @@ import { TranslateService } from '@ngx-translate/core'; import { Item } from '../../../../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators'; import { - SupervisionOrderGroupSelectorComponent + SupervisionOrderGroupSelectorComponent, } from './supervision-order-group-selector/supervision-order-group-selector.component'; import { - getWorkspaceItemDeleteRoute + getWorkspaceItemDeleteRoute, } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; @@ -28,7 +28,7 @@ import { getSearchResultFor } from '../../../../../shared/search/search-result-e @Component({ selector: 'ds-workspace-item-admin-workflow-actions-element', styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'], - templateUrl: './workspace-item-admin-workflow-actions.component.html' + templateUrl: './workspace-item-admin-workflow-actions.component.html', }) /** * The component for displaying the actions for a list element for a workspace-item on the admin workflow search page @@ -94,7 +94,7 @@ export class WorkspaceItemAdminWorkflowActionsComponent implements OnInit { ); item$.pipe( - map((item: Item) => this.getPoliciesRoute(item)) + map((item: Item) => this.getPoliciesRoute(item)), ).subscribe((route: string[]) => { this.resourcePoliciesPageRoute = route; }); @@ -143,22 +143,22 @@ export class WorkspaceItemAdminWorkflowActionsComponent implements OnInit { null, this.translateService.get( this.messagePrefix + '.notification.deleted.success', - { name: this.dsoNameService.getName(supervisionOrderEntry.group) } - ) + { name: this.dsoNameService.getName(supervisionOrderEntry.group) }, + ), ); } else { this.notificationsService.error( null, this.translateService.get( this.messagePrefix + '.notification.deleted.failure', - { name: this.dsoNameService.getName(supervisionOrderEntry.group) } - ) + { name: this.dsoNameService.getName(supervisionOrderEntry.group) }, + ), ); } - }) + }), ); } - }) + }), ).subscribe((result: boolean) => { if (result) { this.delete.emit(this.convertReloadedObject()); @@ -172,7 +172,7 @@ export class WorkspaceItemAdminWorkflowActionsComponent implements OnInit { openSupervisionModal() { const supervisionModal: NgbModalRef = this.modalService.open(SupervisionOrderGroupSelectorComponent, { size: 'lg', - backdrop: 'static' + backdrop: 'static', }); supervisionModal.componentInstance.itemUUID = this.item.uuid; supervisionModal.componentInstance.create.subscribe(() => { @@ -186,7 +186,7 @@ export class WorkspaceItemAdminWorkflowActionsComponent implements OnInit { private convertReloadedObject(): DSpaceObject { const constructor = getSearchResultFor((this.wsi as any).constructor); return Object.assign(new constructor(), this.wsi, { - indexableObject: this.wsi + indexableObject: this.wsi, }); } } diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts index 8035c53547..8a7c4246a9 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -8,20 +8,20 @@ import { CollectionElementLinkType } from '../../../../../shared/object-collecti import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { RouterTestingModule } from '@angular/router/testing'; import { - WorkflowItemSearchResultAdminWorkflowGridElementComponent + WorkflowItemSearchResultAdminWorkflowGridElementComponent, } from './workflow-item-search-result-admin-workflow-grid-element.component'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; import { Item } from '../../../../../core/shared/item.model'; import { - ItemGridElementComponent + ItemGridElementComponent, } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; import { - ListableObjectDirective + ListableObjectDirective, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive'; import { - WorkflowItemSearchResult + WorkflowItemSearchResult, } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; @@ -67,16 +67,16 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => { { provide: TruncatableService, useValue: { isCollapsed: () => observableOf(true), - } + }, }, { provide: BitstreamDataService, useValue: {} }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(WorkflowItemSearchResultAdminWorkflowGridElementComponent, { set: { - entryComponents: [ItemGridElementComponent] - } + entryComponents: [ItemGridElementComponent], + }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts index 8e7b381eb6..3d7e33efe0 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts @@ -3,7 +3,7 @@ import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { getListableObjectComponent, - listableObjectComponent + listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { Context } from '../../../../../core/shared/context.model'; import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; @@ -18,7 +18,7 @@ import { followLink } from '../../../../../shared/utils/follow-link-config.model import { RemoteData } from '../../../../../core/data/remote-data'; import { getAllSucceededRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../../../../core/shared/operators'; import { take } from 'rxjs/operators'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; @@ -29,7 +29,7 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service @Component({ selector: 'ds-workflow-item-search-result-admin-workflow-grid-element', styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'], - templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html' + templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html', }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page @@ -61,7 +61,7 @@ export class WorkflowItemSearchResultAdminWorkflowGridElementComponent extends S private linkService: LinkService, protected truncatableService: TruncatableService, private themeService: ThemeService, - protected bitstreamDataService: BitstreamDataService + protected bitstreamDataService: BitstreamDataService, ) { super(dsoNameService, truncatableService, bitstreamDataService); } @@ -86,14 +86,14 @@ export class WorkflowItemSearchResultAdminWorkflowGridElementComponent extends S undefined, [ [this.badges.nativeElement], - [this.buttons.nativeElement] + [this.buttons.nativeElement], ]); (componentRef.instance as any).object = item; (componentRef.instance as any).index = this.index; (componentRef.instance as any).linkType = this.linkType; (componentRef.instance as any).listID = this.listID; componentRef.changeDetectorRef.detectChanges(); - } + }, ); } diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts index b9e752c104..74f9baa1e6 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -10,20 +10,20 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { - WorkspaceItemSearchResultAdminWorkflowGridElementComponent + WorkspaceItemSearchResultAdminWorkflowGridElementComponent, } from './workspace-item-search-result-admin-workflow-grid-element.component'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; import { Item } from '../../../../../core/shared/item.model'; import { - ItemGridElementComponent + ItemGridElementComponent, } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; import { - ListableObjectDirective + ListableObjectDirective, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive'; import { - WorkflowItemSearchResult + WorkflowItemSearchResult, } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; @@ -32,7 +32,7 @@ import { getMockThemeService } from '../../../../../shared/mocks/theme-service.m import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { supervisionOrderPaginatedListRD, - supervisionOrderPaginatedListRD$ + supervisionOrderPaginatedListRD$, } from '../../../../../shared/testing/supervision-order.mock'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; @@ -79,17 +79,17 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => { { provide: TruncatableService, useValue: { isCollapsed: () => observableOf(true), - } + }, }, { provide: BitstreamDataService, useValue: {} }, - { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService } + { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(WorkspaceItemSearchResultAdminWorkflowGridElementComponent, { set: { - entryComponents: [ItemGridElementComponent] - } + entryComponents: [ItemGridElementComponent], + }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts index d37b45bf9d..4ebc8ac6d9 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts @@ -7,17 +7,17 @@ import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { getListableObjectComponent, - listableObjectComponent + listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { Context } from '../../../../../core/shared/context.model'; import { - SearchResultGridElementComponent + SearchResultGridElementComponent, } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; import { - ListableObjectDirective + ListableObjectDirective, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; import { LinkService } from '../../../../../core/cache/builders/link.service'; @@ -26,10 +26,10 @@ import { RemoteData } from '../../../../../core/data/remote-data'; import { getAllSucceededRemoteData, getFirstCompletedRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../../../../core/shared/operators'; import { - WorkspaceItemSearchResult + WorkspaceItemSearchResult, } from '../../../../../shared/object-collection/shared/workspace-item-search-result.model'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; @@ -42,7 +42,7 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service @Component({ selector: 'ds-workflow-item-search-result-admin-workflow-grid-element', styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'], - templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html' + templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html', }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page @@ -111,20 +111,20 @@ export class WorkspaceItemSearchResultAdminWorkflowGridElementComponent extends undefined, [ [this.badges.nativeElement], - [this.buttons.nativeElement] + [this.buttons.nativeElement], ]); (componentRef.instance as any).object = item; (componentRef.instance as any).index = this.index; (componentRef.instance as any).linkType = this.linkType; (componentRef.instance as any).listID = this.listID; componentRef.changeDetectorRef.detectChanges(); - } + }, ); this.item$.pipe( take(1), tap((item: Item) => this.itemId = item.id), - mergeMap((item: Item) => this.retrieveSupervisorOrders(item.id)) + mergeMap((item: Item) => this.retrieveSupervisorOrders(item.id)), ).subscribe((supervisionOrderList: SupervisionOrder[]) => { this.supervisionOrder$.next(supervisionOrderList); }); @@ -147,10 +147,10 @@ export class WorkspaceItemSearchResultAdminWorkflowGridElementComponent extends */ private retrieveSupervisorOrders(itemId): Observable { return this.supervisionOrderDataService.searchByItem( - itemId, false, true, followLink('group') + itemId, false, true, followLink('group'), ).pipe( getFirstCompletedRemoteData(), - map((soRD: RemoteData>) => soRD.hasSucceeded && !soRD.hasNoContent ? soRD.payload.page : []) + map((soRD: RemoteData>) => soRD.hasSucceeded && !soRD.hasNoContent ? soRD.payload.page : []), ); } diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts index ab5d8b79a8..98e3d3fb78 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts @@ -10,13 +10,13 @@ import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { RouterTestingModule } from '@angular/router/testing'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { - WorkflowItemSearchResultAdminWorkflowListElementComponent + WorkflowItemSearchResultAdminWorkflowListElementComponent, } from './workflow-item-search-result-admin-workflow-list-element.component'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; import { Item } from '../../../../../core/shared/item.model'; import { - WorkflowItemSearchResult + WorkflowItemSearchResult, } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; @@ -58,9 +58,9 @@ describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => { { provide: TruncatableService, useValue: mockTruncatableService }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environment }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts index d0e773d696..43e8bfc1c4 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts @@ -1,7 +1,7 @@ import { Component, Inject, OnInit } from '@angular/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { - listableObjectComponent + listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { Context } from '../../../../../core/shared/context.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; @@ -12,11 +12,11 @@ import { RemoteData } from '../../../../../core/data/remote-data'; import { getAllSucceededRemoteData, getRemoteDataPayload } from '../../../../../core/shared/operators'; import { Item } from '../../../../../core/shared/item.model'; import { - SearchResultListElementComponent + SearchResultListElementComponent, } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { - WorkflowItemSearchResult + WorkflowItemSearchResult, } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; @@ -25,7 +25,7 @@ import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.inter @Component({ selector: 'ds-workflow-item-search-result-admin-workflow-list-element', styleUrls: ['./workflow-item-search-result-admin-workflow-list-element.component.scss'], - templateUrl: './workflow-item-search-result-admin-workflow-list-element.component.html' + templateUrl: './workflow-item-search-result-admin-workflow-list-element.component.html', }) /** * The component for displaying a list element for a workflow item on the admin workflow search page @@ -40,7 +40,7 @@ export class WorkflowItemSearchResultAdminWorkflowListElementComponent extends S constructor(private linkService: LinkService, protected truncatableService: TruncatableService, public dsoNameService: DSONameService, - @Inject(APP_CONFIG) protected appConfig: AppConfig + @Inject(APP_CONFIG) protected appConfig: AppConfig, ) { super(truncatableService, dsoNameService, appConfig); } diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts index 19eefc9c48..d8dc114f76 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts @@ -11,13 +11,13 @@ import { CollectionElementLinkType } from '../../../../../shared/object-collecti import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { - WorkspaceItemSearchResultAdminWorkflowListElementComponent + WorkspaceItemSearchResultAdminWorkflowListElementComponent, } from './workspace-item-search-result-admin-workflow-list-element.component'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; import { Item } from '../../../../../core/shared/item.model'; import { - WorkflowItemSearchResult + WorkflowItemSearchResult, } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; @@ -28,7 +28,7 @@ import { environment } from '../../../../../../environments/environment'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { supervisionOrderPaginatedListRD, - supervisionOrderPaginatedListRD$ + supervisionOrderPaginatedListRD$, } from '../../../../../shared/testing/supervision-order.mock'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; @@ -71,9 +71,9 @@ describe('WorkspaceItemSearchResultAdminWorkflowListElementComponent', () => { { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environment }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts index 3d6d1c8e44..43f6bc9af7 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts @@ -5,7 +5,7 @@ import { map, mergeMap, take, tap } from 'rxjs/operators'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { - listableObjectComponent + listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { Context } from '../../../../../core/shared/context.model'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; @@ -15,17 +15,17 @@ import { RemoteData } from '../../../../../core/data/remote-data'; import { getAllSucceededRemoteData, getFirstCompletedRemoteData, - getRemoteDataPayload + getRemoteDataPayload, } from '../../../../../core/shared/operators'; import { Item } from '../../../../../core/shared/item.model'; import { - SearchResultListElementComponent + SearchResultListElementComponent, } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; import { - WorkspaceItemSearchResult + WorkspaceItemSearchResult, } from '../../../../../shared/object-collection/shared/workspace-item-search-result.model'; import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; @@ -36,7 +36,7 @@ import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; @Component({ selector: 'ds-workflow-item-search-result-admin-workflow-list-element', styleUrls: ['./workspace-item-search-result-admin-workflow-list-element.component.scss'], - templateUrl: './workspace-item-search-result-admin-workflow-list-element.component.html' + templateUrl: './workspace-item-search-result-admin-workflow-list-element.component.html', }) /** * The component for displaying a list element for a workflow item on the admin workflow search page @@ -62,7 +62,7 @@ export class WorkspaceItemSearchResultAdminWorkflowListElementComponent extends public dsoNameService: DSONameService, protected supervisionOrderDataService: SupervisionOrderDataService, protected truncatableService: TruncatableService, - @Inject(APP_CONFIG) protected appConfig: AppConfig + @Inject(APP_CONFIG) protected appConfig: AppConfig, ) { super(truncatableService, dsoNameService, appConfig); } @@ -78,7 +78,7 @@ export class WorkspaceItemSearchResultAdminWorkflowListElementComponent extends this.item$.pipe( take(1), tap((item: Item) => this.itemId = item.id), - mergeMap((item: Item) => this.retrieveSupervisorOrders(item.id)) + mergeMap((item: Item) => this.retrieveSupervisorOrders(item.id)), ).subscribe((supervisionOrderList: SupervisionOrder[]) => { this.supervisionOrder$.next(supervisionOrderList); }); @@ -92,10 +92,10 @@ export class WorkspaceItemSearchResultAdminWorkflowListElementComponent extends */ private retrieveSupervisorOrders(itemId): Observable { return this.supervisionOrderDataService.searchByItem( - itemId, false, true, followLink('group') + itemId, false, true, followLink('group'), ).pipe( getFirstCompletedRemoteData(), - map((soRD: RemoteData>) => soRD.hasSucceeded && !soRD.hasNoContent ? soRD.payload.page : []) + map((soRD: RemoteData>) => soRD.hasSucceeded && !soRD.hasNoContent ? soRD.payload.page : []), ); } diff --git a/src/app/admin/admin-workflow-page/admin-workflow.module.ts b/src/app/admin/admin-workflow-page/admin-workflow.module.ts index 21990c1ea9..9191740f67 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow.module.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow.module.ts @@ -2,30 +2,30 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../shared/shared.module'; import { - WorkflowItemSearchResultAdminWorkflowGridElementComponent + WorkflowItemSearchResultAdminWorkflowGridElementComponent, } from './admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component'; import { - WorkflowItemAdminWorkflowActionsComponent + WorkflowItemAdminWorkflowActionsComponent, } from './admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component'; import { - WorkflowItemSearchResultAdminWorkflowListElementComponent + WorkflowItemSearchResultAdminWorkflowListElementComponent, } from './admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component'; import { AdminWorkflowPageComponent } from './admin-workflow-page.component'; import { SearchModule } from '../../shared/search/search.module'; import { - WorkspaceItemAdminWorkflowActionsComponent + WorkspaceItemAdminWorkflowActionsComponent, } from './admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component'; import { - WorkspaceItemSearchResultAdminWorkflowListElementComponent + WorkspaceItemSearchResultAdminWorkflowListElementComponent, } from './admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component'; import { - WorkspaceItemSearchResultAdminWorkflowGridElementComponent + WorkspaceItemSearchResultAdminWorkflowGridElementComponent, } from './admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component'; import { - SupervisionOrderGroupSelectorComponent + SupervisionOrderGroupSelectorComponent, } from './admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component'; import { - SupervisionOrderStatusComponent + SupervisionOrderStatusComponent, } from './admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component'; const ENTRY_COMPONENTS = [ @@ -33,13 +33,13 @@ const ENTRY_COMPONENTS = [ WorkflowItemSearchResultAdminWorkflowListElementComponent, WorkflowItemSearchResultAdminWorkflowGridElementComponent, WorkspaceItemSearchResultAdminWorkflowListElementComponent, - WorkspaceItemSearchResultAdminWorkflowGridElementComponent + WorkspaceItemSearchResultAdminWorkflowGridElementComponent, ]; @NgModule({ imports: [ SearchModule, - SharedModule.withEntryComponents() + SharedModule.withEntryComponents(), ], declarations: [ AdminWorkflowPageComponent, @@ -47,11 +47,11 @@ const ENTRY_COMPONENTS = [ SupervisionOrderStatusComponent, WorkflowItemAdminWorkflowActionsComponent, WorkspaceItemAdminWorkflowActionsComponent, - ...ENTRY_COMPONENTS + ...ENTRY_COMPONENTS, ], exports: [ - AdminWorkflowPageComponent - ] + AdminWorkflowPageComponent, + ], }) export class AdminWorkflowModuleModule { /** @@ -61,7 +61,7 @@ export class AdminWorkflowModuleModule { static withEntryComponents() { return { ngModule: SharedModule, - providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) + providers: ENTRY_COMPONENTS.map((component) => ({provide: component})), }; } } diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 3dc0036854..500cc0406d 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -34,8 +34,8 @@ const ENTRY_COMPONENTS = [ declarations: [ AdminCurationTasksComponent, MetadataImportPageComponent, - BatchImportPageComponent - ] + BatchImportPageComponent, + ], }) export class AdminModule { /** @@ -45,7 +45,7 @@ export class AdminModule { static withEntryComponents() { return { ngModule: AdminModule, - providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) + providers: ENTRY_COMPONENTS.map((component) => ({provide: component})), }; } } diff --git a/src/app/app-routing-paths.ts b/src/app/app-routing-paths.ts index fe2837c6e3..bf7f47032b 100644 --- a/src/app/app-routing-paths.ts +++ b/src/app/app-routing-paths.ts @@ -27,8 +27,8 @@ export function getBitstreamRequestACopyRoute(item, bitstream): { routerLink: st return { routerLink: url, queryParams: { - bitstream: bitstream.uuid - } + bitstream: bitstream.uuid, + }, }; } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 5a14779abb..53e50586ac 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -4,7 +4,7 @@ import { AuthBlockingGuard } from './core/auth/auth-blocking.guard'; import { AuthenticatedGuard } from './core/auth/authenticated.guard'; import { - SiteAdministratorGuard + SiteAdministratorGuard, } from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { ACCESS_CONTROL_MODULE_PATH, @@ -32,10 +32,10 @@ import { SiteRegisterGuard } from './core/data/feature-authorization/feature-aut import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component'; import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component'; import { - GroupAdministratorGuard + GroupAdministratorGuard, } from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; import { - ThemedPageInternalServerErrorComponent + ThemedPageInternalServerErrorComponent, } from './page-internal-server-error/themed-page-internal-server-error.component'; import { ServerCheckGuard } from './core/server-check/server-check.guard'; import { MenuResolver } from './menu.resolver'; @@ -57,163 +57,163 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone path: 'reload/:rnd', component: ThemedPageNotFoundComponent, pathMatch: 'full', - canActivate: [ReloadGuard] + canActivate: [ReloadGuard], }, { path: 'home', loadChildren: () => import('./home-page/home-page.module') .then((m) => m.HomePageModule), data: { showBreadcrumbs: false }, - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'community-list', loadChildren: () => import('./community-list-page/community-list-page.module') .then((m) => m.CommunityListPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'id', loadChildren: () => import('./lookup-by-id/lookup-by-id.module') .then((m) => m.LookupIdModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'handle', loadChildren: () => import('./lookup-by-id/lookup-by-id.module') .then((m) => m.LookupIdModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: REGISTER_PATH, loadChildren: () => import('./register-page/register-page.module') .then((m) => m.RegisterPageModule), - canActivate: [SiteRegisterGuard] + canActivate: [SiteRegisterGuard], }, { path: FORGOT_PASSWORD_PATH, loadChildren: () => import('./forgot-password/forgot-password.module') .then((m) => m.ForgotPasswordModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: COMMUNITY_MODULE_PATH, loadChildren: () => import('./community-page/community-page.module') .then((m) => m.CommunityPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: COLLECTION_MODULE_PATH, loadChildren: () => import('./collection-page/collection-page.module') .then((m) => m.CollectionPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: ITEM_MODULE_PATH, loadChildren: () => import('./item-page/item-page.module') .then((m) => m.ItemPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'entities/:entity-type', loadChildren: () => import('./item-page/item-page.module') .then((m) => m.ItemPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: LEGACY_BITSTREAM_MODULE_PATH, loadChildren: () => import('./bitstream-page/bitstream-page.module') .then((m) => m.BitstreamPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: BITSTREAM_MODULE_PATH, loadChildren: () => import('./bitstream-page/bitstream-page.module') .then((m) => m.BitstreamPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'mydspace', loadChildren: () => import('./my-dspace-page/my-dspace-page.module') .then((m) => m.MyDSpacePageModule), - canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard] + canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard], }, { path: 'search', loadChildren: () => import('./search-page/search-page-routing.module') .then((m) => m.SearchPageRoutingModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'browse', loadChildren: () => import('./browse-by/browse-by-page.module') .then((m) => m.BrowseByPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: ADMIN_MODULE_PATH, loadChildren: () => import('./admin/admin.module') .then((m) => m.AdminModule), - canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard] + canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard], }, { path: 'login', loadChildren: () => import('./login-page/login-page.module') - .then((m) => m.LoginPageModule) + .then((m) => m.LoginPageModule), }, { path: 'logout', loadChildren: () => import('./logout-page/logout-page.module') - .then((m) => m.LogoutPageModule) + .then((m) => m.LogoutPageModule), }, { path: 'submit', loadChildren: () => import('./submit-page/submit-page.module') .then((m) => m.SubmitPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'import-external', loadChildren: () => import('./import-external-page/import-external-page.module') .then((m) => m.ImportExternalPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: 'workspaceitems', loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page.module') .then((m) => m.WorkspaceitemsEditPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: WORKFLOW_ITEM_MODULE_PATH, loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module') .then((m) => m.WorkflowItemsEditPageModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: PROFILE_MODULE_PATH, loadChildren: () => import('./profile-page/profile-page.module') .then((m) => m.ProfilePageModule), - canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard] + canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard], }, { path: PROCESS_MODULE_PATH, loadChildren: () => import('./process-page/process-page.module') .then((m) => m.ProcessPageModule), - canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard] + canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard], }, { path: INFO_MODULE_PATH, - loadChildren: () => import('./info/info.module').then((m) => m.InfoModule) + loadChildren: () => import('./info/info.module').then((m) => m.InfoModule), }, { path: REQUEST_COPY_MODULE_PATH, loadChildren: () => import('./request-copy/request-copy.module').then((m) => m.RequestCopyModule), - canActivate: [EndUserAgreementCurrentUserGuard] + canActivate: [EndUserAgreementCurrentUserGuard], }, { path: FORBIDDEN_PATH, - component: ThemedForbiddenComponent + component: ThemedForbiddenComponent, }, { path: 'statistics', @@ -224,7 +224,7 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone { path: HEALTH_PAGE_PATH, loadChildren: () => import('./health-page/health-page.module') - .then((m) => m.HealthPageModule) + .then((m) => m.HealthPageModule), }, { path: ACCESS_CONTROL_MODULE_PATH, @@ -235,11 +235,11 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone path: 'subscriptions', loadChildren: () => import('./subscriptions-page/subscriptions-page-routing.module') .then((m) => m.SubscriptionsPageRoutingModule), - canActivate: [AuthenticatedGuard] + canActivate: [AuthenticatedGuard], }, { path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent }, - ] - } + ], + }, ], { // enableTracing: true, useHash: false, @@ -248,7 +248,7 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone initialNavigation: 'enabledBlocking', preloadingStrategy: NoPreloading, onSameUrlNavigation: 'reload', - }) + }), ], exports: [RouterModule], }) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index e921c67ace..b4aaeb12e5 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -41,12 +41,12 @@ let comp: AppComponent; let fixture: ComponentFixture; const menuService = new MenuServiceStub(); const initialState = { - core: { auth: { loading: false } } + core: { auth: { loading: false } }, }; export function getMockLocaleService(): LocaleService { return jasmine.createSpyObj('LocaleService', { - setCurrentLanguageCode: jasmine.createSpy('setCurrentLanguageCode') + setCurrentLanguageCode: jasmine.createSpy('setCurrentLanguageCode'), }); } @@ -64,8 +64,8 @@ describe('App component', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), ], declarations: [AppComponent], // declare the test component @@ -85,9 +85,9 @@ describe('App component', () => { { provide: APP_CONFIG, useValue: environment }, provideMockStore({ initialState }), AppComponent, - RouteService + RouteService, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }; }; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ba7b738227..4cc531153a 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -102,7 +102,7 @@ export class AppComponent implements OnInit, AfterViewInit { this.isAuthBlocking$ = this.store.pipe( select(isAuthenticationBlocking), - distinctUntilChanged() + distinctUntilChanged(), ); this.dispatchWindowSize(this._window.nativeWindow.innerWidth, this._window.nativeWindow.innerHeight); @@ -133,7 +133,7 @@ export class AppComponent implements OnInit, AfterViewInit { private dispatchWindowSize(width, height): void { this.store.dispatch( - new HostWindowResizeAction(width, height) + new HostWindowResizeAction(width, height), ); } diff --git a/src/app/app.effects.ts b/src/app/app.effects.ts index 871fae8d6b..00d07be9c2 100644 --- a/src/app/app.effects.ts +++ b/src/app/app.effects.ts @@ -11,5 +11,5 @@ export const appEffects = [ NotificationsEffects, SidebarEffects, ThemeEffects, - RelationshipEffects + RelationshipEffects, ]; diff --git a/src/app/app.metareducers.ts b/src/app/app.metareducers.ts index 4cdecdc797..559389ccd3 100644 --- a/src/app/app.metareducers.ts +++ b/src/app/app.metareducers.ts @@ -29,9 +29,9 @@ export function universalMetaReducer(reducer) { } export const debugMetaReducers = [ - debugMetaReducer + debugMetaReducer, ]; export const appMetaReducers = [ - universalMetaReducer + universalMetaReducer, ]; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 89e361821b..747d01e1e9 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -67,41 +67,41 @@ const PROVIDERS = [ { provide: APP_BASE_HREF, useFactory: getBaseHref, - deps: [DOCUMENT, APP_CONFIG] + deps: [DOCUMENT, APP_CONFIG], }, { provide: USER_PROVIDED_META_REDUCERS, useFactory: getMetaReducers, - deps: [APP_CONFIG] + deps: [APP_CONFIG], }, { provide: RouterStateSerializer, - useClass: DSpaceRouterStateSerializer + useClass: DSpaceRouterStateSerializer, }, ClientCookieService, // register AuthInterceptor as HttpInterceptor { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, - multi: true + multi: true, }, // register LocaleInterceptor as HttpInterceptor { provide: HTTP_INTERCEPTORS, useClass: LocaleInterceptor, - multi: true + multi: true, }, // register XsrfInterceptor as HttpInterceptor { provide: HTTP_INTERCEPTORS, useClass: XsrfInterceptor, - multi: true + multi: true, }, // register LogInterceptor as HttpInterceptor { provide: HTTP_INTERCEPTORS, useClass: LogInterceptor, - multi: true + multi: true, }, // register the dynamic matcher used by form. MUST be provided by the app module ...DYNAMIC_MATCHER_PROVIDERS, @@ -117,10 +117,10 @@ const EXPORTS = [ @NgModule({ imports: [ BrowserModule.withServerTransition({ appId: 'dspace-angular' }), - ...IMPORTS + ...IMPORTS, ], providers: [ - ...PROVIDERS + ...PROVIDERS, ], declarations: [ ...DECLARATIONS, @@ -128,7 +128,7 @@ const EXPORTS = [ exports: [ ...EXPORTS, ...DECLARATIONS, - ] + ], }) export class AppModule { diff --git a/src/app/app.reducer.ts b/src/app/app.reducer.ts index 802ad1aff5..24f90daf2d 100644 --- a/src/app/app.reducer.ts +++ b/src/app/app.reducer.ts @@ -2,45 +2,45 @@ import { routerReducer, RouterReducerState } from '@ngrx/router-store'; import { ActionReducerMap, createSelector, MemoizedSelector } from '@ngrx/store'; import { ePeopleRegistryReducer, - EPeopleRegistryState + EPeopleRegistryState, } from './access-control/epeople-registry/epeople-registry.reducers'; import { groupRegistryReducer, - GroupRegistryState + GroupRegistryState, } from './access-control/group-registry/group-registry.reducers'; import { metadataRegistryReducer, - MetadataRegistryState + MetadataRegistryState, } from './admin/admin-registries/metadata-registry/metadata-registry.reducers'; import { CommunityListReducer, - CommunityListState + CommunityListState, } from './community-list-page/community-list.reducer'; import { hasValue } from './shared/empty.util'; import { NameVariantListsState, - nameVariantReducer + nameVariantReducer, } from './shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.reducer'; import { formReducer, FormState } from './shared/form/form.reducer'; import { menusReducer} from './shared/menu/menu.reducer'; import { notificationsReducer, - NotificationsState + NotificationsState, } from './shared/notifications/notifications.reducers'; import { selectableListReducer, - SelectableListsState + SelectableListsState, } from './shared/object-list/selectable-list/selectable-list.reducer'; import { ObjectSelectionListState, - objectSelectionReducer + objectSelectionReducer, } from './shared/object-select/object-select.reducer'; import { cssVariablesReducer, CSSVariablesState } from './shared/sass-helper/css-variable.reducer'; import { hostWindowReducer, HostWindowState } from './shared/search/host-window.reducer'; import { filterReducer, - SearchFiltersState + SearchFiltersState, } from './shared/search/search-filters/search-filter/search-filter.reducer'; import { sidebarReducer, SidebarState } from './shared/sidebar/sidebar.reducer'; import { truncatableReducer, TruncatablesState } from './shared/truncatable/truncatable.reducer'; @@ -108,6 +108,6 @@ export function keySelector(key: string, selector): MemoizedSelector { 'dc.title': [ { value: 'file name', - language: null - } - ] + language: null, + }, + ], }, _links: { - content: { href: 'file-selflink' } - } + content: { href: 'file-selflink' }, + }, }); const bitstreamRD = createSuccessfulRemoteDataObject(bitstream); const routeStub = { data: observableOf({ - bitstream: bitstreamRD - }) + bitstream: bitstreamRD, + }), }; beforeEach(waitForAsync(() => { @@ -47,9 +47,9 @@ describe('BitstreamAuthorizationsComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) + useClass: TranslateLoaderMock, + }, + }), ], declarations: [BitstreamAuthorizationsComponent], providers: [ diff --git a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts index adc0638780..dcb418881e 100644 --- a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts +++ b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts @@ -27,7 +27,7 @@ export class BitstreamAuthorizationsComponent impl * @param {ActivatedRoute} route */ constructor( - private route: ActivatedRoute + private route: ActivatedRoute, ) { } diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts index 59261e56d2..29ee50c31b 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts @@ -33,48 +33,48 @@ describe('BitstreamDownloadPageComponent', () => { const mocklink = { href: 'http://test.org', rel: 'test', - type: 'test' + type: 'test', }; const mocklink2 = { href: 'http://test2.org', rel: 'test', - type: 'test' + type: 'test', }; function init() { authService = jasmine.createSpyObj('authService', { isAuthenticated: observableOf(true), - setRedirectUrl: {} + setRedirectUrl: {}, }); authorizationService = jasmine.createSpyObj('authorizationSerivice', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); fileService = jasmine.createSpyObj('fileService', { - retrieveFileDownloadLink: observableOf('content-url-with-headers') + retrieveFileDownloadLink: observableOf('content-url-with-headers'), }); hardRedirectService = jasmine.createSpyObj('fileService', { - redirect: {} + redirect: {}, }); bitstream = Object.assign(new Bitstream(), { uuid: 'bitstreamUuid', _links: { content: { href: 'bitstream-content-link' }, self: { href: 'bitstream-self-link' }, - } + }, }); activatedRoute = { data: observableOf({ bitstream: createSuccessfulRemoteDataObject( - bitstream - ) + bitstream, + ), }), params: observableOf({ - id: 'testid' - }) + id: 'testid', + }), }; router = jasmine.createSpyObj('router', ['navigateByUrl']); @@ -84,7 +84,7 @@ describe('BitstreamDownloadPageComponent', () => { }); signpostingDataService = jasmine.createSpyObj('SignpostingDataService', { - getLinks: observableOf([mocklink, mocklink2]) + getLinks: observableOf([mocklink, mocklink2]), }); } @@ -101,8 +101,8 @@ describe('BitstreamDownloadPageComponent', () => { { provide: HardRedirectService, useValue: hardRedirectService }, { provide: ServerResponseService, useValue: serverResponseService }, { provide: SignpostingDataService, useValue: signpostingDataService }, - { provide: PLATFORM_ID, useValue: 'server' } - ] + { provide: PLATFORM_ID, useValue: 'server' }, + ], }) .compileComponents(); } diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts index 0b8e6a66e5..857ae24cda 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts @@ -21,7 +21,7 @@ import { SignpostingLink } from '../../core/data/signposting-links.model'; @Component({ selector: 'ds-bitstream-download-page', - templateUrl: './bitstream-download-page.component.html' + templateUrl: './bitstream-download-page.component.html', }) /** * Page component for downloading a bitstream @@ -42,7 +42,7 @@ export class BitstreamDownloadPageComponent implements OnInit { public dsoNameService: DSONameService, private signpostingDataService: SignpostingDataService, private responseService: ServerResponseService, - @Inject(PLATFORM_ID) protected platformId: string + @Inject(PLATFORM_ID) protected platformId: string, ) { this.initPageLinks(); } @@ -58,7 +58,7 @@ export class BitstreamDownloadPageComponent implements OnInit { this.bitstream$ = this.bitstreamRD$.pipe( redirectOn4xx(this.router, this.auth), - getRemoteDataPayload() + getRemoteDataPayload(), ); this.bitstream$.pipe( @@ -80,7 +80,7 @@ export class BitstreamDownloadPageComponent implements OnInit { } else { return [[isAuthorized, isLoggedIn, bitstream, '']]; } - }) + }), ).subscribe(([isAuthorized, isLoggedIn, bitstream, fileLink]: [boolean, boolean, Bitstream, string]) => { if (isAuthorized && isLoggedIn && isNotEmpty(fileLink)) { this.hardRedirectService.redirect(fileLink); diff --git a/src/app/bitstream-page/bitstream-page-routing.module.ts b/src/app/bitstream-page/bitstream-page-routing.module.ts index 3960ccb743..7457a28349 100644 --- a/src/app/bitstream-page/bitstream-page-routing.module.ts +++ b/src/app/bitstream-page/bitstream-page-routing.module.ts @@ -28,7 +28,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; path: 'handle/:prefix/:suffix/:filename', component: BitstreamDownloadPageComponent, resolve: { - bitstream: LegacyBitstreamUrlResolver + bitstream: LegacyBitstreamUrlResolver, }, }, { @@ -36,7 +36,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; path: ':prefix/:suffix/:sequence_id/:filename', component: BitstreamDownloadPageComponent, resolve: { - bitstream: LegacyBitstreamUrlResolver + bitstream: LegacyBitstreamUrlResolver, }, }, { @@ -44,7 +44,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; path: ':id/download', component: BitstreamDownloadPageComponent, resolve: { - bitstream: BitstreamPageResolver + bitstream: BitstreamPageResolver, }, }, { @@ -54,7 +54,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; bitstream: BitstreamPageResolver, breadcrumb: BitstreamBreadcrumbResolver, }, - canActivate: [AuthenticatedGuard] + canActivate: [AuthenticatedGuard], }, { path: EDIT_BITSTREAM_AUTHORIZATIONS_PATH, @@ -63,19 +63,19 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title', showBreadcrumbs: true } + data: { title: 'resource-policies.create.page.title', showBreadcrumbs: true }, }, { path: 'edit', resolve: { breadcrumb: I18nBreadcrumbResolver, - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: { breadcrumbKey: 'item.edit', title: 'resource-policies.edit.page.title', showBreadcrumbs: true } + data: { breadcrumbKey: 'item.edit', title: 'resource-policies.edit.page.title', showBreadcrumbs: true }, }, { path: '', @@ -84,17 +84,17 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; breadcrumb: BitstreamBreadcrumbResolver, }, component: BitstreamAuthorizationsComponent, - data: { title: 'bitstream.edit.authorizations.title', showBreadcrumbs: true } - } - ] - } - ]) + data: { title: 'bitstream.edit.authorizations.title', showBreadcrumbs: true }, + }, + ], + }, + ]), ], providers: [ BitstreamPageResolver, BitstreamBreadcrumbResolver, - BitstreamBreadcrumbsService - ] + BitstreamBreadcrumbsService, + ], }) export class BitstreamPageRoutingModule { } diff --git a/src/app/bitstream-page/bitstream-page.module.ts b/src/app/bitstream-page/bitstream-page.module.ts index 9bbe3d200c..7eeaad3900 100644 --- a/src/app/bitstream-page/bitstream-page.module.ts +++ b/src/app/bitstream-page/bitstream-page.module.ts @@ -18,14 +18,14 @@ import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-e SharedModule, BitstreamPageRoutingModule, FormModule, - ResourcePoliciesModule + ResourcePoliciesModule, ], declarations: [ BitstreamAuthorizationsComponent, EditBitstreamPageComponent, ThemedEditBitstreamPageComponent, BitstreamDownloadPageComponent, - ] + ], }) export class BitstreamPageModule { } diff --git a/src/app/bitstream-page/bitstream-page.resolver.ts b/src/app/bitstream-page/bitstream-page.resolver.ts index bbaf368c52..5eb476ea73 100644 --- a/src/app/bitstream-page/bitstream-page.resolver.ts +++ b/src/app/bitstream-page/bitstream-page.resolver.ts @@ -13,7 +13,7 @@ import { getFirstCompletedRemoteData } from '../core/shared/operators'; */ export const BITSTREAM_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ followLink('bundle', {}, followLink('primaryBitstream'), followLink('item')), - followLink('format') + followLink('format'), ]; /** diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index ad8f13b0d2..c7d84bc8f9 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -62,8 +62,8 @@ describe('EditBitstreamPageComponent', () => { supportLevel: BitstreamFormatSupportLevel.Unknown, mimetype: 'application/octet-stream', _links: { - self: { href: 'format-selflink-1' } - } + self: { href: 'format-selflink-1' }, + }, }), Object.assign({ id: '2', @@ -72,8 +72,8 @@ describe('EditBitstreamPageComponent', () => { supportLevel: BitstreamFormatSupportLevel.Known, mimetype: 'image/png', _links: { - self: { href: 'format-selflink-2' } - } + self: { href: 'format-selflink-2' }, + }, }), Object.assign({ id: '3', @@ -82,9 +82,9 @@ describe('EditBitstreamPageComponent', () => { supportLevel: BitstreamFormatSupportLevel.Known, mimetype: 'image/gif', _links: { - self: { href: 'format-selflink-3' } - } - }) + self: { href: 'format-selflink-3' }, + }, + }), ] as BitstreamFormat[]; selectedFormat = allFormats[1]; @@ -98,33 +98,33 @@ describe('EditBitstreamPageComponent', () => { return new UntypedFormGroup(controls); } return undefined; - } + }, }); bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: createSuccessfulRemoteDataObject$(createPaginatedList(allFormats)) + findAll: createSuccessfulRemoteDataObject$(createPaginatedList(allFormats)), }); notificationsService = jasmine.createSpyObj('notificationsService', { info: infoNotification, warning: warningNotification, - success: successNotification - } + success: successNotification, + }, ); bundle = { _links: { primaryBitstream: { - href: 'bundle-selflink' - } + href: 'bundle-selflink', + }, }, item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), { uuid: 'some-uuid', firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string { return undefined; }, - })) + })), }; const result = createSuccessfulRemoteDataObject$(bundle); @@ -143,15 +143,15 @@ describe('EditBitstreamPageComponent', () => { bundle = { _links: { primaryBitstream: { - href: 'bundle-selflink' - } + href: 'bundle-selflink', + }, }, item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), { uuid: 'some-uuid', firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string { return undefined; }, - })) + })), }; const bundleName = 'ORIGINAL'; @@ -161,20 +161,20 @@ describe('EditBitstreamPageComponent', () => { metadata: { 'dc.description': [ { - value: 'Bitstream description' - } + value: 'Bitstream description', + }, ], 'dc.title': [ { - value: 'Bitstream title' - } - ] + value: 'Bitstream title', + }, + ], }, format: createSuccessfulRemoteDataObject$(selectedFormat), _links: { - self: 'bitstream-selflink' + self: 'bitstream-selflink', }, - bundle: createSuccessfulRemoteDataObject$(bundle) + bundle: createSuccessfulRemoteDataObject$(bundle), }); bitstreamService = jasmine.createSpyObj('bitstreamService', { findById: createSuccessfulRemoteDataObject$(bitstream), @@ -182,13 +182,13 @@ describe('EditBitstreamPageComponent', () => { update: createSuccessfulRemoteDataObject$(bitstream), updateFormat: createSuccessfulRemoteDataObject$(bitstream), commitUpdates: {}, - patch: {} + patch: {}, }); bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: createSuccessfulRemoteDataObject$(createPaginatedList(allFormats)) + findAll: createSuccessfulRemoteDataObject$(createPaginatedList(allFormats)), }); dsoNameService = jasmine.createSpyObj('dsoNameService', { - getName: bundleName + getName: bundleName, }); TestBed.configureTestingModule({ @@ -201,16 +201,16 @@ describe('EditBitstreamPageComponent', () => { provide: ActivatedRoute, useValue: { data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), - snapshot: { queryParams: {} } - } + snapshot: { queryParams: {} }, + }, }, { provide: BitstreamDataService, useValue: bitstreamService }, { provide: DSONameService, useValue: dsoNameService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef + ChangeDetectorRef, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -374,8 +374,8 @@ describe('EditBitstreamPageComponent', () => { beforeEach(() => { comp.formGroup.patchValue({ formatContainer: { - selectedFormat: allFormats[2].id - } + selectedFormat: allFormats[2].id, + }, }); fixture.detectChanges(); comp.onSubmit(); @@ -420,51 +420,51 @@ describe('EditBitstreamPageComponent', () => { metadata: { 'dc.description': [ { - value: 'Bitstream description' - } + value: 'Bitstream description', + }, ], 'dc.title': [ { - value: 'Bitstream title' - } + value: 'Bitstream title', + }, ], 'iiif.label': [ { - value: 'chapter one' - } + value: 'chapter one', + }, ], 'iiif.toc': [ { - value: 'chapter one' - } + value: 'chapter one', + }, ], 'iiif.image.width': [ { - value: '2400' - } + value: '2400', + }, ], 'iiif.image.height': [ { - value: '2800' - } + value: '2800', + }, ], }, format: createSuccessfulRemoteDataObject$(allFormats[1]), _links: { - self: 'bitstream-selflink' + self: 'bitstream-selflink', }, bundle: createSuccessfulRemoteDataObject$({ _links: { primaryBitstream: { - href: 'bundle-selflink' - } + href: 'bundle-selflink', + }, }, item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), { uuid: 'some-uuid', firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string { return 'True'; - } - })) + }, + })), }), }); bitstreamService = jasmine.createSpyObj('bitstreamService', { @@ -473,11 +473,11 @@ describe('EditBitstreamPageComponent', () => { update: createSuccessfulRemoteDataObject$(bitstream), updateFormat: createSuccessfulRemoteDataObject$(bitstream), commitUpdates: {}, - patch: {} + patch: {}, }); dsoNameService = jasmine.createSpyObj('dsoNameService', { - getName: bundleName + getName: bundleName, }); TestBed.configureTestingModule({ @@ -490,16 +490,16 @@ describe('EditBitstreamPageComponent', () => { provide: ActivatedRoute, useValue: { data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}), - snapshot: {queryParams: {}} - } + snapshot: {queryParams: {}}, + }, }, {provide: BitstreamDataService, useValue: bitstreamService}, {provide: DSONameService, useValue: dsoNameService}, {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef + ChangeDetectorRef, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -545,51 +545,51 @@ describe('EditBitstreamPageComponent', () => { metadata: { 'dc.description': [ { - value: 'Bitstream description' - } + value: 'Bitstream description', + }, ], 'dc.title': [ { - value: 'Bitstream title' - } + value: 'Bitstream title', + }, ], 'iiif.label': [ { - value: 'chapter one' - } + value: 'chapter one', + }, ], 'iiif.toc': [ { - value: 'chapter one' - } + value: 'chapter one', + }, ], 'iiif.image.width': [ { - value: '2400' - } + value: '2400', + }, ], 'iiif.image.height': [ { - value: '2800' - } + value: '2800', + }, ], }, format: createSuccessfulRemoteDataObject$(allFormats[2]), _links: { - self: 'bitstream-selflink' + self: 'bitstream-selflink', }, bundle: createSuccessfulRemoteDataObject$({ _links: { primaryBitstream: { - href: 'bundle-selflink' - } + href: 'bundle-selflink', + }, }, item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), { uuid: 'some-uuid', firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string { return 'True'; - } - })) + }, + })), }), }); bitstreamService = jasmine.createSpyObj('bitstreamService', { @@ -598,11 +598,11 @@ describe('EditBitstreamPageComponent', () => { update: createSuccessfulRemoteDataObject$(bitstream), updateFormat: createSuccessfulRemoteDataObject$(bitstream), commitUpdates: {}, - patch: {} + patch: {}, }); dsoNameService = jasmine.createSpyObj('dsoNameService', { - getName: bundleName + getName: bundleName, }); TestBed.configureTestingModule({ @@ -614,16 +614,16 @@ describe('EditBitstreamPageComponent', () => { {provide: ActivatedRoute, useValue: { data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}), - snapshot: {queryParams: {}} - } + snapshot: {queryParams: {}}, + }, }, {provide: BitstreamDataService, useValue: bitstreamService}, {provide: DSONameService, useValue: dsoNameService}, {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef + ChangeDetectorRef, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 7157113337..59b82f6db5 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -31,7 +31,7 @@ import { PrimaryBitstreamService } from '../../core/data/primary-bitstream.servi selector: 'ds-edit-bitstream-page', styleUrls: ['./edit-bitstream-page.component.scss'], templateUrl: './edit-bitstream-page.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) /** * Page component for editing a bitstream @@ -124,11 +124,11 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { name: 'fileName', required: true, validators: { - required: null + required: null, }, errorMessages: { - required: 'You must provide a file name for the bitstream' - } + required: 'You must provide a file name for the bitstream', + }, }); /** @@ -136,8 +136,8 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { */ primaryBitstreamModel = new DynamicCustomSwitchModel({ id: 'primaryBitstream', - name: 'primaryBitstream' - } + name: 'primaryBitstream', + }, ); /** @@ -147,7 +147,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '', id: 'description', name: 'description', - rows: 10 + rows: 10, }); /** @@ -155,7 +155,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { */ selectedFormatModel = new DynamicSelectModel({ id: 'selectedFormat', - name: 'selectedFormat' + name: 'selectedFormat', }); /** @@ -163,7 +163,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { */ newFormatModel = new DynamicInputModel({ id: 'newFormat', - name: 'newFormat' + name: 'newFormat', }); /** @@ -172,20 +172,20 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { iiifLabelModel = new DsDynamicInputModel({ hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '', id: 'iiifLabel', - name: 'iiifLabel' + name: 'iiifLabel', }, { grid: { - host: 'col col-lg-6 d-inline-block' - } + host: 'col col-lg-6 d-inline-block', + }, }); iiifLabelContainer = new DynamicFormGroupModel({ id: 'iiifLabelContainer', - group: [this.iiifLabelModel] + group: [this.iiifLabelModel], }, { grid: { - host: 'form-row' - } + host: 'form-row', + }, }); iiifTocModel = new DsDynamicInputModel({ @@ -194,16 +194,16 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { name: 'iiifToc', }, { grid: { - host: 'col col-lg-6 d-inline-block' - } + host: 'col col-lg-6 d-inline-block', + }, }); iiifTocContainer = new DynamicFormGroupModel({ id: 'iiifTocContainer', - group: [this.iiifTocModel] + group: [this.iiifTocModel], }, { grid: { - host: 'form-row' - } + host: 'form-row', + }, }); iiifWidthModel = new DsDynamicInputModel({ @@ -212,34 +212,34 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { name: 'iiifWidth', }, { grid: { - host: 'col col-lg-6 d-inline-block' - } + host: 'col col-lg-6 d-inline-block', + }, }); iiifWidthContainer = new DynamicFormGroupModel({ id: 'iiifWidthContainer', - group: [this.iiifWidthModel] + group: [this.iiifWidthModel], }, { grid: { - host: 'form-row' - } + host: 'form-row', + }, }); iiifHeightModel = new DsDynamicInputModel({ hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '', id: 'iiifHeight', - name: 'iiifHeight' + name: 'iiifHeight', }, { grid: { - host: 'col col-lg-6 d-inline-block' - } + host: 'col col-lg-6 d-inline-block', + }, }); iiifHeightContainer = new DynamicFormGroupModel({ id: 'iiifHeightContainer', - group: [this.iiifHeightModel] + group: [this.iiifHeightModel], }, { grid: { - host: 'form-row' - } + host: 'form-row', + }, }); /** @@ -257,26 +257,26 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { id: 'fileNamePrimaryContainer', group: [ this.fileNameModel, - this.primaryBitstreamModel - ] + this.primaryBitstreamModel, + ], }, { grid: { - host: 'form-row' - } + host: 'form-row', + }, }), new DynamicFormGroupModel({ id: 'descriptionContainer', group: [ - this.descriptionModel - ] + this.descriptionModel, + ], }), new DynamicFormGroupModel({ id: 'formatContainer', group: [ this.selectedFormatModel, - this.newFormatModel - ] - }) + this.newFormatModel, + ], + }), ]; /** @@ -290,49 +290,49 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { formLayout: DynamicFormLayout = { fileName: { grid: { - host: 'col col-sm-8 d-inline-block' - } + host: 'col col-sm-8 d-inline-block', + }, }, primaryBitstream: { grid: { - host: 'col col-sm-4 d-inline-block switch border-0' - } + host: 'col col-sm-4 d-inline-block switch border-0', + }, }, description: { grid: { - host: 'col-12 d-inline-block' - } + host: 'col-12 d-inline-block', + }, }, embargo: { grid: { - host: 'col-12 d-inline-block' - } + host: 'col-12 d-inline-block', + }, }, selectedFormat: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, newFormat: { grid: { - host: this.newFormatBaseLayout + ' invisible' - } + host: this.newFormatBaseLayout + ' invisible', + }, }, fileNamePrimaryContainer: { grid: { - host: 'row position-relative' - } + host: 'row position-relative', + }, }, descriptionContainer: { grid: { - host: 'row' - } + host: 'row', + }, }, formatContainer: { grid: { - host: 'row' - } - } + host: 'row', + }, + }, }; /** @@ -440,14 +440,14 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { this.primaryBitstreamUUID = hasValue(primaryBitstream) ? primaryBitstream.uuid : null; this.itemId = item.uuid; this.setIiifStatus(this.bitstream); - }) + }), ); this.subs.push( this.translate.onLangChange .subscribe(() => { this.updateFieldTranslations(); - }) + }), ); } @@ -469,39 +469,39 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { this.formGroup.patchValue({ fileNamePrimaryContainer: { fileName: bitstream.name, - primaryBitstream: this.primaryBitstreamUUID === bitstream.uuid + primaryBitstream: this.primaryBitstreamUUID === bitstream.uuid, }, descriptionContainer: { - description: bitstream.firstMetadataValue('dc.description') + description: bitstream.firstMetadataValue('dc.description'), }, formatContainer: { - newFormat: hasValue(bitstream.firstMetadata('dc.format')) ? bitstream.firstMetadata('dc.format').value : undefined - } + newFormat: hasValue(bitstream.firstMetadata('dc.format')) ? bitstream.firstMetadata('dc.format').value : undefined, + }, }); if (this.isIIIF) { this.formGroup.patchValue({ iiifLabelContainer: { - iiifLabel: bitstream.firstMetadataValue(this.IIIF_LABEL_METADATA) + iiifLabel: bitstream.firstMetadataValue(this.IIIF_LABEL_METADATA), }, iiifTocContainer: { - iiifToc: bitstream.firstMetadataValue(this.IIIF_TOC_METADATA) + iiifToc: bitstream.firstMetadataValue(this.IIIF_TOC_METADATA), }, iiifWidthContainer: { - iiifWidth: bitstream.firstMetadataValue(this.IMAGE_WIDTH_METADATA) + iiifWidth: bitstream.firstMetadataValue(this.IMAGE_WIDTH_METADATA), }, iiifHeightContainer: { - iiifHeight: bitstream.firstMetadataValue(this.IMAGE_HEIGHT_METADATA) - } + iiifHeight: bitstream.firstMetadataValue(this.IMAGE_HEIGHT_METADATA), + }, }); } this.bitstream.format.pipe( - getAllSucceededRemoteDataPayload() + getAllSucceededRemoteDataPayload(), ).subscribe((format: BitstreamFormat) => { this.originalFormat = format; this.formGroup.patchValue({ formatContainer: { - selectedFormat: format.id - } + selectedFormat: format.id, + }, }); this.updateNewFormatLayout(format.id); }); @@ -514,7 +514,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { this.selectedFormatModel.options = this.formats.map((format: BitstreamFormat) => Object.assign({ value: format.id, - label: this.isUnknownFormat(format.id) ? this.translate.instant(this.KEY_PREFIX + 'selectedFormat.unknown') : format.shortDescription + label: this.isUnknownFormat(format.id) ? this.translate.instant(this.KEY_PREFIX + 'selectedFormat.unknown') : format.shortDescription, })); } @@ -546,7 +546,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { this.inputModels.forEach( (fieldModel: DynamicFormControlModel) => { this.updateFieldTranslation(fieldModel); - } + }, ); } @@ -600,11 +600,11 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { const completedBundleRd$ = bundleRd$.pipe(getFirstCompletedRemoteData()); this.subs.push(completedBundleRd$.pipe( - filter((bundleRd: RemoteData) => bundleRd.hasFailed) + filter((bundleRd: RemoteData) => bundleRd.hasFailed), ).subscribe((bundleRd: RemoteData) => { this.notificationsService.error( this.translate.instant(this.NOTIFICATIONS_PREFIX + 'error.primaryBitstream.title'), - bundleRd.errorMessage + bundleRd.errorMessage, ); errorWhileSaving = true; })); @@ -616,13 +616,13 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { } else { return this.bundle; } - }) + }), ); this.subs.push(bundle$.pipe( hasValueOperator(), switchMap((bundle: Bundle) => this.bitstreamService.findByHref(bundle._links.primaryBitstream.href, false)), - getFirstSucceededRemoteDataPayload() + getFirstSucceededRemoteDataPayload(), ).subscribe((bitstream: Bitstream) => { this.primaryBitstreamUUID = hasValue(bitstream) ? bitstream.uuid : null; })); @@ -637,12 +637,12 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { if (hasValue(formatResponse) && formatResponse.hasFailed) { this.notificationsService.error( this.translate.instant(this.NOTIFICATIONS_PREFIX + 'error.format.title'), - formatResponse.errorMessage + formatResponse.errorMessage, ); } else { return formatResponse.payload; } - }) + }), ); } else { bitstream$ = observableOf(this.bitstream); @@ -652,14 +652,14 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { tap(([bundle]) => this.bundle = bundle), switchMap(() => { return this.bitstreamService.update(updatedBitstream).pipe( - getFirstSucceededRemoteDataPayload() + getFirstSucceededRemoteDataPayload(), ); - }) + }), ).subscribe(() => { this.bitstreamService.commitUpdates(); this.notificationsService.success( this.translate.instant(this.NOTIFICATIONS_PREFIX + 'saved.title'), - this.translate.instant(this.NOTIFICATIONS_PREFIX + 'saved.content') + this.translate.instant(this.NOTIFICATIONS_PREFIX + 'saved.content'), ); if (!errorWhileSaving) { this.navigateToItemEditBitstreams(); @@ -753,13 +753,13 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { getFirstSucceededRemoteData(), map((item: RemoteData) => (item.payload.firstMetadataValue('dspace.iiif.enabled') && - item.payload.firstMetadataValue('dspace.iiif.enabled').match(regexIIIFItem) !== null) + item.payload.firstMetadataValue('dspace.iiif.enabled').match(regexIIIFItem) !== null), )))); const iiifSub = combineLatest( isImage$, isIIIFBundle$, - isEnabled$ + isEnabled$, ).subscribe(([isImage, isIIIFBundle, isEnabled]) => { if (isImage && isIIIFBundle && isEnabled) { this.isIIIF = true; diff --git a/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts b/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts index aec8cd22f4..12202376c1 100644 --- a/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts +++ b/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts @@ -20,7 +20,7 @@ describe(`LegacyBitstreamUrlResolver`, () => { route = { params: {}, - queryParams: {} + queryParams: {}, }; state = {}; remoteDataMocks = { @@ -30,7 +30,7 @@ describe(`LegacyBitstreamUrlResolver`, () => { Error: new RemoteData(0, 0, 0, RequestEntryState.Error, 'Internal server error', undefined, 500), }; bitstreamDataService = { - findByItemHandle: () => undefined + findByItemHandle: () => undefined, } as any; resolver = new LegacyBitstreamUrlResolver(bitstreamDataService); }); @@ -44,8 +44,8 @@ describe(`LegacyBitstreamUrlResolver`, () => { prefix: '123456789', suffix: '1234', filename: 'some-file.pdf', - sequence_id: '5' - } + sequence_id: '5', + }, }); }); it(`should call findByItemHandle with the handle, sequence id, and filename from the route`, () => { @@ -54,7 +54,7 @@ describe(`LegacyBitstreamUrlResolver`, () => { expect(bitstreamDataService.findByItemHandle).toHaveBeenCalledWith( `${route.params.prefix}/${route.params.suffix}`, route.params.sequence_id, - route.params.filename + route.params.filename, ); }); }); @@ -71,8 +71,8 @@ describe(`LegacyBitstreamUrlResolver`, () => { filename: 'some-file.pdf', }, queryParams: { - sequenceId: '5' - } + sequenceId: '5', + }, }); }); it(`should call findByItemHandle with the handle and filename from the route, and the sequence ID from the queryParams`, () => { @@ -81,7 +81,7 @@ describe(`LegacyBitstreamUrlResolver`, () => { expect(bitstreamDataService.findByItemHandle).toHaveBeenCalledWith( `${route.params.prefix}/${route.params.suffix}`, route.queryParams.sequenceId, - route.params.filename + route.params.filename, ); }); }); @@ -103,7 +103,7 @@ describe(`LegacyBitstreamUrlResolver`, () => { expect(bitstreamDataService.findByItemHandle).toHaveBeenCalledWith( `${route.params.prefix}/${route.params.suffix}`, undefined, - route.params.filename + route.params.filename, ); }); }); diff --git a/src/app/bitstream-page/legacy-bitstream-url.resolver.ts b/src/app/bitstream-page/legacy-bitstream-url.resolver.ts index 33acc7f669..b8846e8e14 100644 --- a/src/app/bitstream-page/legacy-bitstream-url.resolver.ts +++ b/src/app/bitstream-page/legacy-bitstream-url.resolver.ts @@ -11,7 +11,7 @@ import { BitstreamDataService } from '../core/data/bitstream-data.service'; * This class resolves a bitstream based on the DSpace 6 XMLUI or JSPUI bitstream download URLs */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class LegacyBitstreamUrlResolver implements Resolve> { constructor(protected bitstreamDataService: BitstreamDataService) { @@ -42,7 +42,7 @@ export class LegacyBitstreamUrlResolver implements Resolve sequenceId, filename, ).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); } } diff --git a/src/app/breadcrumbs/breadcrumbs.component.spec.ts b/src/app/breadcrumbs/breadcrumbs.component.spec.ts index 69387e7534..84a47381cd 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.spec.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.spec.ts @@ -50,7 +50,7 @@ describe('BreadcrumbsComponent', () => { loader: { provide: TranslateLoader, useClass: TranslateLoaderMock, - } + }, }), ], providers: [ diff --git a/src/app/breadcrumbs/breadcrumbs.component.ts b/src/app/breadcrumbs/breadcrumbs.component.ts index 248fb446ed..911d38d517 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.ts @@ -9,7 +9,7 @@ import { Observable } from 'rxjs'; @Component({ selector: 'ds-breadcrumbs', templateUrl: './breadcrumbs.component.html', - styleUrls: ['./breadcrumbs.component.scss'] + styleUrls: ['./breadcrumbs.component.scss'], }) export class BreadcrumbsComponent { diff --git a/src/app/breadcrumbs/breadcrumbs.service.spec.ts b/src/app/breadcrumbs/breadcrumbs.service.spec.ts index 11b8bace39..940762d293 100644 --- a/src/app/breadcrumbs/breadcrumbs.service.spec.ts +++ b/src/app/breadcrumbs/breadcrumbs.service.spec.ts @@ -80,8 +80,8 @@ describe('BreadcrumbsService', () => { const route1 = { snapshot: { data: { breadcrumb: breadcrumbConfigA }, - routeConfig: { resolve: { breadcrumb: {} } } - } + routeConfig: { resolve: { breadcrumb: {} } }, + }, }; const expectation1 = [ @@ -94,7 +94,7 @@ describe('BreadcrumbsService', () => { const route2 = { snapshot: { data: { breadcrumb: breadcrumbConfigA }, - routeConfig: { resolve: { breadcrumb: {} } } + routeConfig: { resolve: { breadcrumb: {} } }, }, firstChild: { snapshot: { @@ -104,10 +104,10 @@ describe('BreadcrumbsService', () => { firstChild: { snapshot: { data: { breadcrumb: breadcrumbConfigB }, - routeConfig: { resolve: { breadcrumb: {} } } - } - } - } + routeConfig: { resolve: { breadcrumb: {} } }, + }, + }, + }, }; const expectation2 = [ @@ -129,8 +129,8 @@ describe('BreadcrumbsService', () => { breadcrumb: breadcrumbConfigA, showBreadcrumbs: false, // explicitly hide breadcrumbs }, - routeConfig: { resolve: { breadcrumb: {} } } - } + routeConfig: { resolve: { breadcrumb: {} } }, + }, }; changeActivatedRoute(route1); @@ -142,8 +142,8 @@ describe('BreadcrumbsService', () => { breadcrumb: breadcrumbConfigA, showBreadcrumbs: true, // explicitly show breadcrumbs }, - routeConfig: { resolve: { breadcrumb: {} } } - } + routeConfig: { resolve: { breadcrumb: {} } }, + }, }; changeActivatedRoute(route2); @@ -158,8 +158,8 @@ describe('BreadcrumbsService', () => { data: { // no breadcrumbs set - always hide }, - routeConfig: { resolve: { breadcrumb: {} } } - } + routeConfig: { resolve: { breadcrumb: {} } }, + }, }; changeActivatedRoute(route1); diff --git a/src/app/breadcrumbs/breadcrumbs.service.ts b/src/app/breadcrumbs/breadcrumbs.service.ts index a7be030c12..cafe410c7c 100644 --- a/src/app/breadcrumbs/breadcrumbs.service.ts +++ b/src/app/breadcrumbs/breadcrumbs.service.ts @@ -6,7 +6,7 @@ import {filter, map, switchMap, tap} from 'rxjs/operators'; import {hasNoValue, hasValue, isUndefined} from '../shared/empty.util'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class BreadcrumbsService { diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts index 8745971e93..714b9440f1 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts @@ -35,9 +35,9 @@ describe('BrowseByDatePageComponent', () => { metadata: [ { key: 'dc.title', - value: 'test community' - } - ] + value: 'test community', + }, + ], }); const firstItem = Object.assign(new Item(), { @@ -45,40 +45,40 @@ describe('BrowseByDatePageComponent', () => { metadata: { 'dc.date.issued': [ { - value: '1950-01-01' - } - ] - } + value: '1950-01-01', + }, + ], + }, }); const lastItem = Object.assign(new Item(), { id: 'last-item-id', metadata: { 'dc.date.issued': [ { - value: '1960-01-01' - } - ] - } + value: '1960-01-01', + }, + ], + }, }); const mockBrowseService = { getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData([]), getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData([firstItem]), - getFirstItemFor: (definition: string, scope?: string, sortDirection?: SortDirection) => null + getFirstItemFor: (definition: string, scope?: string, sortDirection?: SortDirection) => null, }; const mockDsoService = { - findById: () => createSuccessfulRemoteDataObject$(mockCommunity) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity), }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { params: observableOf({}), queryParams: observableOf({}), - data: observableOf({ metadata: 'dateissued', metadataField: 'dc.date.issued' }) + data: observableOf({ metadata: 'dateissued', metadataField: 'dc.date.issued' }), }); const mockCdRef = Object.assign({ - detectChanges: () => fixture.detectChanges() + detectChanges: () => fixture.detectChanges(), }); paginationService = new PaginationServiceStub(); @@ -94,9 +94,9 @@ describe('BrowseByDatePageComponent', () => { { provide: Router, useValue: new RouterMock() }, { provide: PaginationService, useValue: paginationService }, { provide: ChangeDetectorRef, useValue: mockCdRef }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environment }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index c1d6a072b3..0bc6a27265 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, Inject } from '@angular/core'; import { BrowseByMetadataPageComponent, browseParamsToOptions, - getBrowseSearchOptions + getBrowseSearchOptions, } from '../browse-by-metadata-page/browse-by-metadata-page.component'; import { combineLatest as observableCombineLatest } from 'rxjs'; import { hasValue, isNotEmpty } from '../../shared/empty.util'; @@ -23,7 +23,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-browse-by-date-page', styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], - templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html' + templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html', }) /** * Component for browsing items by metadata definition of type 'date' @@ -61,7 +61,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { this.currentPagination$, this.currentSort$]).pipe( map(([routeParams, queryParams, data, currentPage, currentSort]) => { return [Object.assign({}, routeParams, queryParams, data), currentPage, currentSort]; - }) + }), ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { const metadataKeys = params.browseDefinition ? params.browseDefinition.metadataKeys : this.defaultMetadataKeys; this.browseId = params.id || this.defaultBrowseId; @@ -116,7 +116,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { this.startsWithOptions = options; this.cdRef.detectChanges(); } - }) + }), ); } diff --git a/src/app/browse-by/browse-by-dso-breadcrumb.resolver.ts b/src/app/browse-by/browse-by-dso-breadcrumb.resolver.ts index fc8b40267a..aae54c3b88 100644 --- a/src/app/browse-by/browse-by-dso-breadcrumb.resolver.ts +++ b/src/app/browse-by/browse-by-dso-breadcrumb.resolver.ts @@ -33,7 +33,7 @@ export class BrowseByDSOBreadcrumbResolver { getRemoteDataPayload(), map((object: Community | Collection) => { return { provider: this.breadcrumbService, key: object, url: getDSORoute(object) }; - }) + }), ); } return undefined; diff --git a/src/app/browse-by/browse-by-guard.spec.ts b/src/app/browse-by/browse-by-guard.spec.ts index aac5ba2723..ed47544ec0 100644 --- a/src/app/browse-by/browse-by-guard.spec.ts +++ b/src/app/browse-by/browse-by-guard.spec.ts @@ -26,15 +26,15 @@ describe('BrowseByGuard', () => { beforeEach(() => { dsoService = { - findById: (dsoId: string) => observableOf({ payload: { name: name }, hasSucceeded: true }) + findById: (dsoId: string) => observableOf({ payload: { name: name }, hasSucceeded: true }), }; translateService = { - instant: () => field + instant: () => field, }; browseDefinitionService = { - findById: () => createSuccessfulRemoteDataObject$(browseDefinition) + findById: () => createSuccessfulRemoteDataObject$(browseDefinition), }; router = new RouterStub() as any; @@ -53,8 +53,8 @@ describe('BrowseByGuard', () => { }, queryParams: { scope, - value - } + value, + }, }; guard.canActivate(scopedRoute as any, undefined) .pipe(first()) @@ -66,12 +66,12 @@ describe('BrowseByGuard', () => { browseDefinition, collection: name, field, - value: '"' + value + '"' + value: '"' + value + '"', }; expect(scopedRoute.data).toEqual(result); expect(router.navigate).not.toHaveBeenCalled(); expect(canActivate).toEqual(true); - } + }, ); }); @@ -85,8 +85,8 @@ describe('BrowseByGuard', () => { id, }, queryParams: { - scope - } + scope, + }, }; guard.canActivate(scopedNoValueRoute as any, undefined) @@ -99,12 +99,12 @@ describe('BrowseByGuard', () => { browseDefinition, collection: name, field, - value: '' + value: '', }; expect(scopedNoValueRoute.data).toEqual(result); expect(router.navigate).not.toHaveBeenCalled(); expect(canActivate).toEqual(true); - } + }, ); }); @@ -118,8 +118,8 @@ describe('BrowseByGuard', () => { id, }, queryParams: { - value - } + value, + }, }; guard.canActivate(route as any, undefined) .pipe(first()) @@ -131,12 +131,12 @@ describe('BrowseByGuard', () => { browseDefinition, collection: '', field, - value: '"' + value + '"' + value: '"' + value + '"', }; expect(route.data).toEqual(result); expect(router.navigate).not.toHaveBeenCalled(); expect(canActivate).toEqual(true); - } + }, ); }); @@ -152,8 +152,8 @@ describe('BrowseByGuard', () => { }, queryParams: { scope, - value - } + value, + }, }; guard.canActivate(scopedRoute as any, undefined) .pipe(first()) diff --git a/src/app/browse-by/browse-by-guard.ts b/src/app/browse-by/browse-by-guard.ts index dd87699a84..d12f774253 100644 --- a/src/app/browse-by/browse-by-guard.ts +++ b/src/app/browse-by/browse-by-guard.ts @@ -52,7 +52,7 @@ export class BrowseByGuard implements CanActivate { const name = this.dsoNameService.getName(dso); route.data = this.createData(title, id, browseDefinition, name, metadataTranslated, value, route); return true; - }) + }), ); } else { route.data = this.createData(title, id, browseDefinition, '', metadataTranslated, value, route); @@ -62,7 +62,7 @@ export class BrowseByGuard implements CanActivate { void this.router.navigate([PAGE_NOT_FOUND_PATH]); return observableOf(false); } - }) + }), ); } @@ -73,7 +73,7 @@ export class BrowseByGuard implements CanActivate { browseDefinition: browseDefinition, collection: collection, field: field, - value: hasValue(value) ? `"${value}"` : '' + value: hasValue(value) ? `"${value}"` : '', }); } } diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index a5beeb8a45..3aa7d032c8 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -1,7 +1,7 @@ import { BrowseByMetadataPageComponent, browseParamsToOptions, - getBrowseSearchOptions + getBrowseSearchOptions, } from './browse-by-metadata-page.component'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { BrowseService } from '../../core/browse/browse.service'; @@ -43,16 +43,16 @@ describe('BrowseByMetadataPageComponent', () => { metadata: [ { key: 'dc.title', - value: 'test community' - } - ] + value: 'test community', + }, + ], }); const environmentMock = { browseBy: { showThumbnails: true, - pageSize: 10 - } + pageSize: 10, + }, }; const mockEntries = [ @@ -61,41 +61,41 @@ describe('BrowseByMetadataPageComponent', () => { authority: null, value: 'John Doe', language: 'en', - count: 1 + count: 1, }, { type: BrowseEntry.type, authority: null, value: 'James Doe', language: 'en', - count: 3 + count: 3, }, { type: BrowseEntry.type, authority: null, value: 'Fake subject', language: 'en', - count: 2 - } + count: 2, + }, ]; const mockItems = [ Object.assign(new Item(), { - id: 'fakeId' - }) + id: 'fakeId', + }), ]; const mockBrowseService = { getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData(mockEntries), - getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData(mockItems) + getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData(mockItems), }; const mockDsoService = { - findById: () => createSuccessfulRemoteDataObject$(mockCommunity) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity), }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { - params: observableOf({}) + params: observableOf({}), }); paginationService = new PaginationServiceStub(); @@ -110,9 +110,9 @@ describe('BrowseByMetadataPageComponent', () => { { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: new RouterMock() }, - { provide: APP_CONFIG, useValue: environmentMock } + { provide: APP_CONFIG, useValue: environmentMock }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); @@ -139,7 +139,7 @@ describe('BrowseByMetadataPageComponent', () => { beforeEach(() => { const paramsWithValue = { metadata: 'author', - value: 'John Doe' + value: 'John Doe', }; route.params = observableOf(paramsWithValue); @@ -165,7 +165,7 @@ describe('BrowseByMetadataPageComponent', () => { beforeEach(() => { const paramsScope = { - scope: 'fake-scope' + scope: 'fake-scope', }; const paginationOptions = Object.assign(new PaginationComponentOptions(), { currentPage: 5, @@ -196,7 +196,7 @@ describe('BrowseByMetadataPageComponent', () => { beforeEach(() => { const paramsScope = { - scope: 'fake-scope' + scope: 'fake-scope', }; const paginationOptions = Object.assign(new PaginationComponentOptions(), { currentPage: 5, diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index b8765efae9..8787f44f7d 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -28,7 +28,7 @@ export const BBM_PAGINATION_ID = 'bbm'; @Component({ selector: 'ds-browse-by-metadata-page', styleUrls: ['./browse-by-metadata-page.component.scss'], - templateUrl: './browse-by-metadata-page.component.html' + templateUrl: './browse-by-metadata-page.component.html', }) /** * Component for browsing (items) by metadata definition. @@ -150,7 +150,7 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { observableCombineLatest([this.route.params, this.route.queryParams, this.currentPagination$, this.currentSort$]).pipe( map(([routeParams, queryParams, currentPage, currentSort]) => { return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; - }) + }), ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { this.browseId = params.id || this.defaultBrowseId; this.authority = params.authority; @@ -225,7 +225,7 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { true, true, ...linksToFollow() as FollowLinkConfig[]).pipe( - getFirstSucceededRemoteData() + getFirstSucceededRemoteData(), ); } } @@ -238,7 +238,7 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { this.logo$ = this.parent$.pipe( map((rd: RemoteData) => rd.payload), filter((collectionOrCommunity: Collection | Community) => hasValue(collectionOrCommunity.logo)), - mergeMap((collectionOrCommunity: Collection | Community) => collectionOrCommunity.logo) + mergeMap((collectionOrCommunity: Collection | Community) => collectionOrCommunity.logo), ); } } @@ -319,6 +319,6 @@ export function browseParamsToOptions(params: any, sortConfig, params.startsWith, params.scope, - fetchThumbnail + fetchThumbnail, ); } diff --git a/src/app/browse-by/browse-by-page.module.ts b/src/app/browse-by/browse-by-page.module.ts index 554a6c4f46..cb7f9a4870 100644 --- a/src/app/browse-by/browse-by-page.module.ts +++ b/src/app/browse-by/browse-by-page.module.ts @@ -19,7 +19,7 @@ import { SharedBrowseByModule } from '../shared/browse-by/shared-browse-by.modul ], declarations: [ - ] + ], }) export class BrowseByPageModule { diff --git a/src/app/browse-by/browse-by-routing.module.ts b/src/app/browse-by/browse-by-routing.module.ts index bb67dc65ae..1060a92a7d 100644 --- a/src/app/browse-by/browse-by-routing.module.ts +++ b/src/app/browse-by/browse-by-routing.module.ts @@ -13,7 +13,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; path: '', resolve: { breadcrumb: BrowseByDSOBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, children: [ { @@ -21,15 +21,15 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; component: ThemedBrowseBySwitcherComponent, canActivate: [BrowseByGuard], resolve: { breadcrumb: BrowseByI18nBreadcrumbResolver }, - data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' } - } - ] - }]) + data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' }, + }, + ], + }]), ], providers: [ BrowseByI18nBreadcrumbResolver, - BrowseByDSOBreadcrumbResolver - ] + BrowseByDSOBreadcrumbResolver, + ], }) export class BrowseByRoutingModule { diff --git a/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts b/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts index b59a46cae1..03fec82a93 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts @@ -3,7 +3,7 @@ import { InjectionToken } from '@angular/core'; import { GenericConstructor } from '../../core/shared/generic-constructor'; import { DEFAULT_THEME, - resolveTheme + resolveTheme, } from '../../shared/object-collection/shared/listable-object/listable-object.decorator'; export enum BrowseByDataType { @@ -16,7 +16,7 @@ export const DEFAULT_BROWSE_BY_TYPE = BrowseByDataType.Metadata; export const BROWSE_BY_COMPONENT_FACTORY = new InjectionToken<(browseByType, theme) => GenericConstructor>('getComponentByBrowseByType', { providedIn: 'root', - factory: () => getComponentByBrowseByType + factory: () => getComponentByBrowseByType, }); const map = new Map(); diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts index c13405dd4d..4ad16224bd 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts @@ -18,33 +18,33 @@ describe('BrowseBySwitcherComponent', () => { new FlatBrowseDefinition(), { id: 'title', dataType: BrowseByDataType.Title, - } + }, ), Object.assign( new FlatBrowseDefinition(), { id: 'dateissued', dataType: BrowseByDataType.Date, - metadataKeys: ['dc.date.issued'] - } + metadataKeys: ['dc.date.issued'], + }, ), Object.assign( new ValueListBrowseDefinition(), { id: 'author', dataType: BrowseByDataType.Metadata, - } + }, ), Object.assign( new ValueListBrowseDefinition(), { id: 'subject', dataType: BrowseByDataType.Metadata, - } + }, ), ]; const data = new BehaviorSubject(createDataWithBrowseDefinition(new FlatBrowseDefinition())); const activatedRouteStub = { - data + data, }; let themeService: ThemeService; @@ -61,9 +61,9 @@ describe('BrowseBySwitcherComponent', () => { providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: ThemeService, useValue: themeService }, - { provide: BROWSE_BY_COMPONENT_FACTORY, useValue: jasmine.createSpy('getComponentByBrowseByType').and.returnValue(null) } + { provide: BROWSE_BY_COMPONENT_FACTORY, useValue: jasmine.createSpy('getComponentByBrowseByType').and.returnValue(null) }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts index 35e4edf900..2a05d6aa2c 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts @@ -9,7 +9,7 @@ import { ThemeService } from '../../shared/theme-support/theme.service'; @Component({ selector: 'ds-browse-by-switcher', - templateUrl: './browse-by-switcher.component.html' + templateUrl: './browse-by-switcher.component.html', }) /** * Component for determining what Browse-By component to use depending on the metadata (browse ID) provided @@ -31,7 +31,7 @@ export class BrowseBySwitcherComponent implements OnInit { */ ngOnInit(): void { this.browseByComponent = this.route.data.pipe( - map((data: { browseDefinition: BrowseDefinition }) => this.getComponentByBrowseByType(data.browseDefinition.getRenderType(), this.themeService.getThemeName())) + map((data: { browseDefinition: BrowseDefinition }) => this.getComponentByBrowseByType(data.browseDefinition.getRenderType(), this.themeService.getThemeName())), ); } diff --git a/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts index 0187d4e3c5..fdd633b1c0 100644 --- a/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts @@ -9,7 +9,7 @@ import { BrowseBySwitcherComponent } from './browse-by-switcher.component'; @Component({ selector: 'ds-themed-browse-by-switcher', styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html' + templateUrl: '../../shared/theme-support/themed.component.html', }) export class ThemedBrowseBySwitcherComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts index ffd1fb4318..6620cc3168 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts @@ -19,7 +19,7 @@ describe('BrowseByTaxonomyPageComponent', () => { const data = new BehaviorSubject(createDataWithBrowseDefinition(new HierarchicalBrowseDefinition())); const activatedRouteStub = { - data + data, }; beforeEach(async () => { @@ -34,7 +34,7 @@ describe('BrowseByTaxonomyPageComponent', () => { { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: ThemeService, useValue: themeService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); }); diff --git a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts index c14495d4e7..a688bc9316 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts @@ -13,7 +13,7 @@ import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-bro @Component({ selector: 'ds-browse-by-taxonomy-page', templateUrl: './browse-by-taxonomy-page.component.html', - styleUrls: ['./browse-by-taxonomy-page.component.scss'] + styleUrls: ['./browse-by-taxonomy-page.component.scss'], }) /** * Component for browsing items by metadata in a hierarchical controlled vocabulary @@ -70,7 +70,7 @@ export class BrowseByTaxonomyPageComponent implements OnInit, OnDestroy { map((data: { browseDefinition: BrowseDefinition }) => { this.getComponentByBrowseByType(data.browseDefinition.getRenderType(), this.themeService.getThemeName()); return data.browseDefinition; - }) + }), ); this.browseByComponentSubs.push(this.browseByComponent.subscribe((browseDefinition: HierarchicalBrowseDefinition) => { this.facetType = browseDefinition.facetType; @@ -108,7 +108,7 @@ export class BrowseByTaxonomyPageComponent implements OnInit, OnDestroy { */ private updateQueryParams(): void { this.queryParams = { - ['f.' + this.facetType]: this.filterValues + ['f.' + this.facetType]: this.filterValues, }; } diff --git a/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts b/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts index 212044b853..443aaccc64 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts @@ -6,7 +6,7 @@ import { BrowseByTaxonomyPageComponent } from './browse-by-taxonomy-page.compone @Component({ selector: 'ds-themed-browse-by-taxonomy-page', templateUrl: '../../shared/theme-support/themed.component.html', - styleUrls: [] + styleUrls: [], }) /** * Themed wrapper for BrowseByTaxonomyPageComponent diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts index e32c0ac430..98eef12082 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts @@ -35,9 +35,9 @@ describe('BrowseByTitlePageComponent', () => { metadata: [ { key: 'dc.title', - value: 'test community' - } - ] + value: 'test community', + }, + ], }); const mockItems = [ @@ -46,24 +46,24 @@ describe('BrowseByTitlePageComponent', () => { metadata: [ { key: 'dc.title', - value: 'Fake Title' - } - ] - }) + value: 'Fake Title', + }, + ], + }), ]; const mockBrowseService = { getBrowseItemsFor: () => toRemoteData(mockItems), - getBrowseEntriesFor: () => toRemoteData([]) + getBrowseEntriesFor: () => toRemoteData([]), }; const mockDsoService = { - findById: () => createSuccessfulRemoteDataObject$(mockCommunity) + findById: () => createSuccessfulRemoteDataObject$(mockCommunity), }; const activatedRouteStub = Object.assign(new ActivatedRouteStub(), { params: observableOf({}), - data: observableOf({ metadata: 'title' }) + data: observableOf({ metadata: 'title' }), }); const paginationService = new PaginationServiceStub(); @@ -78,9 +78,9 @@ describe('BrowseByTitlePageComponent', () => { { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: new RouterMock() }, - { provide: APP_CONFIG, useValue: environment } + { provide: APP_CONFIG, useValue: environment }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index 58df79ebe8..74888883d6 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -4,7 +4,7 @@ import { ActivatedRoute, Params, Router } from '@angular/router'; import { hasValue } from '../../shared/empty.util'; import { BrowseByMetadataPageComponent, - browseParamsToOptions, getBrowseSearchOptions + browseParamsToOptions, getBrowseSearchOptions, } from '../browse-by-metadata-page/browse-by-metadata-page.component'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { BrowseService } from '../../core/browse/browse.service'; @@ -18,7 +18,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-browse-by-title-page', styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], - templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html' + templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html', }) /** * Component for browsing items by title (dc.title) @@ -46,7 +46,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { observableCombineLatest([this.route.params, this.route.queryParams, this.currentPagination$, this.currentSort$]).pipe( map(([routeParams, queryParams, currentPage, currentSort]) => { return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; - }) + }), ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { this.startsWith = +params.startsWith || params.startsWith; this.browseId = params.id || this.defaultBrowseId; diff --git a/src/app/browse-by/browse-by.module.ts b/src/app/browse-by/browse-by.module.ts index c0e2d3f9ff..5702c79f0c 100644 --- a/src/app/browse-by/browse-by.module.ts +++ b/src/app/browse-by/browse-by.module.ts @@ -39,11 +39,11 @@ const ENTRY_COMPONENTS = [ declarations: [ BrowseBySwitcherComponent, ThemedBrowseBySwitcherComponent, - ...ENTRY_COMPONENTS + ...ENTRY_COMPONENTS, ], exports: [ - BrowseBySwitcherComponent - ] + BrowseBySwitcherComponent, + ], }) export class BrowseByModule { /** @@ -53,7 +53,7 @@ export class BrowseByModule { static withEntryComponents() { return { ngModule: SharedBrowseByModule, - providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) + providers: ENTRY_COMPONENTS.map((component) => ({provide: component})), }; } } 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 6c6909d1e0..2ae48fc78a 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -6,7 +6,7 @@ import { DynamicFormControlModel, DynamicFormOptionConfig, DynamicFormService, - DynamicSelectModel + DynamicSelectModel, } from '@ng-dynamic-forms/core'; import { Collection } from '../../core/shared/collection.model'; @@ -20,7 +20,7 @@ import { EntityTypeDataService } from '../../core/data/entity-type-data.service' import { ItemType } from '../../core/shared/item-relationships/item-type.model'; import { MetadataValue } from '../../core/shared/metadata.models'; import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators'; -import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models'; +import { collectionFormEntityTypeSelectionConfig, collectionFormModels } from './collection-form.models'; import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; import { hasNoValue, isNotNull } from 'src/app/shared/empty.util'; @@ -31,7 +31,7 @@ import { hasNoValue, isNotNull } from 'src/app/shared/empty.util'; @Component({ selector: 'ds-collection-form', styleUrls: ['../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.scss'], - templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html' + templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', }) export class CollectionFormComponent extends ComColFormComponent implements OnInit, OnChanges { /** @@ -92,7 +92,7 @@ export class CollectionFormComponent extends ComColFormComponent imp } const entities$: Observable = this.entityTypeService.findAll({ elementsPerPage: 100, currentPage: 1 }).pipe( - getFirstSucceededRemoteListPayload() + getFirstSucceededRemoteListPayload(), ); // retrieve all entity types to populate the dropdowns selection @@ -104,7 +104,7 @@ export class CollectionFormComponent extends ComColFormComponent imp this.entityTypeSelection.add({ disabled: false, label: type.label, - value: type.label + value: type.label, } as DynamicFormOptionConfig); if (currentRelationshipValue && currentRelationshipValue.length > 0 && currentRelationshipValue[0].value === type.label) { this.entityTypeSelection.select(index); diff --git a/src/app/collection-page/collection-form/collection-form.models.ts b/src/app/collection-page/collection-form/collection-form.models.ts index 1a009d95a1..831e6c4264 100644 --- a/src/app/collection-page/collection-form/collection-form.models.ts +++ b/src/app/collection-page/collection-form/collection-form.models.ts @@ -5,7 +5,7 @@ import { environment } from '../../../environments/environment'; export const collectionFormEntityTypeSelectionConfig: DynamicSelectModelConfig = { id: 'entityType', name: 'dspace.entity.type', - disabled: false + disabled: false, }; /** @@ -18,10 +18,10 @@ export const collectionFormModels: DynamicFormControlModel[] = [ name: 'dc.title', required: true, validators: { - required: null + required: null, }, errorMessages: { - required: 'Please enter a name for this title' + required: 'Please enter a name for this title', }, }), new DynamicTextAreaModel({ @@ -48,5 +48,5 @@ export const collectionFormModels: DynamicFormControlModel[] = [ id: 'license', name: 'dc.rights.license', spellCheck: environment.form.spellCheck, - }) + }), ]; diff --git a/src/app/collection-page/collection-form/collection-form.module.ts b/src/app/collection-page/collection-form/collection-form.module.ts index ddf18f0586..85e84d40ba 100644 --- a/src/app/collection-page/collection-form/collection-form.module.ts +++ b/src/app/collection-page/collection-form/collection-form.module.ts @@ -9,14 +9,14 @@ import { FormModule } from '../../shared/form/form.module'; imports: [ ComcolModule, FormModule, - SharedModule + SharedModule, ], declarations: [ CollectionFormComponent, ], exports: [ - CollectionFormComponent - ] + CollectionFormComponent, + ], }) export class CollectionFormModule { diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts index db844b588f..58095718fd 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts @@ -37,7 +37,7 @@ import { PaginatedSearchOptions } from '../../shared/search/models/paginated-sea import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, - createSuccessfulRemoteDataObject$ + createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; import { createPaginatedList } from '../../shared/testing/utils.test'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; @@ -64,32 +64,32 @@ describe('CollectionItemMapperComponent', () => { name: 'test-collection', _links: { mappedItems: { - href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4/mappedItems' + href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4/mappedItems', }, self: { - href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4' - } - } + href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4', + }, + }, }); const mockCollectionRD: RemoteData = createSuccessfulRemoteDataObject(mockCollection); const mockSearchOptions = observableOf(new PaginatedSearchOptions({ pagination: Object.assign(new PaginationComponentOptions(), { id: 'search-page-configuration', pageSize: 10, - currentPage: 1 + currentPage: 1, }), sort: new SortOptions('dc.title', SortDirection.ASC), - scope: mockCollection.id + scope: mockCollection.id, })); const url = 'http://test.url'; const urlWithParam = url + '?param=value'; const routerStub = Object.assign(new RouterStub(), { url: urlWithParam, navigateByUrl: {}, - navigate: {} + navigate: {}, }); const searchConfigServiceStub = { - paginatedSearchOptions: mockSearchOptions + paginatedSearchOptions: mockSearchOptions, }; const emptyList = createSuccessfulRemoteDataObject(createPaginatedList([])); const itemDataServiceStub = { @@ -99,31 +99,31 @@ describe('CollectionItemMapperComponent', () => { const activatedRouteStub = { parent: { data: observableOf({ - dso: mockCollectionRD - }) + dso: mockCollectionRD, + }), }, snapshot: { queryParamMap: new Map([ ['query', 'test'], - ]) - } + ]), + }, }; const translateServiceStub = { get: () => observableOf('test-message of collection ' + mockCollection.name), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), - onDefaultLangChange: new EventEmitter() + onDefaultLangChange: new EventEmitter(), }; const searchServiceStub = Object.assign(new SearchServiceStub(), { search: () => observableOf(emptyList), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ - clearDiscoveryRequests: () => {} + clearDiscoveryRequests: () => {}, /* eslint-enable no-empty,@typescript-eslint/no-empty-function */ }); const collectionDataServiceStub = { getMappedItems: () => observableOf(emptyList), /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ - clearMappedItemsRequests: () => {} + clearMappedItemsRequests: () => {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ }; const routeServiceStub = { @@ -135,20 +135,20 @@ describe('CollectionItemMapperComponent', () => { }, getQueryParamsWithPrefix: () => { return observableOf(''); - } + }, }; const fixedFilterServiceStub = { getQueryByFilterName: () => { return observableOf(''); - } + }, }; const authorizationDataService = jasmine.createSpyObj('authorizationDataService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); const linkHeadService = jasmine.createSpyObj('linkHeadService', { - addTag: '' + addTag: '', }); const groupDataService = jasmine.createSpyObj('groupsDataService', { @@ -161,9 +161,9 @@ describe('CollectionItemMapperComponent', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); beforeEach(waitForAsync(() => { @@ -186,15 +186,15 @@ describe('CollectionItemMapperComponent', () => { { provide: GroupDataService, useValue: groupDataService }, { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, - ] + ], }).overrideComponent(CollectionItemMapperComponent, { set: { providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationServiceStub - } - ] } + useClass: SearchConfigurationServiceStub, + }, + ] }, }).compileComponents(); })); diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts index 30013e4f63..d173090d19 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -13,7 +13,7 @@ import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, getRemoteDataPayload, - toDSpaceObjectListRD + toDSpaceObjectListRD, } from '../../core/shared/operators'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model'; @@ -38,14 +38,14 @@ import { FeatureID } from '../../core/data/feature-authorization/feature-id'; changeDetection: ChangeDetectionStrategy.OnPush, animations: [ fadeIn, - fadeInOut + fadeInOut, ], providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } - ] + useClass: SearchConfigurationService, + }, + ], }) /** * Component used to map items to a collection @@ -115,13 +115,13 @@ export class CollectionItemMapperComponent implements OnInit { ngOnInit(): void { this.collectionRD$ = this.route.parent.data.pipe( map((data) => data.dso as RemoteData), - getFirstSucceededRemoteData() + getFirstSucceededRemoteData(), ); this.collectionName$ = this.collectionRD$.pipe( map((rd: RemoteData) => { return this.dsoNameService.getName(rd.payload); - }) + }), ); this.searchOptions$ = this.searchConfigService.paginatedSearchOptions; this.loadItemLists(); @@ -136,7 +136,7 @@ export class CollectionItemMapperComponent implements OnInit { const collectionAndOptions$ = observableCombineLatest( this.collectionRD$, this.searchOptions$, - this.shouldUpdate$ + this.shouldUpdate$, ); this.collectionItemsRD$ = collectionAndOptions$.pipe( switchMap(([collectionRD, options, shouldUpdate]) => { @@ -144,11 +144,11 @@ export class CollectionItemMapperComponent implements OnInit { this.shouldUpdate$.next(false); } return this.itemDataService.findListByHref(collectionRD.payload._links.mappedItems.href, Object.assign(options, { - sort: this.defaultSortOptions + sort: this.defaultSortOptions, }),!shouldUpdate, false, followLink('owningCollection')).pipe( - getAllSucceededRemoteData() + getAllSucceededRemoteData(), ); - }) + }), ); this.mappedItemsRD$ = collectionAndOptions$.pipe( switchMap(([collectionRD, options, shouldUpdate]) => { @@ -156,12 +156,12 @@ export class CollectionItemMapperComponent implements OnInit { query: this.buildQuery(collectionRD.payload.id, options.query), scope: undefined, dsoTypes: [DSpaceObjectType.ITEM], - sort: this.defaultSortOptions + sort: this.defaultSortOptions, }), 10000, undefined, undefined, followLink('owningCollection')).pipe( toDSpaceObjectListRD(), - startWith(undefined) + startWith(undefined), ); - }) + }), ); } @@ -178,16 +178,16 @@ export class CollectionItemMapperComponent implements OnInit { observableCombineLatest(ids.map((id: string) => { if (remove) { return this.itemDataService.removeMappingFromCollection(id, collection.id).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); } else { return this.itemDataService.mapToCollection(id, collection._links.self.href).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); } - } - )) - ) + }, + )), + ), ); this.showNotifications(responses$, remove); @@ -207,7 +207,7 @@ export class CollectionItemMapperComponent implements OnInit { if (successful.length > 0) { const successMessages = observableCombineLatest( this.translateService.get(`collection.edit.item-mapper.notifications.${messageInsertion}.success.head`), - this.translateService.get(`collection.edit.item-mapper.notifications.${messageInsertion}.success.content`, { amount: successful.length }) + this.translateService.get(`collection.edit.item-mapper.notifications.${messageInsertion}.success.content`, { amount: successful.length }), ); successMessages.subscribe(([head, content]) => { @@ -218,7 +218,7 @@ export class CollectionItemMapperComponent implements OnInit { if (unsuccessful.length > 0) { const unsuccessMessages = observableCombineLatest( this.translateService.get(`collection.edit.item-mapper.notifications.${messageInsertion}.error.head`), - this.translateService.get(`collection.edit.item-mapper.notifications.${messageInsertion}.error.content`, { amount: unsuccessful.length }) + this.translateService.get(`collection.edit.item-mapper.notifications.${messageInsertion}.error.content`, { amount: unsuccessful.length }), ); unsuccessMessages.subscribe(([head, content]) => { @@ -277,7 +277,7 @@ export class CollectionItemMapperComponent implements OnInit { this.collectionRD$.pipe( getFirstSucceededRemoteData(), getRemoteDataPayload(), - take(1) + take(1), ).subscribe((collection: Collection) => { this.router.navigate(['/collections/', collection.id]); }); diff --git a/src/app/collection-page/collection-page-administrator.guard.ts b/src/app/collection-page/collection-page-administrator.guard.ts index c7866515b2..5e19bf08f1 100644 --- a/src/app/collection-page/collection-page-administrator.guard.ts +++ b/src/app/collection-page/collection-page-administrator.guard.ts @@ -9,7 +9,7 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { AuthService } from '../core/auth/auth.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) /** * Guard for preventing unauthorized access to certain {@link Collection} pages requiring administrator rights diff --git a/src/app/collection-page/collection-page-routing.module.ts b/src/app/collection-page/collection-page-routing.module.ts index 9dc25b778e..8981ed50cb 100644 --- a/src/app/collection-page/collection-page-routing.module.ts +++ b/src/app/collection-page/collection-page-routing.module.ts @@ -15,7 +15,7 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso import { ITEMTEMPLATE_PATH, COLLECTION_EDIT_PATH, - COLLECTION_CREATE_PATH + COLLECTION_CREATE_PATH, } from './collection-page-routing-paths'; import { CollectionPageAdministratorGuard } from './collection-page-administrator.guard'; import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; @@ -29,14 +29,14 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; { path: COLLECTION_CREATE_PATH, component: CreateCollectionPageComponent, - canActivate: [AuthenticatedGuard, CreateCollectionPageGuard] + canActivate: [AuthenticatedGuard, CreateCollectionPageGuard], }, { path: ':id', resolve: { dso: CollectionPageResolver, breadcrumb: CollectionBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, runGuardsAndResolvers: 'always', children: [ @@ -44,7 +44,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; path: COLLECTION_EDIT_PATH, loadChildren: () => import('./edit-collection-page/edit-collection-page.module') .then((m) => m.EditCollectionPageModule), - canActivate: [CollectionPageAdministratorGuard] + canActivate: [CollectionPageAdministratorGuard], }, { path: 'delete', @@ -58,15 +58,15 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; canActivate: [AuthenticatedGuard], resolve: { item: ItemTemplatePageResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: { title: 'collection.edit.template.title', breadcrumbKey: 'collection.edit.template' } + data: { title: 'collection.edit.template.title', breadcrumbKey: 'collection.edit.template' }, }, { path: '', component: ThemedCollectionPageComponent, pathMatch: 'full', - } + }, ], data: { menu: { @@ -84,7 +84,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; }, }, }, - ]) + ]), ], providers: [ CollectionPageResolver, @@ -94,7 +94,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; LinkService, CreateCollectionPageGuard, CollectionPageAdministratorGuard, - ] + ], }) export class CollectionPageRoutingModule { diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index 16704cef52..4ca188e59c 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -16,7 +16,7 @@ import { Item } from '../core/shared/item.model'; import { getAllSucceededRemoteDataPayload, getFirstSucceededRemoteData, - toDSpaceObjectListRD + toDSpaceObjectListRD, } from '../core/shared/operators'; import { fadeIn, fadeInOut } from '../shared/animations/fade'; @@ -39,8 +39,8 @@ import { APP_CONFIG, AppConfig } from '../../../src/config/app-config.interface' changeDetection: ChangeDetectionStrategy.OnPush, animations: [ fadeIn, - fadeInOut - ] + fadeInOut, + ], }) export class CollectionPageComponent implements OnInit { collectionRD$: Observable>; @@ -87,18 +87,18 @@ export class CollectionPageComponent implements OnInit { this.collectionRD$ = this.route.data.pipe( map((data) => data.dso as RemoteData), redirectOn4xx(this.router, this.authService), - take(1) + take(1), ); this.logoRD$ = this.collectionRD$.pipe( map((rd: RemoteData) => rd.payload), filter((collection: Collection) => hasValue(collection)), - mergeMap((collection: Collection) => collection.logo) + mergeMap((collection: Collection) => collection.logo), ); this.isCollectionAdmin$ = this.authorizationDataService.isAuthorized(FeatureID.IsCollectionAdmin); this.paginationChanges$ = new BehaviorSubject({ paginationConfig: this.paginationConfig, - sortConfig: this.sortConfig + sortConfig: this.sortConfig, }); const currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig); @@ -114,18 +114,18 @@ export class CollectionPageComponent implements OnInit { scope: id, pagination: currentPagination, sort: currentSort, - dsoTypes: [DSpaceObjectType.ITEM] + dsoTypes: [DSpaceObjectType.ITEM], }), null, true, true, ...BROWSE_LINKS_TO_FOLLOW) .pipe(toDSpaceObjectListRD()) as Observable>>; }), - startWith(undefined) // Make sure switching pages shows loading component - ) - ) + startWith(undefined), // Make sure switching pages shows loading component + ), + ), ); this.collectionPageRoute$ = this.collectionRD$.pipe( getAllSucceededRemoteDataPayload(), - map((collection) => getCollectionPageRoute(collection.id)) + map((collection) => getCollectionPageRoute(collection.id)), ); } diff --git a/src/app/collection-page/collection-page.module.ts b/src/app/collection-page/collection-page.module.ts index 6bcefed2b7..3c9a51e2fd 100644 --- a/src/app/collection-page/collection-page.module.ts +++ b/src/app/collection-page/collection-page.module.ts @@ -38,7 +38,7 @@ import { DsoPageModule } from '../shared/dso-page/dso-page.module'; DeleteCollectionPageComponent, EditItemTemplatePageComponent, ThemedEditItemTemplatePageComponent, - CollectionItemMapperComponent + CollectionItemMapperComponent, ], providers: [ SearchService, diff --git a/src/app/collection-page/collection-page.resolver.spec.ts b/src/app/collection-page/collection-page.resolver.spec.ts index 4b1ea9834c..f51c187e59 100644 --- a/src/app/collection-page/collection-page.resolver.spec.ts +++ b/src/app/collection-page/collection-page.resolver.spec.ts @@ -11,7 +11,7 @@ describe('CollectionPageResolver', () => { beforeEach(() => { collectionService = { - findById: (id: string) => createSuccessfulRemoteDataObject$({ id }) + findById: (id: string) => createSuccessfulRemoteDataObject$({ id }), }; store = jasmine.createSpyObj('store', { dispatch: {}, @@ -26,7 +26,7 @@ describe('CollectionPageResolver', () => { (resolved) => { expect(resolved.payload.id).toEqual(uuid); done(); - } + }, ); }); }); diff --git a/src/app/collection-page/collection-page.resolver.ts b/src/app/collection-page/collection-page.resolver.ts index 2f5b3ed37a..9d971b1d0c 100644 --- a/src/app/collection-page/collection-page.resolver.ts +++ b/src/app/collection-page/collection-page.resolver.ts @@ -15,7 +15,7 @@ import { ResolvedAction } from '../core/resolving/resolver.actions'; */ export const COLLECTION_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ followLink('parentCommunity', {}, - followLink('parentCommunity') + followLink('parentCommunity'), ), followLink('logo'), ]; @@ -27,7 +27,7 @@ export const COLLECTION_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ export class CollectionPageResolver implements Resolve> { constructor( private collectionService: CollectionDataService, - private store: Store + private store: Store, ) { } @@ -43,9 +43,9 @@ export class CollectionPageResolver implements Resolve> { route.params.id, true, false, - ...COLLECTION_PAGE_LINKS_TO_FOLLOW + ...COLLECTION_PAGE_LINKS_TO_FOLLOW, ).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); collectionRD$.subscribe((collectionRD: RemoteData) => { diff --git a/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts index 5a4295cb26..5e5b3092b7 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts @@ -29,14 +29,14 @@ describe('CreateCollectionPageComponent', () => { { provide: CollectionDataService, useValue: {} }, { provide: CommunityDataService, - useValue: { findById: () => observableOf({ payload: { name: 'test' } }) } + useValue: { findById: () => observableOf({ payload: { name: 'test' } }) }, }, { provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } }, { provide: Router, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, - { provide: RequestService, useValue: {}} + { provide: RequestService, useValue: {}}, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/collection-page/create-collection-page/create-collection-page.component.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.ts index a8cf594c3b..1a6698d196 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.component.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.component.ts @@ -16,7 +16,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-create-collection', styleUrls: ['./create-collection-page.component.scss'], - templateUrl: './create-collection-page.component.html' + templateUrl: './create-collection-page.component.html', }) export class CreateCollectionPageComponent extends CreateComColPageComponent { protected frontendURL = '/collections/'; @@ -30,7 +30,7 @@ export class CreateCollectionPageComponent extends CreateComColPageComponent { } else if (id === 'error-id') { return createFailedRemoteDataObject$('not found', 404); } - } + }, }; router = new RouterMock(); @@ -32,7 +32,7 @@ describe('CreateCollectionPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(true) + expect(canActivate).toEqual(true), ); }); @@ -41,7 +41,7 @@ describe('CreateCollectionPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(false) + expect(canActivate).toEqual(false), ); }); @@ -50,7 +50,7 @@ describe('CreateCollectionPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(false) + expect(canActivate).toEqual(false), ); }); @@ -59,7 +59,7 @@ describe('CreateCollectionPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(false) + expect(canActivate).toEqual(false), ); }); }); diff --git a/src/app/collection-page/create-collection-page/create-collection-page.guard.ts b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts index bdb0af1cd1..28c76d2b60 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.guard.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts @@ -37,7 +37,7 @@ export class CreateCollectionPageGuard implements CanActivate { if (!isValid) { this.router.navigate(['/404']); } - }) + }), ); } } diff --git a/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts index 9fc88932d0..b712f6e1a8 100644 --- a/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts +++ b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts @@ -26,9 +26,9 @@ describe('DeleteCollectionPageComponent', () => { { provide: CollectionDataService, useValue: {} }, { provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } }, { provide: NotificationsService, useValue: {} }, - { provide: RequestService, useValue: {} } + { provide: RequestService, useValue: {} }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts index 0a1b87e58b..cbdc5b0422 100644 --- a/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts +++ b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts @@ -13,7 +13,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-delete-collection', styleUrls: ['./delete-collection-page.component.scss'], - templateUrl: './delete-collection-page.component.html' + templateUrl: './delete-collection-page.component.html', }) export class DeleteCollectionPageComponent extends DeleteComColPageComponent { protected frontendURL = '/collections/'; diff --git a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts index c926686fb7..2453fe8869 100644 --- a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts @@ -8,7 +8,7 @@ xdescribe('CollectionAccessControlComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CollectionAccessControlComponent ] + declarations: [ CollectionAccessControlComponent ], }) .compileComponents(); }); diff --git a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts index 4192fe5a9a..7b824cc9b8 100644 --- a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts @@ -18,7 +18,7 @@ export class CollectionAccessControlComponent implements OnInit { ngOnInit(): void { this.itemRD$ = this.route.parent.parent.data.pipe( - map((data) => data.dso) + map((data) => data.dso), ).pipe(getFirstSucceededRemoteData()) as Observable>; } } diff --git a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts index c8e529443a..1b0bf8d2db 100644 --- a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts @@ -19,8 +19,8 @@ describe('CollectionAuthorizationsComponent', () => { uuid: 'collection', id: 'collection', _links: { - self: { href: 'collection-selflink' } - } + self: { href: 'collection-selflink' }, + }, }); const collectionRD = createSuccessfulRemoteDataObject(collection); @@ -29,16 +29,16 @@ describe('CollectionAuthorizationsComponent', () => { parent: { parent: { data: observableOf({ - dso: collectionRD - }) - } - } + dso: collectionRD, + }), + }, + }, }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - CommonModule + CommonModule, ], declarations: [CollectionAuthorizationsComponent], providers: [ diff --git a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts index d1b59a0c90..926ff3ca15 100644 --- a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts @@ -27,7 +27,7 @@ export class CollectionAuthorizationsComponent imp * @param {ActivatedRoute} route */ constructor( - private route: ActivatedRoute + private route: ActivatedRoute, ) { } diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts index 2cf25734e1..ffe7bbd2f2 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts @@ -17,20 +17,20 @@ describe('CollectionCurateComponent', () => { let dsoNameService; const collection = Object.assign(new Collection(), { - metadata: {'dc.title': ['Collection Name'], 'dc.identifier.uri': [ { value: '123456789/1'}]} + metadata: {'dc.title': ['Collection Name'], 'dc.identifier.uri': [ { value: '123456789/1'}]}, }); beforeEach(waitForAsync(() => { routeStub = { parent: { data: observableOf({ - dso: createSuccessfulRemoteDataObject(collection) - }) - } + dso: createSuccessfulRemoteDataObject(collection), + }), + }, }; dsoNameService = jasmine.createSpyObj('dsoNameService', { - getName: 'Collection Name' + getName: 'Collection Name', }); TestBed.configureTestingModule({ @@ -38,9 +38,9 @@ describe('CollectionCurateComponent', () => { declarations: [CollectionCurateComponent], providers: [ {provide: ActivatedRoute, useValue: routeStub}, - {provide: DSONameService, useValue: dsoNameService} + {provide: DSONameService, useValue: dsoNameService}, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); @@ -58,7 +58,7 @@ describe('CollectionCurateComponent', () => { }); it('should contain the collection information provided in the route', () => { comp.dsoRD$.subscribe((value) => { - expect(value.payload.handle + expect(value.payload.handle, ).toEqual('123456789/1'); }); comp.collectionName$.subscribe((value) => { diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts index e20f229cd6..93bb78b85c 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts @@ -34,7 +34,7 @@ export class CollectionCurateComponent { filter((rd: RemoteData) => hasValue(rd)), map((rd: RemoteData) => { return this.dsoNameService.getName(rd.payload); - }) + }), ); } } diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts index 7cc54bd994..1050330b84 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts @@ -24,16 +24,16 @@ describe('CollectionMetadataComponent', () => { const template = Object.assign(new Item(), { _links: { - self: { href: 'template-selflink' } - } + self: { href: 'template-selflink' }, + }, }); const collection = Object.assign(new Collection(), { uuid: 'collection-id', id: 'collection-id', name: 'Fake Collection', _links: { - self: { href: 'collection-selflink' } - } + self: { href: 'collection-selflink' }, + }, }); const collectionTemplateHref = 'rest/api/test/collections/template'; @@ -46,10 +46,10 @@ describe('CollectionMetadataComponent', () => { const notificationsService = jasmine.createSpyObj('notificationsService', { success: {}, - error: {} + error: {}, }); const requestService = jasmine.createSpyObj('requestService', { - setStaleByHrefSubstring: {} + setStaleByHrefSubstring: {}, }); const routerMock = { @@ -67,9 +67,9 @@ describe('CollectionMetadataComponent', () => { { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, { provide: NotificationsService, useValue: notificationsService }, { provide: RequestService, useValue: requestService }, - { provide: Router, useValue: routerMock} + { provide: Router, useValue: routerMock}, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts index 634363527f..0dc4e17a39 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts @@ -40,7 +40,7 @@ export class CollectionMetadataComponent extends ComcolMetadataComponent this.itemTemplateService.findByCollectionID(collection.uuid)) + switchMap((collection: Collection) => this.itemTemplateService.findByCollectionID(collection.uuid)), ); } diff --git a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts index c375a23ddf..77c3a2fd1f 100644 --- a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts @@ -54,10 +54,10 @@ describe('CollectionRolesComponent', () => { }, ], }, - }) + }), ), - }) - } + }), + }, }; const requestService = { @@ -74,7 +74,7 @@ describe('CollectionRolesComponent', () => { SharedModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), - NoopAnimationsModule + NoopAnimationsModule, ], declarations: [ CollectionRolesComponent, @@ -84,9 +84,9 @@ describe('CollectionRolesComponent', () => { { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: RequestService, useValue: requestService }, { provide: GroupDataService, useValue: groupDataService }, - { provide: NotificationsService, useClass: NotificationsServiceStub } + { provide: NotificationsService, useClass: NotificationsServiceStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); fixture = TestBed.createComponent(CollectionRolesComponent); diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts index 3eb83ebe8a..4ac8e184db 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts @@ -51,38 +51,38 @@ describe('CollectionSourceControlsComponent', () => { { id: 'dc', label: 'Simple Dublin Core', - nameSpace: 'http://www.openarchives.org/OAI/2.0/oai_dc/' + nameSpace: 'http://www.openarchives.org/OAI/2.0/oai_dc/', }, { id: 'qdc', label: 'Qualified Dublin Core', - nameSpace: 'http://purl.org/dc/terms/' + nameSpace: 'http://purl.org/dc/terms/', }, { id: 'dim', label: 'DSpace Intermediate Metadata', - nameSpace: 'http://www.dspace.org/xmlns/dspace/dim' - } + nameSpace: 'http://www.dspace.org/xmlns/dspace/dim', + }, ], oaiSource: 'oai-harvest-source', oaiSetId: 'oai-set-id', - _links: {self: {href: 'contentsource-selflink'}} + _links: {self: {href: 'contentsource-selflink'}}, }); process = Object.assign(new Process(), { processId: 'process-id', processStatus: 'COMPLETED', - _links: {output: {href: 'output-href'}} + _links: {output: {href: 'output-href'}}, }); bitstream = Object.assign(new Bitstream(), {_links: {content: {href: 'content-href'}}}); collection = Object.assign(new Collection(), { uuid: 'fake-collection-id', - _links: {self: {href: 'collection-selflink'}} + _links: {self: {href: 'collection-selflink'}}, }); notificationsService = new NotificationsServiceStub(); collectionService = jasmine.createSpyObj('collectionService', { getContentSource: createSuccessfulRemoteDataObject$(contentSource), - findByHref: createSuccessfulRemoteDataObject$(collection) + findByHref: createSuccessfulRemoteDataObject$(collection), }); scriptDataService = jasmine.createSpyObj('scriptDataService', { invoke: createSuccessfulRemoteDataObject$(process), @@ -108,9 +108,9 @@ describe('CollectionSourceControlsComponent', () => { {provide: NotificationsService, useValue: notificationsService}, {provide: CollectionDataService, useValue: collectionService}, {provide: HttpClient, useValue: httpClient}, - {provide: BitstreamDataService, useValue: bitstreamService} + {provide: BitstreamDataService, useValue: bitstreamService}, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts index a84f8929b9..4ba1823a50 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts @@ -6,7 +6,7 @@ import { getAllCompletedRemoteData, getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, - getFirstSucceededRemoteDataPayload + getFirstSucceededRemoteDataPayload, } from '../../../../core/shared/operators'; import { filter, map, switchMap, tap } from 'rxjs/operators'; import { hasValue, hasValueOperator } from '../../../../shared/empty.util'; @@ -61,7 +61,7 @@ export class CollectionSourceControlsComponent implements OnDestroy { private collectionService: CollectionDataService, private translateService: TranslateService, private httpClient: HttpClient, - private bitstreamService: BitstreamDataService + private bitstreamService: BitstreamDataService, ) { } @@ -70,7 +70,7 @@ export class CollectionSourceControlsComponent implements OnDestroy { this.contentSource$ = this.collectionService.findByHref(this.collection._links.self.href, false).pipe( getAllSucceededRemoteDataPayload(), switchMap((collection) => this.collectionService.getContentSource(collection.uuid, false)), - getAllSucceededRemoteDataPayload() + getAllSucceededRemoteDataPayload(), ); } @@ -123,7 +123,7 @@ export class CollectionSourceControlsComponent implements OnDestroy { }); this.testConfigRunning$.next(false); } - } + }, )); } @@ -170,7 +170,7 @@ export class CollectionSourceControlsComponent implements OnDestroy { this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); this.importRunning$.next(false); } - } + }, )); } @@ -217,7 +217,7 @@ export class CollectionSourceControlsComponent implements OnDestroy { this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); this.reImportRunning$.next(false); } - } + }, )); } diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts index e7e98d9523..f94bd90727 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts @@ -50,29 +50,29 @@ describe('CollectionSourceComponent', () => { { id: 'dc', label: 'Simple Dublin Core', - nameSpace: 'http://www.openarchives.org/OAI/2.0/oai_dc/' + nameSpace: 'http://www.openarchives.org/OAI/2.0/oai_dc/', }, { id: 'qdc', label: 'Qualified Dublin Core', - nameSpace: 'http://purl.org/dc/terms/' + nameSpace: 'http://purl.org/dc/terms/', }, { id: 'dim', label: 'DSpace Intermediate Metadata', - nameSpace: 'http://www.dspace.org/xmlns/dspace/dim' - } + nameSpace: 'http://www.dspace.org/xmlns/dspace/dim', + }, ], - _links: { self: { href: 'contentsource-selflink' } } + _links: { self: { href: 'contentsource-selflink' } }, }); fieldUpdate = { field: contentSource, - changeType: undefined + changeType: undefined, }; objectUpdatesService = jasmine.createSpyObj('objectUpdatesService', { getFieldUpdates: observableOf({ - [contentSource.uuid]: fieldUpdate + [contentSource.uuid]: fieldUpdate, }), saveAddFieldUpdate: {}, discardFieldUpdates: {}, @@ -82,15 +82,15 @@ describe('CollectionSourceComponent', () => { getLastModified: observableOf(date), hasUpdates: observableOf(true), isReinstatable: observableOf(false), - isValidPage: observableOf(true) - } + isValidPage: observableOf(true), + }, ); notificationsService = jasmine.createSpyObj('notificationsService', { info: infoNotification, warning: warningNotification, - success: successNotification - } + success: successNotification, + }, ); location = jasmine.createSpyObj('location', ['back']); formService = Object.assign({ @@ -103,18 +103,18 @@ describe('CollectionSourceComponent', () => { return new UntypedFormGroup(controls); } return undefined; - } + }, }); router = Object.assign(new RouterStub(), { - url: 'http://test-url.com/test-url' + url: 'http://test-url.com/test-url', }); collection = Object.assign(new Collection(), { - uuid: 'fake-collection-id' + uuid: 'fake-collection-id', }); collectionService = jasmine.createSpyObj('collectionService', { getContentSource: createSuccessfulRemoteDataObject$(contentSource), updateContentSource: observableOf(contentSource), - getHarvesterEndpoint: observableOf('harvester-endpoint') + getHarvesterEndpoint: observableOf('harvester-endpoint'), }); requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); @@ -129,9 +129,9 @@ describe('CollectionSourceComponent', () => { { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, { provide: Router, useValue: router }, { provide: CollectionDataService, useValue: collectionService }, - { provide: RequestService, useValue: requestService } + { provide: RequestService, useValue: requestService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts index 2d1308cc83..a16f99023e 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts @@ -8,7 +8,7 @@ import { DynamicInputModel, DynamicOptionControlModel, DynamicRadioGroupModel, - DynamicSelectModel + DynamicSelectModel, } from '@ng-dynamic-forms/core'; import { Location } from '@angular/common'; import { TranslateService } from '@ngx-translate/core'; @@ -84,11 +84,11 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem name: 'oaiSource', required: true, validators: { - required: null + required: null, }, errorMessages: { - required: 'You must provide a set id of the target collection.' - } + required: 'You must provide a set id of the target collection.', + }, }); /** @@ -96,7 +96,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem */ oaiSetIdModel = new DynamicInputModel({ id: 'oaiSetId', - name: 'oaiSetId' + name: 'oaiSetId', }); /** @@ -104,7 +104,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem */ metadataConfigIdModel = new DynamicSelectModel({ id: 'metadataConfigId', - name: 'metadataConfigId' + name: 'metadataConfigId', }); /** @@ -115,15 +115,15 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem name: 'harvestType', options: [ { - value: ContentSourceHarvestType.Metadata + value: ContentSourceHarvestType.Metadata, }, { - value: ContentSourceHarvestType.MetadataAndRef + value: ContentSourceHarvestType.MetadataAndRef, }, { - value: ContentSourceHarvestType.MetadataAndBitstreams - } - ] + value: ContentSourceHarvestType.MetadataAndBitstreams, + }, + ], }); /** @@ -139,22 +139,22 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem new DynamicFormGroupModel({ id: 'oaiSourceContainer', group: [ - this.oaiSourceModel - ] + this.oaiSourceModel, + ], }), new DynamicFormGroupModel({ id: 'oaiSetContainer', group: [ this.oaiSetIdModel, - this.metadataConfigIdModel - ] + this.metadataConfigIdModel, + ], }), new DynamicFormGroupModel({ id: 'harvestTypeContainer', group: [ - this.harvestTypeModel - ] - }) + this.harvestTypeModel, + ], + }), ]; /** @@ -163,40 +163,40 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem formLayout: DynamicFormLayout = { oaiSource: { grid: { - host: 'col-12 d-inline-block' - } + host: 'col-12 d-inline-block', + }, }, oaiSetId: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, metadataConfigId: { grid: { - host: 'col col-sm-6 d-inline-block' - } + host: 'col col-sm-6 d-inline-block', + }, }, harvestType: { grid: { host: 'col-12', - option: 'btn-outline-secondary' - } + option: 'btn-outline-secondary', + }, }, oaiSetContainer: { grid: { - host: 'row' - } + host: 'row', + }, }, oaiSourceContainer: { grid: { - host: 'row' - } + host: 'row', + }, }, harvestTypeContainer: { grid: { - host: 'row' - } - } + host: 'row', + }, + }, }; /** @@ -279,7 +279,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem const initialContentSource = cloneDeep(this.contentSource); this.objectUpdatesService.initialize(this.url, [initialContentSource], new Date()); this.update$ = this.objectUpdatesService.getFieldUpdates(this.url, [initialContentSource]).pipe( - map((updates: FieldUpdates) => updates[initialContentSource.uuid]) + map((updates: FieldUpdates) => updates[initialContentSource.uuid]), ); this.updateSub = this.update$.subscribe((update: FieldUpdate) => { if (update) { @@ -294,15 +294,15 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem if (hasValue(field)) { this.formGroup.patchValue({ oaiSourceContainer: { - oaiSource: field.oaiSource + oaiSource: field.oaiSource, }, oaiSetContainer: { oaiSetId: field.oaiSetId, - metadataConfigId: configId + metadataConfigId: configId, }, harvestTypeContainer: { - harvestType: field.harvestType - } + harvestType: field.harvestType, + }, }); this.contentSource = cloneDeep(field); } @@ -320,8 +320,8 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem if (this.metadataConfigIdModel.options.length > 0) { this.formGroup.patchValue({ oaiSetContainer: { - metadataConfigId: this.metadataConfigIdModel.options[0].value - } + metadataConfigId: this.metadataConfigIdModel.options[0].value, + }, }); } } @@ -333,7 +333,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem this.inputModels.forEach( (fieldModel: DynamicFormControlModel) => { this.updateFieldTranslation(fieldModel); - } + }, ); } @@ -378,7 +378,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem getFirstSucceededRemoteData(), map((col) => col.payload.uuid), switchMap((uuid) => this.collectionService.getHarvesterEndpoint(uuid)), - take(1) + take(1), ).subscribe((endpoint) => this.requestService.removeByHrefSubstring(endpoint)); this.requestService.setStaleByHrefSubstring(this.contentSource._links.self.href); // Update harvester @@ -386,7 +386,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem getFirstSucceededRemoteData(), map((col) => col.payload.uuid), switchMap((uuid) => this.collectionService.updateContentSource(uuid, this.contentSource)), - take(1) + take(1), ).subscribe((result: ContentSource | INotification) => { if (hasValue((result as any).harvestType)) { this.clearNotifications(); @@ -433,7 +433,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem this.inputModels.forEach( (fieldModel: DynamicInputModel) => { this.updateContentSourceField(fieldModel, updateHarvestType); - } + }, ); this.saveFieldUpdate(); } diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts index 00f05f50c0..ed1fa413bd 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts @@ -15,25 +15,25 @@ describe('EditCollectionPageComponent', () => { const routeStub = { data: observableOf({ - dso: { payload: {} } + dso: { payload: {} }, }), routeConfig: { children: [ { path: 'mockUrl', data: { - hideReturnButton: false - } - } - ] + hideReturnButton: false, + }, + }, + ], }, snapshot: { firstChild: { routeConfig: { - path: 'mockUrl' - } - } - } + path: 'mockUrl', + }, + }, + }, }; beforeEach(waitForAsync(() => { @@ -44,7 +44,7 @@ describe('EditCollectionPageComponent', () => { { provide: CollectionDataService, useValue: {} }, { provide: ActivatedRoute, useValue: routeStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts index 62fbb3ee3d..02c300321c 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts @@ -9,14 +9,14 @@ import { getCollectionPageRoute } from '../collection-page-routing-paths'; */ @Component({ selector: 'ds-edit-collection', - templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html' + templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html', }) export class EditCollectionPageComponent extends EditComColPageComponent { type = 'collection'; public constructor( protected router: Router, - protected route: ActivatedRoute + protected route: ActivatedRoute, ) { super(router, route); } diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts index 8d0cb179f1..d1cd21af54 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts @@ -10,7 +10,7 @@ import { CollectionSourceComponent } from './collection-source/collection-source import { CollectionAuthorizationsComponent } from './collection-authorizations/collection-authorizations.component'; import { CollectionFormModule } from '../collection-form/collection-form.module'; import { - CollectionSourceControlsComponent + CollectionSourceControlsComponent, } from './collection-source/collection-source-controls/collection-source-controls.component'; import { ResourcePoliciesModule } from '../../shared/resource-policies/resource-policies.module'; import { FormModule } from '../../shared/form/form.module'; @@ -40,8 +40,8 @@ import { AccessControlFormModule } from '../../shared/access-control-form-contai CollectionSourceComponent, CollectionAccessControlComponent, CollectionSourceControlsComponent, - CollectionAuthorizationsComponent - ] + CollectionAuthorizationsComponent, + ], }) export class EditCollectionPageModule { diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts index efab4749fd..d7e06c99aa 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts @@ -24,7 +24,7 @@ import { CollectionAccessControlComponent } from './collection-access-control/co { path: '', resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { breadcrumbKey: 'collection.edit' }, component: EditCollectionPageComponent, @@ -33,7 +33,7 @@ import { CollectionAccessControlComponent } from './collection-access-control/co { path: '', redirectTo: 'metadata', - pathMatch: 'full' + pathMatch: 'full', }, { path: 'metadata', @@ -41,28 +41,28 @@ import { CollectionAccessControlComponent } from './collection-access-control/co data: { title: 'collection.edit.tabs.metadata.title', hideReturnButton: true, - showBreadcrumbs: true - } + showBreadcrumbs: true, + }, }, { path: 'roles', component: CollectionRolesComponent, - data: { title: 'collection.edit.tabs.roles.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.roles.title', showBreadcrumbs: true }, }, { path: 'source', component: CollectionSourceComponent, - data: { title: 'collection.edit.tabs.source.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.source.title', showBreadcrumbs: true }, }, { path: 'curate', component: CollectionCurateComponent, - data: { title: 'collection.edit.tabs.curate.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.curate.title', showBreadcrumbs: true }, }, { path: 'access-control', component: CollectionAccessControlComponent, - data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }, }, /* { path: 'authorizations', @@ -76,39 +76,39 @@ import { CollectionAccessControlComponent } from './collection-access-control/co { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title' } + data: { title: 'resource-policies.create.page.title' }, }, { path: 'edit', resolve: { - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: { title: 'resource-policies.edit.page.title' } + data: { title: 'resource-policies.edit.page.title' }, }, { path: '', component: CollectionAuthorizationsComponent, - data: { title: 'collection.edit.tabs.authorizations.title', showBreadcrumbs: true } - } - ] + data: { title: 'collection.edit.tabs.authorizations.title', showBreadcrumbs: true }, + }, + ], }, { path: 'mapper', component: CollectionItemMapperComponent, - data: { title: 'collection.edit.tabs.item-mapper.title', hideReturnButton: true, showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.item-mapper.title', hideReturnButton: true, showBreadcrumbs: true }, }, - ] - } - ]) + ], + }, + ]), ], providers: [ ResourcePolicyResolver, - ResourcePolicyTargetResolver - ] + ResourcePolicyTargetResolver, + ], }) export class EditCollectionPageRoutingModule { diff --git a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts index 72b776dd7d..676b984935 100644 --- a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts +++ b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts @@ -22,19 +22,19 @@ describe('EditItemTemplatePageComponent', () => { collection = Object.assign(new Collection(), { uuid: 'collection-id', id: 'collection-id', - name: 'Fake Collection' + name: 'Fake Collection', }); itemTemplateService = jasmine.createSpyObj('itemTemplateService', { - findByCollectionID: createSuccessfulRemoteDataObject$({}) + findByCollectionID: createSuccessfulRemoteDataObject$({}), }); TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], declarations: [EditItemTemplatePageComponent], providers: [ { provide: ItemTemplateDataService, useValue: itemTemplateService }, - { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } } + { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/collection-page/edit-item-template-page/item-template-page.resolver.spec.ts b/src/app/collection-page/edit-item-template-page/item-template-page.resolver.spec.ts index 95f0d888e4..1b1a67644e 100644 --- a/src/app/collection-page/edit-item-template-page/item-template-page.resolver.spec.ts +++ b/src/app/collection-page/edit-item-template-page/item-template-page.resolver.spec.ts @@ -14,7 +14,7 @@ describe('ItemTemplatePageResolver', () => { beforeEach(() => { itemTemplateService = { - findByCollectionID: (id: string) => createSuccessfulRemoteDataObject$({ id }) + findByCollectionID: (id: string) => createSuccessfulRemoteDataObject$({ id }), }; dsoNameService = new DSONameServiceMock(); resolver = new ItemTemplatePageResolver(dsoNameService as DSONameService, itemTemplateService); @@ -27,7 +27,7 @@ describe('ItemTemplatePageResolver', () => { (resolved) => { expect(resolved.payload.id).toEqual(uuid); done(); - } + }, ); }); }); diff --git a/src/app/community-list-page/community-list-page.component.spec.ts b/src/app/community-list-page/community-list-page.component.spec.ts index 080a0a9e18..c958a0d63a 100644 --- a/src/app/community-list-page/community-list-page.component.spec.ts +++ b/src/app/community-list-page/community-list-page.component.spec.ts @@ -15,7 +15,7 @@ describe('CommunityListPageComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock + useClass: TranslateLoaderMock, }, }), ], diff --git a/src/app/community-list-page/community-list-page.module.ts b/src/app/community-list-page/community-list-page.module.ts index 15946b2e89..b4d0e68f48 100644 --- a/src/app/community-list-page/community-list-page.module.ts +++ b/src/app/community-list-page/community-list-page.module.ts @@ -13,7 +13,7 @@ const DECLARATIONS = [ CommunityListPageComponent, CommunityListComponent, ThemedCommunityListPageComponent, - ThemedCommunityListComponent + ThemedCommunityListComponent, ]; /** * The page which houses a title and the community list, as described in community-list.component @@ -26,7 +26,7 @@ const DECLARATIONS = [ CdkTreeModule, ], declarations: [ - ...DECLARATIONS + ...DECLARATIONS, ], exports: [ ...DECLARATIONS, diff --git a/src/app/community-list-page/community-list-page.routing.module.ts b/src/app/community-list-page/community-list-page.routing.module.ts index 1754b1b7cf..b1d9841c97 100644 --- a/src/app/community-list-page/community-list-page.routing.module.ts +++ b/src/app/community-list-page/community-list-page.routing.module.ts @@ -17,14 +17,14 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso component: ThemedCommunityListPageComponent, pathMatch: 'full', resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: { title: 'communityList.tabTitle', breadcrumbKey: 'communityList' } - } + data: { title: 'communityList.tabTitle', breadcrumbKey: 'communityList' }, + }, ]), CdkTreeModule, ], - providers: [CommunityListService] + providers: [CommunityListService], }) export class CommunityListPageRoutingModule { } diff --git a/src/app/community-list-page/community-list-service.spec.ts b/src/app/community-list-page/community-list-service.spec.ts index 7781b6f4c0..988dca9255 100644 --- a/src/app/community-list-page/community-list-service.spec.ts +++ b/src/app/community-list-page/community-list-service.spec.ts @@ -41,31 +41,31 @@ describe('CommunityListService', () => { Object.assign(new Community(), { id: '59ee713b-ee53-4220-8c3f-9860dc84fe33', uuid: '59ee713b-ee53-4220-8c3f-9860dc84fe33', - }) + }), ]; mockCollectionsPage1 = [ Object.assign(new Collection(), { id: 'e9dbf393-7127-415f-8919-55be34a6e9ed', uuid: 'e9dbf393-7127-415f-8919-55be34a6e9ed', - name: 'Collection 1' + name: 'Collection 1', }), Object.assign(new Collection(), { id: '59da2ff0-9bf4-45bf-88be-e35abd33f304', uuid: '59da2ff0-9bf4-45bf-88be-e35abd33f304', - name: 'Collection 2' - }) + name: 'Collection 2', + }), ]; mockCollectionsPage2 = [ Object.assign(new Collection(), { id: 'a5159760-f362-4659-9e81-e3253ad91ede', uuid: 'a5159760-f362-4659-9e81-e3253ad91ede', - name: 'Collection 3' + name: 'Collection 3', }), Object.assign(new Collection(), { id: 'a392e16b-fcf2-400a-9a88-53ef7ecbdcd3', uuid: 'a392e16b-fcf2-400a-9a88-53ef7ecbdcd3', - name: 'Collection 4' - }) + name: 'Collection 4', + }), ]; mockListOfTopCommunitiesPage1 = [ Object.assign(new Community(), { @@ -164,7 +164,7 @@ describe('CommunityListService', () => { } else { return createFailedRemoteDataObject$(); } - } + }, }; collectionDataServiceStub = { findByParent(parentUUID: string, options: FindListOptions = {}) { @@ -189,7 +189,7 @@ describe('CommunityListService', () => { } else { return createFailedRemoteDataObject$(); } - } + }, }; TestBed.configureTestingModule({ providers: [CommunityListService, @@ -217,7 +217,7 @@ describe('CommunityListService', () => { service.loadCommunities({ currentPage: 2, - sort: new SortOptions('dc.title', SortDirection.ASC) + sort: new SortOptions('dc.title', SortDirection.ASC), }, null) .pipe(take(1)) .subscribe((value) => { @@ -246,7 +246,7 @@ describe('CommunityListService', () => { beforeEach((done) => { service.loadCommunities({ currentPage: 1, - sort: new SortOptions('dc.title', SortDirection.ASC) + sort: new SortOptions('dc.title', SortDirection.ASC), }, null) .pipe(take(1)) .subscribe((value) => { @@ -279,7 +279,7 @@ describe('CommunityListService', () => { }); service.loadCommunities({ currentPage: 1, - sort: new SortOptions('dc.title', SortDirection.ASC) + sort: new SortOptions('dc.title', SortDirection.ASC), }, expandedNodes) .pipe(take(1)) .subscribe((value) => { @@ -307,7 +307,7 @@ describe('CommunityListService', () => { const expandedNodes = [communityFlatNode]; service.loadCommunities({ currentPage: 1, - sort: new SortOptions('dc.title', SortDirection.ASC) + sort: new SortOptions('dc.title', SortDirection.ASC), }, expandedNodes) .pipe(take(1)) .subscribe((value) => { @@ -332,7 +332,7 @@ describe('CommunityListService', () => { const expandedNodes = [communityFlatNode]; service.loadCommunities({ currentPage: 1, - sort: new SortOptions('dc.title', SortDirection.ASC) + sort: new SortOptions('dc.title', SortDirection.ASC), }, expandedNodes) .pipe(take(1)) .subscribe((value) => { @@ -429,8 +429,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), metadata: { 'dc.description': [{ language: 'en_US', value: 'no subcoms, 2 coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 2' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 2' }], + }, }); let flatNodeList; describe('should return list containing only flatnode corresponding to that community', () => { @@ -461,8 +461,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), metadata: { 'dc.description': [{ language: 'en_US', value: '2 subcoms, no coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 1' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 1' }], + }, }); let flatNodeList; describe('should return list containing only flatnode corresponding to that community', () => { @@ -495,8 +495,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), metadata: { 'dc.description': [{ language: 'en_US', value: '2 subcoms, no coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 1' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 1' }], + }, }); let flatNodeList; beforeEach((done) => { @@ -540,8 +540,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [...mockCollectionsPage1, ...mockCollectionsPage2])), metadata: { 'dc.description': [{ language: 'en_US', value: '2 subcoms, no coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 1' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 1' }], + }, }); const communityFlatNode = toFlatNode(communityWithCollections, observableOf(true), 0, true, null); communityFlatNode.currentCollectionPage = 2; @@ -591,8 +591,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), metadata: { 'dc.description': [{ language: 'en_US', value: '2 subcoms, no coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 1' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 1' }], + }, }); service.getIsExpandable(communityWithSubcoms).pipe(take(1)).subscribe((result) => { expect(result).toEqual(true); @@ -607,8 +607,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockCollectionsPage1)), metadata: { 'dc.description': [{ language: 'en_US', value: 'no subcoms, 2 coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 2' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 2' }], + }, }); service.getIsExpandable(communityWithCollections).pipe(take(1)).subscribe((result) => { expect(result).toEqual(true); @@ -625,8 +625,8 @@ describe('CommunityListService', () => { collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), metadata: { 'dc.description': [{ language: 'en_US', value: 'no subcoms, no coll' }], - 'dc.title': [{ language: 'en_US', value: 'Community 3' }] - } + 'dc.title': [{ language: 'en_US', value: 'Community 3' }], + }, }); service.getIsExpandable(communityWithNoSubcomsOrColls).pipe(take(1)).subscribe((result) => { expect(result).toEqual(false); diff --git a/src/app/community-list-page/community-list-service.ts b/src/app/community-list-page/community-list-service.ts index 21ede06a7d..431bb87ffb 100644 --- a/src/app/community-list-page/community-list-service.ts +++ b/src/app/community-list-page/community-list-service.ts @@ -45,7 +45,7 @@ export const toFlatNode = ( isExpandable: Observable, level: number, isExpanded: boolean, - parent?: FlatNode + parent?: FlatNode, ): FlatNode => ({ isExpandable$: isExpandable, name: c.name, @@ -64,7 +64,7 @@ export const toFlatNode = ( export const showMoreFlatNode = ( id: string, level: number, - parent: FlatNode + parent: FlatNode, ): FlatNode => ({ isExpandable$: observableOf(false), name: 'Show More Flatnode', @@ -94,13 +94,13 @@ export class CommunityListService { @Inject(APP_CONFIG) protected appConfig: AppConfig, private communityDataService: CommunityDataService, private collectionDataService: CollectionDataService, - private store: Store + private store: Store, ) { this.pageSize = appConfig.communityList.pageSize; } private configOnePage: FindListOptions = Object.assign(new FindListOptions(), { - elementsPerPage: 1 + elementsPerPage: 1, }); saveCommunityListStateToStore(expandedNodes: FlatNode[], loadingNode: FlatNode): void { @@ -137,7 +137,7 @@ export class CommunityListService { newPageInfo = Object.assign({}, coms[0].pageInfo, { currentPage }); } return buildPaginatedList(newPageInfo, newPage); - }) + }), ); return topComs$.pipe( switchMap((topComs: PaginatedList) => this.transformListOfCommunities(topComs, 0, null, expandedNodes)), @@ -154,8 +154,8 @@ export class CommunityListService { elementsPerPage: this.pageSize, sort: { field: options.sort.field, - direction: options.sort.direction - } + direction: options.sort.direction, + }, }, followLink('subcommunities', { findListOptions: this.configOnePage }), followLink('collections', { findListOptions: this.configOnePage })) @@ -223,7 +223,7 @@ export class CommunityListService { for (let i = 1; i <= currentCommunityPage; i++) { const nextSetOfSubcommunitiesPage = this.communityDataService.findByParent(community.uuid, { elementsPerPage: this.pageSize, - currentPage: i + currentPage: i, }, followLink('subcommunities', { findListOptions: this.configOnePage }), followLink('collections', { findListOptions: this.configOnePage })) @@ -235,7 +235,7 @@ export class CommunityListService { } else { return observableOf([]); } - }) + }), ); subcoms = [...subcoms, nextSetOfSubcommunitiesPage]; @@ -248,7 +248,7 @@ export class CommunityListService { for (let i = 1; i <= currentCollectionPage; i++) { const nextSetOfCollectionsPage = this.collectionDataService.findByParent(community.uuid, { elementsPerPage: this.pageSize, - currentPage: i + currentPage: i, }) .pipe( getFirstCompletedRemoteData(), @@ -303,7 +303,7 @@ export class CommunityListService { ); return observableCombineLatest(hasSubcoms$, hasColls$).pipe( - map(([hasSubcoms, hasColls]: [boolean, boolean]) => hasSubcoms || hasColls) + map(([hasSubcoms, hasColls]: [boolean, boolean]) => hasSubcoms || hasColls), ); } diff --git a/src/app/community-list-page/community-list.actions.ts b/src/app/community-list-page/community-list.actions.ts index 8e8d6d87cf..e8f3aed2e8 100644 --- a/src/app/community-list-page/community-list.actions.ts +++ b/src/app/community-list-page/community-list.actions.ts @@ -7,7 +7,7 @@ import { FlatNode } from './flat-node.model'; */ export const CommunityListActionTypes = { - SAVE: type('dspace/community-list-page/SAVE') + SAVE: type('dspace/community-list-page/SAVE'), }; /** diff --git a/src/app/community-list-page/community-list.reducer.spec.ts b/src/app/community-list-page/community-list.reducer.spec.ts index 0d0f5c7580..66c2325834 100644 --- a/src/app/community-list-page/community-list.reducer.spec.ts +++ b/src/app/community-list-page/community-list.reducer.spec.ts @@ -20,7 +20,7 @@ describe('communityListReducer', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockSubcommunities1Page1)), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), name: 'community1', - }), observableOf(true), 0, false, null + }), observableOf(true), 0, false, null, ); it ('should set init state of the expandedNodes and loadingNode', () => { diff --git a/src/app/community-list-page/community-list/community-list.component.spec.ts b/src/app/community-list-page/community-list/community-list.component.spec.ts index 815f70005e..65cb1c2ffd 100644 --- a/src/app/community-list-page/community-list/community-list.component.spec.ts +++ b/src/app/community-list-page/community-list/community-list.component.spec.ts @@ -31,7 +31,7 @@ describe('CommunityListComponent', () => { id: '59ee713b-ee53-4220-8c3f-9860dc84fe33', uuid: '59ee713b-ee53-4220-8c3f-9860dc84fe33', name: 'subcommunity2', - }) + }), ]; const mockCollectionsPage1 = [ Object.assign(new Collection(), { @@ -43,7 +43,7 @@ describe('CommunityListComponent', () => { id: '59da2ff0-9bf4-45bf-88be-e35abd33f304', uuid: '59da2ff0-9bf4-45bf-88be-e35abd33f304', name: 'collection2', - }) + }), ]; const mockCollectionsPage2 = [ Object.assign(new Collection(), { @@ -55,7 +55,7 @@ describe('CommunityListComponent', () => { id: 'a392e16b-fcf2-400a-9a88-53ef7ecbdcd3', uuid: 'a392e16b-fcf2-400a-9a88-53ef7ecbdcd3', name: 'collection4', - }) + }), ]; const mockTopCommunitiesWithChildrenArrays = [ @@ -86,7 +86,7 @@ describe('CommunityListComponent', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockSubcommunities1Page1)), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), name: 'community1', - }), observableOf(true), 0, false, null + }), observableOf(true), 0, false, null, ), toFlatNode( Object.assign(new Community(), { @@ -95,7 +95,7 @@ describe('CommunityListComponent', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [...mockCollectionsPage1, ...mockCollectionsPage2])), name: 'community2', - }), observableOf(true), 0, false, null + }), observableOf(true), 0, false, null, ), toFlatNode( Object.assign(new Community(), { @@ -104,7 +104,7 @@ describe('CommunityListComponent', () => { subcommunities: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), collections: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), name: 'community3', - }), observableOf(false), 0, false, null + }), observableOf(false), 0, false, null, ), ]; let communityListServiceStub; @@ -183,14 +183,14 @@ describe('CommunityListComponent', () => { } return observableOf(flatnodes); } - } + }, }; TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock + useClass: TranslateLoaderMock, }, }), CdkTreeModule, @@ -198,7 +198,7 @@ describe('CommunityListComponent', () => { RouterLinkWithHref], declarations: [CommunityListComponent], providers: [CommunityListComponent, - { provide: CommunityListService, useValue: communityListServiceStub },], + { provide: CommunityListService, useValue: communityListServiceStub }], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) .compileComponents(); @@ -242,7 +242,7 @@ describe('CommunityListComponent', () => { const showMoreLink = fixture.debugElement.query(By.css('.show-more-node .btn-outline-primary')); showMoreLink.triggerEventHandler('click', { preventDefault: () => {/**/ - } + }, }); tick(); fixture.detectChanges(); diff --git a/src/app/community-list-page/community-list/community-list.component.ts b/src/app/community-list-page/community-list/community-list.component.ts index 5b2f930813..cb899d98f2 100644 --- a/src/app/community-list-page/community-list/community-list.component.ts +++ b/src/app/community-list-page/community-list/community-list.component.ts @@ -26,7 +26,7 @@ export class CommunityListComponent implements OnInit, OnDestroy { public loadingNode: FlatNode; treeControl = new FlatTreeControl( - (node: FlatNode) => node.level, (node: FlatNode) => true + (node: FlatNode) => node.level, (node: FlatNode) => true, ); dataSource: CommunityListDatasource; diff --git a/src/app/community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts index 4c42161c3c..6f8c0891b4 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -3,7 +3,7 @@ import { DynamicFormControlModel, DynamicFormService, DynamicInputModel, - DynamicTextAreaModel + DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; import { Community } from '../../core/shared/community.model'; import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component'; @@ -21,7 +21,7 @@ import { environment } from '../../../environments/environment'; @Component({ selector: 'ds-community-form', styleUrls: ['../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.scss'], - templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html' + templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', }) export class CommunityFormComponent extends ComColFormComponent implements OnChanges { /** @@ -44,10 +44,10 @@ export class CommunityFormComponent extends ComColFormComponent imple name: 'dc.title', required: true, validators: { - required: null + required: null, }, errorMessages: { - required: 'Please enter a name for this title' + required: 'Please enter a name for this title', }, }), new DynamicTextAreaModel({ diff --git a/src/app/community-page/community-form/community-form.module.ts b/src/app/community-page/community-form/community-form.module.ts index 925d218973..03977fbfa0 100644 --- a/src/app/community-page/community-form/community-form.module.ts +++ b/src/app/community-page/community-form/community-form.module.ts @@ -9,14 +9,14 @@ import { FormModule } from '../../shared/form/form.module'; imports: [ ComcolModule, FormModule, - SharedModule + SharedModule, ], declarations: [ CommunityFormComponent, ], exports: [ - CommunityFormComponent - ] + CommunityFormComponent, + ], }) export class CommunityFormModule { diff --git a/src/app/community-page/community-page-administrator.guard.ts b/src/app/community-page/community-page-administrator.guard.ts index fd7ce5f7bf..c065fe8949 100644 --- a/src/app/community-page/community-page-administrator.guard.ts +++ b/src/app/community-page/community-page-administrator.guard.ts @@ -9,7 +9,7 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { AuthService } from '../core/auth/auth.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) /** * Guard for preventing unauthorized access to certain {@link Community} pages requiring administrator rights diff --git a/src/app/community-page/community-page-routing.module.ts b/src/app/community-page/community-page-routing.module.ts index c37f8832f8..30393aac05 100644 --- a/src/app/community-page/community-page-routing.module.ts +++ b/src/app/community-page/community-page-routing.module.ts @@ -22,14 +22,14 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; { path: COMMUNITY_CREATE_PATH, component: CreateCommunityPageComponent, - canActivate: [AuthenticatedGuard, CreateCommunityPageGuard] + canActivate: [AuthenticatedGuard, CreateCommunityPageGuard], }, { path: ':id', resolve: { dso: CommunityPageResolver, breadcrumb: CommunityBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, runGuardsAndResolvers: 'always', children: [ @@ -37,7 +37,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; path: COMMUNITY_EDIT_PATH, loadChildren: () => import('./edit-community-page/edit-community-page.module') .then((m) => m.EditCommunityPageModule), - canActivate: [CommunityPageAdministratorGuard] + canActivate: [CommunityPageAdministratorGuard], }, { path: 'delete', @@ -49,7 +49,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; path: '', component: ThemedCommunityPageComponent, pathMatch: 'full', - } + }, ], data: { menu: { @@ -67,7 +67,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; }, }, }, - ]) + ]), ], providers: [ CommunityPageResolver, @@ -76,7 +76,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; LinkService, CreateCommunityPageGuard, CommunityPageAdministratorGuard, - ] + ], }) export class CommunityPageRoutingModule { diff --git a/src/app/community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts index a5bbff3cee..61948f0634 100644 --- a/src/app/community-page/community-page.component.ts +++ b/src/app/community-page/community-page.component.ts @@ -26,7 +26,7 @@ import { DSONameService } from '../core/breadcrumbs/dso-name.service'; styleUrls: ['./community-page.component.scss'], templateUrl: './community-page.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - animations: [fadeInOut] + animations: [fadeInOut], }) /** * This component represents a detail page for a single community @@ -67,7 +67,7 @@ export class CommunityPageComponent implements OnInit { ngOnInit(): void { this.communityRD$ = this.route.data.pipe( map((data) => data.dso as RemoteData), - redirectOn4xx(this.router, this.authService) + redirectOn4xx(this.router, this.authService), ); this.logoRD$ = this.communityRD$.pipe( map((rd: RemoteData) => rd.payload), @@ -75,7 +75,7 @@ export class CommunityPageComponent implements OnInit { mergeMap((community: Community) => community.logo)); this.communityPageRoute$ = this.communityRD$.pipe( getAllSucceededRemoteDataPayload(), - map((community) => getCommunityPageRoute(community.id)) + map((community) => getCommunityPageRoute(community.id)), ); this.isCommunityAdmin$ = this.authorizationDataService.isAuthorized(FeatureID.IsCommunityAdmin); } diff --git a/src/app/community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts index 45ffb2a786..9bc93c4808 100644 --- a/src/app/community-page/community-page.module.ts +++ b/src/app/community-page/community-page.module.ts @@ -14,10 +14,10 @@ import { CommunityFormModule } from './community-form/community-form.module'; import { ThemedCommunityPageComponent } from './themed-community-page.component'; import { ComcolModule } from '../shared/comcol/comcol.module'; import { - ThemedCommunityPageSubCommunityListComponent + ThemedCommunityPageSubCommunityListComponent, } from './sub-community-list/themed-community-page-sub-community-list.component'; import { - ThemedCollectionPageSubCollectionListComponent + ThemedCollectionPageSubCollectionListComponent, } from './sub-collection-list/themed-community-page-sub-collection-list.component'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; @@ -41,11 +41,11 @@ const DECLARATIONS = [CommunityPageComponent, DsoPageModule, ], declarations: [ - ...DECLARATIONS + ...DECLARATIONS, ], exports: [ - ...DECLARATIONS - ] + ...DECLARATIONS, + ], }) export class CommunityPageModule { diff --git a/src/app/community-page/community-page.resolver.spec.ts b/src/app/community-page/community-page.resolver.spec.ts index f181dbfff6..d9662717d6 100644 --- a/src/app/community-page/community-page.resolver.spec.ts +++ b/src/app/community-page/community-page.resolver.spec.ts @@ -11,7 +11,7 @@ describe('CommunityPageResolver', () => { beforeEach(() => { communityService = { - findById: (id: string) => createSuccessfulRemoteDataObject$({ id }) + findById: (id: string) => createSuccessfulRemoteDataObject$({ id }), }; store = jasmine.createSpyObj('store', { dispatch: {}, @@ -26,7 +26,7 @@ describe('CommunityPageResolver', () => { (resolved) => { expect(resolved.payload.id).toEqual(uuid); done(); - } + }, ); }); }); diff --git a/src/app/community-page/community-page.resolver.ts b/src/app/community-page/community-page.resolver.ts index 01de9294f3..23a677b2d2 100644 --- a/src/app/community-page/community-page.resolver.ts +++ b/src/app/community-page/community-page.resolver.ts @@ -17,7 +17,7 @@ export const COMMUNITY_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ followLink('logo'), followLink('subcommunities'), followLink('collections'), - followLink('parentCommunity') + followLink('parentCommunity'), ]; /** @@ -27,7 +27,7 @@ export const COMMUNITY_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ export class CommunityPageResolver implements Resolve> { constructor( private communityService: CommunityDataService, - private store: Store + private store: Store, ) { } @@ -43,7 +43,7 @@ export class CommunityPageResolver implements Resolve> { route.params.id, true, false, - ...COMMUNITY_PAGE_LINKS_TO_FOLLOW + ...COMMUNITY_PAGE_LINKS_TO_FOLLOW, ).pipe( getFirstCompletedRemoteData(), ); diff --git a/src/app/community-page/create-community-page/create-community-page.component.spec.ts b/src/app/community-page/create-community-page/create-community-page.component.spec.ts index fbff82efd8..43c7417f11 100644 --- a/src/app/community-page/create-community-page/create-community-page.component.spec.ts +++ b/src/app/community-page/create-community-page/create-community-page.component.spec.ts @@ -26,9 +26,9 @@ describe('CreateCommunityPageComponent', () => { { provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } }, { provide: Router, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, - { provide: RequestService, useValue: {} } + { provide: RequestService, useValue: {} }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/community-page/create-community-page/create-community-page.component.ts b/src/app/community-page/create-community-page/create-community-page.component.ts index eea0908388..f862024d87 100644 --- a/src/app/community-page/create-community-page/create-community-page.component.ts +++ b/src/app/community-page/create-community-page/create-community-page.component.ts @@ -15,7 +15,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-create-community', styleUrls: ['./create-community-page.component.scss'], - templateUrl: './create-community-page.component.html' + templateUrl: './create-community-page.component.html', }) export class CreateCommunityPageComponent extends CreateComColPageComponent { protected frontendURL = '/communities/'; @@ -28,7 +28,7 @@ export class CreateCommunityPageComponent extends CreateComColPageComponent { } else if (id === 'error-id') { return createFailedRemoteDataObject$('not found', 404); } - } + }, }; router = new RouterMock(); @@ -32,7 +32,7 @@ describe('CreateCommunityPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(true) + expect(canActivate).toEqual(true), ); }); @@ -41,7 +41,7 @@ describe('CreateCommunityPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(true) + expect(canActivate).toEqual(true), ); }); @@ -50,7 +50,7 @@ describe('CreateCommunityPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(false) + expect(canActivate).toEqual(false), ); }); @@ -59,7 +59,7 @@ describe('CreateCommunityPageGuard', () => { .pipe(first()) .subscribe( (canActivate) => - expect(canActivate).toEqual(false) + expect(canActivate).toEqual(false), ); }); }); diff --git a/src/app/community-page/create-community-page/create-community-page.guard.ts b/src/app/community-page/create-community-page/create-community-page.guard.ts index c488dc57f8..bb23d277c1 100644 --- a/src/app/community-page/create-community-page/create-community-page.guard.ts +++ b/src/app/community-page/create-community-page/create-community-page.guard.ts @@ -37,8 +37,8 @@ export class CreateCommunityPageGuard implements CanActivate { if (!isValid) { this.router.navigate(['/404']); } - } - ) + }, + ), ); } } diff --git a/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts index 55d0508c10..0000789407 100644 --- a/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts +++ b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts @@ -26,9 +26,9 @@ describe('DeleteCommunityPageComponent', () => { { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } }, { provide: NotificationsService, useValue: {} }, - { provide: RequestService, useValue: {}} + { provide: RequestService, useValue: {}}, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/community-page/delete-community-page/delete-community-page.component.ts b/src/app/community-page/delete-community-page/delete-community-page.component.ts index 65b7c81b38..045fdd2a03 100644 --- a/src/app/community-page/delete-community-page/delete-community-page.component.ts +++ b/src/app/community-page/delete-community-page/delete-community-page.component.ts @@ -13,7 +13,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-delete-community', styleUrls: ['./delete-community-page.component.scss'], - templateUrl: './delete-community-page.component.html' + templateUrl: './delete-community-page.component.html', }) export class DeleteCommunityPageComponent extends DeleteComColPageComponent { protected frontendURL = '/communities/'; diff --git a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts index a3f7935f55..3a3f331def 100644 --- a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts @@ -8,7 +8,7 @@ xdescribe('CommunityAccessControlComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CommunityAccessControlComponent ] + declarations: [ CommunityAccessControlComponent ], }) .compileComponents(); }); diff --git a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts index 8a216e38df..17826c1551 100644 --- a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts +++ b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts @@ -18,7 +18,7 @@ export class CommunityAccessControlComponent implements OnInit { ngOnInit(): void { this.itemRD$ = this.route.parent.parent.data.pipe( - map((data) => data.dso) + map((data) => data.dso), ).pipe(getFirstSucceededRemoteData()) as Observable>; } } diff --git a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts index 719cf83a26..3810157d5f 100644 --- a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts @@ -19,8 +19,8 @@ describe('CommunityAuthorizationsComponent', () => { uuid: 'community', id: 'community', _links: { - self: { href: 'community-selflink' } - } + self: { href: 'community-selflink' }, + }, }); const communityRD = createSuccessfulRemoteDataObject(community); @@ -29,16 +29,16 @@ describe('CommunityAuthorizationsComponent', () => { parent: { parent: { data: observableOf({ - dso: communityRD - }) - } - } + dso: communityRD, + }), + }, + }, }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - CommonModule + CommonModule, ], declarations: [CommunityAuthorizationsComponent], providers: [ diff --git a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts index 7a9f224311..39bd3c5e0c 100644 --- a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts +++ b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts @@ -25,7 +25,7 @@ export class CommunityAuthorizationsComponent impl * @param {ActivatedRoute} route */ constructor( - private route: ActivatedRoute + private route: ActivatedRoute, ) { } diff --git a/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts index 1b1ee2c9f9..cf049a89be 100644 --- a/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts @@ -17,20 +17,20 @@ describe('CommunityCurateComponent', () => { let dsoNameService; const community = Object.assign(new Community(), { - metadata: {'dc.title': ['Community Name'], 'dc.identifier.uri': [ { value: '123456789/1'}]} + metadata: {'dc.title': ['Community Name'], 'dc.identifier.uri': [ { value: '123456789/1'}]}, }); beforeEach(waitForAsync(() => { routeStub = { parent: { data: observableOf({ - dso: createSuccessfulRemoteDataObject(community) - }) - } + dso: createSuccessfulRemoteDataObject(community), + }), + }, }; dsoNameService = jasmine.createSpyObj('dsoNameService', { - getName: 'Community Name' + getName: 'Community Name', }); TestBed.configureTestingModule({ @@ -38,9 +38,9 @@ describe('CommunityCurateComponent', () => { declarations: [CommunityCurateComponent], providers: [ {provide: ActivatedRoute, useValue: routeStub}, - {provide: DSONameService, useValue: dsoNameService} + {provide: DSONameService, useValue: dsoNameService}, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); })); @@ -58,7 +58,7 @@ describe('CommunityCurateComponent', () => { }); it('should contain the community information provided in the route', () => { comp.dsoRD$.subscribe((value) => { - expect(value.payload.handle + expect(value.payload.handle, ).toEqual('123456789/1'); }); comp.communityName$.subscribe((value) => { diff --git a/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts index 8ae04af8f1..83f5826c12 100644 --- a/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts +++ b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts @@ -35,7 +35,7 @@ export class CommunityCurateComponent implements OnInit { filter((rd: RemoteData) => hasValue(rd)), map((rd: RemoteData) => { return this.dsoNameService.getName(rd.payload); - }) + }), ); } diff --git a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts index c597fac0bd..40b2a2d9da 100644 --- a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts @@ -22,9 +22,9 @@ describe('CommunityMetadataComponent', () => { providers: [ { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: { payload: {} } }) } } }, - { provide: NotificationsService, useValue: new NotificationsServiceStub() } + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts index a2dbfa6eb6..2ee98d1c8e 100644 --- a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts +++ b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts @@ -22,7 +22,7 @@ export class CommunityMetadataComponent extends ComcolMetadataComponent { href: 'adminGroup link', }, }, - }) + }), ), - }) - } + }), + }, }; const requestService = { @@ -59,7 +59,7 @@ describe('CommunityRolesComponent', () => { SharedModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), - NoopAnimationsModule + NoopAnimationsModule, ], declarations: [ CommunityRolesComponent, @@ -69,9 +69,9 @@ describe('CommunityRolesComponent', () => { { provide: ActivatedRoute, useValue: route }, { provide: RequestService, useValue: requestService }, { provide: GroupDataService, useValue: groupDataService }, - { provide: NotificationsService, useClass: NotificationsServiceStub } + { provide: NotificationsService, useClass: NotificationsServiceStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); fixture = TestBed.createComponent(CommunityRolesComponent); diff --git a/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts index 3a4c3351c3..1c488a3c08 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts @@ -15,25 +15,25 @@ describe('EditCommunityPageComponent', () => { const routeStub = { data: observableOf({ - dso: { payload: {} } + dso: { payload: {} }, }), routeConfig: { children: [ { path: 'mockUrl', data: { - hideReturnButton: false - } - } - ] + hideReturnButton: false, + }, + }, + ], }, snapshot: { firstChild: { routeConfig: { - path: 'mockUrl' - } - } - } + path: 'mockUrl', + }, + }, + }, }; beforeEach(waitForAsync(() => { @@ -44,7 +44,7 @@ describe('EditCommunityPageComponent', () => { { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: routeStub }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/community-page/edit-community-page/edit-community-page.component.ts b/src/app/community-page/edit-community-page/edit-community-page.component.ts index 54a6ee4944..a4a0a06015 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.component.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.component.ts @@ -9,14 +9,14 @@ import { getCommunityPageRoute } from '../community-page-routing-paths'; */ @Component({ selector: 'ds-edit-community', - templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html' + templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html', }) export class EditCommunityPageComponent extends EditComColPageComponent { type = 'community'; public constructor( protected router: Router, - protected route: ActivatedRoute + protected route: ActivatedRoute, ) { super(router, route); } diff --git a/src/app/community-page/edit-community-page/edit-community-page.module.ts b/src/app/community-page/edit-community-page/edit-community-page.module.ts index 5190d6a008..39ef0e4243 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.module.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.module.ts @@ -12,7 +12,7 @@ import { ResourcePoliciesModule } from '../../shared/resource-policies/resource- import { ComcolModule } from '../../shared/comcol/comcol.module'; import { CommunityAccessControlComponent } from './community-access-control/community-access-control.component'; import { - AccessControlFormModule + AccessControlFormModule, } from '../../shared/access-control-form-container/access-control-form.module'; /** @@ -34,8 +34,8 @@ import { CommunityMetadataComponent, CommunityRolesComponent, CommunityAuthorizationsComponent, - CommunityAccessControlComponent - ] + CommunityAccessControlComponent, + ], }) export class EditCommunityPageModule { diff --git a/src/app/community-page/edit-community-page/edit-community-page.routing.module.ts b/src/app/community-page/edit-community-page/edit-community-page.routing.module.ts index 994c6b5e96..40dc53c829 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.routing.module.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.routing.module.ts @@ -22,7 +22,7 @@ import { CommunityAccessControlComponent } from './community-access-control/comm { path: '', resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { breadcrumbKey: 'community.edit' }, component: EditCommunityPageComponent, @@ -31,7 +31,7 @@ import { CommunityAccessControlComponent } from './community-access-control/comm { path: '', redirectTo: 'metadata', - pathMatch: 'full' + pathMatch: 'full', }, { path: 'metadata', @@ -39,23 +39,23 @@ import { CommunityAccessControlComponent } from './community-access-control/comm data: { title: 'community.edit.tabs.metadata.title', hideReturnButton: true, - showBreadcrumbs: true - } + showBreadcrumbs: true, + }, }, { path: 'roles', component: CommunityRolesComponent, - data: { title: 'community.edit.tabs.roles.title', showBreadcrumbs: true } + data: { title: 'community.edit.tabs.roles.title', showBreadcrumbs: true }, }, { path: 'curate', component: CommunityCurateComponent, - data: { title: 'community.edit.tabs.curate.title', showBreadcrumbs: true } + data: { title: 'community.edit.tabs.curate.title', showBreadcrumbs: true }, }, { path: 'access-control', component: CommunityAccessControlComponent, - data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }, }, /*{ path: 'authorizations', @@ -69,34 +69,34 @@ import { CommunityAccessControlComponent } from './community-access-control/comm { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title' } + data: { title: 'resource-policies.create.page.title' }, }, { path: 'edit', resolve: { - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: { title: 'resource-policies.edit.page.title' } + data: { title: 'resource-policies.edit.page.title' }, }, { path: '', component: CommunityAuthorizationsComponent, - data: { title: 'community.edit.tabs.authorizations.title', showBreadcrumbs: true, hideReturnButton: true } - } - ] - } - ] - } - ]) + data: { title: 'community.edit.tabs.authorizations.title', showBreadcrumbs: true, hideReturnButton: true }, + }, + ], + }, + ], + }, + ]), ], providers: [ ResourcePolicyResolver, - ResourcePolicyTargetResolver - ] + ResourcePolicyTargetResolver, + ], }) export class EditCommunityPageRoutingModule { diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts index 3da92f1493..3f9498e8dd 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts @@ -41,67 +41,67 @@ describe('CommunityPageSubCollectionList Component', () => { id: '123456789-1', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 1' } - ] - } + { language: 'en_US', value: 'Collection 1' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-2', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 2' } - ] - } + { language: 'en_US', value: 'Collection 2' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-3', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 3' } - ] - } + { language: 'en_US', value: 'Collection 3' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-4', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 4' } - ] - } + { language: 'en_US', value: 'Collection 4' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-5', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 5' } - ] - } + { language: 'en_US', value: 'Collection 5' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-6', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 6' } - ] - } + { language: 'en_US', value: 'Collection 6' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-7', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Collection 7' } - ] - } - }) + { language: 'en_US', value: 'Collection 7' }, + ], + }, + }), ]; const mockCommunity = Object.assign(new Community(), { id: '123456789', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Test title' } - ] - } + { language: 'en_US', value: 'Test title' }, + ], + }, }); collectionDataServiceStub = { @@ -119,7 +119,7 @@ describe('CommunityPageSubCollectionList Component', () => { } return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), subCollList.slice(startPageIndex, endPageIndex))); - } + }, }; const paginationService = new PaginationServiceStub(); @@ -127,7 +127,7 @@ describe('CommunityPageSubCollectionList Component', () => { themeService = getMockThemeService(); const linkHeadService = jasmine.createSpyObj('linkHeadService', { - addTag: '' + addTag: '', }); const groupDataService = jasmine.createSpyObj('groupsDataService', { @@ -140,9 +140,9 @@ describe('CommunityPageSubCollectionList Component', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); beforeEach(waitForAsync(() => { @@ -152,7 +152,7 @@ describe('CommunityPageSubCollectionList Component', () => { SharedModule, RouterTestingModule.withRoutes([]), NgbModule, - NoopAnimationsModule + NoopAnimationsModule, ], declarations: [CommunityPageSubCollectionListComponent], providers: [ @@ -166,7 +166,7 @@ describe('CommunityPageSubCollectionList Component', () => { { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts index 7f8c4db9d8..6b9d4c5550 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts @@ -19,7 +19,7 @@ import { hasValue } from '../../shared/empty.util'; selector: 'ds-community-page-sub-collection-list', styleUrls: ['./community-page-sub-collection-list.component.scss'], templateUrl: './community-page-sub-collection-list.component.html', - animations:[fadeIn] + animations:[fadeIn], }) export class CommunityPageSubCollectionListComponent implements OnInit, OnDestroy { @Input() community: Community; @@ -82,9 +82,9 @@ export class CommunityPageSubCollectionListComponent implements OnInit, OnDestro return this.cds.findByParent(this.community.id, { currentPage: currentPagination.currentPage, elementsPerPage: currentPagination.pageSize, - sort: {field: currentSort.field, direction: currentSort.direction} + sort: {field: currentSort.field, direction: currentSort.direction}, }); - }) + }), ).subscribe((results) => { this.subCollectionsRDObs.next(results); }); diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts index 37ce7e496a..554ae5c68b 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -41,67 +41,67 @@ describe('CommunityPageSubCommunityListComponent Component', () => { id: '123456789-1', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 1' } - ] - } + { language: 'en_US', value: 'SubCommunity 1' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-2', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 2' } - ] - } + { language: 'en_US', value: 'SubCommunity 2' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-3', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 3' } - ] - } + { language: 'en_US', value: 'SubCommunity 3' }, + ], + }, }), Object.assign(new Community(), { id: '12345678942', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 4' } - ] - } + { language: 'en_US', value: 'SubCommunity 4' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-5', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 5' } - ] - } + { language: 'en_US', value: 'SubCommunity 5' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-6', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 6' } - ] - } + { language: 'en_US', value: 'SubCommunity 6' }, + ], + }, }), Object.assign(new Community(), { id: '123456789-7', metadata: { 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 7' } - ] - } - }) + { language: 'en_US', value: 'SubCommunity 7' }, + ], + }, + }), ]; const mockCommunity = Object.assign(new Community(), { id: '123456789', metadata: { 'dc.title': [ - { language: 'en_US', value: 'Test title' } - ] - } + { language: 'en_US', value: 'Test title' }, + ], + }, }); communityDataServiceStub = { @@ -120,11 +120,11 @@ describe('CommunityPageSubCommunityListComponent Component', () => { } return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), subCommList.slice(startPageIndex, endPageIndex))); - } + }, }; const linkHeadService = jasmine.createSpyObj('linkHeadService', { - addTag: '' + addTag: '', }); const groupDataService = jasmine.createSpyObj('groupsDataService', { @@ -137,9 +137,9 @@ describe('CommunityPageSubCommunityListComponent Component', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); const paginationService = new PaginationServiceStub(); @@ -153,7 +153,7 @@ describe('CommunityPageSubCommunityListComponent Component', () => { SharedModule, RouterTestingModule.withRoutes([]), NgbModule, - NoopAnimationsModule + NoopAnimationsModule, ], declarations: [CommunityPageSubCommunityListComponent], providers: [ @@ -167,7 +167,7 @@ describe('CommunityPageSubCommunityListComponent Component', () => { { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); })); diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts index 5a0409a051..30639936ba 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts @@ -18,7 +18,7 @@ import { hasValue } from '../../shared/empty.util'; selector: 'ds-community-page-sub-community-list', styleUrls: ['./community-page-sub-community-list.component.scss'], templateUrl: './community-page-sub-community-list.component.html', - animations: [fadeIn] + animations: [fadeIn], }) /** * Component to render the sub-communities of a Community @@ -84,9 +84,9 @@ export class CommunityPageSubCommunityListComponent implements OnInit, OnDestroy return this.cds.findByParent(this.community.id, { currentPage: currentPagination.currentPage, elementsPerPage: currentPagination.pageSize, - sort: { field: currentSort.field, direction: currentSort.direction } + sort: { field: currentSort.field, direction: currentSort.direction }, }); - }) + }), ).subscribe((results) => { this.subCommunitiesRDObs.next(results); }); diff --git a/src/app/core/auth/auth-blocking.guard.spec.ts b/src/app/core/auth/auth-blocking.guard.spec.ts index 3747edd532..6fb2669533 100644 --- a/src/app/core/auth/auth-blocking.guard.spec.ts +++ b/src/app/core/auth/auth-blocking.guard.spec.ts @@ -21,9 +21,9 @@ describe('AuthBlockingGuard', () => { loaded: false, blocking: undefined, loading: false, - authMethods: [] - } - } + authMethods: [], + }, + }, }; beforeEach(waitForAsync(() => { @@ -33,8 +33,8 @@ describe('AuthBlockingGuard', () => { ], providers: [ provideMockStore({ initialState }), - { provide: AuthBlockingGuard, useValue: guard } - ] + { provide: AuthBlockingGuard, useValue: guard }, + ], }).compileComponents(); })); @@ -58,9 +58,9 @@ describe('AuthBlockingGuard', () => { const state = Object.assign({}, initialState, { core: Object.assign({}, initialState.core, { 'auth': { - blocking: true - } - }) + blocking: true, + }, + }), }); mockStore.setState(state); }); @@ -76,9 +76,9 @@ describe('AuthBlockingGuard', () => { const state = Object.assign({}, initialState, { core: Object.assign({}, initialState.core, { 'auth': { - blocking: false - } - }) + blocking: false, + }, + }), }); mockStore.setState(state); }); diff --git a/src/app/core/auth/auth-blocking.guard.ts b/src/app/core/auth/auth-blocking.guard.ts index 9054f66f8b..2bc6c77ed1 100644 --- a/src/app/core/auth/auth-blocking.guard.ts +++ b/src/app/core/auth/auth-blocking.guard.ts @@ -12,7 +12,7 @@ import { isAuthenticationBlocking } from './selectors'; * To ensure all rest requests get the correct auth header. */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class AuthBlockingGuard implements CanActivate { diff --git a/src/app/core/auth/auth-request.service.spec.ts b/src/app/core/auth/auth-request.service.spec.ts index 063aad612f..f059793360 100644 --- a/src/app/core/auth/auth-request.service.spec.ts +++ b/src/app/core/auth/auth-request.service.spec.ts @@ -30,7 +30,7 @@ describe(`AuthRequestService`, () => { constructor( hes: HALEndpointService, rs: RequestService, - rdbs: RemoteDataBuildService + rdbs: RemoteDataBuildService, ) { super(hes, rs, rdbs); } @@ -44,19 +44,19 @@ describe(`AuthRequestService`, () => { endpointURL = 'https://rest.api/auth'; requestID = 'requestID'; shortLivedToken = Object.assign(new ShortLivedToken(), { - value: 'some-token' + value: 'some-token', }); shortLivedTokenRD = createSuccessfulRemoteDataObject(shortLivedToken); halService = jasmine.createSpyObj('halService', { - 'getEndpoint': cold('a', { a: endpointURL }) + 'getEndpoint': cold('a', { a: endpointURL }), }); requestService = jasmine.createSpyObj('requestService', { 'generateRequestId': requestID, 'send': null, }); rdbService = jasmine.createSpyObj('rdbService', { - 'buildFromRequestUUID': cold('a', { a: shortLivedTokenRD }) + 'buildFromRequestUUID': cold('a', { a: shortLivedTokenRD }), }); service = new TestAuthRequestService(halService, requestService, rdbService); diff --git a/src/app/core/auth/auth-request.service.ts b/src/app/core/auth/auth-request.service.ts index b9fdd90176..db82e8a122 100644 --- a/src/app/core/auth/auth-request.service.ts +++ b/src/app/core/auth/auth-request.service.ts @@ -3,7 +3,7 @@ import { distinctUntilChanged, filter, map, switchMap, tap, take } from 'rxjs/op import { HALEndpointService } from '../shared/hal-endpoint.service'; import { RequestService } from '../data/request.service'; import { isNotEmpty } from '../../shared/empty.util'; -import { GetRequest, PostRequest, } from '../data/request.models'; +import { GetRequest, PostRequest } from '../data/request.models'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { getFirstCompletedRemoteData } from '../shared/operators'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; @@ -23,7 +23,7 @@ export abstract class AuthRequestService { constructor(protected halService: HALEndpointService, protected requestService: RequestService, - private rdbService: RemoteDataBuildService + private rdbService: RemoteDataBuildService, ) { } @@ -65,7 +65,7 @@ export abstract class AuthRequestService { map((endpointURL) => this.getEndpointByMethod(endpointURL, method)), distinctUntilChanged(), map((endpointURL: string) => new PostRequest(requestId, endpointURL, body, options)), - take(1) + take(1), ).subscribe((request: PostRequest) => { this.requestService.send(request); }); @@ -90,7 +90,7 @@ export abstract class AuthRequestService { map((endpointURL) => this.getEndpointByMethod(endpointURL, method, ...linksToFollow)), distinctUntilChanged(), map((endpointURL: string) => new GetRequest(requestId, endpointURL, undefined, options)), - take(1) + take(1), ).subscribe((request: GetRequest) => { this.requestService.send(request); }); @@ -125,7 +125,7 @@ export abstract class AuthRequestService { } else { return null; } - }) + }), ); } } diff --git a/src/app/core/auth/auth.actions.ts b/src/app/core/auth/auth.actions.ts index 6bc4565682..b6166ba5f6 100644 --- a/src/app/core/auth/auth.actions.ts +++ b/src/app/core/auth/auth.actions.ts @@ -38,7 +38,7 @@ export const AuthActionTypes = { RETRIEVE_AUTHENTICATED_EPERSON_ERROR: type('dspace/auth/RETRIEVE_AUTHENTICATED_EPERSON_ERROR'), REDIRECT_AFTER_LOGIN_SUCCESS: type('dspace/auth/REDIRECT_AFTER_LOGIN_SUCCESS'), SET_USER_AS_IDLE: type('dspace/auth/SET_USER_AS_IDLE'), - UNSET_USER_AS_IDLE: type('dspace/auth/UNSET_USER_AS_IDLE') + UNSET_USER_AS_IDLE: type('dspace/auth/UNSET_USER_AS_IDLE'), }; diff --git a/src/app/core/auth/auth.effects.spec.ts b/src/app/core/auth/auth.effects.spec.ts index 2e6ba917aa..dad2a46da6 100644 --- a/src/app/core/auth/auth.effects.spec.ts +++ b/src/app/core/auth/auth.effects.spec.ts @@ -25,7 +25,7 @@ import { RetrieveAuthMethodsAction, RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction, - RetrieveTokenAction + RetrieveTokenAction, } from './auth.actions'; import { authMethodsMock, AuthServiceStub } from '../../shared/testing/auth-service.stub'; import { AuthService } from './auth.service'; @@ -56,9 +56,9 @@ describe('AuthEffects', () => { authenticated: false, loaded: false, loading: false, - authMethods: [] - } - } + authMethods: [], + }, + }, }; } @@ -66,7 +66,7 @@ describe('AuthEffects', () => { init(); TestBed.configureTestingModule({ imports: [ - StoreModule.forRoot({ auth: authReducer }, storeModuleConfig) + StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), ], providers: [ AuthEffects, @@ -88,8 +88,8 @@ describe('AuthEffects', () => { actions = hot('--a-', { a: { type: AuthActionTypes.AUTHENTICATE, - payload: { email: 'user', password: 'password' } - } + payload: { email: 'user', password: 'password' }, + }, }); const expected = cold('--b-', { b: new AuthenticationSuccessAction(token) }); @@ -105,8 +105,8 @@ describe('AuthEffects', () => { actions = hot('--a-', { a: { type: AuthActionTypes.AUTHENTICATE, - payload: { email: 'user', password: 'wrongpassword' } - } + payload: { email: 'user', password: 'wrongpassword' }, + }, }); const expected = cold('--b-', { b: new AuthenticationErrorAction(new Error('Message Error test')) }); @@ -161,9 +161,9 @@ describe('AuthEffects', () => { type: AuthActionTypes.AUTHENTICATED_SUCCESS, payload: { authenticated: true, authToken: token, - userHref: EPersonMock._links.self.href - } - } + userHref: EPersonMock._links.self.href, + }, + }, }); const expected = cold('--b-', { b: new RetrieveAuthenticatedEpersonAction(EPersonMock._links.self.href) }); @@ -211,8 +211,8 @@ describe('AuthEffects', () => { spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( observableOf( { - authenticated: true - }) + authenticated: true, + }), ); spyOn((authEffects as any).authService, 'setExternalAuthStatus'); actions = hot('--a-', { a: { type: AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_COOKIE } }); @@ -230,7 +230,7 @@ describe('AuthEffects', () => { it('should return a RETRIEVE_AUTH_METHODS action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is false', () => { spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( observableOf( - { authenticated: false }) + { authenticated: false }), ); actions = hot('--a-', { a: { type: AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_COOKIE } }); @@ -260,8 +260,8 @@ describe('AuthEffects', () => { actions = hot('--a-', { a: { type: AuthActionTypes.RETRIEVE_AUTHENTICATED_EPERSON, - payload: EPersonMock._links.self.href - } + payload: EPersonMock._links.self.href, + }, }); const expected = cold('--b-', { b: new RetrieveAuthenticatedEpersonSuccessAction(EPersonMock.id) }); @@ -314,8 +314,8 @@ describe('AuthEffects', () => { it('should return a AUTHENTICATE_SUCCESS action in response to a RETRIEVE_TOKEN action', () => { actions = hot('--a-', { a: { - type: AuthActionTypes.RETRIEVE_TOKEN - } + type: AuthActionTypes.RETRIEVE_TOKEN, + }, }); const expected = cold('--b-', { b: new AuthenticationSuccessAction(token) }); @@ -330,8 +330,8 @@ describe('AuthEffects', () => { actions = hot('--a-', { a: { - type: AuthActionTypes.RETRIEVE_TOKEN - } + type: AuthActionTypes.RETRIEVE_TOKEN, + }, }); const expected = cold('--b-', { b: new AuthenticationErrorAction(new Error('Message Error test')) }); diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 708ad48f20..09442729a0 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -6,7 +6,7 @@ import { Observable, of as observableOf, queueScheduler, - timer + timer, } from 'rxjs'; import { catchError, filter, map, observeOn, switchMap, take, tap } from 'rxjs/operators'; // import @ngrx @@ -45,7 +45,7 @@ import { RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction, RetrieveTokenAction, - SetUserAsIdleAction + SetUserAsIdleAction, } from './auth.actions'; import { hasValue } from '../../shared/empty.util'; import { environment } from '../../../environments/environment'; @@ -73,14 +73,14 @@ export class AuthEffects { return this.authService.authenticate(action.payload.email, action.payload.password).pipe( take(1), map((response: AuthStatus) => new AuthenticationSuccessAction(response.token)), - catchError((error) => observableOf(new AuthenticationErrorAction(error))) + catchError((error) => observableOf(new AuthenticationErrorAction(error))), ); - }) + }), )); public authenticateSuccess$: Observable = createEffect(() => this.actions$.pipe( ofType(AuthActionTypes.AUTHENTICATE_SUCCESS), - map((action: AuthenticationSuccessAction) => new AuthenticatedAction(action.payload)) + map((action: AuthenticationSuccessAction) => new AuthenticatedAction(action.payload)), )); public authenticated$: Observable = createEffect(() => this.actions$.pipe( @@ -88,8 +88,8 @@ export class AuthEffects { switchMap((action: AuthenticatedAction) => { return this.authService.authenticatedUser(action.payload).pipe( map((userHref: string) => new AuthenticatedSuccessAction((userHref !== null), action.payload, userHref)), - catchError((error) => observableOf(new AuthenticatedErrorAction(error))),); - }) + catchError((error) => observableOf(new AuthenticatedErrorAction(error)))); + }), )); public authenticatedSuccess$: Observable = createEffect(() => this.actions$.pipe( @@ -97,7 +97,7 @@ export class AuthEffects { tap((action: AuthenticatedSuccessAction) => this.authService.storeToken(action.payload.authToken)), switchMap((action: AuthenticatedSuccessAction) => this.authService.getRedirectUrl().pipe( take(1), - map((redirectUrl: string) => [action, redirectUrl]) + map((redirectUrl: string) => [action, redirectUrl]), )), map(([action, redirectUrl]: [AuthenticatedSuccessAction, string]) => { if (hasValue(redirectUrl)) { @@ -105,7 +105,7 @@ export class AuthEffects { } else { return new RetrieveAuthenticatedEpersonAction(action.payload.userHref); } - }) + }), )); public redirectAfterLoginSuccess$: Observable = createEffect(() => this.actions$.pipe( @@ -113,13 +113,13 @@ export class AuthEffects { tap((action: RedirectAfterLoginSuccessAction) => { this.authService.clearRedirectUrl(); this.authService.navigateToRedirectUrl(action.payload); - }) + }), ), { dispatch: false }); // It means "reacts to this action but don't send another" public authenticatedError$: Observable = createEffect(() => this.actions$.pipe( ofType(AuthActionTypes.AUTHENTICATED_ERROR), - tap((action: LogOutSuccessAction) => this.authService.removeToken()) + tap((action: LogOutSuccessAction) => this.authService.removeToken()), ), { dispatch: false }); public retrieveAuthenticatedEperson$: Observable = createEffect(() => this.actions$.pipe( @@ -135,16 +135,16 @@ export class AuthEffects { return user$.pipe( map((user: EPerson) => new RetrieveAuthenticatedEpersonSuccessAction(user.id)), catchError((error) => observableOf(new RetrieveAuthenticatedEpersonErrorAction(error)))); - }) + }), )); public checkToken$: Observable = createEffect(() => this.actions$.pipe(ofType(AuthActionTypes.CHECK_AUTHENTICATION_TOKEN), switchMap(() => { return this.authService.hasValidAuthenticationToken().pipe( map((token: AuthTokenInfo) => new AuthenticatedAction(token)), - catchError((error) => observableOf(new CheckAuthenticationTokenCookieAction())) + catchError((error) => observableOf(new CheckAuthenticationTokenCookieAction())), ); - }) + }), )); public checkTokenCookie$: Observable = createEffect(() => this.actions$.pipe( @@ -160,9 +160,9 @@ export class AuthEffects { return new RetrieveAuthMethodsAction(response); } }), - catchError((error) => observableOf(new AuthenticatedErrorAction(error))) + catchError((error) => observableOf(new AuthenticatedErrorAction(error))), ); - }) + }), )); public retrieveToken$: Observable = createEffect(() => this.actions$.pipe( @@ -171,24 +171,24 @@ export class AuthEffects { return this.authService.refreshAuthenticationToken(null).pipe( take(1), map((token: AuthTokenInfo) => new AuthenticationSuccessAction(token)), - catchError((error) => observableOf(new AuthenticationErrorAction(error))) + catchError((error) => observableOf(new AuthenticationErrorAction(error))), ); - }) + }), )); public refreshToken$: Observable = createEffect(() => this.actions$.pipe(ofType(AuthActionTypes.REFRESH_TOKEN), switchMap((action: RefreshTokenAction) => { return this.authService.refreshAuthenticationToken(action.payload).pipe( map((token: AuthTokenInfo) => new RefreshTokenSuccessAction(token)), - catchError((error) => observableOf(new RefreshTokenErrorAction())) + catchError((error) => observableOf(new RefreshTokenErrorAction())), ); - }) + }), )); // It means "reacts to this action but don't send another" public refreshTokenSuccess$: Observable = createEffect(() => this.actions$.pipe( ofType(AuthActionTypes.REFRESH_TOKEN_SUCCESS), - tap((action: RefreshTokenSuccessAction) => this.authService.replaceToken(action.payload)) + tap((action: RefreshTokenSuccessAction) => this.authService.replaceToken(action.payload)), ), { dispatch: false }); /** @@ -204,7 +204,7 @@ export class AuthEffects { take(1), filter(([loaded, authenticated]) => loaded && !authenticated), tap(() => this.authService.removeToken()), - tap(() => this.authService.resetAuthenticationError()) + tap(() => this.authService.resetAuthenticationError()), ); })), { dispatch: false }); @@ -215,7 +215,7 @@ export class AuthEffects { */ invalidateAuthorizationsRequestCache$ = createEffect(() => this.actions$ .pipe(ofType(StoreActionTypes.REHYDRATE), - tap(() => this.authorizationsService.invalidateAuthorizationsRequestCache()) + tap(() => this.authorizationsService.invalidateAuthorizationsRequestCache()), ), { dispatch: false }); public logOut$: Observable = createEffect(() => this.actions$ @@ -225,23 +225,23 @@ export class AuthEffects { this.authService.stopImpersonating(); return this.authService.logout().pipe( map((value) => new LogOutSuccessAction()), - catchError((error) => observableOf(new LogOutErrorAction(error))) + catchError((error) => observableOf(new LogOutErrorAction(error))), ); - }) + }), )); public logOutSuccess$: Observable = createEffect(() => this.actions$ .pipe(ofType(AuthActionTypes.LOG_OUT_SUCCESS), tap(() => this.authService.removeToken()), tap(() => this.authService.clearRedirectUrl()), - tap(() => this.authService.refreshAfterLogout()) + tap(() => this.authService.refreshAfterLogout()), ), { dispatch: false }); public redirectToLoginTokenExpired$: Observable = createEffect(() => this.actions$ .pipe( ofType(AuthActionTypes.REDIRECT_TOKEN_EXPIRED), tap(() => this.authService.removeToken()), - tap(() => this.authService.redirectToLoginWhenTokenExpired()) + tap(() => this.authService.redirectToLoginWhenTokenExpired()), ), { dispatch: false }); public retrieveMethods$: Observable = createEffect(() => this.actions$ @@ -251,9 +251,9 @@ export class AuthEffects { return this.authService.retrieveAuthMethodsFromAuthStatus(action.payload) .pipe( map((authMethodModels: AuthMethod[]) => new RetrieveAuthMethodsSuccessAction(authMethodModels)), - catchError((error) => observableOf(new RetrieveAuthMethodsErrorAction())) + catchError((error) => observableOf(new RetrieveAuthMethodsErrorAction())), ); - }) + }), )); /** @@ -268,7 +268,7 @@ export class AuthEffects { // in, and start a new timer switchMap(() => // Start a timer outside of Angular's zone - timer(environment.auth.ui.timeUntilIdle, new LeaveZoneScheduler(this.zone, asyncScheduler)) + timer(environment.auth.ui.timeUntilIdle, new LeaveZoneScheduler(this.zone, asyncScheduler)), ), // Re-enter the zone to dispatch the action observeOn(new EnterZoneScheduler(this.zone, queueScheduler)), diff --git a/src/app/core/auth/auth.interceptor.spec.ts b/src/app/core/auth/auth.interceptor.spec.ts index 04bbc4acaf..6c589cb694 100644 --- a/src/app/core/auth/auth.interceptor.spec.ts +++ b/src/app/core/auth/auth.interceptor.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { HttpClientTestingModule, HttpTestingController, } from '@angular/common/http/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { Router } from '@angular/router'; @@ -23,7 +23,7 @@ describe(`AuthInterceptor`, () => { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ dispatch: {}, /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - select: observableOf(true) + select: observableOf(true), }); beforeEach(() => { diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index de0662ff07..365f4ef144 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -10,7 +10,7 @@ import { HttpInterceptor, HttpRequest, HttpResponse, - HttpResponseBase + HttpResponseBase, } from '@angular/common/http'; import { AppState } from '../../app.reducer'; @@ -207,7 +207,7 @@ export class AuthInterceptor implements HttpInterceptor { message: 'Unknown auth error', status: 500, timestamp: Date.now(), - path: '' + path: '', }; } } else { @@ -261,7 +261,7 @@ export class AuthInterceptor implements HttpInterceptor { // login successfully const newToken = response.headers.get('authorization'); authRes = response.clone({ - body: this.makeAuthStatusObject(true, newToken) + body: this.makeAuthStatusObject(true, newToken), }); // clean eventually refresh Requests list @@ -269,13 +269,13 @@ export class AuthInterceptor implements HttpInterceptor { } else if (this.isStatusResponse(response)) { authRes = response.clone({ body: Object.assign(response.body, { - authMethods: this.parseAuthMethodsFromHeaders(response.headers) - }) + authMethods: this.parseAuthMethodsFromHeaders(response.headers), + }), }); } else { // logout successfully authRes = response.clone({ - body: this.makeAuthStatusObject(false) + body: this.makeAuthStatusObject(false), }); } return authRes; @@ -298,7 +298,7 @@ export class AuthInterceptor implements HttpInterceptor { headers: error.headers, status: error.status, statusText: error.statusText, - url: error.url + url: error.url, }); return observableOf(authResponse); } else if (this.isUnauthorized(error) && isNotNull(token) && authService.isTokenExpired()) { diff --git a/src/app/core/auth/auth.reducer.spec.ts b/src/app/core/auth/auth.reducer.spec.ts index c0619adf79..28a0181ed6 100644 --- a/src/app/core/auth/auth.reducer.spec.ts +++ b/src/app/core/auth/auth.reducer.spec.ts @@ -26,7 +26,7 @@ import { RetrieveAuthMethodsSuccessAction, SetRedirectUrlAction, SetUserAsIdleAction, - UnsetUserAsIdleAction + UnsetUserAsIdleAction, } from './auth.actions'; import { AuthTokenInfo } from './models/auth-token-info.model'; import { EPersonMock } from '../../shared/testing/eperson.mock'; @@ -47,7 +47,7 @@ describe('authReducer', () => { loaded: false, blocking: true, loading: false, - idle: false + idle: false, }; const action = new AuthenticateAction('user', 'password'); const newState = authReducer(initialState, action); @@ -58,7 +58,7 @@ describe('authReducer', () => { error: undefined, loading: true, info: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); @@ -72,7 +72,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; const action = new AuthenticationSuccessAction(mockTokenInfo); const newState = authReducer(initialState, action); @@ -88,7 +88,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; const action = new AuthenticationErrorAction(mockError); const newState = authReducer(initialState, action); @@ -100,7 +100,7 @@ describe('authReducer', () => { info: undefined, authToken: undefined, error: 'Test error message', - idle: false + idle: false, }; expect(newState).toEqual(state); @@ -114,7 +114,7 @@ describe('authReducer', () => { error: undefined, loading: true, info: undefined, - idle: false + idle: false, }; const action = new AuthenticatedAction(mockTokenInfo); const newState = authReducer(initialState, action); @@ -125,7 +125,7 @@ describe('authReducer', () => { error: undefined, loading: true, info: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -138,7 +138,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; const action = new AuthenticatedSuccessAction(true, mockTokenInfo, EPersonMock._links.self.href); const newState = authReducer(initialState, action); @@ -150,7 +150,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -163,7 +163,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; const action = new AuthenticatedErrorAction(mockError); const newState = authReducer(initialState, action); @@ -175,7 +175,7 @@ describe('authReducer', () => { blocking: false, loading: false, info: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -186,7 +186,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: false, - idle: false + idle: false, }; const action = new CheckAuthenticationTokenAction(); const newState = authReducer(initialState, action); @@ -195,7 +195,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: true, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -206,7 +206,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: true, - idle: false + idle: false, }; const action = new CheckAuthenticationTokenCookieAction(); const newState = authReducer(initialState, action); @@ -215,7 +215,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: true, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -227,7 +227,7 @@ describe('authReducer', () => { blocking: false, loading: true, externalAuth: false, - idle: false + idle: false, }; const action = new SetAuthCookieStatus(true); const newState = authReducer(initialState, action); @@ -237,7 +237,7 @@ describe('authReducer', () => { blocking: false, loading: true, externalAuth: true, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -252,7 +252,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; const action = new LogOutAction(); @@ -271,7 +271,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; const action = new LogOutSuccessAction(); @@ -286,7 +286,7 @@ describe('authReducer', () => { info: undefined, refreshing: false, userId: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -301,7 +301,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; const action = new LogOutErrorAction(mockError); @@ -315,7 +315,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -329,7 +329,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; const action = new RetrieveAuthenticatedEpersonSuccessAction(EPersonMock.id); const newState = authReducer(initialState, action); @@ -342,7 +342,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -355,7 +355,7 @@ describe('authReducer', () => { blocking: true, loading: true, info: undefined, - idle: false + idle: false, }; const action = new RetrieveAuthenticatedEpersonErrorAction(mockError); const newState = authReducer(initialState, action); @@ -367,7 +367,7 @@ describe('authReducer', () => { blocking: false, loading: false, info: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -382,7 +382,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; const newTokenInfo = new AuthTokenInfo('Refreshed token'); const action = new RefreshTokenAction(newTokenInfo); @@ -397,7 +397,7 @@ describe('authReducer', () => { info: undefined, userId: EPersonMock.id, refreshing: true, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -413,7 +413,7 @@ describe('authReducer', () => { info: undefined, userId: EPersonMock.id, refreshing: true, - idle: false + idle: false, }; const newTokenInfo = new AuthTokenInfo('Refreshed token'); const action = new RefreshTokenSuccessAction(newTokenInfo); @@ -428,7 +428,7 @@ describe('authReducer', () => { info: undefined, userId: EPersonMock.id, refreshing: false, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -444,7 +444,7 @@ describe('authReducer', () => { info: undefined, userId: EPersonMock.id, refreshing: true, - idle: false + idle: false, }; const action = new RefreshTokenErrorAction(); const newState = authReducer(initialState, action); @@ -458,7 +458,7 @@ describe('authReducer', () => { info: undefined, refreshing: false, userId: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -473,7 +473,7 @@ describe('authReducer', () => { loading: false, info: undefined, userId: EPersonMock.id, - idle: false + idle: false, }; state = { @@ -485,7 +485,7 @@ describe('authReducer', () => { error: undefined, info: 'Message', userId: undefined, - idle: false + idle: false, }; }); @@ -507,7 +507,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: false, - idle: false + idle: false, }; const action = new AddAuthenticationMessageAction('Message'); const newState = authReducer(initialState, action); @@ -517,7 +517,7 @@ describe('authReducer', () => { blocking: false, loading: false, info: 'Message', - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -530,7 +530,7 @@ describe('authReducer', () => { loading: false, error: 'Error', info: 'Message', - idle: false + idle: false, }; const action = new ResetAuthenticationMessagesAction(); const newState = authReducer(initialState, action); @@ -541,7 +541,7 @@ describe('authReducer', () => { loading: false, error: undefined, info: undefined, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -552,7 +552,7 @@ describe('authReducer', () => { loaded: false, blocking: false, loading: false, - idle: false + idle: false, }; const action = new SetRedirectUrlAction('redirect.url'); const newState = authReducer(initialState, action); @@ -562,7 +562,7 @@ describe('authReducer', () => { blocking: false, loading: false, redirectUrl: 'redirect.url', - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -574,7 +574,7 @@ describe('authReducer', () => { blocking: false, loading: false, authMethods: [], - idle: false + idle: false, }; const action = new RetrieveAuthMethodsAction(new AuthStatus()); const newState = authReducer(initialState, action); @@ -584,7 +584,7 @@ describe('authReducer', () => { blocking: false, loading: true, authMethods: [], - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -596,11 +596,11 @@ describe('authReducer', () => { blocking: true, loading: true, authMethods: [], - idle: false + idle: false, }; const authMethods = [ new AuthMethod(AuthMethodType.Password), - new AuthMethod(AuthMethodType.Shibboleth, 'location') + new AuthMethod(AuthMethodType.Shibboleth, 'location'), ]; const action = new RetrieveAuthMethodsSuccessAction(authMethods); const newState = authReducer(initialState, action); @@ -610,7 +610,7 @@ describe('authReducer', () => { blocking: false, loading: false, authMethods: authMethods, - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -622,7 +622,7 @@ describe('authReducer', () => { blocking: true, loading: true, authMethods: [], - idle: false + idle: false, }; const action = new RetrieveAuthMethodsErrorAction(); @@ -633,7 +633,7 @@ describe('authReducer', () => { blocking: false, loading: false, authMethods: [new AuthMethod(AuthMethodType.Password)], - idle: false + idle: false, }; expect(newState).toEqual(state); }); @@ -644,7 +644,7 @@ describe('authReducer', () => { loaded: true, blocking: false, loading: false, - idle: false + idle: false, }; const action = new SetUserAsIdleAction(); @@ -654,7 +654,7 @@ describe('authReducer', () => { loaded: true, blocking: false, loading: false, - idle: true + idle: true, }; expect(newState).toEqual(state); }); @@ -665,7 +665,7 @@ describe('authReducer', () => { loaded: true, blocking: false, loading: false, - idle: true + idle: true, }; const action = new UnsetUserAsIdleAction(); @@ -675,7 +675,7 @@ describe('authReducer', () => { loaded: true, blocking: false, loading: false, - idle: false + 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 ba9c41326a..a0de83e3a1 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -11,7 +11,7 @@ import { RefreshTokenSuccessAction, RetrieveAuthenticatedEpersonSuccessAction, RetrieveAuthMethodsSuccessAction, SetAuthCookieStatus, - SetRedirectUrlAction + SetRedirectUrlAction, } from './auth.actions'; // import models import { AuthTokenInfo } from './models/auth-token-info.model'; @@ -76,7 +76,7 @@ const initialState: AuthState = { loading: false, authMethods: [], externalAuth: false, - idle: false + idle: false, }; /** @@ -92,13 +92,13 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut return Object.assign({}, state, { error: undefined, loading: true, - info: undefined + info: undefined, }); case AuthActionTypes.AUTHENTICATED: return Object.assign({}, state, { loading: true, - blocking: true + blocking: true, }); case AuthActionTypes.CHECK_AUTHENTICATION_TOKEN: @@ -109,7 +109,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut case AuthActionTypes.SET_AUTH_COOKIE_STATUS: return Object.assign({}, state, { - externalAuth: (action as SetAuthCookieStatus).payload + externalAuth: (action as SetAuthCookieStatus).payload, }); case AuthActionTypes.AUTHENTICATED_ERROR: @@ -120,13 +120,13 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut error: (action as AuthenticationErrorAction).payload.message, loaded: true, blocking: false, - loading: false + loading: false, }); case AuthActionTypes.AUTHENTICATED_SUCCESS: return Object.assign({}, state, { authenticated: true, - authToken: (action as AuthenticatedSuccessAction).payload.authToken + authToken: (action as AuthenticatedSuccessAction).payload.authToken, }); case AuthActionTypes.RETRIEVE_AUTHENTICATED_EPERSON_SUCCESS: @@ -136,7 +136,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut loading: false, blocking: false, info: undefined, - userId: (action as RetrieveAuthenticatedEpersonSuccessAction).payload + userId: (action as RetrieveAuthenticatedEpersonSuccessAction).payload, }); case AuthActionTypes.AUTHENTICATE_ERROR: @@ -145,7 +145,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut authToken: undefined, error: (action as AuthenticationErrorAction).payload.message, blocking: false, - loading: false + loading: false, }); case AuthActionTypes.AUTHENTICATE_SUCCESS: @@ -155,7 +155,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut case AuthActionTypes.LOG_OUT_ERROR: return Object.assign({}, state, { authenticated: true, - error: (action as LogOutErrorAction).payload.message + error: (action as LogOutErrorAction).payload.message, }); case AuthActionTypes.REFRESH_TOKEN_ERROR: @@ -168,7 +168,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut loading: false, info: undefined, refreshing: false, - userId: undefined + userId: undefined, }); case AuthActionTypes.LOG_OUT_SUCCESS: @@ -181,7 +181,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut loading: true, info: undefined, refreshing: false, - userId: undefined + userId: undefined, }); case AuthActionTypes.REDIRECT_AUTHENTICATION_REQUIRED: @@ -193,7 +193,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut blocking: false, loading: false, info: (action as RedirectWhenTokenExpiredAction as RedirectWhenAuthenticationIsRequiredAction).payload, - userId: undefined + userId: undefined, }); case AuthActionTypes.REFRESH_TOKEN: @@ -205,7 +205,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut return Object.assign({}, state, { authToken: (action as RefreshTokenSuccessAction).payload, refreshing: false, - blocking: false + blocking: false, }); case AuthActionTypes.ADD_MESSAGE: @@ -229,14 +229,14 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut return Object.assign({}, state, { loading: false, blocking: false, - authMethods: (action as RetrieveAuthMethodsSuccessAction).payload + authMethods: (action as RetrieveAuthMethodsSuccessAction).payload, }); case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR: return Object.assign({}, state, { loading: false, blocking: false, - authMethods: [new AuthMethod(AuthMethodType.Password)] + authMethods: [new AuthMethod(AuthMethodType.Password)], }); case AuthActionTypes.SET_REDIRECT_URL: diff --git a/src/app/core/auth/auth.service.spec.ts b/src/app/core/auth/auth.service.spec.ts index b38d17aecd..4e652afa88 100644 --- a/src/app/core/auth/auth.service.spec.ts +++ b/src/app/core/auth/auth.service.spec.ts @@ -40,7 +40,7 @@ describe('AuthService test', () => { const mockEpersonDataService: any = { findByHref(href: string): Observable> { return createSuccessfulRemoteDataObject$(EPersonMock); - } + }, }; let mockStore: Store; @@ -62,13 +62,13 @@ describe('AuthService test', () => { uuid: 'test', authenticated: true, okay: true, - specialGroups: SpecialGroupDataMock$ + specialGroups: SpecialGroupDataMock$, }); function init() { mockStore = jasmine.createSpyObj('store', { dispatch: {}, - pipe: observableOf(true) + pipe: observableOf(true), }); window = new NativeWindowRef(); routerStub = new RouterStub(); @@ -80,7 +80,7 @@ describe('AuthService test', () => { loading: false, authToken: token, user: EPersonMock, - idle: false + idle: false, }; unAuthenticatedState = { authenticated: false, @@ -88,7 +88,7 @@ describe('AuthService test', () => { loading: false, authToken: undefined, user: undefined, - idle: false + idle: false, }; idleState = { authenticated: true, @@ -96,12 +96,12 @@ describe('AuthService test', () => { loading: false, authToken: token, user: EPersonMock, - idle: true + idle: true, }; authRequest = new AuthRequestServiceStub(); routeStub = new ActivatedRouteStub(); linkService = { - resolveLinks: {} + resolveLinks: {}, }; hardRedirectService = jasmine.createSpyObj('hardRedirectService', ['redirect']); spyOn(linkService, 'resolveLinks').and.returnValue({ authenticated: true, eperson: observableOf({ payload: {} }) }); @@ -117,8 +117,8 @@ describe('AuthService test', () => { StoreModule.forRoot({ authReducer }, { runtimeChecks: { strictStateImmutability: false, - strictActionImmutability: false - } + strictActionImmutability: false, + }, }), ], declarations: [], @@ -135,7 +135,7 @@ describe('AuthService test', () => { { provide: NotificationsService, useValue: NotificationsServiceStub }, { provide: TranslateService, useValue: getMockTranslateService() }, CookieService, - AuthService + AuthService, ], }); authService = TestBed.inject(AuthService); @@ -238,9 +238,9 @@ describe('AuthService test', () => { StoreModule.forRoot({ authReducer }, { runtimeChecks: { strictStateImmutability: false, - strictActionImmutability: false - } - }) + strictActionImmutability: false, + }, + }), ], providers: [ { provide: AuthRequestService, useValue: authRequest }, @@ -249,8 +249,8 @@ describe('AuthService test', () => { { provide: RouteService, useValue: routeServiceStub }, { provide: RemoteDataBuildService, useValue: linkService }, CookieService, - AuthService - ] + AuthService, + ], }).compileComponents(); })); @@ -313,9 +313,9 @@ describe('AuthService test', () => { StoreModule.forRoot({ authReducer }, { runtimeChecks: { strictStateImmutability: false, - strictActionImmutability: false - } - }) + strictActionImmutability: false, + }, + }), ], providers: [ { provide: AuthRequestService, useValue: authRequest }, @@ -325,8 +325,8 @@ describe('AuthService test', () => { { provide: RemoteDataBuildService, useValue: linkService }, ClientCookieService, CookieService, - AuthService - ] + AuthService, + ], }).compileComponents(); })); @@ -338,7 +338,7 @@ describe('AuthService test', () => { loaded: true, loading: false, authToken: expiredToken, - user: EPersonMock + user: EPersonMock, }; store .subscribe((state) => { @@ -528,7 +528,7 @@ describe('AuthService test', () => { it('should call navigateToRedirectUrl with no url', () => { const expectRes = cold('(a|)', { - a: SpecialGroupDataMock + a: SpecialGroupDataMock, }); expect(authService.getSpecialGroupsFromAuthStatus()).toBeObservable(expectRes); }); @@ -543,9 +543,9 @@ describe('AuthService test', () => { StoreModule.forRoot({ authReducer }, { runtimeChecks: { strictStateImmutability: false, - strictActionImmutability: false - } - }) + strictActionImmutability: false, + }, + }), ], providers: [ { provide: AuthRequestService, useValue: authRequest }, @@ -554,8 +554,8 @@ describe('AuthService test', () => { { provide: RouteService, useValue: routeServiceStub }, { provide: RemoteDataBuildService, useValue: linkService }, CookieService, - AuthService - ] + AuthService, + ], }).compileComponents(); })); @@ -583,9 +583,9 @@ describe('AuthService test', () => { StoreModule.forRoot({ authReducer }, { runtimeChecks: { strictStateImmutability: false, - strictActionImmutability: false - } - }) + strictActionImmutability: false, + }, + }), ], providers: [ { provide: AuthRequestService, useValue: authRequest }, @@ -594,8 +594,8 @@ describe('AuthService test', () => { { provide: RouteService, useValue: routeServiceStub }, { provide: RemoteDataBuildService, useValue: linkService }, CookieService, - AuthService - ] + AuthService, + ], }).compileComponents(); })); diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index c1537792f5..b610dc448f 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -20,7 +20,7 @@ import { isEmpty, isNotEmpty, isNotNull, - isNotUndefined + isNotUndefined, } from '../../shared/empty.util'; import { CookieService } from '../services/cookie.service'; import { @@ -30,7 +30,7 @@ import { isAuthenticated, isAuthenticatedLoaded, isIdle, - isTokenRefreshing + isTokenRefreshing, } from './selectors'; import { AppState } from '../../app.reducer'; import { @@ -39,7 +39,7 @@ import { ResetAuthenticationMessagesAction, SetAuthCookieStatus, SetRedirectUrlAction, SetUserAsIdleAction, - UnsetUserAsIdleAction + UnsetUserAsIdleAction, } from './auth.actions'; import { NativeWindowRef, NativeWindowService } from '../services/window.service'; import { RouteService } from '../services/route.service'; @@ -90,13 +90,13 @@ export class AuthService { protected store: Store, protected hardRedirectService: HardRedirectService, private notificationService: NotificationsService, - private translateService: TranslateService + private translateService: TranslateService, ) { this.store.pipe( // when this service is constructed the store is not fully initialized yet filter((state: any) => state?.core?.auth !== undefined), select(isAuthenticated), - startWith(false) + startWith(false), ).subscribe((authenticated: boolean) => this._authenticated = authenticated); } @@ -136,7 +136,7 @@ export class AuthService { options.headers = headers; options.withCredentials = true; return this.authRequestService.getRequest('status', options).pipe( - map((rd: RemoteData) => Object.assign(new AuthStatus(), rd.payload)) + map((rd: RemoteData) => Object.assign(new AuthStatus(), rd.payload)), ); } @@ -202,7 +202,7 @@ export class AuthService { */ public retrieveAuthenticatedUserByHref(userHref: string): Observable { return this.epersonService.findByHref(userHref).pipe( - getAllSucceededRemoteDataPayload() + getAllSucceededRemoteDataPayload(), ); } @@ -212,7 +212,7 @@ export class AuthService { */ public retrieveAuthenticatedUserById(userId: string): Observable { return this.epersonService.findById(userId).pipe( - getAllSucceededRemoteDataPayload() + getAllSucceededRemoteDataPayload(), ); } @@ -225,7 +225,7 @@ export class AuthService { select(getAuthenticatedUserId), hasValueOperator(), switchMap((id: string) => this.epersonService.findById(id)), - getAllSucceededRemoteDataPayload() + getAllSucceededRemoteDataPayload(), ); } @@ -248,7 +248,7 @@ export class AuthService { } else { return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(),[])); } - }) + }), ); } @@ -267,7 +267,7 @@ export class AuthService { } else { throw false; } - }) + }), ); } @@ -411,7 +411,7 @@ export class AuthService { const token = this.getToken(); return token.expires - (60 * 5 * 1000) < Date.now(); } - }) + }), ); } @@ -515,7 +515,7 @@ export class AuthService { } else { return this.storage.get(REDIRECT_COOKIE); } - }) + }), ); } @@ -608,7 +608,7 @@ export class AuthService { */ getShortlivedToken(): Observable { return this.isAuthenticated().pipe( - switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : observableOf(null)) + switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : observableOf(null)), ); } diff --git a/src/app/core/auth/authenticated.guard.ts b/src/app/core/auth/authenticated.guard.ts index 1ab1d2e0a5..a5ecbd14d8 100644 --- a/src/app/core/auth/authenticated.guard.ts +++ b/src/app/core/auth/authenticated.guard.ts @@ -4,7 +4,7 @@ import { CanActivate, Router, RouterStateSnapshot, - UrlTree + UrlTree, } from '@angular/router'; import { Observable } from 'rxjs'; @@ -59,7 +59,7 @@ export class AuthenticatedGuard implements CanActivate { this.authService.removeToken(); return this.router.createUrlTree([LOGIN_ROUTE]); } - }) + }), ); } } diff --git a/src/app/core/auth/browser-auth-request.service.spec.ts b/src/app/core/auth/browser-auth-request.service.spec.ts index b41d981bcf..d9645e5885 100644 --- a/src/app/core/auth/browser-auth-request.service.spec.ts +++ b/src/app/core/auth/browser-auth-request.service.spec.ts @@ -12,7 +12,7 @@ describe(`BrowserAuthRequestService`, () => { beforeEach(() => { href = 'https://rest.api/auth/shortlivedtokens'; requestService = jasmine.createSpyObj('requestService', { - 'generateRequestId': '8bb0582d-5013-4337-af9c-763beb25aae2' + 'generateRequestId': '8bb0582d-5013-4337-af9c-763beb25aae2', }); service = new BrowserAuthRequestService(null, requestService, null); }); diff --git a/src/app/core/auth/browser-auth-request.service.ts b/src/app/core/auth/browser-auth-request.service.ts index 485e2ef9c4..17d10c69fb 100644 --- a/src/app/core/auth/browser-auth-request.service.ts +++ b/src/app/core/auth/browser-auth-request.service.ts @@ -15,7 +15,7 @@ export class BrowserAuthRequestService extends AuthRequestService { constructor( halService: HALEndpointService, requestService: RequestService, - rdbService: RemoteDataBuildService + rdbService: RemoteDataBuildService, ) { super(halService, requestService, rdbService); } diff --git a/src/app/core/auth/server-auth-request.service.spec.ts b/src/app/core/auth/server-auth-request.service.spec.ts index 5b0221e5df..cec9da469e 100644 --- a/src/app/core/auth/server-auth-request.service.spec.ts +++ b/src/app/core/auth/server-auth-request.service.spec.ts @@ -7,7 +7,7 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; import { PostRequest } from '../data/request.models'; import { XSRF_REQUEST_HEADER, - XSRF_RESPONSE_HEADER + XSRF_RESPONSE_HEADER, } from '../xsrf/xsrf.constants'; describe(`ServerAuthRequestService`, () => { @@ -22,20 +22,20 @@ describe(`ServerAuthRequestService`, () => { beforeEach(() => { href = 'https://rest.api/auth/shortlivedtokens'; requestService = jasmine.createSpyObj('requestService', { - 'generateRequestId': '8bb0582d-5013-4337-af9c-763beb25aae2' + 'generateRequestId': '8bb0582d-5013-4337-af9c-763beb25aae2', }); let headers = new HttpHeaders(); headers = headers.set(XSRF_RESPONSE_HEADER, mockToken); httpResponse = { body: { bar: false }, headers: headers, - statusText: '200' + statusText: '200', } as HttpResponse; httpClient = jasmine.createSpyObj('httpClient', { get: observableOf(httpResponse), }); halService = jasmine.createSpyObj('halService', { - 'getRootHref': '/api' + 'getRootHref': '/api', }); service = new ServerAuthRequestService(halService, requestService, null, httpClient); }); diff --git a/src/app/core/auth/server-auth-request.service.ts b/src/app/core/auth/server-auth-request.service.ts index 976c5cc3df..e9b41691cf 100644 --- a/src/app/core/auth/server-auth-request.service.ts +++ b/src/app/core/auth/server-auth-request.service.ts @@ -7,12 +7,12 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { HttpHeaders, HttpClient, - HttpResponse + HttpResponse, } from '@angular/common/http'; import { XSRF_REQUEST_HEADER, XSRF_RESPONSE_HEADER, - DSPACE_XSRF_COOKIE + DSPACE_XSRF_COOKIE, } from '../xsrf/xsrf.constants'; import { map } from 'rxjs/operators'; import { Observable } from 'rxjs'; @@ -59,8 +59,8 @@ export class ServerAuthRequestService extends AuthRequestService { { headers: headers, }, - ) - ) + ), + ), ); } diff --git a/src/app/core/auth/server-auth.service.ts b/src/app/core/auth/server-auth.service.ts index fc8ab18bfb..6dbbf28443 100644 --- a/src/app/core/auth/server-auth.service.ts +++ b/src/app/core/auth/server-auth.service.ts @@ -57,7 +57,7 @@ export class ServerAuthService extends AuthService { options.headers = headers; options.withCredentials = true; return this.authRequestService.getRequest('status', options).pipe( - map((rd: RemoteData) => Object.assign(new AuthStatus(), rd.payload)) + map((rd: RemoteData) => Object.assign(new AuthStatus(), rd.payload)), ); } } diff --git a/src/app/core/auth/token-response-parsing.service.spec.ts b/src/app/core/auth/token-response-parsing.service.spec.ts index a440325560..20a6e31794 100644 --- a/src/app/core/auth/token-response-parsing.service.spec.ts +++ b/src/app/core/auth/token-response-parsing.service.spec.ts @@ -13,10 +13,10 @@ describe('TokenResponseParsingService', () => { it('should return a TokenResponse containing the token', () => { const data = { payload: { - token: 'valid-token' + token: 'valid-token', }, statusCode: 200, - statusText: 'OK' + statusText: 'OK', } as RawRestResponse; const expected = new TokenResponse(data.payload.token, true, 200, 'OK'); expect(service.parse(undefined, data)).toEqual(expected); @@ -26,7 +26,7 @@ describe('TokenResponseParsingService', () => { const data = { payload: {}, statusCode: 200, - statusText: 'OK' + statusText: 'OK', } as RawRestResponse; const expected = new TokenResponse(null, false, 200, 'OK'); expect(service.parse(undefined, data)).toEqual(expected); @@ -36,7 +36,7 @@ describe('TokenResponseParsingService', () => { const data = { payload: {}, statusCode: 400, - statusText: 'BAD REQUEST' + statusText: 'BAD REQUEST', } as RawRestResponse; const expected = new TokenResponse(null, false, 400, 'BAD REQUEST'); expect(service.parse(undefined, data)).toEqual(expected); diff --git a/src/app/core/breadcrumbs/bitstream-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/bitstream-breadcrumb.resolver.ts index b2ddade682..cacc05a700 100644 --- a/src/app/core/breadcrumbs/bitstream-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/bitstream-breadcrumb.resolver.ts @@ -11,7 +11,7 @@ import { BitstreamBreadcrumbsService } from './bitstream-breadcrumbs.service'; * The class that resolves the BreadcrumbConfig object for an Item */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class BitstreamBreadcrumbResolver extends DSOBreadcrumbResolver { constructor( diff --git a/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts b/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts index 333886ed3d..a1e3692cad 100644 --- a/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts +++ b/src/app/core/breadcrumbs/bitstream-breadcrumbs.service.ts @@ -23,13 +23,13 @@ import { BITSTREAM_PAGE_LINKS_TO_FOLLOW } from '../../bitstream-page/bitstream-p * Service to calculate DSpaceObject breadcrumbs for a single part of the route */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class BitstreamBreadcrumbsService extends DSOBreadcrumbsService { constructor( protected bitstreamService: BitstreamDataService, protected linkService: LinkService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, ) { super(linkService, dsoNameService); } @@ -53,7 +53,7 @@ export class BitstreamBreadcrumbsService extends DSOBreadcrumbsService { return observableOf([]); }), - map((breadcrumbs: Breadcrumb[]) => [...breadcrumbs, crumb]) + map((breadcrumbs: Breadcrumb[]) => [...breadcrumbs, crumb]), ); } @@ -74,12 +74,12 @@ export class BitstreamBreadcrumbsService extends DSOBreadcrumbsService { } else { return observableOf(undefined); } - }) + }), ); } else { return observableOf(undefined); } - }) + }), ); } } diff --git a/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts index 46c49add06..eee5f495be 100644 --- a/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts @@ -10,7 +10,7 @@ import { COLLECTION_PAGE_LINKS_TO_FOLLOW } from '../../collection-page/collectio * The class that resolves the BreadcrumbConfig object for a Collection */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CollectionBreadcrumbResolver extends DSOBreadcrumbResolver { constructor(protected breadcrumbService: DSOBreadcrumbsService, protected dataService: CollectionDataService) { diff --git a/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts index 309927771d..574ef4798d 100644 --- a/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts @@ -10,7 +10,7 @@ import { COMMUNITY_PAGE_LINKS_TO_FOLLOW } from '../../community-page/community-p * The class that resolves the BreadcrumbConfig object for a Community */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CommunityBreadcrumbResolver extends DSOBreadcrumbResolver { constructor(protected breadcrumbService: DSOBreadcrumbsService, protected dataService: CommunityDataService) { diff --git a/src/app/core/breadcrumbs/dso-breadcrumb.resolver.spec.ts b/src/app/core/breadcrumbs/dso-breadcrumb.resolver.spec.ts index e35e26e46f..f5b35b5514 100644 --- a/src/app/core/breadcrumbs/dso-breadcrumb.resolver.spec.ts +++ b/src/app/core/breadcrumbs/dso-breadcrumb.resolver.spec.ts @@ -21,7 +21,7 @@ describe('DSOBreadcrumbResolver', () => { testCollection = Object.assign(new Collection(), { uuid }); dsoBreadcrumbService = {}; collectionService = { - findById: (id: string) => createSuccessfulRemoteDataObject$(testCollection) + findById: (id: string) => createSuccessfulRemoteDataObject$(testCollection), }; resolver = new CollectionBreadcrumbResolver(dsoBreadcrumbService, collectionService); }); diff --git a/src/app/core/breadcrumbs/dso-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/dso-breadcrumb.resolver.ts index 8be4e5e099..92c02ed14c 100644 --- a/src/app/core/breadcrumbs/dso-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/dso-breadcrumb.resolver.ts @@ -43,7 +43,7 @@ export abstract class DSOBreadcrumbResolver { { type: 'community', metadata: { - 'dc.title': [{ value: 'community' }] + 'dc.title': [{ value: 'community' }], }, uuid: communityUUID, parentCommunity: observableOf(Object.assign(createSuccessfulRemoteDataObject(undefined), { statusCode: 204 })), _links: { parentCommunity: 'site', - self: communityPath + communityUUID - } - } + self: communityPath + communityUUID, + }, + }, ); testCollection = Object.assign(new Collection(), { type: 'collection', metadata: { - 'dc.title': [{ value: 'collection' }] + 'dc.title': [{ value: 'collection' }], }, uuid: collectionUUID, parentCommunity: createSuccessfulRemoteDataObject$(testCommunity), _links: { parentCommunity: communityPath + communityUUID, - self: communityPath + collectionUUID - } - } + self: communityPath + collectionUUID, + }, + }, ); testItem = Object.assign(new Item(), { type: 'item', metadata: { - 'dc.title': [{ value: 'item' }] + 'dc.title': [{ value: 'item' }], }, uuid: itemUUID, owningCollection: createSuccessfulRemoteDataObject$(testCollection), _links: { owningCollection: collectionPath + collectionUUID, - self: itemPath + itemUUID - } - } + self: itemPath + itemUUID, + }, + }, ); dsoNameService = { getName: (dso) => getName(dso) }; @@ -93,8 +93,8 @@ describe('DSOBreadcrumbsService', () => { TestBed.configureTestingModule({ providers: [ { provide: LinkService, useValue: getMockLinkService() }, - { provide: DSONameService, useValue: dsoNameService } - ] + { provide: DSONameService, useValue: dsoNameService }, + ], }).compileComponents(); })); diff --git a/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts b/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts index 9a22cd0e35..9c9f724454 100644 --- a/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts +++ b/src/app/core/breadcrumbs/dso-breadcrumbs.service.ts @@ -16,12 +16,12 @@ import { getDSORoute } from '../../app-routing-paths'; * Service to calculate DSpaceObject breadcrumbs for a single part of the route */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DSOBreadcrumbsService implements BreadcrumbsProviderService { constructor( protected linkService: LinkService, - protected dsoNameService: DSONameService + protected dsoNameService: DSONameService, ) { } @@ -46,7 +46,7 @@ export class DSOBreadcrumbsService implements BreadcrumbsProviderService [...breadcrumbs, crumb]) + map((breadcrumbs: Breadcrumb[]) => [...breadcrumbs, crumb]), ); } } diff --git a/src/app/core/breadcrumbs/dso-name.service.spec.ts b/src/app/core/breadcrumbs/dso-name.service.spec.ts index 9f2f76599a..90b08dca14 100644 --- a/src/app/core/breadcrumbs/dso-name.service.spec.ts +++ b/src/app/core/breadcrumbs/dso-name.service.spec.ts @@ -22,7 +22,7 @@ describe(`DSONameService`, () => { }, getRenderTypes(): (string | GenericConstructor)[] { return ['Person', Item, DSpaceObject]; - } + }, }); mockOrgUnitName = 'Molecular Spectroscopy'; @@ -32,7 +32,7 @@ describe(`DSONameService`, () => { }, getRenderTypes(): (string | GenericConstructor)[] { return ['OrgUnit', Item, DSpaceObject]; - } + }, }); mockDSOName = 'Lorem Ipsum'; @@ -42,7 +42,7 @@ describe(`DSONameService`, () => { }, getRenderTypes(): (string | GenericConstructor)[] { return [DSpaceObject]; - } + }, }); service = new DSONameService({ instant: (a) => a } as any); diff --git a/src/app/core/breadcrumbs/dso-name.service.ts b/src/app/core/breadcrumbs/dso-name.service.ts index ddd97705b0..18bc821c3f 100644 --- a/src/app/core/breadcrumbs/dso-name.service.ts +++ b/src/app/core/breadcrumbs/dso-name.service.ts @@ -9,7 +9,7 @@ import { Metadata } from '../shared/metadata.utils'; * on its render types. */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DSONameService { @@ -55,7 +55,7 @@ export class DSONameService { Default: (dso: DSpaceObject): string => { // If object doesn't have dc.title metadata use name property return dso.firstMetadataValue('dc.title') || dso.name || this.translateService.instant('dso.name.untitled'); - } + }, }; /** diff --git a/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.spec.ts b/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.spec.ts index 0d1870487a..822d6a896f 100644 --- a/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.spec.ts +++ b/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.spec.ts @@ -17,13 +17,13 @@ describe('I18nBreadcrumbResolver', () => { route = { data: { breadcrumbKey: i18nKey }, routeConfig: { - path: segment + path: segment, }, parent: { routeConfig: { - path: parentSegment - } - } as any + path: parentSegment, + }, + } as any, }; expectedPath = new URLCombiner(parentSegment, segment).toString(); i18nBreadcrumbService = {}; diff --git a/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.ts index b3fadbbaa9..ed5a024672 100644 --- a/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/i18n-breadcrumb.resolver.ts @@ -9,7 +9,7 @@ import { currentPathFromSnapshot } from '../../shared/utils/route.utils'; * The class that resolves a BreadcrumbConfig object with an i18n key string for a route */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class I18nBreadcrumbResolver implements Resolve> { constructor(protected breadcrumbService: I18nBreadcrumbsService) { diff --git a/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts b/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts index 15563bdde8..7e31efe690 100644 --- a/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts +++ b/src/app/core/breadcrumbs/i18n-breadcrumbs.service.ts @@ -12,7 +12,7 @@ export const BREADCRUMB_MESSAGE_POSTFIX = '.breadcrumbs'; * Service to calculate i18n breadcrumbs for a single part of the route */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class I18nBreadcrumbsService implements BreadcrumbsProviderService { diff --git a/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts index 3005b6f09a..e22ffb364d 100644 --- a/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts @@ -10,7 +10,7 @@ import { ITEM_PAGE_LINKS_TO_FOLLOW } from '../../item-page/item.resolver'; * The class that resolves the BreadcrumbConfig object for an Item */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ItemBreadcrumbResolver extends DSOBreadcrumbResolver { constructor(protected breadcrumbService: DSOBreadcrumbsService, protected dataService: ItemDataService) { diff --git a/src/app/core/browse/browse-definition-data.service.spec.ts b/src/app/core/browse/browse-definition-data.service.spec.ts index f321c2551c..84899b8336 100644 --- a/src/app/core/browse/browse-definition-data.service.spec.ts +++ b/src/app/core/browse/browse-definition-data.service.spec.ts @@ -18,7 +18,7 @@ describe(`BrowseDefinitionDataService`, () => { const options = new FindListOptions(); const linksToFollow = [ followLink('entries'), - followLink('items') + followLink('items'), ]; function initTestService() { diff --git a/src/app/core/browse/browse-definition-data.service.ts b/src/app/core/browse/browse-definition-data.service.ts index b7cc3daa6f..b81781ced0 100644 --- a/src/app/core/browse/browse-definition-data.service.ts +++ b/src/app/core/browse/browse-definition-data.service.ts @@ -35,7 +35,7 @@ export const createAndSendBrowseDefinitionGetRequest = (requestService: RequestS href$.pipe( isNotEmptyOperator(), - take(1) + take(1), ).subscribe((href: string) => { const requestId = requestService.generateRequestId(); const request = new BrowseDefinitionRestRequest(requestId, href); @@ -150,7 +150,7 @@ export class BrowseDefinitionDataService extends IdentifiableDataService { sortOptions: [ { name: 'title', - metadata: 'dc.title' + metadata: 'dc.title', }, { name: 'dateissued', - metadata: 'dc.date.issued' + metadata: 'dc.date.issued', }, { name: 'dateaccessioned', - metadata: 'dc.date.accessioned' - } + metadata: 'dc.date.accessioned', + }, ], defaultSortOrder: 'ASC', type: 'browse', metadataKeys: [ - 'dc.date.issued' + 'dc.date.issued', ], _links: { self: { href: 'https://rest.api/discover/browses/dateissued' }, - items: { href: 'https://rest.api/discover/browses/dateissued/items' } - } + items: { href: 'https://rest.api/discover/browses/dateissued/items' }, + }, }), Object.assign(new ValueListBrowseDefinition(), { id: 'author', @@ -58,28 +58,28 @@ describe('BrowseService', () => { sortOptions: [ { name: 'title', - metadata: 'dc.title' + metadata: 'dc.title', }, { name: 'dateissued', - metadata: 'dc.date.issued' + metadata: 'dc.date.issued', }, { name: 'dateaccessioned', - metadata: 'dc.date.accessioned' - } + metadata: 'dc.date.accessioned', + }, ], defaultSortOrder: 'ASC', type: 'browse', metadataKeys: [ 'dc.contributor.*', - 'dc.creator' + 'dc.creator', ], _links: { self: { href: 'https://rest.api/discover/browses/author' }, entries: { href: 'https://rest.api/discover/browses/author/entries' }, - items: { href: 'https://rest.api/discover/browses/author/items' } - } + items: { href: 'https://rest.api/discover/browses/author/items' }, + }, }), Object.assign(new HierarchicalBrowseDefinition(), { id: 'srsc', @@ -88,14 +88,14 @@ describe('BrowseService', () => { vocabulary: 'srsc', type: 'browse', metadata: [ - 'dc.subject' + 'dc.subject', ], _links: { vocabulary: { 'href': 'https://rest.api/submission/vocabularies/srsc/' }, items: { 'href': 'https://rest.api/discover/browses/srsc/items' }, entries: { 'href': 'https://rest.api/discover/browses/srsc/entries' }, - self: { 'href': 'https://rest.api/discover/browses/srsc' } - } + self: { 'href': 'https://rest.api/discover/browses/srsc' }, + }, }), ]; @@ -104,13 +104,13 @@ describe('BrowseService', () => { const getRequestEntry$ = (successful: boolean) => { return observableOf({ - response: { isSuccessful: successful, payload: browseDefinitions } as any + response: { isSuccessful: successful, payload: browseDefinitions } as any, } as RequestEntry); }; function initTestService() { browseDefinitionDataService = jasmine.createSpyObj('browseDefinitionDataService', { - findAll: createSuccessfulRemoteDataObject$(createPaginatedList(browseDefinitions)) + findAll: createSuccessfulRemoteDataObject$(createPaginatedList(browseDefinitions)), }); hrefOnlyDataService = getMockHrefOnlyDataService(); return new BrowseService( @@ -118,7 +118,7 @@ describe('BrowseService', () => { halService, browseDefinitionDataService, hrefOnlyDataService, - rdbService + rdbService, ); } @@ -164,7 +164,7 @@ describe('BrowseService', () => { scheduler.flush(); expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { - a: expected + a: expected, })); }); @@ -178,7 +178,7 @@ describe('BrowseService', () => { scheduler.flush(); expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { - a: expected + a: expected, })); }); @@ -193,7 +193,7 @@ describe('BrowseService', () => { scheduler.flush(); expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { - a: expected + a: expected, })); }); }); @@ -208,7 +208,7 @@ describe('BrowseService', () => { service = initTestService(); spyOn(service, 'getBrowseDefinitions').and .returnValue(hot('--a-', { - a: createSuccessfulRemoteDataObject(createPaginatedList(browseDefinitions)) + a: createSuccessfulRemoteDataObject(createPaginatedList(browseDefinitions)), })); }); @@ -290,7 +290,7 @@ describe('BrowseService', () => { scheduler.flush(); expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { - a: expectedURL + a: expectedURL, })); }); diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index b210b34949..531eef7915 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -16,7 +16,7 @@ import { getFirstOccurrence, getRemoteDataPayload, getFirstSucceededRemoteData, - getPaginatedListPayload + getPaginatedListPayload, } from '../shared/operators'; import { URLCombiner } from '../url-combiner/url-combiner'; import { BrowseEntrySearchOptions } from './browse-entry-search-options.model'; @@ -27,7 +27,7 @@ import { SortDirection } from '../cache/models/sort-options.model'; export const BROWSE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ - followLink('thumbnail') + followLink('thumbnail'), ]; /** @@ -102,7 +102,7 @@ export class BrowseService { href = new URLCombiner(href, `?${args.join('&')}`).toString(); } return href; - }) + }), ); if (options.fetchThumbnail ) { return this.hrefOnlyDataService.findListByHref(href$, {}, null, null, ...BROWSE_LINKS_TO_FOLLOW); @@ -187,12 +187,12 @@ export class BrowseService { href = new URLCombiner(href, `?${args.join('&')}`).toString(); } return href; - }) + }), ); return this.hrefOnlyDataService.findListByHref(href$).pipe( getFirstSucceededRemoteData(), - getFirstOccurrence() + getFirstOccurrence(), ); } @@ -248,7 +248,7 @@ export class BrowseService { } return isNotEmpty(matchingKeys); - }) + }), ), map((def: BrowseDefinition) => { if (isEmpty(def) || isEmpty(def._links) || isEmpty(def._links[linkPath])) { @@ -258,7 +258,7 @@ export class BrowseService { } }), startWith(undefined), - distinctUntilChanged() + distinctUntilChanged(), ); } diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index 01c4622122..904f0c9ce8 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -13,7 +13,7 @@ export const LINK_DEFINITION_FACTORY = new InjectionToken<(source: GenericConstructor) => Map>>('getLinkDefinitions', { providedIn: 'root', - factory: () => getLinkDefinitions + factory: () => getLinkDefinitions, }); const resolvedLinkKey = Symbol('resolvedLink'); @@ -81,7 +81,7 @@ export const link = ( resourceType, isList, linkName, - propertyName + propertyName, }); linkMap.set(target.constructor, targetMap); diff --git a/src/app/core/cache/builders/link.service.spec.ts b/src/app/core/cache/builders/link.service.spec.ts index 0ddfe05870..3c4147164c 100644 --- a/src/app/core/cache/builders/link.service.spec.ts +++ b/src/app/core/cache/builders/link.service.spec.ts @@ -54,15 +54,15 @@ describe('LinkService', () => { value: 'a test value', _links: { self: { - href: 'http://self.link' + href: 'http://self.link', }, predecessor: { - href: 'http://predecessor.link' + href: 'http://predecessor.link', }, successor: { - href: 'http://successor.link' + href: 'http://successor.link', }, - } + }, }); testDataService = new TestDataService(); spyOn(testDataService, 'findListByHref').and.callThrough(); @@ -70,7 +70,7 @@ describe('LinkService', () => { TestBed.configureTestingModule({ providers: [LinkService, { provide: TestDataService, - useValue: testDataService + useValue: testDataService, }, { provide: DATA_SERVICE_FACTORY, useValue: jasmine.createSpy('getDataServiceFor').and.returnValue(TestDataService), @@ -79,7 +79,7 @@ describe('LinkService', () => { useValue: jasmine.createSpy('getLinkDefinition').and.returnValue({ resourceType: TEST_MODEL, linkName: 'predecessor', - propertyName: 'predecessor' + propertyName: 'predecessor', }), }, { provide: LINK_DEFINITION_MAP_FACTORY, @@ -93,9 +93,9 @@ describe('LinkService', () => { resourceType: TEST_MODEL, linkName: 'successor', propertyName: 'successor', - } + }, ]), - }] + }], }); service = TestBed.inject(LinkService); }); @@ -115,7 +115,7 @@ describe('LinkService', () => { resourceType: TEST_MODEL, linkName: 'predecessor', propertyName: 'predecessor', - isList: true + isList: true, }); service.resolveLink(testModel, followLink('predecessor', { findListOptions: { some: 'options ' } as any }, followLink('successor'))); }); @@ -213,12 +213,12 @@ describe('LinkService', () => { value: 'a test value', _links: { self: { - href: 'http://self.link' + href: 'http://self.link', }, predecessor: { - href: 'http://predecessor.link' - } - } + href: 'http://predecessor.link', + }, + }, }); }); @@ -237,7 +237,7 @@ describe('LinkService', () => { ((service as any).getLinkDefinition as jasmine.Spy).and.returnValue({ resourceType: TEST_MODEL, linkName: 'successor', - propertyName: 'successor' + propertyName: 'successor', }); result = service.resolveLinks(testModel, followLink('successor')); }); diff --git a/src/app/core/cache/builders/remote-data-build.service.spec.ts b/src/app/core/cache/builders/remote-data-build.service.spec.ts index d9b856bb77..76f6f9fb8f 100644 --- a/src/app/core/cache/builders/remote-data-build.service.spec.ts +++ b/src/app/core/cache/builders/remote-data-build.service.spec.ts @@ -49,7 +49,7 @@ describe('RemoteDataBuildService', () => { linkService = getMockLinkService(); requestService = getMockRequestService(); unCacheableObject = { - foo: 'bar' + foo: 'bar', }; pageInfo = new PageInfo(); selfLink1 = 'https://rest.api/some/object'; @@ -64,31 +64,31 @@ describe('RemoteDataBuildService', () => { 'dc.title': [ { language: 'en_US', - value: 'Item nr 1' - } - ] + value: 'Item nr 1', + }, + ], }, _links: { self: { - href: selfLink1 - } - } + href: selfLink1, + }, + }, }), Object.assign(new Item(), { metadata: { 'dc.title': [ { language: 'en_US', - value: 'Item nr 2' - } - ] + value: 'Item nr 2', + }, + ], }, _links: { self: { - href: selfLink2 - } - } - }) + href: selfLink2, + }, + }, + }), ]; paginatedList = buildPaginatedList(pageInfo, array); normalizedPaginatedList = buildPaginatedList(pageInfo, array, true); @@ -96,43 +96,43 @@ describe('RemoteDataBuildService', () => { paginatedListRD = createSuccessfulRemoteDataObject(paginatedList); entrySuccessCacheable = { request: { - uuid: '17820127-0ee5-4ed4-b6da-e654bdff8487' + uuid: '17820127-0ee5-4ed4-b6da-e654bdff8487', }, state: RequestEntryState.Success, response: { statusCode: 200, payloadLink: { - href: selfLink1 - } - } + href: selfLink1, + }, + }, } as RequestEntry; entrySuccessUnCacheable = { request: { - uuid: '0aa5ec06-d6a7-4e73-952e-1e0462bd1501' + uuid: '0aa5ec06-d6a7-4e73-952e-1e0462bd1501', }, state: RequestEntryState.Success, response: { statusCode: 200, unCacheableObject, - } + }, } as RequestEntry; entrySuccessNoContent = { request: { - uuid: '780a7295-6102-4a43-9775-80f2a4ff673c' + uuid: '780a7295-6102-4a43-9775-80f2a4ff673c', }, state: RequestEntryState.Success, response: { - statusCode: 204 + statusCode: 204, }, } as RequestEntry; entryError = { request: { - uuid: '1609dcbc-8442-4877-966e-864f151cc40c' + uuid: '1609dcbc-8442-4877-966e-864f151cc40c', }, state: RequestEntryState.Error, response: { statusCode: 500, - } + }, } as RequestEntry; requestEntry$ = observableOf(entrySuccessCacheable); linksToFollow = [ @@ -427,8 +427,8 @@ describe('RemoteDataBuildService', () => { beforeEach(() => { entry = { response: { - payloadLink: { href: 'payload-link' } - } + payloadLink: { href: 'payload-link' }, + }, }; }); @@ -441,8 +441,8 @@ describe('RemoteDataBuildService', () => { beforeEach(() => { entry = { response: { - payloadLink: undefined - } + payloadLink: undefined, + }, }; }); @@ -459,8 +459,8 @@ describe('RemoteDataBuildService', () => { beforeEach(() => { entry = { response: { - unCacheableObject: Object.assign({}) - } + unCacheableObject: Object.assign({}), + }, }; }); @@ -472,7 +472,7 @@ describe('RemoteDataBuildService', () => { describe('when the entry\'s response doesn\'t contain an uncacheable object', () => { beforeEach(() => { entry = { - response: {} + response: {}, }; }); @@ -487,7 +487,7 @@ describe('RemoteDataBuildService', () => { it(`should return a new instance of that type`, () => { const source: any = { type: ITEM, - uuid: 'some-uuid' + uuid: 'some-uuid', }; const result = (service as any).plainObjectToInstance(source); @@ -503,7 +503,7 @@ describe('RemoteDataBuildService', () => { it(`should return a new plain JS object`, () => { const source: any = { type: 'foobar', - uuid: 'some-uuid' + uuid: 'some-uuid', }; const result = (service as any).plainObjectToInstance(source); @@ -528,7 +528,7 @@ describe('RemoteDataBuildService', () => { beforeEach(() => { paginatedLinksToFollow = [ followLink('page', {}, ...linksToFollow), - ...linksToFollow + ...linksToFollow, ]; }); describe(`and the given list doesn't have a page property already`, () => { @@ -843,15 +843,15 @@ describe('RemoteDataBuildService', () => { it('should only emit after the callback is done', () => { testScheduler.run(({ cold: tsCold, expectObservable }) => { buildFromRequestUUIDSpy.and.returnValue( - tsCold('-p----s', RDs) + tsCold('-p----s', RDs), ); callback.and.returnValue( - tsCold(' --t', BOOLEAN) + tsCold(' --t', BOOLEAN), ); const done$ = service.buildFromRequestUUIDAndAwait('some-href', callback); expectObservable(done$).toBe( - ' -p------s', RDs // resulting duration between pending & successful includes the callback + ' -p------s', RDs, // resulting duration between pending & successful includes the callback ); }); }); diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index 075bf3ca0c..a84ed6804a 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -77,7 +77,7 @@ export class RemoteDataBuildService { } } return [obj]; - }) + }), ); } @@ -151,7 +151,7 @@ export class RemoteDataBuildService { paginatedList.page = page .map((obj: any) => this.plainObjectToInstance(obj)) .map((obj: any) => - this.linkService.resolveLinks(obj, ...pageLink.linksToFollow) + this.linkService.resolveLinks(obj, ...pageLink.linksToFollow), ); if (isNotEmpty(otherLinks)) { return this.linkService.resolveLinks(paginatedList, ...otherLinks); @@ -163,7 +163,7 @@ export class RemoteDataBuildService { paginatedList.page = paginatedList.page .map((obj: any) => this.plainObjectToInstance(obj)) .map((obj: any) => - this.linkService.resolveLinks(obj, ...pageLink.linksToFollow) + this.linkService.resolveLinks(obj, ...pageLink.linksToFollow), ); if (isNotEmpty(otherLinks)) { return observableOf(this.linkService.resolveLinks(paginatedList, ...otherLinks)); @@ -229,7 +229,7 @@ export class RemoteDataBuildService { } else { return [rd]; } - }) + }), ); } @@ -272,7 +272,7 @@ export class RemoteDataBuildService { return isStale(r2.state) ? r1 : r2; } }), - distinctUntilKeyChanged('lastUpdated') + distinctUntilKeyChanged('lastUpdated'), ); const payload$ = this.buildPayload(requestEntry$, href$, ...linksToFollow); @@ -293,12 +293,12 @@ export class RemoteDataBuildService { toRemoteDataObservable(requestEntry$: Observable, payload$: Observable) { return observableCombineLatest([ requestEntry$, - payload$ + payload$, ]).pipe( filter(([entry,payload]: [RequestEntry, T]) => hasValue(entry) && // filter out cases where the state is successful, but the payload isn't yet set - !(hasSucceeded(entry.state) && isUndefined(payload)) + !(hasSucceeded(entry.state) && isUndefined(payload)), ), map(([entry, payload]: [RequestEntry, T]) => { let response = entry.response; @@ -313,9 +313,9 @@ export class RemoteDataBuildService { entry.state, response.errorMessage, payload, - response.statusCode + response.statusCode, ); - }) + }), ); } @@ -406,7 +406,7 @@ export class RemoteDataBuildService { state, errorMessage, payload, - statusCode + statusCode, ); })); } diff --git a/src/app/core/cache/object-cache.actions.ts b/src/app/core/cache/object-cache.actions.ts index c18a20ffd6..41f4f41a8d 100644 --- a/src/app/core/cache/object-cache.actions.ts +++ b/src/app/core/cache/object-cache.actions.ts @@ -15,7 +15,7 @@ export const ObjectCacheActionTypes = { ADD_PATCH: type('dspace/core/cache/object/ADD_PATCH'), APPLY_PATCH: type('dspace/core/cache/object/APPLY_PATCH'), ADD_DEPENDENTS: type('dspace/core/cache/object/ADD_DEPENDENTS'), - REMOVE_DEPENDENTS: type('dspace/core/cache/object/REMOVE_DEPENDENTS') + REMOVE_DEPENDENTS: type('dspace/core/cache/object/REMOVE_DEPENDENTS'), }; /** diff --git a/src/app/core/cache/object-cache.effects.ts b/src/app/core/cache/object-cache.effects.ts index 5d6899c9ba..7ce7b26119 100644 --- a/src/app/core/cache/object-cache.effects.ts +++ b/src/app/core/cache/object-cache.effects.ts @@ -18,7 +18,7 @@ export class ObjectCacheEffects { */ fixTimestampsOnRehydrate = createEffect(() => this.actions$ .pipe(ofType(StoreActionTypes.REHYDRATE), - map(() => new ResetObjectCacheTimestampsAction(new Date().getTime())) + map(() => new ResetObjectCacheTimestampsAction(new Date().getTime())), )); constructor(private actions$: Actions) { diff --git a/src/app/core/cache/object-cache.reducer.spec.ts b/src/app/core/cache/object-cache.reducer.spec.ts index 919edc8e57..402ab61b2d 100644 --- a/src/app/core/cache/object-cache.reducer.spec.ts +++ b/src/app/core/cache/object-cache.reducer.spec.ts @@ -54,7 +54,7 @@ describe('objectCacheReducer', () => { type: Item.type, self: selfLink2, foo: 'baz', - _links: { self: { href: selfLink2 } } + _links: { self: { href: selfLink2 } }, }, alternativeLinks: [altLink3, altLink4], timeCompleted: new Date().getTime(), @@ -62,8 +62,8 @@ describe('objectCacheReducer', () => { requestUUIDs: [requestUUID2], dependentRequestUUIDs: [requestUUID1], patches: [], - isDirty: false - } + isDirty: false, + }, }; deepFreeze(testState); @@ -170,7 +170,7 @@ describe('objectCacheReducer', () => { const action = new AddPatchObjectCacheAction(selfLink1, [{ op: 'replace', path: '/name', - value: 'random string' + value: 'random string', }]); // testState has already been frozen above objectCacheReducer(testState, action); diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index dc3f50db68..8f4122eaaa 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -177,8 +177,8 @@ function addToObjectCache(state: ObjectCacheState, action: AddToObjectCacheActio dependentRequestUUIDs: existing.dependentRequestUUIDs || [], isDirty: isNotEmpty(existing.patches), patches: existing.patches || [], - alternativeLinks: [...(existing.alternativeLinks || []), ...newAltLinks] - } as ObjectCacheEntry + alternativeLinks: [...(existing.alternativeLinks || []), ...newAltLinks], + } as ObjectCacheEntry, }); } @@ -217,7 +217,7 @@ function resetObjectCacheTimestamps(state: ObjectCacheState, action: ResetObject const newState = Object.create(null); Object.keys(state).forEach((key) => { newState[key] = Object.assign({}, state[key], { - timeCompleted: action.payload + timeCompleted: action.payload, }); }); return newState; @@ -241,7 +241,7 @@ function addPatchObjectCache(state: ObjectCacheState, action: AddPatchObjectCach const patches = newState[uuid].patches; newState[uuid] = Object.assign({}, newState[uuid], { patches: [...patches, { operations } as Patch], - isDirty: true + isDirty: true, }); } return newState; @@ -286,8 +286,8 @@ function addDependentsObjectCacheState(state: ObjectCacheState, action: AddDepen ...new Set([ ...newState[href]?.dependentRequestUUIDs || [], ...action.payload.dependentRequestUUIDs, - ]) - ] + ]), + ], }); } @@ -308,7 +308,7 @@ function removeDependentsObjectCacheState(state: ObjectCacheState, action: Remov if (hasValue(newState[href])) { newState[href] = Object.assign({}, newState[href], { - dependentRequestUUIDs: [] + dependentRequestUUIDs: [], }); } diff --git a/src/app/core/cache/object-cache.service.spec.ts b/src/app/core/cache/object-cache.service.spec.ts index 6af797be29..f183f5da22 100644 --- a/src/app/core/cache/object-cache.service.spec.ts +++ b/src/app/core/cache/object-cache.service.spec.ts @@ -69,8 +69,8 @@ describe('ObjectCacheService', () => { type: Item.type, _links: { self: { href: selfLink }, - anotherLink: { href: anotherLink } - } + anotherLink: { href: anotherLink }, + }, }; cacheEntry = { data: objectToCache, @@ -96,8 +96,8 @@ describe('ObjectCacheService', () => { 'cache/syncbuffer': {}, 'cache/object-updates': {}, 'data/request': {}, - 'index': {} - } + 'index': {}, + }, }; } @@ -105,12 +105,12 @@ describe('ObjectCacheService', () => { TestBed.configureTestingModule({ imports: [ - StoreModule.forRoot(coreReducers, storeModuleConfig) + StoreModule.forRoot(coreReducers, storeModuleConfig), ], providers: [ provideMockStore({ initialState }), - { provide: ObjectCacheService, useValue: service } - ] + { provide: ObjectCacheService, useValue: service }, + ], }).compileComponents(); })); @@ -120,7 +120,7 @@ describe('ObjectCacheService', () => { mockStore = store as MockStore; mockStore.setState(initialState); linkServiceStub = { - removeResolvedLinks: (a) => a + removeResolvedLinks: (a) => a, }; spyOn(linkServiceStub, 'removeResolvedLinks').and.callThrough(); spyOn(store, 'dispatch'); @@ -209,7 +209,7 @@ describe('ObjectCacheService', () => { describe('getList', () => { it('should return an observable of the array of cached objects with the specified self link and type', () => { const item = Object.assign(new Item(), { - _links: { self: { href: selfLink } } + _links: { self: { href: selfLink } }, }); spyOn(service, 'getObjectByHref').and.returnValue(observableOf(item)); @@ -251,7 +251,7 @@ describe('ObjectCacheService', () => { 'something', 'something-else', 'specific-request', - ] + ], }))); }); @@ -266,7 +266,7 @@ describe('ObjectCacheService', () => { requestUUIDs: [ 'something', 'something-else', - ] + ], }))); }); @@ -292,9 +292,9 @@ describe('ObjectCacheService', () => { const state = Object.assign({}, initialState, { core: Object.assign({}, initialState.core, { 'cache/object': { - [selfLink]: cacheEntry - } - }) + [selfLink]: cacheEntry, + }, + }), }); mockStore.setState(state); const expected: TestColdObservable = cold('a', { a: cacheEntry }); @@ -310,14 +310,14 @@ describe('ObjectCacheService', () => { const state = Object.assign({}, initialState, { core: Object.assign({}, initialState.core, { 'cache/object': { - [selfLink]: cacheEntry + [selfLink]: cacheEntry, }, 'index': { 'object/alt-link-to-self-link': { - [anotherLink]: selfLink - } - } - }) + [anotherLink]: selfLink, + }, + }, + }), }); mockStore.setState(state); (service as any).getByAlternativeLink(anotherLink).subscribe(); @@ -335,8 +335,8 @@ describe('ObjectCacheService', () => { it('isDirty should return true when the patches list in the cache entry is not empty', () => { cacheEntry.patches = [ { - operations: operations - } as Patch + operations: operations, + } as Patch, ]; const result = (service as any).isDirty(cacheEntry); expect(result).toBe(true); @@ -371,9 +371,9 @@ describe('ObjectCacheService', () => { [anotherLink]: selfLink, ['objectWithoutDependentsAlt']: 'objectWithoutDependents', ['objectWithDependentsAlt']: 'objectWithDependents', - } - } - }) + }, + }, + }), }); mockStore.setState(state); }); @@ -421,11 +421,11 @@ describe('ObjectCacheService', () => { testScheduler.run(({ cold: tsCold, flush }) => { const href$ = tsCold('--y-n-n', { y: selfLink, - n: 'NOPE' + n: 'NOPE', }); const dependsOnHref$ = tsCold('-y-n-n', { y: 'objectWithoutDependents', - n: 'NOPE' + n: 'NOPE', }); service.addDependency(href$, dependsOnHref$); diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index 5b2bfc7957..be1f83fac6 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -26,7 +26,7 @@ import { IndexName } from '../index/index-name.model'; */ const objectCacheSelector = createSelector( coreSelector, - (state: CoreState) => state['cache/object'] + (state: CoreState) => state['cache/object'], ); /** @@ -46,7 +46,7 @@ const entryFromSelfLinkSelector = export class ObjectCacheService { constructor( private store: Store, - private linkService: LinkService + private linkService: LinkService, ) { } @@ -87,7 +87,7 @@ export class ObjectCacheService { .filter(([key, value]: [string, HALLink]) => key !== 'self') .map(([key, value]: [string, HALLink]) => value.href); }), - take(1) + take(1), ); this.removeLinksFromAlternativeLinkIndex(altLinks$); this.removeLinksFromAlternativeLinkIndex(childLinks$); @@ -97,7 +97,7 @@ export class ObjectCacheService { private removeLinksFromAlternativeLinkIndex(links$: Observable) { links$.subscribe((links: string[]) => links.forEach((link: string) => { this.store.dispatch(new RemoveFromIndexBySubstringAction(IndexName.ALTERNATIVE_OBJECT_LINK, link)); - } + }, )); } @@ -113,8 +113,8 @@ export class ObjectCacheService { Observable { return this.store.pipe( select(selfLinkFromUuidSelector(uuid)), - mergeMap((selfLink: string) => this.getObjectByHref(selfLink) - ) + mergeMap((selfLink: string) => this.getObjectByHref(selfLink), + ), ); } @@ -136,7 +136,7 @@ export class ObjectCacheService { } else { return entry; } - } + }, ), map((entry: ObjectCacheEntry) => { const type: GenericConstructor = getClassForType((entry.data as any).type); @@ -144,7 +144,7 @@ export class ObjectCacheService { throw new Error(`${type} is not a valid constructor for ${JSON.stringify(entry.data)}`); } return Object.assign(new type(), entry.data) as T; - }) + }), ); } @@ -162,13 +162,13 @@ export class ObjectCacheService { this.getBySelfLink(href), ]).pipe( map((results: ObjectCacheEntry[]) => results.find((entry: ObjectCacheEntry) => hasValue(entry))), - filter((entry: ObjectCacheEntry) => hasValue(entry)) + filter((entry: ObjectCacheEntry) => hasValue(entry)), ); } private getBySelfLink(selfLink: string): Observable { return this.store.pipe( - select(entryFromSelfLinkSelector(selfLink)) + select(entryFromSelfLinkSelector(selfLink)), ); } @@ -204,7 +204,7 @@ export class ObjectCacheService { getRequestUUIDByObjectUUID(uuid: string): Observable { return this.store.pipe( select(selfLinkFromUuidSelector(uuid)), - mergeMap((selfLink: string) => this.getRequestUUIDBySelfLink(selfLink)) + mergeMap((selfLink: string) => this.getRequestUUIDBySelfLink(selfLink)), ); } @@ -232,7 +232,7 @@ export class ObjectCacheService { return observableOf([]); } else { return observableCombineLatest( - selfLinks.map((selfLink: string) => this.getObjectByHref(selfLink)) + selfLinks.map((selfLink: string) => this.getObjectByHref(selfLink)), ); } } @@ -252,7 +252,7 @@ export class ObjectCacheService { /* NB: that this is only a solution because the select method is synchronous, see: https://github.com/ngrx/store/issues/296#issuecomment-269032571*/ this.store.pipe( select(selfLinkFromUuidSelector(uuid)), - take(1) + take(1), ).subscribe((selfLink: string) => result = this.hasByHref(selfLink)); return result; @@ -290,9 +290,9 @@ export class ObjectCacheService { hasByHref$(href: string): Observable { return observableCombineLatest( this.getBySelfLink(href), - this.getByAlternativeLink(href) + this.getByAlternativeLink(href), ).pipe( - map((entries: ObjectCacheEntry[]) => entries.some((entry) => hasValue(entry))) + map((entries: ObjectCacheEntry[]) => entries.some((entry) => hasValue(entry))), ); } @@ -358,7 +358,7 @@ export class ObjectCacheService { observableCombineLatest([ href$, dependsOnHref$.pipe( - switchMap(dependsOnHref => this.resolveSelfLink(dependsOnHref)) + switchMap(dependsOnHref => this.resolveSelfLink(dependsOnHref)), ), ]).pipe( switchMap(([href, dependsOnSelfLink]: [string, string]) => { @@ -373,7 +373,7 @@ export class ObjectCacheService { this.getByHref(href).pipe( // only add the latest request to keep dependency index from growing indefinitely map((entry: ObjectCacheEntry) => entry?.requestUUIDs?.[0]), - ) + ), ]); }), take(1), diff --git a/src/app/core/cache/response.models.ts b/src/app/core/cache/response.models.ts index 197bf130fb..9dedb26acf 100644 --- a/src/app/core/cache/response.models.ts +++ b/src/app/core/cache/response.models.ts @@ -13,7 +13,7 @@ export class RestResponse { constructor( public isSuccessful: boolean, public statusCode: number, - public statusText: string + public statusText: string, ) { } } @@ -29,7 +29,7 @@ export class DSOSuccessResponse extends RestResponse { public resourceSelfLinks: string[], public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } @@ -43,7 +43,7 @@ export class EndpointMapSuccessResponse extends RestResponse { constructor( public endpointMap: EndpointMap, public statusCode: number, - public statusText: string + public statusText: string, ) { super(true, statusCode, statusText); } @@ -64,7 +64,7 @@ export class ConfigSuccessResponse extends RestResponse { public configDefinition: ConfigObject, public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } @@ -78,7 +78,7 @@ export class TokenResponse extends RestResponse { public token: string, public isSuccessful: boolean, public statusCode: number, - public statusText: string + public statusText: string, ) { super(isSuccessful, statusCode, statusText); } @@ -89,7 +89,7 @@ export class PostPatchSuccessResponse extends RestResponse { public dataDefinition: any, public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } @@ -100,7 +100,7 @@ export class EpersonSuccessResponse extends RestResponse { public epersonDefinition: DSpaceObject[], public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } @@ -112,7 +112,7 @@ export class MessageResponse extends RestResponse { constructor( public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } @@ -124,7 +124,7 @@ export class TaskResponse extends RestResponse { constructor( public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } @@ -135,7 +135,7 @@ export class FilteredDiscoveryQueryResponse extends RestResponse { public filterQuery: string, public statusCode: number, public statusText: string, - public pageInfo?: PageInfo + public pageInfo?: PageInfo, ) { super(true, statusCode, statusText); } diff --git a/src/app/core/cache/server-sync-buffer.effects.spec.ts b/src/app/core/cache/server-sync-buffer.effects.spec.ts index 833c6b580f..68fd4086d2 100644 --- a/src/app/core/cache/server-sync-buffer.effects.spec.ts +++ b/src/app/core/cache/server-sync-buffer.effects.spec.ts @@ -16,7 +16,7 @@ import { ObjectCacheService } from './object-cache.service'; import { CommitSSBAction, EmptySSBAction, - ServerSyncBufferActionTypes + ServerSyncBufferActionTypes, } from './server-sync-buffer.actions'; import { ServerSyncBufferEffects } from './server-sync-buffer.effects'; import { storeModuleConfig } from '../../app.reducer'; @@ -32,9 +32,9 @@ describe('ServerSyncBufferEffects', () => { autoSync: { timePerMethod: {}, - defaultTime: 0 - } - } + defaultTime: 0, + }, + }, }; const selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7'; let store; @@ -52,21 +52,21 @@ describe('ServerSyncBufferEffects', () => { provide: ObjectCacheService, useValue: { getObjectBySelfLink: (link) => { const object = Object.assign(new DSpaceObject(), { - _links: { self: { href: link } } + _links: { self: { href: link } }, }); return observableOf(object); }, getByHref: (link) => { const object = Object.assign(new DSpaceObject(), { _links: { - self: { href: link } - } + self: { href: link }, + }, }); return observableOf(object); - } - } + }, + }, }, - { provide: Store, useClass: StoreMock } + { provide: Store, useClass: StoreMock }, // other providers ], }); @@ -88,12 +88,12 @@ describe('ServerSyncBufferEffects', () => { actions = hot('a', { a: { type: ServerSyncBufferActionTypes.ADD, - payload: { href: selfLink, method: RestRequestMethod.PUT } - } + payload: { href: selfLink, method: RestRequestMethod.PUT }, + }, }); expectObservable(ssbEffects.setTimeoutForServerSync).toBe('b', { - b: new CommitSSBAction(RestRequestMethod.PUT) + b: new CommitSSBAction(RestRequestMethod.PUT), }); }); }); @@ -108,8 +108,8 @@ describe('ServerSyncBufferEffects', () => { (state as any).core['cache/syncbuffer'] = { buffer: [{ href: selfLink, - method: RestRequestMethod.PATCH - }] + method: RestRequestMethod.PATCH, + }], }; }); }); @@ -117,13 +117,13 @@ describe('ServerSyncBufferEffects', () => { actions = hot('a', { a: { type: ServerSyncBufferActionTypes.COMMIT, - payload: RestRequestMethod.PATCH - } + payload: RestRequestMethod.PATCH, + }, }); const expected = cold('(bc)', { b: new ApplyPatchObjectCacheAction(selfLink), - c: new EmptySSBAction(RestRequestMethod.PATCH) + c: new EmptySSBAction(RestRequestMethod.PATCH), }); expect(ssbEffects.commitServerSyncBuffer).toBeObservable(expected); @@ -136,7 +136,7 @@ describe('ServerSyncBufferEffects', () => { .subscribe((state) => { (state as any).core = Object({}); (state as any).core['cache/syncbuffer'] = { - buffer: [] + buffer: [], }; }); }); @@ -145,8 +145,8 @@ describe('ServerSyncBufferEffects', () => { actions = hot('a', { a: { type: ServerSyncBufferActionTypes.COMMIT, - payload: { method: RestRequestMethod.PATCH } - } + payload: { method: RestRequestMethod.PATCH }, + }, }); const expected = cold('b', { b: new NoOpAction() }); diff --git a/src/app/core/cache/server-sync-buffer.effects.ts b/src/app/core/cache/server-sync-buffer.effects.ts index b3fe7ac34f..91c4ce7efc 100644 --- a/src/app/core/cache/server-sync-buffer.effects.ts +++ b/src/app/core/cache/server-sync-buffer.effects.ts @@ -6,7 +6,7 @@ import { AddToSSBAction, CommitSSBAction, EmptySSBAction, - ServerSyncBufferActionTypes + ServerSyncBufferActionTypes, } from './server-sync-buffer.actions'; import { Action, createSelector, MemoizedSelector, select, Store } from '@ngrx/store'; import { ServerSyncBufferEntry, ServerSyncBufferState } from './server-sync-buffer.reducer'; @@ -41,7 +41,7 @@ export class ServerSyncBufferEffects { return observableOf(new CommitSSBAction(action.payload.method)).pipe( delay(timeoutInSeconds * 1000), ); - }) + }), )); /** @@ -78,14 +78,14 @@ export class ServerSyncBufferEffects { /* Add extra action to array, to make sure the ServerSyncBuffer is emptied afterwards */ if (isNotEmpty(actions) && isNotUndefined(actions[0])) { return observableCombineLatest(...actions).pipe( - switchMap((array) => [...array, new EmptySSBAction(action.payload)]) + switchMap((array) => [...array, new EmptySSBAction(action.payload)]), ); } else { return observableOf(new NoOpAction()); } - }) + }), ); - }) + }), )); /** @@ -96,7 +96,7 @@ export class ServerSyncBufferEffects { */ private applyPatch(href: string): Observable { const patchObject = this.objectCache.getByHref(href).pipe( - take(1) + take(1), ); return patchObject.pipe( @@ -108,7 +108,7 @@ export class ServerSyncBufferEffects { } } return new ApplyPatchObjectCacheAction(href); - }) + }), ); } diff --git a/src/app/core/cache/server-sync-buffer.reducer.spec.ts b/src/app/core/cache/server-sync-buffer.reducer.spec.ts index 51ba010c1e..edfd8e2502 100644 --- a/src/app/core/cache/server-sync-buffer.reducer.spec.ts +++ b/src/app/core/cache/server-sync-buffer.reducer.spec.ts @@ -27,8 +27,8 @@ describe('serverSyncBufferReducer', () => { { href: selfLink2, method: RestRequestMethod.GET, - } - ] + }, + ], }; const newSelfLink = 'https://localhost:8080/api/core/items/1ce6b5ae-97e1-4e5a-b4b0-f9029bad10c0'; @@ -79,7 +79,7 @@ describe('serverSyncBufferReducer', () => { // testState has already been frozen above const newState = serverSyncBufferReducer(testState, action); expect(newState.buffer).toContain({ - href: newSelfLink, method: RestRequestMethod.PUT + href: newSelfLink, method: RestRequestMethod.PUT, }) ; }); diff --git a/src/app/core/cache/server-sync-buffer.reducer.ts b/src/app/core/cache/server-sync-buffer.reducer.ts index cb26bf29ed..866a3004f8 100644 --- a/src/app/core/cache/server-sync-buffer.reducer.ts +++ b/src/app/core/cache/server-sync-buffer.reducer.ts @@ -3,7 +3,7 @@ import { AddToSSBAction, EmptySSBAction, ServerSyncBufferAction, - ServerSyncBufferActionTypes + ServerSyncBufferActionTypes, } from './server-sync-buffer.actions'; import { RestRequestMethod } from '../data/rest-request-method'; diff --git a/src/app/core/core-state.model.ts b/src/app/core/core-state.model.ts index 1d7aca67a4..86f3b43c7e 100644 --- a/src/app/core/core-state.model.ts +++ b/src/app/core/core-state.model.ts @@ -1,5 +1,5 @@ import { - BitstreamFormatRegistryState + BitstreamFormatRegistryState, } from '../admin/admin-registries/bitstream-formats/bitstream-format.reducers'; import { ObjectCacheState } from './cache/object-cache.reducer'; import { ServerSyncBufferState } from './cache/server-sync-buffer.reducer'; diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index dbca773375..734bec56b3 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -14,7 +14,7 @@ import { EndpointMockingRestService } from '../shared/mocks/dspace-rest/endpoint import { MOCK_RESPONSE_MAP, mockResponseMap, - ResponseMapMock + ResponseMapMock, } from '../shared/mocks/dspace-rest/mocks/response-map.mock'; import { NotificationsService } from '../shared/notifications/notifications.service'; import { SelectableListService } from '../shared/object-list/selectable-list/selectable-list.service'; @@ -127,7 +127,7 @@ import { Authorization } from './shared/authorization.model'; import { FeatureDataService } from './data/feature-authorization/feature-data.service'; import { AuthorizationDataService } from './data/feature-authorization/authorization-data.service'; import { - SiteAdministratorGuard + SiteAdministratorGuard, } from './data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { Registration } from './shared/registration.model'; import { MetadataSchemaDataService } from './data/metadata-schema-data.service'; @@ -198,7 +198,7 @@ export const restServiceFactory = (mocks: ResponseMapMock, http: HttpClient) => const IMPORTS = [ CommonModule, StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig), - EffectsModule.forFeature(coreEffects) + EffectsModule.forFeature(coreEffects), ]; const DECLARATIONS = []; @@ -304,7 +304,7 @@ const PROVIDERS = [ OrcidAuthService, OrcidQueueDataService, OrcidHistoryDataService, - SupervisionOrderDataService + SupervisionOrderDataService, ]; /** @@ -380,22 +380,22 @@ export const models = IdentifierData, Subscription, ItemRequest, - BulkAccessConditionOptions + BulkAccessConditionOptions, ]; @NgModule({ imports: [ - ...IMPORTS + ...IMPORTS, ], declarations: [ - ...DECLARATIONS + ...DECLARATIONS, ], exports: [ - ...EXPORTS + ...EXPORTS, ], providers: [ - ...PROVIDERS - ] + ...PROVIDERS, + ], }) export class CoreModule { @@ -403,8 +403,8 @@ export class CoreModule { return { ngModule: CoreModule, providers: [ - ...PROVIDERS - ] + ...PROVIDERS, + ], }; } diff --git a/src/app/core/core.reducers.ts b/src/app/core/core.reducers.ts index c0165c5384..83d32ea8ed 100644 --- a/src/app/core/core.reducers.ts +++ b/src/app/core/core.reducers.ts @@ -1,4 +1,4 @@ -import { ActionReducerMap, } from '@ngrx/store'; +import { ActionReducerMap } from '@ngrx/store'; import { objectCacheReducer } from './cache/object-cache.reducer'; import { indexReducer } from './index/index.reducer'; @@ -9,7 +9,7 @@ import { serverSyncBufferReducer } from './cache/server-sync-buffer.reducer'; import { objectUpdatesReducer } from './data/object-updates/object-updates.reducer'; import { routeReducer } from './services/route.reducer'; import { - bitstreamFormatReducer + bitstreamFormatReducer, } from '../admin/admin-registries/bitstream-formats/bitstream-format.reducers'; import { historyReducer } from './history/history.reducer'; import { metaTagReducer } from './metadata/meta-tag.reducer'; @@ -26,5 +26,5 @@ export const coreReducers: ActionReducerMap = { 'auth': authReducer, 'json/patch': jsonPatchOperationsReducer, 'metaTag': metaTagReducer, - 'route': routeReducer + 'route': routeReducer, }; diff --git a/src/app/core/data/access-status-data.service.spec.ts b/src/app/core/data/access-status-data.service.spec.ts index 18b8cb5d65..eb92e112c7 100644 --- a/src/app/core/data/access-status-data.service.spec.ts +++ b/src/app/core/data/access-status-data.service.spec.ts @@ -29,12 +29,12 @@ describe('AccessStatusDataService', () => { name: 'test-item', _links: { accessStatus: { - href: `https://rest.api/items/${itemId}/accessStatus` + href: `https://rest.api/items/${itemId}/accessStatus`, }, self: { - href: `https://rest.api/items/${itemId}` - } - } + href: `https://rest.api/items/${itemId}`, + }, + }, }); describe('when the requests are successful', () => { @@ -69,10 +69,10 @@ describe('AccessStatusDataService', () => { } rdbService = jasmine.createSpyObj('rdbService', { buildFromRequestUUID: buildResponse$, - buildSingle: buildResponse$ + buildSingle: buildResponse$, }); objectCache = jasmine.createSpyObj('objectCache', { - remove: jasmine.createSpy('remove') + remove: jasmine.createSpy('remove'), }); halService = new HALEndpointServiceStub(url); notificationsService = new NotificationsServiceStub(); diff --git a/src/app/core/data/array-move-change-analyzer.service.spec.ts b/src/app/core/data/array-move-change-analyzer.service.spec.ts index 025791d6dc..d8f3c51256 100644 --- a/src/app/core/data/array-move-change-analyzer.service.spec.ts +++ b/src/app/core/data/array-move-change-analyzer.service.spec.ts @@ -28,7 +28,7 @@ describe('ArrayMoveChangeAnalyzer', () => { '4d7d0798-a8fa-45b8-b4fc-deb2819606c8', 'e56eb99e-2f7c-4bee-9b3f-d3dcc83386b1', '0f608168-cdfc-46b0-92ce-889f7d3ac684', - '546f9f5c-15dc-4eec-86fe-648007ac9e1c' + '546f9f5c-15dc-4eec-86fe-648007ac9e1c', ]; }); @@ -72,7 +72,7 @@ describe('ArrayMoveChangeAnalyzer', () => { '4d7d0798-a8fa-45b8-b4fc-deb2819606c8', undefined, undefined, - '546f9f5c-15dc-4eec-86fe-648007ac9e1c' + '546f9f5c-15dc-4eec-86fe-648007ac9e1c', ]; }); diff --git a/src/app/core/data/base-response-parsing.service.spec.ts b/src/app/core/data/base-response-parsing.service.spec.ts index da9fa7a643..e99e2c76d4 100644 --- a/src/app/core/data/base-response-parsing.service.spec.ts +++ b/src/app/core/data/base-response-parsing.service.spec.ts @@ -35,7 +35,7 @@ describe('BaseResponseParsingService', () => { beforeEach(() => { obj = undefined; objectCache = jasmine.createSpyObj('objectCache', { - add: {} + add: {}, }); service = new TestService(objectCache); }); @@ -58,8 +58,8 @@ describe('BaseResponseParsingService', () => { beforeEach(() => { obj = Object.assign(new DSpaceObject(), { _links: { - self: { href: 'obj-selflink' } - } + self: { href: 'obj-selflink' }, + }, }); }); @@ -79,8 +79,8 @@ describe('BaseResponseParsingService', () => { data = { type: 'NotARealType', _links: { - self: { href: 'data-selflink' } - } + self: { href: 'data-selflink' }, + }, }; }); diff --git a/src/app/core/data/base-response-parsing.service.ts b/src/app/core/data/base-response-parsing.service.ts index 10bbe33197..0380dd7614 100644 --- a/src/app/core/data/base-response-parsing.service.ts +++ b/src/app/core/data/base-response-parsing.service.ts @@ -96,14 +96,14 @@ export abstract class BaseResponseParsingService { list = this.flattenSingleKeyObject(list); } const page: ObjectDomain[] = this.processArray(list, request); - return buildPaginatedList(pageInfo, page,); + return buildPaginatedList(pageInfo, page); } protected processArray(data: any, request: RestRequest): ObjectDomain[] { let array: ObjectDomain[] = []; data.forEach((datum) => { array = [...array, this.process(datum, request)]; - } + }, ); return array; } @@ -139,7 +139,7 @@ export abstract class BaseResponseParsingService { let dataJSON: string; if (hasValue(data._embedded)) { dataJSON = JSON.stringify(Object.assign({}, data, { - _embedded: '...' + _embedded: '...', })); } else { dataJSON = JSON.stringify(data); diff --git a/src/app/core/data/base/base-data.service.spec.ts b/src/app/core/data/base/base-data.service.spec.ts index 098f075c10..267da4eba8 100644 --- a/src/app/core/data/base/base-data.service.spec.ts +++ b/src/app/core/data/base/base-data.service.spec.ts @@ -77,7 +77,7 @@ describe('BaseDataService', () => { selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7'; linksToFollow = [ followLink('a'), - followLink('b') + followLink('b'), ]; testScheduler = new TestScheduler((actual, expected) => { @@ -566,7 +566,7 @@ describe('BaseDataService', () => { beforeEach(() => { getByHrefSpy = spyOn(objectCache, 'getByHref').and.returnValue(observableOf({ requestUUIDs: ['request1', 'request2', 'request3'], - dependentRequestUUIDs: ['request4', 'request5'] + dependentRequestUUIDs: ['request4', 'request5'], })); }); @@ -714,7 +714,7 @@ describe('BaseDataService', () => { (service as any).addDependency( createSuccessfulRemoteDataObject$({ _links: { self: { href: 'object-href' } } }), - observableOf('dependsOnHref') + observableOf('dependsOnHref'), ); expect(addDependencySpy).toHaveBeenCalled(); }); @@ -729,7 +729,7 @@ describe('BaseDataService', () => { (service as any).addDependency( createFailedRemoteDataObject$('something went wrong'), - observableOf('dependsOnHref') + observableOf('dependsOnHref'), ); expect(addDependencySpy).toHaveBeenCalled(); }); diff --git a/src/app/core/data/base/base-data.service.ts b/src/app/core/data/base/base-data.service.ts index 6337bf4951..452c8e2346 100644 --- a/src/app/core/data/base/base-data.service.ts +++ b/src/app/core/data/base/base-data.service.ts @@ -235,7 +235,7 @@ export class BaseDataService implements HALDataServic if (hasValue(remoteData) && remoteData.isStale) { requestFn(); } - }) + }), ); } else { return source; @@ -329,7 +329,7 @@ export class BaseDataService implements HALDataServic href$.pipe( isNotEmptyOperator(), - take(1) + take(1), ).subscribe((href: string) => { const requestId = this.requestService.generateRequestId(); const request = new GetRequest(requestId, href); @@ -375,11 +375,11 @@ export class BaseDataService implements HALDataServic if (hasCachedResponse) { return this.rdbService.buildSingle(href$).pipe( getFirstCompletedRemoteData(), - map((rd => rd.hasFailed)) + map((rd => rd.hasFailed)), ); } return observableOf(false); - }) + }), ); } @@ -420,7 +420,7 @@ export class BaseDataService implements HALDataServic } }), ), - dependsOnHref$ + dependsOnHref$, ); } @@ -437,7 +437,7 @@ export class BaseDataService implements HALDataServic switchMap((oce: ObjectCacheEntry) => { return observableFrom([ ...oce.requestUUIDs, - ...oce.dependentRequestUUIDs + ...oce.dependentRequestUUIDs, ]).pipe( mergeMap((requestUUID: string) => this.requestService.setStaleByUUID(requestUUID)), toArray(), diff --git a/src/app/core/data/base/create-data.spec.ts b/src/app/core/data/base/create-data.spec.ts index 0b2e0f3930..d22bc0a796 100644 --- a/src/app/core/data/base/create-data.spec.ts +++ b/src/app/core/data/base/create-data.spec.ts @@ -149,7 +149,7 @@ describe('CreateDataImpl', () => { describe('create', () => { it('should POST the object to the root endpoint with the given parameters and return the remote data', (done) => { const params = [ - new RequestParam('abc', 123), new RequestParam('def', 456) + new RequestParam('abc', 123), new RequestParam('def', 456), ]; buildFromRequestUUIDSpy.and.returnValue(observableOf(remoteDataMocks.Success)); diff --git a/src/app/core/data/base/create-data.ts b/src/app/core/data/base/create-data.ts index 3ffcd9adf2..bd7b74a574 100644 --- a/src/app/core/data/base/create-data.ts +++ b/src/app/core/data/base/create-data.ts @@ -95,7 +95,7 @@ export class CreateDataImpl extends BaseDataService) => rd.isLoading, true) + takeWhile((rd: RemoteData) => rd.isLoading, true), ).subscribe((rd: RemoteData) => { if (rd.hasFailed) { this.notificationsService.error('Server Error:', rd.errorMessage, new NotificationOptions(-1)); diff --git a/src/app/core/data/base/delete-data.spec.ts b/src/app/core/data/base/delete-data.spec.ts index a076473b0f..07da7a1a76 100644 --- a/src/app/core/data/base/delete-data.spec.ts +++ b/src/app/core/data/base/delete-data.spec.ts @@ -34,7 +34,7 @@ export function testDeleteDataImplementation(serviceFactory: () => DeleteData { @@ -105,13 +105,13 @@ describe('DeleteDataImpl', () => { }, getByHref: () => { /* empty */ - } + }, } as any; notificationsService = {} as NotificationsService; selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7'; linksToFollow = [ followLink('a'), - followLink('b') + followLink('b'), ]; testScheduler = new TestScheduler((actual, expected) => { diff --git a/src/app/core/data/base/identifiable-data.service.spec.ts b/src/app/core/data/base/identifiable-data.service.spec.ts index 11af83ff9f..2f47d32a70 100644 --- a/src/app/core/data/base/identifiable-data.service.spec.ts +++ b/src/app/core/data/base/identifiable-data.service.spec.ts @@ -63,12 +63,12 @@ describe('IdentifiableDataService', () => { }, getByHref: () => { /* empty */ - } + }, } as any; selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7'; linksToFollow = [ followLink('a'), - followLink('b') + followLink('b'), ]; testScheduler = new TestScheduler((actual, expected) => { @@ -132,7 +132,7 @@ describe('IdentifiableDataService', () => { resourceIdMock, followLink('bundles', { shouldEmbed: false }), followLink('owningCollection', { shouldEmbed: false }), - followLink('templateItemOf') + followLink('templateItemOf'), ); expect(result).toEqual(expected); }); diff --git a/src/app/core/data/base/patch-data.spec.ts b/src/app/core/data/base/patch-data.spec.ts index a55b1229b8..3b94ec04f8 100644 --- a/src/app/core/data/base/patch-data.spec.ts +++ b/src/app/core/data/base/patch-data.spec.ts @@ -182,15 +182,15 @@ describe('PatchDataImpl', () => { _links: { self: { href: 'dso-href', - } - } + }, + }, }; const operations = [ Object.assign({ op: 'move', from: '/1', - path: '/5' - }) as Operation + path: '/5', + }) as Operation, ]; it('should send a PatchRequest', () => { @@ -224,12 +224,12 @@ describe('PatchDataImpl', () => { dso = Object.assign(new DSpaceObject(), { _links: { self: { href: selfLink } }, - metadata: [{ key: 'dc.title', value: name1 }] + metadata: [{ key: 'dc.title', value: name1 }], }); dso2 = Object.assign(new DSpaceObject(), { _links: { self: { href: selfLink } }, - metadata: [{ key: 'dc.title', value: name2 }] + metadata: [{ key: 'dc.title', value: name2 }], }); spyOn(service, 'findByHref').and.returnValue(createSuccessfulRemoteDataObject$(dso)); diff --git a/src/app/core/data/base/put-data.spec.ts b/src/app/core/data/base/put-data.spec.ts index 6287fe91b1..5bfc0cc16e 100644 --- a/src/app/core/data/base/put-data.spec.ts +++ b/src/app/core/data/base/put-data.spec.ts @@ -127,7 +127,7 @@ describe('PutDataImpl', () => { metadata: { // recognized properties will be serialized ['dc.title']: [ { language: 'en', value: 'some object' }, - ] + ], }, data: [ 1, 2, 3, 4 ], // unrecognized properties won't be serialized _links: { self: { href: selfLink } }, @@ -144,7 +144,7 @@ describe('PutDataImpl', () => { method: RestRequestMethod.PUT, body: { // _links are not serialized uuid: obj.uuid, - metadata: obj.metadata + metadata: obj.metadata, }, })); done(); diff --git a/src/app/core/data/bitstream-data.service.spec.ts b/src/app/core/data/bitstream-data.service.spec.ts index 89178f8dd2..4a78ad611c 100644 --- a/src/app/core/data/bitstream-data.service.spec.ts +++ b/src/app/core/data/bitstream-data.service.spec.ts @@ -35,32 +35,32 @@ describe('BitstreamDataService', () => { id: 'fake-bitstream1', uuid: 'fake-bitstream1', _links: { - self: { href: 'fake-bitstream1-self' } - } + self: { href: 'fake-bitstream1-self' }, + }, }); const bitstream2 = Object.assign(new Bitstream(), { id: 'fake-bitstream2', uuid: 'fake-bitstream2', _links: { - self: { href: 'fake-bitstream2-self' } - } + self: { href: 'fake-bitstream2-self' }, + }, }); const format = Object.assign(new BitstreamFormat(), { id: '2', shortDescription: 'PNG', description: 'Portable Network Graphics', - supportLevel: BitstreamFormatSupportLevel.Known + supportLevel: BitstreamFormatSupportLevel.Known, }); const url = 'fake-bitstream-url'; beforeEach(() => { objectCache = jasmine.createSpyObj('objectCache', { - remove: jasmine.createSpy('remove') + remove: jasmine.createSpy('remove'), }); requestService = getMockRequestService(); halService = Object.assign(new HALEndpointServiceStub(url)); bitstreamFormatService = jasmine.createSpyObj('bistreamFormatService', { - getBrowseEndpoint: observableOf(bitstreamFormatHref) + getBrowseEndpoint: observableOf(bitstreamFormatHref), }); rdbService = getMockRemoteDataBuildService(); diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index bb4ec28166..8a293666f3 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -107,7 +107,7 @@ export class BitstreamDataService extends IdentifiableDataService imp } else { return [bundleRD as any]; } - }) + }), ); } @@ -120,10 +120,10 @@ export class BitstreamDataService extends IdentifiableDataService imp const requestId = this.requestService.generateRequestId(); const bitstreamHref$ = this.getBrowseEndpoint().pipe( map((href: string) => `${href}/${bitstream.id}`), - switchMap((href: string) => this.halService.getEndpoint('format', href)) + switchMap((href: string) => this.halService.getEndpoint('format', href)), ); const formatHref$ = this.bitstreamFormatService.getBrowseEndpoint().pipe( - map((href: string) => `${href}/${format.id}`) + map((href: string) => `${href}/${format.id}`), ); observableCombineLatest([bitstreamHref$, formatHref$]).pipe( map(([bitstreamHref, formatHref]) => { @@ -134,7 +134,7 @@ export class BitstreamDataService extends IdentifiableDataService imp return new PutRequest(requestId, bitstreamHref, formatHref, options); }), sendRequest(this.requestService), - take(1) + take(1), ).subscribe(() => { this.requestService.removeByHrefSubstring(bitstream.self + '/format'); }); @@ -177,7 +177,7 @@ export class BitstreamDataService extends IdentifiableDataService imp const hrefObs = this.getSearchByHref( 'byItemHandle', { searchParams }, - ...linksToFollow + ...linksToFollow, ); return this.findByHref( diff --git a/src/app/core/data/bitstream-format-data.service.spec.ts b/src/app/core/data/bitstream-format-data.service.spec.ts index 15efebe8c7..5dc6a39122 100644 --- a/src/app/core/data/bitstream-format-data.service.spec.ts +++ b/src/app/core/data/bitstream-format-data.service.spec.ts @@ -31,19 +31,19 @@ describe('BitstreamFormatDataService', () => { const store = { dispatch(action: Action) { // Do Nothing - } + }, } as Store; const requestUUIDs = ['some', 'uuid']; const objectCache = jasmine.createSpyObj('objectCache', { - getByHref: observableOf({ requestUUIDs }) + getByHref: observableOf({ requestUUIDs }), }) as ObjectCacheService; const halEndpointService = { getEndpoint(linkPath: string): Observable { return cold('a', { a: bitstreamFormatsEndpoint }); - } + }, } as HALEndpointService; const notificationsService = {} as NotificationsService; @@ -83,7 +83,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); })); @@ -104,7 +104,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); })); @@ -127,7 +127,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); })); @@ -149,7 +149,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); })); @@ -174,7 +174,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); })); @@ -198,12 +198,12 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); const halService = { getEndpoint(linkPath: string): Observable { return observableOf(bitstreamFormatsEndpoint); - } + }, } as HALEndpointService; service = initTestService(halService); service.clearBitStreamFormatRequests().subscribe(); @@ -222,7 +222,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); spyOn(store, 'dispatch'); @@ -245,7 +245,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); spyOn(store, 'dispatch'); @@ -268,7 +268,7 @@ describe('BitstreamFormatDataService', () => { getByUUID: cold('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); service = initTestService(halEndpointService); spyOn(store, 'dispatch'); @@ -289,12 +289,12 @@ describe('BitstreamFormatDataService', () => { getByUUID: hot('a', { a: responseCacheEntry }), setStaleByUUID: observableOf(true), generateRequestId: 'request-id', - removeByHrefSubstring: {} + removeByHrefSubstring: {}, }); const halService = { getEndpoint(linkPath: string): Observable { return observableOf(bitstreamFormatsEndpoint); - } + }, } as HALEndpointService; service = initTestService(halService); })); diff --git a/src/app/core/data/bitstream-format-data.service.ts b/src/app/core/data/bitstream-format-data.service.ts index 0104389815..49c9335c7c 100644 --- a/src/app/core/data/bitstream-format-data.service.ts +++ b/src/app/core/data/bitstream-format-data.service.ts @@ -106,7 +106,7 @@ export class BitstreamFormatDataService extends IdentifiableDataService { return new PostRequest(requestId, endpointURL, bitstreamFormat); }), - sendRequest(this.requestService) + sendRequest(this.requestService), ).subscribe(); return this.rdbService.buildFromRequestUUID(requestId); @@ -117,7 +117,7 @@ export class BitstreamFormatDataService extends IdentifiableDataService { return this.getBrowseEndpoint().pipe( - tap((href: string) => this.requestService.removeByHrefSubstring(href)) + tap((href: string) => this.requestService.removeByHrefSubstring(href)), ); } diff --git a/src/app/core/data/browse-response-parsing.service.ts b/src/app/core/data/browse-response-parsing.service.ts index a568cdb617..d290e13a46 100644 --- a/src/app/core/data/browse-response-parsing.service.ts +++ b/src/app/core/data/browse-response-parsing.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { ObjectCacheService } from '../cache/object-cache.service'; import { hasValue } from '../../shared/empty.util'; import { - HIERARCHICAL_BROWSE_DEFINITION + HIERARCHICAL_BROWSE_DEFINITION, } from '../shared/hierarchical-browse-definition.resource-type'; import { FLAT_BROWSE_DEFINITION } from '../shared/flat-browse-definition.resource-type'; import { HierarchicalBrowseDefinition } from '../shared/hierarchical-browse-definition.model'; diff --git a/src/app/core/data/bundle-data.service.spec.ts b/src/app/core/data/bundle-data.service.spec.ts index e3ba438f9b..80fb1c8c0d 100644 --- a/src/app/core/data/bundle-data.service.spec.ts +++ b/src/app/core/data/bundle-data.service.spec.ts @@ -41,7 +41,7 @@ describe('BundleDataService', () => { bundleHALLink.href = bundleLink; item = new Item(); item._links = { - bundles: bundleHALLink + bundles: bundleHALLink, }; requestService = getMockRequestService(); halService = new HALEndpointServiceStub('url') as any; @@ -56,7 +56,7 @@ describe('BundleDataService', () => { }, getObjectBySelfLink: () => { /* empty */ - } + }, } as any; store = {} as Store; return new BundleDataService( @@ -99,30 +99,30 @@ describe('BundleDataService', () => { metadata: { 'dc.title': [ { - value: 'ORIGINAL' - } - ] - } + value: 'ORIGINAL', + }, + ], + }, }), Object.assign(new Bundle(), { id: 'THUMBNAIL_BUNDLE', metadata: { 'dc.title': [ { - value: 'THUMBNAIL' - } - ] - } + value: 'THUMBNAIL', + }, + ], + }, }), Object.assign(new Bundle(), { id: 'EXTRA_BUNDLE', metadata: { 'dc.title': [ { - value: 'EXTRA' - } - ] - } + value: 'EXTRA', + }, + ], + }, }), ]; spyOn(service, 'findAllByItem').and.returnValue(createSuccessfulRemoteDataObject$(createPaginatedList(bundles))); diff --git a/src/app/core/data/bundle-data.service.ts b/src/app/core/data/bundle-data.service.ts index 19f0e73706..7f0a372165 100644 --- a/src/app/core/data/bundle-data.service.ts +++ b/src/app/core/data/bundle-data.service.ts @@ -91,7 +91,7 @@ export class BundleDataService extends IdentifiableDataService implement RequestEntryState.Success, null, matchingBundle, - 200 + 200, ); } else { return new RemoteData( @@ -101,7 +101,7 @@ export class BundleDataService extends IdentifiableDataService implement RequestEntryState.Error, `The bundle with name ${bundleName} was not found.`, null, - 404 + 404, ); } } else { @@ -119,7 +119,7 @@ export class BundleDataService extends IdentifiableDataService implement getBitstreamsEndpoint(bundleId: string, searchOptions?: PaginatedSearchOptions): Observable { return this.getBrowseEndpoint().pipe( switchMap((href: string) => this.halService.getEndpoint(this.bitstreamsEndpoint, `${href}/${bundleId}`)), - map((href) => searchOptions ? searchOptions.toRestUrl(href) : href) + map((href) => searchOptions ? searchOptions.toRestUrl(href) : href), ); } diff --git a/src/app/core/data/collection-data.service.spec.ts b/src/app/core/data/collection-data.service.spec.ts index 65f8b3ab2c..f400970c63 100644 --- a/src/app/core/data/collection-data.service.spec.ts +++ b/src/app/core/data/collection-data.service.spec.ts @@ -43,9 +43,9 @@ describe('CollectionDataService', () => { name: 'test-collection-1', _links: { self: { - href: 'https://rest.api/collections/test-collection-1-1' - } - } + href: 'https://rest.api/collections/test-collection-1-1', + }, + }, }); const mockCollection2: Collection = Object.assign(new Collection(), { @@ -53,9 +53,9 @@ describe('CollectionDataService', () => { name: 'test-collection-2', _links: { self: { - href: 'https://rest.api/collections/test-collection-2-2' - } - } + href: 'https://rest.api/collections/test-collection-2-2', + }, + }, }); const mockCollection3: Collection = Object.assign(new Collection(), { @@ -63,9 +63,9 @@ describe('CollectionDataService', () => { name: 'test-collection-3', _links: { self: { - href: 'https://rest.api/collections/test-collection-3-3' - } - } + href: 'https://rest.api/collections/test-collection-3-3', + }, + }, }); const queryString = 'test-string'; @@ -138,7 +138,7 @@ describe('CollectionDataService', () => { it('should return a RemoteData> for the getAuthorizedCollection', () => { const result = service.getAuthorizedCollection(queryString); const expected = cold('a|', { - a: paginatedListRD + a: paginatedListRD, }); expect(result).toBeObservable(expected); }); @@ -153,7 +153,7 @@ describe('CollectionDataService', () => { it('should return a RemoteData> for the getAuthorizedCollectionByCommunity', () => { const result = service.getAuthorizedCollectionByCommunity(communityId, queryString); const expected = cold('a|', { - a: paginatedListRD + a: paginatedListRD, }); expect(result).toBeObservable(expected); }); @@ -200,13 +200,13 @@ describe('CollectionDataService', () => { } rdbService = jasmine.createSpyObj('rdbService', { buildList: hot('a|', { - a: paginatedListRD + a: paginatedListRD, }), buildFromRequestUUID: buildResponse$, - buildSingle: buildResponse$ + buildSingle: buildResponse$, }); objectCache = jasmine.createSpyObj('objectCache', { - remove: jasmine.createSpy('remove') + remove: jasmine.createSpy('remove'), }); halService = new HALEndpointServiceStub(url); notificationsService = new NotificationsServiceStub(); diff --git a/src/app/core/data/collection-data.service.ts b/src/app/core/data/collection-data.service.ts index 405b35c1f9..8f5f1af673 100644 --- a/src/app/core/data/collection-data.service.ts +++ b/src/app/core/data/collection-data.service.ts @@ -26,7 +26,7 @@ import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; import { ContentSourceRequest, - UpdateContentSourceRequest + UpdateContentSourceRequest, } from './request.models'; import { RequestService } from './request.service'; import { BitstreamDataService } from './bitstream-data.service'; @@ -73,7 +73,7 @@ export class CollectionDataService extends ComColDataService { getAuthorizedCollection(query: string, options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { const searchHref = 'findSubmitAuthorized'; options = Object.assign({}, options, { - searchParams: [new RequestParam('query', query)] + searchParams: [new RequestParam('query', query)], }); return this.searchBy(searchHref, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow).pipe( @@ -102,8 +102,8 @@ export class CollectionDataService extends ComColDataService { options = Object.assign({}, options, { searchParams: [ new RequestParam('query', query), - new RequestParam('entityType', entityType) - ] + new RequestParam('entityType', entityType), + ], }); return this.searchBy(searchHref, options, true, reRequestOnStale, ...linksToFollow).pipe( @@ -121,13 +121,13 @@ export class CollectionDataService extends ComColDataService { * @return Observable>> * collection list */ - getAuthorizedCollectionByCommunity(communityId: string, query: string, options: FindListOptions = {}, reRequestOnStale = true,): Observable>> { + getAuthorizedCollectionByCommunity(communityId: string, query: string, options: FindListOptions = {}, reRequestOnStale = true): Observable>> { const searchHref = 'findSubmitAuthorizedByCommunity'; options = Object.assign({}, options, { searchParams: [ new RequestParam('uuid', communityId), - new RequestParam('query', query) - ] + new RequestParam('query', query), + ], }); return this.searchBy(searchHref, options, reRequestOnStale).pipe( @@ -154,11 +154,11 @@ export class CollectionDataService extends ComColDataService { const searchHref = 'findSubmitAuthorizedByCommunityAndEntityType'; const searchParams = [ new RequestParam('uuid', communityId), - new RequestParam('entityType', entityType) + new RequestParam('entityType', entityType), ]; options = Object.assign({}, options, { - searchParams: searchParams + searchParams: searchParams, }); return this.searchBy(searchHref, options, true, reRequestOnStale, ...linksToFollow).pipe( @@ -179,7 +179,7 @@ export class CollectionDataService extends ComColDataService { return this.searchBy(searchHref, options).pipe( filter((collections: RemoteData>) => !collections.isResponsePending), take(1), - map((collections: RemoteData>) => collections.payload.totalElements > 0) + map((collections: RemoteData>) => collections.payload.totalElements > 0), ); } @@ -189,7 +189,7 @@ export class CollectionDataService extends ComColDataService { */ getHarvesterEndpoint(collectionId: string): Observable { return this.halService.getEndpoint(this.linkPath).pipe( - switchMap((href: string) => this.halService.getEndpoint('harvester', `${href}/${collectionId}`)) + switchMap((href: string) => this.halService.getEndpoint('harvester', `${href}/${collectionId}`)), ); } @@ -200,7 +200,7 @@ export class CollectionDataService extends ComColDataService { getContentSource(collectionId: string, useCachedVersionIfAvailable = true): Observable> { const href$ = this.getHarvesterEndpoint(collectionId).pipe( isNotEmptyOperator(), - take(1) + take(1), ); href$.subscribe((href: string) => { @@ -227,7 +227,7 @@ export class CollectionDataService extends ComColDataService { headers = headers.append('Content-Type', 'application/json'); options.headers = headers; return new UpdateContentSourceRequest(requestId, href, JSON.stringify(serializedContentSource), options); - }) + }), ); // Execute the post/put request @@ -255,7 +255,7 @@ export class CollectionDataService extends ComColDataService { return (response as RemoteData).payload; } return response as INotification; - }) + }), ); } diff --git a/src/app/core/data/comcol-data.service.spec.ts b/src/app/core/data/comcol-data.service.spec.ts index 0f9f0fa740..5e044caff6 100644 --- a/src/app/core/data/comcol-data.service.spec.ts +++ b/src/app/core/data/comcol-data.service.spec.ts @@ -45,7 +45,7 @@ class TestService extends ComColDataService { protected http: HttpClient, protected bitstreamDataService: BitstreamDataService, protected comparator: DSOChangeAnalyzer, - protected linkPath: string + protected linkPath: string, ) { super('something', requestService, rdbService, objectCache, halService, comparator, notificationsService, bitstreamDataService); } @@ -79,30 +79,30 @@ describe('ComColDataService', () => { const comparator = {} as any; const options = Object.assign(new FindListOptions(), { - scopeID: scopeID + scopeID: scopeID, }); const scopedEndpoint = `${communityEndpoint}/${LINK_NAME}`; const mockHalService = { - getEndpoint: (linkPath) => observableOf(communitiesEndpoint) + getEndpoint: (linkPath) => observableOf(communitiesEndpoint), }; function initRdbService(): RemoteDataBuildService { return jasmine.createSpyObj('rdbService', { - buildSingle : createFailedRemoteDataObject$('Error', 500) + buildSingle : createFailedRemoteDataObject$('Error', 500), }); } function initBitstreamDataService(): BitstreamDataService { return jasmine.createSpyObj('bitstreamDataService', { - deleteByHref: createSuccessfulRemoteDataObject$({}) + deleteByHref: createSuccessfulRemoteDataObject$({}), }); } function initMockCommunityDataService(): CommunityDataService { return jasmine.createSpyObj('cds', { getEndpoint: cold('--a-', { a: communitiesEndpoint }), - getIDHref: communityEndpoint + getIDHref: communityEndpoint, }); } @@ -112,11 +112,11 @@ describe('ComColDataService', () => { d: { _links: { [LINK_NAME]: { - href: scopedEndpoint - } - } - } - }) + href: scopedEndpoint, + }, + }, + }, + }), }); } @@ -132,7 +132,7 @@ describe('ComColDataService', () => { http, bitstreamDataService, comparator, - LINK_NAME + LINK_NAME, ); } @@ -200,12 +200,12 @@ describe('ComColDataService', () => { communityWithParentHref = { _links: { parentCommunity: { - href: 'topLevel/parentCommunity' - } - } + href: 'topLevel/parentCommunity', + }, + }, } as Community; communityWithoutParentHref = { - _links: {} + _links: {}, } as Community; }); @@ -238,9 +238,9 @@ describe('ComColDataService', () => { id: 'a20da287-e174-466a-9926-f66as300d399', metadata: [{ key: 'dc.title', - value: 'parent community' + value: 'parent community', }], - _links: {} + _links: {}, }); }); it('should refresh a specific cached community when the parent link can be resolved', () => { @@ -262,9 +262,9 @@ describe('ComColDataService', () => { dso = { _links: { logo: { - href: 'logo-href' - } - } + href: 'logo-href', + }, + }, }; }); @@ -291,8 +291,8 @@ describe('ComColDataService', () => { _links: { self: { href: 'logo-href', - } - } + }, + }, }); }); diff --git a/src/app/core/data/comcol-data.service.ts b/src/app/core/data/comcol-data.service.ts index abc9046cd0..7590fb4dd0 100644 --- a/src/app/core/data/comcol-data.service.ts +++ b/src/app/core/data/comcol-data.service.ts @@ -86,7 +86,7 @@ export abstract class ComColDataService extend }), filter((halLink: HALLink) => isNotEmpty(halLink)), map((halLink: HALLink) => halLink.href), - distinctUntilChanged() + distinctUntilChanged(), ); } } @@ -97,7 +97,7 @@ export abstract class ComColDataService extend public findByParent(parentUUID: string, options: FindListOptions = {}, ...linksToFollow: FollowLinkConfig[]): Observable>> { const href$ = this.getFindByParentHref(parentUUID).pipe( - map((href: string) => this.buildHrefFromFindOptions(href, options)) + map((href: string) => this.buildHrefFromFindOptions(href, options)), ); return this.findListByHref(href$, options, true, true, ...linksToFollow); } @@ -110,7 +110,7 @@ export abstract class ComColDataService extend return this.halService.getEndpoint(this.linkPath).pipe( // We can't use HalLinkService to discover the logo link itself, as objects without a logo // don't have the link, and this method is also used in the createLogo method. - map((href: string) => new URLCombiner(href, id, 'logo').toString()) + map((href: string) => new URLCombiner(href, id, 'logo').toString()), ); } @@ -132,7 +132,7 @@ export abstract class ComColDataService extend } else { return this.bitstreamDataService.deleteByHref(logoRd.payload._links.self.href); } - }) + }), ); } else { return createFailedRemoteDataObject$(`The given object doesn't have a logo`, 400); @@ -148,7 +148,7 @@ export abstract class ComColDataService extend this.findByHref(parentCommunityUrl).pipe( getFirstCompletedRemoteData(), ), - this.halService.getEndpoint('communities/search/top').pipe(take(1)) + this.halService.getEndpoint('communities/search/top').pipe(take(1)), ]).subscribe(([rd, topHref]: [RemoteData, string]) => { if (rd.hasSucceeded && isNotEmpty(rd.payload) && isNotEmpty(rd.payload.id)) { this.requestService.setStaleByHrefSubstring(rd.payload.id); diff --git a/src/app/core/data/community-data.service.ts b/src/app/core/data/community-data.service.ts index efb6d50e84..c6c09e9653 100644 --- a/src/app/core/data/community-data.service.ts +++ b/src/app/core/data/community-data.service.ts @@ -44,14 +44,14 @@ export class CommunityDataService extends ComColDataService { findTop(options: FindListOptions = {}, ...linksToFollow: FollowLinkConfig[]): Observable>> { return this.getEndpoint().pipe( map(href => `${href}/search/top`), - switchMap(href => this.findListByHref(href, options, true, true, ...linksToFollow)) + switchMap(href => this.findListByHref(href, options, true, true, ...linksToFollow)), ); } protected getFindByParentHref(parentUUID: string): Observable { return this.halService.getEndpoint(this.linkPath).pipe( switchMap((communityEndpointHref: string) => - this.halService.getEndpoint('subcommunities', `${communityEndpointHref}/${parentUUID}`)) + this.halService.getEndpoint('subcommunities', `${communityEndpointHref}/${parentUUID}`)), ); } @@ -59,7 +59,7 @@ export class CommunityDataService extends ComColDataService { return this.getEndpoint().pipe( map((endpoint: string) => this.getIDHref(endpoint, options.scopeID)), filter((href: string) => isNotEmpty(href)), - take(1) + take(1), ); } } diff --git a/src/app/core/data/configuration-data.service.spec.ts b/src/app/core/data/configuration-data.service.spec.ts index 7fe69c16e5..b9fefdbd2d 100644 --- a/src/app/core/data/configuration-data.service.spec.ts +++ b/src/app/core/data/configuration-data.service.spec.ts @@ -18,7 +18,7 @@ describe('ConfigurationDataService', () => { const testObject = { uuid: 'test-property', name: 'test-property', - values: ['value-1', 'value-2'] + values: ['value-1', 'value-2'], } as ConfigurationProperty; const configLink = 'https://rest.api/rest/api/config/properties'; const requestURL = `https://rest.api/rest/api/config/properties/${testObject.name}`; @@ -28,18 +28,18 @@ describe('ConfigurationDataService', () => { scheduler = getTestScheduler(); halService = jasmine.createSpyObj('halService', { - getEndpoint: cold('a', { a: configLink }) + getEndpoint: cold('a', { a: configLink }), }); requestService = jasmine.createSpyObj('requestService', { generateRequestId: requestUUID, - send: true + send: true, }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: cold('a', { a: { - payload: testObject - } - }) + payload: testObject, + }, + }), }); objectCache = {} as ObjectCacheService; @@ -70,8 +70,8 @@ describe('ConfigurationDataService', () => { const result = service.findByPropertyName(testObject.name); const expected = cold('a', { a: { - payload: testObject - } + payload: testObject, + }, }); expect(result).toBeObservable(expected); }); diff --git a/src/app/core/data/dso-redirect.service.spec.ts b/src/app/core/data/dso-redirect.service.spec.ts index 2122dc663a..6d0b0f0449 100644 --- a/src/app/core/data/dso-redirect.service.spec.ts +++ b/src/app/core/data/dso-redirect.service.spec.ts @@ -33,26 +33,26 @@ describe('DsoRedirectService', () => { scheduler = getTestScheduler(); halService = jasmine.createSpyObj('halService', { - getEndpoint: cold('a', { a: pidLink }) + getEndpoint: cold('a', { a: pidLink }), }); requestService = jasmine.createSpyObj('requestService', { generateRequestId: requestUUID, - send: true + send: true, }); remoteData = createSuccessfulRemoteDataObject(Object.assign(new Item(), { type: 'item', - uuid: '123456789' + uuid: '123456789', })); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: cold('a', { - a: remoteData - }) + a: remoteData, + }), }); redirectService = jasmine.createSpyObj('redirectService', { - redirect: {} + redirect: {}, }); service = new DsoRedirectService( @@ -60,7 +60,7 @@ describe('DsoRedirectService', () => { rdbService, objectCache, halService, - redirectService + redirectService, ); }); @@ -115,8 +115,8 @@ describe('DsoRedirectService', () => { 'dspace.entity.type': [ { language: 'en_US', - value: 'Publication' - } + value: 'Publication', + }, ], }; const redir = service.findByIdAndIDType(dsoHandle, IdentifierType.HANDLE); diff --git a/src/app/core/data/dso-redirect.service.ts b/src/app/core/data/dso-redirect.service.ts index 8c15a33a3f..057e471488 100644 --- a/src/app/core/data/dso-redirect.service.ts +++ b/src/app/core/data/dso-redirect.service.ts @@ -74,7 +74,7 @@ export class DsoRedirectService { protected rdbService: RemoteDataBuildService, protected objectCache: ObjectCacheService, protected halService: HALEndpointService, - private hardRedirectService: HardRedirectService + private hardRedirectService: HardRedirectService, ) { this.dataService = new DsoByIdOrUUIDDataService(requestService, rdbService, objectCache, halService); } @@ -102,7 +102,7 @@ export class DsoRedirectService { } } } - }) + }), ); } } diff --git a/src/app/core/data/dspace-object-data.service.spec.ts b/src/app/core/data/dspace-object-data.service.spec.ts index 0f167ea47e..e003cc7ffc 100644 --- a/src/app/core/data/dspace-object-data.service.spec.ts +++ b/src/app/core/data/dspace-object-data.service.spec.ts @@ -16,7 +16,7 @@ describe('DSpaceObjectDataService', () => { let rdbService: RemoteDataBuildService; let objectCache: ObjectCacheService; const testObject = { - uuid: '9b4f22f4-164a-49db-8817-3316b6ee5746' + uuid: '9b4f22f4-164a-49db-8817-3316b6ee5746', } as DSpaceObject; const dsoLink = 'https://rest.api/rest/api/dso/find{?uuid}'; const requestURL = `https://rest.api/rest/api/dso/find?uuid=${testObject.uuid}`; @@ -26,18 +26,18 @@ describe('DSpaceObjectDataService', () => { scheduler = getTestScheduler(); halService = jasmine.createSpyObj('halService', { - getEndpoint: cold('a', { a: dsoLink }) + getEndpoint: cold('a', { a: dsoLink }), }); requestService = jasmine.createSpyObj('requestService', { generateRequestId: requestUUID, - send: true + send: true, }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: cold('a', { a: { - payload: testObject - } - }) + payload: testObject, + }, + }), }); objectCache = {} as ObjectCacheService; @@ -68,8 +68,8 @@ describe('DSpaceObjectDataService', () => { const result = service.findById(testObject.uuid); const expected = cold('a', { a: { - payload: testObject - } + payload: testObject, + }, }); expect(result).toBeObservable(expected); }); diff --git a/src/app/core/data/dspace-rest-response-parsing.service.ts b/src/app/core/data/dspace-rest-response-parsing.service.ts index 106410bad5..66506b4bff 100644 --- a/src/app/core/data/dspace-rest-response-parsing.service.ts +++ b/src/app/core/data/dspace-rest-response-parsing.service.ts @@ -144,8 +144,8 @@ export class DspaceRestResponseParsingService implements ResponseParsingService console.warn(`The response for '${request.href}' doesn't have a self link. This could mean there's an issue with the REST endpoint`); response.payload._links = Object.assign({}, response.payload._links, { self: { - href: urlWithoutEmbedParams - } + href: urlWithoutEmbedParams, + }, }); } else { @@ -155,8 +155,8 @@ export class DspaceRestResponseParsingService implements ResponseParsingService console.warn(`The response for '${urlWithoutEmbedParams}' has the self link '${response.payload._links.self.href}'. These don't match. This could mean there's an issue with the REST endpoint`); response.payload._links = Object.assign({}, response.payload._links, { self: { - href: urlWithoutEmbedParams - } + href: urlWithoutEmbedParams, + }, }); } } @@ -185,7 +185,7 @@ export class DspaceRestResponseParsingService implements ResponseParsingService let array: ObjectDomain[] = []; data.forEach((datum) => { array = [...array, this.process(datum, request)]; - } + }, ); return array; } @@ -231,7 +231,7 @@ export class DspaceRestResponseParsingService implements ResponseParsingService let dataJSON: string; if (hasValue(data._embedded)) { dataJSON = JSON.stringify(Object.assign({}, data, { - _embedded: '...' + _embedded: '...', })); } else { dataJSON = JSON.stringify(data); diff --git a/src/app/core/data/endpoint-map-response-parsing.service.ts b/src/app/core/data/endpoint-map-response-parsing.service.ts index 728714876c..eaf46f93e9 100644 --- a/src/app/core/data/endpoint-map-response-parsing.service.ts +++ b/src/app/core/data/endpoint-map-response-parsing.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { DspaceRestResponseParsingService, - isCacheableObject + isCacheableObject, } from './dspace-rest-response-parsing.service'; import { hasValue } from '../../shared/empty.util'; import { getClassForType } from '../cache/builders/build-decorators'; @@ -56,7 +56,7 @@ export class EndpointMapResponseParsingService extends DspaceRestResponseParsing } catch (e) { console.warn(`Couldn't parse endpoint request at ${request.href}`); return new ParsedResponse(response.statusCode, undefined, { - _links: response.payload._links + _links: response.payload._links, }); } } @@ -101,7 +101,7 @@ export class EndpointMapResponseParsingService extends DspaceRestResponseParsing let dataJSON: string; if (hasValue(data._embedded)) { dataJSON = JSON.stringify(Object.assign({}, data, { - _embedded: '...' + _embedded: '...', })); } else { dataJSON = JSON.stringify(data); diff --git a/src/app/core/data/entity-type-data.service.ts b/src/app/core/data/entity-type-data.service.ts index 4020ff638d..d0afce0679 100644 --- a/src/app/core/data/entity-type-data.service.ts +++ b/src/app/core/data/entity-type-data.service.ts @@ -48,7 +48,7 @@ export class EntityTypeDataService extends BaseDataService implements */ getRelationshipTypesEndpoint(entityTypeId: string): Observable { return this.halService.getEndpoint(this.linkPath).pipe( - switchMap((href) => this.halService.getEndpoint('relationshiptypes', `${href}/${entityTypeId}`)) + switchMap((href) => this.halService.getEndpoint('relationshiptypes', `${href}/${entityTypeId}`)), ); } @@ -84,7 +84,7 @@ export class EntityTypeDataService extends BaseDataService implements hasMoreThanOneAuthorized(): Observable { const findListOptions: FindListOptions = { elementsPerPage: 2, - currentPage: 1 + currentPage: 1, }; return this.getAllAuthorizedRelationshipType(findListOptions).pipe( map((result: RemoteData>) => { @@ -95,7 +95,7 @@ export class EntityTypeDataService extends BaseDataService implements output = false; } return output; - }) + }), ); } @@ -118,7 +118,7 @@ export class EntityTypeDataService extends BaseDataService implements hasMoreThanOneAuthorizedImport(): Observable { const findListOptions: FindListOptions = { elementsPerPage: 2, - currentPage: 1 + currentPage: 1, }; return this.getAllAuthorizedRelationshipTypeImport(findListOptions).pipe( map((result: RemoteData>) => { @@ -129,7 +129,7 @@ export class EntityTypeDataService extends BaseDataService implements output = false; } return output; - }) + }), ); } diff --git a/src/app/core/data/eperson-registration.service.spec.ts b/src/app/core/data/eperson-registration.service.spec.ts index afd4927103..686b13b56d 100644 --- a/src/app/core/data/eperson-registration.service.spec.ts +++ b/src/app/core/data/eperson-registration.service.spec.ts @@ -44,7 +44,7 @@ describe('EpersonRegistrationService', () => { generateRequestId: 'request-id', send: {}, getByUUID: cold('a', - { a: Object.assign(new RequestEntry(), { response: new RestResponse(true, 200, 'Success') }) }) + { a: Object.assign(new RequestEntry(), { response: new RestResponse(true, 200, 'Success') }) }), }); rdbService = jasmine.createSpyObj('rdbService', { buildSingle: observableOf(rd), @@ -53,7 +53,7 @@ describe('EpersonRegistrationService', () => { service = new EpersonRegistrationService( requestService, rdbService, - halService + halService, ); }); @@ -111,9 +111,9 @@ describe('EpersonRegistrationService', () => { payload: Object.assign(new Registration(), { email: registrationWithUser.email, token: 'test-token', - user: registrationWithUser.user - }) - }) + user: registrationWithUser.user, + }), + }), })); }); @@ -128,10 +128,10 @@ describe('EpersonRegistrationService', () => { jasmine.objectContaining({ uuid: 'request-id', method: 'GET', href: 'rest-url/registrations/search/findByToken?token=test-token', - }), true + }), true, ); expectObservable(rdbService.buildSingle.calls.argsFor(0)[0]).toBe('(a|)', { - a: 'rest-url/registrations/search/findByToken?token=test-token' + a: 'rest-url/registrations/search/findByToken?token=test-token', }); }); }); diff --git a/src/app/core/data/eperson-registration.service.ts b/src/app/core/data/eperson-registration.service.ts index 499d05af38..b526c9f29f 100644 --- a/src/app/core/data/eperson-registration.service.ts +++ b/src/app/core/data/eperson-registration.service.ts @@ -81,11 +81,11 @@ export class EpersonRegistrationService { map((href: string) => { const request = new PostRequest(requestId, href, registration, options); this.requestService.send(request); - }) + }), ).subscribe(); return this.rdbService.buildFromRequestUUID(requestId).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); } @@ -105,7 +105,7 @@ export class EpersonRegistrationService { Object.assign(request, { getResponseParser(): GenericConstructor { return RegistrationResponseParsingService; - } + }, }); this.requestService.send(request, true); }); @@ -117,7 +117,7 @@ export class EpersonRegistrationService { } else { return rd; } - }) + }), ); } diff --git a/src/app/core/data/external-source-data.service.spec.ts b/src/app/core/data/external-source-data.service.spec.ts index 723d7f9bed..e52f6e72b8 100644 --- a/src/app/core/data/external-source-data.service.spec.ts +++ b/src/app/core/data/external-source-data.service.spec.ts @@ -22,10 +22,10 @@ describe('ExternalSourceService', () => { metadata: { 'dc.identifier.uri': [ { - value: 'https://orcid.org/0001-0001-0001-0001' - } - ] - } + value: 'https://orcid.org/0001-0001-0001-0001', + }, + ], + }, }), Object.assign(new ExternalSourceEntry(), { id: '0001-0001-0001-0002', @@ -34,20 +34,20 @@ describe('ExternalSourceService', () => { metadata: { 'dc.identifier.uri': [ { - value: 'https://orcid.org/0001-0001-0001-0002' - } - ] - } - }) + value: 'https://orcid.org/0001-0001-0001-0002', + }, + ], + }, + }), ]; function init() { requestService = jasmine.createSpyObj('requestService', { generateRequestId: 'request-uuid', - send: {} + send: {}, }); rdbService = jasmine.createSpyObj('rdbService', { - buildList: createSuccessfulRemoteDataObject$(createPaginatedList(entries)) + buildList: createSuccessfulRemoteDataObject$(createPaginatedList(entries)), }); halService = jasmine.createSpyObj('halService', { getEndpoint: observableOf('external-sources-REST-endpoint'), diff --git a/src/app/core/data/external-source-data.service.ts b/src/app/core/data/external-source-data.service.ts index 02c5e4a53c..1b3b3f2fd7 100644 --- a/src/app/core/data/external-source-data.service.ts +++ b/src/app/core/data/external-source-data.service.ts @@ -50,7 +50,7 @@ export class ExternalSourceDataService extends IdentifiableDataService { return this.getBrowseEndpoint().pipe( map((href) => this.getIDHref(href, externalSourceId)), - switchMap((href) => this.halService.getEndpoint('entries', href)) + switchMap((href) => this.halService.getEndpoint('entries', href)), ); } @@ -78,7 +78,7 @@ export class ExternalSourceDataService extends IdentifiableDataService { return this.findListByHref(href$, undefined, !hasCachedErrorResponse, reRequestOnStale, ...linksToFollow as any); - }) + }), ) as any; } diff --git a/src/app/core/data/facet-config-response-parsing.service.ts b/src/app/core/data/facet-config-response-parsing.service.ts index 3e4493c32b..474d42872b 100644 --- a/src/app/core/data/facet-config-response-parsing.service.ts +++ b/src/app/core/data/facet-config-response-parsing.service.ts @@ -16,19 +16,19 @@ export class FacetConfigResponseParsingService extends DspaceRestResponseParsing const filters = serializer.deserializeArray(config); const _links = { - self: data.payload._links.self + self: data.payload._links.self, }; // fill in the missing links section filters.forEach((filterConfig: SearchFilterConfig) => { _links[filterConfig.name] = { - href: filterConfig._links.self.href + href: filterConfig._links.self.href, }; }); const facetConfigResponse = Object.assign(new FacetConfigResponse(), { filters, - _links + _links, }); this.addToObjectCache(facetConfigResponse, request, data); diff --git a/src/app/core/data/feature-authorization/authorization-data.service.spec.ts b/src/app/core/data/feature-authorization/authorization-data.service.spec.ts index ae44d590a4..91492cdcbb 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.spec.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.spec.ts @@ -23,19 +23,19 @@ describe('AuthorizationDataService', () => { let ePerson: EPerson; const requestService = jasmine.createSpyObj('requestService', { - setStaleByHrefSubstring: jasmine.createSpy('setStaleByHrefSubstring') + setStaleByHrefSubstring: jasmine.createSpy('setStaleByHrefSubstring'), }); function init() { site = Object.assign(new Site(), { id: 'test-site', _links: { - self: { href: 'test-site-href' } - } + self: { href: 'test-site-href' }, + }, }); ePerson = Object.assign(new EPerson(), { id: 'test-eperson', - uuid: 'test-eperson' + uuid: 'test-eperson', }); siteService = jasmine.createSpyObj('siteService', { find: observableOf(site), @@ -157,26 +157,26 @@ describe('AuthorizationDataService', () => { const validPayload = [ Object.assign(new Authorization(), { feature: createSuccessfulRemoteDataObject$(Object.assign(new Feature(), { - id: 'invalid-feature' - })) + id: 'invalid-feature', + })), }), Object.assign(new Authorization(), { feature: createSuccessfulRemoteDataObject$(Object.assign(new Feature(), { - id: featureID - })) - }) + id: featureID, + })), + }), ]; const invalidPayload = [ Object.assign(new Authorization(), { feature: createSuccessfulRemoteDataObject$(Object.assign(new Feature(), { - id: 'invalid-feature' - })) + id: 'invalid-feature', + })), }), Object.assign(new Authorization(), { feature: createSuccessfulRemoteDataObject$(Object.assign(new Feature(), { - id: 'another-invalid-feature' - })) - }) + id: 'another-invalid-feature', + })), + }), ]; const emptyPayload = []; diff --git a/src/app/core/data/feature-authorization/authorization-data.service.ts b/src/app/core/data/feature-authorization/authorization-data.service.ts index c43d335234..bb33aba037 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.ts @@ -75,7 +75,7 @@ export class AuthorizationDataService extends BaseDataService imp } }), catchError(() => observableOf(false)), - oneAuthorizationMatchesFeature(featureId) + oneAuthorizationMatchesFeature(featureId), ); } @@ -100,7 +100,7 @@ export class AuthorizationDataService extends BaseDataService imp switchMap((url) => { if (hasNoValue(url)) { return this.siteService.find().pipe( - map((site) => site.self) + map((site) => site.self), ); } else { return observableOf(url); @@ -112,7 +112,7 @@ export class AuthorizationDataService extends BaseDataService imp map((url: string) => new AuthorizationSearchParams(url, ePersonUuid, featureId)), switchMap((params: AuthorizationSearchParams) => { return this.searchBy(this.searchByObjectPath, this.createSearchOptions(params.objectUrl, options, params.ePersonUuid, params.featureId), useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); - }) + }), ); this.addDependency(out$, objectUrl$); diff --git a/src/app/core/data/feature-authorization/authorization-utils.ts b/src/app/core/data/feature-authorization/authorization-utils.ts index d1b65f6123..8db3f1ef19 100644 --- a/src/app/core/data/feature-authorization/authorization-utils.ts +++ b/src/app/core/data/feature-authorization/authorization-utils.ts @@ -20,12 +20,12 @@ export const addSiteObjectUrlIfEmpty = (siteService: SiteDataService) => switchMap((params: AuthorizationSearchParams) => { if (hasNoValue(params.objectUrl)) { return siteService.find().pipe( - map((site) => Object.assign({}, params, { objectUrl: site.self })) + map((site) => Object.assign({}, params, { objectUrl: site.self })), ); } else { return observableOf(params); } - }) + }), ); /** @@ -42,17 +42,17 @@ export const addAuthenticatedUserUuidIfEmpty = (authService: AuthService) => switchMap((authenticated) => { if (authenticated) { return authService.getAuthenticatedUserFromStore().pipe( - map((ePerson) => Object.assign({}, params, { ePersonUuid: ePerson.uuid })) + map((ePerson) => Object.assign({}, params, { ePersonUuid: ePerson.uuid })), ); } else { return observableOf(params); } - }) + }), ); } else { return observableOf(params); } - }) + }), ); /** @@ -72,12 +72,12 @@ export const oneAuthorizationMatchesFeature = (featureID: FeatureID) => ...authorizations .filter((authorization: Authorization) => hasValue(authorization.feature)) .map((authorization: Authorization) => authorization.feature.pipe( - getFirstSucceededRemoteDataPayload() - )) + getFirstSucceededRemoteDataPayload(), + )), ); } else { return observableOf([]); } }), - map((features: Feature[]) => features.filter((feature: Feature) => feature.id === featureID).length > 0) + map((features: Feature[]) => features.filter((feature: Feature) => feature.id === featureID).length > 0), ); diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts index b41a322cb6..9af82e335a 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard.ts @@ -11,7 +11,7 @@ import { FeatureID } from '../feature-id'; * isn't a Collection administrator */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CollectionAdministratorGuard extends SingleFeatureAuthorizationGuard { constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts index 2ab77a00cc..11211029ed 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/community-administrator.guard.ts @@ -11,7 +11,7 @@ import { FeatureID } from '../feature-id'; * isn't a Community administrator */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CommunityAdministratorGuard extends SingleFeatureAuthorizationGuard { constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts index 6c1f330c69..469178399a 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard.spec.ts @@ -37,30 +37,30 @@ describe('DsoPageSingleFeatureGuard', () => { function init() { object = { - self: 'test-selflink' + self: 'test-selflink', } as DSpaceObject; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); router = jasmine.createSpyObj('router', { - parseUrl: {} + parseUrl: {}, }); resolver = jasmine.createSpyObj('resolver', { - resolve: createSuccessfulRemoteDataObject$(object) + resolve: createSuccessfulRemoteDataObject$(object), }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true) + isAuthenticated: observableOf(true), }); parentRoute = { params: { - id: '3e1a5327-dabb-41ff-af93-e6cab9d032f0' - } + id: '3e1a5327-dabb-41ff-af93-e6cab9d032f0', + }, }; route = { params: { }, - parent: parentRoute + parent: parentRoute, }; guard = new DsoPageSingleFeatureGuardImpl(resolver, authorizationService, router, authService, undefined); } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts index 071b1b0731..7d86202993 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.spec.ts @@ -37,30 +37,30 @@ describe('DsoPageSomeFeatureGuard', () => { function init() { object = { - self: 'test-selflink' + self: 'test-selflink', } as DSpaceObject; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); router = jasmine.createSpyObj('router', { - parseUrl: {} + parseUrl: {}, }); resolver = jasmine.createSpyObj('resolver', { - resolve: createSuccessfulRemoteDataObject$(object) + resolve: createSuccessfulRemoteDataObject$(object), }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true) + isAuthenticated: observableOf(true), }); parentRoute = { params: { - id: '3e1a5327-dabb-41ff-af93-e6cab9d032f0' - } + id: '3e1a5327-dabb-41ff-af93-e6cab9d032f0', + }, }; route = { params: { }, - parent: parentRoute + parent: parentRoute, }; guard = new DsoPageSomeFeatureGuardImpl(resolver, authorizationService, router, authService, []); } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.ts index 8683709345..81365660d8 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-some-feature.guard.ts @@ -28,7 +28,7 @@ export abstract class DsoPageSomeFeatureGuard extends So const routeWithObjectID = this.getRouteWithDSOId(route); return (this.resolver.resolve(routeWithObjectID, state) as Observable>).pipe( getAllSucceededRemoteDataPayload(), - map((dso) => dso.self) + map((dso) => dso.self), ); } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts index 5afd572326..7b24121032 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard.ts @@ -11,7 +11,7 @@ import { FeatureID } from '../feature-id'; * management rights */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class GroupAdministratorGuard extends SingleFeatureAuthorizationGuard { constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts index 635aa3530b..b7f0998d69 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/single-feature-authorization.guard.spec.ts @@ -48,13 +48,13 @@ describe('SingleFeatureAuthorizationGuard', () => { ePersonUuid = 'fake-eperson-uuid'; authorizationService = jasmine.createSpyObj('authorizationService', { - isAuthorized: observableOf(true) + isAuthorized: observableOf(true), }); router = jasmine.createSpyObj('router', { - parseUrl: {} + parseUrl: {}, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true) + isAuthenticated: observableOf(true), }); guard = new SingleFeatureAuthorizationGuardImpl(authorizationService, router, authService, featureId, objectUrl, ePersonUuid); } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts index cc6f50c161..be59235b20 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts @@ -11,7 +11,7 @@ import { AuthService } from '../../../auth/auth.service'; * rights to the {@link Site} */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class SiteAdministratorGuard extends SingleFeatureAuthorizationGuard { constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts index bdbb8250e2..245c91026d 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts @@ -11,7 +11,7 @@ import { AuthService } from '../../../auth/auth.service'; * rights to the {@link Site} */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class SiteRegisterGuard extends SingleFeatureAuthorizationGuard { constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts index 90153d2d14..84f77e04af 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.spec.ts @@ -52,13 +52,13 @@ describe('SomeFeatureAuthorizationGuard', () => { authorizationService = Object.assign({ isAuthorized(featureId?: FeatureID): Observable { return observableOf(authorizedFeatureIds.indexOf(featureId) > -1); - } + }, }); router = jasmine.createSpyObj('router', { - parseUrl: {} + parseUrl: {}, }); authService = jasmine.createSpyObj('authService', { - isAuthenticated: observableOf(true) + isAuthenticated: observableOf(true), }); guard = new SomeFeatureAuthorizationGuardImpl(authorizationService, router, authService, featureIds, objectUrl, ePersonUuid); } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts index b909640ea6..ea59b164b4 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard.ts @@ -24,9 +24,9 @@ export abstract class SomeFeatureAuthorizationGuard implements CanActivate { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { return observableCombineLatest(this.getFeatureIDs(route, state), this.getObjectUrl(route, state), this.getEPersonUuid(route, state)).pipe( switchMap(([featureIDs, objectUrl, ePersonUuid]) => - observableCombineLatest(...featureIDs.map((featureID) => this.authorizationService.isAuthorized(featureID, objectUrl, ePersonUuid))) + observableCombineLatest(...featureIDs.map((featureID) => this.authorizationService.isAuthorized(featureID, objectUrl, ePersonUuid))), ), - returnForbiddenUrlTreeOrLoginOnAllFalse(this.router, this.authService, state.url) + returnForbiddenUrlTreeOrLoginOnAllFalse(this.router, this.authService, state.url), ); } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts index 7e2a827876..f25d1728a8 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts @@ -11,7 +11,7 @@ import { FeatureID } from '../feature-id'; * management rights */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class StatisticsAdministratorGuard extends SingleFeatureAuthorizationGuard { constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { diff --git a/src/app/core/data/filtered-discovery-page-response-parsing.service.spec.ts b/src/app/core/data/filtered-discovery-page-response-parsing.service.spec.ts index ac0e96a2e6..633c1cb7f5 100644 --- a/src/app/core/data/filtered-discovery-page-response-parsing.service.spec.ts +++ b/src/app/core/data/filtered-discovery-page-response-parsing.service.spec.ts @@ -17,15 +17,15 @@ describe('FilteredDiscoveryPageResponseParsingService', () => { const request = Object.assign(new GetRequest('client/f5b4ccb8-fbb0-4548-b558-f234d9fdfad6', 'https://rest.api/path'), { getResponseParser(): GenericConstructor { return FilteredDiscoveryPageResponseParsingService; - } + }, }); const mockResponse = { payload: { - 'discovery-query': 'query' + 'discovery-query': 'query', }, statusCode: 200, - statusText: 'OK' + statusText: 'OK', } as RawRestResponse; it('should return a FilteredDiscoveryQueryResponse containing the correct query', () => { diff --git a/src/app/core/data/identifier-data.service.ts b/src/app/core/data/identifier-data.service.ts index 03422dadfb..4ab28a62fe 100644 --- a/src/app/core/data/identifier-data.service.ts +++ b/src/app/core/data/identifier-data.service.ts @@ -61,7 +61,7 @@ export class IdentifierDataService extends BaseDataService { public getIdentifierRegistrationConfiguration(): Observable { return this.configurationService.findByPropertyName('identifiers.item-status.register-doi').pipe( getFirstCompletedRemoteData(), - map((propertyRD: RemoteData) => propertyRD.hasSucceeded ? propertyRD.payload.values : []) + map((propertyRD: RemoteData) => propertyRD.hasSucceeded ? propertyRD.payload.values : []), ); } @@ -79,7 +79,7 @@ export class IdentifierDataService extends BaseDataService { return new PostRequest(requestId, endpointURL, item._links.self.href, options); }), sendRequest(this.requestService), - switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID(request.uuid) as Observable>) + switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID(request.uuid) as Observable>), ); } } diff --git a/src/app/core/data/item-data.service.spec.ts b/src/app/core/data/item-data.service.spec.ts index 2c20ed0fb6..e08ffdb329 100644 --- a/src/app/core/data/item-data.service.spec.ts +++ b/src/app/core/data/item-data.service.spec.ts @@ -46,7 +46,7 @@ describe('ItemDataService', () => { const objectCache = {} as ObjectCacheService; const halEndpointService: any = new HALEndpointServiceStub(itemEndpoint); const bundleService = jasmine.createSpyObj('bundleService', { - findByHref: {} + findByHref: {}, }); const scopeID = '4af28e99-6a9c-4036-a199-e1b587046d39'; @@ -54,8 +54,8 @@ describe('ItemDataService', () => { scopeID: scopeID, sort: { field: '', - direction: undefined - } + direction: undefined, + }, }); const browsesEndpoint = 'https://rest.api/discover/browses'; @@ -73,7 +73,7 @@ describe('ItemDataService', () => { cold('--a-', { a: itemBrowseEndpoint }) : cold('--#-', undefined, browseError); return jasmine.createSpyObj('bs', { - getBrowseURLFor: obs + getBrowseURLFor: obs, }); } @@ -158,7 +158,7 @@ describe('ItemDataService', () => { const externalSourceEntry = Object.assign(new ExternalSourceEntry(), { display: 'John, Doe', value: 'John, Doe', - _links: { self: { href: 'http://test-rest.com/server/api/integration/externalSources/orcidV2/entryValues/0000-0003-4851-8004' } } + _links: { self: { href: 'http://test-rest.com/server/api/integration/externalSources/orcidV2/entryValues/0000-0003-4851-8004' } }, }); beforeEach(() => { diff --git a/src/app/core/data/item-data.service.ts b/src/app/core/data/item-data.service.ts index c3fa84dd6c..a0fd5ae00e 100644 --- a/src/app/core/data/item-data.service.ts +++ b/src/app/core/data/item-data.service.ts @@ -140,7 +140,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService return new PostRequest(this.requestService.generateRequestId(), endpointURL, collectionHref, options); }), sendRequest(this.requestService), - switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID(request.uuid)) + switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID(request.uuid)), ); } @@ -152,7 +152,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService public setWithDrawn(item: Item, withdrawn: boolean): Observable> { const patchOperation = { - op: 'replace', path: '/withdrawn', value: withdrawn + op: 'replace', path: '/withdrawn', value: withdrawn, } as Operation; this.requestService.removeByHrefSubstring('/discover'); @@ -166,7 +166,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService */ public setDiscoverable(item: Item, discoverable: boolean): Observable> { const patchOperation = { - op: 'replace', path: '/discoverable', value: discoverable + op: 'replace', path: '/discoverable', value: discoverable, } as Operation; this.requestService.removeByHrefSubstring('/discover'); @@ -180,7 +180,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService */ public getBundlesEndpoint(itemId: string): Observable { return this.halService.getEndpoint(this.linkPath).pipe( - switchMap((url: string) => this.halService.getEndpoint('bundles', `${url}/${itemId}`)) + switchMap((url: string) => this.halService.getEndpoint('bundles', `${url}/${itemId}`)), ); } @@ -191,10 +191,10 @@ export abstract class BaseItemDataService extends IdentifiableDataService */ public getBundles(itemId: string, searchOptions?: PaginatedSearchOptions): Observable>> { const hrefObs = this.getBundlesEndpoint(itemId).pipe( - map((href) => searchOptions ? searchOptions.toRestUrl(href) : href) + map((href) => searchOptions ? searchOptions.toRestUrl(href) : href), ); hrefObs.pipe( - take(1) + take(1), ).subscribe((href) => { const request = new GetRequest(this.requestService.generateRequestId(), href); this.requestService.send(request); @@ -215,11 +215,11 @@ export abstract class BaseItemDataService extends IdentifiableDataService const bundleJson = { name: bundleName, - metadata: metadata ? metadata : {} + metadata: metadata ? metadata : {}, }; hrefObs.pipe( - take(1) + take(1), ).subscribe((href) => { const options: HttpOptions = Object.create({}); let headers = new HttpHeaders(); @@ -238,7 +238,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService */ public getIdentifiersEndpoint(itemId: string): Observable { return this.halService.getEndpoint(this.linkPath).pipe( - switchMap((url: string) => this.halService.getEndpoint('identifiers', `${url}/${itemId}`)) + switchMap((url: string) => this.halService.getEndpoint('identifiers', `${url}/${itemId}`)), ); } @@ -249,7 +249,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService public getMoveItemEndpoint(itemId: string, inheritPolicies: boolean): Observable { return this.halService.getEndpoint(this.linkPath).pipe( map((endpoint: string) => this.getIDHref(endpoint, itemId)), - map((endpoint: string) => `${endpoint}/owningCollection?inheritPolicies=${inheritPolicies}`) + map((endpoint: string) => `${endpoint}/owningCollection?inheritPolicies=${inheritPolicies}`), ); } @@ -275,10 +275,10 @@ export abstract class BaseItemDataService extends IdentifiableDataService // TODO: for now, the move Item endpoint returns a malformed collection -- only look at the status code getResponseParser(): GenericConstructor { return StatusCodeOnlyResponseParsingService; - } + }, }); return request; - }) + }), ).subscribe((request) => { this.requestService.send(request); }); @@ -305,7 +305,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService map((href: string) => { const request = new PostRequest(requestId, href, externalSourceEntry._links.self.href, options); this.requestService.send(request); - }) + }), ).subscribe(); return this.rdbService.buildFromRequestUUID(requestId); @@ -317,7 +317,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService */ public getBitstreamsEndpoint(itemId: string): Observable { return this.halService.getEndpoint(this.linkPath).pipe( - switchMap((url: string) => this.halService.getEndpoint('bitstreams', `${url}/${itemId}`)) + switchMap((url: string) => this.halService.getEndpoint('bitstreams', `${url}/${itemId}`)), ); } diff --git a/src/app/core/data/item-request-data.service.ts b/src/app/core/data/item-request-data.service.ts index ff6025f7ac..ced5817fc1 100644 --- a/src/app/core/data/item-request-data.service.ts +++ b/src/app/core/data/item-request-data.service.ts @@ -60,11 +60,11 @@ export class ItemRequestDataService extends IdentifiableDataService map((href: string) => { const request = new PostRequest(requestId, href, itemRequest); this.requestService.send(request); - }) + }), ).subscribe(); return this.rdbService.buildFromRequestUUID(requestId).pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); } diff --git a/src/app/core/data/item-template-data.service.spec.ts b/src/app/core/data/item-template-data.service.spec.ts index 16cf0dbd99..9a7390648d 100644 --- a/src/app/core/data/item-template-data.service.spec.ts +++ b/src/app/core/data/item-template-data.service.spec.ts @@ -46,7 +46,7 @@ describe('ItemTemplateDataService', () => { }, commit(method?: RestRequestMethod) { // Do nothing - } + }, } as RequestService; const rdbService = {} as RemoteDataBuildService; const store = {} as Store; @@ -62,18 +62,18 @@ describe('ItemTemplateDataService', () => { const halEndpointService = { getEndpoint(linkPath: string): Observable { return cold('a', { a: itemEndpoint }); - } + }, } as HALEndpointService; const notificationsService = {} as NotificationsService; const comparator = { diff(first, second) { return [{}]; - } + }, } as any; const collectionService = { getIDHrefObs(id): Observable { return observableOf(collectionEndpoint); - } + }, } as CollectionDataService; function initTestService() { diff --git a/src/app/core/data/lookup-relation.service.spec.ts b/src/app/core/data/lookup-relation.service.spec.ts index 58598b9870..48bcb4fd3c 100644 --- a/src/app/core/data/lookup-relation.service.spec.ts +++ b/src/app/core/data/lookup-relation.service.spec.ts @@ -24,20 +24,20 @@ describe('LookupRelationService', () => { const optionsWithQuery = new PaginatedSearchOptions({ query: 'test-query' }); const relationship = Object.assign(new RelationshipOptions(), { filter: 'test-filter', - configuration: 'test-configuration' + configuration: 'test-configuration', }); const localResults = [ Object.assign(new SearchResult(), { indexableObject: Object.assign(new Item(), { uuid: 'test-item-uuid', - handle: 'test-item-handle' - }) - }) + handle: 'test-item-handle', + }), + }), ]; const externalSource = Object.assign(new ExternalSource(), { id: 'orcidV2', name: 'orcidV2', - hierarchical: false + hierarchical: false, }); const searchServiceEndpoint = 'http://test-rest.com/server/api/core/search'; @@ -47,12 +47,12 @@ describe('LookupRelationService', () => { elementsPerPage: 1, totalElements: totalExternal, totalPages: totalExternal, - currentPage: 1 - }), [{}])) + currentPage: 1, + }), [{}])), }); searchService = jasmine.createSpyObj('searchService', { search: createSuccessfulRemoteDataObject$(createPaginatedList(localResults)), - getEndpoint: observableOf(searchServiceEndpoint) + getEndpoint: observableOf(searchServiceEndpoint), }); requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring']); service = new LookupRelationService(externalSourceService, searchService, requestService); @@ -77,7 +77,7 @@ describe('LookupRelationService', () => { it('should set the searchConfig to contain a fixedFilter and configuration', () => { expect(service.searchConfig).toEqual(Object.assign(new PaginatedSearchOptions({}), optionsWithQuery, - { fixedFilter: relationship.filter, configuration: relationship.searchConfiguration } + { fixedFilter: relationship.filter, configuration: relationship.searchConfiguration }, )); }); }); diff --git a/src/app/core/data/lookup-relation.service.ts b/src/app/core/data/lookup-relation.service.ts index 7a6bc2358b..aa8c549250 100644 --- a/src/app/core/data/lookup-relation.service.ts +++ b/src/app/core/data/lookup-relation.service.ts @@ -31,7 +31,7 @@ export class LookupRelationService { */ private singleResultOptions = Object.assign(new PaginationComponentOptions(), { id: 'single-result-options', - pageSize: 1 + pageSize: 1, }); constructor(protected externalSourceService: ExternalSourceDataService, @@ -47,7 +47,7 @@ export class LookupRelationService { */ getLocalResults(relationship: RelationshipOptions, searchOptions: PaginatedSearchOptions, setSearchConfig = true): Observable>>> { const newConfig = Object.assign(new PaginatedSearchOptions({}), searchOptions, - { fixedFilter: relationship.filter, configuration: relationship.searchConfiguration } + { fixedFilter: relationship.filter, configuration: relationship.searchConfiguration }, ); if (setSearchConfig) { this.searchConfig = newConfig; @@ -59,8 +59,8 @@ export class LookupRelationService { () => new ReplaySubject(1), (subject) => subject.pipe( takeWhile((rd: RemoteData>>) => rd.isLoading), - concat(subject.pipe(take(1))) - ) + concat(subject.pipe(take(1))), + ), ) as any , ) as Observable>>>; @@ -76,7 +76,7 @@ export class LookupRelationService { getAllSucceededRemoteData(), getRemoteDataPayload(), map((results: PaginatedList>) => results.totalElements), - startWith(0) + startWith(0), ); } @@ -91,7 +91,7 @@ export class LookupRelationService { getRemoteDataPayload(), map((results: PaginatedList) => results.totalElements), startWith(0), - distinctUntilChanged() + distinctUntilChanged(), ); } diff --git a/src/app/core/data/metadata-field-data.service.spec.ts b/src/app/core/data/metadata-field-data.service.spec.ts index 1ce078f5d5..72b1ff6632 100644 --- a/src/app/core/data/metadata-field-data.service.spec.ts +++ b/src/app/core/data/metadata-field-data.service.spec.ts @@ -31,8 +31,8 @@ describe('MetadataFieldDataService', () => { prefix: 'dc', namespace: 'namespace', _links: { - self: { href: 'selflink' } - } + self: { href: 'selflink' }, + }, }); requestService = jasmine.createSpyObj('requestService', { generateRequestId: '34cfed7c-f597-49ef-9cbe-ea351f0023c2', @@ -73,7 +73,7 @@ describe('MetadataFieldDataService', () => { it('should call searchBy with the correct arguments', () => { metadataFieldService.findBySchema(schema); const expectedOptions = Object.assign(new FindListOptions(), { - searchParams: [new RequestParam('schema', schema.prefix)] + searchParams: [new RequestParam('schema', schema.prefix)], }); expect(metadataFieldService.searchBy).toHaveBeenCalledWith('bySchema', expectedOptions, true, true); }); diff --git a/src/app/core/data/metadata-schema-data.service.spec.ts b/src/app/core/data/metadata-schema-data.service.spec.ts index 1bcf4e1104..07c71a4646 100644 --- a/src/app/core/data/metadata-schema-data.service.spec.ts +++ b/src/app/core/data/metadata-schema-data.service.spec.ts @@ -61,8 +61,8 @@ describe('MetadataSchemaDataService', () => { prefix: 'dc', namespace: 'namespace', _links: { - self: { href: 'selflink' } - } + self: { href: 'selflink' }, + }, }); }); @@ -78,7 +78,7 @@ describe('MetadataSchemaDataService', () => { describe('called with an existing metadata schema', () => { beforeEach(() => { schema = Object.assign(schema, { - id: 'id-of-existing-schema' + id: 'id-of-existing-schema', }); }); diff --git a/src/app/core/data/mydspace-response-parsing.service.ts b/src/app/core/data/mydspace-response-parsing.service.ts index e46e319149..d1f28a572d 100644 --- a/src/app/core/data/mydspace-response-parsing.service.ts +++ b/src/app/core/data/mydspace-response-parsing.service.ts @@ -14,8 +14,8 @@ export class MyDSpaceResponseParsingService extends DspaceRestResponseParsingSer // fallback for unexpected empty response const emptyPayload = { _embedded: { - objects: [] - } + objects: [], + }, }; const payload = data.payload._embedded.searchResult || emptyPayload; const hitHighlights: MetadataMap[] = payload._embedded.objects @@ -26,7 +26,7 @@ export class MyDSpaceResponseParsingService extends DspaceRestResponseParsingSer for (const key of Object.keys(hhObject)) { const value: MetadataValue = Object.assign(new MetadataValue(), { value: hhObject[key].join('...'), - language: null + language: null, }); mdMap[key] = [value]; } @@ -46,7 +46,7 @@ export class MyDSpaceResponseParsingService extends DspaceRestResponseParsingSer .map((object, index) => Object.assign({}, object, { indexableObject: dsoSelfLinks[index], hitHighlights: hitHighlights[index], - _embedded: this.filterEmbeddedObjects(object) + _embedded: this.filterEmbeddedObjects(object), })); payload.objects = objects; const deserialized: any = new DSpaceSerializer(SearchObjects).deserialize(payload); @@ -65,8 +65,8 @@ export class MyDSpaceResponseParsingService extends DspaceRestResponseParsingSer .reduce((obj, key) => { obj[key] = object._embedded.indexableObject._embedded[key]; return obj; - }, {}) - }) + }, {}), + }), }); } else { return object; diff --git a/src/app/core/data/object-updates/object-updates.actions.ts b/src/app/core/data/object-updates/object-updates.actions.ts index 615dedbaf9..2bd50655fd 100644 --- a/src/app/core/data/object-updates/object-updates.actions.ts +++ b/src/app/core/data/object-updates/object-updates.actions.ts @@ -20,7 +20,7 @@ export const ObjectUpdatesActionTypes = { REINSTATE: type('dspace/core/cache/object-updates/REINSTATE'), REMOVE: type('dspace/core/cache/object-updates/REMOVE'), REMOVE_ALL: type('dspace/core/cache/object-updates/REMOVE_ALL'), - REMOVE_FIELD: type('dspace/core/cache/object-updates/REMOVE_FIELD') + REMOVE_FIELD: type('dspace/core/cache/object-updates/REMOVE_FIELD'), }; @@ -49,7 +49,7 @@ export class InitializeFieldsAction implements Action { url: string, fields: Identifiable[], lastModified: Date, - patchOperationService?: GenericConstructor + patchOperationService?: GenericConstructor, ) { this.payload = { url, fields, lastModified, patchOperationService }; } @@ -193,7 +193,7 @@ export class DiscardObjectUpdatesAction implements Action { constructor( url: string, notification: INotification, - discardAll = false + discardAll = false, ) { this.payload = { url, notification, discardAll }; } @@ -215,7 +215,7 @@ export class ReinstateObjectUpdatesAction implements Action { * the unique url of the page for which the changes should be reinstated */ constructor( - url: string + url: string, ) { this.payload = { url }; } @@ -237,7 +237,7 @@ export class RemoveObjectUpdatesAction implements Action { * the unique url of the page for which the changes should be removed */ constructor( - url: string + url: string, ) { this.payload = { url }; } @@ -269,7 +269,7 @@ export class RemoveFieldUpdateAction implements Action { */ constructor( url: string, - uuid: string + uuid: string, ) { this.payload = { url, uuid }; } diff --git a/src/app/core/data/object-updates/object-updates.effects.spec.ts b/src/app/core/data/object-updates/object-updates.effects.spec.ts index b78e77e06d..fff9e13f66 100644 --- a/src/app/core/data/object-updates/object-updates.effects.spec.ts +++ b/src/app/core/data/object-updates/object-updates.effects.spec.ts @@ -9,11 +9,11 @@ import { ObjectUpdatesAction, ReinstateObjectUpdatesAction, RemoveFieldUpdateAction, - RemoveObjectUpdatesAction + RemoveObjectUpdatesAction, } from './object-updates.actions'; import { INotification, - Notification + Notification, } from '../../../shared/notifications/models/notification.model'; import { NotificationType } from '../../../shared/notifications/models/notification-type'; import { filter } from 'rxjs/operators'; @@ -35,8 +35,8 @@ describe('ObjectUpdatesEffects', () => { provide: NotificationsService, useValue: { remove: (notification) => { /* empty */ - } - } + }, + }, }, ], }); @@ -86,7 +86,7 @@ describe('ObjectUpdatesEffects', () => { filter(((action) => hasValue(action)))) .subscribe((t) => { expect(t).toEqual(removeAction); - } + }, ) ; }); @@ -102,7 +102,7 @@ describe('ObjectUpdatesEffects', () => { actions = hot('b', { b: new ReinstateObjectUpdatesAction(testURL) }); updatesEffects.removeAfterDiscardOrReinstateOnUndo$.subscribe((t) => { expect(t).toEqual(new NoOpAction()); - } + }, ); }); }); @@ -117,7 +117,7 @@ describe('ObjectUpdatesEffects', () => { actions = hot('b', { b: new RemoveFieldUpdateAction(testURL, testUUID) }); updatesEffects.removeAfterDiscardOrReinstateOnUndo$.subscribe((t) => - expect(t).toEqual(new RemoveObjectUpdatesAction(testURL)) + expect(t).toEqual(new RemoveObjectUpdatesAction(testURL)), ); }); }); diff --git a/src/app/core/data/object-updates/object-updates.effects.ts b/src/app/core/data/object-updates/object-updates.effects.ts index 5d5b032c56..cee45b5197 100644 --- a/src/app/core/data/object-updates/object-updates.effects.ts +++ b/src/app/core/data/object-updates/object-updates.effects.ts @@ -5,7 +5,7 @@ import { ObjectUpdatesAction, ObjectUpdatesActionTypes, RemoveAllObjectUpdatesAction, - RemoveObjectUpdatesAction + RemoveObjectUpdatesAction, } from './object-updates.actions'; import { delay, filter, map, switchMap, take, tap } from 'rxjs/operators'; import { of as observableOf, race as observableRace, Subject } from 'rxjs'; @@ -15,7 +15,7 @@ import { INotification } from '../../../shared/notifications/models/notification import { NotificationsActions, NotificationsActionTypes, - RemoveNotificationAction + RemoveNotificationAction, } from '../../../shared/notifications/notifications.actions'; import { Action } from '@ngrx/store'; import { NoOpAction } from '../../../shared/ngrx/no-op.action'; @@ -63,7 +63,7 @@ export class ObjectUpdatesEffects { } this.actionMap$[url].next(action); } - }) + }), ), { dispatch: false }); /** @@ -78,8 +78,8 @@ export class ObjectUpdatesEffects { this.notificationActionMap$[id] = new Subject(); } this.notificationActionMap$[id].next(action); - } - ) + }, + ), ), { dispatch: false }); /** @@ -117,23 +117,23 @@ export class ObjectUpdatesEffects { } // If someone performed another action, assume the user does not want to reinstate and remove all changes return removeAction; - }) + }), ), this.notificationActionMap$[notification.id].pipe( filter((notificationsAction: NotificationsActions) => notificationsAction.type === NotificationsActionTypes.REMOVE_NOTIFICATION), map(() => { return removeAction; - }) + }), ), this.notificationActionMap$[this.allIdentifier].pipe( filter((notificationsAction: NotificationsActions) => notificationsAction.type === NotificationsActionTypes.REMOVE_ALL_NOTIFICATIONS), map(() => { return removeAction; - }) - ) + }), + ), ); - } - ) + }, + ), )); constructor(private actions$: Actions, diff --git a/src/app/core/data/object-updates/object-updates.reducer.spec.ts b/src/app/core/data/object-updates/object-updates.reducer.spec.ts index 08944a073f..7b8413fb7a 100644 --- a/src/app/core/data/object-updates/object-updates.reducer.spec.ts +++ b/src/app/core/data/object-updates/object-updates.reducer.spec.ts @@ -10,7 +10,7 @@ import { RemoveObjectUpdatesAction, SelectVirtualMetadataAction, SetEditableFieldUpdateAction, - SetValidFieldUpdateAction + SetValidFieldUpdateAction, } from './object-updates.actions'; import { OBJECT_UPDATES_TRASH_PATH, objectUpdatesReducer } from './object-updates.reducer'; import { Relationship } from '../../shared/item-relationships/relationship.model'; @@ -29,26 +29,26 @@ const identifiable1 = { uuid: '8222b07e-330d-417b-8d7f-3b82aeaf2320', key: 'dc.contributor.author', language: null, - value: 'Smith, John' + value: 'Smith, John', }; const identifiable1update = { uuid: '8222b07e-330d-417b-8d7f-3b82aeaf2320', key: 'dc.contributor.author', language: null, - value: 'Smith, James' + value: 'Smith, James', }; const identifiable2 = { uuid: '26cbb5ce-5786-4e57-a394-b9fcf8eaf241', key: 'dc.title', language: null, - value: 'New title' + value: 'New title', }; const identifiable3 = { uuid: 'c5d2c2f7-d757-48bf-84cc-8c9229c8407e', key: 'dc.description.abstract', language: null, - value: 'Unchanged value' + value: 'Unchanged value', }; const relationship: Relationship = Object.assign(new Relationship(), { uuid: 'test relationship uuid' }); @@ -62,17 +62,17 @@ describe('objectUpdatesReducer', () => { [identifiable1.uuid]: { editable: true, isNew: false, - isValid: true + isValid: true, }, [identifiable2.uuid]: { editable: false, isNew: true, - isValid: true + isValid: true, }, [identifiable3.uuid]: { editable: false, isNew: false, - isValid: false + isValid: false, }, }, fieldUpdates: { @@ -81,16 +81,16 @@ describe('objectUpdatesReducer', () => { uuid: identifiable2.uuid, key: 'dc.titl', language: null, - value: 'New title' + value: 'New title', }, - changeType: FieldChangeType.ADD - } + changeType: FieldChangeType.ADD, + }, }, lastModified: modDate, virtualMetadataSources: { - [relationship.uuid]: { [identifiable1.uuid]: true } + [relationship.uuid]: { [identifiable1.uuid]: true }, }, - } + }, }; const discardedTestState = { @@ -99,22 +99,22 @@ describe('objectUpdatesReducer', () => { [identifiable1.uuid]: { editable: true, isNew: false, - isValid: true + isValid: true, }, [identifiable2.uuid]: { editable: false, isNew: true, - isValid: true + isValid: true, }, [identifiable3.uuid]: { editable: false, isNew: false, - isValid: true + isValid: true, }, }, lastModified: modDate, virtualMetadataSources: { - [relationship.uuid]: { [identifiable1.uuid]: true } + [relationship.uuid]: { [identifiable1.uuid]: true }, }, }, [url + OBJECT_UPDATES_TRASH_PATH]: { @@ -122,17 +122,17 @@ describe('objectUpdatesReducer', () => { [identifiable1.uuid]: { editable: true, isNew: false, - isValid: true + isValid: true, }, [identifiable2.uuid]: { editable: false, isNew: true, - isValid: true + isValid: true, }, [identifiable3.uuid]: { editable: false, isNew: false, - isValid: false + isValid: false, }, }, fieldUpdates: { @@ -141,16 +141,16 @@ describe('objectUpdatesReducer', () => { uuid: identifiable2.uuid, key: 'dc.titl', language: null, - value: 'New title' + value: 'New title', }, - changeType: FieldChangeType.ADD - } + changeType: FieldChangeType.ADD, + }, }, lastModified: modDate, virtualMetadataSources: { - [relationship.uuid]: { [identifiable1.uuid]: true } + [relationship.uuid]: { [identifiable1.uuid]: true }, }, - } + }, }; deepFreeze(testState); @@ -226,19 +226,19 @@ describe('objectUpdatesReducer', () => { [identifiable1.uuid]: { editable: false, isNew: false, - isValid: true + isValid: true, }, [identifiable3.uuid]: { editable: false, isNew: false, - isValid: true + isValid: true, }, }, fieldUpdates: {}, virtualMetadataSources: {}, lastModified: modDate, - patchOperationService: undefined - } + patchOperationService: undefined, + }, }; const newState = objectUpdatesReducer(testState, action); expect(newState).toEqual(expectedState); diff --git a/src/app/core/data/object-updates/object-updates.reducer.ts b/src/app/core/data/object-updates/object-updates.reducer.ts index 14bacc52db..c0bf1bc628 100644 --- a/src/app/core/data/object-updates/object-updates.reducer.ts +++ b/src/app/core/data/object-updates/object-updates.reducer.ts @@ -164,7 +164,7 @@ function initializeFieldsUpdate(state: any, action: InitializeFieldsAction) { { fieldUpdates: {} }, { virtualMetadataSources: {} }, { lastModified: lastModifiedServer }, - { patchOperationService } + { patchOperationService }, ); return Object.assign({}, state, { [url]: newPageState }); } @@ -239,7 +239,7 @@ function selectVirtualMetadata(state: any, action: SelectVirtualMetadataAction) state, { [url]: newPageState, - } + }, ); } @@ -279,7 +279,7 @@ function discardObjectUpdatesFor(url: string, state: any) { const discardedPageState = Object.assign({}, pageState, { fieldUpdates: {}, - fieldStates: newFieldStates + fieldStates: newFieldStates, }); return Object.assign({}, state, { [url]: discardedPageState }, { [url + OBJECT_UPDATES_TRASH_PATH]: pageState }); } @@ -357,7 +357,7 @@ function removeFieldUpdate(state: any, action: RemoveFieldUpdateAction) { } newPageState = Object.assign({}, state[url], { fieldUpdates: newUpdates, - fieldStates: newFieldStates + fieldStates: newFieldStates, }); } return Object.assign({}, state, { [url]: newPageState }); diff --git a/src/app/core/data/object-updates/object-updates.service.spec.ts b/src/app/core/data/object-updates/object-updates.service.spec.ts index 9cf856f03a..9b6ffb8dc3 100644 --- a/src/app/core/data/object-updates/object-updates.service.spec.ts +++ b/src/app/core/data/object-updates/object-updates.service.spec.ts @@ -6,7 +6,7 @@ import { ReinstateObjectUpdatesAction, RemoveFieldUpdateAction, SelectVirtualMetadataAction, - SetEditableFieldUpdateAction + SetEditableFieldUpdateAction, } from './object-updates.actions'; import { of as observableOf } from 'rxjs'; import { Notification } from '../../../shared/notifications/models/notification.model'; @@ -31,7 +31,7 @@ describe('ObjectUpdatesService', () => { const fieldUpdates = { [identifiable1.uuid]: { field: identifiable1Updated, changeType: FieldChangeType.UPDATE }, - [identifiable3.uuid]: { field: identifiable3, changeType: FieldChangeType.ADD } + [identifiable3.uuid]: { field: identifiable3, changeType: FieldChangeType.ADD }, }; const modDate = new Date(2010, 2, 11); @@ -46,15 +46,15 @@ describe('ObjectUpdatesService', () => { }; patchOperationService = jasmine.createSpyObj('patchOperationService', { - fieldUpdatesToPatchOperations: [] + fieldUpdatesToPatchOperations: [], }); const objectEntry = { - fieldStates, fieldUpdates, lastModified: modDate, virtualMetadataSources: {}, patchOperationService + fieldStates, fieldUpdates, lastModified: modDate, virtualMetadataSources: {}, patchOperationService, }; store = new Store(undefined, undefined, undefined); spyOn(store, 'dispatch'); injector = jasmine.createSpyObj('injector', { - get: patchOperationService + get: patchOperationService, }); service = new ObjectUpdatesService(store, injector); @@ -80,7 +80,7 @@ describe('ObjectUpdatesService', () => { const expectedResult = { [identifiable1.uuid]: { field: identifiable1Updated, changeType: FieldChangeType.UPDATE }, [identifiable2.uuid]: { field: identifiable2, changeType: undefined }, - [identifiable3.uuid]: { field: identifiable3, changeType: FieldChangeType.ADD } + [identifiable3.uuid]: { field: identifiable3, changeType: FieldChangeType.ADD }, }; result$.subscribe((result) => { @@ -96,7 +96,7 @@ describe('ObjectUpdatesService', () => { const expectedResult = { [identifiable1.uuid]: { field: identifiable1Updated, changeType: FieldChangeType.UPDATE }, - [identifiable2.uuid]: { field: identifiable2, changeType: undefined } + [identifiable2.uuid]: { field: identifiable2, changeType: undefined }, }; result$.subscribe((result) => { diff --git a/src/app/core/data/object-updates/object-updates.service.ts b/src/app/core/data/object-updates/object-updates.service.ts index 21d5adb2d4..d0a7ee12d0 100644 --- a/src/app/core/data/object-updates/object-updates.service.ts +++ b/src/app/core/data/object-updates/object-updates.service.ts @@ -6,7 +6,7 @@ import { OBJECT_UPDATES_TRASH_PATH, ObjectUpdatesEntry, ObjectUpdatesState, - VirtualMetadataSource + VirtualMetadataSource, } from './object-updates.reducer'; import { Observable } from 'rxjs'; import { @@ -17,7 +17,7 @@ import { RemoveFieldUpdateAction, SelectVirtualMetadataAction, SetEditableFieldUpdateAction, - SetValidFieldUpdateAction + SetValidFieldUpdateAction, } from './object-updates.actions'; import { distinctUntilChanged, filter, map, switchMap } from 'rxjs/operators'; import { @@ -25,7 +25,7 @@ import { hasValue, isEmpty, isNotEmpty, - hasValueOperator + hasValueOperator, } from '../../../shared/empty.util'; import { INotification } from '../../../shared/notifications/models/notification.model'; import { Operation } from 'fast-json-patch'; @@ -122,7 +122,7 @@ export class ObjectUpdatesService { fieldUpdates[uuid] = fieldUpdatesExclusive[uuid]; }); return fieldUpdates; - }) + }), ); }), ); @@ -161,7 +161,7 @@ export class ObjectUpdatesService { return fieldState$.pipe( filter((fieldState) => hasValue(fieldState)), map((fieldState) => fieldState.editable), - distinctUntilChanged() + distinctUntilChanged(), ); } @@ -175,7 +175,7 @@ export class ObjectUpdatesService { return fieldState$.pipe( filter((fieldState) => hasValue(fieldState)), map((fieldState) => fieldState.isValid), - distinctUntilChanged() + distinctUntilChanged(), ); } @@ -189,7 +189,7 @@ export class ObjectUpdatesService { map((entry: ObjectUpdatesEntry) => { return Object.values(entry.fieldStates).findIndex((state: FieldState) => !state.isValid) < 0; }), - distinctUntilChanged() + distinctUntilChanged(), ); } @@ -367,7 +367,7 @@ export class ObjectUpdatesService { patch = this.injector.get(entry.patchOperationService).fieldUpdatesToPatchOperations(entry.fieldUpdates); } return patch; - }) + }), ); } } diff --git a/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.spec.ts b/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.spec.ts index db46426b79..f44887816b 100644 --- a/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.spec.ts +++ b/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.spec.ts @@ -23,13 +23,13 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Deleted title', - place: 0 + place: 0, }), - changeType: FieldChangeType.REMOVE - } + changeType: FieldChangeType.REMOVE, + }, }); expected = [ - { op: 'remove', path: '/metadata/dc.title/0' } + { op: 'remove', path: '/metadata/dc.title/0' }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); @@ -46,13 +46,13 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Added title', - place: 0 + place: 0, }), - changeType: FieldChangeType.ADD - } + changeType: FieldChangeType.ADD, + }, }); expected = [ - { op: 'add', path: '/metadata/dc.title/-', value: [{ value: 'Added title', language: undefined }] } + { op: 'add', path: '/metadata/dc.title/-', value: [{ value: 'Added title', language: undefined }] }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); @@ -69,13 +69,13 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Changed title', - place: 0 + place: 0, }), - changeType: FieldChangeType.UPDATE - } + changeType: FieldChangeType.UPDATE, + }, }); expected = [ - { op: 'replace', path: '/metadata/dc.title/0', value: { value: 'Changed title', language: undefined } } + { op: 'replace', path: '/metadata/dc.title/0', value: { value: 'Changed title', language: undefined } }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); @@ -92,31 +92,31 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'First deleted title', - place: 0 + place: 0, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update2: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Second deleted title', - place: 1 + place: 1, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update3: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Third deleted title', - place: 2 + place: 2, }), - changeType: FieldChangeType.REMOVE - } + changeType: FieldChangeType.REMOVE, + }, }); expected = [ { op: 'remove', path: '/metadata/dc.title/0' }, { op: 'remove', path: '/metadata/dc.title/0' }, - { op: 'remove', path: '/metadata/dc.title/0' } + { op: 'remove', path: '/metadata/dc.title/0' }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); @@ -133,31 +133,31 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Third deleted title', - place: 2 + place: 2, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update2: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Second deleted title', - place: 1 + place: 1, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update3: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'First deleted title', - place: 0 + place: 0, }), - changeType: FieldChangeType.REMOVE - } + changeType: FieldChangeType.REMOVE, + }, }); expected = [ { op: 'remove', path: '/metadata/dc.title/2' }, { op: 'remove', path: '/metadata/dc.title/1' }, - { op: 'remove', path: '/metadata/dc.title/0' } + { op: 'remove', path: '/metadata/dc.title/0' }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); @@ -174,31 +174,31 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Second deleted title', - place: 1 + place: 1, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update2: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Third deleted title', - place: 2 + place: 2, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update3: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'First deleted title', - place: 0 + place: 0, }), - changeType: FieldChangeType.REMOVE - } + changeType: FieldChangeType.REMOVE, + }, }); expected = [ { op: 'remove', path: '/metadata/dc.title/1' }, { op: 'remove', path: '/metadata/dc.title/1' }, - { op: 'remove', path: '/metadata/dc.title/0' } + { op: 'remove', path: '/metadata/dc.title/0' }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); @@ -215,31 +215,31 @@ describe('MetadataPatchOperationService', () => { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Second deleted title', - place: 1 + place: 1, }), - changeType: FieldChangeType.REMOVE + changeType: FieldChangeType.REMOVE, }, update2: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'Third changed title', - place: 2 + place: 2, }), - changeType: FieldChangeType.UPDATE + changeType: FieldChangeType.UPDATE, }, update3: { field: Object.assign(new MetadatumViewModel(), { key: 'dc.title', value: 'First deleted title', - place: 0 + place: 0, }), - changeType: FieldChangeType.REMOVE - } + changeType: FieldChangeType.REMOVE, + }, }); expected = [ { op: 'remove', path: '/metadata/dc.title/1' }, { op: 'replace', path: '/metadata/dc.title/1', value: { value: 'Third changed title', language: undefined } }, - { op: 'remove', path: '/metadata/dc.title/0' } + { op: 'remove', path: '/metadata/dc.title/0' }, ] as any[]; result = service.fieldUpdatesToPatchOperations(fieldUpdates); }); diff --git a/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.ts b/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.ts index 33e9129a9d..8ef094286b 100644 --- a/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.ts +++ b/src/app/core/data/object-updates/patch-operation-service/metadata-patch-operation.service.ts @@ -15,7 +15,7 @@ import { FieldChangeType } from '../field-change-type.model'; * This expects the fields within every {@link FieldUpdate} to be {@link MetadatumViewModel}s */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class MetadataPatchOperationService implements PatchOperationService { @@ -75,7 +75,7 @@ export class MetadataPatchOperationService implements PatchOperationService { const metadatum = update.field as MetadatumViewModel; const val = { value: metadatum.value, - language: metadatum.language + language: metadatum.language, }; let operation: MetadataPatchOperation; diff --git a/src/app/core/data/paginated-list.model.ts b/src/app/core/data/paginated-list.model.ts index f1714f638f..1044186746 100644 --- a/src/app/core/data/paginated-list.model.ts +++ b/src/app/core/data/paginated-list.model.ts @@ -45,7 +45,7 @@ export const buildPaginatedList = (pageInfo: PageInfo, page: T[], normalized } result._links = Object.assign({}, _links, pageInfo._links, { - page: pageLinks + page: pageLinks, }); if (!normalized || isUndefined(pageLinks)) { diff --git a/src/app/core/data/primary-bitstream.service.spec.ts b/src/app/core/data/primary-bitstream.service.spec.ts index 00d6d7f03c..3919a80ef2 100644 --- a/src/app/core/data/primary-bitstream.service.spec.ts +++ b/src/app/core/data/primary-bitstream.service.spec.ts @@ -28,8 +28,8 @@ describe('PrimaryBitstreamService', () => { const bitstream = Object.assign(new Bitstream(), { uuid: 'fake-bitstream', _links: { - self: { href: 'fake-bitstream-self' } - } + self: { href: 'fake-bitstream-self' }, + }, }); const bundle = Object.assign(new Bundle(), { @@ -37,14 +37,14 @@ describe('PrimaryBitstreamService', () => { _links: { self: { href: 'fake-bundle-self' }, primaryBitstream: { href: 'fake-primary-bitstream-self' }, - } + }, }); const url = 'fake-bitstream-url'; beforeEach(() => { objectCache = jasmine.createSpyObj('objectCache', { - remove: jasmine.createSpy('remove') + remove: jasmine.createSpy('remove'), }); requestService = getMockRequestService(); halService = Object.assign(new HALEndpointServiceStub(url)); @@ -96,7 +96,7 @@ describe('PrimaryBitstreamService', () => { expect((service as any).createAndSendRequest).toHaveBeenCalledWith( PostRequest, bundle._links.primaryBitstream.href, - bitstream.self + bitstream.self, ); }); }); @@ -113,7 +113,7 @@ describe('PrimaryBitstreamService', () => { expect((service as any).createAndSendRequest).toHaveBeenCalledWith( PutRequest, bundle._links.primaryBitstream.href, - bitstream.self + bitstream.self, ); }); }); @@ -121,12 +121,12 @@ describe('PrimaryBitstreamService', () => { const testBundle = Object.assign(new Bundle(), { _links: { self: { - href: 'test-href' + href: 'test-href', }, primaryBitstream: { - href: 'test-primaryBitstream-href' - } - } + href: 'test-primaryBitstream-href', + }, + }, }); describe('when the delete request succeeds', () => { diff --git a/src/app/core/data/primary-bitstream.service.ts b/src/app/core/data/primary-bitstream.service.ts index 850f6de02a..727f983b41 100644 --- a/src/app/core/data/primary-bitstream.service.ts +++ b/src/app/core/data/primary-bitstream.service.ts @@ -63,7 +63,7 @@ export class PrimaryBitstreamService { requestId, endpointURL, primaryBitstreamSelfLink, - this.getHttpOptions() + this.getHttpOptions(), ); this.requestService.send(request); @@ -81,7 +81,7 @@ export class PrimaryBitstreamService { return this.createAndSendRequest( PostRequest, bundle._links.primaryBitstream.href, - primaryBitstream.self + primaryBitstream.self, ) as Observable>; } @@ -95,7 +95,7 @@ export class PrimaryBitstreamService { return this.createAndSendRequest( PutRequest, bundle._links.primaryBitstream.href, - primaryBitstream.self + primaryBitstream.self, ) as Observable>; } @@ -107,12 +107,12 @@ export class PrimaryBitstreamService { delete(bundle: Bundle): Observable> { return this.createAndSendRequest( DeleteRequest, - bundle._links.primaryBitstream.href + bundle._links.primaryBitstream.href, ).pipe( getAllCompletedRemoteData(), switchMap((rd: RemoteData) => { return this.bundleDataService.findByHref(bundle.self, rd.hasFailed); - }) + }), ); } diff --git a/src/app/core/data/processes/process-data.service.ts b/src/app/core/data/processes/process-data.service.ts index 3bf34eb650..dd039867d0 100644 --- a/src/app/core/data/processes/process-data.service.ts +++ b/src/app/core/data/processes/process-data.service.ts @@ -46,7 +46,7 @@ export class ProcessDataService extends IdentifiableDataService impleme */ getFilesEndpoint(processId: string): Observable { return this.getBrowseEndpoint().pipe( - switchMap((href) => this.halService.getEndpoint('files', `${href}/${processId}`)) + switchMap((href) => this.halService.getEndpoint('files', `${href}/${processId}`)), ); } diff --git a/src/app/core/data/processes/script-data.service.ts b/src/app/core/data/processes/script-data.service.ts index d9c92cb1d2..ca34d8f658 100644 --- a/src/app/core/data/processes/script-data.service.ts +++ b/src/app/core/data/processes/script-data.service.ts @@ -51,7 +51,7 @@ export class ScriptDataService extends IdentifiableDataService