Update upgrade status when externalId changes

This commit is contained in:
Vincent Fiduccia 2015-10-19 09:36:19 -07:00
parent e33426f9d4
commit 045d89cb15
3 changed files with 26 additions and 11 deletions

View File

@ -6,6 +6,7 @@ export default Ember.Component.extend({
access: Ember.inject.service(), access: Ember.inject.service(),
projects: Ember.inject.service(), projects: Ember.inject.service(),
project: Ember.computed.alias('projects.current'), project: Ember.computed.alias('projects.current'),
cookies: Ember.inject.service(),
currentPath: null, currentPath: null,
authController: null, authController: null,
@ -44,6 +45,10 @@ export default Ember.Component.extend({
return this.get('isAdmin') && this.get('store').hasRecordFor('schema','setting'); return this.get('isAdmin') && this.get('store').hasRecordFor('schema','setting');
}.property(), }.property(),
showCatalog: function() {
return this.get('cookies').get('showcatalog') === 'true';
}.property(),
actions: { actions: {
showAbout() { showAbout() {
this.sendAction('showAbout'); this.sendAction('showAbout');

View File

@ -123,7 +123,9 @@
{{/if}} {{/if}}
{{#if isApplicationsTab}} {{#if isApplicationsTab}}
{{#link-to "environments"}}<i class="icon icon-globe"></i> Stacks{{/link-to}} {{#link-to "environments"}}<i class="icon icon-globe"></i> Stacks{{/link-to}}
{{#if showCatalog}}
{{#link-to "applications-tab.catalog" "all"}}<i class="fa fa-database"></i> Catalog{{/link-to}} {{#link-to "applications-tab.catalog" "all"}}<i class="fa fa-database"></i> Catalog{{/link-to}}
{{/if}}
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<a class="dropdown-toggle hand" data-toggle="dropdown" aria-expanded="false"> <a class="dropdown-toggle hand" data-toggle="dropdown" aria-expanded="false">

View File

@ -41,16 +41,7 @@ export default Ember.Component.extend({
upgradeInfo: null, upgradeInfo: null,
didInitAttrs() { didInitAttrs() {
var uuid = this.get('environmentResource.externalId'); this.updateStatus();
if ( uuid )
{
this.set('upgradeStatus', LOADING);
queue.push({uuid: uuid, obj: this});
}
else
{
this.set('upgradeStatus', NONE);
}
}, },
click: function() { click: function() {
@ -94,4 +85,21 @@ export default Ember.Component.extend({
return 'Error checking upgrades'; return 'Error checking upgrades';
} }
}.property('upgradeStatus'), }.property('upgradeStatus'),
updateStatus() {
var uuid = this.get('environmentResource.externalId');
if ( uuid )
{
this.set('upgradeStatus', LOADING);
queue.push({uuid: uuid, obj: this});
}
else
{
this.set('upgradeStatus', NONE);
}
},
externalIdChanged: function() {
this.updateStatus();
}.property('environmentResource.externalId'),
}); });