[Monitor Dashboard]: Add publish/unpublish

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57849 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2019-12-09 15:52:08 +00:00
parent fa0c0af6e0
commit bbaf91e51b
2 changed files with 20 additions and 6 deletions

View File

@ -80,9 +80,9 @@
<li><a (click)="toggleIndicatorStatus(indicator)"> <li><a (click)="toggleIndicatorStatus(indicator)">
{{indicator.isActive ? 'Deactivate' : 'Activate'}}</a> {{indicator.isActive ? 'Deactivate' : 'Activate'}}</a>
</li> </li>
<!--<li><a (click)="editChartIndicatorOpen(indicator._id)"> <li><a (click)="toggleIndicatorAccess(indicator)">
{{indicator.isPublic?'Unpublish':'Publish'}}</a> {{indicator.isPublic?'Unpublish':'Publish'}}</a>
</li>--> </li>
<li class="uk-nav-divider"></li> <li class="uk-nav-divider"></li>
<li><a (click)="deleteIndicatorOpen(indicator._id, 'number')">Delete</a> <li><a (click)="deleteIndicatorOpen(indicator._id, 'number')">Delete</a>
</li> </li>
@ -157,9 +157,9 @@
<li><a (click)="toggleIndicatorStatus(indicator)"> <li><a (click)="toggleIndicatorStatus(indicator)">
{{indicator.isActive ? 'Deactivate' : 'Activate'}}</a> {{indicator.isActive ? 'Deactivate' : 'Activate'}}</a>
</li> </li>
<!--<li><a (click)="editChartIndicatorOpen(indicator._id)"> <li><a (click)="toggleIndicatorAccess(indicator)">
{{indicator.isPublic?'Unpublish':'Publish'}}</a> {{indicator.isPublic?'Unpublish':'Publish'}}</a>
</li>--> </li>
<li class="uk-nav-divider"></li> <li class="uk-nav-divider"></li>
<li><a (click)="deleteIndicatorOpen(indicator._id)">Delete</a></li> <li><a (click)="deleteIndicatorOpen(indicator._id)">Delete</a></li>
</ul> </ul>

View File

@ -468,8 +468,22 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id,
indicator._id indicator._id
]; ];
this.stakeholderService.toggleStatus(this.properties.monitorServiceAPIURL, path).subscribe(status => { this.stakeholderService.toggleStatus(this.properties.monitorServiceAPIURL, path).subscribe(isActive => {
indicator.isActive = status; indicator.isActive = isActive;
this.stakeholderService.setStakeholder(this.stakeholder);
});
}
toggleIndicatorAccess(indicator: Indicator) {
let path = [
this.stakeholder._id,
this.stakeholder.topics[this.topicIndex]._id,
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id,
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id,
indicator._id
];
this.stakeholderService.toggleAccess(this.properties.monitorServiceAPIURL, path).subscribe(isPublic => {
indicator.isPublic = isPublic;
this.stakeholderService.setStakeholder(this.stakeholder); this.stakeholderService.setStakeholder(this.stakeholder);
}); });
} }