mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
[DURACOM-304] fix tests and lint
This commit is contained in:
@@ -4,19 +4,18 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { filter, map, switchMap, tap } from 'rxjs/operators';
|
||||
import {
|
||||
combineLatest,
|
||||
combineLatest as observableCombineLatest, EMPTY,
|
||||
expand,
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf, reduce,
|
||||
of as observableOf,
|
||||
Subscription, take
|
||||
} from 'rxjs';
|
||||
import { DynamicFormControlModel, DynamicFormGroupModel, DynamicFormLayout, DynamicFormService, DynamicInputModel, DynamicSelectModel } from '@ng-dynamic-forms/core';
|
||||
import { DynamicFormControlModel, DynamicFormGroupModel, DynamicFormLayout, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
import { UntypedFormGroup } 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/cloneDeep';
|
||||
import { BitstreamDataService } from '../../core/data/bitstream-data.service';
|
||||
import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, getFirstSucceededRemoteData, getFirstSucceededRemoteDataPayload, getRemoteDataPayload } from '../../core/shared/operators';
|
||||
import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, getFirstSucceededRemoteDataPayload, getRemoteDataPayload } from '../../core/shared/operators';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { BitstreamFormatDataService } from '../../core/data/bitstream-format-data.service';
|
||||
import { BitstreamFormat } from '../../core/shared/bitstream-format.model';
|
||||
@@ -25,7 +24,6 @@ import { hasValue, hasValueOperator, isEmpty, isNotEmpty } from '../../shared/em
|
||||
import { Metadata } from '../../core/shared/metadata.utils';
|
||||
import { Location } from '@angular/common';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { getEntityEditRoute } from '../../item-page/item-page-routing-paths';
|
||||
import { Bundle } from '../../core/shared/bundle.model';
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
@@ -34,7 +32,7 @@ import { DsDynamicInputModel } from '../../shared/form/builder/ds-dynamic-form-u
|
||||
import { DsDynamicTextAreaModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-textarea.model';
|
||||
import { PrimaryBitstreamService } from '../../core/data/primary-bitstream.service';
|
||||
import { DynamicScrollableDropdownModel } from 'src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.model';
|
||||
import { FindAllDataImpl } from "../../core/data/base/find-all-data";
|
||||
import { FindAllDataImpl } from '../../core/data/base/find-all-data';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-edit-bitstream-page',
|
||||
|
@@ -8,7 +8,7 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||
import { Bitstream } from '../shared/bitstream.model';
|
||||
import { BITSTREAM } from '../shared/bitstream.resource-type';
|
||||
import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData } from '../shared/operators';
|
||||
import { getFirstCompletedRemoteData } from '../shared/operators';
|
||||
import { Bundle } from '../shared/bundle.model';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
import { Item } from '../shared/item.model';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { combineLatest as observableCombineLatest, EMPTY, expand, from, Observable, reduce } from 'rxjs';
|
||||
import { map, mergeMap, switchMap, toArray } from 'rxjs/operators';
|
||||
import { map, mergeMap, toArray } from 'rxjs/operators';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||
|
@@ -45,7 +45,7 @@ import { CoreState } from '../core-state.model';
|
||||
import { AuthorizationDataService } from '../data/feature-authorization/authorization-data.service';
|
||||
import { getDownloadableBitstream } from '../shared/bitstream.operators';
|
||||
import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface';
|
||||
import { FindListOptions } from "../data/find-list-options.model";
|
||||
import { FindListOptions } from '../data/find-list-options.model';
|
||||
|
||||
/**
|
||||
* The base selector function to select the metaTag section in the store
|
||||
|
@@ -23,7 +23,7 @@ import { ResponsiveTableSizes } from '../../../shared/responsive-table-sizes/res
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { ItemBitstreamsService } from './item-bitstreams.service';
|
||||
import { AlertType } from '../../../shared/alert/alert-type';
|
||||
import { PaginationComponentOptions } from "../../../shared/pagination/pagination-component-options.model";
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-bitstreams',
|
||||
|
@@ -1,19 +1,18 @@
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Optional, Output } from '@angular/core';
|
||||
import { ScriptDataService } from '../../../core/data/processes/script-data.service';
|
||||
import { Script } from '../../scripts/script.model';
|
||||
import { BehaviorSubject, Observable, Subscription, tap } from 'rxjs';
|
||||
import { distinctUntilChanged, filter, map, switchMap, take } from 'rxjs/operators';
|
||||
import { BehaviorSubject, Subscription, tap } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import {
|
||||
getRemoteDataPayload,
|
||||
getFirstSucceededRemoteData,
|
||||
getFirstCompletedRemoteData
|
||||
} from '../../../core/shared/operators';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { hasNoValue, hasValue } from '../../../shared/empty.util';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { ControlContainer, NgForm } from '@angular/forms';
|
||||
import { controlContainerFactory } from '../process-form.component';
|
||||
import { FindListOptions } from "../../../core/data/find-list-options.model";
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
|
||||
const SCRIPT_QUERY_PARAMETER = 'script';
|
||||
|
||||
@@ -69,7 +68,7 @@ export class ScriptsSelectComponent implements OnInit, OnDestroy {
|
||||
* Load the scripts and check if the route contains a script
|
||||
*/
|
||||
loadScripts() {
|
||||
if (this.isLoading$.value) return;
|
||||
if (this.isLoading$.value) {return;}
|
||||
this.isLoading$.next(true);
|
||||
|
||||
this.routeSub = this.scriptService.findAll(this.scriptOptions).pipe(
|
||||
|
@@ -17,7 +17,7 @@ import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/share
|
||||
import { PaginatedList } from '../../../../../../core/data/paginated-list.model';
|
||||
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { PageInfo } from '../../../../../../core/shared/page-info.model';
|
||||
import { BehaviorSubject, EMPTY, expand, map, reduce, Subscription, tap } from "rxjs";
|
||||
import { BehaviorSubject, map, Subscription, tap } from 'rxjs';
|
||||
|
||||
export interface ListItem {
|
||||
id: string;
|
||||
|
@@ -15,7 +15,6 @@ import { catchError, distinctUntilChanged, map, tap } from 'rxjs/operators';
|
||||
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||
|
||||
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { DynamicScrollableDropdownModel } from './dynamic-scrollable-dropdown.model';
|
||||
import { PageInfo } from '../../../../../../core/shared/page-info.model';
|
||||
import { hasValue, isEmpty } from '../../../../../empty.util';
|
||||
@@ -27,9 +26,9 @@ import {
|
||||
} from '../../../../../../core/data/paginated-list.model';
|
||||
import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component';
|
||||
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
|
||||
import { FindAllData } from "../../../../../../core/data/base/find-all-data";
|
||||
import { CacheableObject } from "../../../../../../core/cache/cacheable-object.model";
|
||||
import { RemoteData } from "../../../../../../core/data/remote-data";
|
||||
import { FindAllData } from '../../../../../../core/data/base/find-all-data';
|
||||
import { CacheableObject } from '../../../../../../core/cache/cacheable-object.model';
|
||||
import { RemoteData } from '../../../../../../core/data/remote-data';
|
||||
|
||||
/**
|
||||
* Component representing a dropdown input field
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { AUTOCOMPLETE_OFF, DynamicFormControlLayout, serializable } from '@ng-dynamic-forms/core';
|
||||
import { DsDynamicInputModel, DsDynamicInputModelConfig } from '../ds-dynamic-input.model';
|
||||
import { VocabularyOptions } from '../../../../../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||
import { FindAllDataImpl } from "../../../../../../core/data/base/find-all-data";
|
||||
import { CacheableObject } from "../../../../../../core/cache/cacheable-object.model";
|
||||
import { FindAllDataImpl } from '../../../../../../core/data/base/find-all-data';
|
||||
import { CacheableObject } from '../../../../../../core/cache/cacheable-object.model';
|
||||
|
||||
export const DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN = 'SCROLLABLE_DROPDOWN';
|
||||
|
||||
|
@@ -198,10 +198,10 @@ describe('SubmissionSectionCcLicensesComponent', () => {
|
||||
|
||||
it('should display a dropdown with the different cc licenses', () => {
|
||||
expect(
|
||||
de.query(By.css('.ccLicense-select ds-select .dropdown-menu button:nth-child(1)')).nativeElement.innerText
|
||||
de.query(By.css('.ccLicense-select .scrollable-menu button:nth-child(1)')).nativeElement.innerText,
|
||||
).toContain('test license name 1');
|
||||
expect(
|
||||
de.query(By.css('.ccLicense-select ds-select .dropdown-menu button:nth-child(2)')).nativeElement.innerText
|
||||
de.query(By.css('.ccLicense-select .scrollable-menu button:nth-child(2)')).nativeElement.innerText,
|
||||
).toContain('test license name 2');
|
||||
});
|
||||
|
||||
|
@@ -1,9 +1,8 @@
|
||||
import { ChangeDetectorRef, Component, Inject } from '@angular/core';
|
||||
import { EMPTY, expand, Observable, of as observableOf, reduce, Subscription, tap } from 'rxjs';
|
||||
import { Observable, of as observableOf, Subscription, tap } from 'rxjs';
|
||||
import { Field, Option, SubmissionCcLicence } from '../../../core/submission/models/submission-cc-license.model';
|
||||
import {
|
||||
getFirstCompletedRemoteData,
|
||||
getFirstSucceededRemoteData, getFirstSucceededRemoteDataPayload,
|
||||
getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload,
|
||||
getRemoteDataPayload
|
||||
} from '../../../core/shared/operators';
|
||||
import { distinctUntilChanged, filter, map, take } from 'rxjs/operators';
|
||||
@@ -20,9 +19,7 @@ import { isNotEmpty } from '../../../shared/empty.util';
|
||||
import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder';
|
||||
import { SubmissionCcLicenseUrlDataService } from '../../../core/submission/submission-cc-license-url-data.service';
|
||||
import {ConfigurationDataService} from '../../../core/data/configuration-data.service';
|
||||
import { RemoteData } from "../../../core/data/remote-data";
|
||||
import { PaginatedList } from "../../../core/data/paginated-list.model";
|
||||
import { FindListOptions } from "../../../core/data/find-list-options.model";
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
|
||||
/**
|
||||
* This component represents the submission section to select the Creative Commons license.
|
||||
|
Reference in New Issue
Block a user