1
|
<div *ngIf="stakeholder && canEdit">
|
2
|
<div class="uk-text-right uk-width-expand">
|
3
|
<a class="uk-margin-bottom uk-margin-right " [attr.uk-icon]="export_loading ? null : 'icon:download'" title="Export indicators (JSON file)"
|
4
|
(click)="export_indicators()">
|
5
|
<span class="uk-text-small">Export</span>
|
6
|
<span *ngIf="export_loading" class="uk-margin-small-left uk-icon icon-button"><loading [top_margin]="false"></loading></span>
|
7
|
</a>
|
8
|
<div uk-form-custom class="js-upload uk-margin-top">
|
9
|
<input id="exampleInputFile" type="file" class="uk-width-medium" (change)="fileChangeEvent($event)"/>
|
10
|
<a class=" uk-margin-bottom" [attr.uk-icon]="import_loading ? null : 'icon:upload'" title="Import indicators (JSON file)"> Import</a>
|
11
|
<span *ngIf="import_loading" class="uk-margin-small-left uk-icon icon-button"><loading [top_margin]="false"></loading></span>
|
12
|
</div>
|
13
|
</div>
|
14
|
|
15
|
<div *ngIf="numberSections">
|
16
|
<h6 class="uk-text-bold">Number Indicators</h6>
|
17
|
<ng-template ngFor [ngForOf]="displayNumbers" let-number let-i="index">
|
18
|
<div [id]="'number-' + number._id"
|
19
|
class="uk-grid-match uk-grid-small uk-grid uk-margin-top section"
|
20
|
uk-sortable="group: number" uk-grid>
|
21
|
<div class="tools disable-sortable uk-sortable-nodrag">
|
22
|
<div class="actions">
|
23
|
<a [class.uk-disabled]="editing" class="" (click)="createSection(i, 'number')"
|
24
|
title="Create a new section">
|
25
|
<icon name="add"></icon>
|
26
|
</a>
|
27
|
<!--<button class="md-btn md-btn-mini"><i class="material-icons rotate-90">drag_indicator</i></button>-->
|
28
|
<a [title]="(number.defaultId?'Default sections cannot be deleted':'Delete section')"
|
29
|
(click)="deleteSectionOpen(number, i, 'number', 'delete')">
|
30
|
<icon name="close"></icon>
|
31
|
</a>
|
32
|
<!-- <ng-container *ngIf="!stakeholder.defaultId">-->
|
33
|
<!-- <button [disabled]="editing || number.defaultId " class="md-btn md-btn-mini"-->
|
34
|
<!-- [title]="(number.defaultId?'Default sections cannot be deleted':'Delete all related sections')"-->
|
35
|
<!-- (click)="deleteSectionOpen(number, i, 'number', 'delete')"><i class="material-icons">highlight_off</i>-->
|
36
|
<!-- </button>-->
|
37
|
<!-- <button [disabled]="editing || number.defaultId " class="md-btn md-btn-mini"-->
|
38
|
<!-- [title]="(number.defaultId?'Default sections cannot be deleted':'Delete section and disconnect related')"-->
|
39
|
<!-- (click)="deleteSectionOpen(number, i, 'number', 'disconnect')"><i class="material-icons">link_off</i>-->
|
40
|
<!-- </button>-->
|
41
|
<!-- </ng-container>-->
|
42
|
</div>
|
43
|
</div>
|
44
|
<div *ngIf="numberSections.at(i)"
|
45
|
class="uk-width-1-1 uk-margin-medium-bottom disable-sortable uk-sortable-nodrag">
|
46
|
<div dashboard-input [formInput]="numberSections.at(i).get('title')"
|
47
|
[extraLeft]="false" class="uk-width-1-3@m uk-width-1-1" placeholder="Title"
|
48
|
inputClass="input-borderless uk-h5 uk-margin-remove">
|
49
|
<div [class.uk-invisible]="numberSections.at(i).get('title').pristine">
|
50
|
<button class="uk-button uk-button-secondary" [disabled]="editing"
|
51
|
(click)="saveSection(numberSections.at(i).value, i, 'number')">
|
52
|
Save
|
53
|
</button>
|
54
|
</div>
|
55
|
</div>
|
56
|
</div>
|
57
|
<ng-template ngFor [ngForOf]="number.indicators" let-indicator let-j="index">
|
58
|
<div *ngIf="indicator" [id]="indicator._id"
|
59
|
[ngClass]="getNumberClassBySize(indicator.width)"
|
60
|
[class.disable-sortable]="!canReorder"
|
61
|
[class.uk-sortable-nodrag]="!canReorder">
|
62
|
<div class="uk-card uk-card-default uk-card-body uk-position-relative" [class.uk-card-hover]="canReorder">
|
63
|
<ng-container
|
64
|
*ngTemplateOutlet="visibilityOptions; context:{indicator: indicator, sectionId: number._id}"></ng-container>
|
65
|
<div [attr.uk-tooltip]="export_loading ? 'title:Edit is disabled, while exporting indicators; cls:uk-active' : 'cls: uk-invisible'"
|
66
|
class="uk-position-top-right uk-margin-small-right uk-margin-small-top clickable">
|
67
|
<i [class]="export_loading ? 'uk-disabled ' : ' '" uk-icon="more-vertical" (click)="$event.stopPropagation();$event.preventDefault()"></i>
|
68
|
<div #element uk-dropdown="mode: click; pos: bottom-right; delay-hide: 0; flip: false">
|
69
|
<ul class="uk-nav uk-dropdown-nav">
|
70
|
<li *ngIf="!editing"><a
|
71
|
(click)="editNumberIndicatorOpen(number, indicator._id)">Edit</a></li>
|
72
|
<ng-template ngFor [ngForOf]="stakeholderUtils.visibility" let-v>
|
73
|
<li *ngIf="indicator.visibility != v.value"><a (click)="changeIndicatorStatus(number._id,
|
74
|
indicator, v.value); hide(element)">
|
75
|
{{'Make ' + v.label.toLowerCase()}}</a>
|
76
|
</li>
|
77
|
</ng-template>
|
78
|
<hr *ngIf="!indicator.defaultId" class="uk-nav-divider">
|
79
|
<li *ngIf="!indicator.defaultId && !editing"><a
|
80
|
(click)="deleteIndicatorOpen(number, indicator._id, 'number', 'delete');hide(element)">Delete</a>
|
81
|
<!-- <ng-container *ngIf="!stakeholder.defaultId">-->
|
82
|
<!-- <a (click)="deleteIndicatorOpen(number, indicator._id, 'number', 'delete');hide(element)">Delete from all profiles</a>-->
|
83
|
<!-- <a (click)="deleteIndicatorOpen(number, indicator._id, 'number', 'disconnect');hide(element)">Delete and disconnect from all profiles</a>-->
|
84
|
<!-- </ng-container>-->
|
85
|
</li>
|
86
|
</ul>
|
87
|
</div>
|
88
|
</div>
|
89
|
<div>
|
90
|
<div class="uk-text-center uk-text-bold">
|
91
|
{{indicator.name ? indicator.name : 'No title available'}}
|
92
|
</div>
|
93
|
<h3 class="uk-margin-medium-top uk-text-center uk-text-bold">
|
94
|
<span *ngIf="numberResults.get(i + '-' + j)">{{numberResults.get(i + '-' + j) | number}}</span>
|
95
|
<span *ngIf="!numberResults.get(i + '-' + j)">--</span>
|
96
|
</h3>
|
97
|
<!--<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>-->
|
98
|
</div>
|
99
|
</div>
|
100
|
</div>
|
101
|
</ng-template>
|
102
|
<div class="disable-sortable uk-sortable-nodrag uk-width-1-1">
|
103
|
<div class="uk-grid uk-grid-small" uk-grid>
|
104
|
<div class="uk-width-1-4@xl uk-width-1-3@l uk-width-1-2@m uk-width-1-1">
|
105
|
<div class="uk-card uk-card-default uk-card-body clickable" (click)="editNumberIndicatorOpen(number)">
|
106
|
<h5 class="uk-text-bold">
|
107
|
Create a new number Indicator
|
108
|
</h5>
|
109
|
<div class="uk-flex uk-flex-center uk-text-secondary uk-margin-large-top">
|
110
|
<icon name="add" ratio="5"></icon>
|
111
|
</div>
|
112
|
</div>
|
113
|
</div>
|
114
|
</div>
|
115
|
</div>
|
116
|
</div>
|
117
|
</ng-template>
|
118
|
<ng-container *ngTemplateOutlet="new_section; context:{type: 'number'}"></ng-container>
|
119
|
</div>
|
120
|
<div *ngIf="chartSections" class="uk-margin-large-top">
|
121
|
<h6 class="uk-text-bold">Chart Indicators</h6>
|
122
|
<ng-template ngFor [ngForOf]="displayCharts" let-chart let-i="index">
|
123
|
<div [id]="'chart-' + chart._id"
|
124
|
class="uk-grid-match section uk-grid-small uk-grid uk-margin-top"
|
125
|
uk-sortable="group: chart" uk-grid>
|
126
|
<div class="tools disable-sortable uk-sortable-nodrag">
|
127
|
<div class="actions">
|
128
|
<a [class.uk-disabled]="editing" class="" (click)="createSection(i)"
|
129
|
title="Create a new section">
|
130
|
<icon name="add"></icon>
|
131
|
</a>
|
132
|
<!--<button class="md-btn md-btn-mini"><i class="material-icons rotate-90">drag_indicator</i></button>-->
|
133
|
<a [title]="(chart.defaultId?'Default sections cannot be deleted':'Delete section')"
|
134
|
(click)="deleteSectionOpen(chart, i, 'chart', 'delete')">
|
135
|
<icon name="close"></icon>
|
136
|
</a>
|
137
|
<!-- <ng-container *ngIf="!stakeholder.defaultId">-->
|
138
|
<!-- <button [disabled]="editing || chart.defaultId " class="md-btn md-btn-mini"-->
|
139
|
<!-- [title]="(chart.defaultId?'Default sections cannot be deleted':'Delete all related sections')"-->
|
140
|
<!-- (click)="deleteSectionOpen(chart, i, 'chart', 'delete')"><i class="material-icons">highlight_off</i>-->
|
141
|
<!-- </button>-->
|
142
|
<!-- <button [disabled]="editing || chart.defaultId " class="md-btn md-btn-mini"-->
|
143
|
<!-- [title]="(chart.defaultId?'Default sections cannot be deleted':'Delete section and disconnect related')"-->
|
144
|
<!-- (click)="deleteSectionOpen(chart, i, 'chart', 'disconnect')"><i class="material-icons">link_off</i>-->
|
145
|
<!-- </button>-->
|
146
|
<!-- </ng-container>-->
|
147
|
</div>
|
148
|
</div>
|
149
|
<div *ngIf="chartSections.at(i)"
|
150
|
class="uk-width-1-1 uk-margin-medium-bottom disable-sortable uk-sortable-nodrag">
|
151
|
<div dashboard-input [formInput]="chartSections.at(i).get('title')"
|
152
|
[extraLeft]="false" class="uk-width-1-3@m uk-width-1-1" placeholder="Title"
|
153
|
inputClass="input-borderless uk-h5 uk-margin-remove">
|
154
|
<div [class.uk-invisible]="chartSections.at(i).get('title').pristine">
|
155
|
<button class="uk-button uk-button-secondary" [disabled]="editing"
|
156
|
(click)="saveSection(chartSections.at(i).value, i)">
|
157
|
Save
|
158
|
</button>
|
159
|
</div>
|
160
|
</div>
|
161
|
</div>
|
162
|
<ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index">
|
163
|
<div *ngIf="indicator" [id]="indicator._id"
|
164
|
[ngClass]="getChartClassBySize(indicator.width)"
|
165
|
[class.disable-sortable]="!canReorder"
|
166
|
[class.uk-sortable-nodrag]="!canReorder">
|
167
|
<div class="uk-card uk-card-default uk-card-body uk-position-relative" [class.uk-card-hover]="canReorder">
|
168
|
<ng-container
|
169
|
*ngTemplateOutlet="visibilityOptions; context:{indicator: indicator, sectionId: chart._id}"></ng-container>
|
170
|
<div [attr.uk-tooltip]="export_loading ? 'title:Edit is disabled, while exporting indicators; cls:uk-active' : 'cls: uk-invisible'"
|
171
|
class="uk-position-top-right uk-margin-small-right uk-margin-small-top clickable">
|
172
|
<i [class]="export_loading ? 'uk-disabled ' : ' '" uk-icon="more-vertical" (click)="$event.stopPropagation();$event.preventDefault()"></i>
|
173
|
<div #element uk-dropdown="mode: click; pos: bottom-right; delay-hide: 0; flip: false">
|
174
|
<ul class="uk-nav uk-dropdown-nav">
|
175
|
<li *ngIf="!editing"><a
|
176
|
(click)="editChartIndicatorOpen(chart, indicator._id);hide(element)">Edit</a>
|
177
|
</li>
|
178
|
<ng-template ngFor [ngForOf]="stakeholderUtils.visibility" let-v>
|
179
|
<li *ngIf="indicator.visibility != v.value"><a (click)="changeIndicatorStatus(chart._id,
|
180
|
indicator, v.value); hide(element)">
|
181
|
{{'Make ' + v.label.toLowerCase()}}</a>
|
182
|
</li>
|
183
|
</ng-template>
|
184
|
<hr *ngIf="!indicator.defaultId " class="uk-nav-divider">
|
185
|
<li *ngIf="!editing && !indicator.defaultId "><a
|
186
|
(click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">
|
187
|
Delete</a>
|
188
|
<!-- <a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">Delete from all profiles</a>-->
|
189
|
<!-- <a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'disconnect');hide(element)">Delete and disconnect from all profiles</a>-->
|
190
|
</li>
|
191
|
</ul>
|
192
|
</div>
|
193
|
</div>
|
194
|
<div>
|
195
|
<div *ngIf="indicator.name" class="uk-text-center uk-text-bold uk-margin-small-bottom">
|
196
|
{{indicator.name}}
|
197
|
</div>
|
198
|
<iframe *ngIf="!properties.disableFrameLoad && indicator.indicatorPaths[0] &&
|
199
|
indicator.indicatorPaths[0].source !==
|
200
|
'image' &&
|
201
|
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
202
|
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
203
|
[class]="' uk-width-1-1 uk-height-' +
|
204
|
(indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
|
205
|
<div *ngIf="properties.disableFrameLoad &&
|
206
|
indicator.indicatorPaths[0].source !==
|
207
|
'image'" class="uk-alert uk-alert-danger uk-text-center">I frames
|
208
|
preview is disabled
|
209
|
</div>
|
210
|
<div *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source === 'image'">
|
211
|
<img [class]="' uk-width-1-1 uk-height-' +
|
212
|
(indicator.height?indicator.height.toLowerCase():'medium')"
|
213
|
[src]="indicator.indicatorPaths[0].url">
|
214
|
</div>
|
215
|
<!--<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>-->
|
216
|
</div>
|
217
|
</div>
|
218
|
</div>
|
219
|
</ng-template>
|
220
|
<div class="disable-sortable uk-sortable-nodrag uk-width-1-1">
|
221
|
<div class="uk-grid uk-grid-small" uk-grid>
|
222
|
<div class="uk-width-1-3@xl uk-width-1-2@m uk-width-1-1">
|
223
|
<div class=" uk-card uk-card-default uk-card-body clickable" (click)="editChartIndicatorOpen(chart)">
|
224
|
<h5 class="uk-text-bold">
|
225
|
Create a custom indicator
|
226
|
</h5>
|
227
|
<div class="uk-text-muted uk-text-small">
|
228
|
Use our advance tool to create a custom Indicator that suit the needs of your funding
|
229
|
KPI's.
|
230
|
</div>
|
231
|
<div class="uk-flex uk-flex-center uk-text-secondary uk-margin-medium-top">
|
232
|
<icon name="add" ratio="5"></icon>
|
233
|
</div>
|
234
|
</div>
|
235
|
</div>
|
236
|
</div>
|
237
|
</div>
|
238
|
</div>
|
239
|
</ng-template>
|
240
|
<ng-container *ngTemplateOutlet="new_section; context:{type: 'chart'}"></ng-container>
|
241
|
</div>
|
242
|
</div>
|
243
|
|
244
|
<modal-alert #editNumberModal
|
245
|
[large]="true"
|
246
|
(alertOutput)="saveIndicator()"
|
247
|
[okDisabled]="numberIndicatorFb && (numberIndicatorFb.invalid || numberIndicatorFb.pristine)">
|
248
|
<div class="uk-padding-small">
|
249
|
<div *ngIf="numberIndicatorFb" class="uk-grid" [formGroup]="numberIndicatorFb" uk-grid>
|
250
|
<div dashboard-input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('name')" placeholder="Write a title"
|
251
|
label="Title"></div>
|
252
|
<div dashboard-input class="uk-width-1-1" *ngIf="stakeholder.defaultId !=-1 && ( (indicator.description &&
|
253
|
indicator.description.length > 0) || !stakeholder.defaultId)"
|
254
|
[formInput]="numberIndicatorFb.get('description')"
|
255
|
placeholder="Write a description"
|
256
|
label="Profile description" type="textarea">
|
257
|
</div>
|
258
|
<div dashboard-input class="uk-width-1-1" *ngIf="stakeholder.defaultId"
|
259
|
[formInput]="numberIndicatorFb.get('additionalDescription')"
|
260
|
placeholder="Write a description"
|
261
|
label="Description" type="textarea">
|
262
|
</div>
|
263
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('visibility')"
|
264
|
placeholder="Select a status"
|
265
|
label="Visibility" [options]="stakeholderUtils.visibility" type="select">
|
266
|
</div>
|
267
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('width')"
|
268
|
type="select" [options]="indicatorUtils.indicatorSizes"
|
269
|
placeholder="Select a size" label="Number Size">
|
270
|
</div>
|
271
|
<div *ngIf="numberIndicatorPaths" formArrayName="indicatorPaths">
|
272
|
<div *ngFor="let indicatorPath of numberIndicatorPaths.controls; let i=index"
|
273
|
[formGroup]="indicatorPath">
|
274
|
<div class="uk-grid" uk-grid>
|
275
|
<div class="uk-width-1-1">
|
276
|
<div class="uk-grid" uk-grid>
|
277
|
<div class="uk-width-1-1">
|
278
|
<div dashboard-input [formInput]="indicatorPath.get('url')" label="Number URL"
|
279
|
placeholder="Write a URL">
|
280
|
<div *ngIf="urlParameterizedMessage" warning>{{urlParameterizedMessage}}</div>
|
281
|
</div>
|
282
|
</div>
|
283
|
<div *ngIf="showCheckForSchemaEnhancements" class=" uk-width-1-1 ">
|
284
|
<div class="uk-alert uk-alert-warning">
|
285
|
There are schema enchancements that can be applied in this query. <a
|
286
|
(click)="indicatorPath.get('url').setValue(indicatorUtils.applySchemaEnhancements(indicatorPath.get('url').value)); indicatorPath.get('url').markAsDirty()">Apply
|
287
|
now</a>
|
288
|
</div>
|
289
|
</div>
|
290
|
<div class="uk-width-1-1">
|
291
|
<div dashboard-input [formInput]="indicatorPath.get('source')" label="Source"
|
292
|
type="select" placeholder="Select a source"
|
293
|
[options]="isAdministrator?indicatorUtils.allSourceTypes:indicatorUtils.sourceTypes">
|
294
|
</div>
|
295
|
</div>
|
296
|
</div>
|
297
|
</div>
|
298
|
<div formArrayName="jsonPath" class="uk-width-1-1">
|
299
|
<h6 class="uk-text-bold uk-flex uk-flex-middle uk-margin-remove-bottom">
|
300
|
<span>JSON Path</span>
|
301
|
</h6>
|
302
|
<div
|
303
|
*ngIf="numberIndicatorPaths.at(i).get('result').invalid && numberIndicatorPaths.at(i).get('result').errors.required">
|
304
|
<div class="uk-text-danger uk-text-small">
|
305
|
This JSON path is not valid or the result has not been calculated yet.
|
306
|
Please press calculate on box below to see the result.
|
307
|
</div>
|
308
|
</div>
|
309
|
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-1 uk-margin-top" uk-grid>
|
310
|
<div *ngFor="let jsonPath of getJsonPath(i).controls; let j=index" class="uk-flex uk-flex-middle">
|
311
|
<div dashboard-input class="uk-width-1-1"
|
312
|
[extraLeft]="false"
|
313
|
[formInput]="jsonPath"
|
314
|
placeholder="Write a field"
|
315
|
[label]="'Level ' + +(j + 1)">
|
316
|
<div class="uk-flex uk-flex-middle">
|
317
|
<span *ngIf="getJsonPath(i).length !== 1"
|
318
|
[class.uk-hidden]="numberIndicatorFb.get('defaultId').value"
|
319
|
class="uk-margin-small-left uk-text-danger clickable"
|
320
|
[class.uk-disabled]="getJsonPath(i).disabled"
|
321
|
(click)="removeJsonPath(i, j)">
|
322
|
<icon name="close"></icon>
|
323
|
</span>
|
324
|
<span class="uk-text-center uk-margin-left">
|
325
|
<icon *ngIf="indicator.defaultId === null || j < (getJsonPath(i).controls.length - 1)"
|
326
|
name="arrow_right"></icon>
|
327
|
</span>
|
328
|
</div>
|
329
|
</div>
|
330
|
</div>
|
331
|
<div *ngIf="indicator.defaultId === null" class="uk-flex uk-flex-middle">
|
332
|
<button class="uk-icon-button uk-button-secondary uk-margin-medium-top"
|
333
|
(click)="addJsonPath(i)">
|
334
|
<icon name="add"></icon>
|
335
|
</button>
|
336
|
</div>
|
337
|
</div>
|
338
|
</div>
|
339
|
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
340
|
<div class="uk-flex uk-position-relative">
|
341
|
<span class="uk-padding number number-preview uk-text-center">
|
342
|
<span
|
343
|
*ngIf="numberIndicatorPaths.at(i).get('result').valid && numberIndicatorPaths.at(i).get('result').value !== 0">
|
344
|
{{numberIndicatorPaths.at(i).get('result').value | number}}
|
345
|
</span>
|
346
|
<span
|
347
|
*ngIf="numberIndicatorPaths.at(i).get('result').valid && numberIndicatorPaths.at(i).get('result').value === 0">
|
348
|
--
|
349
|
</span>
|
350
|
</span>
|
351
|
<div *ngIf="numberIndicatorPaths.at(i).get('result').invalid"
|
352
|
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
|
353
|
<div class="uk-position-relative uk-height-1-1">
|
354
|
<div class="uk-position-center uk-text-center clickable uk-text-small"
|
355
|
[class.uk-disabled]="numberIndicatorPaths.at(i).get('url').invalid"
|
356
|
(click)="validateJsonPath(i, true)">
|
357
|
<div>
|
358
|
<icon name="refresh"></icon>
|
359
|
</div>
|
360
|
<span *ngIf="numberIndicatorPaths.at(i).get('result').errors.required">Calculate</span>
|
361
|
<span *ngIf="numberIndicatorPaths.at(i).get('result').errors.validating">Calculating...</span>
|
362
|
</div>
|
363
|
</div>
|
364
|
</div>
|
365
|
</div>
|
366
|
</div>
|
367
|
</div>
|
368
|
</div>
|
369
|
</div>
|
370
|
</div>
|
371
|
<div #editNumberNotify notify-form class="uk-width-1-1 uk-margin-medium-top"
|
372
|
[class.uk-hidden]="properties.environment === 'production'"></div>
|
373
|
</div>
|
374
|
</modal-alert>
|
375
|
<modal-alert #editChartModal
|
376
|
[large]="true"
|
377
|
(alertOutput)="saveIndicator()"
|
378
|
[okDisabled]="chartIndicatorFb && (chartIndicatorFb.invalid || chartIndicatorFb.pristine)">
|
379
|
<div class="uk-padding-small">
|
380
|
<div *ngIf="chartIndicatorFb" [formGroup]="chartIndicatorFb" class="uk-grid" uk-grid>
|
381
|
<div dashboard-input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('name')" placeholder="Write a title"
|
382
|
label="Title"></div>
|
383
|
<div dashboard-input class="uk-width-1-1" *ngIf="stakeholder.defaultId !=-1 && ( (indicator.description &&
|
384
|
indicator.description.length > 0) || !stakeholder.defaultId)"
|
385
|
[formInput]="chartIndicatorFb.get('description')" placeholder="Write a description"
|
386
|
label="Default Description" type="textarea">
|
387
|
</div>
|
388
|
<div dashboard-input *ngIf="stakeholder.defaultId" class="uk-width-1-1"
|
389
|
[formInput]="chartIndicatorFb.get('additionalDescription')" placeholder="Write a default description"
|
390
|
label="Description" type="textarea">
|
391
|
</div>
|
392
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('visibility')"
|
393
|
placeholder="Select a status"
|
394
|
label="Status" [options]="stakeholderUtils.visibility" type="select">
|
395
|
</div>
|
396
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('width')"
|
397
|
type="select" [options]="indicatorUtils.indicatorSizes" placeholder="Select a size"
|
398
|
label="Chart width">
|
399
|
</div>
|
400
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('height')"
|
401
|
type="select" [options]="indicatorUtils.indicatorSizes" placeholder="Select a size"
|
402
|
label="Chart height">
|
403
|
</div>
|
404
|
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
405
|
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;"
|
406
|
[formGroup]="indicatorPath" class="uk-grid" uk-grid>
|
407
|
<div dashboard-input class="uk-width-1-1"
|
408
|
[title]="indicatorPath.get('url').disabled?'Default chart URLs cannot change':''"
|
409
|
[formInput]="indicatorPath.get('url')" placeholder="Write a URL" label="Chart URL">
|
410
|
<div *ngIf="urlParameterizedMessage" warning>{{urlParameterizedMessage}}</div>
|
411
|
</div>
|
412
|
<div *ngIf="showCheckForSchemaEnhancements" class=" uk-width-1-1 ">
|
413
|
<div class="uk-alert uk-alert-warning">
|
414
|
There are schema enchancements that can be applied in this query. <a
|
415
|
(click)="indicatorPath.get('url').setValue(indicatorUtils.applySchemaEnhancements(indicatorPath.get('url').value)); indicatorPath.get('url').markAsDirty()">Apply
|
416
|
now</a>
|
417
|
</div>
|
418
|
</div>
|
419
|
<div class="uk-width-1-1" formArrayName="parameters">
|
420
|
<div class="uk-grid" uk-grid>
|
421
|
<div *ngIf="getParameter(i, 'title')" class="uk-width-1-1">
|
422
|
<div dashboard-input
|
423
|
[formInput]="getParameter(i, 'title').get('value')"
|
424
|
placeholder="Write a title"
|
425
|
label="Chart Title"></div>
|
426
|
</div>
|
427
|
<div *ngIf="getParameter(i, 'subtitle')" class="uk-width-1-1">
|
428
|
<div dashboard-input placeholder="Write a subtitle"
|
429
|
[formInput]="getParameter(i, 'subtitle').get('value')"
|
430
|
label="Chart Subtitle"></div>
|
431
|
</div>
|
432
|
<div *ngIf="!getParameter(i, 'type')" class="uk-width-1-3@s">
|
433
|
<div dashboard-input [formInput]="indicatorPath.get('type')"
|
434
|
type="select" placeholder="Select a type"
|
435
|
[options]="(indicatorPath.get('type').value == 'table' && getParameter(i, 'data_title_0'))?indicatorUtils.getChartTypes(indicatorPath.get('type').value):indicatorUtils.allChartTypes"
|
436
|
label="Chart Type"></div>
|
437
|
</div>
|
438
|
<div *ngIf="getParameter(i, 'type')" class="uk-width-1-3@s">
|
439
|
<div dashboard-input [formInput]="getParameter(i, 'type').get('value')"
|
440
|
placeholder="Select a type"
|
441
|
type="select" [options]="indicatorUtils.getChartTypes(getParameter(i, 'type').get('value').value)"
|
442
|
label="Chart Type"></div>
|
443
|
</div>
|
444
|
<div *ngIf="getParameter(i, 'xAxisTitle')" class="uk-width-1-3@s">
|
445
|
<div dashboard-input [formInput]="getParameter(i, 'xAxisTitle').get('value')"
|
446
|
placeholder="Write a title for X-Axis"
|
447
|
label="X-Axis Title"></div>
|
448
|
</div>
|
449
|
<div *ngIf="getParameter(i, 'yAxisTitle')" class="uk-width-1-3@s">
|
450
|
<div dashboard-input [formInput]="getParameter(i, 'yAxisTitle').get('value')"
|
451
|
placeholder="Write a title"
|
452
|
label="Y-Axis Title"></div>
|
453
|
</div>
|
454
|
<div *ngIf="getParameter(i, 'data_title_0')" class="uk-width-1-3@s">
|
455
|
<div dashboard-input [formInput]="getParameter(i, 'data_title_0').get('value')"
|
456
|
placeholder="Write a title"
|
457
|
label="Data title"></div>
|
458
|
</div>
|
459
|
<div *ngIf="getParameter(i, 'data_title_1')" class="uk-width-1-3@s">
|
460
|
<div dashboard-input [formInput]="getParameter(i, 'data_title_1').get('value')"
|
461
|
placeholder="Write a title"
|
462
|
label="Data title"></div>
|
463
|
</div>
|
464
|
<div *ngIf="getParameter(i, 'start_year')" class="uk-width-1-3@s">
|
465
|
<div dashboard-input [formInput]="getParameter(i, 'start_year').get('value')"
|
466
|
placeholder="Write a year"
|
467
|
label="Year (From)"></div>
|
468
|
</div>
|
469
|
<div *ngIf="getParameter(i, 'end_year')" class="uk-width-1-3@s">
|
470
|
<div dashboard-input [formInput]="getParameter(i, 'end_year').get('value')"
|
471
|
placeholder="Write a year"
|
472
|
label="Year (To)"></div>
|
473
|
</div>
|
474
|
</div>
|
475
|
</div>
|
476
|
<div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl"
|
477
|
class="uk-margin-medium-top uk-position-relative uk-width-1-1 uk-flex uk-flex-center">
|
478
|
<div *ngIf="(hasDifference(i)) && !indicatorPath.invalid"
|
479
|
class="uk-width-1-1 uk-height-large refresh-indicator">
|
480
|
<div class="uk-position-relative uk-height-1-1">
|
481
|
<div class="uk-position-center uk-text-center clickable"
|
482
|
(click)="refreshIndicator()">
|
483
|
<div>
|
484
|
<icon name="refresh"></icon>
|
485
|
</div>
|
486
|
<span>Click to refresh the graph view</span>
|
487
|
</div>
|
488
|
</div>
|
489
|
</div>
|
490
|
<iframe *ngIf="indicator.indicatorPaths[i].source !== 'image'"
|
491
|
[src]="indicator.indicatorPaths[i].safeResourceUrl"
|
492
|
class="uk-width-1-1 uk-height-large"></iframe>
|
493
|
<!-- <div *ngIf="properties.disableFrameLoad && indicator.indicatorPaths[i].source !== 'image'" class="uk-alert uk-alert-danger uk-text-center">I frames-->
|
494
|
<!-- preview is disabled</div>-->
|
495
|
<div *ngIf="indicator.indicatorPaths[i].source === 'image'">
|
496
|
<img class="uk-width-1-1 uk-height-large" [src]="indicator.indicatorPaths[i].url">
|
497
|
</div>
|
498
|
</div>
|
499
|
</div>
|
500
|
</div>
|
501
|
</div>
|
502
|
<div #editChartNotify notify-form class="uk-width-1-1 uk-margin-medium-top"
|
503
|
[class.uk-hidden]="properties.environment === 'production'"></div>
|
504
|
</div>
|
505
|
</modal-alert>
|
506
|
<modal-alert #deleteModal (alertOutput)="deleteIndicator()">
|
507
|
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
508
|
"{{indicator.name ? indicator.name : indicator.indicatorPaths[0].parameters.title}}"</span> indicator permanently.
|
509
|
<div *ngIf="indicatorChildrenActionOnDelete == 'delete'" class="uk-text-bold">
|
510
|
Indicators of all profiles based on this default indicator, will be deleted as well.
|
511
|
</div>
|
512
|
<!-- <span *ngIf="indicatorChildrenActionOnDelete == 'disconnect'" class="uk-text-bold">-->
|
513
|
<!-- Indicators of all profiles based on this default indicator, will not be marked as copied from default anymore.-->
|
514
|
<!-- </span>-->
|
515
|
Are you sure you want to proceed?
|
516
|
<div #deleteNotify notify-form class="uk-width-1-1 uk-margin-medium-top"
|
517
|
[class.uk-hidden]="properties.environment === 'production'"></div>
|
518
|
</modal-alert>
|
519
|
<!--<modal-alert #deleteAllModal (alertOutput)="deleteIndicator('delete')">
|
520
|
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
521
|
"{{indicator.name ? indicator.name : indicator.indicatorPaths[0].parameters.title}}"</span> indicator permanently.
|
522
|
<span class="uk-text-bold">Indicators of all profiles based on this default indicator, will be deleted as well.</span>
|
523
|
Are you sure you want to proceed?
|
524
|
</modal-alert>
|
525
|
<modal-alert #deleteAndDisconnectModal (alertOutput)="deleteIndicator('disconnect')">
|
526
|
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
527
|
"{{indicator.name ? indicator.name : indicator.indicatorPaths[0].parameters.title}}"</span> indicator permanently.
|
528
|
<span class="uk-text-bold">Indicators of all profiles based on this default indicator, will not be marked as copied from default anymore.</span>
|
529
|
Are you sure you want to proceed?
|
530
|
</modal-alert>-->
|
531
|
<modal-alert #deleteSectionModal (alertOutput)="deleteSection()">
|
532
|
You are about to delete this section and its indicators permanently.
|
533
|
<div *ngIf="sectionChildrenActionOnDelete == 'delete' && !stakeholder.defaultId" class="uk-text-bold">
|
534
|
Sections of all profiles based on this default section and their contents, will be deleted as well.
|
535
|
</div>
|
536
|
<!-- <span *ngIf="sectionChildrenActionOnDelete == 'disconnect'" class="uk-text-bold">-->
|
537
|
<!-- Sections of all profiles based on this default section and their contents, will not be marked as copied from default anymore.-->
|
538
|
<!-- </span>-->
|
539
|
Are you sure you want to proceed?
|
540
|
</modal-alert>
|
541
|
<!--<modal-alert #deleteNumberSectionModal (alertOutput)="deleteSection('number')">
|
542
|
You are about to delete this section and its indicators permanently.
|
543
|
Are you sure you want to proceed?
|
544
|
</modal-alert>
|
545
|
<modal-alert #deleteChartSectionModal (alertOutput)="deleteSection()">
|
546
|
You are about to delete this section and its indicators permanently.
|
547
|
Are you sure you want to proceed?
|
548
|
</modal-alert>-->
|
549
|
<ng-template #visibilityOptions let-indicator="indicator" let-sectionId="sectionId">
|
550
|
<span [attr.uk-tooltip]="export_loading ? 'title:Edit is disabled, while exporting indicators; cls:uk-active' : 'cls: uk-invisible'"
|
551
|
class="uk-position-top-left uk-margin-small-left uk-margin-small-top visibility" [class]="export_loading ? '' : ' clickable '">
|
552
|
<span [class]="export_loading ? 'uk-disabled ' : ' '" class="clickable color">
|
553
|
<icon [name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"></icon>
|
554
|
</span>
|
555
|
<div #element uk-dropdown="mode: click; pos: bottom-left; delay-hide: 0; flip: false">
|
556
|
<ul class="uk-nav uk-dropdown-nav">
|
557
|
<li *ngFor="let v of stakeholderUtils.visibility" class="uk-position-relative">
|
558
|
<a *ngIf="indicator.visibility != v.value"
|
559
|
(click)="$event.stopPropagation();changeIndicatorStatus(sectionId, indicator,v.value);hide(element);$event.preventDefault()">
|
560
|
<icon [name]="stakeholderUtils.visibilityIcon.get(v.value)" ratio="0.8"></icon>
|
561
|
<span> {{v.label}}</span>
|
562
|
</a>
|
563
|
<a *ngIf="indicator.visibility == v.value">
|
564
|
<icon [name]="stakeholderUtils.visibilityIcon.get(v.value)" [ratio]="0.8"></icon>
|
565
|
<span> {{v.label}}</span>
|
566
|
<span class="uk-position-center-right">
|
567
|
<icon customClass="uk-text-secondary" [ratio]="0.5" name="bullet"></icon>
|
568
|
</span>
|
569
|
</a>
|
570
|
</li>
|
571
|
</ul>
|
572
|
</div>
|
573
|
</span>
|
574
|
</ng-template>
|
575
|
<ng-template #new_section let-type="type">
|
576
|
<div class="new-section uk-margin-large-top">
|
577
|
<div class="tools uk-flex uk-flex-middle clickable" (click)="createSection(-1, type)">
|
578
|
<button class="uk-margin-small-right uk-icon-button uk-button-secondary">
|
579
|
<icon name="add" [ratio]="1.5"></icon>
|
580
|
</button>
|
581
|
<span>Create a new section</span>
|
582
|
</div>
|
583
|
</div>
|
584
|
</ng-template>
|
585
|
<ng-template #description let-indicator="indicator">
|
586
|
<span class="descriptionIcon"
|
587
|
*ngIf="(indicator.description && indicator.description.length > 0)
|
588
|
|| (indicator.additionalDescription && indicator.additionalDescription.length > 0)"
|
589
|
uk-icon="info"
|
590
|
[attr.uk-tooltip]="'title:<div class=\'uk-padding-small\'>'+
|
591
|
(indicator.description&& indicator.description.length > 0?indicator.description:'') +'<br>'+
|
592
|
(indicator.additionalDescription && indicator.additionalDescription.length?indicator.additionalDescription:'')
|
593
|
+'</div>'">
|
594
|
</span>
|
595
|
</ng-template>
|