You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by rm...@apache.org on 2019/06/11 12:58:10 UTC

[metron] branch feature/METRON-1856-parser-aggregation updated: METRON-2114 [UI] Moving components to sensor parser module (tiborm via merrimanr) closes apache/metron#1410

This is an automated email from the ASF dual-hosted git repository.

rmerriman pushed a commit to branch feature/METRON-1856-parser-aggregation
in repository https://gitbox.apache.org/repos/asf/metron.git


The following commit(s) were added to refs/heads/feature/METRON-1856-parser-aggregation by this push:
     new bfc496c  METRON-2114 [UI] Moving components to sensor parser module (tiborm via merrimanr) closes apache/metron#1410
bfc496c is described below

commit bfc496cc1267a3c5c6939fb6704fd30582c4057c
Author: tiborm <ti...@gmail.com>
AuthorDate: Tue Jun 11 07:57:50 2019 -0500

    METRON-2114 [UI] Moving components to sensor parser module (tiborm via merrimanr) closes apache/metron#1410
---
 .../metron-config/src/app/app.module.ts            | 93 ++++++++++++----------
 .../src/app/sensors/sensors.module.ts              | 60 ++++++++++++++
 2 files changed, 111 insertions(+), 42 deletions(-)

diff --git a/metron-interface/metron-config/src/app/app.module.ts b/metron-interface/metron-config/src/app/app.module.ts
index 89aa937..5a730ed 100644
--- a/metron-interface/metron-config/src/app/app.module.ts
+++ b/metron-interface/metron-config/src/app/app.module.ts
@@ -15,55 +15,64 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import {APP_INITIALIZER, NgModule} from '@angular/core';
-import {FormsModule, ReactiveFormsModule} from '@angular/forms';
-import {BrowserModule} from '@angular/platform-browser';
-import {HttpClientModule, HTTP_INTERCEPTORS} from '@angular/common/http';
-import { Router } from '@angular/router';
-import {AppComponent} from './app.component';
-import {SensorParserConfigService} from './service/sensor-parser-config.service';
-import {KafkaService} from './service/kafka.service';
-import {GrokValidationService} from './service/grok-validation.service';
-import {StellarService} from './service/stellar.service';
-import {MetronAlerts} from './shared/metron-alerts';
-import {NavbarComponent} from './navbar/navbar.component';
-import {VerticalNavbarComponent} from './verticalnavbar/verticalnavbar.component';
-import {MetronConfigRoutingModule} from './app.routes';
-import {AuthenticationService} from './service/authentication.service';
-import {AuthGuard} from './shared/auth-guard';
-import {LoginGuard} from './shared/login-guard';
-import {SensorParserConfigModule} from './sensors/sensor-parser-config/sensor-parser-config.module';
-import {SensorParserConfigReadonlyModule} from './sensors/sensor-parser-config-readonly/sensor-parser-config-readonly.module';
-import {SensorParserListModule} from './sensors/sensor-parser-list/sensor-parser-list.module';
-import {MetronDialogBox} from './shared/metron-dialog-box';
-import {GeneralSettingsModule} from './general-settings/general-settings.module';
-import {SensorEnrichmentConfigService} from './service/sensor-enrichment-config.service';
-import {GlobalConfigService} from './service/global-config.service';
-import {APP_CONFIG, METRON_REST_CONFIG} from './app.config';
-import {StormService} from './service/storm.service';
-import {SensorParserConfigHistoryService} from './service/sensor-parser-config-history.service';
-import {SensorIndexingConfigService} from './service/sensor-indexing-config.service';
-import {HdfsService} from './service/hdfs.service';
+import { StoreModule, MetaReducer } from '@ngrx/store';
+import { StoreDevtoolsModule } from '@ngrx/store-devtools';
+import { EffectsModule } from '@ngrx/effects'
+import { SensorsModule } from './sensors/sensors.module';
+import { storeFreeze } from 'ngrx-store-freeze';
+import { environment } from '../environments/environment';
+
+import { APP_INITIALIZER, NgModule } from '@angular/core';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { BrowserModule } from '@angular/platform-browser';
+import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
+import { AppComponent } from './app.component';
+import { MetronAlerts } from './shared/metron-alerts';
+import { NavbarComponent } from './navbar/navbar.component';
+import { VerticalNavbarComponent } from './verticalnavbar/verticalnavbar.component';
+import { MetronConfigRoutingModule } from './app.routes';
+import { AuthenticationService } from './service/authentication.service';
+import { AuthGuard } from './shared/auth-guard';
+import { LoginGuard } from './shared/login-guard';
+import { MetronDialogBox } from './shared/metron-dialog-box';
+import { GeneralSettingsModule } from './general-settings/general-settings.module';
+import { GlobalConfigService } from './service/global-config.service';
 import { DefaultHeadersInterceptor } from './http-interceptors/default-headers.interceptor';
-import {AppConfigService} from './service/app-config.service';
+import {AppConfigService } from './service/app-config.service';
+
+export const metaReducers: MetaReducer<{}>[] = !environment.production
+? [storeFreeze]
+: [];
 
 export function initConfig(appConfigService: AppConfigService) {
   return () => appConfigService.loadAppConfig();
 }
 
 @NgModule({
-  imports: [ BrowserModule, FormsModule, ReactiveFormsModule, HttpClientModule, SensorParserListModule,
-    SensorParserConfigModule, SensorParserConfigReadonlyModule, GeneralSettingsModule, MetronConfigRoutingModule ],
+  imports: [
+    BrowserModule,
+    FormsModule,
+    ReactiveFormsModule,
+    HttpClientModule,
+    GeneralSettingsModule,
+    MetronConfigRoutingModule,
+    SensorsModule,
+    EffectsModule.forRoot([]),
+    StoreModule.forRoot({}, { metaReducers }),
+    StoreDevtoolsModule.instrument(),
+  ],
   declarations: [ AppComponent, NavbarComponent, VerticalNavbarComponent ],
-  providers: [  AppConfigService, AuthenticationService, AuthGuard, LoginGuard, SensorParserConfigService,
-    SensorParserConfigHistoryService, SensorEnrichmentConfigService, SensorIndexingConfigService,
-    StormService, KafkaService, GrokValidationService, StellarService, HdfsService,
-    GlobalConfigService, MetronAlerts, MetronDialogBox,
+  providers: [
+    AppConfigService,
+    AuthenticationService,
+    AuthGuard,
+    LoginGuard,
+    GlobalConfigService,
+    MetronAlerts,
+    MetronDialogBox,
     { provide: HTTP_INTERCEPTORS, useClass: DefaultHeadersInterceptor, multi: true },
-    { provide: APP_INITIALIZER, useFactory: initConfig, deps: [AppConfigService], multi: true }
-    ],
-  bootstrap:    [ AppComponent ]
+    { provide: APP_INITIALIZER, useFactory: initConfig, deps: [AppConfigService], multi: true },
+  ],
+  bootstrap: [ AppComponent ]
 })
-export class AppModule {
-  constructor(router: Router) {}
-}
+export class AppModule {}
diff --git a/metron-interface/metron-config/src/app/sensors/sensors.module.ts b/metron-interface/metron-config/src/app/sensors/sensors.module.ts
new file mode 100644
index 0000000..929c0b5
--- /dev/null
+++ b/metron-interface/metron-config/src/app/sensors/sensors.module.ts
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { NgModule } from '@angular/core';
+import { SensorParserListModule } from './sensor-parser-list/sensor-parser-list.module';
+import { SensorParserConfigReadonlyModule } from './sensor-parser-config-readonly/sensor-parser-config-readonly.module';
+import { SensorParserConfigModule } from './sensor-parser-config/sensor-parser-config.module';
+import { SensorParserAggregateSidebarModule } from './sensor-parser-aggregate-sidebar/sensor-parser-aggregate-sidebar.module';
+import { GrokValidationService } from '../service/grok-validation.service';
+import { StellarService } from '../service/stellar.service';
+import { HdfsService } from '../service/hdfs.service';
+import { SensorIndexingConfigService } from '../service/sensor-indexing-config.service';
+import { SensorEnrichmentConfigService } from '../service/sensor-enrichment-config.service';
+import { SensorParserConfigHistoryService } from '../service/sensor-parser-config-history.service';
+import { SensorParserConfigService } from '../service/sensor-parser-config.service';
+import { KafkaService } from '../service/kafka.service';
+import { StormService } from '../service/storm.service';
+import { EffectsModule } from '@ngrx/effects';
+import { effects } from './effects';
+import { StoreModule } from '@ngrx/store';
+import { reducers } from './reducers';
+
+@NgModule ({
+  imports: [
+    SensorParserListModule,
+    SensorParserConfigReadonlyModule,
+    SensorParserConfigModule,
+    SensorParserAggregateSidebarModule,
+    EffectsModule.forFeature(effects),
+    StoreModule.forFeature('sensors', reducers),
+  ],
+  declarations: [],
+  providers: [
+    SensorParserConfigService,
+    SensorParserConfigHistoryService,
+    SensorEnrichmentConfigService,
+    SensorIndexingConfigService,
+    StormService,
+    KafkaService,
+    GrokValidationService,
+    StellarService,
+    HdfsService,
+  ],
+})
+export class SensorsModule { }