From a989bebf50f3ea322d1ae39e3909d6ebe0430f63 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Wed, 22 Nov 2023 19:34:15 +0100 Subject: [PATCH] [DURACOM-208] Remove unused dependency --- .../vocabulary-treeview.component.spec.ts | 27 ++----------------- .../vocabulary-treeview.component.ts | 9 ------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts index 9b26644564c..21ac1a90c69 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts @@ -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 { CdkTreeModule } from '@angular/cdk/tree'; +import { By } from '@angular/platform-browser'; import { of as observableOf } from 'rxjs'; -import { StoreModule } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { provideMockStore } from '@ngrx/store/testing'; import { createTestComponent } from '../../testing/utils.test'; 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 { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.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 { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model'; @@ -28,7 +23,6 @@ describe('VocabularyTreeviewComponent test suite', () => { let comp: VocabularyTreeviewComponent; let compAsAny: any; let fixture: ComponentFixture; - let initialState; let de; const item = new VocabularyEntryDetail(); @@ -59,25 +53,10 @@ describe('VocabularyTreeviewComponent test suite', () => { 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(() => { TestBed.configureTestingModule({ imports: [ CdkTreeModule, - StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), TranslateModule.forRoot() ], declarations: [ @@ -88,8 +67,6 @@ describe('VocabularyTreeviewComponent test suite', () => { { provide: VocabularyTreeviewService, useValue: vocabularyTreeviewServiceStub }, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: NgbActiveModal, useValue: modalStub }, - provideMockStore({ initialState }), - ChangeDetectorRef, VocabularyTreeviewComponent ], schemas: [NO_ERRORS_SCHEMA] diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts index 55656c6796c..eb1028986aa 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -2,7 +2,6 @@ import { FlatTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; -import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; 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 { VocabularyTreeFlattener } from './vocabulary-tree-flattener'; import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source'; -import { CoreState } from '../../../core/core-state.model'; import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service'; import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model'; @@ -107,11 +105,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges */ @Output() deselect: EventEmitter = new EventEmitter(null); - /** - * A boolean representing if user is authenticated - */ - private isAuthenticated: Observable; - /** * Array to track all subscriptions and unsubscribe them onDestroy */ @@ -122,13 +115,11 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges * * @param {VocabularyTreeviewService} vocabularyTreeviewService * @param {vocabularyService} vocabularyService - * @param {Store} store * @param {TranslateService} translate */ constructor( private vocabularyTreeviewService: VocabularyTreeviewService, private vocabularyService: VocabularyService, - private store: Store, private translate: TranslateService ) { this.treeFlattener = new VocabularyTreeFlattener(this.transformer, this.getLevel,