From 4c90567c80177211817eaaa6a39d401afa5b931d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 2 Mar 2020 20:16:50 +0100 Subject: [PATCH] Fix injections in module --- .../src/app/{init-vendors.js => init-vendors.ts} | 0 .../ifc_models/openproject-ifc-models.module.ts | 6 +++++- .../ifc_models/pages/viewer/bim-view.service.ts | 3 +-- .../pages/viewer/ifc-models-data.service.ts | 3 +-- frontend/src/main.ts | 2 +- frontend/src/tsconfig.app.json | 13 +++++++++---- 6 files changed, 17 insertions(+), 10 deletions(-) rename frontend/src/app/{init-vendors.js => init-vendors.ts} (100%) diff --git a/frontend/src/app/init-vendors.js b/frontend/src/app/init-vendors.ts similarity index 100% rename from frontend/src/app/init-vendors.js rename to frontend/src/app/init-vendors.ts diff --git a/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts b/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts index 3099358fa6..d76179fa76 100644 --- a/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts +++ b/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts @@ -38,6 +38,8 @@ import {BimViewToggleButtonComponent} from "core-app/modules/ifc_models/toolbar/ import {BimViewToggleDropdownDirective} from "core-app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive"; import {BimManageIfcModelsButtonComponent} from "core-app/modules/ifc_models/toolbar/manage-ifc-models-button/bim-manage-ifc-models-button.component"; import {IFCViewerService} from "core-app/modules/ifc_models/ifc-viewer/ifc-viewer.service"; +import {BimViewService} from "core-app/modules/ifc_models/pages/viewer/bim-view.service"; +import {IfcModelsDataService} from "core-app/modules/ifc_models/pages/viewer/ifc-models-data.service"; @NgModule({ imports: [ @@ -48,7 +50,9 @@ import {IFCViewerService} from "core-app/modules/ifc_models/ifc-viewer/ifc-viewe }) ], providers: [ - IFCViewerService + IFCViewerService, + BimViewService, + IfcModelsDataService ], declarations: [ // Pages diff --git a/frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.ts b/frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.ts index 8dd63da2ca..b2979f2b5d 100644 --- a/frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.ts +++ b/frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.ts @@ -31,7 +31,6 @@ import {I18nService} from 'core-app/modules/common/i18n/i18n.service'; import {Observable} from "rxjs"; import {StateService, TransitionService} from "@uirouter/core"; import {input} from "reactivestates"; -import {OpenprojectIFCModelsModule} from "core-app/modules/ifc_models/openproject-ifc-models.module"; import {takeUntil} from "rxjs/operators"; @@ -41,7 +40,7 @@ export const bimSplitViewIdentifier = 'split'; export type BimViewState = 'list'|'viewer'|'split'; -@Injectable({providedIn: OpenprojectIFCModelsModule}) +@Injectable() export class BimViewService implements OnDestroy { private _state = input(); diff --git a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.ts b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.ts index b91c86cc1b..96f988d266 100644 --- a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.ts +++ b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.ts @@ -1,5 +1,4 @@ import {Injectable} from "@angular/core"; -import {OpenprojectIFCModelsModule} from "core-app/modules/ifc_models/openproject-ifc-models.module"; import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service"; import {GonService} from "core-app/modules/common/gon/gon.service"; import {CurrentProjectService} from "core-components/projects/current-project.service"; @@ -10,7 +9,7 @@ export interface IfcModelDefinition { saoEnabled:boolean; } -@Injectable({ providedIn: OpenprojectIFCModelsModule }) +@Injectable() export class IfcModelsDataService { constructor(readonly paths:PathHelperService, diff --git a/frontend/src/main.ts b/frontend/src/main.ts index c25b75e1fb..a320a0c1bc 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -11,7 +11,7 @@ import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {SentryReporter} from "core-app/sentry/sentry-reporter"; window.ErrorReporter = new SentryReporter(); -require('./app/init-vendors'); +require('core-app/init-vendors'); require('./app/init-globals'); diff --git a/frontend/src/tsconfig.app.json b/frontend/src/tsconfig.app.json index f05a016377..1ae34e96d7 100644 --- a/frontend/src/tsconfig.app.json +++ b/frontend/src/tsconfig.app.json @@ -5,9 +5,14 @@ "baseUrl": "./", "types": [] }, - "exclude": [ - "test.ts", - "test/*", - "**/*.spec.ts" + "files": [ + "main.ts", + "polyfills.ts", + "app/init-globals.ts", + "app/init-vendors" + ], + "include": [ + "**/*.d.ts", + "app/globals/**/*.ts" ] }