Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
feat(analytics) : handle deleted api/application analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompiegne committed Nov 21, 2016
1 parent 7ec74b3 commit 62a92b9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/app/api/admin/analytics/analytics.controller.js
Expand Up @@ -178,9 +178,10 @@ class ApiAnalyticsController {
} else {
this.ApplicationService.get(id).then(response => {
_this.cache[id] = response.data;
_this.cache[id].exists = true;
deferred.resolve(this.cache[id]);
}).catch(function() {
_this.cache[id] = { 'name' : id };
_this.cache[id] = { 'name' : id, 'exists' : false };
deferred.resolve(_this.cache[id]);
});
}
Expand Down
9 changes: 4 additions & 5 deletions src/app/api/admin/analytics/analyticsApplicationModel.html
Expand Up @@ -15,9 +15,8 @@
limitations under the License.
-->
<span ng-if="entity.name">
{{entity.name}}
</span>
<span ng-if="!entity.name">
{{id}}
<span ng-if="entity.exists">{{entity.name}}</span>

<span ng-if="!entity.exists" style="color: grey;">
Deleted application
</span>
Expand Up @@ -175,9 +175,10 @@ class ApplicationAnalyticsController {
} else {
this.ApiService.get(id).then(response => {
_this.cache[id] = response.data;
_this.cache[id].exists = true;
deferred.resolve(this.cache[id]);
}).catch(function() {
_this.cache[id] = { 'name' : id, 'version' : 'N/A' };
_this.cache[id] = { 'name' : id, 'exists' : false };
deferred.resolve(_this.cache[id]);
});
}
Expand Down
7 changes: 4 additions & 3 deletions src/app/application/details/analytics/analyticsAPIModel.html
Expand Up @@ -15,9 +15,10 @@
limitations under the License.
-->
<span ng-if="entity.name">
<span ng-if="entity.exists">
{{entity.name}} <small>({{entity.version}})</small>
</span>
<span ng-if="!entity.name">
{{id}}

<span ng-if="!entity.exists" style="color: grey;">
Deleted API
</span>
12 changes: 10 additions & 2 deletions src/app/platform/dashboard/dashboardModel.html
Expand Up @@ -19,6 +19,14 @@
<a ng-if="entity.exists" ui-sref="apis.admin.analytics({ apiId: entity.id } )">
{{entity.name}} <small ng-if="model === 'api'">({{entity.version}})</small>
</a>
<span ng-if="!entity.exists" style="color: grey;">{{entity.name}}</span>
<span ng-if="!entity.exists" style="color: grey;">
Deleted API
</span>
</span>

<span ng-if="entity && model === 'application'">
<span ng-if="entity.exists">{{entity.name}}</span>
<span ng-if="!entity.exists" style="color: grey;" layout="row">
Deleted application
</span>
</span>
<span ng-if="entity && model === 'application'" ng-style="!entity.exists && {'color':'grey'}">{{entity.name}}</span>

0 comments on commit 62a92b9

Please sign in to comment.