[plugins-functionality | DONE | ADDED ] add optional link in stats plugin
This commit is contained in:
parent
1b99c3b405
commit
9c370fd53b
|
@ -1,4 +1,9 @@
|
||||||
<div *ngIf="pluginObject" class="uk-container uk-section">
|
<div *ngIf="pluginObject" class="uk-container uk-section">
|
||||||
<h3>{{pluginObject.title}} </h3>
|
<h3>{{pluginObject.title}} </h3>
|
||||||
|
<a *ngIf="pluginObject.url.url && pluginObject.url.url.length > 0" [href]="pluginObject.url.url" [target]="pluginObject.url.target"
|
||||||
|
class="uk-float-right uk-text-uppercase uk-button uk-button-text">
|
||||||
|
{{pluginObject.url.linkText}}
|
||||||
|
</a>
|
||||||
|
<!-- <a *ngIf="pluginObject.url.url && pluginObject.url.url.length > 0" class = "uk-float-right" href="" [target]="">{{pluginObject.url.linkText}}</a>-->
|
||||||
<plugin-stats-monitor [pluginObject]="pluginObject"></plugin-stats-monitor>
|
<plugin-stats-monitor [pluginObject]="pluginObject"></plugin-stats-monitor>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {PluginBaseComponent, PluginBaseInfo} from "../../utils/base-plugin.component";
|
import {PluginBaseComponent, PluginBaseInfo, PluginURL} from "../../utils/base-plugin.component";
|
||||||
import {HttpClient} from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
|
||||||
export class PluginStats extends PluginBaseInfo{
|
export class PluginStats extends PluginBaseInfo{
|
||||||
title = "Indicators"
|
title = "Indicators"
|
||||||
disabledIndicators = [];
|
disabledIndicators = [];
|
||||||
|
url:PluginURL = new PluginURL("123", "More","_blank", false);
|
||||||
|
|
||||||
|
|
||||||
compare(oldObject): any {
|
compare(oldObject): any {
|
||||||
|
|
|
@ -8,7 +8,15 @@ import {PluginStats} from "./plugin-stats.component";
|
||||||
<div *ngIf="pluginObject" class="uk-padding-xsmall">
|
<div *ngIf="pluginObject" class="uk-padding-xsmall">
|
||||||
<plugin-field-edit [value]="pluginObject.title"
|
<plugin-field-edit [value]="pluginObject.title"
|
||||||
type="text" field="title" (changed)="valueChanged($event)"></plugin-field-edit>
|
type="text" field="title" (changed)="valueChanged($event)"></plugin-field-edit>
|
||||||
|
<div class=" uk-margin-top uk-text-meta uk-text-xsmall">External Link</div>
|
||||||
|
<div class="uk-margin-small-top">
|
||||||
|
<plugin-field-edit [value]="pluginObject.url.url"
|
||||||
|
type="text" field="url" (changed)="urlValueChanged($event)"></plugin-field-edit>
|
||||||
|
</div>
|
||||||
|
<div class="uk-margin-small-top uk-margin-small-top">
|
||||||
|
<plugin-field-edit [value]="pluginObject.url.linkText"
|
||||||
|
type="text" field="linkText" (changed)="urlValueChanged($event)"></plugin-field-edit>
|
||||||
|
</div>
|
||||||
<!-- <div class=" uk-margin-top uk-text-meta uk-text-xsmall"> Number indicators</div>-->
|
<!-- <div class=" uk-margin-top uk-text-meta uk-text-xsmall"> Number indicators</div>-->
|
||||||
|
|
||||||
<!-- <ng-container *ngFor="let number of stakeholder.topics[0].category[0].subcategory[0].numbers">-->
|
<!-- <ng-container *ngFor="let number of stakeholder.topics[0].category[0].subcategory[0].numbers">-->
|
||||||
|
@ -23,7 +31,7 @@ import {PluginStats} from "./plugin-stats.component";
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </ng-container>-->
|
<!-- </ng-container>-->
|
||||||
|
|
||||||
<div class=" uk-margin-top uk-text-meta uk-text-xsmall"> Chart indicators</div>
|
<div class=" uk-margin-medium-top uk-text-meta uk-text-xsmall"> Chart indicators</div>
|
||||||
<ng-container *ngFor="let section of stakeholder.topics[0].categories[0].subCategories[0].charts">
|
<ng-container *ngFor="let section of stakeholder.topics[0].categories[0].subCategories[0].charts">
|
||||||
|
|
||||||
<ng-container *ngFor="let indicator of section.indicators">
|
<ng-container *ngFor="let indicator of section.indicators">
|
||||||
|
@ -63,5 +71,11 @@ export class PluginStatsFormComponent extends PluginBaseFormComponent<PluginStat
|
||||||
this.valuesChanged.emit({field:$event.field, value: $event.value, type: 'parent'})
|
this.valuesChanged.emit({field:$event.field, value: $event.value, type: 'parent'})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
urlValueChanged($event:PluginEditEvent){
|
||||||
|
console.log($event.field,$event.value)
|
||||||
|
this.pluginObject['url'][$event.field]=$event.value;
|
||||||
|
$event.field = "url";
|
||||||
|
$event.value = this.pluginObject['url'];
|
||||||
|
this.valuesChanged.emit($event)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue