Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"eslint-plugin-deprecation",
"eslint-plugin-unused-imports"
"eslint-plugin-unused-imports",
"eslint-plugin-lodash"
],
"overrides": [
{
Expand Down Expand Up @@ -202,7 +203,12 @@
"deprecation/deprecation": "warn",

"import/order": "off",
"import/no-deprecated": "warn"
"import/no-deprecated": "warn",

"lodash/import-scope": [
"error",
"method"
]
}
},
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
"eslint-plugin-deprecation": "^1.3.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^38.0.6",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-unused-imports": "^2.0.0",
"express-static-gzip": "^2.1.5",
"fork-ts-checker-webpack-plugin": "^6.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import { FormGroup } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { BitstreamDataService } from '../../core/data/bitstream-data.service';
import {
getAllSucceededRemoteDataPayload,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { RemoteData } from '../../../core/data/remote-data';
import { Collection } from '../../../core/shared/collection.model';
import { first, map, switchMap, take } from 'rxjs/operators';
import { ActivatedRoute, Router } from '@angular/router';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { CollectionDataService } from '../../../core/data/collection-data.service';
import { getFirstSucceededRemoteData, getFirstCompletedRemoteData } from '../../../core/shared/operators';
import { MetadataConfig } from '../../../core/shared/metadata-config.model';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/data/dso-change-analyzer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ChangeAnalyzer } from './change-analyzer';
import { Injectable } from '@angular/core';
import { DSpaceObject } from '../shared/dspace-object.model';
import { MetadataMap } from '../shared/metadata.models';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';

/**
* A class to determine what differs between two
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/data/request.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HttpHeaders } from '@angular/common/http';
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { filter, map, take, tap } from 'rxjs/operators';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { hasValue, isEmpty, isNotEmpty, hasNoValue } from '../../shared/empty.util';
import { ObjectCacheEntry } from '../cache/object-cache.reducer';
import { ObjectCacheService } from '../cache/object-cache.service';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/route.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ActivatedRoute, NavigationEnd, Params, Router, RouterStateSnapshot, } f

import { combineLatest, Observable } from 'rxjs';
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
import { isEqual } from 'lodash';
import isEqual from 'lodash/isEqual';

import { AddParameterAction, SetParameterAction, SetParametersAction, SetQueryParameterAction, SetQueryParametersAction } from './route.actions';
import { coreSelector } from '../core.selectors';
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/shared/metadata.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
MetadataValueFilter,
MetadatumViewModel
} from './metadata.models';
import { groupBy, sortBy } from 'lodash';
import groupBy from 'lodash/groupBy';
import sortBy from 'lodash/sortBy';

/**
* Utility class for working with DSpace object metadata.
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/utilities/equatable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-classes-per-file */
import { EquatableObject, excludeFromEquals, fieldsForEquals } from './equals.decorators';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';

class Dog extends EquatableObject<Dog> {
public name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/init.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { makeStateKey, TransferState } from '@angular/platform-browser';
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
import { environment } from '../environments/environment';
import { AppState } from './app.reducer';
import { isEqual } from 'lodash';
import isEqual from 'lodash/isEqual';
import { TranslateService } from '@ngx-translate/core';
import { LocaleService } from './core/locale/locale.service';
import { Angulartics2DSpace } from './statistics/angulartics/dspace-provider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEqual } from 'lodash';
import isEqual from 'lodash/isEqual';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core';
import { Bitstream } from '../../../../core/shared/bitstream.model';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service';
import { Observable } from 'rxjs';
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '../../../../core/shared/operators';
import { hasValue, isNotEmpty } from '../../../../shared/empty.util';
import { RegistryService } from '../../../../core/registry/registry.service';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
import { map } from 'rxjs/operators';
import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Item } from '../../../core/shared/item.model';
import { ItemDataService } from '../../../core/data/item-data.service';
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
import { ActivatedRoute, Router } from '@angular/router';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { first, switchMap } from 'rxjs/operators';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
import { RemoteData } from '../../../core/data/remote-data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EPerson } from '../../core/eperson/models/eperson.model';
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
import { NotificationsService } from '../../shared/notifications/notifications.service';
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';

describe('ProfilePageMetadataFormComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TranslateService } from '@ngx-translate/core';
import { hasValue, isNotEmpty } from '../../shared/empty.util';
import { LangConfig } from '../../../config/lang-config.interface';
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../core/shared/operators';
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
import { NotificationsService } from '../../shared/notifications/notifications.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SimpleChanges
} from '@angular/core';

import { findIndex } from 'lodash';
import findIndex from 'lodash/findIndex';

import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model';
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/chips/chips.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core';

import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
import { isObject } from 'lodash';
import isObject from 'lodash/isObject';

import { Chips } from './models/chips.model';
import { ChipsItem } from './models/chips-item.model';
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/chips/models/chips-item.model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isObject, uniqueId } from 'lodash';
import isObject from 'lodash/isObject';
import uniqueId from 'lodash/uniqueId';
import { hasValue, isNotEmpty } from '../../empty.util';
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
import { ConfidenceType } from '../../../core/shared/confidence-type';
Expand Down
4 changes: 3 additions & 1 deletion src/app/shared/chips/models/chips.model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { findIndex, isEqual, isObject } from 'lodash';
import findIndex from 'lodash/findIndex';
import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';
import { BehaviorSubject } from 'rxjs';
import { ChipsItem, ChipsItemIcon } from './chips-item.model';
import { hasValue, isNotEmpty } from '../../empty.util';
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/cookies/browser-klaro.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { AuthService } from '../../core/auth/auth.service';
import { CookieService } from '../../core/services/cookie.service';
import { getTestScheduler } from 'jasmine-marbles';
import { MetadataValue } from '../../core/shared/metadata.models';
import { clone, cloneDeep } from 'lodash';
import clone from 'lodash/clone';
import cloneDeep from 'lodash/cloneDeep';
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/cookies/browser-klaro.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { KlaroService } from './klaro.service';
import { hasValue, isEmpty, isNotEmpty } from '../empty.util';
import { CookieService } from '../../core/services/cookie.service';
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { cloneDeep, debounce } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import debounce from 'lodash/debounce';
import { ANONYMOUS_STORAGE_NAME_KLARO, klaroConfiguration } from './klaro-configuration';
import { Operation } from 'fast-json-patch';
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/date.util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';

import { isObject } from 'lodash';
import isObject from 'lodash/isObject';
import * as moment from 'moment';

import { isNull, isUndefined } from './empty.util';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';
import { FileUploader } from 'ng2-file-upload';
import { Observable, of as observableOf } from 'rxjs';
import { UploaderOptions } from '../uploader/uploader-options.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DynamicFormLayoutService,
DynamicFormValidationService
} from '@ng-dynamic-forms/core';
import { findKey } from 'lodash';
import findKey from 'lodash/findKey';

import { hasValue, isNotEmpty } from '../../../../../empty.util';
import { DynamicListCheckboxGroupModel } from './dynamic-list-checkbox-group.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
DynamicFormValidationService,
DynamicInputModel
} from '@ng-dynamic-forms/core';
import { isEqual, isObject } from 'lodash';
import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';

import { DynamicRelationGroupModel } from './dynamic-relation-group.model';
import { FormBuilderService } from '../../../form-builder.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dyna
import { Observable, of as observableOf } from 'rxjs';
import { catchError, debounceTime, distinctUntilChanged, map, merge, switchMap, tap } from 'rxjs/operators';
import { NgbTypeahead, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap';
import { isEqual } from 'lodash';
import isEqual from 'lodash/isEqual';

import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service';
import { DynamicTagModel } from './dynamic-tag.model';
Expand Down
4 changes: 3 additions & 1 deletion src/app/shared/form/builder/form-builder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import {
DynamicPathable,
parseReviver,
} from '@ng-dynamic-forms/core';
import { isObject, isString, mergeWith } from 'lodash';
import isObject from 'lodash/isObject';
import isString from 'lodash/isString';
import mergeWith from 'lodash/mergeWith';

import {
hasNoValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEqual } from 'lodash';
import isEqual from 'lodash/isEqual';

export class FormFieldPreviousValueObject {

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/form/builder/parsers/field-parser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Inject, InjectionToken} from '@angular/core';

import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';
import {DynamicFormControlLayout, DynamicFormControlRelation, MATCH_VISIBLE, OR_OPERATOR} from '@ng-dynamic-forms/core';

import { hasValue, isNotEmpty, isNotNull, isNotUndefined } from '../../../empty.util';
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/form/builder/parsers/row-parser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, Injector } from '@angular/core';

import { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DynamicFormGroupModelConfig } from '@ng-dynamic-forms/core';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';

import { isEmpty } from '../../../empty.util';
import { DynamicRowGroupModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-group-model';
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DynamicFormLayout,
} from '@ng-dynamic-forms/core';
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { findIndex } from 'lodash';
import findIndex from 'lodash/findIndex';

import { FormBuilderService } from './builder/form-builder.service';
import { hasValue, isNotEmpty, isNotNull, isNull } from '../empty.util';
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/form/form.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
FormStatusChangeAction
} from './form.actions';
import { hasValue } from '../empty.util';
import { isEqual, uniqWith } from 'lodash';
import isEqual from 'lodash/isEqual';
import uniqWith from 'lodash/uniqWith';

export interface FormError {
message: string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/form/form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { formObjectFromIdSelector } from './selectors';
import { FormBuilderService } from './builder/form-builder.service';
import { DynamicFormControlEvent, DynamicFormControlModel, DynamicFormGroupModel } from '@ng-dynamic-forms/core';
import { isEmpty, isNotUndefined } from '../empty.util';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';
import {
FormAddError,
FormAddTouchedAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AppState } from '../../../app.reducer';
import { NotificationComponent } from '../notification/notification.component';
import { Notification } from '../models/notification.model';
import { NotificationType } from '../models/notification-type';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';
import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces';
import { NotificationsServiceStub } from '../../testing/notifications-service.stub';
import { cold } from 'jasmine-marbles';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { select, Store } from '@ngrx/store';
import { BehaviorSubject, Subscription } from 'rxjs';
import { difference } from 'lodash';
import difference from 'lodash/difference';

import { NotificationsService } from '../notifications.service';
import { AppState } from '../../../app.reducer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { NotificationOptions } from './models/notification-options.model';
import { NotificationAnimationsType } from './models/notification-animations-type';
import { NotificationType } from './models/notification-type';
import { Notification } from './models/notification.model';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';
import { ChangeDetectorRef } from '@angular/core';
import { storeModuleConfig } from '../../app.reducer';

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/notifications/notifications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { of as observableOf } from 'rxjs';
import { first } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';

import { INotification, Notification } from './models/notification.model';
import { NotificationType } from './models/notification-type';
Expand Down
4 changes: 3 additions & 1 deletion src/app/shared/object.util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { isNotEmpty } from './empty.util';
import { isEqual, isObject, transform } from 'lodash';
import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';
import transform from 'lodash/transform';

/**
* Returns passed object without specified property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChangeDetectorRef, Component, Injector, NO_ERRORS_SCHEMA } from '@angul
import { of as observableOf } from 'rxjs';
import { TranslateModule } from '@ngx-translate/core';
import { cold } from 'jasmine-marbles';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';

import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
import { createTestComponent } from '../../../testing/utils.test';
Expand All @@ -19,10 +19,8 @@ import { PaginationComponentOptions } from '../../../pagination/pagination-compo
import { buildPaginatedList } from '../../../../core/data/paginated-list.model';
import { PageInfo } from '../../../../core/shared/page-info.model';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
import { PaginationService } from '../../../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../../testing/pagination-service.stub';
import { FindListOptions } from '../../../../core/data/find-list-options.model';

describe('EpersonGroupListComponent test suite', () => {
let comp: EpersonGroupListComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, EventEmitter, Injector, Input, OnDestroy, OnInit, Output } f

import { BehaviorSubject, Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { uniqueId } from 'lodash';
import uniqueId from 'lodash/uniqueId';

import { RemoteData } from '../../../../core/data/remote-data';
import { PaginatedList } from '../../../../core/data/paginated-list.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MyDSpaceConfigurationValueType } from '../../../my-dspace-page/my-dspac
import { SearchConfigurationOption } from './search-configuration-option.model';
import { SearchService } from '../../../core/shared/search/search.service';
import { currentPath } from '../../utils/route.utils';
import { findIndex } from 'lodash';
import findIndex from 'lodash/findIndex';

@Component({
selector: 'ds-search-switch-configuration',
Expand Down
Loading