summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sqlcomponent/sqlcomponent.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sqlcomponent/sqlcomponent.component.ts')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sqlcomponent/sqlcomponent.component.ts196
1 files changed, 0 insertions, 196 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sqlcomponent/sqlcomponent.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sqlcomponent/sqlcomponent.component.ts
deleted file mode 100644
index d8e8f58b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sqlcomponent/sqlcomponent.component.ts
+++ /dev/null
@@ -1,196 +0,0 @@
-import { Component, OnInit, Input, AfterViewInit } from '@angular/core';
-import { HttpClient, HttpHeaders } from '@angular/common/http';
-import { environment } from '../../../../../../environments/environment';
-import { Router } from '@angular/router';
-import { SqlService } from './sql.service';
-
-@Component({
- selector: 'app-sqlcomponent',
- templateUrl: './sqlcomponent.component.html',
- styleUrls: ['./sqlcomponent.component.css']
-})
-export class SQLComponentComponent implements OnInit, AfterViewInit {
-
- @Input("reportId") reportId1 : string;
- @Input("reportMode") reportMode : string;
-
-
- showSaveSQLDialog: boolean;
- SQLPostResponse : any;
- ValidatePostResponse : any;
- showValidateSQLDialog : boolean;
- SQLstatus : string;
- Validatestatus : string;
- SQLmessage : string;
- Validatemessage : string;
- sqlText : string;
- showModal : boolean;
- ValidateResponseString : string;
-
- finalGetObj : any;
-
- @Input() SQLclosable = true;
- @Input() Validateclosable = true;
-
-
- constructor(private _http : HttpClient, private _router : Router, private _sqlService : SqlService) {
- this.showSaveSQLDialog = false;
- this.SQLPostResponse = true;
- this.ValidatePostResponse = {};
-
- this._sqlService.getSQLTabData(this.reportId1)
- .subscribe((response) => {
- console.log(response);
-
- this.finalGetObj = response;
- this.sqlText = this.finalGetObj.query;
- });
- }
-
- ngOnInit() {
- this.showSaveSQLDialog = false;
- this.SQLPostResponse = true;
- this.ValidatePostResponse = {};
-
- this._sqlService.getSQLTabData(this.reportId1)
- .subscribe((response) => {
- console.log(response);
-
- this.finalGetObj = response;
- this.sqlText = this.finalGetObj.query;
- });
- }
-
- ngAfterViewInit() {
- console.log("Reached SQL TAB On Changes.");
- this.showSaveSQLDialog = false;
- this.SQLPostResponse = true;
- this.ValidatePostResponse = {};
-
- this._sqlService.getSQLTabData(this.reportId1)
- .subscribe((response) => {
- console.log(response);
-
- this.finalGetObj = response;
- this.sqlText = this.finalGetObj.query;
- });
- }
-
- ngOnChanges()
- {
- console.log("Reached SQL TAB On Changes.");
- this.showSaveSQLDialog = false;
- this.SQLPostResponse = true;
- this.ValidatePostResponse = {};
-
- this._sqlService.getSQLTabData(this.reportId1)
- .subscribe((response) => {
- console.log(response);
-
- this.finalGetObj = response;
- this.sqlText = this.finalGetObj.query;
- });
- }
-
-
- saveSQL()
- {
-
- this._http.post(environment.baseUrl + "report/wizard/retrieve_data/true",
- {
- "query": "SELECT region region, market market, site_state state, count(usid) num_site from cssng_data_addition_5g@e911_e911pro where cell_active='Y' group by region,market,site_state",
- "tabId": "Sql",
- "tabName": "Sql"
- }
- , { headers: new HttpHeaders({'Content-Type': 'application/json'})})
- .subscribe((response) => {
- console.log(response);
- });
-
- if(this.SQLPostResponse === true)
- {
- this.SQLstatus = "Success!";
- this.SQLmessage = "Your change has been saved! Definition is updated.";
- this.showSaveSQLDialog = !this.showSaveSQLDialog;
- this.SQLclosable = true;
- }
- else
- {
- this.SQLstatus = "Failure!";
- this.SQLmessage = "Definition could not be updated.";
- this.showSaveSQLDialog = !this.showSaveSQLDialog;
- this.SQLclosable = true;
- }
-}
-
-
-
-validate()
-{
- //console.log(this.sqlText);
-
- this._sqlService.postSQLValidateAndSave(this.sqlText)
- .subscribe((response) => {
-
-
- this.ValidateResponseString = response["data"]["elements"];
- this.SetValidateResponseString(this.ValidateResponseString);
- console.log(this.ValidateResponseString);
-
- this.ValidatePostResponse = JSON.parse(response["data"]["elements"]);
-
- //console.log(this.ValidatePostResponse["errormessage"]);
-
- if(this.ValidatePostResponse["query"] !== undefined)
- {
- this.showModal = true;
- this.Validatestatus = "SQL Test Run - Executed!";
- this.showValidateSQLDialog = !this.showValidateSQLDialog;
- this.Validateclosable = true;
- }
- else
- {
- this.showModal = false;
- this.Validatestatus = "SQL Test Run - Failed!";
- this.showValidateSQLDialog = !this.showValidateSQLDialog;
- this.Validateclosable = true;
- }
-
- });
-
-
-
-}
-
-closeSaveModal() {
- this.showSaveSQLDialog = !this.showSaveSQLDialog;
- this.SQLclosable = false;
-}
-
-closeValidateModal() {
- this.showValidateSQLDialog = !this.showValidateSQLDialog;
- this.Validateclosable = false;
-
- console.log(this.reportMode);
-
- if(this.reportMode === "Create")
- {
- this._http.get(environment.baseUrl + "report/wizard/retrieve_def_tab_wise_data/InSession")
- .subscribe((response) => {
- this._router.navigate(["v2/reports", "Edit",response["reportId"]]);
- });
- }
- //this._router.navigate(["v2/reports", this.reportId1]);
-}
-
-SetValidateResponseString(ValidateResponseString1 : string)
-{
- this.ValidateResponseString = ValidateResponseString1;
-}
-
-GetValidateResponseString()
-{
- return this.ValidateResponseString;
-}
-
-}