mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
87968: Minor code changes to pass lint
This commit is contained in:
@@ -3,7 +3,7 @@ import * as https from 'https';
|
|||||||
|
|
||||||
import { AppConfig } from '../src/config/app-config.interface';
|
import { AppConfig } from '../src/config/app-config.interface';
|
||||||
import { buildAppConfig } from '../src/config/config.server';
|
import { buildAppConfig } from '../src/config/config.server';
|
||||||
|
|
||||||
const appConfig: AppConfig = buildAppConfig();
|
const appConfig: AppConfig = buildAppConfig();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -127,10 +127,10 @@ export class BrowseByMetadataPageComponent implements OnInit {
|
|||||||
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
|
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
|
||||||
})
|
})
|
||||||
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
|
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
|
||||||
this.browseId = params.id || this.defaultBrowseId;
|
this.browseId = params.id || this.defaultBrowseId;
|
||||||
this.authority = params.authority;
|
this.authority = params.authority;
|
||||||
this.value = +params.value || params.value || '';
|
this.value = +params.value || params.value || '';
|
||||||
this.startsWith = +params.startsWith || params.startsWith;
|
this.startsWith = +params.startsWith || params.startsWith;
|
||||||
const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId);
|
const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId);
|
||||||
if (isNotEmpty(this.value)) {
|
if (isNotEmpty(this.value)) {
|
||||||
this.updatePageWithItems(searchOptions, this.value, this.authority);
|
this.updatePageWithItems(searchOptions, this.value, this.authority);
|
||||||
|
@@ -45,7 +45,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent {
|
|||||||
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
|
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
|
||||||
})
|
})
|
||||||
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
|
).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.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId), undefined, undefined);
|
||||||
this.updateParent(params.scope);
|
this.updateParent(params.scope);
|
||||||
}));
|
}));
|
||||||
|
@@ -7,7 +7,8 @@ import { Component } from '@angular/core';
|
|||||||
selector: 'ds-themed-community-list',
|
selector: 'ds-themed-community-list',
|
||||||
styleUrls: [],
|
styleUrls: [],
|
||||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
})export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
|
})
|
||||||
|
export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
|
||||||
protected getComponentName(): string {
|
protected getComponentName(): string {
|
||||||
return 'CommunityListComponent';
|
return 'CommunityListComponent';
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,7 @@ export class AuthService {
|
|||||||
if (hasValue(rd.payload) && rd.payload.authenticated) {
|
if (hasValue(rd.payload) && rd.payload.authenticated) {
|
||||||
return rd.payload;
|
return rd.payload;
|
||||||
} else {
|
} 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) {
|
if (hasValue(status) && status.authenticated) {
|
||||||
return status._links.eperson.href;
|
return status._links.eperson.href;
|
||||||
} else {
|
} else {
|
||||||
throw(new Error('Not authenticated'));
|
throw (new Error('Not authenticated'));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -249,7 +249,7 @@ export class AuthService {
|
|||||||
if (hasValue(status) && status.authenticated) {
|
if (hasValue(status) && status.authenticated) {
|
||||||
return status.token;
|
return status.token;
|
||||||
} else {
|
} else {
|
||||||
throw(new Error('Not authenticated'));
|
throw (new Error('Not authenticated'));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ export class AuthService {
|
|||||||
if (hasValue(status) && !status.authenticated) {
|
if (hasValue(status) && !status.authenticated) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} 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) {
|
if (hasValue(status) && status.authenticated) {
|
||||||
return status._links.eperson.href;
|
return status._links.eperson.href;
|
||||||
} else {
|
} else {
|
||||||
throw(new Error('Not authenticated'));
|
throw (new Error('Not authenticated'));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,8 @@ export class FilteredDiscoveryPageResponseParsingService extends BaseResponsePar
|
|||||||
toCache = false;
|
toCache = false;
|
||||||
constructor(
|
constructor(
|
||||||
protected objectCache: ObjectCacheService,
|
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 { PersonItemMetadataListElementComponent } from './person-item-metadata-list-element.component';
|
||||||
import { MetadataValue } from '../../../../core/shared/metadata.models';
|
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 firstName = 'Joe';
|
||||||
const lastName = 'Anonymous';
|
const lastName = 'Anonymous';
|
||||||
const mockItem = Object.assign(new Item(), { metadata: { 'person.jobTitle': [{ value: jobTitle }], 'person.givenName': [{ value: firstName }], 'person.familyName': [{ value: lastName }] } });
|
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 {
|
class TestComponent {
|
||||||
reload = (event) => {
|
reload = (event) => {
|
||||||
return;
|
return;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
@@ -190,5 +190,5 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => {
|
|||||||
class TestComponent {
|
class TestComponent {
|
||||||
reload = (event) => {
|
reload = (event) => {
|
||||||
return;
|
return;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
@@ -124,5 +124,5 @@ class TestComponent {
|
|||||||
|
|
||||||
reload = (event) => {
|
reload = (event) => {
|
||||||
return;
|
return;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
@@ -33,8 +33,7 @@ const options = { params: { sidebarWidth: '*' } };
|
|||||||
export const slideSidebar = trigger('slideSidebar', [
|
export const slideSidebar = trigger('slideSidebar', [
|
||||||
|
|
||||||
transition('expanded => collapsed',
|
transition('expanded => collapsed',
|
||||||
group
|
group(
|
||||||
(
|
|
||||||
[
|
[
|
||||||
query('@*', animateChild()),
|
query('@*', animateChild()),
|
||||||
query('.sidebar-collapsible', expandedStyle, options),
|
query('.sidebar-collapsible', expandedStyle, options),
|
||||||
@@ -43,8 +42,7 @@ export const slideSidebar = trigger('slideSidebar', [
|
|||||||
)),
|
)),
|
||||||
|
|
||||||
transition('collapsed => expanded',
|
transition('collapsed => expanded',
|
||||||
group
|
group(
|
||||||
(
|
|
||||||
[
|
[
|
||||||
query('@*', animateChild()),
|
query('@*', animateChild()),
|
||||||
query('.sidebar-collapsible', collapsedStyle),
|
query('.sidebar-collapsible', collapsedStyle),
|
||||||
|
@@ -59,7 +59,7 @@ export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent imple
|
|||||||
*/
|
*/
|
||||||
inputFormatter = (x: { display: string }, y: number) => {
|
inputFormatter = (x: { display: string }, y: number) => {
|
||||||
return y === 1 ? this.firstInputValue : this.secondInputValue;
|
return y === 1 ? this.firstInputValue : this.secondInputValue;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the component, setting up the init form value
|
* Initialize the component, setting up the init form value
|
||||||
|
@@ -80,7 +80,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
|||||||
*/
|
*/
|
||||||
formatter = (x: { display: string }) => {
|
formatter = (x: { display: string }) => {
|
||||||
return (typeof x === 'object') ? x.display : x;
|
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
|
* 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)),
|
tap(() => this.changeSearchingStatus(false)),
|
||||||
merge(this.hideSearchingWhenUnsubscribed$)
|
merge(this.hideSearchingWhenUnsubscribed$)
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the component, setting up the init form value
|
* 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),
|
map((list: PaginatedList<VocabularyEntry>) => list.page),
|
||||||
tap(() => this.changeSearchingStatus(false)),
|
tap(() => this.changeSearchingStatus(false)),
|
||||||
merge(this.hideSearchingWhenUnsubscribed))
|
merge(this.hideSearchingWhenUnsubscribed));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the component, setting up the init form value
|
* Initialize the component, setting up the init form value
|
||||||
|
@@ -111,10 +111,10 @@ export class InputSuggestionsComponent implements ControlValueAccessor, OnChange
|
|||||||
@Input() disabled = false;
|
@Input() disabled = false;
|
||||||
propagateChange = (_: any) => {
|
propagateChange = (_: any) => {
|
||||||
/* Empty implementation */
|
/* Empty implementation */
|
||||||
}
|
};
|
||||||
propagateTouch = (_: any) => {
|
propagateTouch = (_: any) => {
|
||||||
/* Empty implementation */
|
/* Empty implementation */
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When any of the inputs change, check if we should still show the suggestions
|
* 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
|
* On route change, build menu sections for every menu type depending on the current route data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public buildRouteMenuSections$: Observable<Action> = createEffect(() => this.actions$
|
public buildRouteMenuSections$: Observable<Action> = createEffect(() => this.actions$
|
||||||
.pipe(
|
.pipe(
|
||||||
ofType(ROUTER_NAVIGATED),
|
ofType(ROUTER_NAVIGATED),
|
||||||
|
@@ -120,7 +120,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
this.zone.run(() => this.cdr.detectChanges());
|
this.zone.run(() => this.cdr.detectChanges());
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
public remove() {
|
public remove() {
|
||||||
if (this.animate) {
|
if (this.animate) {
|
||||||
|
@@ -35,7 +35,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec
|
|||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
|
||||||
case ObjectSelectionActionTypes.INITIAL_SELECT: {
|
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, {
|
return Object.assign({}, state, {
|
||||||
[action.key]: Object.assign({}, state[action.key], {
|
[action.key]: Object.assign({}, state[action.key], {
|
||||||
[action.id]: {
|
[action.id]: {
|
||||||
@@ -48,7 +48,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec
|
|||||||
}
|
}
|
||||||
|
|
||||||
case ObjectSelectionActionTypes.INITIAL_DESELECT: {
|
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, {
|
return Object.assign({}, state, {
|
||||||
[action.key]: Object.assign({}, state[action.key], {
|
[action.key]: Object.assign({}, state[action.key], {
|
||||||
[action.id]: {
|
[action.id]: {
|
||||||
|
@@ -33,7 +33,7 @@ export class AuthServiceStub {
|
|||||||
return observableOf(authStatus);
|
return observableOf(authStatus);
|
||||||
} else {
|
} else {
|
||||||
console.log('error');
|
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') {
|
if (token.accessToken === 'token_test') {
|
||||||
return observableOf(EPersonMock._links.self.href);
|
return observableOf(EPersonMock._links.self.href);
|
||||||
} else {
|
} 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 an input or output has changed
|
||||||
if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) {
|
if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) {
|
||||||
this.connectInputsAndOutputs();
|
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);
|
(this.compRef.instance as any).ngOnChanges(changes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ class TestComponent {
|
|||||||
|
|
||||||
/* eslint-disable no-empty,@typescript-eslint/no-empty-function */
|
/* eslint-disable no-empty,@typescript-eslint/no-empty-function */
|
||||||
public onBeforeUpload = () => {
|
public onBeforeUpload = () => {
|
||||||
}
|
};
|
||||||
|
|
||||||
onCompleteItem(event) {
|
onCompleteItem(event) {
|
||||||
}
|
}
|
||||||
|
@@ -161,7 +161,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
|
|||||||
this.treeControl.expand(newNode);
|
this.treeControl.expand(newNode);
|
||||||
}
|
}
|
||||||
return newNode;
|
return newNode;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get tree level for a given node
|
* Get tree level for a given node
|
||||||
|
@@ -83,7 +83,7 @@ export class SubmissionUploadFilesComponent implements OnChanges {
|
|||||||
.subscribe();
|
.subscribe();
|
||||||
this.subs.push(sub);
|
this.subs.push(sub);
|
||||||
return sub;
|
return sub;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize instance variables
|
* Initialize instance variables
|
||||||
|
@@ -303,7 +303,6 @@ export class SubmissionObjectEffects {
|
|||||||
/**
|
/**
|
||||||
* Show a notification on success and redirect to MyDSpace page
|
* Show a notification on success and redirect to MyDSpace page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
discardSubmissionSuccess$ = createEffect(() => this.actions$.pipe(
|
discardSubmissionSuccess$ = createEffect(() => this.actions$.pipe(
|
||||||
ofType(SubmissionObjectActionTypes.DISCARD_SUBMISSION_SUCCESS),
|
ofType(SubmissionObjectActionTypes.DISCARD_SUBMISSION_SUCCESS),
|
||||||
tap(() => this.notificationsService.success(null, this.translate.get('submission.sections.general.discard_success_notice'))),
|
tap(() => this.notificationsService.success(null, this.translate.get('submission.sections.general.discard_success_notice'))),
|
||||||
|
@@ -73,7 +73,7 @@ const getLocalConfigPath = (env: Environment) => {
|
|||||||
break;
|
break;
|
||||||
case 'development':
|
case 'development':
|
||||||
default:
|
default:
|
||||||
envVariations = ['dev', 'development']
|
envVariations = ['dev', 'development'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if any environment variations of app config exist
|
// 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;
|
export = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare var System: SystemJS;
|
declare let System: SystemJS;
|
||||||
|
|
||||||
interface SystemJS {
|
interface SystemJS {
|
||||||
import: (path?: string) => Promise<any>;
|
import: (path?: string) => Promise<any>;
|
||||||
}
|
}
|
||||||
// Extra variables that live on Global that will be replaced by webpack DefinePlugin
|
// Extra variables that live on Global that will be replaced by webpack DefinePlugin
|
||||||
declare var ENV: string;
|
declare let ENV: string;
|
||||||
declare var HMR: boolean;
|
declare let HMR: boolean;
|
||||||
interface GlobalEnvironment {
|
interface GlobalEnvironment {
|
||||||
ENV;
|
ENV;
|
||||||
HMR;
|
HMR;
|
||||||
|
Reference in New Issue
Block a user