diff --git a/src/components/ApplicationDetails.vue b/src/components/ApplicationDetails.vue
index d0c767e3..90e0e01f 100644
--- a/src/components/ApplicationDetails.vue
+++ b/src/components/ApplicationDetails.vue
@@ -5,7 +5,7 @@
-
+
diff --git a/src/components/Applications.vue b/src/components/Applications.vue
index 1f6a2239..0fe34d3d 100644
--- a/src/components/Applications.vue
+++ b/src/components/Applications.vue
@@ -5,7 +5,7 @@
-
+
diff --git a/src/components/ConsumerMessageDetails.vue b/src/components/ConsumerMessageDetails.vue
index 9a22fcfc..30882d24 100644
--- a/src/components/ConsumerMessageDetails.vue
+++ b/src/components/ConsumerMessageDetails.vue
@@ -5,7 +5,7 @@
-
+
diff --git a/src/components/ConsumerMessages.vue b/src/components/ConsumerMessages.vue
index 2628a423..f80e973a 100644
--- a/src/components/ConsumerMessages.vue
+++ b/src/components/ConsumerMessages.vue
@@ -5,7 +5,7 @@
-
+
-
+
Promote to production
diff --git a/src/components/FunctionalGroups.vue b/src/components/FunctionalGroups.vue
index 352ce86b..decc7580 100644
--- a/src/components/FunctionalGroups.vue
+++ b/src/components/FunctionalGroups.vue
@@ -5,7 +5,7 @@
-
+
-
+
- Promote changes to production
+ Promote staging to production
Module Config
@@ -243,9 +243,9 @@
-
+
- This will promote the module config to production, immediately updating the production policy table. Are you sure you want to do this?
+ This will promote the saved module config state on STAGING to production, immediately updating the production policy table. Are you sure you want to do this?
-
+
-
+
-
+
diff --git a/src/components/common/Header.vue b/src/components/common/Header.vue
index 95b837b6..26150bcb 100644
--- a/src/components/common/Header.vue
+++ b/src/components/common/Header.vue
@@ -3,21 +3,39 @@
-
+
+
+
+
-
-
-
+
@@ -27,18 +45,91 @@
export default {
data: function(){
return {
- "is_logged_in": this.$session.exists()
+ "is_logged_in": this.$session.exists(),
+ "isHidden": true,
+ "innerWidth": window.innerWidth,
+ "badge_counts": {
+ "applications": 0,
+ "functional_groups": 0,
+ "consumer_messages": 0
+ },
+ "intervals": [
+ setInterval(this.setPendingAppCount, 60000),
+ setInterval(this.setUnmappedFunctionalCount, 60000)
+ ]
};
},
methods: {
"openUserNav": function(){
eventBus.$emit("openUserNav");
+ },
+ "onResize": function () {
+ this.innerWidth = window.innerWidth
+ },
+ "setPendingAppCount": function() {
+ // get number of pending applications
+ // prevent redirects in case we aren't logged in
+ this.httpRequest("get", "applications", {
+ "params": {
+ "approval_status": "PENDING"
+ },
+ preventAuthRedirect: true,
+ }, (err, response) => {
+ if(err){
+ // error
+ console.log("Error receiving PENDING applications.");
+ }else{
+ // success
+ response.json().then(parsed => {
+ this.badge_counts.applications = parsed.data.applications.length;
+ });
+ }
+ });
+ },
+ "setUnmappedFunctionalCount": function() {
+ // get number of unmapped RPCs and parameters in PRODUCTION
+ // prevent redirects in case we aren't logged in
+ this.httpRequest("get", "permissions/unmapped?environment=PRODUCTION", {
+ preventAuthRedirect: true,
+ }, (err, response) => {
+ if(err){
+ // error
+ console.log("Error fetching functional group data.");
+ console.log(response);
+ }else{
+ // success
+ response.json().then(parsed => {
+ this.badge_counts.functional_groups = (parsed.data.unmapped_rpc_count + parsed.data.unmapped_parameter_count);
+ });
+ }
+ });
}
},
watch: {
"$route": function(){
+ // if a login session was just started, update the badge counts
+ if (!this.is_logged_in && this.$session.exists()) {
+ this.setPendingAppCount();
+ this.setUnmappedFunctionalCount();
+ }
this.is_logged_in = this.$session.exists();
+ },
+ },
+ created: function(){
+ this.setPendingAppCount();
+ this.setUnmappedFunctionalCount();
+ },
+ mounted() {
+ this.$nextTick(() => {
+ window.addEventListener('resize', this.onResize);
+ })
+ },
+ beforeDestroy() {
+ window.removeEventListener('resize', this.onResize);
+ // ensure closing of all modals
+ for(var i = 0; i < this.intervals.length; i++){
+ clearInterval(this.intervals[i]);
}
- }
+ },
}
\ No newline at end of file
diff --git a/src/components/common/SideNav.vue b/src/components/common/SideNav.vue
index dd56f25a..2bf75c7e 100644
--- a/src/components/common/SideNav.vue
+++ b/src/components/common/SideNav.vue
@@ -1,5 +1,5 @@
-