[CST-9636] Fix lint

This commit is contained in:
Giuseppe Digilio
2023-05-12 09:25:47 +02:00
parent 6808eec3a4
commit 377e27b305
9 changed files with 60 additions and 60 deletions

View File

@@ -69,10 +69,10 @@ describe('BulkAccessBrowseComponent', () => {
it('should have an initial remote data with a paginated list as value', () => {
const list = buildPaginatedList(new PageInfo({
"elementsPerPage": 5,
"totalElements": 2,
"totalPages": 1,
"currentPage": 1
'elementsPerPage': 5,
'totalElements': 2,
'totalPages': 1,
'currentPage': 1
}), [selected1, selected2]) ;
const rd = createSuccessfulRemoteDataObject(list);

View File

@@ -69,7 +69,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
distinctUntilChanged(),
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
).subscribe(this.objectsSelected$)
)
);
}
pageNext() {
@@ -87,7 +87,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
private calculatePageCount(pageSize, totalCount = 0) {
// we suppose that if we have 0 items we want 1 empty page
return totalCount < pageSize ? 1 : Math.ceil(totalCount / pageSize);
};
}
/**
* Generate The RemoteData object containing the list of the selected elements
@@ -114,6 +114,6 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
this.subs
.filter((sub) => hasValue(sub))
.forEach((sub) => sub.unsubscribe());
this.selectableListService.deselectAll(this.listId)
this.selectableListService.deselectAll(this.listId);
}
}

View File

@@ -24,38 +24,38 @@ fdescribe('BulkAccessComponent', () => {
const bulkAccessControlServiceMock = jasmine.createSpyObj('bulkAccessControlService', ['createPayloadFile', 'executeScript']);
const mockFormState = {
"bitstream": [],
"item": [
'bitstream': [],
'item': [
{
"name": "embargo",
"startDate": {
"year": 2026,
"month": 5,
"day": 31
'name': 'embargo',
'startDate': {
'year': 2026,
'month': 5,
'day': 31
},
"endDate": null
'endDate': null
}
],
"state": {
"item": {
"toggleStatus": true,
"accessMode": "replace"
'state': {
'item': {
'toggleStatus': true,
'accessMode': 'replace'
},
"bitstream": {
"toggleStatus": false,
"accessMode": "",
"changesLimit": "",
"selectedBitstreams": []
'bitstream': {
'toggleStatus': false,
'accessMode': '',
'changesLimit': '',
'selectedBitstreams': []
}
}
};
const mockFile = {
"uuids": [
'uuids': [
'1234', '5678'
],
"file": { }
}
'file': { }
};
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
getValue: jasmine.createSpy('getValue'),

View File

@@ -26,7 +26,7 @@ export class BulkAccessComponent implements OnInit {
/**
* The selection list id
*/
listId: string = 'bulk-access-list';
listId = 'bulk-access-list';
/**
* The list of the objects already selected
@@ -58,7 +58,7 @@ export class BulkAccessComponent implements OnInit {
distinctUntilChanged(),
map((list: SelectableListState) => this.generateIdListBySelectedElements(list))
).subscribe(this.objectsSelected$)
)
);
}
canExport(): boolean {
@@ -70,7 +70,7 @@ export class BulkAccessComponent implements OnInit {
* This will also reset the state of the child components (bitstream and item access)
*/
reset(): void {
this.settings.reset()
this.settings.reset();
}
/**

View File

@@ -8,28 +8,28 @@ describe('BulkAccessSettingsComponent', () => {
let component: BulkAccessSettingsComponent;
let fixture: ComponentFixture<BulkAccessSettingsComponent>;
const mockFormState = {
"bitstream": [],
"item": [
'bitstream': [],
'item': [
{
"name": "embargo",
"startDate": {
"year": 2026,
"month": 5,
"day": 31
'name': 'embargo',
'startDate': {
'year': 2026,
'month': 5,
'day': 31
},
"endDate": null
'endDate': null
}
],
"state": {
"item": {
"toggleStatus": true,
"accessMode": "replace"
'state': {
'item': {
'toggleStatus': true,
'accessMode': 'replace'
},
"bitstream": {
"toggleStatus": false,
"accessMode": "",
"changesLimit": "",
"selectedBitstreams": []
'bitstream': {
'toggleStatus': false,
'accessMode': '',
'changesLimit': '',
'selectedBitstreams': []
}
}
};
@@ -68,7 +68,7 @@ describe('BulkAccessSettingsComponent', () => {
it('should return the correct form value', () => {
const expectedValue = mockFormState;
(component.controlForm as any).getFormValue.and.returnValue(mockFormState)
(component.controlForm as any).getFormValue.and.returnValue(mockFormState);
const actualValue = component.getValue();
expect(actualValue).toEqual(expectedValue);
});

View File

@@ -28,7 +28,7 @@ export class BulkAccessSettingsComponent {
* This will also reset the state of the child components (bitstream and item access)
*/
reset() {
this.controlForm.reset()
this.controlForm.reset();
}
}

View File

@@ -13,7 +13,7 @@ import { TranslateService } from '@ngx-translate/core';
import { hasValue } from '../../empty.util';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
export const ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID = 'item-access-control-select-bitstreams'
export const ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID = 'item-access-control-select-bitstreams';
@Component({
selector: 'ds-item-access-control-select-bitstreams-modal',

View File

@@ -53,7 +53,7 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
@Input() selectionConfig: { repeatable: boolean, listId: string };
w /**
/**
* The link type of the listable elements
*/
@Input() linkType: CollectionElementLinkType;

View File

@@ -5348,6 +5348,6 @@
"access-control-add-more": "Add more",
"access-control-select-bitstreams-modal.title": "Select bitstreams",
"access-control-select-bitstreams-modal.no-items": "No items to show.",
"access-control-select-bitstreams-modal.close": "Close"
"access-control-select-bitstreams-modal.close": "Close",
}