Skip to content

Commit

Permalink
SHIBUI-1527 Updated app to work with breaking changes from updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Oct 18, 2019
1 parent 1988d1e commit f89d977
Show file tree
Hide file tree
Showing 44 changed files with 44 additions and 50 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { NavigationServiceStub } from '../testing/navigation-service.stub';
`
})
class TestHostComponent {
@ViewChild(AppComponent)
@ViewChild(AppComponent, {static: true})
public componentUnderTest: AppComponent;
}

Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const routes: Routes = [
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
{
path: 'dashboard',
loadChildren: './dashboard/dashboard.module#DashboardModule'
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule)
},
{
path: 'metadata',
loadChildren: './metadata/metadata.module#MetadataModule'
loadChildren: () => import('./metadata/metadata.module').then(m => m.MetadataModule)
}
];

Expand Down
2 changes: 0 additions & 2 deletions ui/src/app/core/service/file.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Observable, Subject } from 'rxjs';
import { User } from '../model/user';

@Injectable()
export class FileService {
Expand Down
5 changes: 2 additions & 3 deletions ui/src/app/core/service/modal.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable, ComponentRef } from '@angular/core';
import { Http } from '@angular/http';
import { Observable, of } from 'rxjs';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { NgbModal, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';
import { fromPromise } from 'rxjs/observable/fromPromise';

Expand Down
3 changes: 1 addition & 2 deletions ui/src/app/core/service/user.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed, async, inject } from '@angular/core/testing';
import { HttpModule } from '@angular/http';
import { TestBed } from '@angular/core/testing';
import { UserService } from './user.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const TestData: FilterConfiguration = {
template: `<filter-version-list [filters]="filters" (compare)="compare($event)"></filter-version-list>`
})
class TestHostComponent {
@ViewChild(FilterVersionListComponent)
@ViewChild(FilterVersionListComponent, {static: true})
public componentUnderTest: FilterVersionListComponent;

filters = TestData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const TestData = {
template: `<history-list [history]="history.versions" (compare)="compare($event)" (restore)="restore($event)"></history-list>`
})
class TestHostComponent {
@ViewChild(HistoryListComponent)
@ViewChild(HistoryListComponent, {static: true})
public componentUnderTest: HistoryListComponent;

history: MetadataHistory = TestData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ObjectPropertyComponent {
`
})
class TestHostComponent {
@ViewChild(MetadataConfigurationComponent)
@ViewChild(MetadataConfigurationComponent, {static: true})
public componentUnderTest: MetadataConfigurationComponent;

configuration: MetadataConfiguration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { MetadataHeaderComponent } from './metadata-header.component';
`
})
class TestHostComponent {
@ViewChild(MetadataHeaderComponent)
@ViewChild(MetadataHeaderComponent, {static: true})
public componentUnderTest: MetadataHeaderComponent;

isEnabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { of } from 'rxjs';
`
})
class TestHostComponent {
@ViewChild(ArrayPropertyComponent)
@ViewChild(ArrayPropertyComponent, {static: true})
public componentUnderTest: ArrayPropertyComponent;

property: Property = getStepProperty(SCHEMA.properties.list, [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ConfigurationPropertyComponent } from './configuration-property.compone
`
})
class TestHostComponent {
@ViewChild(ConfigurationPropertyComponent)
@ViewChild(ConfigurationPropertyComponent, {static: true})
public componentUnderTest: ConfigurationPropertyComponent;

property: Property = getStepProperty(SCHEMA.properties.name, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ArrayPropertyComponentStub, PrimitivePropertyComponentStub } from '../.
`
})
class TestHostComponent {
@ViewChild(FilterTargetPropertyComponent)
@ViewChild(FilterTargetPropertyComponent, {static: true})
public componentUnderTest: FilterTargetPropertyComponent;

property: Property = getStepProperty(SCHEMA.properties.formatFilterTarget, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { FilterTargetPropertyComponent } from './filter-target-property.componen
`
})
class TestHostComponent {
@ViewChild(ObjectPropertyComponent)
@ViewChild(ObjectPropertyComponent, {static: true})
public componentUnderTest: ObjectPropertyComponent;

property: Property = getStepProperty(SCHEMA.properties.name, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { PrimitivePropertyComponent } from './primitive-property.component';
`
})
class TestHostComponent {
@ViewChild(PrimitivePropertyComponent)
@ViewChild(PrimitivePropertyComponent, {static: true})
public componentUnderTest: PrimitivePropertyComponent;

property: Property = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
`
})
class TestHostComponent {
@ViewChild(ConfigurationComponent)
@ViewChild(ConfigurationComponent, {static: true})
public componentUnderTest: ConfigurationComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { NgbModalStub } from '../../../../testing/modal.stub';
`
})
class TestHostComponent {
@ViewChild(MetadataOptionsComponent)
@ViewChild(MetadataOptionsComponent, {static: true})
public componentUnderTest: MetadataOptionsComponent;

configuration: MetadataConfiguration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MetadataXmlComponent } from './metadata-xml.component';
`
})
class TestHostComponent {
@ViewChild(MetadataXmlComponent)
@ViewChild(MetadataXmlComponent, {static: true})
public componentUnderTest: MetadataXmlComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { WizardActionTypes } from '../../../wizard/action/wizard.action';
`
})
class TestHostComponent {
@ViewChild(RestoreEditStepComponent)
@ViewChild(RestoreEditStepComponent, {static: true})
public componentUnderTest: RestoreEditStepComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { RestoreActionTypes } from '../action/restore.action';
`
})
class TestHostComponent {
@ViewChild(RestoreEditComponent)
@ViewChild(RestoreEditComponent, {static: true})
public componentUnderTest: RestoreEditComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Router } from '@angular/router';
`
})
class TestHostComponent {
@ViewChild(RestoreComponent)
@ViewChild(RestoreComponent, {static: true})
public componentUnderTest: RestoreComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ViewportScroller } from '@angular/common';
`
})
class TestHostComponent {
@ViewChild(VersionOptionsComponent)
@ViewChild(VersionOptionsComponent, {static: true})
public componentUnderTest: VersionOptionsComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
`
})
class TestHostComponent {
@ViewChild(VersionComponent)
@ViewChild(VersionComponent, {static: true})
public componentUnderTest: VersionComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
`
})
class TestHostComponent {
@ViewChild(EditorNavComponent)
@ViewChild(EditorNavComponent, {static: true})
public componentUnderTest: EditorNavComponent;

public format = NAV_FORMATS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
template: `<preview-dialog></preview-dialog>`
})
class TestHostComponent {
@ViewChild(PreviewDialogComponent)
@ViewChild(PreviewDialogComponent, {static: true})
public formUnderTest: PreviewDialogComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { of } from 'rxjs';
`
})
class TestHostComponent {
@ViewChild(SummaryPropertyComponent)
@ViewChild(SummaryPropertyComponent, {static: true})
public componentUnderTest: SummaryPropertyComponent;

private _property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
`
})
class TestHostComponent {
@ViewChild(UnsavedEntityComponent)
@ViewChild(UnsavedEntityComponent, {static: true})
public componentUnderTest: UnsavedEntityComponent;
}

Expand Down
2 changes: 0 additions & 2 deletions ui/src/app/metadata/domain/domain.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { HttpModule } from '@angular/http';
import { EffectsModule } from '@ngrx/effects';
import { CommonModule } from '@angular/common';
import { NgbPopoverModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
Expand Down Expand Up @@ -38,7 +37,6 @@ export const DECLARATIONS = [
declarations: DECLARATIONS,
entryComponents: COMPONENTS,
imports: [
HttpModule,
CommonModule,
I18nModule,
NgbPopoverModule,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/metadata/metadata.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
`
})
class TestHostComponent {
@ViewChild(MetadataPageComponent)
@ViewChild(MetadataPageComponent, {static: true})
public componentUnderTest: MetadataPageComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { FileBackedHttpMetadataProviderEditor } from '../model';
`
})
class TestHostComponent {
@ViewChild(ProviderEditStepComponent)
@ViewChild(ProviderEditStepComponent, {static: true})
public componentUnderTest: ProviderEditStepComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
`
})
class TestHostComponent {
@ViewChild(ProviderEditComponent)
@ViewChild(ProviderEditComponent, {static: true})
public componentUnderTest: ProviderEditComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { FilterListComponentStub } from '../../../../testing/filter-list.stub';
`
})
class TestHostComponent {
@ViewChild(ProviderFilterListComponent)
@ViewChild(ProviderFilterListComponent, {static: true})
public componentUnderTest: ProviderFilterListComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { MetadataProvider } from '../../domain/model';
`
})
class TestHostComponent {
@ViewChild(ProviderSelectComponent)
@ViewChild(ProviderSelectComponent, {static: true})
public componentUnderTest: ProviderSelectComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MetadataProviderWizard } from '../model';
`
})
class TestHostComponent {
@ViewChild(ProviderWizardStepComponent)
@ViewChild(ProviderWizardStepComponent, {static: true})
public componentUnderTest: ProviderWizardStepComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { MetadataConfigurationComponentStub } from '../../../../testing/metadata
`
})
class TestHostComponent {
@ViewChild(ProviderWizardComponent)
@ViewChild(ProviderWizardComponent, {static: true})
public componentUnderTest: ProviderWizardComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestHostComponent {
...stubs.resolver
});

