summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/edit-group.component.html32
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields-add-edit/form-fields-add-edit.component.css23
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.css17
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.html481
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts1167
5 files changed, 895 insertions, 825 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/edit-group.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/edit-group.component.html
new file mode 100644
index 00000000..8a19abf7
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/edit-group.component.html
@@ -0,0 +1,32 @@
+<h1 mat-dialog-title>Edit Form Fields Group</h1>
+<div class="edit-popup" mat-dialog-content>
+ <p>Group Name</p>
+ <mat-form-field >
+ <input matInput [(ngModel)]="data['editGroupInfo'].name" disabled>
+ </mat-form-field>
+ <mat-form-field>
+ <mat-label>Select Form Fields</mat-label>
+ <mat-select multiple [(ngModel)]="data['editGroupInfo'].formFieldList">
+ <mat-option *ngFor="let item of data['formFieldsListObj']; let i = index;" value="{{item.id}}">{{item.name}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+</div>
+<div class="dialog-action" mat-dialog-actions>
+ <button mat-button (click)="onNoClick()">Close</button>
+ <button class="update-button" mat-button [mat-dialog-close]="editGroupInfo" cdkFocusInitial>Update</button>
+</div>
+<style scoped>
+ ::ng-deep .cdk-global-overlay-wrapper, .cdk-overlay-container {
+ z-index: 1000 !important;
+ }
+ .edit-popup{
+ height: 450px;
+ }
+ .update-button{
+ background-color: #006496;
+ color: white;
+ }
+ .dialog-action{
+ align-items: right;
+ }
+</style> \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields-add-edit/form-fields-add-edit.component.css b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields-add-edit/form-fields-add-edit.component.css
index 52a77240..578b33e8 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields-add-edit/form-fields-add-edit.component.css
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields-add-edit/form-fields-add-edit.component.css
@@ -1,13 +1,3 @@
- .overlay {
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: rgba(0, 0, 0, 0.705);
- z-index: 999;
- }
-
.dialog {
z-index: 1000;
display: flex;
@@ -18,10 +8,19 @@
margin-right: auto;
margin-left: auto;
margin-top: 50px;
- height: 900px;
+ height: 690px;
width: 1024px;
background-color: #fff;
padding: 12px;
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.349), 0 13px 19px 2px rgba(0, 0, 0, 0.349), 0 5px 24px 4px rgba(0, 0, 0, 0.349);
}
- \ No newline at end of file
+
+.overlay {
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: rgba(0, 0, 0, 0.705);
+ z-index: 999;
+}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.css b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.css
index e4753426..96d0a71f 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.css
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.css
@@ -2440,10 +2440,10 @@ a.btn {
font-size: 1.7rem; }
.btn-small {
- /* padding: 10px 19px 9px 18px; */
+ padding: 10px 19px 9px 20px;
font-size: 1.5rem;
- border-radius: 8px; }
-
+ border-radius: 8px;
+}
.btn-fullwidth {
width: 100%; }
@@ -6278,4 +6278,13 @@ table, tr, td, th {
td{
height: 5px;
-} \ No newline at end of file
+}
+
+.edit-group{
+ margin-left: 10%;
+}
+
+.center{
+ margin: auto;
+ width: 50%;
+}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.html
index 028c9807..63062109 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.html
@@ -1,242 +1,287 @@
<app-sql-validate-changes-dialog-component [(visible)]="showDialog1">
- <span class="ecomp-spinner" *ngIf="showVerifySpinner"></span>
- <div *ngIf="!showVerifySpinner">
+ <span *ngIf="showVerifySpinner" class="ecomp-spinner"></span>
+ <div *ngIf="!showVerifySpinner">
<div class="card">
<div class="card-body" style="width: 800px; height: 615px; ">
<div style="height:600px; overflow: scroll;">
- <div class="modalTitle">{{Validatestatus}}</div>
- <button *ngIf="Validateclosable" (click)="closeValidateModal()" aria-label="Close" class="dialog__close-btn">X</button>
- <br/>
- <app-sql-validate-success-dialog-component [tableObj] = "validateResponseString"></app-sql-validate-success-dialog-component>
- <!-- <app-sql-validate-error-dialog-component *ngIf="!ValidatePostResponse.query" [tableObj] = "GetValidateResponseString()"></app-sql-validate-error-dialog-component> -->
+ <div class="modalTitle">{{Validatestatus}}</div>
+ <button (click)="closeValidateModal()" *ngIf="Validateclosable" aria-label="Close"
+ class="dialog__close-btn">X
+ </button>
+ <br/>
+ <app-sql-validate-success-dialog-component
+ [tableObj]="validateResponseString"></app-sql-validate-success-dialog-component>
+ <!-- <app-sql-validate-error-dialog-component *ngIf="!ValidatePostResponse.query" [tableObj] = "GetValidateResponseString()"></app-sql-validate-error-dialog-component> -->
</div>
</div>
<div class="card-footer" style="width: 800px;">
- <button style="font-size: 17px;" (click)="closeValidateModal()" class="btn btn-alt btn-small">Close</button>
+ <button (click)="closeValidateModal()" class="btn btn-alt btn-small" style="font-size: 17px;">Close
+ </button>
</div>
</div>
- </div>
+ </div>
</app-sql-validate-changes-dialog-component>
-<app-form-fields-add-edit [(visible)]="showDialog" >
- <div class="card">
- <div class="card-header">
- <div class="modalTitle">Report Form Field - Edit</div>
- <button *ngIf="closable" (click)="close()" aria-label="Close" class="dialog__close-btn">X</button>
- <br/>
+<app-form-fields-add-edit [(visible)]="showDialog">
+ <div class="card">
+ <div class="card-header">
+ <div class="modalTitle">Report Form Field - Edit</div>
+ <button (click)="close()" *ngIf="closable" aria-label="Close" class="dialog__close-btn">X</button>
+ <br/>
+ </div>
+
+
+ <div class="card-body" style="width: 100px; height: 760px; ">
+ <div style="height:737px; overflow: scroll; overflow-x: hidden;">
+ <br/>
+ <br/>
+
+
+ <label class="defaultLabelFontSize">Field Name:</label><label><input [(ngModel)]="fieldName"
+ class="defaultFontSize" id="fieldName"
+ type="text"
+ value="{{fieldName}}"/></label>
+
+
+ <br/>
+ <br/>
+ <br/>
+ <div class="field-group">
+ <label>Field Type:</label>
+ <select [(ngModel)]="fieldType" class="browser-default custom-select defaultFontSize" id="fieldType"
+ required="required" value="{{fieldType}}">
+ <option class="defaultFontSize" selected>Select Field Type</option>
+ <option class="defaultFontSize" value="TEXT">Text Box</option>
+ <option class="defaultFontSize" value="TEXTAREA">TEXTAREA</option>
+ <option class="defaultFontSize" value="LIST_BOX">List Box</option>
+ <option class="defaultFontSize" value="LIST_MULTI_SELECT">Multi-select List Box</option>
+ <option class="defaultFontSize" value="HIDDEN">Hidden</option>
+ </select>
+ </div>
+ <br/>
+ <br/>
+
+ <div class="field-group">
+ <label>Visible:</label>
+ <select [(ngModel)]="visible" class="browser-default custom-select defaultFontSize" id="visible"
+ required="required" value="{{visible}}">
+ <option class="defaultFontSize" selected value="YES">YES</option>
+ <option class="defaultFontSize" value="NO">NO</option>
+ </select>
+ </div>
+
+ <br/>
+ <br/>
+ <div>
+ <label class="defaultLabelFontSize">Is used in Group By Clause?:</label>
+ <label class="defaultLabelFontSize" class="checkbox" for="groupFormField">
+ <input [(ngModel)]="groupFormField" class="ng-valid ng-dirty ng-valid-parse ng-touched" id="groupFormField"
+ type="checkbox" value="{{groupFormField}}"><i class="skin"></i><span></span>
+ </label>
+ </div>
+
+ <br/>
+ <br/>
+ <div>
+ <label class="defaultLabelFontSize">SQL as Default Value:</label>
+ <label class="defaultLabelFontSize" class="checkbox" for="isDefaultSql">
+ <input [(ngModel)]="isDefaultSql" class="ng-valid ng-dirty ng-valid-parse ng-touched" id="isDefaultSql"
+ type="checkbox" value="{{isDefaultSql}}"><i class="skin"></i><span></span>
+ </label>
+ </div>
+
+ <div *ngIf="isDefaultSql">
+ <br/>
+ <br/>
+ <div class="field-group">
+ <label>Default SQL:</label>
+ <textarea [(ngModel)]="fieldDefaultSQL" class="defaultFontSize" id="fieldDefaultSQL"
+ type="textarea" value="{{fieldDefaultSQL}}"></textarea>
+ <div class="center">
+ <button (click)="verify('Default')" class="btn btn-alt btn-small" style="font-size: 17px;">
+ Verify
+ </button>
</div>
-
-
- <div class="card-body" style="width: 1000px; height: 760px; ">
- <div style="height:737px; overflow: scroll; overflow-x: hidden;">
- <br/>
- <br/>
-
-
- <label class="defaultLabelFontSize">Field Name:</label><label><input class="defaultFontSize" id="fieldName" type="text" [(ngModel)]="fieldName" value="{{fieldName}}"/></label>
-
-
-
- <br/>
- <br/>
- <br/>
- <div class="field-group">
- <label>Field Type:</label>
- <select class="browser-default custom-select defaultFontSize" id="fieldType" required="required" [(ngModel)]="fieldType" value="{{fieldType}}">
- <option class="defaultFontSize" selected>Select Field Type </option>
- <option class="defaultFontSize" value="TEXT">Text Box</option>
- <option class="defaultFontSize" value="TEXTAREA">TEXTAREA</option>
- <option class="defaultFontSize" value="LIST_BOX">List Box</option>
- <option class="defaultFontSize" value="LIST_MULTI_SELECT">Multi-select List Box</option>
- <option class="defaultFontSize" value="HIDDEN">Hidden</option>
- </select>
- </div>
- <br/>
- <br/>
-
- <div class="field-group">
- <label>Visible:</label>
- <select class="browser-default custom-select defaultFontSize" id="visible" required="required" [(ngModel)]="visible" value="{{visible}}">
- <option class="defaultFontSize" value="YES" selected>YES</option>
- <option class="defaultFontSize" value="NO">NO</option>
- </select>
- </div>
-
- <br/>
- <br/>
- <div>
- <label class="defaultLabelFontSize">Is used in Group By Clause?:</label>
- <label class="defaultLabelFontSize" for="groupFormField" class="checkbox">
- <input id="groupFormField" type="checkbox" class="ng-valid ng-dirty ng-valid-parse ng-touched" [(ngModel)]="groupFormField" value="{{groupFormField}}"><i class="skin"></i><span></span>
- </label>
- </div>
-
- <br/>
- <br/>
- <div>
- <label class="defaultLabelFontSize">SQL as Default Value:</label>
- <label class="defaultLabelFontSize" for="isDefaultSql" class="checkbox">
- <input id="isDefaultSql" type="checkbox" class="ng-valid ng-dirty ng-valid-parse ng-touched" [(ngModel)]="isDefaultSql" value="{{isDefaultSql}}"><i class="skin"></i><span></span>
- </label>
- </div>
-
- <div *ngIf="isDefaultSql">
- <br/>
- <br/>
- <div class="field-group">
- <label>Default SQL:</label>
- <textarea class="defaultFontSize" id="fieldDefaultSQL" type="textarea" [(ngModel)]="fieldDefaultSQL" value="{{fieldDefaultSQL}}"></textarea>
- <button style="font-size: 17px;" (click)="verify('Default')" class="btn btn-alt btn-small">Verify</button>
-
- </div>
- </div>
- <br/>
- <div *ngIf="(fieldDefaultSQL == null || fieldDefaultSQL == '') && isDefaultSql == false">
- <label class="defaultLabelFontSize" >Default Value:</label>
- <label><input class="defaultFontSize" id="defaultValue" type="text" [(ngModel)]="defaultValue" value="{{defaultValue}}"/></label>
-
-
- </div>
- <br/>
- <br/>
- <br/>
- <div class="field-group">
- <label>Verify Field Value As:</label>
- <select class="browser-default custom-select defaultFontSize" id="validationType" required="required" [(ngModel)]="validationType" value="{{validationType}}">
- <option class="defaultFontSize" value="" selected>Select Visibility </option>
- <option class="defaultFontSize" value="">Do Not Perform Validation</option>
- <option class="defaultFontSize" value="INTEGER">Integer</option>
- <option class="defaultFontSize" value="POSITIVE_INTEGER">Positive Integer</option>
- <option class="defaultFontSize" value="DATE">Date</option>
- <option class="defaultFontSize" value="TIMESTAMP_SEC">Timestamp(Hour, Min, Sec)</option>
- <option class="defaultFontSize" value="TIMESTAMP_MIN">Timestamp(Hour, Min)</option>
- <option class="defaultFontSize" value="TIMESTAMP_HOUR">Timestamp(Hour)</option>
- <option class="defaultFontSize" value="NON_NEGATIVE_INTEGER">Positive Integer Can not Be Zero</option>
- <option class="defaultFontSize" value="FLOAT">Any Number</option>
- <option class="defaultFontSize" value="NON_NEGATIVE_FLOAT">Positive Number</option>
- <option class="defaultFontSize" value="POSITIVE_FLOAT">Positive Number Can Not Be Zero</option>
- </select>
- </div>
- <br/>
- <br/>
- <div class="field-group">
- <label>SQL Generating Custom List of Values:</label>
- <textarea class="defaultFontSize" id="fieldSQL" type="textarea" [(ngModel)]="fieldSQL" value="{{fieldSQL}}"></textarea>
- <button style="font-size: 17px;" (click)="verify('Regular')" class="btn btn-alt btn-small">Verify</button>
- </div>
- <br/>
- <br/>
- <div>
- <label class="defaultLabelFontSize">Provide Predefined List of Values: Do not use Predefined list - Generate list from database:</label><label><input class="defaultFontSize" id="predefinedValue" type="text" [(ngModel)]="predefinedValue" value="{{predefinedValue}}"/></label>
- <button style="font-size: 17px;" (click)="addToList(predefinedValue)" class="btn btn-alt btn-small">Add to List</button>
- </div>
- <br/>
- <br/>
-
- <div>
- <div *ngFor="let value of predefinedValueList">
- <div style="margin-left: 5px;">
- <label >{{value.name}}</label>
- <mat-icon aria-hidden="false" aria-label="delete" (click)="deleteFromList(value.id)">delete</mat-icon>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="card-footer" style="width: 1000px; height: 65px; padding-left: 770px;">
- <button style="font-size: 17px;" *ngIf="!showConfirmButton" (click)="save();" class="btn btn-alt btn-small">Save</button>&nbsp;
- <button style="font-size: 17px;" *ngIf="showConfirmButton" (click)="complete();" class="btn btn-alt btn-small">Confirm</button>&nbsp;&nbsp;
- <button style="font-size: 17px;" (click)="close()" class="btn btn-alt btn-small">Cancel</button>
- </div>
-
-
+ </div>
</div>
-</app-form-fields-add-edit>
+ <br/>
+ <div *ngIf="(fieldDefaultSQL == null || fieldDefaultSQL == '') && isDefaultSql == false">
+ <label class="defaultLabelFontSize">Default Value:</label>
+ <label><input [(ngModel)]="defaultValue" class="defaultFontSize" id="defaultValue" type="text"
+ value="{{defaultValue}}"/></label>
-<div class="stdForm">
- <br/>
- <div class="tab-content">
- <h3>Step 4 - Report Form Fields</h3>
-
+ </div>
+ <br/>
+ <br/>
+ <br/>
+ <div class="field-group">
+ <label>Verify Field Value As:</label>
+ <select [(ngModel)]="validationType" class="browser-default custom-select defaultFontSize"
+ id="validationType" required="required" value="{{validationType}}">
+ <option class="defaultFontSize" selected value="">Select Visibility</option>
+ <option class="defaultFontSize" value="">Do Not Perform Validation</option>
+ <option class="defaultFontSize" value="INTEGER">Integer</option>
+ <option class="defaultFontSize" value="POSITIVE_INTEGER">Positive Integer</option>
+ <option class="defaultFontSize" value="DATE">Date</option>
+ <option class="defaultFontSize" value="TIMESTAMP_SEC">Timestamp(Hour, Min, Sec)</option>
+ <option class="defaultFontSize" value="TIMESTAMP_MIN">Timestamp(Hour, Min)</option>
+ <option class="defaultFontSize" value="TIMESTAMP_HOUR">Timestamp(Hour)</option>
+ <option class="defaultFontSize" value="NON_NEGATIVE_INTEGER">Positive Integer Can not Be Zero
+ </option>
+ <option class="defaultFontSize" value="FLOAT">Any Number</option>
+ <option class="defaultFontSize" value="NON_NEGATIVE_FLOAT">Positive Number</option>
+ <option class="defaultFontSize" value="POSITIVE_FLOAT">Positive Number Can Not Be Zero</option>
+ </select>
+ </div>
+ <br/>
+ <br/>
+ <div class="field-group">
+ <label>SQL Generating Custom List of Values:</label>
+ <textarea [(ngModel)]="fieldSQL" class="defaultFontSize" id="fieldSQL" type="textarea"
+ value="{{fieldSQL}}"></textarea>
+ <div class="center">
+ <button (click)="verify('Regular')" class="btn btn-alt btn-small"
+ style="font-size: 17px;">Verify
+ </button>
+ </div>
+ </div>
+ <br/>
+ <br/>
+ <div>
+ <label class="defaultLabelFontSize">Provide Predefined List of Values: Do not use Predefined list -
+ Generate list from database:</label><label><input [(ngModel)]="predefinedValue" class="defaultFontSize"
+ id="predefinedValue" type="text"
+ value="{{predefinedValue}}"/></label>
+ <button (click)="addToList(predefinedValue)" class="btn btn-alt btn-small" style="font-size: 17px;">
+ Add to List
+ </button>
+ </div>
+ <br/>
+ <br/>
+
+ <div>
+ <div *ngFor="let value of predefinedValueList">
+ <div style="margin-left: 5px;">
+ <label>{{value.name}}</label>
+ <mat-icon (click)="deleteFromList(value.id)" aria-hidden="false" aria-label="delete">
+ delete
+ </mat-icon>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
- <br/>
- <br/>
- <h4>Form Field Groups</h4>
- <br/>
- <div *ngFor="let group of Groups">
- <button class="formFieldGroupButton" mat-button >{{group.name}}</button><mat-icon style="margin-left: 21%;" aria-hidden="false" aria-label="delete" (click)="deleteGroup(group.name)">delete</mat-icon>
- <table style="margin-top: 10px;" class="app-data-table">
-
- <th class="defaultFontSize">Order Number</th>
- <th class="defaultFontSize">Field Name</th>
- <th class="defaultFontSize">Delete From Group</th>
-
- <tr *ngFor="let item of group.formFieldList; let i = index;">
- <td>
- {{item.orderSeq}}
- </td>
- <td>
- {{item.name}}
- </td>
- <td>
- <mat-icon aria-hidden="false" aria-label="delete" (click)="deleteFromGroup(item.id)">delete</mat-icon>
- </td>
- </tr>
-
- </table>
- <br/>
+ <div class="card-footer" style="width: 1000px; height: 65px; padding-left: 770px;">
+ <button (click)="save();" *ngIf="!showConfirmButton" class="btn btn-alt btn-small" style="font-size: 17px;">
+ Save
+ </button>&nbsp;
+ <button (click)="complete();" *ngIf="showConfirmButton" class="btn btn-alt btn-small"
+ style="font-size: 17px;">Confirm
+ </button>&nbsp;&nbsp;
+ <button (click)="close()" class="btn btn-alt btn-small" style="font-size: 17px;">Cancel</button>
</div>
+
+
+ </div>
+</app-form-fields-add-edit>
+
+
+<div class="stdForm">
+ <br/>
+ <div class="tab-content">
+ <h3>Step 4 - Report Form Fields</h3>
+
+ </div>
+ <span *ngIf="showSpinner" class="ecomp-spinner"></span>
+ <br/>
+ <br/>
+
+ <h4>Form Field Groups</h4>
+ <br/>
+ <div *ngFor="let group of Groups">
+ <button class="formFieldGroupButton" mat-button>{{group.name}}</button>
+ <mat-icon (click)="deleteGroup(group.name)" aria-hidden="false" aria-label="delete" style="margin-left: 21%;">
+ delete
+ </mat-icon>
+ <mat-icon (click)="editGroup(group)" aria-hidden="false" aria-label="edit" class="edit-group">edit</mat-icon>
+ <table class="app-data-table" style="margin-top: 10px;">
+
+ <th class="defaultFontSize">Order Number</th>
+ <th class="defaultFontSize">Field Name</th>
+ <th class="defaultFontSize">Delete From Group</th>
+
+ <tr *ngFor="let item of group.formFieldList; let i = index;">
+ <td>
+ {{item.orderSeq}}
+ </td>
+ <td>
+ {{item.name}}
+ </td>
+ <td>
+ <mat-icon (click)="deleteFromGroup(item.id)" aria-hidden="false" aria-label="delete">delete
+ </mat-icon>
+ </td>
+ </tr>
+
+ </table>
<br/>
- <div class="field-group">
+ </div>
+ <br/>
+ <div class="field-group">
<table style="width: auto; margin-left: 70%;">
- <tr>
- <td><button style="font-size: 17px;" class="btn btn-alt btn-small" (click)="createGroup()" >Create Group</button></td>
- <td><button style="font-size: 17px;" class="btn btn-alt btn-small" (click)="saveFormFieldGroups()" >Save Group</button></td>
- </tr>
+ <tr>
+ <td>
+ <button (click)="createGroup()" class="btn btn-alt btn-small" style="font-size: 17px;">Create
+ Group
+ </button>
+ </td>
+ <td>
+ <button (click)="saveFormFieldGroups()" class="btn btn-alt btn-small" style="font-size: 17px;">Save
+ Group
+ </button>
+ </td>
+ </tr>
</table>
+ </div>
+ <br/>
+ <h4>Form Field List</h4>
+ <div *ngIf="!showSpinner">
+
+ <table class="app-data-table" style="margin-top: 10px;">
+
+ <th class="defaultFontSize">Order Number</th>
+ <th class="defaultFontSize">Field Name</th>
+ <th class="defaultFontSize">Edit</th>
+ <th class="defaultFontSize">Delete</th>
+
+ <tr *ngFor="let item of formFieldsListObj; let i = index;">
+ <td>
+ {{item.orderSeq}}
+ </td>
+ <td>
+ {{item.name}}
+ </td>
+ <td>
+ <mat-icon (click)="edit(item.id); setDisplayMode('Edit');" aria-hidden="false" aria-label="edit">
+ edit
+ </mat-icon>
+ </td>
+ <td>
+ <mat-icon (click)="delete(item.id)" aria-hidden="false" aria-label="delete">delete</mat-icon>
+ </td>
+ </tr>
+
+ </table>
+ <br/>
+
+ <div class="field-group">
+ <button (click)="add(); setDisplayMode('Add');" class="btn btn-alt btn-small"
+ style="font-size: 17px; margin-left: 80%;">Add
+ </button>
</div>
<br/>
- <h4>Form Field List</h4>
- <div *ngIf="!showSpinner">
-
- <table style="margin-top: 10px;" class="app-data-table">
-
- <th class="defaultFontSize">Order Number</th>
- <th class="defaultFontSize">Field Name</th>
- <th class="defaultFontSize">Edit</th>
- <th class="defaultFontSize">Order</th>
- <th class="defaultFontSize">Delete</th>
-
- <tr *ngFor="let item of formFieldsListObj; let i = index;">
- <td>
- {{item.orderSeq}}
- </td>
- <td>
- {{item.name}}
- </td>
- <td>
- <mat-icon aria-hidden="false" aria-label="edit" (click)="edit(item.id); setDisplayMode('Edit');">edit</mat-icon>
- </td>
- <td>
- <mat-icon *ngIf="!isFirst(i)" aria-hidden="false" aria-label="expand_less" (click)="moveUpward(i)">expand_less</mat-icon>
- <mat-icon *ngIf="!isLast(i)" aria-hidden="false" aria-label="expand_more" (click)="moveDownward(i)">expand_more</mat-icon>
- </td>
- <td>
- <mat-icon aria-hidden="false" aria-label="delete" (click)="delete(item.id)">delete</mat-icon>
- </td>
- </tr>
-
- </table>
- <br/>
-
- <div class="field-group">
- <button style="font-size: 17px; margin-left: 80%;" class="btn btn-alt btn-small" (click)="add(); setDisplayMode('Add');" >Add</button>
- </div>
- <br/>
- <hr/>
- </div>
+ <hr/>
</div>
+</div>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts
index e3bab3bb..e8a60849 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts
@@ -1,644 +1,629 @@
-import { Component, OnInit, Input, Inject } from '@angular/core';
-import { FormFieldsService } from './form-fields.service';
-import { MatDialog, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
-import { Observable } from 'rxjs';
-import { MatSnackBar } from '@angular/material/snack-bar';
+import {Component, OnInit, Input, Inject} from '@angular/core';
+import {FormFieldsService} from './form-fields.service';
+import {MatDialog, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
+import {Observable} from 'rxjs';
+import {MatSnackBar} from '@angular/material/snack-bar';
export interface DialogData {
- animal: string;
- name: string;
+ name: string;
}
@Component({
- selector: 'app-form-fields',
- templateUrl: './form-fields.component.html',
- styleUrls: ['./form-fields.component.css']
+ selector: 'app-form-fields',
+ templateUrl: './form-fields.component.html',
+ styleUrls: ['./form-fields.component.css']
})
export class FormFieldsComponent implements OnInit {
- @Input("reportId") reportId1 : string;
-
- formFieldsListObj : any[];
- postMoveUpwrdObj : {};
- postDownwardObj : {};
- orderSeqOfDown : number;
- orderSeqOfUp : number;
- showDialog : boolean;
- closable : boolean;
- sqlAsDefaultValue : Boolean;
- showDefaultSQLOption : boolean;
- verifyFieldValueAs : number;
- predefinedValueList : any[];
- predefinedValue : string;
- tabId : string;
- tabName : string;
- validationType : string;
- visible : string;
- orderSeq : number;
- message : any;
- groupFormField : boolean;
- fieldType : string;
- fieldSQL : string;
- fieldName : string;
- fieldId : string;
- fieldDefaultSQL : string;
- errorStackTrace : any;
- errorMessage : any;
- defaultValue : any;
- finalPOSTObj : any;
- mode : string;
- showSpinner : boolean;
- showDialog1 : boolean;
- queryObj : {};
- validateResponseString : string;
- showVerifySpinner : boolean;
- Groups : {}[] = [];
- isDefaultSql : boolean;
-
-
-
- constructor(private _formFieldsService : FormFieldsService, public dialog: MatDialog, private _snackBar: MatSnackBar) {
- this.formFieldsListObj = new Array();
- this.postMoveUpwrdObj = new Object();
- this.postDownwardObj = new Object();
- this.showDialog = false;
- this.showDefaultSQLOption = false;
- this.closable = true;
- this.predefinedValueList = new Array();
- this.finalPOSTObj = new Object();
- this.showSpinner = false;
- this.showDialog1 = false;
- this.queryObj = {};
- this.showVerifySpinner = false;
- this.Groups = new Array();
- this.isDefaultSql = false;
- }
-
- ngOnInit() {
- this.showSpinner = true;
- this._formFieldsService.getListOfFormFields()
- .subscribe((responseFormFields) => {
- this.showSpinner = true;
- for (let m = 0; m < responseFormFields.length; m++) {
- responseFormFields[m]["orderSeq"] = m + 1;
- this.formFieldsListObj.push(responseFormFields[m]);
- }
+ @Input('reportId') reportId1: string;
+
+ formFieldsListObj: any[];
+ postMoveUpwrdObj: {};
+ postDownwardObj: {};
+ orderSeqOfDown: number;
+ orderSeqOfUp: number;
+ showDialog: boolean;
+ closable: boolean;
+ sqlAsDefaultValue: Boolean;
+ showDefaultSQLOption: boolean;
+ verifyFieldValueAs: number;
+ predefinedValueList: any[];
+ predefinedValue: string;
+ tabId: string;
+ tabName: string;
+ validationType: string;
+ visible: string;
+ orderSeq: number;
+ message: any;
+ groupFormField: boolean;
+ fieldType: string;
+ fieldSQL: string;
+ fieldName: string;
+ fieldId: string;
+ fieldDefaultSQL: string;
+ errorStackTrace: any;
+ errorMessage: any;
+ defaultValue: any;
+ finalPOSTObj: any;
+ mode: string;
+ showSpinner: boolean;
+ showDialog1: boolean;
+ queryObj: {};
+ validateResponseString: string;
+ showVerifySpinner: boolean;
+ Groups: {}[] = [];
+ isDefaultSql: boolean;
+ showConfirmButton: boolean;
+
+
+ constructor(private _formFieldsService: FormFieldsService, public dialog: MatDialog, private _snackBar: MatSnackBar) {
+ this.formFieldsListObj = [];
+ this.postMoveUpwrdObj = {};
+ this.postDownwardObj = {};
+ this.showDialog = false;
+ this.showDefaultSQLOption = false;
+ this.closable = true;
+ this.predefinedValueList = [];
+ this.finalPOSTObj = {};
this.showSpinner = false;
- this._formFieldsService.getFormFieldGroupsData(this.reportId1)
- .subscribe((responseGroupsData) => {
- this.showSpinner = true;
- this.Groups = JSON.parse(responseGroupsData["formFieldGroupsJSON"]);
- this.showSpinner = false;
- });
- });
- }
-
-
- isLast( n : number)
- {
- if(n == this.formFieldsListObj.length-1)
- {
- return true;
+ this.showDialog1 = false;
+ this.queryObj = {};
+ this.showVerifySpinner = false;
+ this.Groups = [];
+ this.isDefaultSql = false;
}
- else
- {
- return false;
+
+ ngOnInit() {
+ this._formFieldsService.getListOfFormFields()
+ .subscribe((responseFormFields) => {
+ for (let m = 0; m < responseFormFields.length; m++) {
+ responseFormFields[m]['orderSeq'] = m + 1;
+ this.formFieldsListObj.push(responseFormFields[m]);
+ }
+
+ this._formFieldsService.getFormFieldGroupsData(this.reportId1)
+ .subscribe((responseGroupsData) => {
+ this.Groups = JSON.parse(responseGroupsData['formFieldGroupsJSON']);
+ });
+ });
}
- }
- isFirst( n : number)
- {
- if(n == 0)
- {
- return true;
+
+ isLast(n: number) {
+ if (n == this.formFieldsListObj.length - 1) {
+ return true;
+ } else {
+ return false;
+ }
}
- else
- {
- return false;
+
+ isFirst(n: number) {
+ if (n == 0) {
+ return true;
+ } else {
+ return false;
+ }
}
- }
-
-
- moveUpward( n : number)
- {
- this.showSpinner = true;
-
- this._formFieldsService.getFormFieldData(this.formFieldsListObj[n]["id"])
- .subscribe((responseGetFormFieldn) => {
- this.postMoveUpwrdObj = responseGetFormFieldn;
-
- this._formFieldsService.getFormFieldData(this.formFieldsListObj[n-1]["id"])
- .subscribe((responseGetFormFieldnmin1) => {
- this.postDownwardObj = responseGetFormFieldnmin1;
-
- this.orderSeqOfDown = this.postMoveUpwrdObj["orderSeq"];
- this.orderSeqOfUp = this.postDownwardObj["orderSeq"];
-
- this.postMoveUpwrdObj["orderSeq"] = this.orderSeqOfUp;
- this.postDownwardObj["orderSeq"] = this.orderSeqOfDown;
-
- console.log(this.postDownwardObj);
- console.log(this.postMoveUpwrdObj);
- this.postMoveUpwrdObj["lastUpdatedFieldId"] = this.postDownwardObj["fieldId"];
- this.postDownwardObj["lastUpdatedFieldId"] = this.postMoveUpwrdObj["fieldId"];
-
- this._formFieldsService.postFormFieldData(this.postDownwardObj, this.reportId1)
- .subscribe((responsePostn) => {
- if(responsePostn["message"])
- {
- this._formFieldsService.postFormFieldData(this.postMoveUpwrdObj, this.reportId1)
- .subscribe((responsePostnmin1) => {
- if(responsePostnmin1["message"])
- {
-
- this.formFieldsListObj = [];
- this._formFieldsService.getListOfFormFields()
- .subscribe((finalListResponse) => {
- for(let k=0; k<finalListResponse.length; k++)
- {
- // this.formFieldsListObj.push(finalListResponse[k]);
- for(let m=0; m<finalListResponse.length; m++)
- {
- if(finalListResponse[m]["orderSeq"] == k+1)
- {
- this.formFieldsListObj.push(finalListResponse[m]);
- }
- }
- }
- this.showSpinner = false;
- });
- }
- });
- }
- });
- });
- });
-
-
-
- }
-
- moveDownward( n : number)
- {
- this.showSpinner = true;
-
- this._formFieldsService.getFormFieldData(this.formFieldsListObj[n]["id"])
- .subscribe((responseGetFormFieldn) => {
- this.postMoveUpwrdObj = responseGetFormFieldn;
-
- this._formFieldsService.getFormFieldData(this.formFieldsListObj[n+1]["id"])
- .subscribe((responseGetFormFieldnmin1) => {
- this.postDownwardObj = responseGetFormFieldnmin1;
-
- this.orderSeqOfDown = this.postMoveUpwrdObj["orderSeq"];
- this.orderSeqOfUp = this.postDownwardObj["orderSeq"];
-
- this.postMoveUpwrdObj["orderSeq"] = this.orderSeqOfUp;
- this.postDownwardObj["orderSeq"] = this.orderSeqOfDown;
-
- console.log(this.postDownwardObj);
- console.log(this.postMoveUpwrdObj);
-
- this.postMoveUpwrdObj["lastUpdatedFieldId"] = this.postDownwardObj["fieldId"];
- this.postDownwardObj["lastUpdatedFieldId"] = this.postMoveUpwrdObj["fieldId"];
-
- this._formFieldsService.postFormFieldData(this.postDownwardObj, this.reportId1)
- .subscribe((responsePostn) => {
- if(responsePostn["message"])
- {
- this._formFieldsService.postFormFieldData(this.postMoveUpwrdObj, this.reportId1)
- .subscribe((responsePostnmin1) => {
- if(responsePostnmin1["message"])
- {
-
- this.formFieldsListObj = [];
- this._formFieldsService.getListOfFormFields()
- .subscribe((finalListResponse) => {
- for(let k=0; k<finalListResponse.length; k++)
- {
- // this.formFieldsListObj.push(finalListResponse[k]);
- for(let m=0; m<finalListResponse.length; m++)
- {
- if(finalListResponse[m]["orderSeq"] == k+1)
- {
- this.formFieldsListObj.push(finalListResponse[m]);
- }
- }
- }
- this.showSpinner = false;
- });
- }
- });
- }
-
+ moveUpward(n: number) {
+ this.showSpinner = true;
+
+ this._formFieldsService.getFormFieldData(this.formFieldsListObj[n]['id'])
+ .subscribe((responseGetFormFieldn) => {
+ this.postMoveUpwrdObj = responseGetFormFieldn;
+
+ this._formFieldsService.getFormFieldData(this.formFieldsListObj[n - 1]['id'])
+ .subscribe((responseGetFormFieldnmin1) => {
+ this.postDownwardObj = responseGetFormFieldnmin1;
+
+ this.orderSeqOfDown = this.postMoveUpwrdObj['orderSeq'];
+ this.orderSeqOfUp = this.postDownwardObj['orderSeq'];
+
+ this.postMoveUpwrdObj['orderSeq'] = this.orderSeqOfUp;
+ this.postDownwardObj['orderSeq'] = this.orderSeqOfDown;
+
+ console.log(this.postDownwardObj);
+ console.log(this.postMoveUpwrdObj);
+ this.postMoveUpwrdObj['lastUpdatedFieldId'] = this.postDownwardObj['fieldId'];
+ this.postDownwardObj['lastUpdatedFieldId'] = this.postMoveUpwrdObj['fieldId'];
+
+ this._formFieldsService.postFormFieldData(this.postDownwardObj, this.reportId1)
+ .subscribe((responsePostn) => {
+ if (responsePostn['message']) {
+ this._formFieldsService.postFormFieldData(this.postMoveUpwrdObj, this.reportId1)
+ .subscribe((responsePostnmin1) => {
+ if (responsePostnmin1['message']) {
+
+ this.formFieldsListObj = [];
+ this._formFieldsService.getListOfFormFields()
+ .subscribe((finalListResponse) => {
+ for (let k = 0; k < finalListResponse.length; k++) {
+ // this.formFieldsListObj.push(finalListResponse[k]);
+ for (let m = 0; m < finalListResponse.length; m++) {
+ if (finalListResponse[m]['orderSeq'] == k + 1) {
+ this.formFieldsListObj.push(finalListResponse[m]);
+ }
+ }
+ }
+ this.showSpinner = false;
+ });
+ }
+ });
+ }
+ });
+
});
+ });
+
+
+ }
+
+ moveDownward(n: number) {
+ this.showSpinner = true;
+
+ this._formFieldsService.getFormFieldData(this.formFieldsListObj[n]['id'])
+ .subscribe((responseGetFormFieldn) => {
+ this.postMoveUpwrdObj = responseGetFormFieldn;
+
+ this._formFieldsService.getFormFieldData(this.formFieldsListObj[n + 1]['id'])
+ .subscribe((responseGetFormFieldnmin1) => {
+ this.postDownwardObj = responseGetFormFieldnmin1;
+
+ this.orderSeqOfDown = this.postMoveUpwrdObj['orderSeq'];
+ this.orderSeqOfUp = this.postDownwardObj['orderSeq'];
+
+ this.postMoveUpwrdObj['orderSeq'] = this.orderSeqOfUp;
+ this.postDownwardObj['orderSeq'] = this.orderSeqOfDown;
+
+ console.log(this.postDownwardObj);
+ console.log(this.postMoveUpwrdObj);
+
+ this.postMoveUpwrdObj['lastUpdatedFieldId'] = this.postDownwardObj['fieldId'];
+ this.postDownwardObj['lastUpdatedFieldId'] = this.postMoveUpwrdObj['fieldId'];
+
+ this._formFieldsService.postFormFieldData(this.postDownwardObj, this.reportId1)
+ .subscribe((responsePostn) => {
+ if (responsePostn['message']) {
+ this._formFieldsService.postFormFieldData(this.postMoveUpwrdObj, this.reportId1)
+ .subscribe((responsePostnmin1) => {
+ if (responsePostnmin1['message']) {
+
+ this.formFieldsListObj = [];
+ this._formFieldsService.getListOfFormFields()
+ .subscribe((finalListResponse) => {
+ for (let k = 0; k < finalListResponse.length; k++) {
+ // this.formFieldsListObj.push(finalListResponse[k]);
+ for (let m = 0; m < finalListResponse.length; m++) {
+ if (finalListResponse[m]['orderSeq'] == k + 1) {
+ this.formFieldsListObj.push(finalListResponse[m]);
+ }
+ }
+ }
+ this.showSpinner = false;
+ });
+ }
+ });
+ }
+
+ });
- });
+ });
});
- }
+ }
+
+ ngDoCheck() {
+ if (this.sqlAsDefaultValue) {
+ this.showDefaultSQLOption = true;
+ } else {
+ this.showDefaultSQLOption = false;
+ }
- ngDoCheck()
- {
- if(this.sqlAsDefaultValue)
- {
- this.showDefaultSQLOption = true;
}
- else
- {
- this.showDefaultSQLOption = false;
+
+ setDisplayMode(displayMode: string) {
}
-
- }
-
- setDisplayMode(displayMode : string)
- {
- }
-
- edit(id : string)
- {
- this._formFieldsService.getFormFieldData(id)
- .subscribe((responseFormFieldData) => {
- this.validationType = responseFormFieldData["validationType"];
-
- if(responseFormFieldData["visible"] === true)
- {
- this.visible = "YES";
- }
- else
- {
- this.visible = "NO";
- }
-
- this.orderSeq = responseFormFieldData["orderSeq"];
- this.message = responseFormFieldData["message"];
- this.groupFormField = responseFormFieldData["groupFormField"];
- this.fieldType = responseFormFieldData["fieldType"];
- this.fieldSQL = responseFormFieldData["fieldSQL"];
- this.fieldName = responseFormFieldData["fieldName"];
- this.fieldId = responseFormFieldData["fieldId"];
- this.fieldDefaultSQL = responseFormFieldData["fieldDefaultSQL"];
- this.errorStackTrace = responseFormFieldData["errorStackTrace"];
- this.errorMessage = responseFormFieldData["errorMessage"];
- this.defaultValue = responseFormFieldData["defaultValue"] ;
- if(this.fieldDefaultSQL != null || this.fieldDefaultSQL != "")
- this.isDefaultSql = true;
- else
- this.isDefaultSql = false;
-
- if(this.defaultValue == null || this.defaultValue == "")
- this.isDefaultSql = true;
- else
- this.isDefaultSql = false;
-
- if ((this.fieldDefaultSQL == null || this.fieldDefaultSQL == "") && (this.defaultValue == null || this.defaultValue == ""))
- this.isDefaultSql = false;
-
- if(responseFormFieldData["predefinedValueList"] == null)
- {
+
+ editGroup(group: any) {
+ this.openEditDialog(group);
+ }
+
+ edit(id: string) {
+ this._formFieldsService.getFormFieldData(id)
+ .subscribe((responseFormFieldData) => {
+ this.validationType = responseFormFieldData['validationType'];
+
+ if (responseFormFieldData['visible'] === true) {
+ this.visible = 'YES';
+ } else {
+ this.visible = 'NO';
+ }
+
+ this.orderSeq = responseFormFieldData['orderSeq'];
+ this.message = responseFormFieldData['message'];
+ this.groupFormField = responseFormFieldData['groupFormField'];
+ this.fieldType = responseFormFieldData['fieldType'];
+ this.fieldSQL = responseFormFieldData['fieldSQL'];
+ this.fieldName = responseFormFieldData['fieldName'];
+ this.fieldId = responseFormFieldData['fieldId'];
+ this.fieldDefaultSQL = responseFormFieldData['fieldDefaultSQL'];
+ this.errorStackTrace = responseFormFieldData['errorStackTrace'];
+ this.errorMessage = responseFormFieldData['errorMessage'];
+ this.defaultValue = responseFormFieldData['defaultValue'];
+ if (this.fieldDefaultSQL != null || this.fieldDefaultSQL != '') {
+ this.isDefaultSql = true;
+ } else {
+ this.isDefaultSql = false;
+ }
+
+ if (this.defaultValue == null || this.defaultValue == '') {
+ this.isDefaultSql = true;
+ } else {
+ this.isDefaultSql = false;
+ }
+
+ if ((this.fieldDefaultSQL == null || this.fieldDefaultSQL == '') && (this.defaultValue == null || this.defaultValue == '')) {
+ this.isDefaultSql = false;
+ }
+
+ if (responseFormFieldData['predefinedValueList'] == null) {
+ this.predefinedValueList = [];
+ } else {
+ this.predefinedValueList = responseFormFieldData['predefinedValueList'];
+ }
+
+ this.showDialog = true;
+ this.closable = true;
+ this.mode = 'Edit';
+ });
+
+ }
+
+ add() {
+ this.showDialog = true;
+ this.closable = true;
+ this.validationType = '';
+ this.visible = 'YES';
+ this.message = '';
+ this.groupFormField = false;
+ this.fieldType = '';
+ this.fieldSQL = '';
+ this.fieldName = '';
+ this.fieldId = '';
+ this.fieldDefaultSQL = '';
+ this.errorStackTrace = '';
+ this.errorMessage = '';
+ this.isDefaultSql = false;
this.predefinedValueList = [];
- }
- else
- {
- this.predefinedValueList = responseFormFieldData["predefinedValueList"];
- }
-
- this.showDialog = true;
- this.closable = true;
- this.mode = "Edit";
- });
-
- }
-
- add()
- {
- this.showDialog = true;
- this.closable = true;
- this.validationType = "";
- this.visible = "YES";
- this.message = "";
- this.groupFormField = false;
- this.fieldType = "";
- this.fieldSQL = "";
- this.fieldName = "";
- this.fieldId = "";
- this.fieldDefaultSQL = "";
- this.errorStackTrace = "";
- this.errorMessage = "";
- this.isDefaultSql = false;
- this.predefinedValueList = [];
- this.defaultValue="";
-
- this.showDialog = true;
- this.closable = true;
-
- this.mode = "Add";
-
- }
-
- close() {
- this.showDialog = !this.showDialog;
- this.closable = false;
-
- }
-
- closeValidateModal()
- {
- this.showDialog1 = !this.showDialog1;
- this.showVerifySpinner = false;
- }
-
- addToList( attrib : string)
- {
- this.predefinedValueList.push(
- {
- "id" : attrib,
- "name" : attrib,
- "selected" : false
- });
- }
-
- deleteFromList(attrib : string)
- {
-
- for(let k=0; k<this.predefinedValueList.length; k++)
- {
- if(this.predefinedValueList[k]["id"] == attrib)
- {
- this.predefinedValueList.splice(k, 1);
- }
+ this.defaultValue = '';
+
+ this.showDialog = true;
+ this.closable = true;
+
+ this.mode = 'Add';
+
+ }
+
+ close() {
+ this.showDialog = !this.showDialog;
+ this.closable = false;
+
}
- }
-
-
- save()
- {
- this.showSpinner = true;
- this.showDialog = false;
- this.finalPOSTObj["validationType"] = this.validationType;
-
- if(this.visible == "YES")
- {
- this.finalPOSTObj["visible"] = true;
- }
- else
- {
- this.finalPOSTObj["visible"] = false;
- }
-
- this.finalPOSTObj["orderSeq"] = this.orderSeq;
- this.finalPOSTObj["message"] = this.message;
- this.finalPOSTObj["groupFormField"] = this.groupFormField;
- this.finalPOSTObj["fieldType"] = this.fieldType;
- this.finalPOSTObj["fieldSQL"] = this.fieldSQL;
- this.finalPOSTObj["fieldName"] = this.fieldName;
- this.finalPOSTObj["fieldId"] = this.fieldId;
-
- this.finalPOSTObj["errorStackTrace"] = this.errorStackTrace;
- this.finalPOSTObj["errorMessage"] = this.errorMessage;
- this.finalPOSTObj["lastUpdatedFieldId"] = this.fieldId;
-
- this.finalPOSTObj["fieldDefaultSQL"] = this.fieldDefaultSQL;
-
- this.finalPOSTObj["defaultValue"] = this.defaultValue;
-
- if(this.fieldDefaultSQL != "" && this.fieldDefaultSQL != null)
- {
- this.finalPOSTObj["defaultValue"] = "";
- }
-
- this.finalPOSTObj["predefinedValueList"] = this.predefinedValueList;
-
- if(this.mode == "Edit")
- {
- this._formFieldsService.postFormFieldData(this.finalPOSTObj, this.reportId1)
- .subscribe((responsePost) => {
- if(responsePost["message"])
- {
- this._formFieldsService.getListOfFormFields()
- .subscribe((responseFormFields) => {
- this.formFieldsListObj = [];
- let m=0;
- while(responseFormFields[m])
+
+ closeValidateModal() {
+ this.showDialog1 = !this.showDialog1;
+ this.showVerifySpinner = false;
+ }
+
+ addToList(attrib: string) {
+ this.predefinedValueList.push(
{
- this.formFieldsListObj.push(responseFormFields[m]);
- m++;
+ 'id': attrib,
+ 'name': attrib,
+ 'selected': false
+ });
+ }
+
+ deleteFromList(attrib: string) {
+
+ for (let k = 0; k < this.predefinedValueList.length; k++) {
+ if (this.predefinedValueList[k]['id'] == attrib) {
+ this.predefinedValueList.splice(k, 1);
}
+ }
+ }
+
+
+ save() {
+ this.showSpinner = true;
+ this.showDialog = false;
+ this.finalPOSTObj['validationType'] = this.validationType;
+
+ if (this.visible == 'YES') {
+ this.finalPOSTObj['visible'] = true;
+ } else {
+ this.finalPOSTObj['visible'] = false;
+ }
+
+ this.finalPOSTObj['orderSeq'] = this.orderSeq;
+ this.finalPOSTObj['message'] = this.message;
+ this.finalPOSTObj['groupFormField'] = this.groupFormField;
+ this.finalPOSTObj['fieldType'] = this.fieldType;
+ this.finalPOSTObj['fieldSQL'] = this.fieldSQL;
+ this.finalPOSTObj['fieldName'] = this.fieldName;
+ this.finalPOSTObj['fieldId'] = this.fieldId;
+
+ this.finalPOSTObj['errorStackTrace'] = this.errorStackTrace;
+ this.finalPOSTObj['errorMessage'] = this.errorMessage;
+ this.finalPOSTObj['lastUpdatedFieldId'] = this.fieldId;
+
+ this.finalPOSTObj['fieldDefaultSQL'] = this.fieldDefaultSQL;
+
+ this.finalPOSTObj['defaultValue'] = this.defaultValue;
+
+ if (this.fieldDefaultSQL != '' && this.fieldDefaultSQL != null) {
+ this.finalPOSTObj['defaultValue'] = '';
+ }
+
+ this.finalPOSTObj['predefinedValueList'] = this.predefinedValueList;
+
+ if (this.mode == 'Edit') {
+ this._formFieldsService.postFormFieldData(this.finalPOSTObj, this.reportId1)
+ .subscribe((responsePost) => {
+ if (responsePost['message']) {
+ this._formFieldsService.getListOfFormFields()
+ .subscribe((responseFormFields) => {
+ this.formFieldsListObj = [];
+ let m = 0;
+ while (responseFormFields[m]) {
+ this.formFieldsListObj.push(responseFormFields[m]);
+ m++;
+ }
+
+
+ this.showSpinner = false;
-
- this.showSpinner = false;
-
- });
-
+ });
+
+ }
+ });
+ } else {
+ this._formFieldsService.addFormFieldData(this.finalPOSTObj, this.reportId1)
+ .subscribe((responsePost) => {
+ if (responsePost['message']) {
+ this._formFieldsService.getListOfFormFields()
+ .subscribe((responseFormFields) => {
+ this.formFieldsListObj = [];
+ let m = 0;
+ while (responseFormFields[m]) {
+ this.formFieldsListObj.push(responseFormFields[m]);
+ m++;
+ }
+
+ this.showSpinner = false;
+
+ });
+ }
+ });
}
- });
}
- else
- {
- this._formFieldsService.addFormFieldData(this.finalPOSTObj, this.reportId1)
- .subscribe((responsePost) => {
- if(responsePost["message"])
- {
- this._formFieldsService.getListOfFormFields()
- .subscribe((responseFormFields) => {
- this.formFieldsListObj = [];
- let m=0;
- while(responseFormFields[m])
- {
- this.formFieldsListObj.push(responseFormFields[m]);
- m++;
- }
- this.showSpinner = false;
-
- });
+ delete(id: string) {
+ this.showSpinner = true;
+ this._formFieldsService.deleteFormField(id)
+ .subscribe((responseDeleted) => {
+ if (responseDeleted['message'] == 'Formfield Deleted') {
+ this._formFieldsService.getListOfFormFields()
+ .subscribe((responseFormFields) => {
+ this.formFieldsListObj = [];
+ let m = 0;
+ while (responseFormFields[m]) {
+ this.formFieldsListObj.push(responseFormFields[m]);
+ m++;
+ }
+
+ this.showSpinner = false;
+
+ });
+ }
+ });
+ }
+
+ verify(SQLType: string) {
+ this.showVerifySpinner = true;
+ this.showDialog1 = true;
+ if (SQLType == 'Default') {
+ this.queryObj = {
+ query: this.fieldDefaultSQL
+ };
+ this._formFieldsService.verifySQL(this.queryObj)
+ .subscribe((responseDefaultSQL) => {
+ this.validateResponseString = responseDefaultSQL['data']['elements'];
+ this.showVerifySpinner = false;
+ });
+ } else {
+ this.queryObj = {
+ query: this.fieldSQL
+ };
+ this._formFieldsService.verifySQL(this.queryObj)
+ .subscribe((responseSQL) => {
+ this.validateResponseString = responseSQL['data']['elements'];
+ this.showVerifySpinner = false;
+ });
}
- });
+
}
- }
-
- delete( id : string)
- {
- this.showSpinner = true;
- this._formFieldsService.deleteFormField(id)
- .subscribe((responseDeleted) => {
- if(responseDeleted["message"] == "Formfield Deleted")
- {
- this._formFieldsService.getListOfFormFields()
- .subscribe((responseFormFields) => {
- this.formFieldsListObj = [];
- let m=0;
- while(responseFormFields[m])
- {
- this.formFieldsListObj.push(responseFormFields[m]);
- m++;
+
+ deleteFromGroup(formFieldId: String) {
+ for (let k = 0; k < this.Groups.length; k++) {
+ let element = this.Groups[k];
+ for (let l = 0; l < element["formFieldList"].length; l++) {
+ if (element['formFieldList'][l]['id'] == formFieldId) {
+ this.Groups[k]['formFieldList'].splice(l, 1);
+ }
}
+ }
+ }
- this.showSpinner = false;
-
- });
+ deleteGroup(groupName: string) {
+ for (let k = 0; k < this.Groups.length; k++) {
+ if (this.Groups[k]['name'] == groupName) {
+ this.Groups.splice(k, 1);
+ }
}
- })
- }
-
- verify( SQLType : string)
- {
- this.showVerifySpinner = true;
- this.showDialog1 = true;
- if(SQLType == "Default")
- {
- this.queryObj = {
- query : this.fieldDefaultSQL
- };
- this._formFieldsService.verifySQL(this.queryObj)
- .subscribe((responseDefaultSQL) => {
- this.validateResponseString = responseDefaultSQL["data"]["elements"];
- this.showVerifySpinner = false;
- });
}
- else
- {
- this.queryObj = {
- query : this.fieldSQL
- };
- this._formFieldsService.verifySQL(this.queryObj)
- .subscribe((responseSQL) => {
- this.validateResponseString = responseSQL["data"]["elements"];
- this.showVerifySpinner = false;
- });
+
+ createGroup() {
+ this.openDialog();
}
-
- }
-
- deleteFromGroup(formFieldId : String)
- {
- for(let k=0; k<this.Groups.length; k++)
- {
- let element = this.Groups[k];
- for(let l=0; l<element["formFieldList"].length; l++)
- {
- if(element["formFieldList"][l]["id"] == formFieldId)
- {
- this.Groups[k]["formFieldList"].splice(l, 1);
+
+ openDialog() {
+ const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
+ width: '400px',
+ height: '600px',
+ data: this.formFieldsListObj,
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+
+ let groupAlreadyExists = false;
+ if (this.Groups == null || this.Groups == undefined) {
+ this.Groups = [];
+ }
+ for (let k = 0; k < this.Groups.length; k++) {
+ if (this.Groups[k]['name'] == result['name']) {
+ groupAlreadyExists = true;
+ }
+ }
+
+
+ if (!groupAlreadyExists) {
+ let UpdatedResult = result;
+ for (let i = 0; i < result["formFieldList"].length; i++) {
+ let formFieldId = result['formFieldList'][i];
+ let j = 0;
+ while (this.formFieldsListObj[j]) {
+ if (this.formFieldsListObj[j]['id'] == formFieldId) {
+ UpdatedResult['formFieldList'][i] = this.formFieldsListObj[j];
+ }
+ j++;
+ }
+
+ }
+ if (this.Groups !== null || this.Groups !== undefined) {
+ this.Groups.push(UpdatedResult);
+ } else {
+ this.Groups = [];
+ this.Groups.push(UpdatedResult);
+ }
+
+ } else {
+ this.openSnackBar('Group Already Exists.', 'Try using another name!');
+ }
+
+
+ });
+ }
+
+
+ openEditDialog(groupInfo: any) {
+ const multiSelectArray = [];
+ for (let arr = 0; arr < groupInfo['formFieldList'].length; arr++) {
+ multiSelectArray.push(groupInfo['formFieldList'][arr]['id']);
}
- }
+ let editGroupInfo = {};
+ editGroupInfo['formFieldList'] = multiSelectArray;
+ editGroupInfo['name'] = groupInfo['name'];
+ const dialogRef = this.dialog.open(EditGroupDialog, {
+ width: '400px',
+ height: '600px',
+ data: {
+ formFieldsListObj: this.formFieldsListObj,
+ editGroupInfo: editGroupInfo
+ }
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+ for (let k = 0; k < this.Groups.length; k++) {
+ if (this.Groups[k]['name'] == editGroupInfo['name']) {
+ let UpdatedResult = editGroupInfo;
+ for (let i = 0; i < editGroupInfo["formFieldList"].length; i++) {
+ let formFieldId = editGroupInfo['formFieldList'][i];
+ let j = 0;
+ while (this.formFieldsListObj[j]) {
+ if (this.formFieldsListObj[j]['id'] == formFieldId) {
+ UpdatedResult['formFieldList'][i] = this.formFieldsListObj[j];
+ }
+ j++;
+ }
+
+ }
+
+ this.Groups[k]['formFieldList'] = UpdatedResult['formFieldList'];
+ }
+ }
+ });
}
- }
-
- deleteGroup(groupName : string)
- {
- for(let k=0; k<this.Groups.length; k++)
- {
- if(this.Groups[k]["name"] == groupName)
- {
- this.Groups.splice(k, 1);
- }
+
+
+ openSnackBar(message: string, action: string) {
+ this._snackBar.open(message, action, {
+ duration: 5000,
+ });
}
- }
-
- createGroup()
- {
- this.openDialog();
- }
-
- openDialog(){
- const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
- width: '400px',
- height: '600px',
- data: this.formFieldsListObj
- });
-
- dialogRef.afterClosed().subscribe(result => {
-
- let groupAlreadyExists = false;
- if(this.Groups == null || this.Groups == undefined)
- {
- this.Groups = new Array();
- }
- for(let k=0; k<this.Groups.length; k++)
- {
- if(this.Groups[k]["name"] == result["name"])
- {
- groupAlreadyExists = true;
- }
- }
-
-
- if(!groupAlreadyExists)
- {
- let UpdatedResult = result;
- for(let i=0; i<result["formFieldList"].length; i++)
- {
- let formFieldId = result["formFieldList"][i];
- let j=0;
- while(this.formFieldsListObj[j])
- {
- if(this.formFieldsListObj[j]["id"] == formFieldId)
- {
- UpdatedResult["formFieldList"][i] = this.formFieldsListObj[j];
- }
- j++;
- }
- }
- if(this.Groups !== null || this.Groups!== undefined)
- {
- this.Groups.push(UpdatedResult);
- }
- else
- {
- this.Groups = new Array();
- this.Groups.push(UpdatedResult);
- }
-
- }
- else
- {
- this.openSnackBar("Group Already Exists.","Try using another name!");
- }
-
-
- });
- }
-
- openSnackBar(message: string, action: string) {
- this._snackBar.open(message, action, {
- duration: 5000,
- });
- }
-
- saveFormFieldGroups()
- {
- let formFieldGroupsPostObj =
- {
- reportId : this.reportId1,
- formFieldGroupsJSON : JSON.stringify(this.Groups)
- };
-
- this._formFieldsService.postFormFieldGroupsData(formFieldGroupsPostObj)
- .subscribe((responsePost) => {
- this.openSnackBar("Successfully Saved!","");
- });
- }
+ saveFormFieldGroups() {
+ let formFieldGroupsPostObj =
+ {
+ reportId: this.reportId1,
+ formFieldGroupsJSON: JSON.stringify(this.Groups)
+ };
+
+ this._formFieldsService.postFormFieldGroupsData(formFieldGroupsPostObj)
+ .subscribe((responsePost) => {
+ this.openSnackBar('Successfully Saved!', '');
+ });
+ }
}
@Component({
- selector: 'app-create-group',
- templateUrl: './create-group.component.html',
+ selector: 'app-create-group',
+ templateUrl: './create-group.component.html',
})
export class DialogOverviewExampleDialog {
- createGroupObj : any = {};
- constructor(
- public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
- @Inject(MAT_DIALOG_DATA) public data: DialogData) {
+ createGroupObj: any = {};
+
+ constructor(
+ public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
+ @Inject(MAT_DIALOG_DATA) public data: DialogData) {
+ }
+
+ onNoClick(): void {
+ this.dialogRef.close();
+ }
+
+}
+
+
+@Component({
+ selector: 'app-edit-group',
+ templateUrl: './edit-group.component.html',
+})
+export class EditGroupDialog {
+ @Input('mode') mode: string;
+ editGroupInfo: any = {};
+
+ constructor(
+ public dialogRef: MatDialogRef<EditGroupDialog>,
+ @Inject(MAT_DIALOG_DATA) public data: DialogData) {
}
- onNoClick() : void {
- this.dialogRef.close();
- }
+ onNoClick(): void {
+ this.dialogRef.close();
+ }
}
+