Commit 67cf203f authored by sourabh_roy's avatar sourabh_roy
Browse files

updated help text in dashboard

parent 7a59f939
Pipeline #27990 passed with stages
in 3 minutes and 15 seconds
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { BrowserModule } from '@angular/platform-browser';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
RouterTestingModule,BrowserModule
],
declarations: [
AppComponent
......
......@@ -2,6 +2,7 @@ import { APP_INITIALIZER } from '@angular/core';
import { AppConfig } from './app.config';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
......@@ -32,7 +33,7 @@ export function initializeApp(appConfig: AppConfig) {
LoginComponent
],
imports: [
BrowserModule,
BrowserModule,BrowserAnimationsModule,
AppRoutingModule,HttpClientModule, NgbModule,
NgxSpinnerModule,NgMultiSelectDropDownModule,
NgSelectModule,FormsModule,ReactiveFormsModule
......
......@@ -34,9 +34,11 @@ export class AuthService {
public search_endpoint_url="";
public legal_endpoint_url="";
public storage_endpoint_url="";
public workflow_endpoint_url="";
public data_partition="";
public scope="";
public logout_uri="";
public tennant_id="";
httpOptions_token={};
constructor(private router: Router, private http: HttpClient,public cmnSrv:CommonService) {
console.log("inside auth",router.url);
......@@ -57,8 +59,15 @@ export class AuthService {
this.legal_endpoint_url=this.config_params["api_endpoints"]["legal_endpoint"];
this.search_endpoint_url=this.config_params["api_endpoints"]["search_endpoint"];
this.storage_endpoint_url=this.config_params["api_endpoints"]["storage_endpoint"];
this.workflow_endpoint_url=this.config_params["api_endpoints"]["workflow_endpoint"];
this.data_partition=this.config_params.data_partition;
this.scope=this.config_params.scope;
if(this.cloud_provider_name=='azure'){
this.tennant_id=this.config_params["tenant_id"];
}
if(this.cloud_provider_name=='azure'){
this.token_url=`${this.token_url}${this.tennant_id}/oauth2/v2.0/token/`
}
this.httpOptions_token = {
headers: new HttpHeaders({
'Authorization': 'Basic ' + this.authorization,
......@@ -74,13 +83,15 @@ export class AuthService {
httpOptions_token_gcp = {
headers: new HttpHeaders({
"Content-Type":"application/json"
"Content-Type":"application/json",
'Access-Control-Allow-Origin': '*',
}),
};
httpOptions_token_ibm = {
headers: new HttpHeaders({
"Content-Type":"application/x-www-form-urlencoded"
"Content-Type":"application/x-www-form-urlencoded",
'Access-Control-Allow-Origin': '*',
}),
};
......@@ -110,17 +121,7 @@ export class AuthService {
// window.location.href="https://osdur3m1-646453888586.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=6pt82avd7cshl3u4al1djafrm3&redirect_uri=http://localhost:8090&scope=email+openid"
}
else if (error.status == 400) {
// if(error["error"]["error"]=="invalid_grant"){
// if(this.cloud_provider_name=="gcp"){
// window.location.href = `${this.auth_url}?response_type=code&prompt=consent&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}&access_type=offline`;
// }
// else{
// window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
// }
// }
// else{
// errorMessage = error.error;
// }
if(error["error"]["message"] != undefined){
errorMessage=error["error"]["message"];
}
......@@ -209,8 +210,11 @@ export class AuthService {
window.location.href=`${this.logout_uri}?client_id=${this.client_id}&logout_uri=${this.redirect_uri}`
// window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
}
else if(this.cloud_provider_name=="ibm"){
// "https://keycloak-osdu-keycloak.odi-osdu-fa7661852f2ab29a6be32f560b2f5573-0000.us-south.containers.appdomain.cloud/auth/realms/OSDU/protocol/openid-connect/logout"
else if(this.cloud_provider_name=="azure"){
window.location.href=`${this.logout_uri}${this.tennant_id}/oauth2/v2.0/logout`
// window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
}
else if(this.cloud_provider_name=="ibm"){
this.router.navigate(['/login']);
}
}
......@@ -230,7 +234,7 @@ export class AuthService {
code= href.split("&")[0].split("=")[1];
}
else{
code = href.split('=')[1];
code = href.split('=')[1];
}
......@@ -244,6 +248,9 @@ export class AuthService {
else if(this.cloud_provider_name=="aws"){
window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
}
else if(this.cloud_provider_name=='azure'){
window.location.href=`${this.auth_url}${this.tennant_id}/oauth2/v2.0/authorize?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`
}
else if(this.cloud_provider_name=="ibm"){
this.router.navigate(['/login']);
}
......@@ -259,22 +266,21 @@ export class AuthService {
}
else{
this.logout();
// if(this.cloud_provider_name=="gcp"){
// window.location.href = `${this.auth_url}?response_type=code&prompt=consent&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}&access_type=offline`;
// }
// else{
// window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
// }
}
}
}
else {
else {
if(this.cloud_provider_name=='azure'){
code=code.slice(0,-14);
}
if (token == null) {
if(this.cloud_provider_name=="gcp"){
this.subscribeAuthToken_gcp(code);
}
else if(this.cloud_provider_name=="aws"){
else if(this.cloud_provider_name=="aws" || this.cloud_provider_name=="azure"){
this.subscribeAuthToken(code);
}
// else if(this.cloud_provider_name=="ibm"){
......@@ -372,17 +378,7 @@ export class AuthService {
this.setIdToken(res.id_token);
this.refreshTokenTimer(res.id_token);
window.location.reload(true);
// this.getRefreshToken(this.getRefreshSession()).subscribe((result) => {
// this.setTokenSession(result.access_token);
// // this.setRefreshToken(result.refresh_token);
// this.setIdToken(result.id_token);
// this.refreshTokenTimer(result.id_token);
// }, (err) => {
// console.log(err);
// });
}
}
......@@ -536,7 +532,7 @@ export class AuthService {
refreshTokenTimer(access_token) {
let decoded = jwt_decode(access_token);
if(this.cloud_provider_name=="gcp" || this.cloud_provider_name=="ibm"){
if(this.cloud_provider_name=="gcp" || this.cloud_provider_name=="ibm" || this.cloud_provider_name=='azure'){
this.cmnSrv.username=decoded["name"];
}
else{
......@@ -585,12 +581,15 @@ export class AuthService {
console.log("inside auth redirect");
if (code == undefined) {
if (token == null) {
if(this.cloud_provider_name=="gcp"){
window.location.href = `${this.auth_url}?response_type=code&prompt=consent&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}&access_type=offline`;
}
else{
window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
}
if (this.cloud_provider_name == "gcp") {
window.location.href = `${this.auth_url}?response_type=code&prompt=consent&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}&access_type=offline`;
}
else if (this.cloud_provider_name == 'azure') {
window.location.href = `${this.auth_url}${this.tennant_id}/oauth2/v2.0/authorize?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`
}
else {
window.location.href = `${this.auth_url}?response_type=code&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&scope=${this.scope}`;
}
}
}
}
......
......@@ -11,6 +11,7 @@ export class CommonService {
sideNavLists=[];
SideNavHeader='';
EandOgroupEmailList=[];
workFlowNameList=[];
filterByValue(array, string) {
return array.filter(o =>
......
......@@ -18,11 +18,13 @@ export class RestAPILayerService {
storage_endpoint_url=this.auth.storage_endpoint_url;
search_endpoint_url=this.auth.search_endpoint_url;
legal_endpoint_url=this.auth.legal_endpoint_url;
workflow_endpoint_url=this.auth.workflow_endpoint_url;
// --------host points-------
entitlementHost=AppConfig.settings.common.entitlement_host;
legalHost=AppConfig.settings.common.legal_host;
search_host=AppConfig.settings.common.search_host;
storage_host=AppConfig.settings.common.storage_host;
workflow_host=AppConfig.settings.common.workflow_host;
access_token=this.auth.getTokenSession();
authorization = this.auth.authorization;
data_partition=this.auth.data_partition;
......@@ -271,4 +273,65 @@ export class RestAPILayerService {
);
}
//--------------------------------- Workflow Services----------------------------------------
getWorkFlowList(): Observable<any> {
this.param = 'workflow'
let errorData={
'api':this.param,
}
return this.http.get<any>(this.workflow_endpoint_url+ this.workflow_host+ this.param, this.httpOptions).pipe(
map(this.extractData),
catchError(this.auth.errorHandler<any>('addProduct',errorData))
);
}
getAWorkFlowDetail(name){
this.param = 'workflow/'+name;
let errorData={
'api':this.param,
}
return this.http.get<any>(this.workflow_endpoint_url+ this.workflow_host+ this.param, this.httpOptions).pipe(
map(this.extractData),
catchError(this.auth.errorHandler<any>('addProduct',errorData))
);
}
getAWorkFlowRun(name){
this.param = 'workflow/'+name+'/workflowRun';
let errorData={
'api':this.param,
}
return this.http.get<any>(this.workflow_endpoint_url+ this.workflow_host+ this.param, this.httpOptions).pipe(
map(this.extractData),
catchError(this.auth.errorHandler<any>('addProduct',errorData))
);
}
getAWorkFlowRunDetail(name,runid){
this.param = 'workflow/'+name+'/workflowRun/'+runid;
let errorData={
'api':this.param,
}
return this.http.get<any>(this.workflow_endpoint_url+ this.workflow_host+ this.param, this.httpOptions).pipe(
map(this.extractData),
catchError(this.auth.errorHandler<any>('addProduct',errorData))
);
}
updateWorkFlowRunStatus(name,runid,data){
this.param = 'workflow/'+name+'/workflowRun/'+runid;
let errorData={
'api':this.param,
}
return this.http.post<any>(this.workflow_endpoint_url+ this.workflow_host+ this.param,data, this.httpOptions).pipe(
map(this.extractData),
catchError(this.auth.errorHandler<any>('addProduct',errorData))
);
}
}
......@@ -69,7 +69,7 @@ font-size: 18px;
.cont_router:hover {
transform: scale(1.01);
transition: 0.25s;
opacity: 0.8;
opacity: 0.98;
}
.chart-wrapper.px-3 .btn.btn-success, .btn.btn-register{
background-color: rgb(0 124 102 / 1) !important;
......@@ -87,4 +87,48 @@ font-size: 18px;
}
.card-height{
height: 190px;
}
/* tooltip */
p.tool-tip__info.tooltip_right {
left: 50%;
transform: translate(-50%, calc(15% + 8px));
transform: translate(-50%,calc(100%+1px));
}
p.tool-tip__info.tooltip_right:after {
border-width: 0 8px 8px 8px;
border-color: transparent transparent rgba(10, 20, 30, 0.85) transparent;
bottom: -8px;
left: 50%;
transform: translate(-50%, 0);
}
.tool-tip .tool-tip__info.tooltip_right:before, .tool-tip .tool-tip__info.tooltip_right:after {
border-width: 0 8px 8px 8px;
border-color: transparent transparent rgba(10, 20, 30, 0.85) transparent;
bottom: 100%;
top: 100%;
left: 50%;
transform: translate(-50%, 100%,);
transform: translateY(-206px);
display: none;
}
p.tool-tip__info.tooltip_right {
display: none;
background: #262626;
border: 1px solid #27b1f0;
border-radius: 3px;
font-size: 0.875em;
padding: 1em;
position: absolute;
right: 100%;
top: -10px;
z-index: 2;
width: 233px !important;
}
\ No newline at end of file
......@@ -6,9 +6,16 @@
<div class="container1 cont_router1" >
<div class="card text-white bg-flat-color-2" style=" height: 404px;">
<div class="card-body pb-0">
<p class="text-light"><i class="fa fa-sitemap" aria-hidden="true"></i>&nbsp; Manage Groups & Legal Tags</p>
<div class="text-light"><i class="fa fa-sitemap" aria-hidden="true"></i>&nbsp;<span> Manage Groups & Legal Tags</span>
<div class="tool-tip" style=" left: -10px; top: -10px;">
<i class="fa fa-info-circle " aria-hidden="true"></i>
<p class="tool-tip__info tooltip_right">
<span class="info">{{entitlements_helptext}}</span>
</p>
</div>
</div>
<div class="chart-wrapper px-3" style="margin-top: 15%; margin-bottom: 15%;text-align: center;" height="70">
<div>
<img src="../../../assets/images/settings.png" height="70" style="height: 90px;margin-bottom: 5%;">
......@@ -42,8 +49,15 @@
<div class="container1 cont_router" routerLink="/data-platform">
<div class="card text-white bg-flat-color-2">
<div class="card-body pb-0">
<div class="text-light"><i class="fa fa-database" aria-hidden="true"></i>&nbsp; Search for Data
<div class="tool-tip" style=" left: -10px; top: -10px;">
<i class="fa fa-info-circle " aria-hidden="true"></i>
<p class="tool-tip__info tooltip_right" style="top: 4px;">
<span class="info">{{searchdata_helptext}}</span>
</p>
</div>
</div>
<p class="text-light"><i class="fa fa-database" aria-hidden="true"></i>&nbsp; Search for Data</p>
<div class="chart-wrapper px-0" style="height:70px;" height="70">
<div class="chart-wrapper px-0" style="height:70px;text-align: center;" height="70">
<img src="../../../assets/images/dataPlatform.png" height="70" style="height: 90px;">
......@@ -56,10 +70,18 @@
</div>
<div class="col-sm-6 col-lg-6">
<!-- routerLink="/data-ingestion/workflow" -->
<div class="container1 cont_router1">
<div class="card text-white bg-flat-color-1">
<div class="card-body pb-0">
<p class="text-light"><i class="fa fa-paper-plane" aria-hidden="true"></i>&nbsp; Data Ingestion(Coming Soon!)</p>
<div class="card-body pb-0">
<div class="text-light"><i class="fa fa-paper-plane" aria-hidden="true"></i>&nbsp; WorkFlow Service(Coming Soon!)
<div class="tool-tip" style=" left: -10px; top: -10px;">
<i class="fa fa-info-circle " aria-hidden="true"></i>
<p class="tool-tip__info tooltip_right">
<span class="info">{{workflow_helptext}}</span>
</p>
</div>
</div>
<div class="chart-wrapper px-0" style="height:70px;text-align: center;" height="70">
<img src="../../../assets/images/data_ingestion.png" height="70" style="height: 90px;">
</div>
......@@ -76,9 +98,14 @@
<div class="container1 cont_router" routerLink="/EDS/source">
<div class="card text-white bg-flat-color-1">
<div class="card-body pb-0">
<p class="text-light"><i class="fa fa-arrows" aria-hidden="true"></i>&nbsp; External Data Sources(Coming Soon!)</p>
<div class="text-light"><i class="fa fa-arrows" aria-hidden="true"></i>&nbsp; External Data Source(Coming Soon!)
<div class="tool-tip" style=" left: -10px; top: -10px;">
<i class="fa fa-info-circle " aria-hidden="true"></i>
<p class="tool-tip__info tooltip_right">
<span class="info">{{eds_helptext}}</span>
</p>
</div>
</div>
<div class="chart-wrapper px-0" style="height:70px;text-align: center;" height="70">
<img src="../../../assets/images/icons8-combo-chart-80.png" />
</div>
......@@ -95,22 +122,21 @@
<div class="container1 cont_router1" >
<div class="card text-white bg-flat-color-2">
<div class="card-body pb-0">
<p class="text-light"><i class="fa fa-object-group" aria-hidden="true"></i>&nbsp; Data Loading(Coming Soon!)</p>
<div class="text-light"><i class="fa fa-object-group" aria-hidden="true"></i>&nbsp; Data Loading(Coming Soon!)
<div class="tool-tip" style=" left: -10px; top: -10px;">
<i class="fa fa-info-circle " aria-hidden="true"></i>
<p class="tool-tip__info tooltip_right" style="top: 4px;">
<span class="info">{{dataloading_helptext}}</span>
</p>
</div>
</div>
<div class="chart-wrapper px-0" style="height:70px;text-align: center;" height="70">
<img src="../../../assets/images/data_loading.png" height="70" style="height: 90px;">
</div>
</div>
</div>
<!-- <div class="overlay overlay-clr1">
<div class="text">
<a href="javascript:void(0);" routerLink="/data-loading">Common Action 1</a><br/>
<a href="javascript:void(0);" routerLink="/data-loading">Common Action 2</a><br/>
</div>
</div> -->
</div>
</div>
......
......@@ -4,7 +4,7 @@ import jwt_decode from "jwt-decode";
import { AuthService } from 'src/app/common/Authentication/auth.service';
import { CommonService } from 'src/app/common/common.service';
import '../../../config';
import { dashboardList } from '../../../config';
import { dashboardList,managegroups_members_helptext,searchdata_helptext,workflow_helptext,eds_helptext ,dataloading_helptext} from '../../../config';
import { AppConfig} from 'src/app/app.config';
import { RestAPILayerService} from 'src/app/common/rest-apilayer.service';
import { environment } from 'src/environments/environment';
......@@ -19,6 +19,12 @@ import { environment } from 'src/environments/environment';
export class DashboardMainComponent implements OnInit {
href;
id_token='';
entitlements_helptext=managegroups_members_helptext;
searchdata_helptext=searchdata_helptext;
workflow_helptext=workflow_helptext;
eds_helptext=eds_helptext;
dataloading_helptext=dataloading_helptext;
constructor(public restService:RestAPILayerService, public router: Router, public cmnSrc: CommonService, private cd: ChangeDetectorRef,private auth:AuthService) {
this.cmnSrc.sideNavLists=dashboardList[0]["sideValues"];
this.cmnSrc.SideNavHeader=dashboardList[0]["header"];
......
......@@ -3,16 +3,17 @@ import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '../auth.guard';
import { DataIngestionComponent} from './data-ingestion/data-ingestion.component';
import { WorkFlowRunComponent} from './work-flow-run/work-flow-run.component';
import { WorkflowsComponent} from './workflows/workflows.component';
const routes: Routes = [
// { path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: '', component: DataIngestionComponent,canActivateChild:[AuthGuard], children:[
{path:'workflowRun',component:WorkFlowRunComponent},
{path:'workflow',component:WorkflowsComponent},
] },
];
@NgModule({
......
......@@ -2,13 +2,18 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DataIngestionComponent } from './data-ingestion/data-ingestion.component';
import { DataIngestionRoutingModule } from './data-ingestion-routing.module';
import { NgxSpinnerModule,NgxSpinnerService} from 'ngx-spinner';
import { FormsModule } from '@angular/forms';
import { NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { NgSelectModule } from '@ng-select/ng-select';
import { WorkFlowRunComponent } from './work-flow-run/work-flow-run.component';
import { WorkflowsComponent } from './workflows/workflows.component';
import { WfRunViewComponent } from './wf-run-view/wf-run-view.component';
@NgModule({
declarations: [DataIngestionComponent],
declarations: [DataIngestionComponent, WorkFlowRunComponent, WorkflowsComponent, WfRunViewComponent],
imports: [
CommonModule,DataIngestionRoutingModule
CommonModule,DataIngestionRoutingModule,NgxSpinnerModule,FormsModule,NgbModule,NgSelectModule
]
})
export class DataIngestionModule { }
<p>Data Ingestion in Progress!</p>
<router-outlet></router-outlet>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { NgxSpinnerService } from 'ngx-spinner';
import { AuthService } from 'src/app/common/Authentication/auth.service';
import { CommonService } from 'src/app/common/common.service';
import { RestAPILayerService } from 'src/app/common/rest-apilayer.service';
@Component({
selector: 'app-data-ingestion',
......@@ -7,9 +13,9 @@ import { Component, OnInit } from '@angular/core';
})
export class DataIngestionComponent implements OnInit {
constructor() { }
constructor(){}
ngOnInit(): void {
}
}
<ngx-spinner bdColor = "rgba(0, 0, 0, 0.4)" size = "medium" color = "#fff" type = "ball-scale-multiple" ><p style="color: white" > Loading... </p></ngx-spinner>
<div class="modal-header" style=" padding: 4px 20px;" id="videoTitle">
<h4 class="modal-title" id="videoTitle1" style="width: 100%;">
{{runName}}
<button style="float: right;"
type="button"
(click)="closePopup()"
class="close"
data-dismiss="modal"
aria-label="Close"
>
&times;
</button>