diff --git a/src/app/admin/admin-notifications/admin-notifications-routing.module.ts b/src/app/admin/admin-notifications/admin-notifications-routing.module.ts index 63d555d7b74..ee6c02550f1 100644 --- a/src/app/admin/admin-notifications/admin-notifications-routing.module.ts +++ b/src/app/admin/admin-notifications/admin-notifications-routing.module.ts @@ -4,18 +4,16 @@ import { RouterModule } from '@angular/router'; import { AuthenticatedGuard } from '../../core/auth/authenticated.guard'; import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; +import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver'; +import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service'; import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths'; -import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component'; import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component'; -import { AdminQualityAssuranceTopicsPageResolver } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service'; import { AdminQualityAssuranceEventsPageResolver } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.resolver'; +import { SourceDataResolver } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-data.resolver'; import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component'; import { AdminQualityAssuranceSourcePageResolver } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service'; -import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver'; -import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service'; -import { - SourceDataResolver -} from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-data.resolver'; +import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component'; +import { AdminQualityAssuranceTopicsPageResolver } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service'; @NgModule({ imports: [ @@ -27,13 +25,13 @@ import { pathMatch: 'full', resolve: { breadcrumb: QualityAssuranceBreadcrumbResolver, - openaireQualityAssuranceTopicsParams: AdminQualityAssuranceTopicsPageResolver + openaireQualityAssuranceTopicsParams: AdminQualityAssuranceTopicsPageResolver, }, data: { title: 'admin.quality-assurance.page.title', breadcrumbKey: 'admin.quality-assurance', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [ AuthenticatedGuard ], @@ -43,13 +41,13 @@ import { resolve: { breadcrumb: I18nBreadcrumbResolver, openaireQualityAssuranceSourceParams: AdminQualityAssuranceSourcePageResolver, - sourceData: SourceDataResolver + sourceData: SourceDataResolver, }, data: { title: 'admin.notifications.source.breadcrumbs', breadcrumbKey: 'admin.notifications.source', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [ AuthenticatedGuard ], @@ -58,15 +56,15 @@ import { pathMatch: 'full', resolve: { breadcrumb: QualityAssuranceBreadcrumbResolver, - openaireQualityAssuranceEventsParams: AdminQualityAssuranceEventsPageResolver + openaireQualityAssuranceEventsParams: AdminQualityAssuranceEventsPageResolver, }, data: { title: 'admin.notifications.event.page.title', breadcrumbKey: 'admin.notifications.event', - showBreadcrumbsFluid: false - } - } - ]) + showBreadcrumbsFluid: false, + }, + }, + ]), ], providers: [ I18nBreadcrumbResolver, @@ -76,8 +74,8 @@ import { AdminQualityAssuranceEventsPageResolver, AdminQualityAssuranceSourcePageResolver, QualityAssuranceBreadcrumbResolver, - QualityAssuranceBreadcrumbService - ] + QualityAssuranceBreadcrumbService, + ], }) /** * Routing module for the Notifications section of the admin sidebar diff --git a/src/app/admin/admin-notifications/admin-notifications.module.ts b/src/app/admin/admin-notifications/admin-notifications.module.ts index 84475a1623e..5712cda7742 100644 --- a/src/app/admin/admin-notifications/admin-notifications.module.ts +++ b/src/app/admin/admin-notifications/admin-notifications.module.ts @@ -1,12 +1,13 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; + import { CoreModule } from '../../core/core.module'; +import { NotificationsModule } from '../../notifications/notifications.module'; import { SharedModule } from '../../shared/shared.module'; import { AdminNotificationsRoutingModule } from './admin-notifications-routing.module'; -import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component'; import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component'; import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component'; -import {NotificationsModule} from '../../notifications/notifications.module'; +import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component'; @NgModule({ imports: [ @@ -14,14 +15,14 @@ import {NotificationsModule} from '../../notifications/notifications.module'; SharedModule, CoreModule.forRoot(), AdminNotificationsRoutingModule, - NotificationsModule + NotificationsModule, ], declarations: [ AdminQualityAssuranceTopicsPageComponent, AdminQualityAssuranceEventsPageComponent, - AdminQualityAssuranceSourcePageComponent + AdminQualityAssuranceSourcePageComponent, ], - entryComponents: [] + entryComponents: [], }) /** * This module handles all components related to the notifications pages diff --git a/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.spec.ts b/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.spec.ts index b9520782154..31ced46a2fa 100644 --- a/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.spec.ts +++ b/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.spec.ts @@ -1,5 +1,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { + async, + ComponentFixture, + TestBed, +} from '@angular/core/testing'; + import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page.component'; describe('AdminQualityAssuranceEventsPageComponent', () => { @@ -9,9 +14,9 @@ describe('AdminQualityAssuranceEventsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AdminQualityAssuranceEventsPageComponent ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.ts b/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.ts index bd3470f3012..cc7cce6de4f 100644 --- a/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.ts +++ b/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.component.ts @@ -5,7 +5,7 @@ import { Component } from '@angular/core'; */ @Component({ selector: 'ds-quality-assurance-events-page', - templateUrl: './admin-quality-assurance-events-page.component.html' + templateUrl: './admin-quality-assurance-events-page.component.html', }) export class AdminQualityAssuranceEventsPageComponent { diff --git a/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.resolver.ts b/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.resolver.ts index 3139355629f..f0853ecfd15 100644 --- a/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.resolver.ts +++ b/src/app/admin/admin-notifications/admin-quality-assurance-events-page/admin-quality-assurance-events-page.resolver.ts @@ -1,5 +1,9 @@ import { Injectable } from '@angular/core'; -import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; +import { + ActivatedRouteSnapshot, + Resolve, + RouterStateSnapshot, +} from '@angular/router'; /** * Interface for the route parameters. @@ -26,7 +30,7 @@ export class AdminQualityAssuranceEventsPageResolver implements Resolve { return this.qualityAssuranceSourceService.getSources(this.pageSize, 0).pipe( - map((sources: PaginatedList) => { - if (sources.page.length === 1) { - this.router.navigate([this.getResolvedUrl(route) + '/' + sources.page[0].id]); - } - return sources.page; - })); + map((sources: PaginatedList) => { + if (sources.page.length === 1) { + this.router.navigate([this.getResolvedUrl(route) + '/' + sources.page[0].id]); + } + return sources.page; + })); } /** diff --git a/src/app/admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service.ts b/src/app/admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service.ts index ac9bdb48d66..c218022718a 100644 --- a/src/app/admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service.ts +++ b/src/app/admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service.ts @@ -1,5 +1,9 @@ import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; +import { + ActivatedRouteSnapshot, + Resolve, + RouterStateSnapshot, +} from '@angular/router'; /** * Interface for the route parameters. @@ -26,7 +30,7 @@ export class AdminQualityAssuranceSourcePageResolver implements Resolve { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [ AdminQualityAssuranceSourcePageComponent ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service.ts b/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service.ts index 47500d18783..0c8f23c61de 100644 --- a/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service.ts +++ b/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service.ts @@ -1,5 +1,9 @@ import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; +import { + ActivatedRouteSnapshot, + Resolve, + RouterStateSnapshot, +} from '@angular/router'; /** * Interface for the route parameters. @@ -26,7 +30,7 @@ export class AdminQualityAssuranceTopicsPageResolver implements Resolve { @@ -9,9 +14,9 @@ describe('AdminQualityAssuranceTopicsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AdminQualityAssuranceTopicsPageComponent ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component.ts b/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component.ts index f17d3448d5b..4b23f38789e 100644 --- a/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component.ts +++ b/src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component.ts @@ -5,7 +5,7 @@ import { Component } from '@angular/core'; */ @Component({ selector: 'ds-notification-qa-page', - templateUrl: './admin-quality-assurance-topics-page.component.html' + templateUrl: './admin-quality-assurance-topics-page.component.html', }) export class AdminQualityAssuranceTopicsPageComponent { diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts index c052c75b4a6..5868da1ccde 100644 --- a/src/app/admin/admin-routing.module.ts +++ b/src/app/admin/admin-routing.module.ts @@ -7,8 +7,8 @@ import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curati import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component'; import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component'; import { + NOTIFICATIONS_MODULE_PATH, REGISTRIES_MODULE_PATH, - NOTIFICATIONS_MODULE_PATH } from './admin-routing-paths'; import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component'; import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component'; diff --git a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.spec.ts b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.spec.ts index 3544af62e7a..ea6045c85ee 100644 --- a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.spec.ts +++ b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.spec.ts @@ -1,4 +1,4 @@ -import {QualityAssuranceBreadcrumbResolver} from './quality-assurance-breadcrumb.resolver'; +import { QualityAssuranceBreadcrumbResolver } from './quality-assurance-breadcrumb.resolver'; describe('QualityAssuranceBreadcrumbResolver', () => { describe('resolve', () => { @@ -15,15 +15,15 @@ describe('QualityAssuranceBreadcrumbResolver', () => { return this[param]; }, sourceId: 'testSourceId', - topicId: 'testTopicId' - } + topicId: 'testTopicId', + }, }; qualityAssuranceBreadcrumbService = {}; resolver = new QualityAssuranceBreadcrumbResolver(qualityAssuranceBreadcrumbService); }); it('should resolve the breadcrumb config', () => { - const resolvedConfig = resolver.resolve(route as any, {url: fullPath + 'testSourceId'} as any); + const resolvedConfig = resolver.resolve(route as any, { url: fullPath + 'testSourceId' } as any); const expectedConfig = { provider: qualityAssuranceBreadcrumbService, key: expectedKey, url: fullPath }; expect(resolvedConfig).toEqual(expectedConfig); }); diff --git a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.ts index 6eb351ab1ab..832cd5d08ca 100644 --- a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.resolver.ts @@ -1,10 +1,15 @@ import { Injectable } from '@angular/core'; -import {QualityAssuranceBreadcrumbService} from './quality-assurance-breadcrumb.service'; -import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; -import {BreadcrumbConfig} from '../../breadcrumbs/breadcrumb/breadcrumb-config.model'; +import { + ActivatedRouteSnapshot, + Resolve, + RouterStateSnapshot, +} from '@angular/router'; + +import { BreadcrumbConfig } from '../../breadcrumbs/breadcrumb/breadcrumb-config.model'; +import { QualityAssuranceBreadcrumbService } from './quality-assurance-breadcrumb.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class QualityAssuranceBreadcrumbResolver implements Resolve> { constructor(protected breadcrumbService: QualityAssuranceBreadcrumbService) {} diff --git a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.spec.ts b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.spec.ts index 4fef7672147..86ee3565dc9 100644 --- a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.spec.ts +++ b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.spec.ts @@ -1,7 +1,11 @@ -import { TestBed, waitForAsync } from '@angular/core/testing'; -import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { getTestScheduler } from 'jasmine-marbles'; -import {QualityAssuranceBreadcrumbService} from './quality-assurance-breadcrumb.service'; + +import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; +import { QualityAssuranceBreadcrumbService } from './quality-assurance-breadcrumb.service'; describe('QualityAssuranceBreadcrumbService', () => { let service: QualityAssuranceBreadcrumbService; @@ -33,7 +37,7 @@ describe('QualityAssuranceBreadcrumbService', () => { it('should return a breadcrumb based on a string', () => { const breadcrumbs = service.getBreadcrumbs(exampleString, exampleURL); getTestScheduler().expectObservable(breadcrumbs).toBe('(a|)', { a: [new Breadcrumb(exampleQaKey, exampleURL), - new Breadcrumb(exampleString, exampleURL + exampleString)] + new Breadcrumb(exampleString, exampleURL + exampleString)], }); }); }); diff --git a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.ts b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.ts index 209ae0722ce..a7cbaeee53c 100644 --- a/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.ts +++ b/src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.ts @@ -1,11 +1,15 @@ -import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; -import { BreadcrumbsProviderService } from './breadcrumbsProviderService'; -import { Observable, of as observableOf } from 'rxjs'; import { Injectable } from '@angular/core'; -import { map } from 'rxjs/operators'; -import { getFirstCompletedRemoteData } from '../shared/operators'; import { TranslateService } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; import { QualityAssuranceTopicDataService } from '../notifications/qa/topics/quality-assurance-topic-data.service'; +import { getFirstCompletedRemoteData } from '../shared/operators'; +import { BreadcrumbsProviderService } from './breadcrumbsProviderService'; @@ -13,7 +17,7 @@ import { QualityAssuranceTopicDataService } from '../notifications/qa/topics/qua * Service to calculate QA breadcrumbs for a single part of the route */ @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class QualityAssuranceBreadcrumbService implements BreadcrumbsProviderService { @@ -39,10 +43,10 @@ export class QualityAssuranceBreadcrumbService implements BreadcrumbsProviderSer return this.qualityAssuranceService.getTopic(topicId).pipe( getFirstCompletedRemoteData(), map((topic) => { - return [new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url), - new Breadcrumb(sourceId, `${url}${sourceId}`), - new Breadcrumb(topicId, undefined)]; - }) + return [new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url), + new Breadcrumb(sourceId, `${url}${sourceId}`), + new Breadcrumb(topicId, undefined)]; + }), ); } else { return observableOf([new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url), diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 6b3389f83b5..9bcc6abb1de 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -1,8 +1,17 @@ import { CommonModule } from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core'; +import { + ModuleWithProviders, + NgModule, + Optional, + SkipSelf, +} from '@angular/core'; import { EffectsModule } from '@ngrx/effects'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; import { environment } from '../../environments/environment'; import { storeModuleConfig } from '../app.reducer'; @@ -14,7 +23,11 @@ import { isNotEmpty } from '../shared/empty.util'; import { HostWindowService } from '../shared/host-window.service'; import { MenuService } from '../shared/menu/menu.service'; import { EndpointMockingRestService } from '../shared/mocks/dspace-rest/endpoint-mocking-rest.service'; -import { MOCK_RESPONSE_MAP, mockResponseMap, ResponseMapMock } from '../shared/mocks/dspace-rest/mocks/response-map.mock'; +import { + MOCK_RESPONSE_MAP, + mockResponseMap, + ResponseMapMock, +} from '../shared/mocks/dspace-rest/mocks/response-map.mock'; import { NotificationsService } from '../shared/notifications/notifications.service'; import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model'; import { IdentifierData } from '../shared/object-list/identifier-data/identifier-data.model'; @@ -94,6 +107,9 @@ import { JsonPatchOperationsBuilder } from './json-patch/builder/json-patch-oper import { MetadataService } from './metadata/metadata.service'; import { MetadataField } from './metadata/metadata-field.model'; import { MetadataSchema } from './metadata/metadata-schema.model'; +import { QualityAssuranceEventObject } from './notifications/qa/models/quality-assurance-event.model'; +import { QualityAssuranceSourceObject } from './notifications/qa/models/quality-assurance-source.model'; +import { QualityAssuranceTopicObject } from './notifications/qa/models/quality-assurance-topic.model'; import { OrcidHistory } from './orcid/model/orcid-history.model'; import { OrcidQueue } from './orcid/model/orcid-queue.model'; import { OrcidAuthService } from './orcid/orcid-auth.service'; @@ -108,7 +124,10 @@ import { ResourcePolicyDataService } from './resource-policy/resource-policy-dat import { RoleService } from './roles/role.service'; import { LinkHeadService } from './services/link-head.service'; import { ServerResponseService } from './services/server-response.service'; -import { NativeWindowFactory, NativeWindowService } from './services/window.service'; +import { + NativeWindowFactory, + NativeWindowService, +} from './services/window.service'; import { Authorization } from './shared/authorization.model'; import { Bitstream } from './shared/bitstream.model'; import { BitstreamFormat } from './shared/bitstream-format.model'; @@ -173,9 +192,6 @@ import { TaskObject } from './tasks/models/task-object.model'; import { WorkflowAction } from './tasks/models/workflow-action-object.model'; import { PoolTaskDataService } from './tasks/pool-task-data.service'; import { TaskResponseParsingService } from './tasks/task-response-parsing.service'; -import { QualityAssuranceTopicObject } from './notifications/qa/models/quality-assurance-topic.model'; -import { QualityAssuranceEventObject } from './notifications/qa/models/quality-assurance-event.model'; -import { QualityAssuranceSourceObject } from './notifications/qa/models/quality-assurance-source.model'; /** * When not in production, endpoint responses can be mocked for testing purposes diff --git a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts index 50d0e43a99c..14edc329655 100644 --- a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts +++ b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.spec.ts @@ -1,27 +1,29 @@ import { HttpClient } from '@angular/common/http'; - -import { TestScheduler } from 'rxjs/testing'; +import { ReplaceOperation } from 'fast-json-patch'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { cold, getTestScheduler } from 'jasmine-marbles'; +import { TestScheduler } from 'rxjs/testing'; -import { RequestService } from '../../../data/request.service'; -import { buildPaginatedList } from '../../../data/paginated-list.model'; -import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; -import { ObjectCacheService } from '../../../cache/object-cache.service'; -import { RestResponse } from '../../../cache/response.models'; -import { PageInfo } from '../../../shared/page-info.model'; -import { HALEndpointService } from '../../../shared/hal-endpoint.service'; -import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { createSuccessfulRemoteDataObject } from '../../../../shared/remote-data.utils'; -import { QualityAssuranceEventDataService } from './quality-assurance-event-data.service'; import { qualityAssuranceEventObjectMissingPid, qualityAssuranceEventObjectMissingPid2, - qualityAssuranceEventObjectMissingProjectFound + qualityAssuranceEventObjectMissingProjectFound, } from '../../../../shared/mocks/notifications.mock'; -import { ReplaceOperation } from 'fast-json-patch'; -import { RequestEntry } from '../../../data/request-entry.model'; +import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { createSuccessfulRemoteDataObject } from '../../../../shared/remote-data.utils'; +import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; +import { ObjectCacheService } from '../../../cache/object-cache.service'; +import { RestResponse } from '../../../cache/response.models'; import { FindListOptions } from '../../../data/find-list-options.model'; +import { buildPaginatedList } from '../../../data/paginated-list.model'; +import { RequestService } from '../../../data/request.service'; +import { RequestEntry } from '../../../data/request-entry.model'; +import { HALEndpointService } from '../../../shared/hal-endpoint.service'; +import { PageInfo } from '../../../shared/page-info.model'; +import { QualityAssuranceEventDataService } from './quality-assurance-event-data.service'; describe('QualityAssuranceEventDataService', () => { let scheduler: TestScheduler; @@ -54,8 +56,8 @@ describe('QualityAssuranceEventDataService', () => { { path: '/status', op: 'replace', - value: status - } + value: status, + }, ]; beforeEach(() => { @@ -69,7 +71,7 @@ describe('QualityAssuranceEventDataService', () => { send: true, removeByHrefSubstring: {}, getByHref: jasmine.createSpy('getByHref'), - getByUUID: jasmine.createSpy('getByUUID') + getByUUID: jasmine.createSpy('getByUUID'), }); responseCacheEntryB = new RequestEntry(); @@ -82,18 +84,18 @@ describe('QualityAssuranceEventDataService', () => { rdbService = jasmine.createSpyObj('rdbService', { buildSingle: cold('(a)', { - a: qaEventObjectRD + a: qaEventObjectRD, }), buildList: cold('(a)', { - a: paginatedListRD + a: paginatedListRD, }), buildFromRequestUUID: jasmine.createSpy('buildFromRequestUUID'), - buildFromRequestUUIDAndAwait: jasmine.createSpy('buildFromRequestUUIDAndAwait') + buildFromRequestUUIDAndAwait: jasmine.createSpy('buildFromRequestUUIDAndAwait'), }); objectCache = {} as ObjectCacheService; halService = jasmine.createSpyObj('halService', { - getEndpoint: cold('a|', { a: endpointURL }) + getEndpoint: cold('a|', { a: endpointURL }), }); notificationsService = {} as NotificationsService; @@ -106,7 +108,7 @@ describe('QualityAssuranceEventDataService', () => { objectCache, halService, notificationsService, - comparator + comparator, ); serviceASAny = service; @@ -130,9 +132,9 @@ describe('QualityAssuranceEventDataService', () => { searchParams: [ { fieldName: 'topic', - fieldValue: topic - } - ] + fieldValue: topic, + }, + ], }; service.getEventsByTopic(topic); expect(serviceASAny.searchData.searchBy).toHaveBeenCalledWith('findByTopic', options, true, true); @@ -141,7 +143,7 @@ describe('QualityAssuranceEventDataService', () => { it('should return a RemoteData> for the object with the given Topic', () => { const result = service.getEventsByTopic(topic); const expected = cold('(a)', { - a: paginatedListRD + a: paginatedListRD, }); expect(result).toBeObservable(expected); }); @@ -158,14 +160,14 @@ describe('QualityAssuranceEventDataService', () => { service.getEvent(qualityAssuranceEventObjectMissingPid.id).subscribe( (res) => { expect(serviceASAny.findById).toHaveBeenCalledWith(qualityAssuranceEventObjectMissingPid.id, true, true); - } + }, ); }); it('should return a RemoteData for the object with the given URL', () => { const result = service.getEvent(qualityAssuranceEventObjectMissingPid.id); const expected = cold('(a)', { - a: qaEventObjectRD + a: qaEventObjectRD, }); expect(result).toBeObservable(expected); }); @@ -183,14 +185,14 @@ describe('QualityAssuranceEventDataService', () => { service.patchEvent(status, qualityAssuranceEventObjectMissingPid).subscribe( (res) => { expect(serviceASAny.patchData.patch).toHaveBeenCalledWith(qualityAssuranceEventObjectMissingPid, operation); - } + }, ); }); it('should return a RemoteData with HTTP 200', () => { const result = service.patchEvent(status, qualityAssuranceEventObjectMissingPid); const expected = cold('(a|)', { - a: createSuccessfulRemoteDataObject(qualityAssuranceEventObjectMissingPid) + a: createSuccessfulRemoteDataObject(qualityAssuranceEventObjectMissingPid), }); expect(result).toBeObservable(expected); }); @@ -207,14 +209,14 @@ describe('QualityAssuranceEventDataService', () => { service.boundProject(qualityAssuranceEventObjectMissingProjectFound.id, requestUUID).subscribe( (res) => { expect(serviceASAny.postOnRelated).toHaveBeenCalledWith(qualityAssuranceEventObjectMissingProjectFound.id, requestUUID); - } + }, ); }); it('should return a RestResponse with HTTP 201', () => { const result = service.boundProject(qualityAssuranceEventObjectMissingProjectFound.id, requestUUID); const expected = cold('(a|)', { - a: createSuccessfulRemoteDataObject(qualityAssuranceEventObjectMissingProjectFound) + a: createSuccessfulRemoteDataObject(qualityAssuranceEventObjectMissingProjectFound), }); expect(result).toBeObservable(expected); }); @@ -231,14 +233,14 @@ describe('QualityAssuranceEventDataService', () => { service.removeProject(qualityAssuranceEventObjectMissingProjectFound.id).subscribe( (res) => { expect(serviceASAny.deleteOnRelated).toHaveBeenCalledWith(qualityAssuranceEventObjectMissingProjectFound.id); - } + }, ); }); it('should return a RestResponse with HTTP 204', () => { const result = service.removeProject(qualityAssuranceEventObjectMissingProjectFound.id); const expected = cold('(a|)', { - a: createSuccessfulRemoteDataObject({}) + a: createSuccessfulRemoteDataObject({}), }); expect(result).toBeObservable(expected); }); diff --git a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts index 7f7e68afaab..20a93cdbf67 100644 --- a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts +++ b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts @@ -1,30 +1,47 @@ import { Injectable } from '@angular/core'; - -import { Observable } from 'rxjs'; -import { find, take } from 'rxjs/operators'; import { ReplaceOperation } from 'fast-json-patch'; +import { Observable } from 'rxjs'; +import { + find, + take, +} from 'rxjs/operators'; -import { HALEndpointService } from '../../../shared/hal-endpoint.service'; +import { hasValue } from '../../../../shared/empty.util'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../cache/object-cache.service'; +import { + CreateData, + CreateDataImpl, +} from '../../../data/base/create-data'; import { dataService } from '../../../data/base/data-service.decorator'; -import { RequestService } from '../../../data/request.service'; +import { + DeleteData, + DeleteDataImpl, +} from '../../../data/base/delete-data'; +import { IdentifiableDataService } from '../../../data/base/identifiable-data.service'; +import { + PatchData, + PatchDataImpl, +} from '../../../data/base/patch-data'; +import { + SearchData, + SearchDataImpl, +} from '../../../data/base/search-data'; +import { DefaultChangeAnalyzer } from '../../../data/default-change-analyzer.service'; +import { FindListOptions } from '../../../data/find-list-options.model'; +import { PaginatedList } from '../../../data/paginated-list.model'; import { RemoteData } from '../../../data/remote-data'; +import { + DeleteByIDRequest, + PostRequest, +} from '../../../data/request.models'; +import { RequestService } from '../../../data/request.service'; +import { HALEndpointService } from '../../../shared/hal-endpoint.service'; +import { NoContent } from '../../../shared/NoContent.model'; import { QualityAssuranceEventObject } from '../models/quality-assurance-event.model'; import { QUALITY_ASSURANCE_EVENT_OBJECT } from '../models/quality-assurance-event-object.resource-type'; -import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; -import { PaginatedList } from '../../../data/paginated-list.model'; -import { NoContent } from '../../../shared/NoContent.model'; -import { FindListOptions } from '../../../data/find-list-options.model'; -import { IdentifiableDataService } from '../../../data/base/identifiable-data.service'; -import { CreateData, CreateDataImpl } from '../../../data/base/create-data'; -import { PatchData, PatchDataImpl } from '../../../data/base/patch-data'; -import { DeleteData, DeleteDataImpl } from '../../../data/base/delete-data'; -import { SearchData, SearchDataImpl } from '../../../data/base/search-data'; -import { DefaultChangeAnalyzer } from '../../../data/default-change-analyzer.service'; -import { hasValue } from '../../../../shared/empty.util'; -import { DeleteByIDRequest, PostRequest } from '../../../data/request.models'; /** * The service handling all Quality Assurance topic REST requests. @@ -53,7 +70,7 @@ export class QualityAssuranceEventDataService extends IdentifiableDataService + protected comparator: DefaultChangeAnalyzer, ) { super('qualityassuranceevents', requestService, rdbService, objectCache, halService); this.createData = new CreateDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, notificationsService, this.responseMsToLive); @@ -78,8 +95,8 @@ export class QualityAssuranceEventDataService extends IdentifiableDataService { const request = new PostRequest(requestId, href + '/related?item=' + relatedItemId, body); if (hasValue(this.responseMsToLive)) { diff --git a/src/app/core/notifications/qa/models/quality-assurance-event.model.ts b/src/app/core/notifications/qa/models/quality-assurance-event.model.ts index 0cdb4a57456..7ca22acac8e 100644 --- a/src/app/core/notifications/qa/models/quality-assurance-event.model.ts +++ b/src/app/core/notifications/qa/models/quality-assurance-event.model.ts @@ -1,15 +1,23 @@ /* eslint-disable max-classes-per-file */ +import { + autoserialize, + autoserializeAs, + deserialize, +} from 'cerialize'; import { Observable } from 'rxjs'; -import { autoserialize, autoserializeAs, deserialize } from 'cerialize'; -import { QUALITY_ASSURANCE_EVENT_OBJECT } from './quality-assurance-event-object.resource-type'; -import { excludeFromEquals } from '../../../utilities/equals.decorators'; -import { ResourceType } from '../../../shared/resource-type'; + +import { + link, + typedObject, +} from '../../../cache/builders/build-decorators'; +import { CacheableObject } from '../../../cache/cacheable-object.model'; +import { RemoteData } from '../../../data/remote-data'; import { HALLink } from '../../../shared/hal-link.model'; import { Item } from '../../../shared/item.model'; import { ITEM } from '../../../shared/item.resource-type'; -import { link, typedObject } from '../../../cache/builders/build-decorators'; -import { RemoteData } from '../../../data/remote-data'; -import {CacheableObject} from '../../../cache/cacheable-object.model'; +import { ResourceType } from '../../../shared/resource-type'; +import { excludeFromEquals } from '../../../utilities/equals.decorators'; +import { QUALITY_ASSURANCE_EVENT_OBJECT } from './quality-assurance-event-object.resource-type'; /** * The interface representing the Quality Assurance event message @@ -94,62 +102,62 @@ export class QualityAssuranceEventObject implements CacheableObject { * The Quality Assurance event uuid inside DSpace */ @autoserialize - id: string; + id: string; /** * The universally unique identifier of this Quality Assurance event */ @autoserializeAs(String, 'id') - uuid: string; + uuid: string; /** * The Quality Assurance event original id (ex.: the source archive OAI-PMH identifier) */ @autoserialize - originalId: string; + originalId: string; /** * The title of the article to which the suggestion refers */ @autoserialize - title: string; + title: string; /** * Reliability of the suggestion (of the data inside 'message') */ @autoserialize - trust: number; + trust: number; /** * The timestamp Quality Assurance event was saved in DSpace */ @autoserialize - eventDate: string; + eventDate: string; /** * The Quality Assurance event status (ACCEPTED, REJECTED, DISCARDED, PENDING) */ @autoserialize - status: string; + status: string; /** * The suggestion data. Data may vary depending on the source */ @autoserialize - message: SourceQualityAssuranceEventMessageObject; + message: SourceQualityAssuranceEventMessageObject; /** * The type of this ConfigObject */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The links to all related resources returned by the rest api. */ @deserialize - _links: { + _links: { self: HALLink, target: HALLink, related: HALLink @@ -160,12 +168,12 @@ export class QualityAssuranceEventObject implements CacheableObject { * Will be undefined unless the {@item HALLink} has been resolved. */ @link(ITEM) - target?: Observable>; + target?: Observable>; /** * The related project for this Event * Will be undefined unless the {@related HALLink} has been resolved. */ @link(ITEM) - related?: Observable>; + related?: Observable>; } diff --git a/src/app/core/notifications/qa/models/quality-assurance-source.model.ts b/src/app/core/notifications/qa/models/quality-assurance-source.model.ts index f59467384ff..cc5f874119c 100644 --- a/src/app/core/notifications/qa/models/quality-assurance-source.model.ts +++ b/src/app/core/notifications/qa/models/quality-assurance-source.model.ts @@ -1,11 +1,14 @@ -import { autoserialize, deserialize } from 'cerialize'; +import { + autoserialize, + deserialize, +} from 'cerialize'; -import { excludeFromEquals } from '../../../utilities/equals.decorators'; -import { ResourceType } from '../../../shared/resource-type'; -import { HALLink } from '../../../shared/hal-link.model'; import { typedObject } from '../../../cache/builders/build-decorators'; +import { CacheableObject } from '../../../cache/cacheable-object.model'; +import { HALLink } from '../../../shared/hal-link.model'; +import { ResourceType } from '../../../shared/resource-type'; +import { excludeFromEquals } from '../../../utilities/equals.decorators'; import { QUALITY_ASSURANCE_SOURCE_OBJECT } from './quality-assurance-source-object.resource-type'; -import {CacheableObject} from '../../../cache/cacheable-object.model'; /** * The interface representing the Quality Assurance source model @@ -21,32 +24,32 @@ export class QualityAssuranceSourceObject implements CacheableObject { * The Quality Assurance source id */ @autoserialize - id: string; + id: string; /** * The date of the last udate from Notifications */ @autoserialize - lastEvent: string; + lastEvent: string; /** * The total number of suggestions provided by Notifications for this source */ @autoserialize - totalEvents: number; + totalEvents: number; /** * The type of this ConfigObject */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The links to all related resources returned by the rest api. */ @deserialize - _links: { + _links: { self: HALLink, }; } diff --git a/src/app/core/notifications/qa/models/quality-assurance-topic.model.ts b/src/app/core/notifications/qa/models/quality-assurance-topic.model.ts index 529980e5f7c..ddc027d1942 100644 --- a/src/app/core/notifications/qa/models/quality-assurance-topic.model.ts +++ b/src/app/core/notifications/qa/models/quality-assurance-topic.model.ts @@ -1,11 +1,14 @@ -import { autoserialize, deserialize } from 'cerialize'; +import { + autoserialize, + deserialize, +} from 'cerialize'; -import { QUALITY_ASSURANCE_TOPIC_OBJECT } from './quality-assurance-topic-object.resource-type'; -import { excludeFromEquals } from '../../../utilities/equals.decorators'; -import { ResourceType } from '../../../shared/resource-type'; -import { HALLink } from '../../../shared/hal-link.model'; import { typedObject } from '../../../cache/builders/build-decorators'; -import {CacheableObject} from '../../../cache/cacheable-object.model'; +import { CacheableObject } from '../../../cache/cacheable-object.model'; +import { HALLink } from '../../../shared/hal-link.model'; +import { ResourceType } from '../../../shared/resource-type'; +import { excludeFromEquals } from '../../../utilities/equals.decorators'; +import { QUALITY_ASSURANCE_TOPIC_OBJECT } from './quality-assurance-topic-object.resource-type'; /** * The interface representing the Quality Assurance topic model @@ -21,38 +24,38 @@ export class QualityAssuranceTopicObject implements CacheableObject { * The Quality Assurance topic id */ @autoserialize - id: string; + id: string; /** * The Quality Assurance topic name to display */ @autoserialize - name: string; + name: string; /** * The date of the last udate from Notifications */ @autoserialize - lastEvent: string; + lastEvent: string; /** * The total number of suggestions provided by Notifications for this topic */ @autoserialize - totalEvents: number; + totalEvents: number; /** * The type of this ConfigObject */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The links to all related resources returned by the rest api. */ @deserialize - _links: { + _links: { self: HALLink, }; } diff --git a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts index 50d9251bb88..6f158627ed2 100644 --- a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts +++ b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.spec.ts @@ -1,23 +1,25 @@ import { HttpClient } from '@angular/common/http'; - -import { TestScheduler } from 'rxjs/testing'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { cold, getTestScheduler } from 'jasmine-marbles'; +import { TestScheduler } from 'rxjs/testing'; -import { RequestService } from '../../../data/request.service'; -import { buildPaginatedList } from '../../../data/paginated-list.model'; -import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; -import { ObjectCacheService } from '../../../cache/object-cache.service'; -import { RestResponse } from '../../../cache/response.models'; -import { PageInfo } from '../../../shared/page-info.model'; -import { HALEndpointService } from '../../../shared/hal-endpoint.service'; -import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { createSuccessfulRemoteDataObject } from '../../../../shared/remote-data.utils'; import { qualityAssuranceSourceObjectMoreAbstract, - qualityAssuranceSourceObjectMorePid + qualityAssuranceSourceObjectMorePid, } from '../../../../shared/mocks/notifications.mock'; +import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { createSuccessfulRemoteDataObject } from '../../../../shared/remote-data.utils'; +import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; +import { ObjectCacheService } from '../../../cache/object-cache.service'; +import { RestResponse } from '../../../cache/response.models'; +import { buildPaginatedList } from '../../../data/paginated-list.model'; +import { RequestService } from '../../../data/request.service'; import { RequestEntry } from '../../../data/request-entry.model'; +import { HALEndpointService } from '../../../shared/hal-endpoint.service'; +import { PageInfo } from '../../../shared/page-info.model'; import { QualityAssuranceSourceDataService } from './quality-assurance-source-data.service'; describe('QualityAssuranceSourceDataService', () => { @@ -56,16 +58,16 @@ describe('QualityAssuranceSourceDataService', () => { rdbService = jasmine.createSpyObj('rdbService', { buildSingle: cold('(a)', { - a: qaSourceObjectRD + a: qaSourceObjectRD, }), buildList: cold('(a)', { - a: paginatedListRD + a: paginatedListRD, }), }); objectCache = {} as ObjectCacheService; halService = jasmine.createSpyObj('halService', { - getEndpoint: cold('a|', { a: endpointURL }) + getEndpoint: cold('a|', { a: endpointURL }), }); notificationsService = {} as NotificationsService; @@ -77,7 +79,7 @@ describe('QualityAssuranceSourceDataService', () => { rdbService, objectCache, halService, - notificationsService + notificationsService, ); spyOn((service as any).findAllData, 'findAll').and.callThrough(); @@ -89,7 +91,7 @@ describe('QualityAssuranceSourceDataService', () => { service.getSources().subscribe( (res) => { expect((service as any).findAllData.findAll).toHaveBeenCalledWith({}, true, true); - } + }, ); done(); }); @@ -97,7 +99,7 @@ describe('QualityAssuranceSourceDataService', () => { it('should return a RemoteData> for the object with the given URL', () => { const result = service.getSources(); const expected = cold('(a)', { - a: paginatedListRD + a: paginatedListRD, }); expect(result).toBeObservable(expected); }); @@ -108,7 +110,7 @@ describe('QualityAssuranceSourceDataService', () => { service.getSource(qualityAssuranceSourceObjectMorePid.id).subscribe( (res) => { expect((service as any).findById).toHaveBeenCalledWith(qualityAssuranceSourceObjectMorePid.id, true, true); - } + }, ); done(); }); @@ -116,7 +118,7 @@ describe('QualityAssuranceSourceDataService', () => { it('should return a RemoteData for the object with the given URL', () => { const result = service.getSource(qualityAssuranceSourceObjectMorePid.id); const expected = cold('(a)', { - a: qaSourceObjectRD + a: qaSourceObjectRD, }); expect(result).toBeObservable(expected); }); diff --git a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts index 03a5da2e8c4..e182b8bcc8e 100644 --- a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts +++ b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts @@ -1,21 +1,23 @@ import { Injectable } from '@angular/core'; - import { Observable } from 'rxjs'; -import { HALEndpointService } from '../../../shared/hal-endpoint.service'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../cache/object-cache.service'; import { dataService } from '../../../data/base/data-service.decorator'; -import { RequestService } from '../../../data/request.service'; +import { + FindAllData, + FindAllDataImpl, +} from '../../../data/base/find-all-data'; +import { IdentifiableDataService } from '../../../data/base/identifiable-data.service'; +import { FindListOptions } from '../../../data/find-list-options.model'; +import { PaginatedList } from '../../../data/paginated-list.model'; import { RemoteData } from '../../../data/remote-data'; +import { RequestService } from '../../../data/request.service'; +import { HALEndpointService } from '../../../shared/hal-endpoint.service'; import { QualityAssuranceSourceObject } from '../models/quality-assurance-source.model'; import { QUALITY_ASSURANCE_SOURCE_OBJECT } from '../models/quality-assurance-source-object.resource-type'; -import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; -import { PaginatedList } from '../../../data/paginated-list.model'; -import { FindListOptions } from '../../../data/find-list-options.model'; -import { IdentifiableDataService } from '../../../data/base/identifiable-data.service'; -import { FindAllData, FindAllDataImpl } from '../../../data/base/find-all-data'; /** * The service handling all Quality Assurance source REST requests. @@ -39,7 +41,7 @@ export class QualityAssuranceSourceDataService extends IdentifiableDataService { let scheduler: TestScheduler; @@ -56,16 +58,16 @@ describe('QualityAssuranceTopicDataService', () => { rdbService = jasmine.createSpyObj('rdbService', { buildSingle: cold('(a)', { - a: qaTopicObjectRD + a: qaTopicObjectRD, }), buildList: cold('(a)', { - a: paginatedListRD + a: paginatedListRD, }), }); objectCache = {} as ObjectCacheService; halService = jasmine.createSpyObj('halService', { - getEndpoint: cold('a|', { a: endpointURL }) + getEndpoint: cold('a|', { a: endpointURL }), }); notificationsService = {} as NotificationsService; @@ -77,7 +79,7 @@ describe('QualityAssuranceTopicDataService', () => { rdbService, objectCache, halService, - notificationsService + notificationsService, ); spyOn((service as any).findAllData, 'findAll').and.callThrough(); @@ -89,7 +91,7 @@ describe('QualityAssuranceTopicDataService', () => { service.getTopics().subscribe( (res) => { expect((service as any).findAllData.findAll).toHaveBeenCalledWith({}, true, true); - } + }, ); done(); }); @@ -97,7 +99,7 @@ describe('QualityAssuranceTopicDataService', () => { it('should return a RemoteData> for the object with the given URL', () => { const result = service.getTopics(); const expected = cold('(a)', { - a: paginatedListRD + a: paginatedListRD, }); expect(result).toBeObservable(expected); }); @@ -108,7 +110,7 @@ describe('QualityAssuranceTopicDataService', () => { service.getTopic(qualityAssuranceTopicObjectMorePid.id).subscribe( (res) => { expect((service as any).findById).toHaveBeenCalledWith(qualityAssuranceTopicObjectMorePid.id, true, true); - } + }, ); done(); }); @@ -116,7 +118,7 @@ describe('QualityAssuranceTopicDataService', () => { it('should return a RemoteData for the object with the given URL', () => { const result = service.getTopic(qualityAssuranceTopicObjectMorePid.id); const expected = cold('(a)', { - a: qaTopicObjectRD + a: qaTopicObjectRD, }); expect(result).toBeObservable(expected); }); diff --git a/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts b/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts index 2bf5195bf1e..8a94fc78e15 100644 --- a/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts +++ b/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts @@ -1,21 +1,23 @@ import { Injectable } from '@angular/core'; - import { Observable } from 'rxjs'; -import { HALEndpointService } from '../../../shared/hal-endpoint.service'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../cache/object-cache.service'; -import { RequestService } from '../../../data/request.service'; +import { dataService } from '../../../data/base/data-service.decorator'; +import { + FindAllData, + FindAllDataImpl, +} from '../../../data/base/find-all-data'; +import { IdentifiableDataService } from '../../../data/base/identifiable-data.service'; +import { FindListOptions } from '../../../data/find-list-options.model'; +import { PaginatedList } from '../../../data/paginated-list.model'; import { RemoteData } from '../../../data/remote-data'; +import { RequestService } from '../../../data/request.service'; +import { HALEndpointService } from '../../../shared/hal-endpoint.service'; import { QualityAssuranceTopicObject } from '../models/quality-assurance-topic.model'; -import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; -import { PaginatedList } from '../../../data/paginated-list.model'; -import { FindListOptions } from '../../../data/find-list-options.model'; -import { IdentifiableDataService } from '../../../data/base/identifiable-data.service'; -import { dataService } from '../../../data/base/data-service.decorator'; import { QUALITY_ASSURANCE_TOPIC_OBJECT } from '../models/quality-assurance-topic-object.resource-type'; -import { FindAllData, FindAllDataImpl } from '../../../data/base/find-all-data'; /** * The service handling all Quality Assurance topic REST requests. @@ -39,7 +41,7 @@ export class QualityAssuranceTopicDataService extends IdentifiableDataService { createSiteAdministratorMenuSections() { combineLatest([ this.authorizationService.isAuthorized(FeatureID.AdministratorOf), - this.authorizationService.isAuthorized(FeatureID.CanSeeQA) + this.authorizationService.isAuthorized(FeatureID.CanSeeQA), ]) - .subscribe(([authorized, canSeeQA]) => { - const menuList = [ + .subscribe(([authorized, canSeeQA]) => { + const menuList = [ /* Notifications */ - { - id: 'notifications', - active: false, - visible: authorized && canSeeQA, - model: { - type: MenuItemType.TEXT, - text: 'menu.section.notifications' - } as TextMenuItemModel, - icon: 'bell', - index: 4 - }, - { - id: 'notifications_quality-assurance', - parentID: 'notifications', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.quality-assurance', - link: '/admin/notifications/quality-assurance' - } as LinkMenuItemModel, - }, - /* Admin Search */ - { - id: 'admin_search', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.admin_search', - link: '/admin/search', - } as LinkMenuItemModel, - icon: 'search', - index: 5, - }, - /* Registries */ - { - id: 'registries', - active: false, - visible: authorized, - model: { - type: MenuItemType.TEXT, - text: 'menu.section.registries', - } as TextMenuItemModel, - icon: 'list', - index: 6, - }, - { - id: 'registries_metadata', - parentID: 'registries', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.registries_metadata', - link: 'admin/registries/metadata', - } as LinkMenuItemModel, - }, - { - id: 'registries_format', - parentID: 'registries', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.registries_format', - link: 'admin/registries/bitstream-formats', - } as LinkMenuItemModel, - }, + { + id: 'notifications', + active: false, + visible: authorized && canSeeQA, + model: { + type: MenuItemType.TEXT, + text: 'menu.section.notifications', + } as TextMenuItemModel, + icon: 'bell', + index: 4, + }, + { + id: 'notifications_quality-assurance', + parentID: 'notifications', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.quality-assurance', + link: '/admin/notifications/quality-assurance', + } as LinkMenuItemModel, + }, + /* Admin Search */ + { + id: 'admin_search', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.admin_search', + link: '/admin/search', + } as LinkMenuItemModel, + icon: 'search', + index: 5, + }, + /* Registries */ + { + id: 'registries', + active: false, + visible: authorized, + model: { + type: MenuItemType.TEXT, + text: 'menu.section.registries', + } as TextMenuItemModel, + icon: 'list', + index: 6, + }, + { + id: 'registries_metadata', + parentID: 'registries', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.registries_metadata', + link: 'admin/registries/metadata', + } as LinkMenuItemModel, + }, + { + id: 'registries_format', + parentID: 'registries', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.registries_format', + link: 'admin/registries/bitstream-formats', + } as LinkMenuItemModel, + }, - /* Curation tasks */ - { - id: 'curation_tasks', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.curation_task', - link: 'admin/curation-tasks', - } as LinkMenuItemModel, - icon: 'filter', - index: 7, - }, + /* Curation tasks */ + { + id: 'curation_tasks', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.curation_task', + link: 'admin/curation-tasks', + } as LinkMenuItemModel, + icon: 'filter', + index: 7, + }, - /* Workflow */ - { - id: 'workflow', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.workflow', - link: '/admin/workflow', - } as LinkMenuItemModel, - icon: 'user-check', - index: 11, - }, - { - id: 'system_wide_alert', - active: false, - visible: authorized, - model: { - type: MenuItemType.LINK, - text: 'menu.section.system-wide-alert', - link: '/admin/system-wide-alert', - } as LinkMenuItemModel, - icon: 'exclamation-circle', - index: 12, - }, - ]; + /* Workflow */ + { + id: 'workflow', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.workflow', + link: '/admin/workflow', + } as LinkMenuItemModel, + icon: 'user-check', + index: 11, + }, + { + id: 'system_wide_alert', + active: false, + visible: authorized, + model: { + type: MenuItemType.LINK, + text: 'menu.section.system-wide-alert', + link: '/admin/system-wide-alert', + } as LinkMenuItemModel, + icon: 'exclamation-circle', + index: 12, + }, + ]; - menuList.forEach((menuSection) => this.menuService.addSection(MenuID.ADMIN, Object.assign(menuSection, { - shouldPersistOnRouteChange: true, - }))); - }); + menuList.forEach((menuSection) => this.menuService.addSection(MenuID.ADMIN, Object.assign(menuSection, { + shouldPersistOnRouteChange: true, + }))); + }); } /** diff --git a/src/app/notifications/notifications-effects.ts b/src/app/notifications/notifications-effects.ts index bf70a058554..6746bd3ec11 100644 --- a/src/app/notifications/notifications-effects.ts +++ b/src/app/notifications/notifications-effects.ts @@ -3,5 +3,5 @@ import { QualityAssuranceTopicsEffects } from './qa/topics/quality-assurance-top export const notificationsEffects = [ QualityAssuranceTopicsEffects, - QualityAssuranceSourceEffects + QualityAssuranceSourceEffects, ]; diff --git a/src/app/notifications/notifications-state.service.spec.ts b/src/app/notifications/notifications-state.service.spec.ts index f07b4f56970..b96e920b722 100644 --- a/src/app/notifications/notifications-state.service.spec.ts +++ b/src/app/notifications/notifications-state.service.spec.ts @@ -1,19 +1,23 @@ import { TestBed } from '@angular/core/testing'; -import { Store, StoreModule } from '@ngrx/store'; +import { + Store, + StoreModule, +} from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { cold } from 'jasmine-marbles'; -import { suggestionNotificationsReducers } from './notifications.reducer'; -import { NotificationsStateService } from './notifications-state.service'; + import { qualityAssuranceSourceObjectMissingPid, qualityAssuranceSourceObjectMoreAbstract, qualityAssuranceSourceObjectMorePid, qualityAssuranceTopicObjectMissingPid, qualityAssuranceTopicObjectMoreAbstract, - qualityAssuranceTopicObjectMorePid + qualityAssuranceTopicObjectMorePid, } from '../shared/mocks/notifications.mock'; -import { RetrieveAllTopicsAction } from './qa/topics/quality-assurance-topics.actions'; +import { suggestionNotificationsReducers } from './notifications.reducer'; +import { NotificationsStateService } from './notifications-state.service'; import { RetrieveAllSourceAction } from './qa/source/quality-assurance-source.actions'; +import { RetrieveAllTopicsAction } from './qa/topics/quality-assurance-topics.actions'; describe('NotificationsStateService', () => { let service: NotificationsStateService; @@ -33,9 +37,9 @@ describe('NotificationsStateService', () => { totalPages: 0, currentPage: 0, totalElements: 0, - totalLoadedPages: 0 - } - } + totalLoadedPages: 0, + }, + }, }; } else { initialState = { @@ -44,16 +48,16 @@ describe('NotificationsStateService', () => { topics: [ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract, - qualityAssuranceTopicObjectMissingPid + qualityAssuranceTopicObjectMissingPid, ], processing: false, loaded: true, totalPages: 1, currentPage: 1, totalElements: 3, - totalLoadedPages: 1 - } - } + totalLoadedPages: 1, + }, + }, }; } } @@ -67,8 +71,8 @@ describe('NotificationsStateService', () => { ], providers: [ provideMockStore({ initialState }), - { provide: NotificationsStateService, useValue: service } - ] + { provide: NotificationsStateService, useValue: service }, + ], }).compileComponents(); }); @@ -83,7 +87,7 @@ describe('NotificationsStateService', () => { it('Should return an empty array', () => { const result = service.getQualityAssuranceTopics(); const expected = cold('(a)', { - a: [] + a: [], }); expect(result).toBeObservable(expected); }); @@ -93,7 +97,7 @@ describe('NotificationsStateService', () => { it('Should return zero (0)', () => { const result = service.getQualityAssuranceTopicsTotalPages(); const expected = cold('(a)', { - a: 0 + a: 0, }); expect(result).toBeObservable(expected); }); @@ -103,7 +107,7 @@ describe('NotificationsStateService', () => { it('Should return minus one (0)', () => { const result = service.getQualityAssuranceTopicsCurrentPage(); const expected = cold('(a)', { - a: 0 + a: 0, }); expect(result).toBeObservable(expected); }); @@ -113,7 +117,7 @@ describe('NotificationsStateService', () => { it('Should return zero (0)', () => { const result = service.getQualityAssuranceTopicsTotals(); const expected = cold('(a)', { - a: 0 + a: 0, }); expect(result).toBeObservable(expected); }); @@ -123,7 +127,7 @@ describe('NotificationsStateService', () => { it('Should return TRUE', () => { const result = service.isQualityAssuranceTopicsLoading(); const expected = cold('(a)', { - a: true + a: true, }); expect(result).toBeObservable(expected); }); @@ -133,7 +137,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceTopicsLoaded(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -143,7 +147,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceTopicsProcessing(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -159,8 +163,8 @@ describe('NotificationsStateService', () => { ], providers: [ provideMockStore({ initialState }), - { provide: NotificationsStateService, useValue: service } - ] + { provide: NotificationsStateService, useValue: service }, + ], }).compileComponents(); }); @@ -178,8 +182,8 @@ describe('NotificationsStateService', () => { a: [ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract, - qualityAssuranceTopicObjectMissingPid - ] + qualityAssuranceTopicObjectMissingPid, + ], }); expect(result).toBeObservable(expected); }); @@ -189,7 +193,7 @@ describe('NotificationsStateService', () => { it('Should return one (1)', () => { const result = service.getQualityAssuranceTopicsTotalPages(); const expected = cold('(a)', { - a: 1 + a: 1, }); expect(result).toBeObservable(expected); }); @@ -199,7 +203,7 @@ describe('NotificationsStateService', () => { it('Should return minus zero (1)', () => { const result = service.getQualityAssuranceTopicsCurrentPage(); const expected = cold('(a)', { - a: 1 + a: 1, }); expect(result).toBeObservable(expected); }); @@ -209,7 +213,7 @@ describe('NotificationsStateService', () => { it('Should return three (3)', () => { const result = service.getQualityAssuranceTopicsTotals(); const expected = cold('(a)', { - a: 3 + a: 3, }); expect(result).toBeObservable(expected); }); @@ -219,7 +223,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceTopicsLoading(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -229,7 +233,7 @@ describe('NotificationsStateService', () => { it('Should return TRUE', () => { const result = service.isQualityAssuranceTopicsLoaded(); const expected = cold('(a)', { - a: true + a: true, }); expect(result).toBeObservable(expected); }); @@ -239,7 +243,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceTopicsProcessing(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -255,8 +259,8 @@ describe('NotificationsStateService', () => { ], providers: [ provideMockStore({ initialState }), - { provide: NotificationsStateService, useValue: service } - ] + { provide: NotificationsStateService, useValue: service }, + ], }).compileComponents(); }); @@ -291,9 +295,9 @@ describe('NotificationsStateService', () => { totalPages: 0, currentPage: 0, totalElements: 0, - totalLoadedPages: 0 - } - } + totalLoadedPages: 0, + }, + }, }; } else { initialState = { @@ -302,16 +306,16 @@ describe('NotificationsStateService', () => { source: [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract, - qualityAssuranceSourceObjectMissingPid + qualityAssuranceSourceObjectMissingPid, ], processing: false, loaded: true, totalPages: 1, currentPage: 1, totalElements: 3, - totalLoadedPages: 1 - } - } + totalLoadedPages: 1, + }, + }, }; } } @@ -325,8 +329,8 @@ describe('NotificationsStateService', () => { ], providers: [ provideMockStore({ initialState }), - { provide: NotificationsStateService, useValue: service } - ] + { provide: NotificationsStateService, useValue: service }, + ], }).compileComponents(); }); @@ -341,7 +345,7 @@ describe('NotificationsStateService', () => { it('Should return an empty array', () => { const result = service.getQualityAssuranceSource(); const expected = cold('(a)', { - a: [] + a: [], }); expect(result).toBeObservable(expected); }); @@ -351,7 +355,7 @@ describe('NotificationsStateService', () => { it('Should return zero (0)', () => { const result = service.getQualityAssuranceSourceTotalPages(); const expected = cold('(a)', { - a: 0 + a: 0, }); expect(result).toBeObservable(expected); }); @@ -361,7 +365,7 @@ describe('NotificationsStateService', () => { it('Should return minus one (0)', () => { const result = service.getQualityAssuranceSourceCurrentPage(); const expected = cold('(a)', { - a: 0 + a: 0, }); expect(result).toBeObservable(expected); }); @@ -371,7 +375,7 @@ describe('NotificationsStateService', () => { it('Should return zero (0)', () => { const result = service.getQualityAssuranceSourceTotals(); const expected = cold('(a)', { - a: 0 + a: 0, }); expect(result).toBeObservable(expected); }); @@ -381,7 +385,7 @@ describe('NotificationsStateService', () => { it('Should return TRUE', () => { const result = service.isQualityAssuranceSourceLoading(); const expected = cold('(a)', { - a: true + a: true, }); expect(result).toBeObservable(expected); }); @@ -391,7 +395,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceSourceLoaded(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -401,7 +405,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceSourceProcessing(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -417,8 +421,8 @@ describe('NotificationsStateService', () => { ], providers: [ provideMockStore({ initialState }), - { provide: NotificationsStateService, useValue: service } - ] + { provide: NotificationsStateService, useValue: service }, + ], }).compileComponents(); }); @@ -436,8 +440,8 @@ describe('NotificationsStateService', () => { a: [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract, - qualityAssuranceSourceObjectMissingPid - ] + qualityAssuranceSourceObjectMissingPid, + ], }); expect(result).toBeObservable(expected); }); @@ -447,7 +451,7 @@ describe('NotificationsStateService', () => { it('Should return one (1)', () => { const result = service.getQualityAssuranceSourceTotalPages(); const expected = cold('(a)', { - a: 1 + a: 1, }); expect(result).toBeObservable(expected); }); @@ -457,7 +461,7 @@ describe('NotificationsStateService', () => { it('Should return minus zero (1)', () => { const result = service.getQualityAssuranceSourceCurrentPage(); const expected = cold('(a)', { - a: 1 + a: 1, }); expect(result).toBeObservable(expected); }); @@ -467,7 +471,7 @@ describe('NotificationsStateService', () => { it('Should return three (3)', () => { const result = service.getQualityAssuranceSourceTotals(); const expected = cold('(a)', { - a: 3 + a: 3, }); expect(result).toBeObservable(expected); }); @@ -477,7 +481,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceSourceLoading(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -487,7 +491,7 @@ describe('NotificationsStateService', () => { it('Should return TRUE', () => { const result = service.isQualityAssuranceSourceLoaded(); const expected = cold('(a)', { - a: true + a: true, }); expect(result).toBeObservable(expected); }); @@ -497,7 +501,7 @@ describe('NotificationsStateService', () => { it('Should return FALSE', () => { const result = service.isQualityAssuranceSourceProcessing(); const expected = cold('(a)', { - a: false + a: false, }); expect(result).toBeObservable(expected); }); @@ -513,8 +517,8 @@ describe('NotificationsStateService', () => { ], providers: [ provideMockStore({ initialState }), - { provide: NotificationsStateService, useValue: service } - ] + { provide: NotificationsStateService, useValue: service }, + ], }).compileComponents(); }); @@ -535,7 +539,7 @@ describe('NotificationsStateService', () => { }); }); }); - }); + }); }); diff --git a/src/app/notifications/notifications-state.service.ts b/src/app/notifications/notifications-state.service.ts index c123cfa3047..7b5f7f409ea 100644 --- a/src/app/notifications/notifications-state.service.ts +++ b/src/app/notifications/notifications-state.service.ts @@ -1,26 +1,30 @@ import { Injectable } from '@angular/core'; -import { select, Store } from '@ngrx/store'; +import { + select, + Store, +} from '@ngrx/store'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; + +import { QualityAssuranceSourceObject } from '../core/notifications/qa/models/quality-assurance-source.model'; +import { QualityAssuranceTopicObject } from '../core/notifications/qa/models/quality-assurance-topic.model'; +import { SuggestionNotificationsState } from './notifications.reducer'; +import { RetrieveAllSourceAction } from './qa/source/quality-assurance-source.actions'; +import { RetrieveAllTopicsAction } from './qa/topics/quality-assurance-topics.actions'; import { + getQualityAssuranceSourceCurrentPageSelector, + getQualityAssuranceSourceTotalPagesSelector, + getQualityAssuranceSourceTotalsSelector, getQualityAssuranceTopicsCurrentPageSelector, getQualityAssuranceTopicsTotalPagesSelector, getQualityAssuranceTopicsTotalsSelector, + isQualityAssuranceSourceLoadedSelector, + isQualityAssuranceSourceProcessingSelector, isQualityAssuranceTopicsLoadedSelector, - qualityAssuranceTopicsObjectSelector, isQualityAssuranceTopicsProcessingSelector, qualityAssuranceSourceObjectSelector, - isQualityAssuranceSourceLoadedSelector, - isQualityAssuranceSourceProcessingSelector, - getQualityAssuranceSourceTotalPagesSelector, - getQualityAssuranceSourceCurrentPageSelector, - getQualityAssuranceSourceTotalsSelector + qualityAssuranceTopicsObjectSelector, } from './selectors'; -import { QualityAssuranceTopicObject } from '../core/notifications/qa/models/quality-assurance-topic.model'; -import { SuggestionNotificationsState } from './notifications.reducer'; -import { RetrieveAllTopicsAction } from './qa/topics/quality-assurance-topics.actions'; -import { QualityAssuranceSourceObject } from '../core/notifications/qa/models/quality-assurance-source.model'; -import { RetrieveAllSourceAction } from './qa/source/quality-assurance-source.actions'; /** * The service handling the Notifications State. @@ -56,7 +60,7 @@ export class NotificationsStateService { public isQualityAssuranceTopicsLoading(): Observable { return this.store.pipe( select(isQualityAssuranceTopicsLoadedSelector), - map((loaded: boolean) => !loaded) + map((loaded: boolean) => !loaded), ); } @@ -131,7 +135,7 @@ export class NotificationsStateService { * @return Observable * The list of Quality Assurance source. */ - public getQualityAssuranceSource(): Observable { + public getQualityAssuranceSource(): Observable { return this.store.pipe(select(qualityAssuranceSourceObjectSelector())); } @@ -144,7 +148,7 @@ export class NotificationsStateService { public isQualityAssuranceSourceLoading(): Observable { return this.store.pipe( select(isQualityAssuranceSourceLoadedSelector), - map((loaded: boolean) => !loaded) + map((loaded: boolean) => !loaded), ); } diff --git a/src/app/notifications/notifications.module.ts b/src/app/notifications/notifications.module.ts index 7003ed3cc86..d4ce22848e5 100644 --- a/src/app/notifications/notifications.module.ts +++ b/src/app/notifications/notifications.module.ts @@ -1,31 +1,32 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; +import { NgModule } from '@angular/core'; import { EffectsModule } from '@ngrx/effects'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; +import { storeModuleConfig } from '../app.reducer'; import { CoreModule } from '../core/core.module'; +import { QualityAssuranceEventDataService } from '../core/notifications/qa/events/quality-assurance-event-data.service'; +import { QualityAssuranceSourceDataService } from '../core/notifications/qa/source/quality-assurance-source-data.service'; +import { QualityAssuranceTopicDataService } from '../core/notifications/qa/topics/quality-assurance-topic-data.service'; +import { SearchModule } from '../shared/search/search.module'; import { SharedModule } from '../shared/shared.module'; -import { storeModuleConfig } from '../app.reducer'; -import { QualityAssuranceTopicsComponent } from './qa/topics/quality-assurance-topics.component'; -import { QualityAssuranceEventsComponent } from './qa/events/quality-assurance-events.component'; -import { NotificationsStateService } from './notifications-state.service'; -import { suggestionNotificationsReducers, SuggestionNotificationsState } from './notifications.reducer'; -import { notificationsEffects } from './notifications-effects'; -import { QualityAssuranceTopicsService } from './qa/topics/quality-assurance-topics.service'; import { - QualityAssuranceTopicDataService -} from '../core/notifications/qa/topics/quality-assurance-topic-data.service'; -import { - QualityAssuranceEventDataService -} from '../core/notifications/qa/events/quality-assurance-event-data.service'; + suggestionNotificationsReducers, + SuggestionNotificationsState, +} from './notifications.reducer'; +import { notificationsEffects } from './notifications-effects'; +import { NotificationsStateService } from './notifications-state.service'; +import { QualityAssuranceEventsComponent } from './qa/events/quality-assurance-events.component'; import { ProjectEntryImportModalComponent } from './qa/project-entry-import-modal/project-entry-import-modal.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchModule } from '../shared/search/search.module'; import { QualityAssuranceSourceComponent } from './qa/source/quality-assurance-source.component'; import { QualityAssuranceSourceService } from './qa/source/quality-assurance-source.service'; -import { - QualityAssuranceSourceDataService -} from '../core/notifications/qa/source/quality-assurance-source-data.service'; +import { QualityAssuranceTopicsComponent } from './qa/topics/quality-assurance-topics.component'; +import { QualityAssuranceTopicsService } from './qa/topics/quality-assurance-topics.service'; const MODULES = [ CommonModule, @@ -34,19 +35,19 @@ const MODULES = [ CoreModule.forRoot(), StoreModule.forFeature('suggestionNotifications', suggestionNotificationsReducers, storeModuleConfig as StoreConfig), EffectsModule.forFeature(notificationsEffects), - TranslateModule + TranslateModule, ]; const COMPONENTS = [ QualityAssuranceTopicsComponent, QualityAssuranceEventsComponent, - QualityAssuranceSourceComponent + QualityAssuranceSourceComponent, ]; const DIRECTIVES = [ ]; const ENTRY_COMPONENTS = [ - ProjectEntryImportModalComponent + ProjectEntryImportModalComponent, ]; const PROVIDERS = [ @@ -55,28 +56,28 @@ const PROVIDERS = [ QualityAssuranceSourceService, QualityAssuranceTopicDataService, QualityAssuranceSourceDataService, - QualityAssuranceEventDataService + QualityAssuranceEventDataService, ]; @NgModule({ - imports: [ - ...MODULES - ], + imports: [ + ...MODULES, + ], declarations: [ ...COMPONENTS, ...DIRECTIVES, - ...ENTRY_COMPONENTS + ...ENTRY_COMPONENTS, ], providers: [ - ...PROVIDERS + ...PROVIDERS, ], entryComponents: [ - ...ENTRY_COMPONENTS + ...ENTRY_COMPONENTS, ], exports: [ ...COMPONENTS, - ...DIRECTIVES - ] + ...DIRECTIVES, + ], }) /** diff --git a/src/app/notifications/notifications.reducer.ts b/src/app/notifications/notifications.reducer.ts index 289d1e498b8..282557a3056 100644 --- a/src/app/notifications/notifications.reducer.ts +++ b/src/app/notifications/notifications.reducer.ts @@ -1,7 +1,11 @@ -import { ActionReducerMap, createFeatureSelector } from '@ngrx/store'; +import { + ActionReducerMap, + createFeatureSelector, +} from '@ngrx/store'; + import { qualityAssuranceSourceReducer, - QualityAssuranceSourceState + QualityAssuranceSourceState, } from './qa/source/quality-assurance-source.reducer'; import { qualityAssuranceTopicsReducer, @@ -18,7 +22,7 @@ export interface SuggestionNotificationsState { export const suggestionNotificationsReducers: ActionReducerMap = { qaTopic: qualityAssuranceTopicsReducer, - qaSource: qualityAssuranceSourceReducer + qaSource: qualityAssuranceSourceReducer, }; export const suggestionNotificationsSelector = createFeatureSelector('suggestionNotifications'); diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts index 3349dd3154d..b65300ce799 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts @@ -1,47 +1,61 @@ -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; import { CommonModule } from '@angular/common'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; +import { TestScheduler } from 'rxjs/testing'; + import { - QualityAssuranceEventDataService -} from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; -import { QualityAssuranceEventsComponent } from './quality-assurance-events.component'; + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; +import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { buildPaginatedList } from '../../../core/data/paginated-list.model'; +import { QualityAssuranceEventDataService } from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; +import { QualityAssuranceEventObject } from '../../../core/notifications/qa/models/quality-assurance-event.model'; +import { PaginationService } from '../../../core/pagination/pagination.service'; +import { PageInfo } from '../../../core/shared/page-info.model'; import { getMockQualityAssuranceEventRestService, - ItemMockPid10, ItemMockPid8, ItemMockPid9, + ItemMockPid10, NotificationsMockDspaceObject, qualityAssuranceEventObjectMissingProjectFound, - qualityAssuranceEventObjectMissingProjectNotFound + qualityAssuranceEventObjectMissingProjectNotFound, } from '../../../shared/mocks/notifications.mock'; -import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock'; -import { createTestComponent } from '../../../shared/testing/utils.test'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { - QualityAssuranceEventObject -} from '../../../core/notifications/qa/models/quality-assurance-event.model'; -import { QualityAssuranceEventData } from '../project-entry-import-modal/project-entry-import-modal.component'; -import { TestScheduler } from 'rxjs/testing'; -import { cold, getTestScheduler } from 'jasmine-marbles'; -import { followLink } from '../../../shared/utils/follow-link-config.model'; -import { PageInfo } from '../../../core/shared/page-info.model'; -import { buildPaginatedList } from '../../../core/data/paginated-list.model'; import { createNoContentRemoteDataObject$, createSuccessfulRemoteDataObject, - createSuccessfulRemoteDataObject$ + createSuccessfulRemoteDataObject$, } from '../../../shared/remote-data.utils'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; -import { PaginationService } from '../../../core/pagination/pagination.service'; +import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; +import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { createTestComponent } from '../../../shared/testing/utils.test'; +import { followLink } from '../../../shared/utils/follow-link-config.model'; +import { QualityAssuranceEventData } from '../project-entry-import-modal/project-entry-import-modal.component'; +import { QualityAssuranceEventsComponent } from './quality-assurance-events.component'; describe('QualityAssuranceEventsComponent test suite', () => { let fixture: ComponentFixture; @@ -50,24 +64,24 @@ describe('QualityAssuranceEventsComponent test suite', () => { let scheduler: TestScheduler; const modalStub = { - open: () => ( {result: new Promise((res, rej) => 'do')} ), - close: () => null, - dismiss: () => null + open: () => ( { result: new Promise((res, rej) => 'do') } ), + close: () => null, + dismiss: () => null, }; const qualityAssuranceEventRestServiceStub: any = getMockQualityAssuranceEventRestService(); const activatedRouteParams = { qualityAssuranceEventsParams: { currentPage: 0, - pageSize: 10 - } + pageSize: 10, + }, }; const activatedRouteParamsMap = { - id: 'ENRICH!MISSING!PROJECT' + id: 'ENRICH!MISSING!PROJECT', }; const events: QualityAssuranceEventObject[] = [ qualityAssuranceEventObjectMissingProjectFound, - qualityAssuranceEventObjectMissingProjectNotFound + qualityAssuranceEventObjectMissingProjectNotFound, ]; const paginationService = new PaginationServiceStub(); @@ -82,7 +96,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { handle: ItemMockPid10.handle, reason: null, isRunning: false, - target: ItemMockPid8 + target: ItemMockPid8, }; } @@ -97,7 +111,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { handle: null, reason: null, isRunning: false, - target: ItemMockPid9 + target: ItemMockPid9, }; } @@ -118,9 +132,9 @@ describe('QualityAssuranceEventsComponent test suite', () => { { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: TranslateService, useValue: getMockTranslateService() }, { provide: PaginationService, useValue: paginationService }, - QualityAssuranceEventsComponent + QualityAssuranceEventsComponent, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents().then(); scheduler = getTestScheduler(); })); @@ -166,8 +180,8 @@ describe('QualityAssuranceEventsComponent test suite', () => { const expected = cold('(a|)', { a: [ getQualityAssuranceEventData1(), - getQualityAssuranceEventData2() - ] + getQualityAssuranceEventData2(), + ], }); expect(result).toBeObservable(expected); }); @@ -213,10 +227,10 @@ describe('QualityAssuranceEventsComponent test suite', () => { externalSourceEntry: null, label: null, importedObject: observableOf({ - indexableObject: NotificationsMockDspaceObject - }) - } - } + indexableObject: NotificationsMockDspaceObject, + }), + }, + }, ); scheduler.schedule(() => { comp.openModalLookup(getQualityAssuranceEventData1()); @@ -233,7 +247,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { const action = 'ACCEPTED'; spyOn(compAsAny, 'getQualityAssuranceEvents').and.returnValue(observableOf([ getQualityAssuranceEventData1(), - getQualityAssuranceEventData2() + getQualityAssuranceEventData2(), ])); qualityAssuranceEventRestServiceStub.patchEvent.and.returnValue(createSuccessfulRemoteDataObject$({})); @@ -292,14 +306,14 @@ describe('QualityAssuranceEventsComponent test suite', () => { comp.topic = activatedRouteParamsMap.id; const options: FindListOptions = Object.assign(new FindListOptions(), { currentPage: comp.paginationConfig.currentPage, - elementsPerPage: comp.paginationConfig.pageSize + elementsPerPage: comp.paginationConfig.pageSize, }); const pageInfo = new PageInfo({ elementsPerPage: comp.paginationConfig.pageSize, totalElements: 2, totalPages: 1, - currentPage: comp.paginationConfig.currentPage + currentPage: comp.paginationConfig.currentPage, }); const array = [ qualityAssuranceEventObjectMissingProjectFound, @@ -310,7 +324,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { qualityAssuranceEventRestServiceStub.getEventsByTopic.and.returnValue(observableOf(paginatedListRD)); spyOn(compAsAny, 'fetchEvents').and.returnValue(observableOf([ getQualityAssuranceEventData1(), - getQualityAssuranceEventData2() + getQualityAssuranceEventData2(), ])); scheduler.schedule(() => { @@ -321,7 +335,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { expect(compAsAny.qualityAssuranceEventRestService.getEventsByTopic).toHaveBeenCalledWith( activatedRouteParamsMap.id, options, - followLink('target'),followLink('related') + followLink('target'),followLink('related'), ); expect(compAsAny.fetchEvents).toHaveBeenCalled(); }); @@ -333,7 +347,7 @@ describe('QualityAssuranceEventsComponent test suite', () => { // declare a test component @Component({ selector: 'ds-test-cmp', - template: `` + template: ``, }) class TestComponent { diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts index c22c28f41e9..5c4a04b56bf 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts @@ -1,36 +1,56 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, combineLatest, from, Observable, of, Subscription } from 'rxjs'; -import { distinctUntilChanged, last, map, mergeMap, scan, switchMap, take, tap } from 'rxjs/operators'; +import { + BehaviorSubject, + combineLatest, + from, + Observable, + of, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + last, + map, + mergeMap, + scan, + switchMap, + take, + tap, +} from 'rxjs/operators'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; +import { environment } from '../../../../environments/environment'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; +import { FindListOptions } from '../../../core/data/find-list-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; +import { QualityAssuranceEventDataService } from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; import { + QualityAssuranceEventObject, SourceQualityAssuranceEventMessageObject, - QualityAssuranceEventObject } from '../../../core/notifications/qa/models/quality-assurance-event.model'; -import { - QualityAssuranceEventDataService -} from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { PaginationService } from '../../../core/pagination/pagination.service'; +import { Item } from '../../../core/shared/item.model'; import { Metadata } from '../../../core/shared/metadata.utils'; -import { followLink } from '../../../shared/utils/follow-link-config.model'; +import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; -import { ItemSearchResult } from '../../../shared/object-collection/shared/item-search-result.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ItemSearchResult } from '../../../shared/object-collection/shared/item-search-result.model'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { followLink } from '../../../shared/utils/follow-link-config.model'; import { ProjectEntryImportModalComponent, - QualityAssuranceEventData + QualityAssuranceEventData, } from '../project-entry-import-modal/project-entry-import-modal.component'; -import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { Item } from '../../../core/shared/item.model'; -import { FindListOptions } from '../../../core/data/find-list-options.model'; -import {environment} from '../../../../environments/environment'; /** * Component to display the Quality Assurance event list. @@ -49,7 +69,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { id: 'bep', currentPage: 1, pageSize: 10, - pageSizeOptions: [5, 10, 20, 40, 60] + pageSizeOptions: [5, 10, 20, 40, 60], }); /** * The Quality Assurance event list sort options. @@ -125,7 +145,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { private notificationsService: NotificationsService, private qualityAssuranceEventRestService: QualityAssuranceEventDataService, private paginationService: PaginationService, - private translateService: TranslateService + private translateService: TranslateService, ) { } @@ -136,17 +156,17 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { this.isEventPageLoading.next(true); this.activatedRoute.paramMap.pipe( - tap((params) => { - this.sourceUrlForProjectSearch = environment.qualityAssuranceConfig.sourceUrlMapForProjectSearch[params.get('sourceId')]; - }), - map((params) => params.get('topicId')), + tap((params) => { + this.sourceUrlForProjectSearch = environment.qualityAssuranceConfig.sourceUrlMapForProjectSearch[params.get('sourceId')]; + }), + map((params) => params.get('topicId')), take(1), switchMap((id: string) => { const regEx = /!/g; this.showTopic = id.replace(regEx, '/'); this.topic = id; return this.getQualityAssuranceEvents(); - }) + }), ).subscribe((events: QualityAssuranceEventData[]) => { this.eventsUpdated$.next(events); this.isEventPageLoading.next(false); @@ -203,7 +223,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { }, (_reason) => { this.selectedReason = null; - } + }, ); } @@ -215,7 +235,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { */ public openModalLookup(eventData: QualityAssuranceEventData): void { this.modalRef = this.modalService.open(ProjectEntryImportModalComponent, { - size: 'lg' + size: 'lg', }); const modalComp = this.modalRef.componentInstance; modalComp.externalSourceEntry = eventData; @@ -228,9 +248,9 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { eventData, object.indexableObject.id, projectTitle.value, - object.indexableObject.handle + object.indexableObject.handle, ); - }) + }), ); } @@ -250,20 +270,20 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { switchMap((rd: RemoteData) => { if (rd.hasSucceeded) { this.notificationsService.success( - this.translateService.instant('quality-assurance.event.action.saved') + this.translateService.instant('quality-assurance.event.action.saved'), ); return this.getQualityAssuranceEvents(); } else { this.notificationsService.error( - this.translateService.instant('quality-assurance.event.action.error') + this.translateService.instant('quality-assurance.event.action.error'), ); return of(this.eventsUpdated$.value); } - }) + }), ).subscribe((events: QualityAssuranceEventData[]) => { this.eventsUpdated$.next(events); eventData.isRunning = false; - }) + }), ); } @@ -286,7 +306,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { .subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { this.notificationsService.success( - this.translateService.instant('quality-assurance.event.project.bounded') + this.translateService.instant('quality-assurance.event.project.bounded'), ); eventData.hasProject = true; eventData.projectTitle = projectTitle; @@ -294,11 +314,11 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { eventData.projectId = projectId; } else { this.notificationsService.error( - this.translateService.instant('quality-assurance.event.project.error') + this.translateService.instant('quality-assurance.event.project.error'), ); } eventData.isRunning = false; - }) + }), ); } @@ -315,7 +335,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { .subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { this.notificationsService.success( - this.translateService.instant('quality-assurance.event.project.removed') + this.translateService.instant('quality-assurance.event.project.removed'), ); eventData.hasProject = false; eventData.projectTitle = null; @@ -323,11 +343,11 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { eventData.projectId = null; } else { this.notificationsService.error( - this.translateService.instant('quality-assurance.event.project.error') + this.translateService.instant('quality-assurance.event.project.error'), ); } eventData.isRunning = false; - }) + }), ); } @@ -356,7 +376,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { switchMap((options: FindListOptions) => this.qualityAssuranceEventRestService.getEventsByTopic( this.topic, options, - followLink('target'), followLink('related') + followLink('target'), followLink('related'), )), getFirstCompletedRemoteData(), switchMap((rd: RemoteData>) => { @@ -374,7 +394,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { take(1), tap(() => { this.qualityAssuranceEventRestService.clearFindByTopicRequests(); - }) + }), ); } @@ -401,7 +421,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { getFirstCompletedRemoteData(), ); const target$ = event.target.pipe( - getFirstCompletedRemoteData() + getFirstCompletedRemoteData(), ); return combineLatest([related$, target$]).pipe( map(([relatedItemRD, targetItemRD]: [RemoteData, RemoteData]) => { @@ -424,11 +444,11 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { data.handle = relatedItemRD?.payload?.handle; } return data; - }) + }), ); }), scan((acc: any, value: any) => [...acc, value], []), - last() + last(), ); } } diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts index 42a57c2ac5e..cddac117b5e 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts @@ -1,25 +1,37 @@ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + async, + ComponentFixture, + inject, + TestBed, +} from '@angular/core/testing'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { SearchService } from '../../../core/shared/search/search.service'; -import { Item } from '../../../core/shared/item.model'; -import { createTestComponent } from '../../../shared/testing/utils.test'; -import { ImportType, ProjectEntryImportModalComponent } from './project-entry-import-modal.component'; -import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; -import { getMockSearchService } from '../../../shared/mocks/search-service.mock'; -import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; + import { buildPaginatedList } from '../../../core/data/paginated-list.model'; +import { Item } from '../../../core/shared/item.model'; import { PageInfo } from '../../../core/shared/page-info.model'; +import { SearchService } from '../../../core/shared/search/search.service'; import { ItemMockPid10, + NotificationsMockDspaceObject, qualityAssuranceEventObjectMissingProjectFound, - NotificationsMockDspaceObject } from '../../../shared/mocks/notifications.mock'; +import { getMockSearchService } from '../../../shared/mocks/search-service.mock'; +import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; +import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; +import { createTestComponent } from '../../../shared/testing/utils.test'; +import { + ImportType, + ProjectEntryImportModalComponent, +} from './project-entry-import-modal.component'; const eventData = { event: qualityAssuranceEventObjectMissingProjectFound, @@ -30,28 +42,28 @@ const eventData = { projectId: ItemMockPid10.id, handle: ItemMockPid10.handle, reason: null, - isRunning: false + isRunning: false, }; const searchString = 'Test project to search'; const pagination = Object.assign( new PaginationComponentOptions(), { id: 'notifications-project-bound', - pageSize: 3 - } + pageSize: 3, + }, ); const searchOptions = Object.assign(new PaginatedSearchOptions( { configuration: 'funding', query: searchString, - pagination: pagination - } + pagination: pagination, + }, )); const pageInfo = new PageInfo({ elementsPerPage: 3, totalElements: 1, totalPages: 1, - currentPage: 1 + currentPage: 1, }); const array = [ NotificationsMockDspaceObject, @@ -83,9 +95,9 @@ describe('ProjectEntryImportModalComponent test suite', () => { { provide: NgbActiveModal, useValue: modalStub }, { provide: SearchService, useValue: searchServiceStub }, { provide: SelectableListService, useValue: jasmine.createSpyObj('selectableListService', ['deselect', 'select', 'deselectAll']) }, - ProjectEntryImportModalComponent + ProjectEntryImportModalComponent, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents().then(); })); @@ -203,7 +215,7 @@ describe('ProjectEntryImportModalComponent test suite', () => { // declare a test component @Component({ selector: 'ds-test-cmp', - template: `` + template: ``, }) class TestComponent { eventData = eventData; diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts index ad9c1035a51..5349a3c9951 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts @@ -1,23 +1,36 @@ -import { Component, EventEmitter, Input, OnInit } from '@angular/core'; +import { + Component, + EventEmitter, + Input, + OnInit, +} from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { Observable, of as observableOf, Subscription } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; + import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { SearchResult } from '../../../shared/search/models/search-result.model'; -import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; -import { CollectionElementLinkType } from '../../../shared/object-collection/collection-element-link.type'; -import { Context } from '../../../core/shared/context.model'; -import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; -import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { SearchService } from '../../../core/shared/search/search.service'; -import { DSpaceObject } from '../../../core/shared/dspace-object.model'; +import { RemoteData } from '../../../core/data/remote-data'; import { - SourceQualityAssuranceEventMessageObject, QualityAssuranceEventObject, + SourceQualityAssuranceEventMessageObject, } from '../../../core/notifications/qa/models/quality-assurance-event.model'; -import { hasValue, isNotEmpty } from '../../../shared/empty.util'; +import { Context } from '../../../core/shared/context.model'; +import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { Item } from '../../../core/shared/item.model'; +import { SearchService } from '../../../core/shared/search/search.service'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; +import { CollectionElementLinkType } from '../../../shared/object-collection/collection-element-link.type'; +import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; +import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; +import { SearchResult } from '../../../shared/search/models/search-result.model'; /** * The possible types of import for the external entry @@ -79,7 +92,7 @@ export interface QualityAssuranceEventData { @Component({ selector: 'ds-project-entry-import-modal', styleUrls: ['./project-entry-import-modal.component.scss'], - templateUrl: './project-entry-import-modal.component.html' + templateUrl: './project-entry-import-modal.component.html', }) /** * Component to display a modal window for linking a project to an Quality Assurance event @@ -185,14 +198,14 @@ export class ProjectEntryImportModalComponent implements OnInit { { configuration: this.configuration, query: this.projectTitle, - pagination: this.pagination - } + pagination: this.pagination, + }, )); this.localEntitiesRD$ = this.searchService.search(this.searchOptions); this.subs.push( this.localEntitiesRD$.subscribe( - () => this.isLoading$ = observableOf(false) - ) + () => this.isLoading$ = observableOf(false), + ), ); } @@ -215,14 +228,14 @@ export class ProjectEntryImportModalComponent implements OnInit { { configuration: this.configuration, query: (searchTitle) ? searchTitle.replace(filterRegEx, '') : searchTitle, - pagination: this.pagination - } + pagination: this.pagination, + }, )); this.localEntitiesRD$ = this.searchService.search(this.searchOptions); this.subs.push( this.localEntitiesRD$.subscribe( - () => this.isLoading$ = observableOf(false) - ) + () => this.isLoading$ = observableOf(false), + ), ); } } diff --git a/src/app/notifications/qa/source/quality-assurance-source.actions.ts b/src/app/notifications/qa/source/quality-assurance-source.actions.ts index f6d9c19eaaf..0493b035abc 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.actions.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.actions.ts @@ -1,7 +1,8 @@ /* eslint-disable max-classes-per-file */ import { Action } from '@ngrx/store'; -import { type } from '../../../shared/ngrx/type'; + import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; +import { type } from '../../../shared/ngrx/type'; /** * For each action type in an action group, make a simple @@ -38,7 +39,7 @@ export class RetrieveAllSourceAction implements Action { constructor(elementsPerPage: number, currentPage: number) { this.payload = { elementsPerPage, - currentPage + currentPage, }; } } @@ -80,7 +81,7 @@ export class AddSourceAction implements Action { source, totalPages, currentPage, - totalElements + totalElements, }; } diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts index ba3a903cc5e..c0da6edc3bc 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts @@ -1,20 +1,29 @@ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { createTestComponent } from '../../../shared/testing/utils.test'; + +import { PaginationService } from '../../../core/pagination/pagination.service'; import { getMockNotificationsStateService, qualityAssuranceSourceObjectMoreAbstract, - qualityAssuranceSourceObjectMorePid + qualityAssuranceSourceObjectMorePid, } from '../../../shared/mocks/notifications.mock'; -import { QualityAssuranceSourceComponent } from './quality-assurance-source.component'; -import { NotificationsStateService } from '../../notifications-state.service'; -import { cold } from 'jasmine-marbles'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { PaginationService } from '../../../core/pagination/pagination.service'; +import { createTestComponent } from '../../../shared/testing/utils.test'; +import { NotificationsStateService } from '../../notifications-state.service'; +import { QualityAssuranceSourceComponent } from './quality-assurance-source.component'; describe('QualityAssuranceSourceComponent test suite', () => { let fixture: ComponentFixture; @@ -24,8 +33,8 @@ describe('QualityAssuranceSourceComponent test suite', () => { const activatedRouteParams = { qualityAssuranceSourceParams: { currentPage: 0, - pageSize: 5 - } + pageSize: 5, + }, }; const paginationService = new PaginationServiceStub(); @@ -43,13 +52,13 @@ describe('QualityAssuranceSourceComponent test suite', () => { { provide: NotificationsStateService, useValue: mockNotificationsStateService }, { provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), params: observableOf({}) } }, { provide: PaginationService, useValue: paginationService }, - QualityAssuranceSourceComponent + QualityAssuranceSourceComponent, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents().then(() => { mockNotificationsStateService.getQualityAssuranceSource.and.returnValue(observableOf([ qualityAssuranceSourceObjectMorePid, - qualityAssuranceSourceObjectMoreAbstract + qualityAssuranceSourceObjectMoreAbstract, ])); mockNotificationsStateService.getQualityAssuranceSourceTotalPages.and.returnValue(observableOf(1)); mockNotificationsStateService.getQualityAssuranceSourceCurrentPage.and.returnValue(observableOf(0)); @@ -103,11 +112,11 @@ describe('QualityAssuranceSourceComponent test suite', () => { expect(comp.sources$).toBeObservable(cold('(a|)', { a: [ qualityAssuranceSourceObjectMorePid, - qualityAssuranceSourceObjectMoreAbstract - ] + qualityAssuranceSourceObjectMoreAbstract, + ], })); expect(comp.totalElements$).toBeObservable(cold('(a|)', { - a: 2 + a: 2, })); }); @@ -122,13 +131,13 @@ describe('QualityAssuranceSourceComponent test suite', () => { it(('isSourceLoading should return FALSE'), () => { expect(comp.isSourceLoading()).toBeObservable(cold('(a|)', { - a: false + a: false, })); }); it(('isSourceProcessing should return FALSE'), () => { expect(comp.isSourceProcessing()).toBeObservable(cold('(a|)', { - a: false + a: false, })); }); @@ -145,7 +154,7 @@ describe('QualityAssuranceSourceComponent test suite', () => { // declare a test component @Component({ selector: 'ds-test-cmp', - template: `` + template: ``, }) class TestComponent { diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.ts b/src/app/notifications/qa/source/quality-assurance-source.component.ts index aef56d09c71..b5a6597d46f 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.ts @@ -1,13 +1,23 @@ -import { Component, OnInit } from '@angular/core'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { Observable, Subscription } from 'rxjs'; -import { distinctUntilChanged, take } from 'rxjs/operators'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + take, +} from 'rxjs/operators'; + +import { AdminQualityAssuranceSourcePageParams } from '../../../admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; +import { PaginationService } from '../../../core/pagination/pagination.service'; +import { hasValue } from '../../../shared/empty.util'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { NotificationsStateService } from '../../notifications-state.service'; -import { AdminQualityAssuranceSourcePageParams } from '../../../admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service'; -import { hasValue } from '../../../shared/empty.util'; /** * Component to display the Quality Assurance source list. @@ -15,18 +25,18 @@ import { hasValue } from '../../../shared/empty.util'; @Component({ selector: 'ds-quality-assurance-source', templateUrl: './quality-assurance-source.component.html', - styleUrls: ['./quality-assurance-source.component.scss'] + styleUrls: ['./quality-assurance-source.component.scss'], }) export class QualityAssuranceSourceComponent implements OnInit { - /** + /** * The pagination system configuration for HTML listing. * @type {PaginationComponentOptions} */ public paginationConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'btp', pageSize: 10, - pageSizeOptions: [5, 10, 20, 40, 60] + pageSizeOptions: [5, 10, 20, 40, 60], }); /** * The Quality Assurance source list sort options. @@ -71,10 +81,10 @@ export class QualityAssuranceSourceComponent implements OnInit { ngAfterViewInit(): void { this.subs.push( this.notificationsStateService.isQualityAssuranceSourceLoaded().pipe( - take(1) + take(1), ).subscribe(() => { this.getQualityAssuranceSource(); - }) + }), ); } @@ -107,7 +117,7 @@ export class QualityAssuranceSourceComponent implements OnInit { ).subscribe((options: PaginationComponentOptions) => { this.notificationsStateService.dispatchRetrieveQualityAssuranceSource( options.pageSize, - options.currentPage + options.currentPage, ); }); } diff --git a/src/app/notifications/qa/source/quality-assurance-source.effects.ts b/src/app/notifications/qa/source/quality-assurance-source.effects.ts index bd85fb18a07..7dacef60e70 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.effects.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.effects.ts @@ -1,26 +1,31 @@ import { Injectable } from '@angular/core'; - +import { + Actions, + createEffect, + ofType, +} from '@ngrx/effects'; import { Store } from '@ngrx/store'; -import { Actions, createEffect, ofType } from '@ngrx/effects'; import { TranslateService } from '@ngx-translate/core'; -import { catchError, map, switchMap, tap, withLatestFrom } from 'rxjs/operators'; import { of as observableOf } from 'rxjs'; +import { + catchError, + map, + switchMap, + tap, + withLatestFrom, +} from 'rxjs/operators'; +import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; +import { QualityAssuranceSourceDataService } from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { AddSourceAction, QualityAssuranceSourceActionTypes, RetrieveAllSourceAction, RetrieveAllSourceErrorAction, } from './quality-assurance-source.actions'; -import { - QualityAssuranceSourceObject -} from '../../../core/notifications/qa/models/quality-assurance-source.model'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; import { QualityAssuranceSourceService } from './quality-assurance-source.service'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { - QualityAssuranceSourceDataService -} from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; /** * Provides effect methods for the Quality Assurance source actions. @@ -37,19 +42,19 @@ export class QualityAssuranceSourceEffects { switchMap(([action, currentState]: [RetrieveAllSourceAction, any]) => { return this.qualityAssuranceSourceService.getSources( action.payload.elementsPerPage, - action.payload.currentPage + action.payload.currentPage, ).pipe( map((sources: PaginatedList) => - new AddSourceAction(sources.page, sources.totalPages, sources.currentPage, sources.totalElements) + new AddSourceAction(sources.page, sources.totalPages, sources.currentPage, sources.totalElements), ), catchError((error: Error) => { if (error) { console.error(error.message); } return observableOf(new RetrieveAllSourceErrorAction()); - }) + }), ); - }) + }), )); /** @@ -59,7 +64,7 @@ export class QualityAssuranceSourceEffects { ofType(QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE_ERROR), tap(() => { this.notificationsService.error(null, this.translate.get('quality-assurance.source.error.service.retrieve')); - }) + }), ), { dispatch: false }); /** @@ -69,7 +74,7 @@ export class QualityAssuranceSourceEffects { ofType(QualityAssuranceSourceActionTypes.ADD_SOURCE), tap(() => { this.qualityAssuranceSourceDataService.clearFindAllSourceRequests(); - }) + }), ), { dispatch: false }); /** @@ -87,7 +92,7 @@ export class QualityAssuranceSourceEffects { private translate: TranslateService, private notificationsService: NotificationsService, private qualityAssuranceSourceService: QualityAssuranceSourceService, - private qualityAssuranceSourceDataService: QualityAssuranceSourceDataService + private qualityAssuranceSourceDataService: QualityAssuranceSourceDataService, ) { } } diff --git a/src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts index fcb717067d5..89db1669261 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts @@ -1,68 +1,71 @@ import { - AddSourceAction, - RetrieveAllSourceAction, - RetrieveAllSourceErrorAction - } from './quality-assurance-source.actions'; - import { qualityAssuranceSourceReducer, QualityAssuranceSourceState } from './quality-assurance-source.reducer'; - import { - qualityAssuranceSourceObjectMoreAbstract, - qualityAssuranceSourceObjectMorePid - } from '../../../shared/mocks/notifications.mock'; + qualityAssuranceSourceObjectMoreAbstract, + qualityAssuranceSourceObjectMorePid, +} from '../../../shared/mocks/notifications.mock'; +import { + AddSourceAction, + RetrieveAllSourceAction, + RetrieveAllSourceErrorAction, +} from './quality-assurance-source.actions'; +import { + qualityAssuranceSourceReducer, + QualityAssuranceSourceState, +} from './quality-assurance-source.reducer'; - describe('qualityAssuranceSourceReducer test suite', () => { - let qualityAssuranceSourceInitialState: QualityAssuranceSourceState; - const elementPerPage = 3; - const currentPage = 0; +describe('qualityAssuranceSourceReducer test suite', () => { + let qualityAssuranceSourceInitialState: QualityAssuranceSourceState; + const elementPerPage = 3; + const currentPage = 0; - beforeEach(() => { - qualityAssuranceSourceInitialState = { - source: [], - processing: false, - loaded: false, - totalPages: 0, - currentPage: 0, - totalElements: 0 - }; - }); + beforeEach(() => { + qualityAssuranceSourceInitialState = { + source: [], + processing: false, + loaded: false, + totalPages: 0, + currentPage: 0, + totalElements: 0, + }; + }); - it('Action RETRIEVE_ALL_SOURCE should set the State property "processing" to TRUE', () => { - const expectedState = qualityAssuranceSourceInitialState; - expectedState.processing = true; + it('Action RETRIEVE_ALL_SOURCE should set the State property "processing" to TRUE', () => { + const expectedState = qualityAssuranceSourceInitialState; + expectedState.processing = true; - const action = new RetrieveAllSourceAction(elementPerPage, currentPage); - const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action); + const action = new RetrieveAllSourceAction(elementPerPage, currentPage); + const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action); - expect(newState).toEqual(expectedState); - }); + expect(newState).toEqual(expectedState); + }); - it('Action RETRIEVE_ALL_SOURCE_ERROR should change the State to initial State but processing, loaded, and currentPage', () => { - const expectedState = qualityAssuranceSourceInitialState; - expectedState.processing = false; - expectedState.loaded = true; - expectedState.currentPage = 0; + it('Action RETRIEVE_ALL_SOURCE_ERROR should change the State to initial State but processing, loaded, and currentPage', () => { + const expectedState = qualityAssuranceSourceInitialState; + expectedState.processing = false; + expectedState.loaded = true; + expectedState.currentPage = 0; - const action = new RetrieveAllSourceErrorAction(); - const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action); + const action = new RetrieveAllSourceErrorAction(); + const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action); - expect(newState).toEqual(expectedState); - }); + expect(newState).toEqual(expectedState); + }); - it('Action ADD_SOURCE should populate the State with Quality Assurance source', () => { - const expectedState = { - source: [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ], - processing: false, - loaded: true, - totalPages: 1, - currentPage: 0, - totalElements: 2 - }; + it('Action ADD_SOURCE should populate the State with Quality Assurance source', () => { + const expectedState = { + source: [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ], + processing: false, + loaded: true, + totalPages: 1, + currentPage: 0, + totalElements: 2, + }; - const action = new AddSourceAction( - [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ], - 1, 0, 2 - ); - const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action); + const action = new AddSourceAction( + [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ], + 1, 0, 2, + ); + const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action); - expect(newState).toEqual(expectedState); - }); + expect(newState).toEqual(expectedState); }); +}); diff --git a/src/app/notifications/qa/source/quality-assurance-source.reducer.ts b/src/app/notifications/qa/source/quality-assurance-source.reducer.ts index 08e26a177ac..2c81462c8d6 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.reducer.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.reducer.ts @@ -1,5 +1,8 @@ import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; -import { QualityAssuranceSourceActionTypes, QualityAssuranceSourceActions } from './quality-assurance-source.actions'; +import { + QualityAssuranceSourceActions, + QualityAssuranceSourceActionTypes, +} from './quality-assurance-source.actions'; /** * The interface representing the Quality Assurance source state. @@ -22,7 +25,7 @@ const qualityAssuranceSourceInitialState: QualityAssuranceSourceState = { loaded: false, totalPages: 0, currentPage: 0, - totalElements: 0 + totalElements: 0, }; /** @@ -40,7 +43,7 @@ export function qualityAssuranceSourceReducer(state = qualityAssuranceSourceInit case QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE: { return Object.assign({}, state, { source: [], - processing: true + processing: true, }); } @@ -51,7 +54,7 @@ export function qualityAssuranceSourceReducer(state = qualityAssuranceSourceInit loaded: true, totalPages: action.payload.totalPages, currentPage: state.currentPage, - totalElements: action.payload.totalElements + totalElements: action.payload.totalElements, }); } @@ -61,7 +64,7 @@ export function qualityAssuranceSourceReducer(state = qualityAssuranceSourceInit loaded: true, totalPages: 0, currentPage: 0, - totalElements: 0 + totalElements: 0, }); } diff --git a/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts index 5ce2ed8ee02..12e0ab9a297 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts @@ -1,20 +1,22 @@ import { TestBed } from '@angular/core/testing'; +import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { QualityAssuranceSourceService } from './quality-assurance-source.service'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; + +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; +import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { buildPaginatedList } from '../../../core/data/paginated-list.model'; +import { QualityAssuranceSourceDataService } from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; import { PageInfo } from '../../../core/shared/page-info.model'; import { getMockQualityAssuranceSourceRestService, qualityAssuranceSourceObjectMoreAbstract, - qualityAssuranceSourceObjectMorePid + qualityAssuranceSourceObjectMorePid, } from '../../../shared/mocks/notifications.mock'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; -import { cold } from 'jasmine-marbles'; -import { buildPaginatedList } from '../../../core/data/paginated-list.model'; -import { - QualityAssuranceSourceDataService -} from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; -import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { QualityAssuranceSourceService } from './quality-assurance-source.service'; describe('QualityAssuranceSourceService', () => { let service: QualityAssuranceSourceService; @@ -33,8 +35,8 @@ describe('QualityAssuranceSourceService', () => { TestBed.configureTestingModule({ providers: [ { provide: QualityAssuranceSourceDataService, useClass: getMockQualityAssuranceSourceRestService }, - { provide: QualityAssuranceSourceService, useValue: service } - ] + { provide: QualityAssuranceSourceService, useValue: service }, + ], }).compileComponents(); }); @@ -52,7 +54,7 @@ describe('QualityAssuranceSourceService', () => { const findListOptions: FindListOptions = { elementsPerPage: elementsPerPage, currentPage: currentPage, - sort: sortOptions + sort: sortOptions, }; const result = service.getSources(elementsPerPage, currentPage); expect((service as any).qualityAssuranceSourceRestService.getSources).toHaveBeenCalledWith(findListOptions); @@ -60,7 +62,7 @@ describe('QualityAssuranceSourceService', () => { it('Should return a paginated list of Quality Assurance Source', () => { const expected = cold('(a|)', { - a: paginatedList + a: paginatedList, }); const result = service.getSources(elementsPerPage, currentPage); expect(result).toBeObservable(expected); diff --git a/src/app/notifications/qa/source/quality-assurance-source.service.ts b/src/app/notifications/qa/source/quality-assurance-source.service.ts index ea0cb2e5c51..790ca67695a 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.service.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.service.ts @@ -1,18 +1,16 @@ import { Injectable } from '@angular/core'; - import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { - QualityAssuranceSourceDataService -} from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; -import { RemoteData } from '../../../core/data/remote-data'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { - QualityAssuranceSourceObject -} from '../../../core/notifications/qa/models/quality-assurance-source.model'; + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { RemoteData } from '../../../core/data/remote-data'; +import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; +import { QualityAssuranceSourceDataService } from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; /** @@ -26,7 +24,7 @@ export class QualityAssuranceSourceService { * @param {QualityAssuranceSourceDataService} qualityAssuranceSourceRestService */ constructor( - private qualityAssuranceSourceRestService: QualityAssuranceSourceDataService + private qualityAssuranceSourceRestService: QualityAssuranceSourceDataService, ) { } @@ -46,7 +44,7 @@ export class QualityAssuranceSourceService { const findListOptions: FindListOptions = { elementsPerPage: elementsPerPage, currentPage: currentPage, - sort: sortOptions + sort: sortOptions, }; return this.qualityAssuranceSourceRestService.getSources(findListOptions).pipe( @@ -57,7 +55,7 @@ export class QualityAssuranceSourceService { } else { throw new Error('Can\'t retrieve Quality Assurance source from the Broker source REST service'); } - }) + }), ); } } diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.actions.ts b/src/app/notifications/qa/topics/quality-assurance-topics.actions.ts index 6b83b1d349c..78f1963423d 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.actions.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.actions.ts @@ -1,7 +1,8 @@ /* eslint-disable max-classes-per-file */ import { Action } from '@ngrx/store'; -import { type } from '../../../shared/ngrx/type'; + import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model'; +import { type } from '../../../shared/ngrx/type'; /** * For each action type in an action group, make a simple @@ -38,7 +39,7 @@ export class RetrieveAllTopicsAction implements Action { constructor(elementsPerPage: number, currentPage: number) { this.payload = { elementsPerPage, - currentPage + currentPage, }; } } @@ -80,7 +81,7 @@ export class AddTopicsAction implements Action { topics, totalPages, currentPage, - totalElements + totalElements, }; } diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts index fd64b82ce7d..31bd5ac55ea 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts @@ -1,21 +1,30 @@ /* eslint-disable no-empty, @typescript-eslint/no-empty-function */ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { createTestComponent } from '../../../shared/testing/utils.test'; + +import { PaginationService } from '../../../core/pagination/pagination.service'; import { getMockNotificationsStateService, qualityAssuranceTopicObjectMoreAbstract, - qualityAssuranceTopicObjectMorePid + qualityAssuranceTopicObjectMorePid, } from '../../../shared/mocks/notifications.mock'; -import { QualityAssuranceTopicsComponent } from './quality-assurance-topics.component'; -import { NotificationsStateService } from '../../notifications-state.service'; -import { cold } from 'jasmine-marbles'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { PaginationService } from '../../../core/pagination/pagination.service'; +import { createTestComponent } from '../../../shared/testing/utils.test'; +import { NotificationsStateService } from '../../notifications-state.service'; +import { QualityAssuranceTopicsComponent } from './quality-assurance-topics.component'; import { QualityAssuranceTopicsService } from './quality-assurance-topics.service'; describe('QualityAssuranceTopicsComponent test suite', () => { @@ -26,8 +35,8 @@ describe('QualityAssuranceTopicsComponent test suite', () => { const activatedRouteParams = { qualityAssuranceTopicsParams: { currentPage: 0, - pageSize: 5 - } + pageSize: 5, + }, }; const paginationService = new PaginationServiceStub(); @@ -47,17 +56,17 @@ describe('QualityAssuranceTopicsComponent test suite', () => { paramMap: { get: () => 'openaire', }, - }}}, + } } }, { provide: PaginationService, useValue: paginationService }, QualityAssuranceTopicsComponent, // tslint:disable-next-line: no-empty - { provide: QualityAssuranceTopicsService, useValue: { setSourceId: (sourceId: string) => { } }} + { provide: QualityAssuranceTopicsService, useValue: { setSourceId: (sourceId: string) => { } } }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).compileComponents().then(() => { mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([ qualityAssuranceTopicObjectMorePid, - qualityAssuranceTopicObjectMoreAbstract + qualityAssuranceTopicObjectMoreAbstract, ])); mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1)); mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0)); @@ -111,11 +120,11 @@ describe('QualityAssuranceTopicsComponent test suite', () => { expect(comp.topics$).toBeObservable(cold('(a|)', { a: [ qualityAssuranceTopicObjectMorePid, - qualityAssuranceTopicObjectMoreAbstract - ] + qualityAssuranceTopicObjectMoreAbstract, + ], })); expect(comp.totalElements$).toBeObservable(cold('(a|)', { - a: 2 + a: 2, })); }); @@ -130,13 +139,13 @@ describe('QualityAssuranceTopicsComponent test suite', () => { it(('isTopicsLoading should return FALSE'), () => { expect(comp.isTopicsLoading()).toBeObservable(cold('(a|)', { - a: false + a: false, })); }); it(('isTopicsProcessing should return FALSE'), () => { expect(comp.isTopicsProcessing()).toBeObservable(cold('(a|)', { - a: false + a: false, })); }); @@ -153,7 +162,7 @@ describe('QualityAssuranceTopicsComponent test suite', () => { // declare a test component @Component({ selector: 'ds-test-cmp', - template: `` + template: ``, }) class TestComponent { diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts index 542d36a9ed1..80f01358ef6 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts @@ -1,20 +1,24 @@ -import { Component, OnInit } from '@angular/core'; - -import { Observable, Subscription } from 'rxjs'; -import { distinctUntilChanged, take } from 'rxjs/operators'; +import { + Component, + OnInit, +} from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + take, +} from 'rxjs/operators'; +import { AdminQualityAssuranceTopicsPageParams } from '../../../admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; -import { - QualityAssuranceTopicObject -} from '../../../core/notifications/qa/models/quality-assurance-topic.model'; +import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model'; +import { PaginationService } from '../../../core/pagination/pagination.service'; import { hasValue } from '../../../shared/empty.util'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { NotificationsStateService } from '../../notifications-state.service'; -import { - AdminQualityAssuranceTopicsPageParams -} from '../../../admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { ActivatedRoute } from '@angular/router'; import { QualityAssuranceTopicsService } from './quality-assurance-topics.service'; /** @@ -33,7 +37,7 @@ export class QualityAssuranceTopicsComponent implements OnInit { public paginationConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { id: 'btp', pageSize: 10, - pageSizeOptions: [5, 10, 20, 40, 60] + pageSizeOptions: [5, 10, 20, 40, 60], }); /** * The Quality Assurance topic list sort options. @@ -71,7 +75,7 @@ export class QualityAssuranceTopicsComponent implements OnInit { private paginationService: PaginationService, private activatedRoute: ActivatedRoute, private notificationsStateService: NotificationsStateService, - private qualityAssuranceTopicsService: QualityAssuranceTopicsService + private qualityAssuranceTopicsService: QualityAssuranceTopicsService, ) { } @@ -91,10 +95,10 @@ export class QualityAssuranceTopicsComponent implements OnInit { ngAfterViewInit(): void { this.subs.push( this.notificationsStateService.isQualityAssuranceTopicsLoaded().pipe( - take(1) + take(1), ).subscribe(() => { this.getQualityAssuranceTopics(); - }) + }), ); } @@ -127,7 +131,7 @@ export class QualityAssuranceTopicsComponent implements OnInit { ).subscribe((options: PaginationComponentOptions) => { this.notificationsStateService.dispatchRetrieveQualityAssuranceTopics( options.pageSize, - options.currentPage + options.currentPage, ); }); } diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts b/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts index a7b4dddd629..e142c2a1006 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts @@ -1,26 +1,31 @@ import { Injectable } from '@angular/core'; - +import { + Actions, + createEffect, + ofType, +} from '@ngrx/effects'; import { Store } from '@ngrx/store'; -import { Actions, createEffect, ofType } from '@ngrx/effects'; import { TranslateService } from '@ngx-translate/core'; -import { catchError, map, switchMap, tap, withLatestFrom } from 'rxjs/operators'; import { of as observableOf } from 'rxjs'; +import { + catchError, + map, + switchMap, + tap, + withLatestFrom, +} from 'rxjs/operators'; +import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model'; +import { QualityAssuranceTopicDataService } from '../../../core/notifications/qa/topics/quality-assurance-topic-data.service'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { AddTopicsAction, QualityAssuranceTopicActionTypes, RetrieveAllTopicsAction, RetrieveAllTopicsErrorAction, } from './quality-assurance-topics.actions'; -import { - QualityAssuranceTopicObject -} from '../../../core/notifications/qa/models/quality-assurance-topic.model'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; import { QualityAssuranceTopicsService } from './quality-assurance-topics.service'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { - QualityAssuranceTopicDataService -} from '../../../core/notifications/qa/topics/quality-assurance-topic-data.service'; /** * Provides effect methods for the Quality Assurance topics actions. @@ -37,19 +42,19 @@ export class QualityAssuranceTopicsEffects { switchMap(([action, currentState]: [RetrieveAllTopicsAction, any]) => { return this.qualityAssuranceTopicService.getTopics( action.payload.elementsPerPage, - action.payload.currentPage + action.payload.currentPage, ).pipe( map((topics: PaginatedList) => - new AddTopicsAction(topics.page, topics.totalPages, topics.currentPage, topics.totalElements) + new AddTopicsAction(topics.page, topics.totalPages, topics.currentPage, topics.totalElements), ), catchError((error: Error) => { if (error) { console.error(error.message); } return observableOf(new RetrieveAllTopicsErrorAction()); - }) + }), ); - }) + }), )); /** @@ -59,7 +64,7 @@ export class QualityAssuranceTopicsEffects { ofType(QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR), tap(() => { this.notificationsService.error(null, this.translate.get('quality-assurance.topic.error.service.retrieve')); - }) + }), ), { dispatch: false }); /** @@ -69,7 +74,7 @@ export class QualityAssuranceTopicsEffects { ofType(QualityAssuranceTopicActionTypes.ADD_TOPICS), tap(() => { this.qualityAssuranceTopicDataService.clearFindAllTopicsRequests(); - }) + }), ), { dispatch: false }); /** @@ -87,6 +92,6 @@ export class QualityAssuranceTopicsEffects { private translate: TranslateService, private notificationsService: NotificationsService, private qualityAssuranceTopicService: QualityAssuranceTopicsService, - private qualityAssuranceTopicDataService: QualityAssuranceTopicDataService + private qualityAssuranceTopicDataService: QualityAssuranceTopicDataService, ) { } } diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts index a1c002d3f25..ccea7f4988a 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts @@ -1,13 +1,16 @@ +import { + qualityAssuranceTopicObjectMoreAbstract, + qualityAssuranceTopicObjectMorePid, +} from '../../../shared/mocks/notifications.mock'; import { AddTopicsAction, RetrieveAllTopicsAction, - RetrieveAllTopicsErrorAction + RetrieveAllTopicsErrorAction, } from './quality-assurance-topics.actions'; -import { qualityAssuranceTopicsReducer, QualityAssuranceTopicState } from './quality-assurance-topics.reducer'; import { - qualityAssuranceTopicObjectMoreAbstract, - qualityAssuranceTopicObjectMorePid -} from '../../../shared/mocks/notifications.mock'; + qualityAssuranceTopicsReducer, + QualityAssuranceTopicState, +} from './quality-assurance-topics.reducer'; describe('qualityAssuranceTopicsReducer test suite', () => { let qualityAssuranceTopicInitialState: QualityAssuranceTopicState; @@ -21,7 +24,7 @@ describe('qualityAssuranceTopicsReducer test suite', () => { loaded: false, totalPages: 0, currentPage: 0, - totalElements: 0 + totalElements: 0, }; }); @@ -54,12 +57,12 @@ describe('qualityAssuranceTopicsReducer test suite', () => { loaded: true, totalPages: 1, currentPage: 0, - totalElements: 2 + totalElements: 2, }; const action = new AddTopicsAction( [ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract ], - 1, 0, 2 + 1, 0, 2, ); const newState = qualityAssuranceTopicsReducer(qualityAssuranceTopicInitialState, action); diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts index ff94f1b8bb1..f1a644a53bf 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts @@ -1,5 +1,8 @@ import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model'; -import { QualityAssuranceTopicActionTypes, QualityAssuranceTopicsActions } from './quality-assurance-topics.actions'; +import { + QualityAssuranceTopicActionTypes, + QualityAssuranceTopicsActions, +} from './quality-assurance-topics.actions'; /** * The interface representing the Quality Assurance topic state. @@ -22,7 +25,7 @@ const qualityAssuranceTopicInitialState: QualityAssuranceTopicState = { loaded: false, totalPages: 0, currentPage: 0, - totalElements: 0 + totalElements: 0, }; /** @@ -40,7 +43,7 @@ export function qualityAssuranceTopicsReducer(state = qualityAssuranceTopicIniti case QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS: { return Object.assign({}, state, { topics: [], - processing: true + processing: true, }); } @@ -51,7 +54,7 @@ export function qualityAssuranceTopicsReducer(state = qualityAssuranceTopicIniti loaded: true, totalPages: action.payload.totalPages, currentPage: state.currentPage, - totalElements: action.payload.totalElements + totalElements: action.payload.totalElements, }); } @@ -61,7 +64,7 @@ export function qualityAssuranceTopicsReducer(state = qualityAssuranceTopicIniti loaded: true, totalPages: 0, currentPage: 0, - totalElements: 0 + totalElements: 0, }); } diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts index c6aae27a888..a4d281d25d0 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts @@ -1,21 +1,23 @@ import { TestBed } from '@angular/core/testing'; +import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { QualityAssuranceTopicsService } from './quality-assurance-topics.service'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; + +import { RequestParam } from '../../../core/cache/models/request-param.model'; import { - QualityAssuranceTopicDataService -} from '../../../core/notifications/qa/topics/quality-assurance-topic-data.service'; + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; +import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { buildPaginatedList } from '../../../core/data/paginated-list.model'; +import { QualityAssuranceTopicDataService } from '../../../core/notifications/qa/topics/quality-assurance-topic-data.service'; import { PageInfo } from '../../../core/shared/page-info.model'; import { getMockQualityAssuranceTopicRestService, qualityAssuranceTopicObjectMoreAbstract, - qualityAssuranceTopicObjectMorePid + qualityAssuranceTopicObjectMorePid, } from '../../../shared/mocks/notifications.mock'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; -import { cold } from 'jasmine-marbles'; -import { buildPaginatedList } from '../../../core/data/paginated-list.model'; -import { RequestParam } from '../../../core/cache/models/request-param.model'; -import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { QualityAssuranceTopicsService } from './quality-assurance-topics.service'; describe('QualityAssuranceTopicsService', () => { let service: QualityAssuranceTopicsService; @@ -34,8 +36,8 @@ describe('QualityAssuranceTopicsService', () => { TestBed.configureTestingModule({ providers: [ { provide: QualityAssuranceTopicDataService, useClass: getMockQualityAssuranceTopicRestService }, - { provide: QualityAssuranceTopicsService, useValue: service } - ] + { provide: QualityAssuranceTopicsService, useValue: service }, + ], }).compileComponents(); }); @@ -54,7 +56,7 @@ describe('QualityAssuranceTopicsService', () => { elementsPerPage: elementsPerPage, currentPage: currentPage, sort: sortOptions, - searchParams: [new RequestParam('source', 'ENRICH!MORE!ABSTRACT')] + searchParams: [new RequestParam('source', 'ENRICH!MORE!ABSTRACT')], }; service.setSourceId('ENRICH!MORE!ABSTRACT'); const result = service.getTopics(elementsPerPage, currentPage); @@ -63,7 +65,7 @@ describe('QualityAssuranceTopicsService', () => { it('Should return a paginated list of Quality Assurance topics', () => { const expected = cold('(a|)', { - a: paginatedList + a: paginatedList, }); const result = service.getTopics(elementsPerPage, currentPage); expect(result).toBeObservable(expected); diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.service.ts b/src/app/notifications/qa/topics/quality-assurance-topics.service.ts index 9dd581ebedc..dbabbbbfab9 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.service.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.service.ts @@ -1,17 +1,17 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - QualityAssuranceTopicDataService -} from '../../../core/notifications/qa/topics/quality-assurance-topic-data.service'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; -import { RemoteData } from '../../../core/data/remote-data'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { - QualityAssuranceTopicObject -} from '../../../core/notifications/qa/models/quality-assurance-topic.model'; + import { RequestParam } from '../../../core/cache/models/request-param.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { RemoteData } from '../../../core/data/remote-data'; +import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model'; +import { QualityAssuranceTopicDataService } from '../../../core/notifications/qa/topics/quality-assurance-topic-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; /** @@ -25,7 +25,7 @@ export class QualityAssuranceTopicsService { * @param {QualityAssuranceTopicDataService} qualityAssuranceTopicRestService */ constructor( - private qualityAssuranceTopicRestService: QualityAssuranceTopicDataService + private qualityAssuranceTopicRestService: QualityAssuranceTopicDataService, ) { } /** @@ -50,7 +50,7 @@ export class QualityAssuranceTopicsService { elementsPerPage: elementsPerPage, currentPage: currentPage, sort: sortOptions, - searchParams: [new RequestParam('source', this.sourceId)] + searchParams: [new RequestParam('source', this.sourceId)], }; return this.qualityAssuranceTopicRestService.getTopics(findListOptions).pipe( @@ -61,7 +61,7 @@ export class QualityAssuranceTopicsService { } else { throw new Error('Can\'t retrieve Quality Assurance topics from the Broker topics REST service'); } - }) + }), ); } diff --git a/src/app/notifications/selectors.ts b/src/app/notifications/selectors.ts index 63b2da7a100..10090d21dc1 100644 --- a/src/app/notifications/selectors.ts +++ b/src/app/notifications/selectors.ts @@ -1,12 +1,18 @@ -import { createFeatureSelector, createSelector, MemoizedSelector } from '@ngrx/store'; -import { subStateSelector } from '../shared/selector.util'; -import { suggestionNotificationsSelector, SuggestionNotificationsState } from './notifications.reducer'; +import { + createFeatureSelector, + createSelector, + MemoizedSelector, +} from '@ngrx/store'; + +import { QualityAssuranceSourceObject } from '../core/notifications/qa/models/quality-assurance-source.model'; import { QualityAssuranceTopicObject } from '../core/notifications/qa/models/quality-assurance-topic.model'; -import { QualityAssuranceTopicState } from './qa/topics/quality-assurance-topics.reducer'; -import { QualityAssuranceSourceState } from './qa/source/quality-assurance-source.reducer'; +import { subStateSelector } from '../shared/selector.util'; import { - QualityAssuranceSourceObject -} from '../core/notifications/qa/models/quality-assurance-source.model'; + suggestionNotificationsSelector, + SuggestionNotificationsState, +} from './notifications.reducer'; +import { QualityAssuranceSourceState } from './qa/source/quality-assurance-source.reducer'; +import { QualityAssuranceTopicState } from './qa/topics/quality-assurance-topics.reducer'; /** * Returns the Notifications state. @@ -43,7 +49,7 @@ export function qualityAssuranceTopicsObjectSelector(): MemoizedSelector state.qaTopic.loaded + (state: SuggestionNotificationsState) => state.qaTopic.loaded, ); /** @@ -52,7 +58,7 @@ export const isQualityAssuranceTopicsLoadedSelector = createSelector(_getNotific * @return {boolean} */ export const isQualityAssuranceTopicsProcessingSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaTopic.processing + (state: SuggestionNotificationsState) => state.qaTopic.processing, ); /** @@ -61,7 +67,7 @@ export const isQualityAssuranceTopicsProcessingSelector = createSelector(_getNot * @return {number} */ export const getQualityAssuranceTopicsTotalPagesSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaTopic.totalPages + (state: SuggestionNotificationsState) => state.qaTopic.totalPages, ); /** @@ -70,7 +76,7 @@ export const getQualityAssuranceTopicsTotalPagesSelector = createSelector(_getNo * @return {number} */ export const getQualityAssuranceTopicsCurrentPageSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaTopic.currentPage + (state: SuggestionNotificationsState) => state.qaTopic.currentPage, ); /** @@ -79,7 +85,7 @@ export const getQualityAssuranceTopicsCurrentPageSelector = createSelector(_getN * @return {number} */ export const getQualityAssuranceTopicsTotalsSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaTopic.totalElements + (state: SuggestionNotificationsState) => state.qaTopic.totalElements, ); // Quality Assurance source @@ -90,7 +96,7 @@ export const getQualityAssuranceTopicsTotalsSelector = createSelector(_getNotifi * @function qualityAssuranceSourceStateSelector * @return {QualityAssuranceSourceState} */ - export function qualityAssuranceSourceStateSelector(): MemoizedSelector { +export function qualityAssuranceSourceStateSelector(): MemoizedSelector { return subStateSelector(suggestionNotificationsSelector, 'qaSource'); } @@ -109,7 +115,7 @@ export function qualityAssuranceSourceObjectSelector(): MemoizedSelector state.qaSource.loaded + (state: SuggestionNotificationsState) => state.qaSource.loaded, ); /** @@ -118,7 +124,7 @@ export const isQualityAssuranceSourceLoadedSelector = createSelector(_getNotific * @return {boolean} */ export const isQualityAssuranceSourceProcessingSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaSource.processing + (state: SuggestionNotificationsState) => state.qaSource.processing, ); /** @@ -127,7 +133,7 @@ export const isQualityAssuranceSourceProcessingSelector = createSelector(_getNot * @return {number} */ export const getQualityAssuranceSourceTotalPagesSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaSource.totalPages + (state: SuggestionNotificationsState) => state.qaSource.totalPages, ); /** @@ -136,7 +142,7 @@ export const getQualityAssuranceSourceTotalPagesSelector = createSelector(_getNo * @return {number} */ export const getQualityAssuranceSourceCurrentPageSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaSource.currentPage + (state: SuggestionNotificationsState) => state.qaSource.currentPage, ); /** @@ -145,5 +151,5 @@ export const getQualityAssuranceSourceCurrentPageSelector = createSelector(_getN * @return {number} */ export const getQualityAssuranceSourceTotalsSelector = createSelector(_getNotificationsState, - (state: SuggestionNotificationsState) => state.qaSource.totalElements + (state: SuggestionNotificationsState) => state.qaSource.totalElements, ); diff --git a/src/app/shared/mocks/notifications.mock.ts b/src/app/shared/mocks/notifications.mock.ts index 707b9a9e6ab..9c60a22d014 100644 --- a/src/app/shared/mocks/notifications.mock.ts +++ b/src/app/shared/mocks/notifications.mock.ts @@ -1,28 +1,19 @@ import { of as observableOf } from 'rxjs'; -import { ResourceType } from '../../core/shared/resource-type'; -import { - QualityAssuranceTopicObject -} from '../../core/notifications/qa/models/quality-assurance-topic.model'; -import { - QualityAssuranceEventObject -} from '../../core/notifications/qa/models/quality-assurance-event.model'; -import { - QualityAssuranceTopicDataService -} from '../../core/notifications/qa/topics/quality-assurance-topic-data.service'; -import { - QualityAssuranceEventDataService -} from '../../core/notifications/qa/events/quality-assurance-event-data.service'; + +import { QualityAssuranceEventDataService } from '../../core/notifications/qa/events/quality-assurance-event-data.service'; +import { QualityAssuranceEventObject } from '../../core/notifications/qa/models/quality-assurance-event.model'; +import { QualityAssuranceSourceObject } from '../../core/notifications/qa/models/quality-assurance-source.model'; +import { QualityAssuranceTopicObject } from '../../core/notifications/qa/models/quality-assurance-topic.model'; +import { QualityAssuranceTopicDataService } from '../../core/notifications/qa/topics/quality-assurance-topic-data.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; +import { ResourceType } from '../../core/shared/resource-type'; import { createNoContentRemoteDataObject$, createSuccessfulRemoteDataObject, - createSuccessfulRemoteDataObject$ + createSuccessfulRemoteDataObject$, } from '../remote-data.utils'; import { SearchResult } from '../search/models/search-result.model'; -import { - QualityAssuranceSourceObject -} from '../../core/notifications/qa/models/quality-assurance-source.model'; // REST Mock --------------------------------------------------------------------- // ------------------------------------------------------------------------------- @@ -40,8 +31,8 @@ const ItemMockPid1: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174001', uuid: 'ITEM4567-e89b-12d3-a456-426614174001', @@ -50,103 +41,103 @@ const ItemMockPid1: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Index nominum et rerum' - } + value: 'Index nominum et rerum', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); const ItemMockPid2: Item = Object.assign( @@ -159,8 +150,8 @@ const ItemMockPid2: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174004', uuid: 'ITEM4567-e89b-12d3-a456-426614174004', @@ -169,103 +160,103 @@ const ItemMockPid2: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'UNA NUOVA RILETTURA DELL\u0027 ARISTOTELE DI FRANZ BRENTANO ALLA LUCE DI ALCUNI INEDITI' - } + value: 'UNA NUOVA RILETTURA DELL\u0027 ARISTOTELE DI FRANZ BRENTANO ALLA LUCE DI ALCUNI INEDITI', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); const ItemMockPid3: Item = Object.assign( @@ -278,8 +269,8 @@ const ItemMockPid3: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174005', uuid: 'ITEM4567-e89b-12d3-a456-426614174005', @@ -288,103 +279,103 @@ const ItemMockPid3: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Sustainable development' - } + value: 'Sustainable development', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); const ItemMockPid4: Item = Object.assign( @@ -397,8 +388,8 @@ const ItemMockPid4: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174006', uuid: 'ITEM4567-e89b-12d3-a456-426614174006', @@ -407,103 +398,103 @@ const ItemMockPid4: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Reply to Critics' - } + value: 'Reply to Critics', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); const ItemMockPid5: Item = Object.assign( @@ -516,8 +507,8 @@ const ItemMockPid5: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174007', uuid: 'ITEM4567-e89b-12d3-a456-426614174007', @@ -526,103 +517,103 @@ const ItemMockPid5: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'PROGETTAZIONE, SINTESI E VALUTAZIONE DELL\u0027ATTIVITA\u0027 ANTIMICOBATTERICA ED ANTIFUNGINA DI NUOVI DERIVATI ETEROCICLICI' - } + value: 'PROGETTAZIONE, SINTESI E VALUTAZIONE DELL\u0027ATTIVITA\u0027 ANTIMICOBATTERICA ED ANTIFUNGINA DI NUOVI DERIVATI ETEROCICLICI', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); const ItemMockPid6: Item = Object.assign( @@ -635,8 +626,8 @@ const ItemMockPid6: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174008', uuid: 'ITEM4567-e89b-12d3-a456-426614174008', @@ -645,103 +636,103 @@ const ItemMockPid6: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Donald Davidson' - } + value: 'Donald Davidson', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); const ItemMockPid7: Item = Object.assign( @@ -754,8 +745,8 @@ const ItemMockPid7: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174009', uuid: 'ITEM4567-e89b-12d3-a456-426614174009', @@ -764,103 +755,103 @@ const ItemMockPid7: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Missing abstract article' - } + value: 'Missing abstract article', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); export const ItemMockPid8: Item = Object.assign( @@ -873,8 +864,8 @@ export const ItemMockPid8: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174002', uuid: 'ITEM4567-e89b-12d3-a456-426614174002', @@ -883,103 +874,103 @@ export const ItemMockPid8: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Egypt, crossroad of translations and literary interweavings (3rd-6th centuries). A reconsideration of earlier Coptic literature' - } + value: 'Egypt, crossroad of translations and literary interweavings (3rd-6th centuries). A reconsideration of earlier Coptic literature', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); export const ItemMockPid9: Item = Object.assign( @@ -992,8 +983,8 @@ export const ItemMockPid9: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'ITEM4567-e89b-12d3-a456-426614174003', uuid: 'ITEM4567-e89b-12d3-a456-426614174003', @@ -1002,103 +993,103 @@ export const ItemMockPid9: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Morocco, crossroad of translations and literary interweavings (3rd-6th centuries). A reconsideration of earlier Coptic literature' - } + value: 'Morocco, crossroad of translations and literary interweavings (3rd-6th centuries). A reconsideration of earlier Coptic literature', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); export const ItemMockPid10: Item = Object.assign( @@ -1111,8 +1102,8 @@ export const ItemMockPid10: Item = Object.assign( isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'P23e4567-e89b-12d3-a456-426614174002', uuid: 'P23e4567-e89b-12d3-a456-426614174002', @@ -1121,103 +1112,103 @@ export const ItemMockPid10: Item = Object.assign( 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Tracking Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage' - } + value: 'Tracking Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); export const NotificationsMockDspaceObject: SearchResult = Object.assign( @@ -1230,8 +1221,8 @@ export const NotificationsMockDspaceObject: SearchResult = Object. isWithdrawn: false, _links:{ self: { - href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' - } + href: 'https://rest.api/rest/api/core/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357', + }, }, id: 'P23e4567-e89b-12d3-a456-426614174002', uuid: 'P23e4567-e89b-12d3-a456-426614174002', @@ -1240,103 +1231,103 @@ export const NotificationsMockDspaceObject: SearchResult = Object. 'dc.creator': [ { language: 'en_US', - value: 'Doe, Jane' - } + value: 'Doe, Jane', + }, ], 'dc.date.accessioned': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.available': [ { language: null, - value: '1650-06-26T19:58:25Z' - } + value: '1650-06-26T19:58:25Z', + }, ], 'dc.date.issued': [ { language: null, - value: '1650-06-26' - } + value: '1650-06-26', + }, ], 'dc.identifier.issn': [ { language: 'en_US', - value: '123456789' - } + value: '123456789', + }, ], 'dc.identifier.uri': [ { language: null, - value: 'https://demo.dspace.org/handle/10673/6' - } + value: 'https://demo.dspace.org/handle/10673/6', + }, ], 'dc.description.abstract': [ { language: 'en_US', - value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!' - } + value: 'This is really just a sample abstract. If it was a real abstract it would contain useful information about this test document. Sorry though, nothing useful in this paragraph. You probably shouldn\'t have even bothered to read it!', + }, ], 'dc.description.provenance': [ { language: 'en', - value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)' + value: 'Made available in DSpace on 2012-06-26T19:58:25Z (GMT). No. of bitstreams: 2\r\ntest_ppt.ppt: 12707328 bytes, checksum: a353fc7d29b3c558c986f7463a41efd3 (MD5)\r\ntest_ppt.pptx: 12468572 bytes, checksum: 599305edb4ebee329667f2c35b14d1d6 (MD5)', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T09:17:34Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).' + value: 'Restored into DSpace on 2013-06-13T11:04:16Z (GMT).', }, { language: 'en', - value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).' - } + value: 'Restored into DSpace on 2017-04-24T19:44:08Z (GMT).', + }, ], 'dc.language': [ { language: 'en_US', - value: 'en' - } + value: 'en', + }, ], 'dc.rights': [ { language: 'en_US', - value: '© Jane Doe' - } + value: '© Jane Doe', + }, ], 'dc.subject': [ { language: 'en_US', - value: 'keyword1' + value: 'keyword1', }, { language: 'en_US', - value: 'keyword2' + value: 'keyword2', }, { language: 'en_US', - value: 'keyword3' - } + value: 'keyword3', + }, ], 'dc.title': [ { language: 'en_US', - value: 'Tracking Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage' - } + value: 'Tracking Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage', + }, ], 'dc.type': [ { language: 'en_US', - value: 'text' - } - ] - } - } + value: 'text', + }, + ], + }, + }, ); // Sources @@ -1349,9 +1340,9 @@ export const qualityAssuranceSourceObjectMorePid: QualityAssuranceSourceObject = totalEvents: 33, _links: { self: { - href: 'https://rest.api/rest/api/integration/qasources/ENRICH!MORE!PID' - } - } + href: 'https://rest.api/rest/api/integration/qasources/ENRICH!MORE!PID', + }, + }, }; export const qualityAssuranceSourceObjectMoreAbstract: QualityAssuranceSourceObject = { @@ -1361,9 +1352,9 @@ export const qualityAssuranceSourceObjectMoreAbstract: QualityAssuranceSourceObj totalEvents: 5, _links: { self: { - href: 'https://rest.api/rest/api/integration/qasources/ENRICH!MORE!ABSTRACT' - } - } + href: 'https://rest.api/rest/api/integration/qasources/ENRICH!MORE!ABSTRACT', + }, + }, }; export const qualityAssuranceSourceObjectMissingPid: QualityAssuranceSourceObject = { @@ -1373,9 +1364,9 @@ export const qualityAssuranceSourceObjectMissingPid: QualityAssuranceSourceObjec totalEvents: 4, _links: { self: { - href: 'https://rest.api/rest/api/integration/qasources/ENRICH!MISSING!PID' - } - } + href: 'https://rest.api/rest/api/integration/qasources/ENRICH!MISSING!PID', + }, + }, }; // Topics @@ -1389,9 +1380,9 @@ export const qualityAssuranceTopicObjectMorePid: QualityAssuranceTopicObject = { totalEvents: 33, _links: { self: { - href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MORE!PID' - } - } + href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MORE!PID', + }, + }, }; export const qualityAssuranceTopicObjectMoreAbstract: QualityAssuranceTopicObject = { @@ -1402,9 +1393,9 @@ export const qualityAssuranceTopicObjectMoreAbstract: QualityAssuranceTopicObjec totalEvents: 5, _links: { self: { - href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MORE!ABSTRACT' - } - } + href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MORE!ABSTRACT', + }, + }, }; export const qualityAssuranceTopicObjectMissingPid: QualityAssuranceTopicObject = { @@ -1415,9 +1406,9 @@ export const qualityAssuranceTopicObjectMissingPid: QualityAssuranceTopicObject totalEvents: 4, _links: { self: { - href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!PID' - } - } + href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!PID', + }, + }, }; export const qualityAssuranceTopicObjectMissingAbstract: QualityAssuranceTopicObject = { @@ -1428,9 +1419,9 @@ export const qualityAssuranceTopicObjectMissingAbstract: QualityAssuranceTopicOb totalEvents: 71, _links: { self: { - href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!ABSTRACT' - } - } + href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!ABSTRACT', + }, + }, }; export const qualityAssuranceTopicObjectMissingAcm: QualityAssuranceTopicObject = { @@ -1441,9 +1432,9 @@ export const qualityAssuranceTopicObjectMissingAcm: QualityAssuranceTopicObject totalEvents: 18, _links: { self: { - href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!SUBJECT!ACM' - } - } + href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!SUBJECT!ACM', + }, + }, }; export const qualityAssuranceTopicObjectMissingProject: QualityAssuranceTopicObject = { @@ -1454,9 +1445,9 @@ export const qualityAssuranceTopicObjectMissingProject: QualityAssuranceTopicObj totalEvents: 6, _links: { self: { - href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!PROJECT' - } - } + href: 'https://rest.api/rest/api/integration/qatopics/ENRICH!MISSING!PROJECT', + }, + }, }; // Events @@ -1482,21 +1473,21 @@ export const qualityAssuranceEventObjectMissingPid: QualityAssuranceEventObject funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174001', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174001/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174001/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174001/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174001/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid1)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject = { @@ -1519,21 +1510,21 @@ export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174004/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid2)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject = { @@ -1556,21 +1547,21 @@ export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174005/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid3)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject = { @@ -1593,21 +1584,21 @@ export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174006/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid4)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject = { @@ -1630,21 +1621,21 @@ export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174007/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid5)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject = { @@ -1667,21 +1658,21 @@ export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174008/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid6)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventObject = { @@ -1704,21 +1695,21 @@ export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventOb funder: null, fundingProgram: null, jurisdiction: null, - title: null + title: null, }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174009/related', + }, }, target: observableOf(createSuccessfulRemoteDataObject(ItemMockPid7)), - related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)) + related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10)), }; export const qualityAssuranceEventObjectMissingProjectFound: QualityAssuranceEventObject = { @@ -1741,21 +1732,21 @@ export const qualityAssuranceEventObjectMissingProjectFound: QualityAssuranceEve funder: 'EC', fundingProgram: 'H2020', jurisdiction: 'EU', - title: 'Tracking Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage' + title: 'Tracking Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage', }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174002' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174002', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174002/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174002/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174002/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174002/related', + }, }, target: createSuccessfulRemoteDataObject$(ItemMockPid8), - related: createSuccessfulRemoteDataObject$(ItemMockPid10) + related: createSuccessfulRemoteDataObject$(ItemMockPid10), }; export const qualityAssuranceEventObjectMissingProjectNotFound: QualityAssuranceEventObject = { @@ -1778,21 +1769,21 @@ export const qualityAssuranceEventObjectMissingProjectNotFound: QualityAssurance funder: 'EC', fundingProgram: 'H2021', jurisdiction: 'EU', - title: 'Tracking Unknown Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage' + title: 'Tracking Unknown Papyrus and Parchment Paths: An Archaeological Atlas of Coptic Literature.\nLiterary Texts in their Geographical Context: Production, Copying, Usage, Dissemination and Storage', }, _links: { self: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174003' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174003', }, target: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174003/target' + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174003/target', }, related: { - href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174003/related' - } + href: 'https://rest.api/rest/api/integration/qaevents/123e4567-e89b-12d3-a456-426614174003/related', + }, }, target: createSuccessfulRemoteDataObject$(ItemMockPid9), - related: createNoContentRemoteDataObject$() + related: createNoContentRemoteDataObject$(), }; // Classes @@ -1819,14 +1810,14 @@ export function getMockNotificationsStateService(): any { getQualityAssuranceSourceCurrentPage: jasmine.createSpy('getQualityAssuranceSourceCurrentPage'), getQualityAssuranceSourceTotals: jasmine.createSpy('getQualityAssuranceSourceTotals'), dispatchRetrieveQualityAssuranceSource: jasmine.createSpy('dispatchRetrieveQualityAssuranceSource'), - dispatchMarkUserSuggestionsAsVisitedAction: jasmine.createSpy('dispatchMarkUserSuggestionsAsVisitedAction') + dispatchMarkUserSuggestionsAsVisitedAction: jasmine.createSpy('dispatchMarkUserSuggestionsAsVisitedAction'), }); } /** * Mock for [[QualityAssuranceSourceDataService]] */ - export function getMockQualityAssuranceSourceRestService(): QualityAssuranceTopicDataService { +export function getMockQualityAssuranceSourceRestService(): QualityAssuranceTopicDataService { return jasmine.createSpyObj('QualityAssuranceSourceDataService', { getSources: jasmine.createSpy('getSources'), getSource: jasmine.createSpy('getSource'), @@ -1853,7 +1844,7 @@ export function getMockQualityAssuranceEventRestService(): QualityAssuranceEvent patchEvent: jasmine.createSpy('patchEvent'), boundProject: jasmine.createSpy('boundProject'), removeProject: jasmine.createSpy('removeProject'), - clearFindByTopicRequests: jasmine.createSpy('.clearFindByTopicRequests') + clearFindByTopicRequests: jasmine.createSpy('.clearFindByTopicRequests'), }); } diff --git a/src/app/shared/selector.util.ts b/src/app/shared/selector.util.ts index 7ea73347b7c..a0419086c64 100644 --- a/src/app/shared/selector.util.ts +++ b/src/app/shared/selector.util.ts @@ -1,4 +1,8 @@ -import { createSelector, MemoizedSelector } from '@ngrx/store'; +import { + createSelector, + MemoizedSelector, +} from '@ngrx/store'; + import { hasValue } from './empty.util'; /** diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts index 742b6fc0f43..6f65deeff32 100644 --- a/src/config/app-config.interface.ts +++ b/src/config/app-config.interface.ts @@ -17,9 +17,9 @@ import { InfoConfig } from './info-config.interface'; import { ItemConfig } from './item-config.interface'; import { LangConfig } from './lang-config.interface'; import { MarkdownConfig } from './markdown-config.interface'; -import { QualityAssuranceConfig } from './quality-assurance.config'; import { MediaViewerConfig } from './media-viewer-config.interface'; import { INotificationBoardOptions } from './notifications-config.interfaces'; +import { QualityAssuranceConfig } from './quality-assurance.config'; import { ServerConfig } from './server-config.interface'; import { SubmissionConfig } from './submission-config.interface'; import { ThemeConfig } from './theme.config'; diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 88d548cb7f9..24d310fe0e6 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -18,11 +18,11 @@ import { LangConfig } from './lang-config.interface'; import { MarkdownConfig } from './markdown-config.interface'; import { MediaViewerConfig } from './media-viewer-config.interface'; import { INotificationBoardOptions } from './notifications-config.interfaces'; +import { QualityAssuranceConfig } from './quality-assurance.config'; import { ServerConfig } from './server-config.interface'; import { SubmissionConfig } from './submission-config.interface'; import { ThemeConfig } from './theme.config'; import { UIServerConfig } from './ui-server-config.interface'; -import { QualityAssuranceConfig } from './quality-assurance.config'; export class DefaultAppConfig implements AppConfig { production = false; @@ -438,7 +438,7 @@ export class DefaultAppConfig implements AppConfig { qualityAssuranceConfig: QualityAssuranceConfig = { sourceUrlMapForProjectSearch: { - openaire: 'https://explore.openaire.eu/search/project?projectId=' + openaire: 'https://explore.openaire.eu/search/project?projectId=', }, pageSize: 5, }; diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index ffc3954ae4a..ed7178484f0 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -309,7 +309,7 @@ export const environment: BuildConfig = { }, qualityAssuranceConfig: { sourceUrlMapForProjectSearch: { - openaire: 'https://explore.openaire.eu/search/project?projectId=' + openaire: 'https://explore.openaire.eu/search/project?projectId=', }, pageSize: 5, },