606 lines
43 KiB
HTML
606 lines
43 KiB
HTML
<div *ngIf="stakeholder && canEdit" class="uk-section">
|
|
<div *ngIf="numberSections">
|
|
<h5 class="uk-text-bold">Number Indicators</h5>
|
|
<div class="uk-grid uk-grid-large uk-child-width-1-1" uk-grid>
|
|
<div *ngFor="let number of numbers; let i=index">
|
|
<div class="section">
|
|
<div *ngIf="isEditable" class="tools">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<a *ngIf="isCurator" [class.uk-disabled]="editing" class=""
|
|
(click)="createSection(i, 'number')"
|
|
uk-tooltip="Create a new section">
|
|
<icon name="add" [flex]="true"></icon>
|
|
</a>
|
|
<a *ngIf="!number.defaultId" [attr.uk-tooltip]="'Delete section'"
|
|
(click)="deleteSectionOpen(number, i, 'number', 'delete')">
|
|
<icon name="close" [flex]="true"></icon>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="numberSections.at(i)" class="uk-margin-medium-bottom">
|
|
<div *ngIf="isEditable" input [formInput]="numberSections.at(i).get('title')"
|
|
(focusEmitter)="saveSection($event, numberSections.at(i), i, 'number')"
|
|
class="uk-width-1-3@m uk-width-1-1" placeholder="Title" inputClass="border-bottom"></div>
|
|
<h5 *ngIf="!isEditable"
|
|
class="uk-margin-remove">{{ numberSections.at(i).get('title').value }}</h5>
|
|
</div>
|
|
<div [id]="'number-' + number._id" class="uk-grid uk-grid-small uk-grid-match"
|
|
[attr.uk-sortable]="isEditable ? 'group: number': null" uk-grid>
|
|
<div *ngFor="let indicator of number.indicators; let j=index" [id]="indicator._id"
|
|
[ngClass]="getNumberClassBySize(indicator.width)">
|
|
<div class="uk-card uk-card-default uk-padding-small number-card uk-position-relative">
|
|
<div *ngIf="!dragging"
|
|
class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true"
|
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
|
ratio="0.6"></icon>
|
|
<a *ngIf="isEditable && (isCurator || showVisibility)"
|
|
class="uk-link-reset uk-flex uk-flex-middle" [class.uk-disabled]="editing">
|
|
<icon *ngIf="showVisibility" [flex]="true"
|
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
|
ratio="0.6"></icon>
|
|
<icon [flex]="true" name="more_vert"></icon>
|
|
</a>
|
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)"
|
|
class="uk-dropdown"
|
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
|
<ul class="uk-nav uk-dropdown-nav">
|
|
<ng-container *ngIf="isCurator">
|
|
<li>
|
|
<a (click)="editNumberIndicatorOpen(number, indicator._id); hide(element)">Edit</a>
|
|
</li>
|
|
</ng-container>
|
|
<ng-container *ngIf="showVisibility">
|
|
<li *ngIf="isCurator" class="uk-nav-divider"></li>
|
|
<li *ngFor="let v of stakeholderUtils.visibilities">
|
|
<a (click)="changeIndicatorStatus(number._id, indicator, v.value);hide(element)">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<icon [flex]="true" [name]="v.icon"
|
|
ratio="0.6"></icon>
|
|
<span class="uk-margin-small-left uk-width-expand">{{ v.label }}</span>
|
|
<icon *ngIf="indicator.visibility === v.value"
|
|
[flex]="true" name="done"
|
|
class="uk-text-secondary" ratio="0.8"></icon>
|
|
</div>
|
|
</a>
|
|
</li>
|
|
</ng-container>
|
|
<ng-container *ngIf="!indicator.defaultId && !editing && isCurator">
|
|
<li class="uk-nav-divider">
|
|
<li>
|
|
<a (click)="deleteIndicatorOpen(number, indicator._id, 'number', 'delete');hide(element)">Delete</a>
|
|
</li>
|
|
</ng-container>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="uk-text-small uk-text-truncate uk-margin-xsmall-bottom uk-margin-right">{{ indicator.name }}</div>
|
|
<div class="number uk-text-small uk-text-bold">
|
|
<span *ngIf="numberResults.get(i + '-' + j + '-' + 0)"
|
|
[innerHTML]="(indicator.indicatorPaths[0].format == 'NUMBER'?(numberResults.get(i + '-' + j + '-' + 0) | numberRound: 2:1:stakeholder.locale):(numberResults.get(i + '-' + j + '-' + 0) | numberPercentage: stakeholder.locale))"></span>
|
|
<span *ngIf="!numberResults.get(i + '-' + j + '-' + 0)">--</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="isCurator && isEditable" class="uk-margin-top">
|
|
<div class="uk-grid uk-grid-small" uk-grid>
|
|
<div [ngClass]="getNumberClassBySize('small')">
|
|
<a class="uk-card uk-card-default number-card uk-padding-small uk-flex uk-flex-middle uk-link-reset"
|
|
(click)="editNumberIndicatorOpen(number)">
|
|
<div class="uk-text-background uk-margin-right">
|
|
<icon name="add" [flex]="true" ratio="1.5"></icon>
|
|
</div>
|
|
<div class="uk-text-bold uk-margin-remove">
|
|
Create a number Indicator
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="isEditable && isCurator">
|
|
<div class="section">
|
|
<div class="uk-flex uk-flex-center" (click)="createSection(-1, 'number')">
|
|
<button class="uk-button uk-button-primary uk-flex uk-flex-middle">
|
|
<icon name="add" [flex]="true"></icon>
|
|
<span class="uk-margin-small-left">New section</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="chartSections" class="uk-margin-large-top">
|
|
<h5 class="uk-text-bold">Chart Indicators</h5>
|
|
<div class="uk-grid uk-grid-large uk-child-width-1-1" uk-grid>
|
|
<div *ngFor="let chart of charts; let i=index">
|
|
<div class="section uk-margin-top uk-padding-small">
|
|
<div *ngIf="isEditable" class="tools">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<a *ngIf="isCurator" [class.uk-disabled]="editing" class="" (click)="createSection(i)"
|
|
title="Create a new section">
|
|
<icon name="add" [flex]="true"></icon>
|
|
</a>
|
|
<a *ngIf="!chart.defaultId" [attr.uk-tooltip]="'Delete section'"
|
|
(click)="deleteSectionOpen(chart, i, 'chart', 'delete')">
|
|
<icon name="close" [flex]="true"></icon>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="chartSections.at(i)"
|
|
class="uk-margin-medium-bottom">
|
|
<div *ngIf="isEditable" input [formInput]="chartSections.at(i).get('title')"
|
|
(focusEmitter)="saveSection($event, chartSections.at(i), i)"
|
|
class="uk-width-1-3@m uk-width-1-1" placeholder="Title" inputClass="border-bottom"></div>
|
|
<h5 *ngIf="!isEditable"
|
|
class="uk-margin-remove">{{ chartSections.at(i).get('title').value }}</h5>
|
|
</div>
|
|
<div [id]="'chart-' + chart._id" class="uk-grid uk-grid-small uk-grid-match"
|
|
[attr.uk-sortable]="isEditable ? 'group: chart': null" uk-grid>
|
|
<div *ngFor="let indicator of chart.indicators; let j=index" [id]="indicator._id"
|
|
[ngClass]="getChartClassBySize(indicator.width)">
|
|
<div class="uk-card uk-card-default uk-position-relative">
|
|
<div class="uk-card-body uk-margin-small-bottom">
|
|
<!-- Dropdown -->
|
|
<div *ngIf="!dragging"
|
|
class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true"
|
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
|
ratio="0.6"></icon>
|
|
<a *ngIf="isEditable && (isCurator || showVisibility)"
|
|
class="uk-link-reset uk-flex uk-flex-middle" [class.uk-disabled]="editing">
|
|
<icon *ngIf="showVisibility" [flex]="true"
|
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
|
ratio="0.6"></icon>
|
|
<icon [flex]="true" name="more_vert"></icon>
|
|
</a>
|
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)"
|
|
class="uk-dropdown"
|
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
|
<ul class="uk-nav uk-dropdown-nav">
|
|
<ng-container *ngIf="isCurator">
|
|
<li>
|
|
<a (click)="editChartIndicatorOpen(chart, indicator._id); hide(element)">Edit</a>
|
|
</li>
|
|
</ng-container>
|
|
<ng-container *ngIf="showVisibility">
|
|
<li *ngIf="isCurator" class="uk-nav-divider"></li>
|
|
<li *ngFor="let v of stakeholderUtils.visibilities">
|
|
<a (click)="changeIndicatorStatus(chart._id, indicator, v.value);">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<icon [flex]="true" [name]="v.icon"
|
|
ratio="0.6"></icon>
|
|
<span class="uk-margin-small-left uk-width-expand">{{ v.label }}</span>
|
|
<icon *ngIf="indicator.visibility === v.value"
|
|
[flex]="true" name="done"
|
|
class="uk-text-secondary" ratio="0.8"></icon>
|
|
</div>
|
|
</a>
|
|
</li>
|
|
</ng-container>
|
|
<ng-container *ngIf="!indicator.defaultId && !editing && isCurator">
|
|
<li class="uk-nav-divider">
|
|
<li>
|
|
<a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">Delete</a>
|
|
</li>
|
|
</ng-container>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- Main content-->
|
|
<div>
|
|
<h6 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom">
|
|
{{ indicator.name + " " }}
|
|
</h6>
|
|
<iframe *ngIf="!properties.disableFrameLoad && getActiveIndicatorPath(indicator) && getActiveIndicatorPath(indicator).source !=='image' &&
|
|
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))"
|
|
allowfullscreen="true" mozallowfullscreen="true"
|
|
webkitallowfullscreen="true"
|
|
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))"
|
|
class="uk-width-1-1"
|
|
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
|
[class.uk-blend-multiply]="!isFullscreen"></iframe>
|
|
<div *ngIf="properties.disableFrameLoad && getActiveIndicatorPath(indicator)?.source !=='image'">
|
|
<img class="uk-width-1-1 uk-blend-multiply"
|
|
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
|
src="assets/chart-placeholder.png">
|
|
</div>
|
|
<div *ngIf="getActiveIndicatorPath(indicator)?.source === 'image'">
|
|
<img class="uk-width-1-1 uk-blend-multiply"
|
|
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
|
[src]="getActiveIndicatorPath(indicator).url">
|
|
</div>
|
|
</div>
|
|
<!-- Tabs -->
|
|
<slider-tabs [type]="'dynamic'" [flexPosition]="'right'"
|
|
(activeEmitter)="indicator.activePath = $event"
|
|
tabsClass="uk-subnav uk-subnav-pill uk-subnav-small"
|
|
containerClass="uk-margin-top uk-margin-bottom" [border]="false">
|
|
<slider-tab *ngFor="let indicatorPath of indicator.indicatorPaths; let i=index"
|
|
[tabTitle]="indicatorPath.parameters.tab ? indicatorPath.parameters.tab : indicatorPath.parameters.title"
|
|
[invisible]="indicator.indicatorPaths.length < 2"
|
|
[tabId]="i" [active]="getActivePathIndex(indicator) == i">
|
|
</slider-tab>
|
|
</slider-tabs>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="isCurator && isEditable" class="uk-margin-top">
|
|
<div class="uk-grid uk-grid-small uk-grid-match" uk-grid>
|
|
<div [ngClass]="getChartClassBySize('small')">
|
|
<div class=" uk-card uk-card-default uk-card-body clickable"
|
|
(click)="editChartIndicatorOpen(chart)">
|
|
<h6 class="uk-text-bold uk-text-center">
|
|
Create a custom indicator
|
|
</h6>
|
|
<div class="uk-text-muted uk-text-small">
|
|
Use our advance tool to create a custom Indicator that suit the needs of your
|
|
funding
|
|
KPI's.
|
|
</div>
|
|
<div class="uk-flex uk-flex-center uk-text-background uk-margin-medium-top">
|
|
<icon name="add" ratio="3" [flex]="true"></icon>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="isEditable && isCurator">
|
|
<div class="section">
|
|
<div class="uk-flex uk-flex-center" (click)="createSection(-1)">
|
|
<button class="uk-button uk-button-primary uk-flex uk-flex-middle">
|
|
<icon name="add" [flex]="true"></icon>
|
|
<span class="uk-margin-small-left">New section</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="loading" class="uk-position-relative uk-height-large">
|
|
<loading class="uk-position-center"></loading>
|
|
</div>
|
|
<modal-alert #editNumberModal
|
|
[large]="true" classTitle="uk-background-primary uk-light"
|
|
(alertOutput)="saveIndicator()"
|
|
[okDisabled]="numberIndicatorFb && (numberIndicatorFb.invalid || numberIndicatorFb.pristine)">
|
|
<div *ngIf="editing" class="uk-position-relative uk-height-large">
|
|
<loading class="uk-position-center"></loading>
|
|
</div>
|
|
<div [class.uk-hidden]="editing" class="uk-padding-small">
|
|
<div *ngIf="numberIndicatorFb" class="uk-grid" [formGroup]="numberIndicatorFb" uk-grid>
|
|
<div input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('name')" placeholder="Title"></div>
|
|
<div *ngIf="stakeholder.defaultId != '-1' && ( (indicator.description && indicator.description.length > 0) || !stakeholder.defaultId)"
|
|
input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('description')"
|
|
placeholder="Profile description" type="textarea">
|
|
</div>
|
|
<div input class="uk-width-1-1" *ngIf="stakeholder.defaultId"
|
|
[formInput]="numberIndicatorFb.get('additionalDescription')"
|
|
placeholder="Description" type="textarea">
|
|
</div>
|
|
<div *ngIf="showVisibility" input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('visibility')"
|
|
placeholder="Visibility" [options]="stakeholderUtils.visibilities" type="select">
|
|
</div>
|
|
<div input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('width')"
|
|
placeholder="Number Size" [options]="indicatorUtils.indicatorSizes" type="select">
|
|
</div>
|
|
<hr class="uk-width-1-1">
|
|
<div *ngIf="numberIndicatorPaths" formArrayName="indicatorPaths">
|
|
<div *ngFor="let indicatorPath of numberIndicatorPaths.controls; let i=index" [formGroupName]="i">
|
|
<div *ngIf="getActivePathIndex() === i" class="uk-grid" uk-grid>
|
|
<div class="uk-width-1-1">
|
|
<div class="uk-grid" uk-grid>
|
|
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
|
<div input class="uk-width-expand" [formInput]="indicatorPath.get('url')"
|
|
placeholder="Number URL">
|
|
</div>
|
|
<div class='uk-padding-small'>
|
|
<a class="uk-link-reset"
|
|
(click)="copyToClipboard(indicatorPath.get('url').value)">
|
|
<icon [flex]="true" name="content_copy"></icon>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="uk-width-1-2@m">
|
|
<div input [formInput]="indicatorPath.get('source')" placeholder="Source"
|
|
[options]="isAdministrator?indicatorUtils.allSourceTypes:indicatorUtils.sourceTypes"
|
|
type="select">
|
|
</div>
|
|
</div>
|
|
<div class="uk-width-1-2@m">
|
|
<div input [formInput]="indicatorPath.get('format')" placeholder="Format"
|
|
[options]="indicatorUtils.formats" type="select">
|
|
</div>
|
|
</div>
|
|
<div class="uk-width-1-2@m" formArrayName="parameters">
|
|
<div *ngIf="getParameter(i, 'statsProfile', 'number') && statsProfiles" input
|
|
[formInput]="getParameter(i, 'statsProfile', 'number').get('value')"
|
|
[type]="'select'"
|
|
[options]="statsProfiles"
|
|
placeholder="Stats Profile"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div formArrayName="jsonPath" class="uk-width-1-1">
|
|
<h6 class="uk-text-bold uk-margin-remove-bottom">
|
|
<span>JSON Path</span>
|
|
</h6>
|
|
<div *ngIf="indicatorPath.get('result').invalid && indicatorPath.get('result').errors.required">
|
|
<div class="uk-text-danger uk-text-small">
|
|
This JSON path is not valid or the result has not been calculated yet.
|
|
Please press calculate on box below to see the result.
|
|
</div>
|
|
</div>
|
|
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-1 uk-margin-top uk-flex-middle"
|
|
uk-grid>
|
|
<div *ngFor="let jsonPath of getJsonPath(i).controls; let j=index"
|
|
class="uk-flex uk-flex-middle">
|
|
<div input class="uk-width-1-1" [formInput]="jsonPath"
|
|
[placeholder]="'Level ' + +(j + 1)"></div>
|
|
<a [class.uk-invisible]="getJsonPath(i).length === 1 || numberIndicatorFb.get('defaultId').value"
|
|
class="uk-margin-small-left uk-text-danger"
|
|
[class.uk-disabled]="getJsonPath(i).disabled"
|
|
(click)="removeJsonPath(i, j)">
|
|
<icon name="close"></icon>
|
|
</a>
|
|
<span [class.uk-invisible]="getJsonPath(i).disabled || j === (getJsonPath(i).controls.length - 1)"
|
|
class="uk-text-center uk-margin-small-left">
|
|
<icon name="east"></icon>
|
|
</span>
|
|
</div>
|
|
<div *ngIf="indicator.defaultId === null">
|
|
<button class="uk-icon-button uk-button-primary" (click)="addJsonPath(i)">
|
|
<icon name="add" [flex]="true"></icon>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
|
<div class="uk-flex uk-position-relative">
|
|
<span class="uk-padding number number-preview uk-flex uk-flex-column uk-flex-center uk-text-center">
|
|
<span *ngIf="indicatorPath.get('result').valid && indicatorPath.get('result').value !== 0"
|
|
[innerHTML]="(indicatorPath.get('format').value == 'NUMBER'?(indicatorPath.get('result').value | numberRound: 2:1:stakeholder.locale):(indicatorPath.get('result').value | numberPercentage: stakeholder.locale))">
|
|
</span>
|
|
<span *ngIf="indicatorPath.get('result').valid && indicatorPath.get('result').value === 0">
|
|
--
|
|
</span>
|
|
</span>
|
|
<div *ngIf="indicatorPath.get('result').invalid"
|
|
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
|
|
<div class="uk-position-relative uk-height-1-1">
|
|
<a class="uk-position-center uk-text-center uk-text-small uk-link-reset"
|
|
[class.uk-disabled]="indicatorPath.get('url').invalid"
|
|
(click)="validateJsonPath(i, true)">
|
|
<div>
|
|
<icon name="refresh"></icon>
|
|
</div>
|
|
<span *ngIf="indicatorPath.get('result').errors.required">Calculate</span>
|
|
<span *ngIf="indicatorPath.get('result').errors.validating">Calculating...</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="hasDifference(i, 'number')"
|
|
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
|
|
<div class="uk-position-relative uk-height-1-1">
|
|
<a class="uk-position-center uk-text-center uk-text-small uk-link-reset"
|
|
[class.uk-disabled]="indicatorPath.get('url').invalid"
|
|
(click)="refreshIndicator('number')">
|
|
<div>
|
|
<icon name="refresh"></icon>
|
|
</div>
|
|
<span>Calculate</span>
|
|
<span *ngIf="indicatorPath.get('result').errors?.validating">Calculating...</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div #editNumberNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
|
</div>
|
|
</modal-alert>
|
|
<modal-alert #editChartModal [large]="true" (alertOutput)="saveIndicator()" classTitle="uk-background-primary uk-light"
|
|
[okDisabled]="chartIndicatorFb && (chartIndicatorFb.invalid || chartIndicatorFb.pristine)">
|
|
<div *ngIf="editing" class="uk-position-relative uk-height-large">
|
|
<loading class="uk-position-center"></loading>
|
|
</div>
|
|
<div [class.uk-hidden]="editing" class="uk-padding-small">
|
|
<div *ngIf="chartIndicatorFb" [formGroup]="chartIndicatorFb" class="uk-grid" uk-grid>
|
|
<div input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('name')" placeholder="Title"></div>
|
|
<div *ngIf="stakeholder.defaultId != '-1' && ((indicator.description && indicator.description.length > 0) || !stakeholder.defaultId)"
|
|
input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('description')"
|
|
placeholder="Default Description" type="textarea">
|
|
</div>
|
|
<div *ngIf="stakeholder.defaultId" input class="uk-width-1-1"
|
|
[formInput]="chartIndicatorFb.get('additionalDescription')"
|
|
placeholder="Description" type="textarea">
|
|
</div>
|
|
<div *ngIf="showVisibility" input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('visibility')"
|
|
placeholder="Status" [options]="stakeholderUtils.visibilities" type="select">
|
|
</div>
|
|
<div input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('width')" placeholder="Chart width"
|
|
[options]="indicatorUtils.indicatorSizes" type="select">
|
|
</div>
|
|
<div input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('height')" placeholder="Chart height"
|
|
[options]="indicatorUtils.indicatorSizes" type="select">
|
|
</div>
|
|
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
|
<div class="uk-margin-medium-bottom">
|
|
<ul #chartsTransition class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
|
<li *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index"
|
|
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
|
|
[class.uk-active]="getActivePathIndex() === i">
|
|
<a (click)="setActiveChartIndicatorPath(i)">
|
|
<span>{{ getParameter(i, 'tab')?.get('value')?.value ? getParameter(i, 'tab').get('value').value : 'No title yet' }}</span>
|
|
</a>
|
|
<span *ngIf="!indicator.defaultId && chartIndicatorPaths.length > 1"
|
|
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
|
[class.uk-invisible-hover]="getActivePathIndex()!== i"
|
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
|
<a *ngIf="isCurator" class="uk-link-reset uk-flex uk-flex-middle">
|
|
<icon [flex]="true" name="more_vert"></icon>
|
|
</a>
|
|
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0;">
|
|
<ul class="uk-nav uk-dropdown-nav">
|
|
<li *ngIf="i > 0">
|
|
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, 'chart', i)">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
|
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
|
</div>
|
|
</a>
|
|
</li>
|
|
<li *ngIf="i < chartIndicatorPaths.length - 1">
|
|
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, 'chart', i, i + 1)">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
|
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
|
</div>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a (click)="removeChartIndicatorPath(i); hide(element)">
|
|
<div class="uk-flex uk-flex-middle">
|
|
<icon [flex]="true" name="delete" ratio="0.6"></icon>
|
|
<span class="uk-margin-small-left uk-width-expand">Delete</span>
|
|
</div>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</span>
|
|
</li>
|
|
<li *ngIf="!indicator.defaultId" class="uk-margin-small-top">
|
|
<a (click)="setActiveChartIndicatorPath(chartIndicatorPaths.length); $event.preventDefault()"
|
|
class="uk-flex uk-flex-middle">
|
|
<icon name="add" [flex]="true"></icon>
|
|
<span class="uk-text-uppercase">Add</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;" [formGroupName]="i">
|
|
<div *ngIf="getActivePathIndex() === i" class="uk-grid" uk-grid>
|
|
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
|
<div input class="uk-width-expand"
|
|
[title]="indicatorPath.get('url').disabled?'Default chart URLs cannot change':''"
|
|
[formInput]="indicatorPath.get('url')" placeholder="Chart URL">
|
|
</div>
|
|
<div class='uk-padding-small'>
|
|
<a class="uk-link-reset" (click)="copyToClipboard(indicatorPath.get('url').value)">
|
|
<icon [flex]="true" name="content_copy"></icon>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="uk-width-1-1" formArrayName="parameters">
|
|
<div class="uk-grid" uk-grid>
|
|
<div *ngIf="getParameter(i, 'tab')" input class="uk-width-1-1"
|
|
[formInput]="getParameter(i, 'tab').get('value')"
|
|
placeholder="Tab Title"></div>
|
|
<div *ngIf="getParameter(i, 'title')" input class="uk-width-1-1"
|
|
[formInput]="getParameter(i, 'title').get('value')"
|
|
placeholder="Chart Title"></div>
|
|
<div *ngIf="getParameter(i, 'subtitle')" input class="uk-width-1-1"
|
|
placeholder="Chart Subtitle" [formInput]="getParameter(i, 'subtitle').get('value')"
|
|
label="Chart Subtitle"></div>
|
|
<div *ngIf="!getParameter(i, 'type')" input class="uk-width-1-3@s"
|
|
[formInput]="indicatorPath.get('type')" placeholder="Chart Type"
|
|
[options]="(indicatorPath.get('type').value == 'table' && getParameter(i, 'data_title_0'))?indicatorUtils.getChartTypes(indicatorPath.get('type').value):indicatorUtils.allChartTypes"
|
|
type="select"></div>
|
|
<div *ngIf="getParameter(i, 'type')" input class="uk-width-1-3@s"
|
|
[formInput]="getParameter(i, 'type').get('value')" placeholder="Chart Type"
|
|
[options]="indicatorUtils.getChartTypes(getParameter(i, 'type').get('value').value)"
|
|
type="select"></div>
|
|
<div *ngIf="getParameter(i, 'xAxisTitle')" input class="uk-width-1-3@s"
|
|
[formInput]="getParameter(i, 'xAxisTitle').get('value')"
|
|
placeholder="X-Axis Title"></div>
|
|
<div *ngIf="getParameter(i, 'yAxisTitle')" input class="uk-width-1-3@s"
|
|
[formInput]="getParameter(i, 'yAxisTitle').get('value')"
|
|
placeholder="Y-Axis Title"></div>
|
|
<ng-container *ngIf="isLegendEnabled(indicator, i)">
|
|
<div *ngFor="let dataTitle of dataTitles(i); let j=index" input
|
|
class="uk-width-1-3@s"
|
|
[formInput]="getParameter(i, dataTitle).get('value')"
|
|
[placeholder]="'Data Title ' + (j + 1)"></div>
|
|
</ng-container>
|
|
<div *ngIf="getParameter(i, 'start_year')" input class="uk-width-1-3@s"
|
|
[formInput]="getParameter(i, 'start_year').get('value')"
|
|
placeholder="Year (From)"></div>
|
|
<div *ngIf="getParameter(i, 'end_year')" input class="uk-width-1-3@s"
|
|
[formInput]="getParameter(i, 'end_year').get('value')"
|
|
placeholder="Year (To)"></div>
|
|
<div *ngIf="getParameter(i, 'statsProfile') && statsProfiles" input
|
|
class="uk-width-1-3@s" [formInput]="getParameter(i, 'statsProfile').get('value')"
|
|
[type]="'select'" [options]="statsProfiles" placeholder="Stats Profile"></div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl"
|
|
class="uk-margin-medium-top uk-position-relative uk-width-1-1 uk-flex uk-flex-center">
|
|
<div *ngIf="(hasDifference(i)) && !indicatorPath.invalid"
|
|
class="uk-width-1-1 uk-height-large refresh-indicator">
|
|
<div class="uk-position-relative uk-height-1-1">
|
|
<a class="uk-position-center uk-text-center uk-link-reset"
|
|
(click)="refreshIndicator()">
|
|
<div>
|
|
<icon name="refresh"></icon>
|
|
</div>
|
|
<span>Click to refresh the graph view</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<iframe *ngIf="indicator.indicatorPaths[i].source !== 'image'"
|
|
[class.uk-blend-multiply]="!isFullscreen"
|
|
[src]="indicator.indicatorPaths[i].safeResourceUrl" allowfullscreen="true"
|
|
mozallowfullscreen="true" webkitallowfullscreen="true"
|
|
class="uk-width-1-1 uk-height-large"></iframe>
|
|
<div *ngIf="indicator.indicatorPaths[i].source === 'image'">
|
|
<img class="uk-width-1-1 uk-height-large uk-blend-multiply"
|
|
[src]="indicator.indicatorPaths[i].url">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div #editChartNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
|
</div>
|
|
</modal-alert>
|
|
<modal-alert #deleteModal (alertOutput)="deleteIndicator()" [overflowBody]="false"
|
|
classTitle="uk-background-primary uk-light">
|
|
<div [class.uk-invisible]="editing" class="uk-position-relative">
|
|
<div *ngIf="editing">
|
|
<loading class="uk-position-center"></loading>
|
|
</div>
|
|
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
|
"{{ indicator.name ? indicator.name : (indicator.indicatorPaths[0]?.parameters?.title ? indicator.indicatorPaths[0].parameters.title : '') }}
|
|
"</span> indicator permanently.
|
|
<div *ngIf="indicatorChildrenActionOnDelete == 'delete'" class="uk-text-bold">
|
|
Indicators of all profiles based on this default indicator, will be deleted as well.
|
|
</div>
|
|
Are you sure you want to proceed?
|
|
<div #deleteNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
|
</div>
|
|
</modal-alert>
|
|
<modal-alert #deleteSectionModal (alertOutput)="deleteSection()" [overflowBody]="false"
|
|
classTitle="uk-background-primary uk-light">
|
|
<div [class.uk-invisible]="editing" class="uk-position-relative">
|
|
<div *ngIf="editing">
|
|
<loading class="uk-position-center"></loading>
|
|
</div>
|
|
You are about to delete this section and its indicators permanently.
|
|
<div *ngIf="sectionChildrenActionOnDelete == 'delete' && !stakeholder.defaultId" class="uk-text-bold">
|
|
Sections of all profiles based on this default section and their contents, will be deleted as well.
|
|
</div>
|
|
Are you sure you want to proceed?
|
|
</div>
|
|
</modal-alert>
|