mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
[DURACOM-208] Remove unused dependency
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { CdkTreeModule } from '@angular/cdk/tree';
|
import { CdkTreeModule } from '@angular/cdk/tree';
|
||||||
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { StoreModule } from '@ngrx/store';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
|
||||||
|
|
||||||
import { createTestComponent } from '../../testing/utils.test';
|
import { createTestComponent } from '../../testing/utils.test';
|
||||||
import { VocabularyTreeviewComponent } from './vocabulary-treeview.component';
|
import { VocabularyTreeviewComponent } from './vocabulary-treeview.component';
|
||||||
@@ -16,10 +15,6 @@ import { TreeviewFlatNode, TreeviewNode } from './vocabulary-treeview-node.model
|
|||||||
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
||||||
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
|
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { AuthTokenInfo } from '../../../core/auth/models/auth-token-info.model';
|
|
||||||
import { authReducer } from '../../../core/auth/auth.reducer';
|
|
||||||
import { storeModuleConfig } from '../../../app.reducer';
|
|
||||||
import { By } from '@angular/platform-browser';
|
|
||||||
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
||||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||||
|
|
||||||
@@ -28,7 +23,6 @@ describe('VocabularyTreeviewComponent test suite', () => {
|
|||||||
let comp: VocabularyTreeviewComponent;
|
let comp: VocabularyTreeviewComponent;
|
||||||
let compAsAny: any;
|
let compAsAny: any;
|
||||||
let fixture: ComponentFixture<VocabularyTreeviewComponent>;
|
let fixture: ComponentFixture<VocabularyTreeviewComponent>;
|
||||||
let initialState;
|
|
||||||
let de;
|
let de;
|
||||||
|
|
||||||
const item = new VocabularyEntryDetail();
|
const item = new VocabularyEntryDetail();
|
||||||
@@ -59,25 +53,10 @@ describe('VocabularyTreeviewComponent test suite', () => {
|
|||||||
clearSearchTopRequests: jasmine.createSpy('clearSearchTopRequests')
|
clearSearchTopRequests: jasmine.createSpy('clearSearchTopRequests')
|
||||||
});
|
});
|
||||||
|
|
||||||
initialState = {
|
|
||||||
core: {
|
|
||||||
auth: {
|
|
||||||
authenticated: true,
|
|
||||||
loaded: true,
|
|
||||||
blocking: false,
|
|
||||||
loading: false,
|
|
||||||
authToken: new AuthTokenInfo('test_token'),
|
|
||||||
userId: 'testid',
|
|
||||||
authMethods: []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CdkTreeModule,
|
CdkTreeModule,
|
||||||
StoreModule.forRoot({ auth: authReducer }, storeModuleConfig),
|
|
||||||
TranslateModule.forRoot()
|
TranslateModule.forRoot()
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
@@ -88,8 +67,6 @@ describe('VocabularyTreeviewComponent test suite', () => {
|
|||||||
{ provide: VocabularyTreeviewService, useValue: vocabularyTreeviewServiceStub },
|
{ provide: VocabularyTreeviewService, useValue: vocabularyTreeviewServiceStub },
|
||||||
{ provide: VocabularyService, useValue: vocabularyServiceStub },
|
{ provide: VocabularyService, useValue: vocabularyServiceStub },
|
||||||
{ provide: NgbActiveModal, useValue: modalStub },
|
{ provide: NgbActiveModal, useValue: modalStub },
|
||||||
provideMockStore({ initialState }),
|
|
||||||
ChangeDetectorRef,
|
|
||||||
VocabularyTreeviewComponent
|
VocabularyTreeviewComponent
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -2,7 +2,6 @@ import { FlatTreeControl } from '@angular/cdk/tree';
|
|||||||
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||||
|
|
||||||
import { Observable, Subscription } from 'rxjs';
|
import { Observable, Subscription } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||||
@@ -14,7 +13,6 @@ import { PageInfo } from '../../../core/shared/page-info.model';
|
|||||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||||
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
|
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
|
||||||
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
|
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
|
||||||
import { CoreState } from '../../../core/core-state.model';
|
|
||||||
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
||||||
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
||||||
|
|
||||||
@@ -107,11 +105,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
|
|||||||
*/
|
*/
|
||||||
@Output() deselect: EventEmitter<VocabularyTreeItemType> = new EventEmitter<VocabularyTreeItemType>(null);
|
@Output() deselect: EventEmitter<VocabularyTreeItemType> = new EventEmitter<VocabularyTreeItemType>(null);
|
||||||
|
|
||||||
/**
|
|
||||||
* A boolean representing if user is authenticated
|
|
||||||
*/
|
|
||||||
private isAuthenticated: Observable<boolean>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array to track all subscriptions and unsubscribe them onDestroy
|
* Array to track all subscriptions and unsubscribe them onDestroy
|
||||||
*/
|
*/
|
||||||
@@ -122,13 +115,11 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
|
|||||||
*
|
*
|
||||||
* @param {VocabularyTreeviewService} vocabularyTreeviewService
|
* @param {VocabularyTreeviewService} vocabularyTreeviewService
|
||||||
* @param {vocabularyService} vocabularyService
|
* @param {vocabularyService} vocabularyService
|
||||||
* @param {Store<CoreState>} store
|
|
||||||
* @param {TranslateService} translate
|
* @param {TranslateService} translate
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private vocabularyTreeviewService: VocabularyTreeviewService,
|
private vocabularyTreeviewService: VocabularyTreeviewService,
|
||||||
private vocabularyService: VocabularyService,
|
private vocabularyService: VocabularyService,
|
||||||
private store: Store<CoreState>,
|
|
||||||
private translate: TranslateService
|
private translate: TranslateService
|
||||||
) {
|
) {
|
||||||
this.treeFlattener = new VocabularyTreeFlattener(this.transformer, this.getLevel,
|
this.treeFlattener = new VocabularyTreeFlattener(this.transformer, this.getLevel,
|
||||||
|
Reference in New Issue
Block a user