summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.html
blob: 63062109a6d946b89083eb32a3699b4c3f3104f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<app-sql-validate-changes-dialog-component [(visible)]="showDialog1">
    <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 (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 (click)="closeValidateModal()" class="btn btn-alt btn-small" style="font-size: 17px;">Close
                </button>
            </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 (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>
                </div>
                <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>
                <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>

        <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>
    <br/>
    <div class="field-group">
        <table style="width: auto; margin-left: 70%;">
            <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/>
        <hr/>
    </div>
</div>