ESLint: fix dangling commas

This commit is contained in:
Yury Bondarenko
2023-06-27 16:23:06 +02:00
parent 725dbc3743
commit 917c36dbe7
1789 changed files with 12452 additions and 12452 deletions

View File

@@ -14,10 +14,10 @@ const mockCollectionWithAbstract: Collection = Object.assign(new Collection(), {
'dc.description.abstract': [
{
language: 'en_US',
value: 'Short description'
}
]
}
value: 'Short description',
},
],
},
});
const mockCollectionWithoutAbstract: Collection = Object.assign(new Collection(), {
@@ -25,31 +25,31 @@ const mockCollectionWithoutAbstract: Collection = Object.assign(new Collection()
'dc.title': [
{
language: 'en_US',
value: 'Test title'
}
]
}
value: 'Test title',
},
],
},
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCollectionWithAbstract
resolveLink: mockCollectionWithAbstract,
});
describe('CollectionGridElementComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot()
TranslateModule.forRoot(),
],
declarations: [CollectionGridElementComponent],
providers: [
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
{ provide: LinkService, useValue: linkService }
{ provide: LinkService, useValue: linkService },
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(CollectionGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -35,7 +35,7 @@ export class CollectionGridElementComponent extends AbstractListableElementCompo
if (hasValue(this._object) && hasNoValue(this._object.logo)) {
this.linkService.resolveLink<Collection>(
this._object,
followLink('logo')
followLink('logo'),
);
}
}

View File

@@ -14,10 +14,10 @@ const mockCommunityWithAbstract: Community = Object.assign(new Community(), {
'dc.description.abstract': [
{
language: 'en_US',
value: 'Short description'
}
]
}
value: 'Short description',
},
],
},
});
const mockCommunityWithoutAbstract: Community = Object.assign(new Community(), {
@@ -25,31 +25,31 @@ const mockCommunityWithoutAbstract: Community = Object.assign(new Community(), {
'dc.title': [
{
language: 'en_US',
value: 'Test title'
}
]
}
value: 'Test title',
},
],
},
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCommunityWithAbstract
resolveLink: mockCommunityWithAbstract,
});
describe('CommunityGridElementComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot()
TranslateModule.forRoot(),
],
declarations: [CommunityGridElementComponent],
providers: [
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) },
{ provide: LinkService, useValue: linkService }
{ provide: LinkService, useValue: linkService },
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(CommunityGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -14,7 +14,7 @@ import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
@Component({
selector: 'ds-community-grid-element',
styleUrls: ['./community-grid-element.component.scss'],
templateUrl: './community-grid-element.component.html'
templateUrl: './community-grid-element.component.html',
})
@listableObjectComponent(Community, ViewMode.GridElement)

View File

@@ -19,28 +19,28 @@ const mockItem = Object.assign(new Item(), {
'dc.title': [
{
language: 'en_US',
value: 'This is just another title'
}
value: 'This is just another title',
},
],
'dc.contributor.author': [
{
language: 'en_US',
value: 'Smith, Donald'
}
value: 'Smith, Donald',
},
],
'dc.date.issued': [
{
language: null,
value: '2015-06-26'
}
value: '2015-06-26',
},
],
'dc.description.abstract': [
{
language: 'en_US',
value: 'This is an abstract'
}
]
}
value: 'This is an abstract',
},
],
},
});
describe('ItemGridElementComponent', () => {
@@ -59,9 +59,9 @@ describe('ItemGridElementComponent', () => {
{ provide: DSONameService, useValue: new DSONameServiceMock() },
{ provide: TruncatableService, useValue: truncatableServiceStub },
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(ItemGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -11,7 +11,7 @@ import { Item } from '../../../../../core/shared/item.model';
selector: 'ds-item-grid-element',
styleUrls: ['./item-grid-element.component.scss'],
templateUrl: './item-grid-element.component.html',
animations: [focusShadow]
animations: [focusShadow],
})
/**
* The component for displaying a grid element for an item of the type Publication

View File

@@ -14,12 +14,12 @@ describe('ObjectGridComponent', () => {
{ seven: 7 },
{ eight: 8 },
{ nine: 9 },
{ ten: 10 }
{ ten: 10 },
];
const mockRD = {
payload: {
page: testObjects
}
page: testObjects,
},
} as any;
describe('the number of columns', () => {
@@ -37,7 +37,7 @@ describe('ObjectGridComponent', () => {
const expected = cold('c', { c: 3 });
const result = comp.columns$.pipe(
map((columns) => columns.length)
map((columns) => columns.length),
);
expect(result).toBeObservable(expected);
@@ -56,7 +56,7 @@ describe('ObjectGridComponent', () => {
const expected = cold('c', { c: 3 });
const result = comp.columns$.pipe(
map((columns) => columns.length)
map((columns) => columns.length),
);
expect(result).toBeObservable(expected);
@@ -75,7 +75,7 @@ describe('ObjectGridComponent', () => {
const expected = cold('c', { c: 2 });
const result = comp.columns$.pipe(
map((columns) => columns.length)
map((columns) => columns.length),
);
expect(result).toBeObservable(expected);
@@ -94,7 +94,7 @@ describe('ObjectGridComponent', () => {
const expected = cold('c', { c: 2 });
const result = comp.columns$.pipe(
map((columns) => columns.length)
map((columns) => columns.length),
);
expect(result).toBeObservable(expected);
@@ -113,7 +113,7 @@ describe('ObjectGridComponent', () => {
const expected = cold('c', { c: 1 });
const result = comp.columns$.pipe(
map((columns) => columns.length)
map((columns) => columns.length),
);
expect(result).toBeObservable(expected);
@@ -136,8 +136,8 @@ describe('ObjectGridComponent', () => {
c: [
[testObjects[0], testObjects[3], testObjects[6], testObjects[9]],
[testObjects[1], testObjects[4], testObjects[7]],
[testObjects[2], testObjects[5], testObjects[8]]
]
[testObjects[2], testObjects[5], testObjects[8]],
],
});
const result = comp.columns$;
@@ -159,8 +159,8 @@ describe('ObjectGridComponent', () => {
c: [
[testObjects[0], testObjects[3], testObjects[6], testObjects[9]],
[testObjects[1], testObjects[4], testObjects[7]],
[testObjects[2], testObjects[5], testObjects[8]]
]
[testObjects[2], testObjects[5], testObjects[8]],
],
});
const result = comp.columns$;
@@ -182,7 +182,7 @@ describe('ObjectGridComponent', () => {
c: [
[testObjects[0], testObjects[2], testObjects[4], testObjects[6], testObjects[8]],
[testObjects[1], testObjects[3], testObjects[5], testObjects[7], testObjects[9]],
]
],
});
const result = comp.columns$;
@@ -204,7 +204,7 @@ describe('ObjectGridComponent', () => {
c: [
[testObjects[0], testObjects[2], testObjects[4], testObjects[6], testObjects[8]],
[testObjects[1], testObjects[3], testObjects[5], testObjects[7], testObjects[9]],
]
],
});
const result = comp.columns$;

View File

@@ -8,7 +8,7 @@ import {
Input,
OnInit,
Output,
ViewEncapsulation
ViewEncapsulation,
} from '@angular/core';
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
@@ -31,7 +31,7 @@ import { CollectionElementLinkType } from '../object-collection/collection-eleme
selector: 'ds-object-grid',
styleUrls: ['./object-grid.component.scss'],
templateUrl: './object-grid.component.html',
animations: [fadeIn]
animations: [fadeIn],
})
export class ObjectGridComponent implements OnInit {
@@ -183,7 +183,7 @@ export class ObjectGridComponent implements OnInit {
}
}
}),
distinctUntilChanged()
distinctUntilChanged(),
).pipe(startWith(3));
this.columns$ = observableCombineLatest(

View File

@@ -36,10 +36,10 @@ mockCollectionWithAbstract.indexableObject = Object.assign(new Collection(), {
'dc.description.abstract': [
{
language: 'en_US',
value: 'Short description'
}
]
}
value: 'Short description',
},
],
},
});
const mockCollectionWithoutAbstract: CollectionSearchResult = new CollectionSearchResult();
@@ -49,20 +49,20 @@ mockCollectionWithoutAbstract.indexableObject = Object.assign(new Collection(),
'dc.title': [
{
language: 'en_US',
value: 'Test title'
}
]
}
value: 'Test title',
},
],
},
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCollectionWithAbstract
resolveLink: mockCollectionWithAbstract,
});
describe('CollectionSearchResultGridElementComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot()
TranslateModule.forRoot(),
],
declarations: [CollectionSearchResultGridElementComponent, TruncatePipe],
providers: [
@@ -80,12 +80,12 @@ describe('CollectionSearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService }
{ provide: LinkService, useValue: linkService },
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(CollectionSearchResultGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -14,7 +14,7 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
@Component({
selector: 'ds-collection-search-result-grid-element',
styleUrls: ['../search-result-grid-element.component.scss', 'collection-search-result-grid-element.component.scss'],
templateUrl: 'collection-search-result-grid-element.component.html'
templateUrl: 'collection-search-result-grid-element.component.html',
})
/**
* Component representing a grid element for a collection search result
@@ -27,7 +27,7 @@ export class CollectionSearchResultGridElementComponent extends SearchResultGrid
public dsoNameService: DSONameService,
private linkService: LinkService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
protected bitstreamDataService: BitstreamDataService,
) {
super(dsoNameService, truncatableService, bitstreamDataService);
}
@@ -38,7 +38,7 @@ export class CollectionSearchResultGridElementComponent extends SearchResultGrid
if (hasValue(this._dso) && hasNoValue(this._dso.logo)) {
this.linkService.resolveLink<Collection>(
this._dso,
followLink('logo')
followLink('logo'),
);
}
}

View File

@@ -36,10 +36,10 @@ mockCommunityWithAbstract.indexableObject = Object.assign(new Community(), {
'dc.description.abstract': [
{
language: 'en_US',
value: 'Short description'
}
]
}
value: 'Short description',
},
],
},
});
const mockCommunityWithoutAbstract: CommunitySearchResult = new CommunitySearchResult();
@@ -49,20 +49,20 @@ mockCommunityWithoutAbstract.indexableObject = Object.assign(new Community(), {
'dc.title': [
{
language: 'en_US',
value: 'Test title'
}
]
}
value: 'Test title',
},
],
},
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCommunityWithAbstract
resolveLink: mockCommunityWithAbstract,
});
describe('CommunitySearchResultGridElementComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot()
TranslateModule.forRoot(),
],
declarations: [CommunitySearchResultGridElementComponent, TruncatePipe],
providers: [
@@ -80,12 +80,12 @@ describe('CommunitySearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService }
{ provide: LinkService, useValue: linkService },
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(CommunitySearchResultGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -30,7 +30,7 @@ export class CommunitySearchResultGridElementComponent extends SearchResultGridE
public dsoNameService: DSONameService,
private linkService: LinkService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
protected bitstreamDataService: BitstreamDataService,
) {
super(dsoNameService, truncatableService, bitstreamDataService);
}

View File

@@ -32,7 +32,7 @@ const dcTitle = 'This is just another <em>title</em>';
mockItemWithMetadata.indexableObject = Object.assign(new Item(), {
hitHighlights: {
'dc.title': [{
value: dcTitle
value: dcTitle,
}],
},
bundles: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])),
@@ -40,33 +40,33 @@ mockItemWithMetadata.indexableObject = Object.assign(new Item(), {
'dc.title': [
{
language: 'en_US',
value: dcTitle
}
value: dcTitle,
},
],
'dc.contributor.author': [
{
language: 'en_US',
value: 'Smith, Donald'
}
value: 'Smith, Donald',
},
],
'dc.date.issued': [
{
language: null,
value: '2015-06-26'
}
value: '2015-06-26',
},
],
'dc.description.abstract': [
{
language: 'en_US',
value: 'This is an abstract'
}
]
}
value: 'This is an abstract',
},
],
},
});
const mockPerson: ItemSearchResult = Object.assign(new ItemSearchResult(), {
hitHighlights: {
'person.familyName': [{
value: '<em>Michel</em>'
value: '<em>Michel</em>',
}],
},
indexableObject:
@@ -77,50 +77,50 @@ const mockPerson: ItemSearchResult = Object.assign(new ItemSearchResult(), {
'dc.title': [
{
language: 'en_US',
value: 'This is just another title'
}
value: 'This is just another title',
},
],
'dc.contributor.author': [
{
language: 'en_US',
value: 'Smith, Donald'
}
value: 'Smith, Donald',
},
],
'dc.publisher': [
{
language: 'en_US',
value: 'a publisher'
}
value: 'a publisher',
},
],
'dc.date.issued': [
{
language: 'en_US',
value: '2015-06-26'
}
value: '2015-06-26',
},
],
'dc.description.abstract': [
{
language: 'en_US',
value: 'This is the abstract'
}
value: 'This is the abstract',
},
],
'dspace.entity.type': [
{
value: 'Person'
}
value: 'Person',
},
],
'person.familyName': [
{
value: 'Michel'
}
]
}
})
value: 'Michel',
},
],
},
}),
});
const mockOrgUnit: ItemSearchResult = Object.assign(new ItemSearchResult(), {
hitHighlights: {
'organization.legalName': [{
value: '<em>Science</em>'
value: '<em>Science</em>',
}],
},
indexableObject:
@@ -131,45 +131,45 @@ const mockOrgUnit: ItemSearchResult = Object.assign(new ItemSearchResult(), {
'dc.title': [
{
language: 'en_US',
value: 'This is just another title'
}
value: 'This is just another title',
},
],
'dc.contributor.author': [
{
language: 'en_US',
value: 'Smith, Donald'
}
value: 'Smith, Donald',
},
],
'dc.publisher': [
{
language: 'en_US',
value: 'a publisher'
}
value: 'a publisher',
},
],
'dc.date.issued': [
{
language: 'en_US',
value: '2015-06-26'
}
value: '2015-06-26',
},
],
'dc.description.abstract': [
{
language: 'en_US',
value: 'This is the abstract'
}
value: 'This is the abstract',
},
],
'organization.legalName': [
{
value: 'Science'
}
value: 'Science',
},
],
'dspace.entity.type': [
{
value: 'OrgUnit'
}
]
}
})
value: 'OrgUnit',
},
],
},
}),
});
const mockItemWithoutMetadata: ItemSearchResult = new ItemSearchResult();
@@ -180,10 +180,10 @@ mockItemWithoutMetadata.indexableObject = Object.assign(new Item(), {
'dc.title': [
{
language: 'en_US',
value: 'This is just another title'
}
]
}
value: 'This is just another title',
},
],
},
});
describe('ItemGridElementComponent', getEntityGridElementTestComponent(ItemSearchResultGridElementComponent, mockItemWithMetadata, mockItemWithoutMetadata, ['authors', 'date', 'abstract']));
@@ -209,14 +209,14 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet
const mockBitstreamDataService = {
getThumbnailFor(item: Item): Observable<RemoteData<Bitstream>> {
return createSuccessfulRemoteDataObject$(new Bitstream());
}
},
};
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
NoopAnimationsModule,
TranslateModule.forRoot()
TranslateModule.forRoot(),
],
declarations: [component, TruncatePipe],
providers: [
@@ -233,9 +233,9 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
}).overrideComponent(component, {
set: { changeDetection: ChangeDetectionStrategy.Default }
set: { changeDetection: ChangeDetectionStrategy.Default },
}).compileComponents();
}));

View File

@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { focusShadow } from '../../../../animations/focus';
import { ViewMode } from '../../../../../core/shared/view-mode.model';
import {
listableObjectComponent
listableObjectComponent,
} from '../../../../object-collection/shared/listable-object/listable-object.decorator';
import { SearchResultGridElementComponent } from '../../search-result-grid-element.component';
import { Item } from '../../../../../core/shared/item.model';
@@ -18,7 +18,7 @@ import { BitstreamDataService } from '../../../../../core/data/bitstream-data.se
selector: 'ds-item-search-result-grid-element',
styleUrls: ['./item-search-result-grid-element.component.scss'],
templateUrl: './item-search-result-grid-element.component.html',
animations: [focusShadow]
animations: [focusShadow],
})
/**
* The component for displaying a grid element for an item search result of the type Publication

View File

@@ -12,7 +12,7 @@ import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
@Component({
selector: 'ds-search-result-grid-element',
template: ``
template: ``,
})
export class SearchResultGridElementComponent<T extends SearchResult<K>, K extends DSpaceObject> extends AbstractListableElementComponent<T> implements OnInit {
/**
@@ -28,7 +28,7 @@ export class SearchResultGridElementComponent<T extends SearchResult<K>, K exten
public constructor(
public dsoNameService: DSONameService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
protected bitstreamDataService: BitstreamDataService,
) {
super(dsoNameService);
}