diff --git a/src/app/topic/indicators.component.ts b/src/app/topic/indicators.component.ts
index 702b8b2..6e2a8b6 100644
--- a/src/app/topic/indicators.component.ts
+++ b/src/app/topic/indicators.component.ts
@@ -15,7 +15,7 @@ import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from "@angul
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
import {StatisticsService} from "../utils/services/statistics.service";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
-import {DomSanitizer} from "@angular/platform-browser";
+import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";
import {StakeholderService} from "../services/stakeholder.service";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {Subscriber} from "rxjs";
@@ -69,6 +69,9 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
* Toggles
*/
public grid: boolean = true;
+ /** Safe Urls*/
+ public safeUrls: Map
= new Map([]);
+
private subscriptions: any[] = [];
private urlSubscriptions: any[] = [];
@ViewChild('editModal') editModal: AlertModal;
@@ -224,7 +227,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
this.displayCharts.forEach(section => {
section.indicators.forEach(indicator => {
indicator.indicatorPaths.forEach(indicatorPath => {
- indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
+ let url = this.indicatorUtils.getFullUrl(indicatorPath);
+ if (!this.safeUrls.get('url')) {
+ indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
+ this.safeUrls.set(url, indicatorPath.safeResourceUrl);
+ }
});
})
});
@@ -475,8 +482,18 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
}
this.filterCharts();
this.indicatorFb = null;
+ UIkit.notification('Section has been successfully saved', {
+ status: 'success',
+ timeout: 3000,
+ pos: 'top-left'
+ });
}, error => {
this.indicatorFb = null;
+ UIkit.notification(error.error.message, {
+ status: 'danger',
+ timeout: 3000,
+ pos: 'top-left'
+ });
});
}
@@ -549,6 +566,17 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
this.numbers.find(section => section._id === this.section._id).indicators.splice(this.index, 1);
this.filterNumbers();
}
+ UIkit.notification('Indicator has been successfully deleted', {
+ status: 'success',
+ timeout: 3000,
+ pos: 'top-left'
+ });
+ }, error => {
+ UIkit.notification(error.error.message, {
+ status: 'danger',
+ timeout: 3000,
+ pos: 'top-left'
+ });
});
}
@@ -563,6 +591,17 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
];
this.stakeholderService.toggleStatus(this.properties.monitorServiceAPIURL, path).subscribe(isActive => {
indicator.isActive = isActive;
+ UIkit.notification('Indicator has been successfully changed to ' + (isActive?'active':'inactive'), {
+ status: 'success',
+ timeout: 3000,
+ pos: 'top-left'
+ });
+ }, error => {
+ UIkit.notification(error.error.message, {
+ status: 'danger',
+ timeout: 3000,
+ pos: 'top-left'
+ });
});
}
@@ -577,6 +616,17 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
];
this.stakeholderService.toggleAccess(this.properties.monitorServiceAPIURL, path).subscribe(isPublic => {
indicator.isPublic = isPublic;
+ UIkit.notification('Indicator has been successfully changed to ' + (isPublic?'public':'private'), {
+ status: 'success',
+ timeout: 3000,
+ pos: 'top-left'
+ });
+ }, error => {
+ UIkit.notification(error.error.message, {
+ status: 'danger',
+ timeout: 3000,
+ pos: 'top-left'
+ });
});
}
diff --git a/src/app/topic/topic.component.html b/src/app/topic/topic.component.html
index 2cd991a..0d21a13 100644
--- a/src/app/topic/topic.component.html
+++ b/src/app/topic/topic.component.html
@@ -21,10 +21,10 @@
- Edit
-
- {{stakeholder.topics[topicIndex].isActive ? 'Deactivate' : 'Activate'}}
+ {{stakeholder.topics[topicIndex].isActive ? 'Inactive' : 'Active'}}
-
- {{stakeholder.topics[topicIndex].isPublic?'Unpublish':'Publish'}}
+ {{stakeholder.topics[topicIndex].isPublic?'Private':'Public'}}
- Delete
@@ -52,10 +52,10 @@
- Edit
-
- {{category.isActive ? 'Deactivate' : 'Activate'}}
+ {{category.isActive ? 'Inactive' : 'Active'}}
-
- {{category.isPublic?'Unpublish':'Publish'}}
+ {{category.isPublic?'Private':'Public'}}
- Delete
@@ -81,10 +81,10 @@
- Edit
-
- {{subcategory.isActive ? 'Deactivate' : 'Activate'}}
+ {{subcategory.isActive ? 'Inactive' : 'Active'}}
-
- {{subcategory.isPublic?'Unpublish':'Publish'}}
+ {{subcategory.isPublic?'Private':'Public'}}
- Delete
diff --git a/src/app/topic/topic.component.ts b/src/app/topic/topic.component.ts
index 389d24f..fd4bf04 100644
--- a/src/app/topic/topic.component.ts
+++ b/src/app/topic/topic.component.ts
@@ -486,7 +486,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;
- UIkit.notification(StringUtils.capitalize(this.type) + ' has been successfully ' + (isActive ? 'activated' : 'deactivated'), {
+ UIkit.notification(StringUtils.capitalize(this.type) + ' has been successfully changed to ' + (isActive ? 'active' : 'inactive'), {
status: 'success',
timeout: 3000,
pos: 'top-left'