summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.html
blob: fcfcf4d4f84fc6889c1adbe49a0e550b2b386c7d (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
<span *ngIf="showSpinner" class="ecomp-spinner"></span>

<div *ngIf="!showSpinner" class="stdForm">

    <div class="tab-content">
        <table>
            <tr>
                <td>
                    <h6 class="reportTitle">{{reportName}}</h6>
                    <h6 class="reportsubTitle" class="subtitle">{{reportSubTitle}}</h6>
                </td>
                <td>
                    <mat-icon (click)="editReport(reportId)" *ngIf="allowEdit"
                              aria-hidden="false" aria-label="edit">edit
                    </mat-icon>
                </td>
            </tr>
        </table>
        <span *ngIf="showformFiledSpinner" class="ecomp-spinner"></span>
        <br>
        <div *ngIf="!showformFiledSpinner" class="stdForm">
            <div *ngIf="formFieldList" class="wrapper">
                <div *ngFor="let item of formFieldList; let i = index;">
                    <div *ngIf="item.fieldType == 'TEXT' && item.validationType !== 'DATE'"
                         class="fieldWidth">
                        <label class="labelWidth">{{item.fieldDisplayName}} :</label> <textarea placement="right" ngbTooltip="comma seperated"
                                                                                                [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)"   [(ngModel)]="formFieldListValueArr[i]" class="defaultFontSizeTextArea" id="item.fieldId"></textarea>
                    </div>
                    <div *ngIf="item.fieldType == 'LIST_BOX'" class="fieldWidth">
                        <label class="labelWidth" for="reportType">{{item.fieldDisplayName}} :</label>
                        <select  [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)"
                                 class="browser-default custom-select defaultFontSize" required="required"
                        >
                            <option *ngFor="let listItem of item.formFieldValues"
                                    class="defaultFontSize" value="{{listItem.id}}">{{listItem.name}}</option>
                        </select>
                    </div>
                    <div *ngIf="item.fieldType == 'LIST_MULTI_SELECT'" class="fieldWidth">
                        <label class="labelWidth" for="reportType">{{item.fieldDisplayName}} :</label>
                        <mat-form-field>
                            <mat-select [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)" multiple>
                                <mat-option *ngFor="let listItem of item.formFieldValues"
                                            value="{{listItem.id}}">{{listItem.name}}</mat-option>
                            </mat-select>
                        </mat-form-field>
                    </div>
                    <div *ngIf="item.validationType == 'DATE'" class="fieldWidth">
                        <label class="labelWidth" for="reportType">{{item.fieldDisplayName}} :</label>
                        <mat-form-field><input  [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)"
                                                [matDatepicker]="picker"
                                                class="defaultFontSize" matInput>
                            <mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
                            <mat-datepicker #picker></mat-datepicker>
                        </mat-form-field>
                    </div>
                </div>
            </div>
            <div *ngIf="formFieldList" style="padding: 0.3em" >
                <div *ngIf="unCommonGropusList.length > 0">
                    <label>Select :</label><br/>
                    <br/>
                    <mat-radio-group ngmodel [(ngModel)]="groupSelectValue"
                                     aria-label="Select an option" (ngModelChange) ="toggleChangeWhenCalledWithFromFields()">
                        <div *ngFor="let group of formFieldGroupObjList; let i=index;" style="display: table-cell">
                            <mat-radio-button value="{{group.name}}">{{group.name}}</mat-radio-button>&nbsp;&nbsp;&nbsp;
                        </div>
                    </mat-radio-group>

                </div>
            </div>

            <div *ngIf="formFieldList" class="wrapper">
                <div *ngFor="let item of toggleFormFieldRenderArr; let i = index;">
                    <div *ngIf="item.fieldType == 'TEXT' && item.validationType !== 'DATE'" class="fieldWidth">
                        <label class="labelWidth">{{item.fieldDisplayName}} :</label><textarea placement="right" ngbTooltip="comma seperated"
                                                                                               [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)" class="defaultFontSizeTextArea" id="item.fieldId"></textarea>
                    </div>
                    <div *ngIf="item.fieldType == 'LIST_BOX'" class="fieldWidth">
                        <label class="labelWidth" for="reportType">{{item.fieldDisplayName}} :</label>
                        <select [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)"
                                class="browser-default custom-select defaultFontSize" required="required"
                        >
                            <option *ngFor="let listItem of item.formFieldValues"
                                    class="defaultFontSize" value="{{listItem.id}}">{{listItem.name}}</option>
                        </select>

                    </div>
                    <div *ngIf="item.fieldType == 'LIST_MULTI_SELECT'" class="fieldWidth">
                        <label class="labelWidth" for="reportType">{{item.fieldDisplayName}} :</label>
                        <mat-form-field>
                            <mat-select [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)"
                                        multiple>
                                <mat-option *ngFor="let listItem of item.formFieldValues"
                                            value="{{listItem.id}}">{{listItem.name}}</mat-option>
                            </mat-select>
                        </mat-form-field>

                        <br/>
                    </div>
                    <div *ngIf="item.validationType == 'DATE'" class="fieldWidth">
                        <label class="labelWidth" for="reportType">{{item.fieldDisplayName}} :</label>
                        <mat-form-field><input [ngModel]="formFieldListValueMap.get(item.fieldId)" (ngModelChange)="formFieldListValueMap.set(item.fieldId, $event)" [matDatepicker]="picker"
                                               class="defaultFontSize"
                                               matInput
                                               value="{{item.formFieldValues[0][name]}}">
                            <mat-datepicker-toggle
                                [for]="picker" matSuffix></mat-datepicker-toggle>
                            <mat-datepicker
                                #picker></mat-datepicker>
                        </mat-form-field>
                    </div>
                    <br/>
                </div>
            </div>
            <div *ngIf="formFieldList" style="float: left;">
                <button (click)="runReport()" class="btn btn-alt btn-run" >Run Report</button>
                <button (click)="resetFormFieldValues()" class="btn btn-alt btn-run" >Reset</button>
            </div>
        </div>
    </div>
</div>
<div></div>

<div *ngIf="isUpload" class="row isFileUploadDiv">
    <p>
        <mat-form-field class="matFormField">
            <textarea matInput placeholder="Comments">{{uploadfileComments}}</textarea>
        </mat-form-field>
    </p>
    <div class="btn-group row" style="margin: auto;">
        <p>
            <button (click)="onProceedWithLoad()" *ngIf="isUpload"
                    class="btn btn-secondary proceedWitLoadButton" type="button">Proceed
                With Load
            </button>
            <button *ngIf="isUpload" class="btn btn-secondary abortButton"
                    type="button">Abort
            </button>
        </p>
    </div>
</div>
<br><br><br>

<div *ngIf="navigateToRun">
    <!-- <app-run-dashboard-report [reportId]="reportId" [reportMode]="reportMode" [queryString]="getQueryString()" [DashboardReportObj]="DashboardReportObj"></app-run-dashboard-report> -->
    <app-run-report [DashboardReportObj]="DashboardReportObj" [TriggerFFArr]="triggerFormFieldArr"
                    [hitCnt]="hitCnt"
                    [queryString]="getQueryString()"
                    [reportId]="reportId" [reportMode]="reportMode" [runAgain]="runReportAgain" [groupSelectValue]="groupSelectValue" [chartType]="chartType" ></app-run-report>
</div>

<div *ngIf="error == true">
    <h1>Error Message:</h1>
    <p>{{errorMessage}}</p>
    <br/>
    <h1>Stack Trace:</h1>
    <p>{{stackTrace}}</p>

</div>