[Monitor Dashboard | Trunk]: Fix bug with number indicators and with subcategory content while is recreated
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@58985 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
5a13ef0a57
commit
03879e7eeb
|
@ -76,7 +76,7 @@
|
|||
"production": {
|
||||
"browserTarget": "ng-universal-demo:build:production"
|
||||
},
|
||||
"production": {
|
||||
"beta": {
|
||||
"browserTarget": "ng-universal-demo:build:beta"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,7 +226,8 @@
|
|||
<!--<button class="md-btn md-btn-mini"><i class="material-icons rotate-90">drag_indicator</i></button>-->
|
||||
<button [disabled]="editing || chart.defaultId "
|
||||
[title]="(chart.defaultId?'Default sections cannot be deleted':'Delete section')"
|
||||
class="md-btn md-btn-mini" (click)="deleteSectionOpen(chart, i, 'chart', 'delete')"><i class="material-icons">clear</i>
|
||||
class="md-btn md-btn-mini" (click)="deleteSectionOpen(chart, i, 'chart', 'delete')"><i
|
||||
class="material-icons">clear</i>
|
||||
</button>
|
||||
<!-- <ng-container *ngIf="!stakeholder.defaultId">-->
|
||||
<!-- <button [disabled]="editing || chart.defaultId " class="md-btn md-btn-mini"-->
|
||||
|
@ -294,7 +295,8 @@
|
|||
<div #element uk-dropdown="mode: click; pos: bottom-right; delay-hide: 0; flip: false"
|
||||
class="uk-padding-remove-horizontal">
|
||||
<ul class="uk-nav uk-dropdown-nav">
|
||||
<li *ngIf="!editing"><a (click)="editChartIndicatorOpen(chart, indicator._id);hide(element)">Edit</a></li>
|
||||
<li *ngIf="!editing"><a (click)="editChartIndicatorOpen(chart, indicator._id);hide(element)">Edit</a>
|
||||
</li>
|
||||
<li *ngIf="!editing"><a (click)="toggleIndicatorStatus(chart._id, indicator);hide(element)">
|
||||
{{indicator.isActive ? 'Inactive' : 'Active'}}</a>
|
||||
</li>
|
||||
|
@ -302,7 +304,8 @@
|
|||
{{indicator.isPublic ? 'Private' : 'Public'}}</a>
|
||||
</li>
|
||||
<hr *ngIf="!indicator.defaultId " class="uk-nav-divider">
|
||||
<li *ngIf="!editing && !indicator.defaultId "><a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">
|
||||
<li *ngIf="!editing && !indicator.defaultId "><a
|
||||
(click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">
|
||||
Delete</a>
|
||||
<!-- <a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">Delete from all profiles</a>-->
|
||||
<!-- <a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'disconnect');hide(element)">Delete and disconnect from all profiles</a>-->
|
||||
|
@ -348,7 +351,7 @@
|
|||
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
||||
class="uk-width-1-1 uk-height-medium"></iframe>
|
||||
<div *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source === 'image'">
|
||||
<img class="uk-width-1-1 uk-height-medium" [src]="indicator.indicatorPaths[i].url">
|
||||
<img class="uk-width-1-1 uk-height-medium" [src]="indicator.indicatorPaths[0].url">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -41,7 +41,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
public categoryIndex: number = 0;
|
||||
@Input()
|
||||
public subcategoryIndex: number = 0;
|
||||
@Input()
|
||||
public stakeholder: Stakeholder = null;
|
||||
public user = null;
|
||||
public preview: string;
|
||||
|
@ -106,8 +105,15 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.userManagementService.getUserInfo().subscribe(user => {
|
||||
this.user = user;
|
||||
});
|
||||
this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
this.stakeholder = stakeholder;
|
||||
if(this.stakeholder) {
|
||||
this.buildFilters();
|
||||
this.buildSections();
|
||||
this.filterCharts();
|
||||
this.filterNumbers();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
@ -133,6 +139,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.filterCharts();
|
||||
this.filterNumbers();
|
||||
}
|
||||
this.setPreview();
|
||||
}
|
||||
|
||||
setPreview() {
|
||||
if(this.stakeholder && this.stakeholder.topics[this.topicIndex]) {
|
||||
this.preview = '/' + this.stakeholder.alias + '/' + this.stakeholder.topics[this.topicIndex].alias;
|
||||
if (this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]) {
|
||||
this.preview += '/' + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].alias;
|
||||
|
@ -141,6 +152,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initReorder() {
|
||||
this.subscriptions.forEach(value => {
|
||||
|
@ -264,7 +276,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.filterByKeyword(HelperFunctions.copy(this.numbers), this.filters.value.keyword),
|
||||
this.filters.value.status),
|
||||
this.filters.value.privacy);
|
||||
console.log(this.numbers);
|
||||
this.buildSections();
|
||||
}
|
||||
|
||||
|
@ -519,7 +530,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.indicator = HelperFunctions.copy(this.section.indicators[this.index]);
|
||||
this.numberIndicatorFb = this.fb.group({
|
||||
_id: this.fb.control(this.indicator._id),
|
||||
name: this.fb.control(this.indicator.name),
|
||||
name: this.fb.control(this.indicator.name, Validators.required),
|
||||
description: this.fb.control(this.indicator.description),
|
||||
isPublic: this.fb.control(this.indicator.isPublic),
|
||||
isActive: this.fb.control(this.indicator.isActive),
|
||||
|
@ -535,7 +546,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.indicator = new Indicator('', '', 'number', 'small', true, true, []);
|
||||
this.numberIndicatorFb = this.fb.group({
|
||||
_id: this.fb.control(this.indicator._id),
|
||||
name: this.fb.control(this.indicator.name),
|
||||
name: this.fb.control(this.indicator.name, Validators.required),
|
||||
description: this.fb.control(this.indicator.description),
|
||||
isPublic: this.fb.control(this.indicator.isPublic),
|
||||
isActive: this.fb.control(this.indicator.isActive),
|
||||
|
@ -619,6 +630,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.section = this.charts.find(section => section._id === this.section._id);
|
||||
} else {
|
||||
this.indicator = this.numberIndicatorFb.value;
|
||||
this.section = this.numbers.find(section => section._id === this.section._id);
|
||||
}
|
||||
let path = [
|
||||
this.stakeholder._id,
|
||||
|
@ -633,8 +645,13 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
} else {
|
||||
this.section.indicators.push(indicator);
|
||||
}
|
||||
if(this.indicator.type === "chart") {
|
||||
this.filterCharts();
|
||||
this.chartIndicatorFb = null;
|
||||
} else {
|
||||
this.filterNumbers();
|
||||
this.numberIndicatorFb = null;
|
||||
}
|
||||
UIkit.notification('Indicator has been successfully saved', {
|
||||
status: 'success',
|
||||
timeout: 3000,
|
||||
|
|
|
@ -143,7 +143,6 @@
|
|||
</div>
|
||||
</aside>
|
||||
<indicators *ngIf="stakeholder" [properties]="properties"
|
||||
[stakeholder]="stakeholder"
|
||||
[topicIndex]="topicIndex"
|
||||
[categoryIndex]="categoryIndex"
|
||||
[subcategoryIndex]="subCategoryIndex"></indicators>
|
||||
|
|
|
@ -459,6 +459,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
|
|||
private save(message: string, path: string[], saveElement: any, callback: Function, redirect = false) {
|
||||
this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, saveElement, path).subscribe(saveElement => {
|
||||
callback(saveElement);
|
||||
this.stakeholderService.setStakeholder(this.stakeholder);
|
||||
UIkit.notification(message, {
|
||||
status: 'success',
|
||||
timeout: 3000,
|
||||
|
@ -481,6 +482,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
|
|||
private delete(message: string, path: string[], callback: Function, redirect = false) {
|
||||
this.stakeholderService.deleteElement(this.properties.monitorServiceAPIURL, path, this.elementChildrenActionOnDelete).subscribe(() => {
|
||||
callback();
|
||||
this.stakeholderService.setStakeholder(this.stakeholder);
|
||||
UIkit.notification(message, {
|
||||
status: 'success',
|
||||
timeout: 3000,
|
||||
|
@ -501,6 +503,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
|
|||
private toggleStatus(element: Topic | Category | SubCategory, path: string[]) {
|
||||
this.stakeholderService.toggleStatus(this.properties.monitorServiceAPIURL, path).subscribe(isActive => {
|
||||
element.isActive = isActive;
|
||||
this.stakeholderService.setStakeholder(this.stakeholder);
|
||||
UIkit.notification(StringUtils.capitalize(this.type) + ' has been successfully changed to ' + (isActive ? 'active' : 'inactive'), {
|
||||
status: 'success',
|
||||
timeout: 3000,
|
||||
|
@ -518,6 +521,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
|
|||
private toggleAccess(element: Topic | Category | SubCategory, path: string[]) {
|
||||
this.stakeholderService.toggleAccess(this.properties.monitorServiceAPIURL, path).subscribe(isPublic => {
|
||||
element.isPublic = isPublic;
|
||||
this.stakeholderService.setStakeholder(this.stakeholder);
|
||||
UIkit.notification(StringUtils.capitalize(this.type) + ' has been successfully changed to ' + (isPublic ? 'public' : 'private'), {
|
||||
status: 'success',
|
||||
timeout: 3000,
|
||||
|
|
|
@ -436,20 +436,24 @@ body.dashboard {
|
|||
|
||||
.dashboard .section:hover .tools .md-btn-group::before {
|
||||
content: "";
|
||||
border-bottom: 23px solid var(--secondary-color);
|
||||
border-bottom: 24px solid var(--secondary-color);
|
||||
border-left:solid 12px transparent;
|
||||
width: 0;
|
||||
margin-left: -1px;
|
||||
padding-bottom: 2px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: -12px;
|
||||
}
|
||||
|
||||
.dashboard .section:hover .tools .md-btn-group::after {
|
||||
content: "";
|
||||
border-bottom: 23px solid var(--secondary-color);
|
||||
border-bottom: 24px solid var(--secondary-color);
|
||||
border-right: solid 12px transparent;
|
||||
width: 0;
|
||||
margin-left: -1px;
|
||||
padding-bottom: 2px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: -11px;
|
||||
}
|
||||
|
||||
/* New section*/
|
||||
|
|
Loading…
Reference in New Issue