Merge pull request #740 from westlywright/dev-1.1-bugs

Resolve route display and tool tip issue on stack details
This commit is contained in:
Vincent Fiduccia 2016-06-16 17:40:38 -07:00 committed by GitHub
commit 9bc925e005
7 changed files with 74 additions and 43 deletions

View File

@ -42,9 +42,9 @@
{{header-state model=model classNames="pull-right"}} {{header-state model=model classNames="pull-right"}}
<div class="btn-group r-ml10"> <div class="btn-group r-ml10">
{{tooltip-link icon="icon-tasks" text=(t 'tooltipLink.list') options=listLinkOptions}} {{#link-to "environment.index" classNames="btn btn-sm btn-default"}}{{tooltip-link icon="icon-tasks" text=(t 'tooltipLink.list') options=listLinkOptions}}{{/link-to}}
{{tooltip-link icon="icon-share" text=(t 'tooltipLink.linkGraph') options=graphLinkOptions}} {{#link-to "environment.graph" classNames="btn btn-sm btn-default"}}{{tooltip-link icon="icon-share" text=(t 'tooltipLink.linkGraph') options=graphLinkOptions}}{{/link-to}}
{{tooltip-link icon="icon-file" text=(t 'tooltipLink.composeYaml') options=yamlLinkOptions}} {{#link-to "environment.code" classNames="btn btn-sm btn-default"}}{{tooltip-link icon="icon-file" text=(t 'tooltipLink.composeYaml') options=yamlLinkOptions}}{{/link-to}}
</div> </div>
{{upgrade-btn environmentResource=model classNames="r-ml10"}} {{upgrade-btn environmentResource=model classNames="r-ml10"}}

View File

@ -2,5 +2,5 @@
value=instance.userdata value=instance.userdata
classNames="form-control" classNames="form-control"
rows="10" rows="10"
placeholder=(if isVm "e.g. Configuration information for the virtual machine" "e.g. Configuration information for the container") placeholder=(if isVm (t 'formUserData.isVmPlaceholder') (t 'formUserData.placeholder'))
}} }}

View File

@ -5,6 +5,7 @@ export default Ember.Component.extend({
originalModel : null, originalModel : null,
action : null, action : null,
alternateLabel : alternateLabel, alternateLabel : alternateLabel,
intl : Ember.inject.service(),
actions: { actions: {
@ -25,22 +26,23 @@ export default Ember.Component.extend({
}, 500); }, 500);
}, },
isService: Ember.computed('originalModel.type', function() { isService: Ember.computed('originalModel.type','intl._locale', function() {
let type = this.get('originalModel.type'); let type = this.get('originalModel.type');
let out = {}; let out = {};
let intl = this.get('intl');
switch (type) { switch (type) {
case 'project': case 'project':
out.message = 'deactivate your environment'; out.message = intl.t('modalConfirmDeactiviate.buttons.project.message');
out.button = 'Deactivate'; out.button = intl.t('modalConfirmDeactiviate.buttons.project.button');
break; break;
case 'environment': case 'environment':
out.message = 'stop services for'; out.message = intl.t('modalConfirmDeactiviate.buttons.environment.message');
out.button = 'Stop Services'; out.button = intl.t('modalConfirmDeactiviate.buttons.environment.button');
break; break;
default: default:
out.message = 'deactivate'; out.message = intl.t('modalConfirmDeactiviate.buttons.default.message');
out.button = 'Deactivate'; out.button = intl.t('modalConfirmDeactiviate.buttons.default.button');
break; break;
} }

View File

@ -1,15 +1,8 @@
import Ember from 'ember'; import Ember from 'ember';
export default Ember.Component.extend({ export default Ember.Component.extend({
tagName : 'button', tagName : '',
classNames : ['btn', 'btn-sm', 'btn-default'],
icon : null, icon : null,
text : null, text : null,
options : null, options : null,
click() {
var options = this.get('options');
this.get('router').transitionTo(options.route, {queryParams: options.options});
},
}); });

View File

@ -44,6 +44,7 @@ function getUpgradeInfo(task, cb) {
export default Ember.Component.extend({ export default Ember.Component.extend({
environmentResource: null, environmentResource: null,
upgradeStatus: null, upgradeStatus: null,
intl: Ember.inject.service(),
tagName: 'button', tagName: 'button',
classNames: ['btn','btn-sm'], classNames: ['btn','btn-sm'],
@ -90,6 +91,7 @@ export default Ember.Component.extend({
}.property('upgradeStatus','isUpgradeState'), }.property('upgradeStatus','isUpgradeState'),
btnLabel: function() { btnLabel: function() {
let intl = this.get('intl');
if ( this.get('isUpgradeState') ) if ( this.get('isUpgradeState') )
{ {
return 'Upgrade in progress'; return 'Upgrade in progress';
@ -99,17 +101,17 @@ export default Ember.Component.extend({
case NONE: case NONE:
return ''; return '';
case LOADING: case LOADING:
return 'Checking upgrades...'; return intl.t('upgradeBtn.status.loading');
case CURRENT: case CURRENT:
return 'Up to date'; return intl.t('upgradeBtn.status.current');
case AVAILABLE: case AVAILABLE:
return 'Upgrade available'; return intl.t('upgradeBtn.status.available');
case NOTFOUND: case NOTFOUND:
return 'Template version not found'; return intl.t('upgradeBtn.status.notfound');
default: default:
return 'Error checking for upgrade'; return intl.t('upgradeBtn.status.default');
} }
}.property('upgradeStatus','isUpgradeState'), }.property('upgradeStatus','isUpgradeState', 'intl._locale'),
updateStatus() { updateStatus() {
var info = this.get('environmentResource.externalIdInfo'); var info = this.get('environmentResource.externalIdInfo');

View File

@ -91,12 +91,12 @@ export default Ember.View.extend(ThrottledResize,{
} }
var serviceId = $('span[data-service]', fo).data('service'); var serviceId = $('span[data-service]', fo).data('service');
if ( serviceId ) if ( serviceId )
{ {
this.showService(serviceId); this.showService(serviceId);
return; return;
} }
} }
@ -117,17 +117,24 @@ export default Ember.View.extend(ThrottledResize,{
showService: function(id) { showService: function(id) {
let svgHeight; let svgHeight;
if ( id ) if ( id ) {
{ svgHeight = $('#environment-svg').height() - 260; // svg minus the height of info service-addtl-info.scss
this.styleSvg(`${svgHeight}px`);
if (!this.get('context.showServiceInfo')) {
this.zoomAndScale(1.5);
}
this.set('context.showServiceInfo', true);
this.set('context.selectedService', this.get('context.stack.services').findBy('id', id));
} else {
svgHeight = $('#environment-svg').height() - 0; // svg minus the height of info service-addtl-info.scss svgHeight = $('#environment-svg').height() - 0; // svg minus the height of info service-addtl-info.scss
this.styleSvg(`${svgHeight}px`);
this.set('context.showServiceInfo', true);
this.set('context.selectedService', this.get('context.stack.services').findBy('id', id));
}
else
{
svgHeight = $('#environment-svg').height() - 310; // svg minus the height of info service-addtl-info.scss
this.styleSvg(svgHeight); this.styleSvg(svgHeight);
if (this.get('context.showServiceInfo')) {
this.zoomAndScale(2);
}
this.set('context.showServiceInfo', null); this.set('context.showServiceInfo', null);
} }
}, },
@ -233,26 +240,32 @@ export default Ember.View.extend(ThrottledResize,{
this.renderGraph(); this.renderGraph();
}, },
renderGraph: function() { zoomAndScale: function(scaleFactor=2.0) {
var zoom = this.get('graphZoom'); var zoom = this.get('graphZoom');
var render = this.get('graphRender');
var inner = this.get('graphInner');
var outer = this.get('graphOuter'); var outer = this.get('graphOuter');
var g = this.get('graph'); var g = this.get('graph');
inner.call(render, g);
// Zoom and scale to fit // Zoom and scale to fit
var zoomScale = zoom.scale(); var zoomScale = zoom.scale();
var graphWidth = g.graph().width; var graphWidth = g.graph().width;
var graphHeight = g.graph().height; var graphHeight = g.graph().height;
var width = $('#environment-svg').width(); var width = $('#environment-svg svg').width();
var height = $('#environment-svg').height(); var height = $('#environment-svg svg').height();
zoomScale = Math.min(2.0, Math.min(width / graphWidth, height / graphHeight)); zoomScale = Math.min(scaleFactor, Math.min(width / graphWidth, height / graphHeight));
var translate = [(width/2) - ((graphWidth*zoomScale)/2), (height/2) - ((graphHeight*zoomScale)/2)]; var translate = [(width/2) - ((graphWidth*zoomScale)/2), (height/2) - ((graphHeight*zoomScale)/2)];
zoom.translate(translate); zoom.translate(translate);
zoom.scale(zoomScale); zoom.scale(zoomScale);
zoom.event(outer); zoom.event(outer);
},
renderGraph: function() {
var render = this.get('graphRender');
var inner = this.get('graphInner');
var g = this.get('graph');
inner.call(render, g);
this.zoomAndScale();
// Overflow the foreignObjects // Overflow the foreignObjects
$(this.get('graphElem').getElementsByTagName('foreignObject')).css('overflow','visible'); $(this.get('graphElem').getElementsByTagName('foreignObject')).css('overflow','visible');

View File

@ -1880,6 +1880,9 @@ formTargets:
If that is not set, then the Default Target port for the Source Port. If that is also not set, then the Source Port. If that is not set, then the Default Target port for the Source Port. If that is also not set, then the Source Port.
noHostnames: "(Can't balance to hostnames)" noHostnames: "(Can't balance to hostnames)"
formUserData:
placeholder: "e.g. Configuration information for the container"
isVmPlaceholder: "e.g. Configuration information for the virtual machine"
formUserLabels: formUserLabels:
addAction: Add Label addAction: Add Label
key: key:
@ -2369,6 +2372,16 @@ modalConfirmDeactiviate:
header: Are you sure you want to header: Are you sure you want to
protip: "ProTip: Hold the {alternateLabel} key while clicking {isServiceButton} to bypass this confirmation." protip: "ProTip: Hold the {alternateLabel} key while clicking {isServiceButton} to bypass this confirmation."
cancel: Cancel cancel: Cancel
buttons:
project:
message: deactivate your environment
button: Deactivate
environment:
message: stop services for
button: Stop Services
default:
message: deactivate
button: Deactivate
modalEditBackup: modalEditBackup:
edit: Edit Backup edit: Edit Backup
@ -2650,6 +2663,14 @@ tooltipWarning:
notConfigured: Access Control Not Configured notConfigured: Access Control Not Configured
dismiss: Dismiss dismiss: Dismiss
upgradeBtn:
status:
loading: 'Checking upgrades...'
current: 'Up to date'
available: 'Upgrade available'
notFound: 'Template version not found'
default: 'Error checking for upgrade'
viewEditDescription: viewEditDescription:
form: form:
name: name: