aboutsummaryrefslogtreecommitdiffstats
path: root/so-monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'so-monitoring')
-rw-r--r--so-monitoring/readme.md35
-rw-r--r--so-monitoring/so-monitoring-service/pom.xml9
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java3
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java23
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java35
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java9
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java39
-rw-r--r--so-monitoring/so-monitoring-service/src/main/resources/application.yaml6
-rw-r--r--so-monitoring/so-monitoring-ui/pom.xml6
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/README.md9
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts12
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts20
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts46
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts50
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts43
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts2
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html15
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss24
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts82
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts45
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts8
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html43
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts108
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts81
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html63
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts5
26 files changed, 162 insertions, 659 deletions
diff --git a/so-monitoring/readme.md b/so-monitoring/readme.md
deleted file mode 100644
index d4b876c763..0000000000
--- a/so-monitoring/readme.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# SO Monitoring
-
-----
-
-## Introduction
-
-SO Monitoring provides multiple useful features:
-* Search/Filtering Menu
-* A graphical user interface
-* Workflow pathing
-* Subflow navigation
-* Access to the workflow variables
-
-## Compiling / Running
-
-Compiling is simple: `mvn clean install`
-Compilation may fail if your code is not formatted properly.
-
-## Components
-
-### so-monitoring-handler
-
-
-### so-monitoring-service
-
-Backend API for so-monitoring. Requires basic auth to access it.
-
-Default credentials:
-- with role GUI-Client: gui/password1$
-
-Note that these default users should be changed for production.
-
-### so-monitoring-ui
-
-UI for so-monitoring has a separate README.md - so-monitoring/so-monitoring-ui/src/main/frontend/README.md
diff --git a/so-monitoring/so-monitoring-service/pom.xml b/so-monitoring/so-monitoring-service/pom.xml
index f5448aaf5c..762e3a5ee6 100644
--- a/so-monitoring/so-monitoring-service/pom.xml
+++ b/so-monitoring/so-monitoring-service/pom.xml
@@ -37,15 +37,10 @@
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
@@ -64,10 +59,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </dependency>
</dependencies>
<build>
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
index 7c5a8965b7..aff4fecfdc 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
@@ -22,11 +22,12 @@ package org.onap.so.monitoring.rest.api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
/**
* @author waqas.ikram@ericsson.com
*/
-@SpringBootApplication(scanBasePackages = {"org.onap"})
+@SpringBootApplication(scanBasePackages = {"org.onap"}, exclude = SecurityAutoConfiguration.class)
public class SoMonitoringApplication {
public static void main(String[] args) {
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
index d48d18dad0..5a5a4143fa 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
@@ -19,6 +19,7 @@
*/
package org.onap.so.monitoring.rest.api;
+import com.google.common.base.Optional;
import java.util.List;
import java.util.Map;
import javax.ws.rs.GET;
@@ -39,12 +40,12 @@ import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
import org.onap.so.monitoring.model.SoInfraRequest;
import org.onap.so.monitoring.rest.service.CamundaProcessDataServiceProvider;
import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
import org.onap.so.rest.exceptions.RestProcessingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.google.common.base.Optional;
/**
* @author waqas.ikram@ericsson.com
@@ -82,10 +83,10 @@ public class SoMonitoringController {
return Response.status(Status.OK).entity(processInstanceId.get()).build();
}
- LOGGER.error("Unable to find process instance id for : " + requestId);
+ LOGGER.error("Unable to find process instance id for : {} ", requestId);
return Response.status(Status.NO_CONTENT).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to find process instance id for : " + requestId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -111,10 +112,10 @@ public class SoMonitoringController {
return Response.status(Status.OK).entity(processInstanceDetail.get()).build();
}
- LOGGER.error("Unable to find process instance id for : " + processInstanceId);
+ LOGGER.error("Unable to find process instance id for : {}", processInstanceId);
return Response.status(Status.NO_CONTENT).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to find process instance id for : " + processInstanceId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -140,10 +141,10 @@ public class SoMonitoringController {
final ProcessDefinitionDetail definitionDetail = response.get();
return Response.status(Status.OK).entity(definitionDetail).build();
}
- LOGGER.error("Unable to find process definition xml for processDefinitionId: " + processDefinitionId);
+ LOGGER.error("Unable to find process definition xml for processDefinitionId: {}", processDefinitionId);
return Response.status(Status.NO_CONTENT).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message =
"Unable to find process definition xml for processDefinitionId: {}" + processDefinitionId;
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -166,7 +167,7 @@ public class SoMonitoringController {
final List<ActivityInstanceDetail> activityInstanceDetails =
camundaProcessDataServiceProvider.getActivityInstance(processInstanceId);
return Response.status(Status.OK).entity(activityInstanceDetails).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to find activity instance for processInstanceId: " + processInstanceId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -189,7 +190,7 @@ public class SoMonitoringController {
final List<ProcessInstanceVariableDetail> processInstanceVariable =
camundaProcessDataServiceProvider.getProcessInstanceVariable(processInstanceId);
return Response.status(Status.OK).entity(processInstanceVariable).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message =
"Unable to find process instance variables for processInstanceId: " + processInstanceId;
LOGGER.error(message);
@@ -214,10 +215,10 @@ public class SoMonitoringController {
try {
final List<SoInfraRequest> requests =
databaseServiceProvider.getSoInfraRequest(filters, startTime, endTime, maxResult);
- LOGGER.info("result size: " + requests.size());
+ LOGGER.info("result size: {}", requests.size());
return Response.status(Status.OK).entity(requests).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
+ ", to: " + endTime + ", maxResult: " + maxResult;
LOGGER.error(message);
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java
deleted file mode 100644
index 3959631f94..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Samsung
- * ================================================================================
- * Licensed 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.monitoring.rest.api;
-
-import java.security.Principal;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class UserController {
-
- @RequestMapping("/user")
- public Principal user(Principal user) {
- return user;
- }
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
index 2b53ed8953..cadd60b0d9 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
@@ -2,9 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed 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
*
@@ -23,15 +21,16 @@ package org.onap.so.monitoring.rest.api;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* @author waqas.ikram@ericsson.com
*/
@Configuration
-public class WebApplicationConfig implements WebMvcConfigurer {
+public class WebApplicationConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
+ super.addViewControllers(registry);
registry.addViewController("/details/**").setViewName("forward:/");
}
}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java
deleted file mode 100644
index 298f52bd35..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Samsung
- * ================================================================================
- * Licensed 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.monitoring.rest.api;
-
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-
-@EnableWebSecurity
-@Configuration("att-security-config")
-@Order(2)
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests().antMatchers("/actuator", "/actuator/*", "/login", "/", "/index.html", "/*.js",
- "/*.js.map", "/favicon.png").permitAll().anyRequest().authenticated().and().httpBasic();
- }
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
index 417febebf6..dbccb76979 100644
--- a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
+++ b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
@@ -19,9 +19,3 @@ mso:
spring:
main:
allow-bean-definition-overriding: true
- security:
- usercredentials:
- -
- username: gui
- password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
- role: GUI-Client
diff --git a/so-monitoring/so-monitoring-ui/pom.xml b/so-monitoring/so-monitoring-ui/pom.xml
index a5f1a6c18e..c362a83a9b 100644
--- a/so-monitoring/so-monitoring-ui/pom.xml
+++ b/so-monitoring/so-monitoring-ui/pom.xml
@@ -28,7 +28,9 @@
</parent>
<artifactId>so-monitoring-ui</artifactId>
-
+ <properties>
+ <yarn.proxy>false</yarn.proxy>
+ </properties>
<build>
<plugins>
<plugin>
@@ -66,7 +68,7 @@
<goal>yarn</goal>
</goals>
<configuration>
- <yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
+ <yarnInheritsProxyConfigFromMaven>${yarn.proxy}</yarnInheritsProxyConfigFromMaven>
<arguments>build</arguments>
</configuration>
</execution>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/README.md b/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
index 65731cdc5d..329de0f833 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
@@ -6,15 +6,6 @@ This project was generated with [Angular CLI](https://github.com/angular/angular
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
-FYI: You may need to change environments.ts to hit to your backend: not so-monitoring:30224 but localhost:8088
-
-### Logging in
-
-Backend API for so-monitoring. Requires basic auth to access it.
-
-Default credentials:
-- with role GUI-Client: gui/password1$
-
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
index 03e77fc2d9..428998dc62 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
@@ -2,8 +2,6 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. All rights reserved.
================================================================================
- Modifications Copyright (c) 2019 Samsung
-================================================================================
Licensed 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
@@ -26,25 +24,17 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { DetailsComponent } from './details/details.component';
-import {AuthGuard} from "./auth.guard";
-import {LoginComponent} from "./login/login.component";
const routes: Routes = [
{
// Route to home page
path: '',
- component: HomeComponent,
- canActivate: [AuthGuard]
+ component: HomeComponent
},
{
// Route to page to show individual process based on ID
path: 'details/:id',
component: DetailsComponent
- },
- {
- // Route to login page
- path: 'login',
- component: LoginComponent
}
];
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
index 71294bfffe..75be395879 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
@@ -2,8 +2,6 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. All rights reserved.
================================================================================
- Modifications Copyright (c) 2019 Samsung
-================================================================================
Licensed 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
@@ -19,7 +17,7 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
import { BrowserModule } from '@angular/platform-browser';
@@ -30,18 +28,15 @@ import { AppComponent } from './app.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { TopbarComponent } from './topbar/topbar.component';
import { HomeComponent } from './home/home.component';
-import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
+import { HttpClientModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DetailsComponent } from './details/details.component';
import { ToastrNotificationService } from './toastr-notification-service.service';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { MatFormFieldModule, MatInputModule, MatTableModule, MatTabsModule, MatSelectModule, MatNativeDateModule, MatDatepickerModule, MatCardModule, MatPaginatorModule, MatSortModule } from '@angular/material';
+import { MatFormFieldModule, MatInputModule, MatTableModule, MatTabsModule, MatSelectModule, MatNativeDateModule, MatDatepickerModule, MatCardModule, MatPaginatorModule, MatSortModule, MatIconModule } from '@angular/material';
import { NgxSpinnerModule } from 'ngx-spinner';
import { RouterModule, Routes } from '@angular/router';
import { APP_BASE_HREF } from '@angular/common';
-import { LoginComponent } from './login/login.component';
-import {BasicAuthInterceptor} from "./basic-auth.interceptor";
-import {ErrorInterceptor} from "./error.interceptor";
@NgModule({
declarations: [
@@ -49,8 +44,7 @@ import {ErrorInterceptor} from "./error.interceptor";
SidebarComponent,
TopbarComponent,
HomeComponent,
- DetailsComponent,
- LoginComponent
+ DetailsComponent
],
imports: [
BrowserModule,
@@ -70,16 +64,14 @@ import {ErrorInterceptor} from "./error.interceptor";
RouterModule,
MatPaginatorModule,
MatSortModule,
+ MatIconModule,
RouterModule.forRoot([]),
ReactiveFormsModule
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
- providers: [
- { provide: HTTP_INTERCEPTORS, useClass: BasicAuthInterceptor, multi: true },
- { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
- ToastrNotificationService],
+ providers: [ToastrNotificationService],
bootstrap: [AppComponent]
})
export class AppModule { }
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts
deleted file mode 100644
index f437a21710..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. All rights reserved.
- ================================================================================
- Licensed 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Injectable } from '@angular/core';
-import {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router} from '@angular/router';
-import { Observable } from 'rxjs';
-
-@Injectable({
- providedIn: 'root'
-})
-export class AuthGuard implements CanActivate {
-
- constructor(private router:Router) { }
-
- canActivate(
- next: ActivatedRouteSnapshot,
- state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
- if (localStorage.getItem('authdata')) {
- // logged in
- return true;
- }
-
- // not logged in
- this.router.navigate(['/login'], { queryParams: {returnUrl: state.url}});
- return false;
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts
deleted file mode 100644
index d7610eed0d..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. All rights reserved.
- ================================================================================
- Licensed 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import {Injectable} from '@angular/core';
-import {HttpClient} from "@angular/common/http";
-import {environment} from "../environments/environment";
-
-@Injectable({
- providedIn: 'root'
-})
-export class AuthenticationService {
-
- constructor(private http: HttpClient) {
- }
-
- login(username: string, password: string) {
- // remove old data from storage
- localStorage.removeItem('authdata');
- // add to local storage
- var authdata = window.btoa(username + ':' + password);
- localStorage.setItem('authdata', authdata);
-
- // make request
- return this.http.get(environment.authBackendURL);
- }
-
- logout() {
- // remove from local storage
- localStorage.removeItem('authdata');
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts
deleted file mode 100644
index 4990d05ecb..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. All rights reserved.
- ================================================================================
- Licensed 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Injectable } from '@angular/core';
-import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
-import { Observable } from 'rxjs';
-
-@Injectable()
-export class BasicAuthInterceptor implements HttpInterceptor {
- intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
- //add authorization header with basic auth credentials if available
- let auth = localStorage.getItem('authdata');
- if (auth) {
- const authReq = request.clone({
- headers: request.headers.set('Authorization', 'Basic Z3VpOnBhc3N3b3JkMSQ=')
- });
-
- // send cloned request with header to the next handler.
- return next.handle(authReq);
- }
-
- return next.handle(request);
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
index 8dfae3da1e..b391672728 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
@@ -21,7 +21,7 @@ SPDX-License-Identifier: Apache-2.0
*/
import { Injectable } from '@angular/core';
-import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
+import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { BpmnInfraRequest } from './model/bpmnInfraRequest.model';
import { catchError } from 'rxjs/operators';
import { Observable } from 'rxjs';
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
index a98095ca00..8ad955f38e 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
@@ -17,12 +17,23 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
-->
<div class="completeForm">
<div class="topCanvas">
- <section class="canvas" id="canvas"></section>
+ <div class="navigation">
+ <button class="zoomButton" mat-icon-button title="zoom in" (click)="zoomIn()">
+ <mat-icon>zoom_in</mat-icon>
+ </button>
+ <button class="zoomButton" mat-icon-button title="zoom out" (click)="zoomOut()">
+ <mat-icon>zoom_out</mat-icon>
+ </button>
+ <button class="zoomButton" mat-icon-button title="reset zoom" (click)="resetZoom()">
+ <mat-icon>all_out</mat-icon>
+ </button>
+ </div>
+ <div #canvas class="canvas" id="canvas"></div>
<mat-card class="besideCanvas" id="besideCanvas">
<mat-card-title>Process Information</mat-card-title>
<br />
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss
index 2789723964..b96fe4ace2 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss
@@ -17,23 +17,39 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
#canvas {
background: white;
padding: 0;
- margin: 0;
+ margin-left: -43px;
width: 70%;
height: 470px;
margin-top: 0;
- box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
+ box-shadow: 0 8px 10px 1px rgba(0,0,0,.2);
+}
+
+.navigation {
+ background: #e6e6e6;
+ width: 40px;
+ box-shadow: -5px 8px 10px 1px rgba(0,0,0,.2);
+ height: 470px;
+ border: 1px;
+ border-color: black;
+ position: relative;
+}
+
+.zoomButton {
+ padding-top: 8px;
+ background: none;
+ border: none;
}
#besideCanvas {
background: white;
padding-left: 20px;
margin: 0;
- width: 28%;
+ width: 25%;
height: 470px;
margin-top: 0;
box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
index 7106a87937..a42fa3f5a6 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
import { Component, OnInit } from '@angular/core';
@@ -34,6 +34,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { VariableInstance } from '../model/variableInstance.model';
import { ToastrNotificationService } from '../toastr-notification-service.service';
import { NgxSpinnerService } from 'ngx-spinner';
+import { ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-details',
@@ -43,6 +44,9 @@ import { NgxSpinnerService } from 'ngx-spinner';
})
export class DetailsComponent implements OnInit {
+
+ @ViewChild("canvas") elementReference: ElementRef;
+
bpmnViewer: any;
processInstanceID: string;
@@ -82,7 +86,8 @@ export class DetailsComponent implements OnInit {
async (data: ProcessDefinitionDetail) => {
this.processDefinition = data;
console.log(data);
- await this.displayCamundaflow(this.processDefinition.processDefinitionXml, this.activityInstance, this.router);
+ await this.displayCamundaflow(this.processDefinition.processDefinitionXml, this.activityInstance,
+ this.router, this.spinner, this.popup);
}, error => {
console.log(error);
this.popup.error("Unable to get process definition for id: " + procDefId + " Error code:" + error.status);
@@ -104,30 +109,53 @@ export class DetailsComponent implements OnInit {
});
}
- displayCamundaflow(bpmnXml, activities: ActivityInstance[], r: Router) {
- this.spinner.show();
+ displayCamundaflow(bpmnXml, activities: ActivityInstance[], router: Router,
+ spinner: NgxSpinnerService, popup: ToastrNotificationService) {
+ spinner.show();
this.bpmnViewer.importXML(bpmnXml, (error) => {
if (error) {
console.error('Unable to load BPMN flow ', error);
- this.popup.error('Unable to load BPMN flow ');
- this.spinner.hide();
+ popup.error('Unable to load BPMN flow ');
+ spinner.hide();
} else {
- this.spinner.hide();
- var canvas = this.bpmnViewer.get('canvas');
+ spinner.hide();
+ let canvas = this.bpmnViewer.get('canvas');
var eventBus = this.bpmnViewer.get('eventBus');
- eventBus.on('element.click', function(e) {
+ var elementRegistry = this.bpmnViewer.get('elementRegistry');
+ var overlays = this.bpmnViewer.get('overlays');
- activities.forEach(a => {
- if (a.activityId == e.element.id && a.calledProcessInstanceId !== null) {
- console.log("will drill down to : " + a.calledProcessInstanceId);
- r.navigate(['/details/' + a.calledProcessInstanceId]);
- this.spinner.show();
- }
- });
+ activities.forEach(a => {
+ if (a.calledProcessInstanceId !== null) {
+ var element = elementRegistry.get(a.activityId);
+ let newNode = document.createElement('div');
+ newNode.className = 'highlight-overlay';
+ newNode.id = element.id;
+ newNode.style.width = element.width + "px";
+ newNode.style.height = element.height + "px";
+ newNode.style.cursor = "pointer";
+
+ overlays.add(a.activityId, {
+ position: {
+ top: -5,
+ left: -5
+ },
+ html: newNode
+ });
+
+ newNode.addEventListener('click', function(e) {
+ console.log("clicked on: " + e.srcElement.id)
+ activities.forEach(a => {
+ if (a.activityId == e.srcElement.id && a.calledProcessInstanceId !== null) {
+ console.log("will drill down to : " + a.calledProcessInstanceId);
+ router.navigate(['/details/' + a.calledProcessInstanceId]);
+ }
+ });
+ });
+ }
});
// zoom to fit full viewport
- canvas.zoom('fit-viewport');
+ canvas.zoom('fit-viewport', 'auto');
activities.forEach(a => {
canvas.addMarker(a.activityId, 'highlight');
});
@@ -135,6 +163,26 @@ export class DetailsComponent implements OnInit {
});
}
+ zoomIn() {
+ this.bpmnViewer.get('zoomScroll').zoom(1, {
+ x: this.elementReference.nativeElement.offsetWidth / 2,
+ y: this.elementReference.nativeElement.offsetHeight / 2
+ });
+ }
+
+ zoomOut() {
+ this.bpmnViewer.get('zoomScroll').zoom(-1, {
+ x: this.elementReference.nativeElement.offsetWidth / 2,
+ y: this.elementReference.nativeElement.offsetHeight / 2
+ });
+ }
+ resetZoom() {
+ let canvas = this.bpmnViewer.get('canvas');
+ canvas.resized();
+ canvas.zoom('fit-viewport', 'auto');
+
+ }
+
getVarInst(procInstId: string) {
this.data.getVariableInstance(procInstId).subscribe(
(data: VariableInstance[]) => {
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts
deleted file mode 100644
index afe792c80f..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. All rights reserved.
- ================================================================================
- Licensed 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Injectable } from '@angular/core';
-import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
-import { Observable, throwError } from 'rxjs';
-import { catchError } from 'rxjs/operators';
-import {AuthenticationService} from "./authentication.service";
-
-@Injectable()
-export class ErrorInterceptor implements HttpInterceptor {
- constructor(private authenticationService: AuthenticationService) {}
-
- intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
- return next.handle(request).pipe(catchError(err => {
- if (err.status === 401) {
- // auto logout if 401 response returned from api
- this.authenticationService.logout();
- location.reload(true);
- }
-
- const error = err.error.message || err.statusText;
- return throwError(error);
- }))
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts
index 16d274f16a..b22fa6ee9c 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
import { Injectable } from '@angular/core';
@@ -44,9 +44,9 @@ export class HttpErrorHandlerService {
this.popup.error("Internal Service Error occured for operation: " + operation + " please check backend service log. status code: " + error.status);
}
console.error(
- 'Backend returned code ${error.status}, ' +
- 'body was: ${error.error}');
- return throwError(error.error || "Internal Service Error occured for operation: " + operation + " please check backend service log. status code: " + error.status);
+ 'Backend returned status code: ', error.status + ' from URL ' + url);
+ return throwError(error.error || "Internal Service Error occured for operation: " +
+ operation + ". Please check backend service log. Status code: " + error.status);
};
}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html
deleted file mode 100644
index 107e1da04a..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
-============LICENSE_START=======================================================
-Copyright (C) 2019 Samsung. All rights reserved.
-================================================================================
-Licensed 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.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: k.kazak@samsung.com
--->
-<h2>Login</h2>
-<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
- <div class="form-group">
- <label for="username">Username</label>
- <input type="text" formControlName="username" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.username.errors }" />
- <div *ngIf="submitted && f.username.errors" class="invalid-feedback">
- <div *ngIf="f.username.errors.required">Username is required</div>
- </div>
- </div>
- <div class="form-group">
- <label for="password">Password</label>
- <input type="password" formControlName="password" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.password.errors }" />
- <div *ngIf="submitted && f.password.errors" class="invalid-feedback">
- <div *ngIf="f.password.errors.required">Password is required</div>
- </div>
- </div>
- <div class="form-group">
- <button [disabled]="loading" class="btn btn-primary">Login</button>
- <img *ngIf="loading" src="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==" />
- </div>
- <div *ngIf="error" class="alert alert-danger">{{error}}</div>
-</form>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts
deleted file mode 100644
index 8cf379d04f..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. All rights reserved.
- ================================================================================
- Licensed 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import {async, ComponentFixture, inject, TestBed} from '@angular/core/testing';
-
-import {LoginComponent} from './login.component';
-import {AuthenticationService} from "../authentication.service";
-import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core";
-import {FormsModule, ReactiveFormsModule} from '@angular/forms';
-import {RouterTestingModule} from "@angular/router/testing";
-import {ActivatedRoute, Router, RouterModule} from "@angular/router";
-
-describe('LoginComponent', () => {
- // Create SPY Object for Jasmine tests to mock DataService
- let spyDataService: jasmine.SpyObj<AuthenticationService>;
- let component: LoginComponent;
- let fixture: ComponentFixture<LoginComponent>;
- let router: Router;
-
- beforeEach(async(() => {
- spyDataService = jasmine.createSpyObj('AuthenticationService', ['login', 'logout']);
-
- TestBed.configureTestingModule({
- providers: [LoginComponent,
- {provide: AuthenticationService, useValue: spyDataService},
- {provide: ActivatedRoute, useValue: { snapshot: {queryParams: { returnUrl: 'test'}}}}
- ],
- imports: [RouterTestingModule, ReactiveFormsModule, FormsModule, RouterModule.forRoot([])],
- declarations: [LoginComponent],
- schemas: [
- CUSTOM_ELEMENTS_SCHEMA
- ]
- });
-
- fixture = TestBed.createComponent(LoginComponent);
- component = fixture.componentInstance;
- router = TestBed.get(Router);
- }));
-
-
- it('should create', inject([LoginComponent],
- (component: LoginComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should logout and route to test directory', inject([LoginComponent],
- (component: LoginComponent) => {
- component.ngOnInit();
- expect(component.returnUrl).toBe('test');
- }));
-
- it('should logout and route to root directory', inject([LoginComponent],
- (component: LoginComponent) => {
- router.initialNavigation();
- component.ngOnInit();
- expect(component.returnUrl).toBe('test');
- }));
-
- it('should submit without success', inject([LoginComponent],
- (component: LoginComponent) => {
- component.ngOnInit();
- expect(component.loginForm.valid).toBe(false);
- component.onSubmit();
- expect(component.submitted).toBe(true);
- }));
-
- it('should submit without success', inject([LoginComponent],
- (component: LoginComponent) => {
- component.ngOnInit();
- expect(component.loginForm.valid).toBe(false);
- spyDataService.login.and.returnValue(Promise.resolve());
-
- let compiled = fixture.debugElement.nativeElement;
- let username = compiled.querySelector('input[type="text"]');
- let password = compiled.querySelector('input[type="password"]');
-
- fixture.detectChanges();
-
- // Change value
- username.value = 'test';
- password.value = 'password';
-
- // dispatch input event
- dispatchEvent(new Event('input'));
-
- component.onSubmit();
- expect(component.submitted).toBe(true);
- }));
-});
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts
deleted file mode 100644
index 4a3f4e6b0f..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. All rights reserved.
- ================================================================================
- Licensed 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Component, OnInit } from '@angular/core';
-import {FormBuilder, FormGroup, Validators, ReactiveFormsModule} from "@angular/forms";
-import {ActivatedRoute, Router} from "@angular/router";
-import {AuthenticationService} from "../authentication.service";
-import {first} from "rxjs/internal/operators";
-
-@Component({
- selector: 'app-login',
- templateUrl: './login.component.html',
- styleUrls: []
-})
-export class LoginComponent implements OnInit {
-
- loginForm: FormGroup;
- loading = false;
- submitted = false;
- returnUrl: string;
- error = '';
-
- constructor(private formBuilder: FormBuilder,
- private route: ActivatedRoute,
- private router: Router,
- private authenticationService: AuthenticationService) { }
-
- ngOnInit() {
- this.loginForm = this.formBuilder.group({
- username: ['', Validators.required],
- password: ['', Validators.required]
- });
-
- // logout
- this.authenticationService.logout();
-
- this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
- }
-
- // convenience getter for easy access to form fields
- get f() { return this.loginForm.controls; }
-
- onSubmit() {
- this.submitted = true;
-
- // stop here if form is invalid
- if (this.loginForm.invalid) {
- return;
- }
-
- this.loading = true;
- this.authenticationService.login(this.f.username.value, this.f.password.value)
- .subscribe(
- next => {
- this.router.navigate([this.returnUrl]);
- },
- error => {
- this.error = error;
- this.loading = false;
- });
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
index 1c623518c7..e8b54d7ae3 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
@@ -1,34 +1,29 @@
-<!--
-============LICENSE_START=======================================================
- Copyright (C) 2018 Ericsson. All rights reserved.
-================================================================================
- Modifications Copyright (c) 2019 Samsung
-================================================================================
-Licensed 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.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
--->
-
-<nav>
- <ul>
- <li>
- <a routerLink="/">Home</a>
- </li>
- <li>
- <a routerLink="/login">Logout</a>
- </li>
- </ul>
-</nav>
+<!--
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed 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.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+-->
+
+<nav>
+ <ul>
+ <li>
+ <a routerLink="/">Home</a>
+ </li>
+ </ul>
+</nav>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
index 484a156fa9..f0c63fe582 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
@@ -2,8 +2,6 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. All rights reserved.
================================================================================
- Modifications Copyright (c) 2019 Samsung
-================================================================================
Licensed 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
@@ -26,6 +24,5 @@ SPDX-License-Identifier: Apache-2.0
export const environment = {
production: false,
- soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/',
- authBackendURL: 'http://so-monitoring:30224/user'
+ soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/'
};