mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
[DURACOM-191] run optimize imports and lint fix
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
// Load the implementations that should be tested
|
||||
import { HttpXsrfTokenExtractor } from '@angular/common/http';
|
||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
CUSTOM_ELEMENTS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
inject,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FileUploadModule } from 'ng2-file-upload';
|
||||
|
||||
@@ -23,21 +32,21 @@ describe('Chips component', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
FileUploadModule,
|
||||
TranslateModule.forRoot(),
|
||||
UploaderComponent,
|
||||
TestComponent
|
||||
],
|
||||
providers: [
|
||||
TestComponent,
|
||||
],
|
||||
providers: [
|
||||
ChangeDetectorRef,
|
||||
UploaderComponent,
|
||||
DragService,
|
||||
{ provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock('mock-token') },
|
||||
{ provide: CookieService, useValue: new CookieServiceMock() },
|
||||
],
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
});
|
||||
});
|
||||
|
||||
}));
|
||||
|
||||
@@ -61,10 +70,10 @@ describe('Chips component', () => {
|
||||
|
||||
// declare a test component
|
||||
@Component({
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [FileUploadModule, UploaderComponent]
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [FileUploadModule, UploaderComponent],
|
||||
})
|
||||
class TestComponent {
|
||||
public uploadFilesOptions: UploaderOptions = Object.assign(new UploaderOptions(), {
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpXsrfTokenExtractor } from '@angular/common/http';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
@@ -8,20 +10,28 @@ import {
|
||||
Output,
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { FileUploader, FileUploadModule } from 'ng2-file-upload';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import uniqueId from 'lodash/uniqueId';
|
||||
import { HttpXsrfTokenExtractor } from '@angular/common/http';
|
||||
import {
|
||||
FileUploader,
|
||||
FileUploadModule,
|
||||
} from 'ng2-file-upload';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { DragService } from '../../../core/drag.service';
|
||||
import { CookieService } from '../../../core/services/cookie.service';
|
||||
import { XSRF_COOKIE, XSRF_REQUEST_HEADER, XSRF_RESPONSE_HEADER, } from '../../../core/xsrf/xsrf.constants';
|
||||
import { hasValue, isNotEmpty, isUndefined, } from '../../empty.util';
|
||||
import {
|
||||
XSRF_COOKIE,
|
||||
XSRF_REQUEST_HEADER,
|
||||
XSRF_RESPONSE_HEADER,
|
||||
} from '../../../core/xsrf/xsrf.constants';
|
||||
import {
|
||||
hasValue,
|
||||
isNotEmpty,
|
||||
isUndefined,
|
||||
} from '../../empty.util';
|
||||
import { UploaderOptions } from './uploader-options.model';
|
||||
import { UploaderProperties } from './uploader-properties.model';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-uploader',
|
||||
@@ -30,7 +40,7 @@ import { CommonModule } from '@angular/common';
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
encapsulation: ViewEncapsulation.Emulated,
|
||||
standalone: true,
|
||||
imports: [TranslateModule, FileUploadModule, CommonModule]
|
||||
imports: [TranslateModule, FileUploadModule, CommonModule],
|
||||
})
|
||||
export class UploaderComponent {
|
||||
|
||||
|
Reference in New Issue
Block a user