87968: Minor code changes to pass lint

This commit is contained in:
Yura Bondarenko
2022-03-25 12:36:14 +01:00
parent bb51609af9
commit 99c41b9e80
27 changed files with 39 additions and 41 deletions

View File

@@ -127,10 +127,10 @@ export class BrowseByMetadataPageComponent implements OnInit {
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
})
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
this.browseId = params.id || this.defaultBrowseId;
this.browseId = params.id || this.defaultBrowseId;
this.authority = params.authority;
this.value = +params.value || params.value || '';
this.startsWith = +params.startsWith || params.startsWith;
this.value = +params.value || params.value || '';
this.startsWith = +params.startsWith || params.startsWith;
const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId);
if (isNotEmpty(this.value)) {
this.updatePageWithItems(searchOptions, this.value, this.authority);

View File

@@ -45,7 +45,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent {
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
})
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
this.browseId = params.id || this.defaultBrowseId;
this.browseId = params.id || this.defaultBrowseId;
this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId), undefined, undefined);
this.updateParent(params.scope);
}));

View File

@@ -7,7 +7,8 @@ import { Component } from '@angular/core';
selector: 'ds-themed-community-list',
styleUrls: [],
templateUrl: '../../shared/theme-support/themed.component.html',
})export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
})
export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
protected getComponentName(): string {
return 'CommunityListComponent';
}

View File

@@ -16,7 +16,8 @@ export class FilteredDiscoveryPageResponseParsingService extends BaseResponsePar
toCache = false;
constructor(
protected objectCache: ObjectCacheService,
) { super();
) {
super();
}
/**

View File

@@ -185,5 +185,5 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => {
class TestComponent {
reload = (event) => {
return;
}
};
}

View File

@@ -190,5 +190,5 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => {
class TestComponent {
reload = (event) => {
return;
}
};
}

View File

@@ -124,5 +124,5 @@ class TestComponent {
reload = (event) => {
return;
}
};
}

View File

@@ -33,8 +33,7 @@ const options = { params: { sidebarWidth: '*' } };
export const slideSidebar = trigger('slideSidebar', [
transition('expanded => collapsed',
group
(
group(
[
query('@*', animateChild()),
query('.sidebar-collapsible', expandedStyle, options),
@@ -43,8 +42,7 @@ export const slideSidebar = trigger('slideSidebar', [
)),
transition('collapsed => expanded',
group
(
group(
[
query('@*', animateChild()),
query('.sidebar-collapsible', collapsedStyle),

View File

@@ -59,7 +59,7 @@ export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent imple
*/
inputFormatter = (x: { display: string }, y: number) => {
return y === 1 ? this.firstInputValue : this.secondInputValue;
}
};
/**
* Initialize the component, setting up the init form value

View File

@@ -80,7 +80,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
*/
formatter = (x: { display: string }) => {
return (typeof x === 'object') ? x.display : x;
}
};
/**
* Converts a stream of text values from the `<input>` element to the stream of the array of items
@@ -116,7 +116,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
tap(() => this.changeSearchingStatus(false)),
merge(this.hideSearchingWhenUnsubscribed$)
);
}
};
/**
* Initialize the component, setting up the init form value

View File

@@ -90,7 +90,7 @@ export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implemen
}),
map((list: PaginatedList<VocabularyEntry>) => list.page),
tap(() => this.changeSearchingStatus(false)),
merge(this.hideSearchingWhenUnsubscribed))
merge(this.hideSearchingWhenUnsubscribed));
/**
* Initialize the component, setting up the init form value

View File

@@ -111,10 +111,10 @@ export class InputSuggestionsComponent implements ControlValueAccessor, OnChange
@Input() disabled = false;
propagateChange = (_: any) => {
/* Empty implementation */
}
};
propagateTouch = (_: any) => {
/* Empty implementation */
}
};
/**
* When any of the inputs change, check if we should still show the suggestions

View File

@@ -19,7 +19,6 @@ export class MenuEffects {
/**
* On route change, build menu sections for every menu type depending on the current route data
*/
public buildRouteMenuSections$: Observable<Action> = createEffect(() => this.actions$
.pipe(
ofType(ROUTER_NAVIGATED),

View File

@@ -120,7 +120,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
}
this.zone.run(() => this.cdr.detectChanges());
});
}
};
public remove() {
if (this.animate) {

View File

@@ -35,7 +35,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec
switch (action.type) {
case ObjectSelectionActionTypes.INITIAL_SELECT: {
if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) {
if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) {
return Object.assign({}, state, {
[action.key]: Object.assign({}, state[action.key], {
[action.id]: {
@@ -48,7 +48,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec
}
case ObjectSelectionActionTypes.INITIAL_DESELECT: {
if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) {
if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) {
return Object.assign({}, state, {
[action.key]: Object.assign({}, state[action.key], {
[action.id]: {

View File

@@ -46,7 +46,7 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
// if an input or output has changed
if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) {
this.connectInputsAndOutputs();
if (this.compRef?.instance && 'ngOnChanges' in this.compRef?.instance) {
if (this.compRef?.instance && 'ngOnChanges' in this.compRef.instance) {
(this.compRef.instance as any).ngOnChanges(changes);
}
}

View File

@@ -79,7 +79,7 @@ class TestComponent {
/* eslint-disable no-empty,@typescript-eslint/no-empty-function */
public onBeforeUpload = () => {
}
};
onCompleteItem(event) {
}

View File

@@ -161,7 +161,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
this.treeControl.expand(newNode);
}
return newNode;
}
};
/**
* Get tree level for a given node

View File

@@ -83,7 +83,7 @@ export class SubmissionUploadFilesComponent implements OnChanges {
.subscribe();
this.subs.push(sub);
return sub;
}
};
/**
* Initialize instance variables

View File

@@ -303,7 +303,6 @@ export class SubmissionObjectEffects {
/**
* Show a notification on success and redirect to MyDSpace page
*/
discardSubmissionSuccess$ = createEffect(() => this.actions$.pipe(
ofType(SubmissionObjectActionTypes.DISCARD_SUBMISSION_SUCCESS),
tap(() => this.notificationsService.success(null, this.translate.get('submission.sections.general.discard_success_notice'))),

View File

@@ -73,7 +73,7 @@ const getLocalConfigPath = (env: Environment) => {
break;
case 'development':
default:
envVariations = ['dev', 'development']
envVariations = ['dev', 'development'];
}
// check if any environment variations of app config exist

6
src/typings.d.ts vendored
View File

@@ -31,14 +31,14 @@ declare module 'modern-lru' {
export = x;
}
declare var System: SystemJS;
declare let System: SystemJS;
interface SystemJS {
import: (path?: string) => Promise<any>;
}
// Extra variables that live on Global that will be replaced by webpack DefinePlugin
declare var ENV: string;
declare var HMR: boolean;
declare let ENV: string;
declare let HMR: boolean;
interface GlobalEnvironment {
ENV;
HMR;