From a99546ed52ecb5cdbbf2ebfae735a10738c04df4 Mon Sep 17 00:00:00 2001 From: mdelez <60604010+mdelez@users.noreply.github.com> Date: Tue, 7 Sep 2021 15:28:12 +0200 Subject: [PATCH] refactor: remove ViewerModule dependency (DSP-1890) (#525) * refactor: removes ViewerModule dependency from tests and switch-properties comp * refactor: removes ViewerModule import from App module --- src/app/app.module.ts | 2 -- .../switch-properties.component.html | 30 +++++++++---------- .../switch-properties.component.spec.ts | 4 +-- .../resource/resource.component.spec.ts | 7 +++-- .../results/results.component.spec.ts | 3 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a2fc45b09a..bcf7667e28 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -7,7 +7,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; -import { DspViewerModule } from '@dasch-swiss/dsp-ui'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { AngularSplitModule } from 'angular-split'; @@ -319,7 +318,6 @@ export function httpLoaderFactory(httpClient: HttpClient) { ClipboardModule, ColorPickerModule, CommonModule, - DspViewerModule, FormsModule, HttpClientModule, MaterialModule, diff --git a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html index 4e841e88b3..96d8e53fb4 100644 --- a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html +++ b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html @@ -1,19 +1,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + +

Cannot match any value component for {{property.objectType}}

diff --git a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.spec.ts b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.spec.ts index bbf84457f8..94d8a48668 100644 --- a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.spec.ts +++ b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.spec.ts @@ -3,7 +3,7 @@ import { Component, Inject, Input, OnInit, ViewChild } from '@angular/core'; import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { CreateIntValue, CreateValue, MockOntology, ReadResource, ResourcePropertyDefinition } from '@dasch-swiss/dsp-js'; -import { IntValueComponent } from '@dasch-swiss/dsp-ui'; +import { IntValueComponent } from '../../../values/int-value/int-value.component'; import { SwitchPropertiesComponent } from './switch-properties.component'; @@ -46,7 +46,7 @@ class TestSwitchPropertiesParentComponent implements OnInit { * mock value component to use in tests. */ @Component({ - selector: 'dsp-int-value' + selector: 'app-int-value' }) class MockCreateIntValueComponent implements OnInit { diff --git a/src/app/workspace/resource/resource.component.spec.ts b/src/app/workspace/resource/resource.component.spec.ts index 2d80816702..f881a9395d 100644 --- a/src/app/workspace/resource/resource.component.spec.ts +++ b/src/app/workspace/resource/resource.component.spec.ts @@ -1,8 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { MatDialogModule } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; import { RouterTestingModule } from '@angular/router/testing'; import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; -import { AppInitService, DspViewerModule } from '@dasch-swiss/dsp-ui'; +import { AppInitService } from '@dasch-swiss/dsp-ui'; import { DspApiConfigToken, DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens'; import { TestConfig } from 'test.config'; import { ResourceComponent } from './resource.component'; @@ -15,8 +17,9 @@ describe('ResourceComponent', () => { TestBed.configureTestingModule({ declarations: [ResourceComponent], imports: [ - DspViewerModule, + MatDialogModule, MatIconModule, + MatSnackBarModule, RouterTestingModule ], providers: [ diff --git a/src/app/workspace/results/results.component.spec.ts b/src/app/workspace/results/results.component.spec.ts index fc12734e61..e50d1b9c8d 100644 --- a/src/app/workspace/results/results.component.spec.ts +++ b/src/app/workspace/results/results.component.spec.ts @@ -1,7 +1,7 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; -import { AppInitService, DspViewerModule } from '@dasch-swiss/dsp-ui'; +import { AppInitService } from '@dasch-swiss/dsp-ui'; import { AngularSplitModule } from 'angular-split'; import { DspApiConfigToken, DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens'; import { TestConfig } from 'test.config'; @@ -20,7 +20,6 @@ describe('ResultsComponent', () => { ], imports: [ AngularSplitModule, - DspViewerModule, RouterTestingModule ], providers: [