ESLint: fix object-curly-spacing

This commit is contained in:
Yury Bondarenko
2023-06-27 17:29:40 +02:00
parent 436a4d7645
commit 0633460107
280 changed files with 765 additions and 765 deletions

View File

@@ -135,7 +135,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
initialisePage() {
this.searching$.next(true);
this.isEPersonFormShown = false;
this.search({scope: this.currentSearchScope, query: this.currentSearchQuery});
this.search({ scope: this.currentSearchScope, query: this.currentSearchQuery });
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
if (eperson != null && eperson.id) {
this.isEPersonFormShown = true;
@@ -260,7 +260,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
if (hasValue(ePerson.id)) {
this.epersonService.deleteEPerson(ePerson).pipe(getFirstCompletedRemoteData()).subscribe((restResponse: RemoteData<NoContent>) => {
if (restResponse.hasSucceeded) {
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', {name: this.dsoNameService.getName(ePerson)}));
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(ePerson) }));
} else {
this.notificationsService.error('Error occured when trying to delete EPerson with id: ' + ePerson.id + ' with code: ' + restResponse.statusCode + ' and message: ' + restResponse.errorMessage);
}
@@ -301,7 +301,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
this.searchForm.patchValue({
query: '',
});
this.search({query: ''});
this.search({ query: '' });
}
/**

View File

@@ -226,7 +226,7 @@ describe('EPersonFormComponent', () => {
{ provide: AuthService, useValue: authService },
{ provide: AuthorizationDataService, useValue: authorizationService },
{ provide: PaginationService, useValue: paginationService },
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])},
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
{ provide: EpersonRegistrationService, useValue: epersonRegistrationService },
EPeopleRegistryComponent,
],

View File

@@ -549,10 +549,10 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
.subscribe((response: RemoteData<Registration>) => {
if (response.hasSucceeded) {
this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'),
this.translateService.get('forgot-email.form.success.content', {email: this.epersonInitial.email}));
this.translateService.get('forgot-email.form.success.content', { email: this.epersonInitial.email }));
} else {
this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'),
this.translateService.get('forgot-email.form.error.content', {email: this.epersonInitial.email}));
this.translateService.get('forgot-email.form.error.content', { email: this.epersonInitial.email }));
}
},
);

View File

@@ -3,7 +3,7 @@ import {
ValidationErrors,
} from '@angular/forms';
import { Observable } from 'rxjs';
import { map} from 'rxjs/operators';
import { map } from 'rxjs/operators';
import { GroupDataService } from '../../../../core/eperson/group-data.service';
import { Group } from '../../../../core/eperson/models/group.model';

View File

@@ -54,7 +54,7 @@ describe('GroupPageGuard', () => {
it('should return true', (done) => {
guard.canActivate(
routeSnapshotWithGroupId, { url: 'current-url'} as any,
routeSnapshotWithGroupId, { url: 'current-url' } as any,
).subscribe((result) => {
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
FeatureID.CanManageGroup, groupEndpointUrl, undefined,
@@ -72,7 +72,7 @@ describe('GroupPageGuard', () => {
it('should not return true', (done) => {
guard.canActivate(
routeSnapshotWithGroupId, { url: 'current-url'} as any,
routeSnapshotWithGroupId, { url: 'current-url' } as any,
).subscribe((result) => {
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
FeatureID.CanManageGroup, groupEndpointUrl, undefined,

View File

@@ -147,7 +147,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
const query: string = data.query;
if (query != null && this.currentSearchQuery !== query) {
this.currentSearchQuery = query;
this.paginationService.updateRouteWithUrl(this.config.id, [], {page: 1});
this.paginationService.updateRouteWithUrl(this.config.id, [], { page: 1 });
}
return this.groupService.searchGroups(this.currentSearchQuery.trim(), {
currentPage: paginationOptions.currentPage,

View File

@@ -12,7 +12,7 @@ import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.compo
{
path: 'metadata',
resolve: { breadcrumb: I18nBreadcrumbResolver },
data: {title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata'},
data: { title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata' },
children: [
{
path: '',
@@ -22,7 +22,7 @@ import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.compo
path: ':schemaName',
resolve: { breadcrumb: I18nBreadcrumbResolver },
component: MetadataSchemaComponent,
data: {title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema'},
data: { title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema' },
},
],
},
@@ -31,7 +31,7 @@ import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.compo
resolve: { breadcrumb: I18nBreadcrumbResolver },
loadChildren: () => import('./bitstream-formats/bitstream-formats.module')
.then((m) => m.BitstreamFormatsModule),
data: {title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats'},
data: { title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats' },
},
]),
],

View File

@@ -21,7 +21,7 @@ const BITSTREAMFORMAT_ADD_PATH = 'add';
path: BITSTREAMFORMAT_ADD_PATH,
resolve: { breadcrumb: I18nBreadcrumbResolver },
component: AddBitstreamFormatComponent,
data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'},
data: { breadcrumbKey: 'admin.registries.bitstream-formats.create' },
},
{
path: BITSTREAMFORMAT_EDIT_PATH,
@@ -30,7 +30,7 @@ const BITSTREAMFORMAT_ADD_PATH = 'add';
bitstreamFormat: BitstreamFormatsResolver,
breadcrumb: I18nBreadcrumbResolver,
},
data: {breadcrumbKey: 'admin.registries.bitstream-formats.edit'},
data: { breadcrumbKey: 'admin.registries.bitstream-formats.edit' },
},
]),
],

View File

@@ -141,7 +141,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy {
const messages = observableCombineLatest(
this.translateService.get(`${prefix}.${suffix}.head`),
this.translateService.get(`${prefix}.${suffix}.amount`, {amount: amount}),
this.translateService.get(`${prefix}.${suffix}.amount`, { amount: amount }),
);
messages.subscribe(([head, content]) => {

View File

@@ -50,9 +50,9 @@ export class FormatFormComponent implements OnInit {
/**
* The different supported support level of the bitstream format
*/
supportLevelOptions = [{label: BitstreamFormatSupportLevel.Known, value: BitstreamFormatSupportLevel.Known},
{label: BitstreamFormatSupportLevel.Unknown, value: BitstreamFormatSupportLevel.Unknown},
{label: BitstreamFormatSupportLevel.Supported, value: BitstreamFormatSupportLevel.Supported}];
supportLevelOptions = [{ label: BitstreamFormatSupportLevel.Known, value: BitstreamFormatSupportLevel.Known },
{ label: BitstreamFormatSupportLevel.Unknown, value: BitstreamFormatSupportLevel.Unknown },
{ label: BitstreamFormatSupportLevel.Supported, value: BitstreamFormatSupportLevel.Supported }];
/**
* Styling element for repeatable field

View File

@@ -173,7 +173,7 @@ export class MetadataRegistryComponent {
const suffix = success ? 'success' : 'failure';
const messages = observableCombineLatest(
this.translateService.get(success ? `${prefix}.${suffix}` : `${prefix}.${suffix}`),
this.translateService.get(`${prefix}.deleted.${suffix}`, {amount: amount}),
this.translateService.get(`${prefix}.deleted.${suffix}`, { amount: amount }),
);
messages.subscribe(([head, content]) => {
if (success) {

View File

@@ -52,7 +52,7 @@ import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow
path: 'system-wide-alert',
resolve: { breadcrumb: I18nBreadcrumbResolver },
loadChildren: () => import('../system-wide-alert/system-wide-alert.module').then((m) => m.SystemWideAlertModule),
data: {title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert'},
data: { title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert' },
},
]),
],

View File

@@ -44,7 +44,7 @@ export class AdminSearchModule {
static withEntryComponents() {
return {
ngModule: SharedModule,
providers: ENTRY_COMPONENTS.map((component) => ({provide: component})),
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
};
}
}

View File

@@ -28,9 +28,9 @@ describe('AdminSidebarSectionComponent', () => {
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot()],
declarations: [AdminSidebarSectionComponent, TestComponent],
providers: [
{provide: 'sectionDataProvider', useValue: {model: {link: 'google.com'}, icon: iconString}},
{provide: MenuService, useValue: menuService},
{provide: CSSVariableService, useClass: CSSVariableServiceStub},
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } },
{ provide: MenuService, useValue: menuService },
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
],
}).overrideComponent(AdminSidebarSectionComponent, {
set: {
@@ -68,9 +68,9 @@ describe('AdminSidebarSectionComponent', () => {
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot()],
declarations: [AdminSidebarSectionComponent, TestComponent],
providers: [
{provide: 'sectionDataProvider', useValue: {model: {link: 'google.com', disabled: true}, icon: iconString}},
{provide: MenuService, useValue: menuService},
{provide: CSSVariableService, useClass: CSSVariableServiceStub},
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } },
{ provide: MenuService, useValue: menuService },
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
],
}).overrideComponent(AdminSidebarSectionComponent, {
set: {

View File

@@ -45,7 +45,7 @@ export class AdminWorkflowModuleModule {
static withEntryComponents() {
return {
ngModule: SharedModule,
providers: ENTRY_COMPONENTS.map((component) => ({provide: component})),
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
};
}
}

View File

@@ -46,7 +46,7 @@ export class AdminModule {
static withEntryComponents() {
return {
ngModule: AdminModule,
providers: ENTRY_COMPONENTS.map((component) => ({provide: component})),
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
};
}
}

View File

@@ -38,7 +38,7 @@ import {
formReducer,
FormState,
} from './shared/form/form.reducer';
import { menusReducer} from './shared/menu/menu.reducer';
import { menusReducer } from './shared/menu/menu.reducer';
import { MenusState } from './shared/menu/menus-state.model';
import {
notificationsReducer,

View File

@@ -111,7 +111,7 @@ export class BitstreamDownloadPageComponent implements OnInit {
} else if (isAuthorized && !isLoggedIn) {
this.hardRedirectService.redirect(bitstream._links.content.href);
} else if (!isAuthorized && isLoggedIn) {
this.router.navigateByUrl(getForbiddenRoute(), {skipLocationChange: true});
this.router.navigateByUrl(getForbiddenRoute(), { skipLocationChange: true });
} else if (!isAuthorized && !isLoggedIn) {
this.auth.setRedirectUrl(this.router.url);
this.router.navigateByUrl('login');

View File

@@ -316,7 +316,7 @@ describe('EditBitstreamPageComponent', () => {
});
it('should call put with the correct bitstream on the PrimaryBitstreamService', () => {
expect(primaryBitstreamService.put).toHaveBeenCalledWith(jasmine.objectContaining({uuid: currentPrimary}), bundle);
expect(primaryBitstreamService.put).toHaveBeenCalledWith(jasmine.objectContaining({ uuid: currentPrimary }), bundle);
});
});
@@ -327,7 +327,7 @@ describe('EditBitstreamPageComponent', () => {
});
it('should call create with the correct bitstream on the PrimaryBitstreamService', () => {
expect(primaryBitstreamService.create).toHaveBeenCalledWith(jasmine.objectContaining({uuid: currentPrimary}), bundle);
expect(primaryBitstreamService.create).toHaveBeenCalledWith(jasmine.objectContaining({ uuid: currentPrimary }), bundle);
});
});
});
@@ -507,18 +507,18 @@ describe('EditBitstreamPageComponent', () => {
imports: [TranslateModule.forRoot(), RouterTestingModule],
declarations: [EditBitstreamPageComponent, FileSizePipe, VarDirective],
providers: [
{provide: NotificationsService, useValue: notificationsService},
{provide: DynamicFormService, useValue: formService},
{ provide: NotificationsService, useValue: notificationsService },
{ provide: DynamicFormService, useValue: formService },
{
provide: ActivatedRoute,
useValue: {
data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}),
snapshot: {queryParams: {}},
data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
snapshot: { queryParams: {} },
},
},
{provide: BitstreamDataService, useValue: bitstreamService},
{provide: DSONameService, useValue: dsoNameService},
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
{ provide: BitstreamDataService, useValue: bitstreamService },
{ provide: DSONameService, useValue: dsoNameService },
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
{ provide: PrimaryBitstreamService, useValue: primaryBitstreamService },
ChangeDetectorRef,
],
@@ -632,17 +632,17 @@ describe('EditBitstreamPageComponent', () => {
imports: [TranslateModule.forRoot(), RouterTestingModule],
declarations: [EditBitstreamPageComponent, FileSizePipe, VarDirective],
providers: [
{provide: NotificationsService, useValue: notificationsService},
{provide: DynamicFormService, useValue: formService},
{provide: ActivatedRoute,
{ provide: NotificationsService, useValue: notificationsService },
{ provide: DynamicFormService, useValue: formService },
{ provide: ActivatedRoute,
useValue: {
data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}),
snapshot: {queryParams: {}},
data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
snapshot: { queryParams: {} },
},
},
{provide: BitstreamDataService, useValue: bitstreamService},
{provide: DSONameService, useValue: dsoNameService},
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
{ provide: BitstreamDataService, useValue: bitstreamService },
{ provide: DSONameService, useValue: dsoNameService },
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
{ provide: PrimaryBitstreamService, useValue: primaryBitstreamService },
ChangeDetectorRef,
],

View File

@@ -22,7 +22,7 @@ import {
hasValue,
isUndefined,
} from '../shared/empty.util';
import {Breadcrumb} from './breadcrumb/breadcrumb.model';
import { Breadcrumb } from './breadcrumb/breadcrumb.model';
@Injectable({
providedIn: 'root',

View File

@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import {

View File

@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import {

View File

@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import {

View File

@@ -54,7 +54,7 @@ export class BrowseByModule {
static withEntryComponents() {
return {
ngModule: SharedBrowseByModule,
providers: ENTRY_COMPONENTS.map((component) => ({provide: component})),
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
};
}
}

View File

@@ -82,7 +82,7 @@ export class CollectionItemMapperComponent implements OnInit {
* A view on the tabset element
* Used to switch tabs programmatically
*/
@ViewChild('tabs', {static: false}) tabs;
@ViewChild('tabs', { static: false }) tabs;
/**
* The collection to map items to

View File

@@ -39,7 +39,7 @@ describe('CreateCollectionPageComponent', () => {
{ provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } },
{ provide: Router, useValue: {} },
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
{ provide: RequestService, useValue: {}},
{ provide: RequestService, useValue: {} },
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();

View File

@@ -25,7 +25,7 @@ describe('CollectionCurateComponent', () => {
let dsoNameService;
const collection = Object.assign(new Collection(), {
metadata: {'dc.title': ['Collection Name'], 'dc.identifier.uri': [ { value: '123456789/1'}]},
metadata: { 'dc.title': ['Collection Name'], 'dc.identifier.uri': [ { value: '123456789/1' }] },
});
beforeEach(waitForAsync(() => {
@@ -45,8 +45,8 @@ describe('CollectionCurateComponent', () => {
imports: [TranslateModule.forRoot()],
declarations: [CollectionCurateComponent],
providers: [
{provide: ActivatedRoute, useValue: routeStub},
{provide: DSONameService, useValue: dsoNameService},
{ provide: ActivatedRoute, useValue: routeStub },
{ provide: DSONameService, useValue: dsoNameService },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();

View File

@@ -80,7 +80,7 @@ describe('CollectionMetadataComponent', () => {
{ provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } },
{ provide: NotificationsService, useValue: notificationsService },
{ provide: RequestService, useValue: requestService },
{ provide: Router, useValue: routerMock},
{ provide: Router, useValue: routerMock },
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();

View File

@@ -71,18 +71,18 @@ describe('CollectionSourceControlsComponent', () => {
],
oaiSource: 'oai-harvest-source',
oaiSetId: 'oai-set-id',
_links: {self: {href: 'contentsource-selflink'}},
_links: { self: { href: 'contentsource-selflink' } },
});
process = Object.assign(new Process(), {
processId: 'process-id', processStatus: 'COMPLETED',
_links: {output: {href: 'output-href'}},
_links: { output: { href: 'output-href' } },
});
bitstream = Object.assign(new Bitstream(), {_links: {content: {href: 'content-href'}}});
bitstream = Object.assign(new Bitstream(), { _links: { content: { href: 'content-href' } } });
collection = Object.assign(new Collection(), {
uuid: 'fake-collection-id',
_links: {self: {href: 'collection-selflink'}},
_links: { self: { href: 'collection-selflink' } },
});
notificationsService = new NotificationsServiceStub();
collectionService = jasmine.createSpyObj('collectionService', {
@@ -107,13 +107,13 @@ describe('CollectionSourceControlsComponent', () => {
imports: [TranslateModule.forRoot(), RouterTestingModule],
declarations: [CollectionSourceControlsComponent, VarDirective],
providers: [
{provide: ScriptDataService, useValue: scriptDataService},
{provide: ProcessDataService, useValue: processDataService},
{provide: RequestService, useValue: requestService},
{provide: NotificationsService, useValue: notificationsService},
{provide: CollectionDataService, useValue: collectionService},
{provide: HttpClient, useValue: httpClient},
{provide: BitstreamDataService, useValue: bitstreamService},
{ provide: ScriptDataService, useValue: scriptDataService },
{ provide: ProcessDataService, useValue: processDataService },
{ provide: RequestService, useValue: requestService },
{ provide: NotificationsService, useValue: notificationsService },
{ provide: CollectionDataService, useValue: collectionService },
{ provide: HttpClient, useValue: httpClient },
{ provide: BitstreamDataService, useValue: bitstreamService },
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
@@ -137,9 +137,9 @@ describe('CollectionSourceControlsComponent', () => {
scheduler.flush();
expect(scriptDataService.invoke).toHaveBeenCalledWith('harvest', [
{name: '-g', value: null},
{name: '-a', value: contentSource.oaiSource},
{name: '-i', value: new ContentSourceSetSerializer().Serialize(contentSource.oaiSetId)},
{ name: '-g', value: null },
{ name: '-a', value: contentSource.oaiSource },
{ name: '-i', value: new ContentSourceSetSerializer().Serialize(contentSource.oaiSetId) },
], []);
expect(processDataService.findById).toHaveBeenCalledWith(process.processId, false);
@@ -153,8 +153,8 @@ describe('CollectionSourceControlsComponent', () => {
scheduler.flush();
expect(scriptDataService.invoke).toHaveBeenCalledWith('harvest', [
{name: '-r', value: null},
{name: '-c', value: collection.uuid},
{ name: '-r', value: null },
{ name: '-c', value: collection.uuid },
], []);
expect(processDataService.findById).toHaveBeenCalledWith(process.processId, false);
expect(notificationsService.success).toHaveBeenCalled();
@@ -166,8 +166,8 @@ describe('CollectionSourceControlsComponent', () => {
scheduler.flush();
expect(scriptDataService.invoke).toHaveBeenCalledWith('harvest', [
{name: '-o', value: null},
{name: '-c', value: collection.uuid},
{ name: '-o', value: null },
{ name: '-c', value: collection.uuid },
], []);
expect(processDataService.findById).toHaveBeenCalledWith(process.processId, false);
expect(notificationsService.success).toHaveBeenCalled();

View File

@@ -98,9 +98,9 @@ export class CollectionSourceControlsComponent implements OnDestroy {
testConfiguration(contentSource) {
this.testConfigRunning$.next(true);
this.subs.push(this.scriptDataService.invoke('harvest', [
{name: '-g', value: null},
{name: '-a', value: contentSource.oaiSource},
{name: '-i', value: new ContentSourceSetSerializer().Serialize(contentSource.oaiSetId)},
{ name: '-g', value: null },
{ name: '-a', value: contentSource.oaiSource },
{ name: '-i', value: new ContentSourceSetSerializer().Serialize(contentSource.oaiSetId) },
], []).pipe(
getFirstCompletedRemoteData(),
tap((rd) => {
@@ -131,7 +131,7 @@ export class CollectionSourceControlsComponent implements OnDestroy {
}
if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) {
this.bitstreamService.findByHref(process._links.output.href).pipe(getFirstSucceededRemoteDataPayload()).subscribe((bitstream) => {
this.httpClient.get(bitstream._links.content.href, {responseType: 'text'}).subscribe((data: any) => {
this.httpClient.get(bitstream._links.content.href, { responseType: 'text' }).subscribe((data: any) => {
const output = data.replaceAll(new RegExp('.*\\@(.*)', 'g'), '$1')
.replaceAll('The script has started', '')
.replaceAll('The script has completed', '');
@@ -150,8 +150,8 @@ export class CollectionSourceControlsComponent implements OnDestroy {
importNow() {
this.importRunning$.next(true);
this.subs.push(this.scriptDataService.invoke('harvest', [
{name: '-r', value: null},
{name: '-c', value: this.collection.uuid},
{ name: '-r', value: null },
{ name: '-c', value: this.collection.uuid },
], [])
.pipe(
getFirstCompletedRemoteData(),
@@ -197,8 +197,8 @@ export class CollectionSourceControlsComponent implements OnDestroy {
resetAndReimport() {
this.reImportRunning$.next(true);
this.subs.push(this.scriptDataService.invoke('harvest', [
{name: '-o', value: null},
{name: '-c', value: this.collection.uuid},
{ name: '-o', value: null },
{ name: '-c', value: this.collection.uuid },
], [])
.pipe(
getFirstCompletedRemoteData(),

View File

@@ -11,7 +11,7 @@ import { finalize } from 'rxjs/operators';
import { FindListOptions } from '../core/data/find-list-options.model';
import { hasValue } from '../shared/empty.util';
import { CommunityListService} from './community-list-service';
import { CommunityListService } from './community-list-service';
import { FlatNode } from './flat-node.model';
/**

View File

@@ -14,7 +14,7 @@ import {
import { FindListOptions } from '../../core/data/find-list-options.model';
import { isEmpty } from '../../shared/empty.util';
import { CommunityListDatasource } from '../community-list-datasource';
import { CommunityListService} from '../community-list-service';
import { CommunityListService } from '../community-list-service';
import { FlatNode } from '../flat-node.model';
/**

View File

@@ -24,7 +24,7 @@ import { MetadataService } from '../core/metadata/metadata.service';
import { redirectOn4xx } from '../core/shared/authorized.operators';
import { Bitstream } from '../core/shared/bitstream.model';
import { Community } from '../core/shared/community.model';
import { getAllSucceededRemoteDataPayload} from '../core/shared/operators';
import { getAllSucceededRemoteDataPayload } from '../core/shared/operators';
import { fadeInOut } from '../shared/animations/fade';
import { hasValue } from '../shared/empty.util';
import { getCommunityPageRoute } from './community-page-routing-paths';

View File

@@ -31,7 +31,7 @@ describe('DeleteCommunityPageComponent', () => {
{ provide: CommunityDataService, useValue: {} },
{ provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } },
{ provide: NotificationsService, useValue: {} },
{ provide: RequestService, useValue: {}},
{ provide: RequestService, useValue: {} },
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();

View File

@@ -25,7 +25,7 @@ describe('CommunityCurateComponent', () => {
let dsoNameService;
const community = Object.assign(new Community(), {
metadata: {'dc.title': ['Community Name'], 'dc.identifier.uri': [ { value: '123456789/1'}]},
metadata: { 'dc.title': ['Community Name'], 'dc.identifier.uri': [ { value: '123456789/1' }] },
});
beforeEach(waitForAsync(() => {
@@ -45,8 +45,8 @@ describe('CommunityCurateComponent', () => {
imports: [TranslateModule.forRoot()],
declarations: [CommunityCurateComponent],
providers: [
{provide: ActivatedRoute, useValue: routeStub},
{provide: DSONameService, useValue: dsoNameService},
{ provide: ActivatedRoute, useValue: routeStub },
{ provide: DSONameService, useValue: dsoNameService },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();

View File

@@ -92,7 +92,7 @@ export class CommunityPageSubCollectionListComponent implements OnInit, OnDestro
return this.cds.findByParent(this.community.id, {
currentPage: currentPagination.currentPage,
elementsPerPage: currentPagination.pageSize,
sort: {field: currentSort.field, direction: currentSort.direction},
sort: { field: currentSort.field, direction: currentSort.direction },
});
}),
).subscribe((results) => {

View File

@@ -468,7 +468,7 @@ export class AuthService {
// Set the cookie expire date
const expires = new Date(expireDate);
const options: CookieAttributes = {expires: expires};
const options: CookieAttributes = { expires: expires };
// Save cookie with the token
return this.storage.set(TOKENITEM, token, options);
@@ -560,7 +560,7 @@ export class AuthService {
// Set the cookie expire date
const expires = new Date(expireDate);
const options: CookieAttributes = {expires: expires};
const options: CookieAttributes = { expires: expires };
this.storage.set(REDIRECT_COOKIE, url, options);
this.store.dispatch(new SetRedirectUrlAction(isNotUndefined(url) ? url : ''));
}

View File

@@ -21,7 +21,7 @@ import { first } from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';
import { storeModuleConfig } from '../../app.reducer';
import { coreReducers} from '../core.reducers';
import { coreReducers } from '../core.reducers';
import { CoreState } from '../core-state.model';
import { RestRequestMethod } from '../data/rest-request-method';
import { RemoveFromIndexBySubstringAction } from '../index/index.actions';

View File

@@ -3,7 +3,7 @@ import { CacheableObject } from '../cache/cacheable-object.model';
import { ObjectCacheService } from '../cache/object-cache.service';
import { DSpaceObject } from '../shared/dspace-object.model';
import { BaseResponseParsingService } from './base-response-parsing.service';
import { GetRequest} from './request.models';
import { GetRequest } from './request.models';
import { RestRequest } from './rest-request.model';
class TestService extends BaseResponseParsingService {

View File

@@ -3,7 +3,7 @@ import {
RouterStateSnapshot,
} from '@angular/router';
import { Observable } from 'rxjs';
import { map} from 'rxjs/operators';
import { map } from 'rxjs/operators';
import { FeatureID } from '../feature-id';
import { SomeFeatureAuthorizationGuard } from './some-feature-authorization.guard';

View File

@@ -18,14 +18,14 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
import { ObjectCacheService } from '../cache/object-cache.service';
import { CoreState } from '../core-state.model';
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
import {ConfigurationProperty} from '../shared/configuration-property.model';
import { ConfigurationProperty } from '../shared/configuration-property.model';
import { HALEndpointService } from '../shared/hal-endpoint.service';
import { Item } from '../shared/item.model';
import { getFirstCompletedRemoteData } from '../shared/operators';
import { sendRequest } from '../shared/request.operators';
import { BaseDataService } from './base/base-data.service';
import { dataService } from './base/data-service.decorator';
import {ConfigurationDataService} from './configuration-data.service';
import { ConfigurationDataService } from './configuration-data.service';
import { DefaultChangeAnalyzer } from './default-change-analyzer.service';
import { RemoteData } from './remote-data';
import { PostRequest } from './request.models';

View File

@@ -114,7 +114,7 @@ export class SelectVirtualMetadataAction implements Action {
uuid: string,
select: boolean,
) {
this.payload = { url, source, uuid, select: select};
this.payload = { url, source, uuid, select: select };
}
}

View File

@@ -181,7 +181,7 @@ function addFieldUpdate(state: any, action: AddFieldUpdateAction) {
const url: string = action.payload.url;
const field: Identifiable = action.payload.field;
const changeType: FieldChangeType = action.payload.changeType;
const pageState: ObjectUpdatesEntry = state[url] || {fieldUpdates: {}};
const pageState: ObjectUpdatesEntry = state[url] || { fieldUpdates: {} };
let states = pageState.fieldStates;
if (changeType === FieldChangeType.ADD) {
@@ -234,7 +234,7 @@ function selectVirtualMetadata(state: any, action: SelectVirtualMetadataAction)
const newPageState = Object.assign(
{},
pageState,
{virtualMetadataSources: virtualMetadataSources},
{ virtualMetadataSources: virtualMetadataSources },
);
return Object.assign(

View File

@@ -61,7 +61,7 @@ describe('PrimaryBitstreamService', () => {
rdbService = getMockRemoteDataBuildService();
notificationService = new NotificationsServiceStub() as any;
bundleDataService = jasmine.createSpyObj('bundleDataService', {'findByHref': createSuccessfulRemoteDataObject$(bundle)});
bundleDataService = jasmine.createSpyObj('bundleDataService', { 'findByHref': createSuccessfulRemoteDataObject$(bundle) });
service = new PrimaryBitstreamService(requestService, rdbService, objectCache, halService, notificationService, bundleDataService);
});

View File

@@ -11,7 +11,7 @@ import {
ResetResponseTimestampsAction,
} from './request.actions';
import { GetRequest } from './request.models';
import { requestReducer} from './request.reducer';
import { requestReducer } from './request.reducer';
import { RequestEntryState } from './request-entry-state.model';
import { RequestState } from './request-state.model';

View File

@@ -28,7 +28,7 @@ import {
getMockUUIDService,
} from '../../shared/mocks/uuid.service.mock';
import { ObjectCacheService } from '../cache/object-cache.service';
import { coreReducers} from '../core.reducers';
import { coreReducers } from '../core.reducers';
import { CoreState } from '../core-state.model';
import { UUIDService } from '../shared/uuid.service';
import {

View File

@@ -40,7 +40,7 @@ import {
RequestExecuteAction,
RequestStaleAction,
} from './request.actions';
import { GetRequest} from './request.models';
import { GetRequest } from './request.models';
import { RequestEntry } from './request-entry.model';
import {
isLoading,

View File

@@ -131,7 +131,7 @@ export class VersionHistoryDataService extends IdentifiableDataService<VersionHi
pageSize: 1,
});
const latestVersionSearch = new PaginatedSearchOptions({pagination: latestVersionOptions});
const latestVersionSearch = new PaginatedSearchOptions({ pagination: latestVersionOptions });
return this.getVersions(versionHistory.id, latestVersionSearch, false, true, followLink('item')).pipe(
getAllSucceededRemoteData(),

View File

@@ -55,7 +55,7 @@ export class DspaceRestService {
get(absoluteURL: string): Observable<RawRestResponse> {
const requestOptions = {
observe: 'response' as any,
headers: new HttpHeaders({'Content-Type': DEFAULT_CONTENT_TYPE}),
headers: new HttpHeaders({ 'Content-Type': DEFAULT_CONTENT_TYPE }),
};
return this.http.get(absoluteURL, requestOptions).pipe(
map((res: HttpResponse<any>) => ({

View File

@@ -11,7 +11,7 @@ import {
import { REQUEST } from '@nguniversal/express-engine/tokens';
import { Observable } from 'rxjs';
@Injectable({providedIn: 'root'})
@Injectable({ providedIn: 'root' })
/**
* Http Interceptor intercepting Http Requests, adding the client's IP to their X-Forwarded-For header
*/

View File

@@ -143,7 +143,7 @@ export class GoogleRecaptchaService {
*/
public getRecaptchaToken(action) {
return this.captchaKey().pipe(
switchMap((key) => grecaptcha.execute(key, {action: action})),
switchMap((key) => grecaptcha.execute(key, { action: action })),
);
}

View File

@@ -39,15 +39,15 @@ describe(`index selectors`, () => {
const source = 'https://rest.api/core/communities/search/top?page=0&size=50&sort=dc.title,ASC&embed.size=subcommunities=5&embed=subcommunities';
const result = getEmbedSizeParams(source);
expect(result).toHaveSize(1);
expect(result[0]).toEqual({name: 'subcommunities', size: 5});
expect(result[0]).toEqual({ name: 'subcommunities', size: 5 });
});
it(`url with multiple embed size param => should return list with {name, size}`, () => {
const source = 'https://rest.api/core/communities/search/top?page=0&size=50&sort=dc.title,ASC&embed.size=subcommunities=5&embed=subcommunities&embed.size=collections=1&embed=collections';
const result = getEmbedSizeParams(source);
expect(result).toHaveSize(2);
expect(result[0]).toEqual({name: 'subcommunities', size: 5});
expect(result[1]).toEqual({name: 'collections', size: 1});
expect(result[0]).toEqual({ name: 'subcommunities', size: 5 });
expect(result[1]).toEqual({ name: 'collections', size: 1 });
});
it(`url without params => should return empty list`, () => {

View File

@@ -52,6 +52,6 @@ export class JsonPatchOperationPathCombiner extends URLCombiner {
path += '/' + fragment;
}
return {rootElement: this._rootElement, subRootElement: this._subRootElement, path: path};
return { rootElement: this._rootElement, subRootElement: this._subRootElement, path: path };
}
}

View File

@@ -26,7 +26,7 @@ describe('LogInterceptor', () => {
let httpMock: HttpTestingController;
let cookieService: CookieService;
let correlationIdService: CorrelationIdService;
const router = Object.assign(new RouterStub(),{url : '/statistics'});
const router = Object.assign(new RouterStub(),{ url : '/statistics' });
// Mock payload/statuses are dummy content as we are not testing the results
// of any below requests. We are only testing for X-XSRF-TOKEN header.

View File

@@ -68,7 +68,7 @@ describe('MetadataService', () => {
let appConfig: AppConfig;
const initialState = { 'core': { metaTag: { tagsInUse: ['title', 'description'] }}};
const initialState = { 'core': { metaTag: { tagsInUse: ['title', 'description'] } } };
beforeEach(() => {
@@ -514,8 +514,8 @@ describe('MetadataService', () => {
totalElements: bitstreams.length, // announce multiple elements/pages
},
_links: index < bitstreams.length - 1
? { next: { href: 'not empty' }} // fake link to the next bitstream page
: { next: { href: undefined }}, // last page has no link
? { next: { href: 'not empty' } } // fake link to the next bitstream page
: { next: { href: undefined } }, // last page has no link
}));
};
});

View File

@@ -97,13 +97,13 @@ describe('PaginationService', () => {
spyOn(service, 'updateRoute');
service.resetPage('test');
expect(service.updateRoute).toHaveBeenCalledWith('test', {page: 1});
expect(service.updateRoute).toHaveBeenCalledWith('test', { page: 1 });
});
});
describe('updateRoute', () => {
it('should update the route with the provided page params', () => {
service.updateRoute('test', {page: 2, pageSize: 5, sortField: 'title', sortDirection: SortDirection.DESC});
service.updateRoute('test', { page: 2, pageSize: 5, sortField: 'title', sortDirection: SortDirection.DESC });
const navigateParams = {};
navigateParams[`test.page`] = `2`;
@@ -111,10 +111,10 @@ describe('PaginationService', () => {
navigateParams[`test.sf`] = `title`;
navigateParams[`test.sd`] = `DESC`;
expect(router.navigate).toHaveBeenCalledWith([], {queryParams: navigateParams, queryParamsHandling: 'merge'});
expect(router.navigate).toHaveBeenCalledWith([], { queryParams: navigateParams, queryParamsHandling: 'merge' });
});
it('should update the route with the provided page params while keeping the existing non provided ones', () => {
service.updateRoute('test', {page: 2});
service.updateRoute('test', { page: 2 });
const navigateParams = {};
navigateParams[`test.page`] = `2`;
@@ -122,10 +122,10 @@ describe('PaginationService', () => {
navigateParams[`test.sf`] = `score`;
navigateParams[`test.sd`] = `ASC`;
expect(router.navigate).toHaveBeenCalledWith([], {queryParams: navigateParams, queryParamsHandling: 'merge'});
expect(router.navigate).toHaveBeenCalledWith([], { queryParams: navigateParams, queryParamsHandling: 'merge' });
});
it('should pass on navigationExtras to router.navigate', () => {
service.updateRoute('test', {page: 2}, undefined, undefined, { queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
service.updateRoute('test', { page: 2 }, undefined, undefined, { queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
const navigateParams = {};
navigateParams[`test.page`] = `2`;
@@ -133,12 +133,12 @@ describe('PaginationService', () => {
navigateParams[`test.sf`] = `score`;
navigateParams[`test.sd`] = `ASC`;
expect(router.navigate).toHaveBeenCalledWith([], {queryParams: navigateParams, queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
expect(router.navigate).toHaveBeenCalledWith([], { queryParams: navigateParams, queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
});
});
describe('updateRouteWithUrl', () => {
it('should update the route with the provided page params and url', () => {
service.updateRouteWithUrl('test', ['someUrl'], {page: 2, pageSize: 5, sortField: 'title', sortDirection: SortDirection.DESC});
service.updateRouteWithUrl('test', ['someUrl'], { page: 2, pageSize: 5, sortField: 'title', sortDirection: SortDirection.DESC });
const navigateParams = {};
navigateParams[`test.page`] = `2`;
@@ -146,10 +146,10 @@ describe('PaginationService', () => {
navigateParams[`test.sf`] = `title`;
navigateParams[`test.sd`] = `DESC`;
expect(router.navigate).toHaveBeenCalledWith(['someUrl'], {queryParams: navigateParams, queryParamsHandling: 'merge'});
expect(router.navigate).toHaveBeenCalledWith(['someUrl'], { queryParams: navigateParams, queryParamsHandling: 'merge' });
});
it('should update the route with the provided page params and url while keeping the existing non provided ones', () => {
service.updateRouteWithUrl('test',['someUrl'], {page: 2});
service.updateRouteWithUrl('test',['someUrl'], { page: 2 });
const navigateParams = {};
navigateParams[`test.page`] = `2`;
@@ -157,10 +157,10 @@ describe('PaginationService', () => {
navigateParams[`test.sf`] = `score`;
navigateParams[`test.sd`] = `ASC`;
expect(router.navigate).toHaveBeenCalledWith(['someUrl'], {queryParams: navigateParams, queryParamsHandling: 'merge'});
expect(router.navigate).toHaveBeenCalledWith(['someUrl'], { queryParams: navigateParams, queryParamsHandling: 'merge' });
});
it('should pass on navigationExtras to router.navigate', () => {
service.updateRouteWithUrl('test',['someUrl'], {page: 2}, undefined, undefined, { queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
service.updateRouteWithUrl('test',['someUrl'], { page: 2 }, undefined, undefined, { queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
const navigateParams = {};
navigateParams[`test.page`] = `2`;
@@ -168,7 +168,7 @@ describe('PaginationService', () => {
navigateParams[`test.sf`] = `score`;
navigateParams[`test.sd`] = `ASC`;
expect(router.navigate).toHaveBeenCalledWith(['someUrl'], {queryParams: navigateParams, queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
expect(router.navigate).toHaveBeenCalledWith(['someUrl'], { queryParams: navigateParams, queryParamsHandling: 'preserve', replaceUrl: true, preserveFragment: true });
});
});
describe('clearPagination', () => {
@@ -190,7 +190,7 @@ describe('PaginationService', () => {
service.updateRoute('another-id', {});
expect(router.navigate).toHaveBeenCalledWith([], {queryParams: Object.assign({}, resetParams, navigateParams), queryParamsHandling: 'merge'});
expect(router.navigate).toHaveBeenCalledWith([], { queryParams: Object.assign({}, resetParams, navigateParams), queryParamsHandling: 'merge' });
});
});
describe('getPageParam', () => {

View File

@@ -126,7 +126,7 @@ export class PaginationService {
* @param paginationId - The pagination id for which to reset the page
*/
resetPage(paginationId: string) {
this.updateRoute(paginationId, {page: 1});
this.updateRoute(paginationId, { page: 1 });
}

View File

@@ -15,7 +15,7 @@ export function locationProvider(): Location {
/**
* Service for performing hard redirects within the browser app module
*/
@Injectable({providedIn: 'root'})
@Injectable({ providedIn: 'root' })
export class BrowserHardRedirectService extends HardRedirectService {
constructor(

View File

@@ -32,7 +32,7 @@ export class RouteEffects {
.pipe(
ofType(RouteActionTypes.RESET),
tap(() => this.service.setCurrentRouteInfo()),
), {dispatch: false });
), { dispatch: false });
constructor(private actions$: Actions, private service: RouteService) {
}

View File

@@ -7,7 +7,7 @@ describe(`ServerReferrerService`, () => {
describe(`getReferrer`, () => {
describe(`when the referer header is set`, () => {
beforeEach(() => {
service = new ServerReferrerService({ headers: { referer: referrer }});
service = new ServerReferrerService({ headers: { referer: referrer } });
});
it(`should return the referer header`, (done: DoneFn) => {
@@ -20,7 +20,7 @@ describe(`ServerReferrerService`, () => {
describe(`when the referer header is not set`, () => {
beforeEach(() => {
service = new ServerReferrerService({ headers: {}});
service = new ServerReferrerService({ headers: {} });
});
it(`should return an empty string`, (done: DoneFn) => {

View File

@@ -13,8 +13,8 @@ import { RemoteData } from '../data/remote-data';
import { BITSTREAM } from './bitstream.resource-type';
import { BitstreamFormat } from './bitstream-format.model';
import { BITSTREAM_FORMAT } from './bitstream-format.resource-type';
import {Bundle} from './bundle.model';
import {BUNDLE} from './bundle.resource-type';
import { Bundle } from './bundle.model';
import { BUNDLE } from './bundle.resource-type';
import { ChildHALResource } from './child-hal-resource.model';
import { DSpaceObject } from './dspace-object.model';
import { HALLink } from './hal-link.model';

View File

@@ -11,7 +11,7 @@ import {
} from '../cache/builders/build-decorators';
import { PaginatedList } from '../data/paginated-list.model';
import { RemoteData } from '../data/remote-data';
import {excludeFromEquals} from '../utilities/equals.decorators';
import { excludeFromEquals } from '../utilities/equals.decorators';
import { Bitstream } from './bitstream.model';
import { BITSTREAM } from './bitstream.resource-type';
import { ChildHALResource } from './child-hal-resource.model';

View File

@@ -20,7 +20,7 @@ import { URLCombiner } from '../url-combiner/url-combiner';
/**
* Provides utility methods to save files on the client-side.
*/
@Injectable({providedIn: 'root'})
@Injectable({ providedIn: 'root' })
export class FileService {
constructor(
@Inject(NativeWindowService) protected _window: NativeWindowRef,

View File

@@ -1,4 +1,4 @@
import {ResourceType} from '../../resource-type';
import { ResourceType } from '../../resource-type';
/**
* The resource type for SearchConfig

View File

@@ -1,7 +1,7 @@
import { WorkspaceitemSectionAccessesObject } from './workspaceitem-section-accesses.model';
import { WorkspaceitemSectionCcLicenseObject } from './workspaceitem-section-cc-license.model';
import { WorkspaceitemSectionFormObject } from './workspaceitem-section-form.model';
import {WorkspaceitemSectionIdentifiersObject} from './workspaceitem-section-identifiers.model';
import { WorkspaceitemSectionIdentifiersObject } from './workspaceitem-section-identifiers.model';
import { WorkspaceitemSectionLicenseObject } from './workspaceitem-section-license.model';
import { WorkspaceitemSectionSherpaPoliciesObject } from './workspaceitem-section-sherpa-policies.model';
import { WorkspaceitemSectionUploadObject } from './workspaceitem-section-upload.model';

View File

@@ -39,7 +39,7 @@ describe('CurationFormComponent', () => {
let notificationsService;
let router;
const process = Object.assign(new Process(), {processId: 'process-id'});
const process = Object.assign(new Process(), { processId: 'process-id' });
beforeEach(waitForAsync(() => {
@@ -79,7 +79,7 @@ describe('CurationFormComponent', () => {
{ provide: ProcessDataService, useValue: processDataService },
{ provide: NotificationsService, useValue: notificationsService },
{ provide: HandleService, useValue: handleService },
{ provide: Router, useValue: router},
{ provide: Router, useValue: router },
{ provide: ConfigurationDataService, useValue: configurationDataService },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
@@ -121,8 +121,8 @@ describe('CurationFormComponent', () => {
comp.submit();
expect(scriptDataService.invoke).toHaveBeenCalledWith('curate', [
{name: '-t', value: 'profileformats'},
{name: '-i', value: 'test-handle'},
{ name: '-t', value: 'profileformats' },
{ name: '-i', value: 'test-handle' },
], []);
expect(notificationsService.success).toHaveBeenCalled();
expect(router.navigateByUrl).toHaveBeenCalledWith(getProcessDetailRoute('process-id'));
@@ -134,8 +134,8 @@ describe('CurationFormComponent', () => {
comp.submit();
expect(scriptDataService.invoke).toHaveBeenCalledWith('curate', [
{name: '-t', value: 'profileformats'},
{name: '-i', value: 'test-handle'},
{ name: '-t', value: 'profileformats' },
{ name: '-i', value: 'test-handle' },
], []);
expect(notificationsService.error).toHaveBeenCalled();
expect(processDataService.findByHref).not.toHaveBeenCalled();
@@ -148,8 +148,8 @@ describe('CurationFormComponent', () => {
comp.submit();
expect(scriptDataService.invoke).toHaveBeenCalledWith('curate', [
{name: '-t', value: 'profileformats'},
{name: '-i', value: 'form-handle'},
{ name: '-t', value: 'profileformats' },
{ name: '-i', value: 'form-handle' },
], []);
});
it('should use "all" when the handle provided by the form is empty and when no dsoHandle is provided', () => {
@@ -157,8 +157,8 @@ describe('CurationFormComponent', () => {
comp.submit();
expect(scriptDataService.invoke).toHaveBeenCalledWith('curate', [
{name: '-t', value: 'profileformats'},
{name: '-i', value: 'all'},
{ name: '-t', value: 'profileformats' },
{ name: '-i', value: 'all' },
], []);
});

View File

@@ -171,14 +171,14 @@ describe('JournalIssueSearchResultListElementComponent', () => {
TestBed.configureTestingModule({
declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe],
providers: [
{provide: TruncatableService, useValue: {}},
{provide: DSONameService, useClass: DSONameServiceMock},
{ provide: TruncatableService, useValue: {} },
{ provide: DSONameService, useClass: DSONameServiceMock },
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -169,14 +169,14 @@ describe('JournalVolumeSearchResultListElementComponent', () => {
TestBed.configureTestingModule({
declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe],
providers: [
{provide: TruncatableService, useValue: {}},
{provide: DSONameService, useClass: DSONameServiceMock},
{ provide: TruncatableService, useValue: {} },
{ provide: DSONameService, useClass: DSONameServiceMock },
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(JournalVolumeSearchResultListElementComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -141,14 +141,14 @@ describe('JournalSearchResultListElementComponent', () => {
TestBed.configureTestingModule({
declarations: [JournalSearchResultListElementComponent, TruncatePipe],
providers: [
{provide: TruncatableService, useValue: {}},
{provide: DSONameService, useClass: DSONameServiceMock},
{ provide: TruncatableService, useValue: {} },
{ provide: DSONameService, useClass: DSONameServiceMock },
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(JournalSearchResultListElementComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -66,7 +66,7 @@ export class JournalEntitiesModule {
static withEntryComponents() {
return {
ngModule: JournalEntitiesModule,
providers: ENTRY_COMPONENTS.map((component) => ({provide: component})),
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
};
}

View File

@@ -158,14 +158,14 @@ describe('OrgUnitSearchResultListElementComponent', () => {
)],
declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe],
providers: [
{provide: TruncatableService, useValue: {}},
{provide: DSONameService, useClass: DSONameServiceMock},
{ provide: TruncatableService, useValue: {} },
{ provide: DSONameService, useClass: DSONameServiceMock },
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -158,14 +158,14 @@ describe('PersonSearchResultListElementComponent', () => {
)],
declarations: [PersonSearchResultListElementComponent, TruncatePipe],
providers: [
{provide: TruncatableService, useValue: {}},
{provide: DSONameService, useClass: DSONameServiceMock},
{ provide: TruncatableService, useValue: {} },
{ provide: DSONameService, useClass: DSONameServiceMock },
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(PersonSearchResultListElementComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -140,15 +140,15 @@ describe('ProjectSearchResultListElementComponent', () => {
TestBed.configureTestingModule({
declarations: [ProjectSearchResultListElementComponent, TruncatePipe],
providers: [
{provide: TruncatableService, useValue: {}},
{provide: DSONameService, useClass: DSONameServiceMock},
{ provide: TruncatableService, useValue: {} },
{ provide: DSONameService, useClass: DSONameServiceMock },
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(ProjectSearchResultListElementComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -123,7 +123,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => {
{ provide: NgbModal, useValue: {} },
{ provide: ItemDataService, useValue: {} },
{ provide: SelectableListService, useValue: {} },
{ provide: Store, useValue: {}},
{ provide: Store, useValue: {} },
{ provide: ObjectCacheService, useValue: {} },
{ provide: UUIDService, useValue: {} },
{ provide: RemoteDataBuildService, useValue: {} },
@@ -203,7 +203,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => {
{ provide: NgbModal, useValue: {} },
{ provide: ItemDataService, useValue: {} },
{ provide: SelectableListService, useValue: {} },
{ provide: Store, useValue: {}},
{ provide: Store, useValue: {} },
{ provide: ObjectCacheService, useValue: {} },
{ provide: UUIDService, useValue: {} },
{ provide: RemoteDataBuildService, useValue: {} },

View File

@@ -51,7 +51,7 @@ describe('ForgotPasswordFormComponent', () => {
beforeEach(waitForAsync(() => {
route = {data: observableOf({registration: createSuccessfulRemoteDataObject(registration)})};
route = { data: observableOf({ registration: createSuccessfulRemoteDataObject(registration) }) };
router = new RouterStub();
notificationsService = new NotificationsServiceStub();
@@ -67,12 +67,12 @@ describe('ForgotPasswordFormComponent', () => {
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule],
declarations: [ForgotPasswordFormComponent],
providers: [
{provide: Router, useValue: router},
{provide: ActivatedRoute, useValue: route},
{provide: Store, useValue: store},
{provide: EPersonDataService, useValue: ePersonDataService},
{provide: UntypedFormBuilder, useValue: new UntypedFormBuilder()},
{provide: NotificationsService, useValue: notificationsService},
{ provide: Router, useValue: router },
{ provide: ActivatedRoute, useValue: route },
{ provide: Store, useValue: store },
{ provide: EPersonDataService, useValue: ePersonDataService },
{ provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() },
{ provide: NotificationsService, useValue: notificationsService },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();

View File

@@ -12,7 +12,7 @@ import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed
{
path: '',
component: ThemedForgotEmailComponent,
data: {title: 'forgot-password.title'},
data: { title: 'forgot-password.title' },
},
{
path: ':token',

View File

@@ -95,7 +95,7 @@ export class TopLevelCommunityListComponent implements OnInit, OnDestroy {
return this.cds.findTop({
currentPage: currentPagination.currentPage,
elementsPerPage: currentPagination.pageSize,
sort: {field: currentSort.field, direction: currentSort.direction},
sort: { field: currentSort.field, direction: currentSort.direction },
});
}),
).subscribe((results) => {

View File

@@ -61,8 +61,8 @@ describe('BitstreamRequestACopyPageComponent', () => {
eperson = Object.assign(new EPerson(), {
email: 'test@mail.org',
metadata: {
'eperson.firstname': [{value: 'Test'}],
'eperson.lastname': [{value: 'User'}],
'eperson.firstname': [{ value: 'Test' }],
'eperson.lastname': [{ value: 'User' }],
},
});
authService = jasmine.createSpyObj('authService', {
@@ -83,13 +83,13 @@ describe('BitstreamRequestACopyPageComponent', () => {
notificationsService = new NotificationsServiceStub();
item = Object.assign(new Item(), {uuid: 'item-uuid'});
item = Object.assign(new Item(), { uuid: 'item-uuid' });
bitstream = Object.assign(new Bitstream(), {
uuid: 'bitstreamUuid',
_links: {
content: {href: 'bitstream-content-link'},
self: {href: 'bitstream-self-link'},
content: { href: 'bitstream-content-link' },
self: { href: 'bitstream-self-link' },
},
});
@@ -116,15 +116,15 @@ describe('BitstreamRequestACopyPageComponent', () => {
imports: [CommonModule, TranslateModule.forRoot(), FormsModule, ReactiveFormsModule],
declarations: [BitstreamRequestACopyPageComponent],
providers: [
{provide: Location, useValue: location},
{provide: ActivatedRoute, useValue: activatedRoute},
{provide: Router, useValue: router},
{provide: AuthorizationDataService, useValue: authorizationService},
{provide: AuthService, useValue: authService},
{provide: ItemRequestDataService, useValue: itemRequestDataService},
{provide: NotificationsService, useValue: notificationsService},
{provide: DSONameService, useValue: new DSONameServiceMock()},
{provide: BitstreamDataService, useValue: bitstreamDataService},
{ provide: Location, useValue: location },
{ provide: ActivatedRoute, useValue: activatedRoute },
{ provide: Router, useValue: router },
{ provide: AuthorizationDataService, useValue: authorizationService },
{ provide: AuthService, useValue: authService },
{ provide: ItemRequestDataService, useValue: itemRequestDataService },
{ provide: NotificationsService, useValue: notificationsService },
{ provide: DSONameService, useValue: new DSONameServiceMock() },
{ provide: BitstreamDataService, useValue: bitstreamDataService },
],
})
.compileComponents();

View File

@@ -133,7 +133,7 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy {
this.subs.push(observableCombineLatest([this.canDownload$, canRequestCopy$]).subscribe(([canDownload, canRequestCopy]) => {
if (!canDownload && !canRequestCopy) {
this.router.navigateByUrl(getForbiddenRoute(), {skipLocationChange: true});
this.router.navigateByUrl(getForbiddenRoute(), { skipLocationChange: true });
}
}));
this.initValues();
@@ -160,13 +160,13 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy {
*/
private initValues() {
this.getCurrentUser().pipe(take(1)).subscribe((user) => {
this.requestCopyForm.patchValue({allfiles: 'true'});
this.requestCopyForm.patchValue({ allfiles: 'true' });
if (hasValue(user)) {
this.requestCopyForm.patchValue({name: user.name, email: user.email});
this.requestCopyForm.patchValue({ name: user.name, email: user.email });
}
});
this.bitstream$.pipe(take(1)).subscribe((bitstream) => {
this.requestCopyForm.patchValue({allfiles: 'false'});
this.requestCopyForm.patchValue({ allfiles: 'false' });
});
}

View File

@@ -1,13 +1,13 @@
import {hot} from 'jasmine-marbles';
import { hot } from 'jasmine-marbles';
import {RemoteData} from '../../core/data/remote-data';
import {Item} from '../../core/shared/item.model';
import { RemoteData } from '../../core/data/remote-data';
import { Item } from '../../core/shared/item.model';
import { isNotEmpty } from '../../shared/empty.util';
import {
createFailedRemoteDataObject,
createSuccessfulRemoteDataObject,
} from '../../shared/remote-data.utils';
import {findSuccessfulAccordingTo} from './edit-item-operators';
import { findSuccessfulAccordingTo } from './edit-item-operators';
describe('findSuccessfulAccordingTo', () => {
let mockItem1;

View File

@@ -1,8 +1,8 @@
import {Observable} from 'rxjs';
import {first} from 'rxjs/operators';
import { Observable } from 'rxjs';
import { first } from 'rxjs/operators';
import {RemoteData} from '../../core/data/remote-data';
import {getAllSucceededRemoteData} from '../../core/shared/operators';
import { RemoteData } from '../../core/data/remote-data';
import { getAllSucceededRemoteData } from '../../core/shared/operators';
/**
* Return first Observable of a RemoteData object that complies to the provided predicate

View File

@@ -75,7 +75,7 @@ describe('ItemPageComponent', () => {
},
],
},
data: observableOf({dso: createSuccessfulRemoteDataObject(new Item())}),
data: observableOf({ dso: createSuccessfulRemoteDataObject(new Item()) }),
};
const mockRouter = {

View File

@@ -172,7 +172,7 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy {
getFirstSucceededRemoteDataWithNotEmptyPayload(),
map((item: Item) => this.linkService.resolveLink(
item,
followLink('bundles', {findListOptions: {currentPage : page, elementsPerPage: this.bundlesPerPage}}, followLink('bitstreams')),
followLink('bundles', { findListOptions: { currentPage : page, elementsPerPage: this.bundlesPerPage } }, followLink('bitstreams')),
)),
) as Observable<Item>;

View File

@@ -121,7 +121,7 @@ export class ItemBitstreamsComponent extends AbstractItemUpdateComponent impleme
* Actions to perform after the item has been initialized
*/
postItemInit(): void {
this.bundles$ = this.itemService.getBundles(this.item.id, new PaginatedSearchOptions({pagination: this.bundlesOptions})).pipe(
this.bundles$ = this.itemService.getBundles(this.item.id, new PaginatedSearchOptions({ pagination: this.bundlesOptions })).pipe(
getFirstSucceededRemoteData(),
getRemoteDataPayload(),
map((bundlePage: PaginatedList<Bundle>) => bundlePage.page),
@@ -226,7 +226,7 @@ export class ItemBitstreamsComponent extends AbstractItemUpdateComponent impleme
* Shows a notification to remind the user that they can undo this
*/
discard() {
const undoNotification = this.notificationsService.info(this.getNotificationTitle('discarded'), this.getNotificationContent('discarded'), {timeOut: this.discardTimeOut});
const undoNotification = this.notificationsService.info(this.getNotificationTitle('discarded'), this.getNotificationContent('discarded'), { timeOut: this.discardTimeOut });
this.objectUpdatesService.discardAllFieldUpdates(this.url, undoNotification);
}

View File

@@ -30,7 +30,7 @@ export class ItemEditBitstreamBundleComponent implements OnInit {
/**
* The view on the bundle information and bitstreams
*/
@ViewChild('bundleView', {static: true}) bundleView;
@ViewChild('bundleView', { static: true }) bundleView;
/**
* The bundle to display bitstreams for

View File

@@ -60,7 +60,7 @@ export class PaginatedDragAndDropBitstreamListComponent extends AbstractPaginate
initializeObjectsRD(): void {
this.objectsRD$ = this.currentPage$.pipe(
switchMap((page: PaginationComponentOptions) => {
const paginatedOptions = new PaginatedSearchOptions({pagination: Object.assign({}, page)});
const paginatedOptions = new PaginatedSearchOptions({ pagination: Object.assign({}, page) });
return this.bundleService.getBitstreamsEndpoint(this.bundle.id, paginatedOptions).pipe(
switchMap((href) => this.requestService.hasByHref$(href)),
switchMap(() => this.bundleService.getBitstreams(

View File

@@ -19,7 +19,7 @@ export class ItemEditBitstreamDragHandleComponent implements OnInit {
/**
* The view on the drag-handle
*/
@ViewChild('handleView', {static: true}) handleView;
@ViewChild('handleView', { static: true }) handleView;
constructor(private viewContainerRef: ViewContainerRef) {
}

View File

@@ -38,7 +38,7 @@ export class ItemEditBitstreamComponent implements OnChanges, OnInit {
/**
* The view on the bitstream
*/
@ViewChild('bitstreamView', {static: true}) bitstreamView;
@ViewChild('bitstreamView', { static: true }) bitstreamView;
/**
* The current field, value and state of the bitstream

View File

@@ -26,7 +26,7 @@ describe('ItemCurateComponent', () => {
const item = Object.assign(new Item(), {
handle: '123456789/1',
metadata: {'dc.title': ['Item Name']},
metadata: { 'dc.title': ['Item Name'] },
});
beforeEach(waitForAsync(() => {
@@ -46,8 +46,8 @@ describe('ItemCurateComponent', () => {
imports: [TranslateModule.forRoot()],
declarations: [ItemCurateComponent],
providers: [
{provide: ActivatedRoute, useValue: routeStub},
{provide: DSONameService, useValue: dsoNameService},
{ provide: ActivatedRoute, useValue: routeStub },
{ provide: DSONameService, useValue: dsoNameService },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();

View File

@@ -3,7 +3,7 @@ import {
Input,
} from '@angular/core';
import {ItemOperation} from './itemOperation.model';
import { ItemOperation } from './itemOperation.model';
@Component({
selector: 'ds-item-operation',

View File

@@ -55,9 +55,9 @@ describe('ItemRegisterDoiComponent', () => {
});
mockIdentifierDataService = jasmine.createSpyObj('mockIdentifierDataService', {
getIdentifierDataFor: createSuccessfulRemoteDataObject$({'identifiers': []}),
getIdentifierDataFor: createSuccessfulRemoteDataObject$({ 'identifiers': [] }),
getIdentifierRegistrationConfiguration: createSuccessfulRemoteDataObject$('true'),
registerIdentifier: createSuccessfulRemoteDataObject$({'identifiers': []}),
registerIdentifier: createSuccessfulRemoteDataObject$({ 'identifiers': [] }),
});
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
@@ -81,7 +81,7 @@ describe('ItemRegisterDoiComponent', () => {
{ provide: ActivatedRoute, useValue: routeStub },
{ provide: Router, useValue: routerStub },
{ provide: ItemDataService, useValue: mockItemDataService },
{ provide: IdentifierDataService, useValue: mockIdentifierDataService},
{ provide: IdentifierDataService, useValue: mockIdentifierDataService },
{ provide: NotificationsService, useValue: notificationsServiceStub },
], schemas: [
CUSTOM_ELEMENTS_SCHEMA,

View File

@@ -153,7 +153,7 @@ describe('ItemRelationshipsComponent', () => {
fieldUpdate2 = {
field: Object.assign(
relationships[1],
{keepLeftVirtualMetadata: true, keepRightVirtualMetadata: false},
{ keepLeftVirtualMetadata: true, keepRightVirtualMetadata: false },
),
changeType: FieldChangeType.REMOVE,
};

View File

@@ -43,7 +43,7 @@ describe('ItemStatusComponent', () => {
});
mockIdentifierDataService = jasmine.createSpyObj('mockIdentifierDataService', {
getIdentifierDataFor: createSuccessfulRemoteDataObject$({'identifiers': []}),
getIdentifierDataFor: createSuccessfulRemoteDataObject$({ 'identifiers': [] }),
getIdentifierRegistrationConfiguration: createSuccessfulRemoteDataObject$('true'),
});

View File

@@ -26,7 +26,7 @@ describe('ItemVersionHistoryComponent', () => {
const activatedRoute = {
parent: {
parent: {
data: observableOf({dso: createSuccessfulRemoteDataObject(item)}),
data: observableOf({ dso: createSuccessfulRemoteDataObject(item) }),
},
},
};

View File

@@ -3,11 +3,11 @@ import {
TestBed,
waitForAsync,
} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {TranslateModule} from '@ngx-translate/core';
import { By } from '@angular/platform-browser';
import { TranslateModule } from '@ngx-translate/core';
import {Item} from '../../../core/shared/item.model';
import {ModifyItemOverviewComponent} from './modify-item-overview.component';
import { Item } from '../../../core/shared/item.model';
import { ModifyItemOverviewComponent } from './modify-item-overview.component';
let comp: ModifyItemOverviewComponent;
let fixture: ComponentFixture<ModifyItemOverviewComponent>;

View File

@@ -4,8 +4,8 @@ import {
OnInit,
} from '@angular/core';
import {Item} from '../../../core/shared/item.model';
import {MetadataMap} from '../../../core/shared/metadata.models';
import { Item } from '../../../core/shared/item.model';
import { MetadataMap } from '../../../core/shared/metadata.models';
@Component({
selector: 'ds-modify-item-overview',

View File

@@ -6,15 +6,15 @@ import {
OnInit,
Output,
} from '@angular/core';
import {Observable} from 'rxjs';
import { Observable } from 'rxjs';
import {
APP_CONFIG,
AppConfig,
} from '../../../../config/app-config.interface';
import {ObjectUpdatesService} from '../../../core/data/object-updates/object-updates.service';
import {Item} from '../../../core/shared/item.model';
import {MetadataValue} from '../../../core/shared/metadata.models';
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
import { Item } from '../../../core/shared/item.model';
import { MetadataValue } from '../../../core/shared/metadata.models';
@Component({
selector: 'ds-virtual-metadata',

View File

@@ -63,7 +63,7 @@ describe('CollectionsComponent', () => {
declarations: [ CollectionsComponent ],
providers: [
{ provide: DSONameService, useValue: new DSONameServiceMock() },
{ provide: RemoteDataBuildService, useValue: getMockRemoteDataBuildService()},
{ provide: RemoteDataBuildService, useValue: getMockRemoteDataBuildService() },
{ provide: CollectionDataService, useValue: collectionDataService },
],

View File

@@ -53,7 +53,7 @@ describe('MetadataUriValuesComponent', () => {
declarations: [MetadataUriValuesComponent],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(MetadataUriValuesComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -53,7 +53,7 @@ describe('MetadataValuesComponent', () => {
declarations: [MetadataValuesComponent],
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(MetadataValuesComponent, {
set: {changeDetection: ChangeDetectionStrategy.Default},
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));
@@ -80,7 +80,7 @@ describe('MetadataValuesComponent', () => {
});
it('should correctly detect a pattern on string containing "test"', () => {
const mdValue = {value: 'This is a test value'} as MetadataValue;
const mdValue = { value: 'This is a test value' } as MetadataValue;
expect(comp.hasLink(mdValue)).toBe(true);
});

Some files were not shown because too many files have changed in this diff Show More