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/12 13:30:19 UTC
[metron] branch feature/METRON-1856-parser-aggregation updated:
METRON-2116 [UI] Removing redundant AppConfigService (tiborm via merrimanr)
closes apache/metron#1411
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 6a19784 METRON-2116 [UI] Removing redundant AppConfigService (tiborm via merrimanr) closes apache/metron#1411
6a19784 is described below
commit 6a197849bee427e33a373d2add5f304e7ad0c977
Author: tiborm <ti...@gmail.com>
AuthorDate: Wed Jun 12 08:29:57 2019 -0500
METRON-2116 [UI] Removing redundant AppConfigService (tiborm via merrimanr) closes apache/metron#1411
---
.../metron-config/src/app/app.config.interface.ts | 21 -----------------
.../metron-config/src/app/app.config.ts | 26 ----------------------
.../src/app/login/login.component.spec.ts | 5 +++--
.../src/app/service/global-config.service.spec.ts | 5 ++---
.../src/app/service/hdfs.service.spec.ts | 1 -
.../sensor-enrichment-config.service.spec.ts | 1 -
6 files changed, 5 insertions(+), 54 deletions(-)
diff --git a/metron-interface/metron-config/src/app/app.config.interface.ts b/metron-interface/metron-config/src/app/app.config.interface.ts
deleted file mode 100644
index 4845b46..0000000
--- a/metron-interface/metron-config/src/app/app.config.interface.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * 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.
- */
-
-export interface IAppConfig {
- apiEndpoint: string;
-}
diff --git a/metron-interface/metron-config/src/app/app.config.ts b/metron-interface/metron-config/src/app/app.config.ts
deleted file mode 100644
index abd378c..0000000
--- a/metron-interface/metron-config/src/app/app.config.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 { InjectionToken } from '@angular/core';
-import {IAppConfig} from './app.config.interface';
-
-export let APP_CONFIG = new InjectionToken('app.config');
-
-export const METRON_REST_CONFIG: IAppConfig = {
- apiEndpoint: '/api/v1'
-};
diff --git a/metron-interface/metron-config/src/app/login/login.component.spec.ts b/metron-interface/metron-config/src/app/login/login.component.spec.ts
index eac383c..f48d897 100644
--- a/metron-interface/metron-config/src/app/login/login.component.spec.ts
+++ b/metron-interface/metron-config/src/app/login/login.component.spec.ts
@@ -21,7 +21,8 @@ import { LoginComponent } from './login.component';
import { Observable } from 'rxjs';
import { ActivatedRoute, Params } from '@angular/router';
import { LoginModule } from './login.module';
-import { APP_CONFIG, METRON_REST_CONFIG } from '../app.config';
+import { AppConfigService } from 'app/service/app-config.service';
+import { MockAppConfigService } from 'app/service/mock.app-config.service';
class MockAuthenticationService {
public login(username: string, password: string, onError): void {
@@ -59,7 +60,7 @@ describe('LoginComponent', () => {
providers: [
{ provide: ActivatedRoute, useClass: MockActivatedRoute },
{ provide: AuthenticationService, useClass: MockAuthenticationService },
- { provide: APP_CONFIG, useValue: METRON_REST_CONFIG }
+ { provide: AppConfigService, useValue: MockAppConfigService }
]
});
fixture = TestBed.createComponent(LoginComponent);
diff --git a/metron-interface/metron-config/src/app/service/global-config.service.spec.ts b/metron-interface/metron-config/src/app/service/global-config.service.spec.ts
index 1bd3ef8..7777d49 100644
--- a/metron-interface/metron-config/src/app/service/global-config.service.spec.ts
+++ b/metron-interface/metron-config/src/app/service/global-config.service.spec.ts
@@ -16,14 +16,13 @@
* limitations under the License.
*/
import { TestBed } from '@angular/core/testing';
-import { APP_CONFIG, METRON_REST_CONFIG } from '../app.config';
import { GlobalConfigService } from './global-config.service';
import {
HttpTestingController,
HttpClientTestingModule
} from '@angular/common/http/testing';
-import {AppConfigService} from './app-config.service';
-import {MockAppConfigService} from './mock.app-config.service';
+import { AppConfigService } from './app-config.service';
+import { MockAppConfigService } from './mock.app-config.service';
describe('GlobalConfigService', () => {
let mockBackend: HttpTestingController;
diff --git a/metron-interface/metron-config/src/app/service/hdfs.service.spec.ts b/metron-interface/metron-config/src/app/service/hdfs.service.spec.ts
index 9163e29..3388c5b 100644
--- a/metron-interface/metron-config/src/app/service/hdfs.service.spec.ts
+++ b/metron-interface/metron-config/src/app/service/hdfs.service.spec.ts
@@ -17,7 +17,6 @@
*/
import { TestBed } from '@angular/core/testing';
-import { APP_CONFIG, METRON_REST_CONFIG } from '../app.config';
import { HdfsService } from './hdfs.service';
import {
HttpTestingController,
diff --git a/metron-interface/metron-config/src/app/service/sensor-enrichment-config.service.spec.ts b/metron-interface/metron-config/src/app/service/sensor-enrichment-config.service.spec.ts
index 3bc9a98..c6290a3 100644
--- a/metron-interface/metron-config/src/app/service/sensor-enrichment-config.service.spec.ts
+++ b/metron-interface/metron-config/src/app/service/sensor-enrichment-config.service.spec.ts
@@ -22,7 +22,6 @@ import {
EnrichmentConfig
} from '../model/sensor-enrichment-config';
import { HttpResponse } from '@angular/common/http';
-import { METRON_REST_CONFIG, APP_CONFIG } from '../app.config';
import {
HttpClientTestingModule,
HttpTestingController