mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
87968: Minor code changes to pass lint
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
}));
|
||||
|
@@ -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';
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ export class AuthService {
|
||||
if (hasValue(rd.payload) && rd.payload.authenticated) {
|
||||
return rd.payload;
|
||||
} else {
|
||||
throw(new Error('Invalid email or password'));
|
||||
throw (new Error('Invalid email or password'));
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -166,7 +166,7 @@ export class AuthService {
|
||||
if (hasValue(status) && status.authenticated) {
|
||||
return status._links.eperson.href;
|
||||
} else {
|
||||
throw(new Error('Not authenticated'));
|
||||
throw (new Error('Not authenticated'));
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -249,7 +249,7 @@ export class AuthService {
|
||||
if (hasValue(status) && status.authenticated) {
|
||||
return status.token;
|
||||
} else {
|
||||
throw(new Error('Not authenticated'));
|
||||
throw (new Error('Not authenticated'));
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -288,7 +288,7 @@ export class AuthService {
|
||||
if (hasValue(status) && !status.authenticated) {
|
||||
return true;
|
||||
} else {
|
||||
throw(new Error('auth.errors.invalid-user'));
|
||||
throw (new Error('auth.errors.invalid-user'));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ export class ServerAuthService extends AuthService {
|
||||
if (hasValue(status) && status.authenticated) {
|
||||
return status._links.eperson.href;
|
||||
} else {
|
||||
throw(new Error('Not authenticated'));
|
||||
throw (new Error('Not authenticated'));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@@ -16,7 +16,8 @@ export class FilteredDiscoveryPageResponseParsingService extends BaseResponsePar
|
||||
toCache = false;
|
||||
constructor(
|
||||
protected objectCache: ObjectCacheService,
|
||||
) { super();
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { PersonItemMetadataListElementComponent } from './person-item-metadata-list-element.component';
|
||||
import { MetadataValue } from '../../../../core/shared/metadata.models';
|
||||
|
||||
const jobTitle ='Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.';
|
||||
const jobTitle = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.';
|
||||
const firstName = 'Joe';
|
||||
const lastName = 'Anonymous';
|
||||
const mockItem = Object.assign(new Item(), { metadata: { 'person.jobTitle': [{ value: jobTitle }], 'person.givenName': [{ value: firstName }], 'person.familyName': [{ value: lastName }] } });
|
||||
|
@@ -185,5 +185,5 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => {
|
||||
class TestComponent {
|
||||
reload = (event) => {
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -190,5 +190,5 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => {
|
||||
class TestComponent {
|
||||
reload = (event) => {
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -124,5 +124,5 @@ class TestComponent {
|
||||
|
||||
reload = (event) => {
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -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),
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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),
|
||||
|
@@ -120,7 +120,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
this.zone.run(() => this.cdr.detectChanges());
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
public remove() {
|
||||
if (this.animate) {
|
||||
|
@@ -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]: {
|
||||
|
@@ -33,7 +33,7 @@ export class AuthServiceStub {
|
||||
return observableOf(authStatus);
|
||||
} else {
|
||||
console.log('error');
|
||||
throw(new Error('Message Error test'));
|
||||
throw (new Error('Message Error test'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class AuthServiceStub {
|
||||
if (token.accessToken === 'token_test') {
|
||||
return observableOf(EPersonMock._links.self.href);
|
||||
} else {
|
||||
throw(new Error('Message Error test'));
|
||||
throw (new Error('Message Error test'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ class TestComponent {
|
||||
|
||||
/* eslint-disable no-empty,@typescript-eslint/no-empty-function */
|
||||
public onBeforeUpload = () => {
|
||||
}
|
||||
};
|
||||
|
||||
onCompleteItem(event) {
|
||||
}
|
||||
|
@@ -161,7 +161,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
|
||||
this.treeControl.expand(newNode);
|
||||
}
|
||||
return newNode;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get tree level for a given node
|
||||
|
@@ -83,7 +83,7 @@ export class SubmissionUploadFilesComponent implements OnChanges {
|
||||
.subscribe();
|
||||
this.subs.push(sub);
|
||||
return sub;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize instance variables
|
||||
|
@@ -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'))),
|
||||
|
@@ -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
6
src/typings.d.ts
vendored
@@ -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;
|
||||
|
Reference in New Issue
Block a user