@ViewChild(FinishFormComponent)
@ViewChild(FinishFormComponent, {static: true})
public formUnderTest: FinishFormComponent;

changeProvider(opts: any): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
(save)="onSave($event)"></copy-resolver-form>`
})
class TestHostComponent {
@ViewChild(CopyResolverComponent)
@ViewChild(CopyResolverComponent, {static: true})
public formUnderTest: CopyResolverComponent;

onSave(event: any): void {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MetadataSourceWizard } from '../../domain/model/wizards/metadata-source
`
})
class TestHostComponent {
@ViewChild(ResolverWizardStepComponent)
@ViewChild(ResolverWizardStepComponent, {static: true})
public componentUnderTest: ResolverWizardStepComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { MetadataConfigurationComponentStub } from '../../../../testing/metadata
`
})
class TestHostComponent {
@ViewChild(ResolverWizardComponent)
@ViewChild(ResolverWizardComponent, {static: true})
public componentUnderTest: ResolverWizardComponent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
(fromUrl)="createFromUrl($event)"></upload-resolver-form>`
})
class TestHostComponent {
@ViewChild(UploadResolverComponent)
@ViewChild(UploadResolverComponent, {static: true})
public formUnderTest: UploadResolverComponent;

upload(event: Event): void {}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/schema-form/widget/number/float.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SchemaService } from '../../service/schema.service';
})
export class CustomFloatComponent extends IntegerWidget implements AfterViewInit {
private _displayValue: string;
@ViewChild('input') element: ElementRef;
@ViewChild('input', { static: true }) element: ElementRef;

constructor(
private widgetService: SchemaService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TestHostComponent {
search: ['']
});

@ViewChild(AutoCompleteComponent)
@ViewChild(AutoCompleteComponent, {static: true})
public autoCompleteUnderTest: AutoCompleteComponent;

configure(opts: any): void {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/autocomplete/autocomplete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy, AfterViewInit,
@Output() more: EventEmitter<any> = new EventEmitter<any>();
@Output() onChange: EventEmitter<string> = new EventEmitter<string>();

@ViewChild('inputField') inputField: ElementRef;
@ViewChild('inputField', { static: true }) inputField: ElementRef;
@ViewChildren('matchElement', { read: ElementRef }) listItems: QueryList<ElementRef>;

focused: number;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/switch/switch.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestHostComponent {

foo: FormControl = new FormControl(false);

@ViewChild(ToggleSwitchComponent)
@ViewChild(ToggleSwitchComponent, {static: true})
public instanceUnderTest: ToggleSwitchComponent;
}

Expand Down
Loading

0 comments on commit f89d977

Please sign in to comment.