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"}}
<div class="btn-group r-ml10">
{{tooltip-link icon="icon-tasks" text=(t 'tooltipLink.list') options=listLinkOptions}}
{{tooltip-link icon="icon-share" text=(t 'tooltipLink.linkGraph') options=graphLinkOptions}}
{{tooltip-link icon="icon-file" text=(t 'tooltipLink.composeYaml') options=yamlLinkOptions}}
{{#link-to "environment.index" classNames="btn btn-sm btn-default"}}{{tooltip-link icon="icon-tasks" text=(t 'tooltipLink.list') options=listLinkOptions}}{{/link-to}}
{{#link-to "environment.graph" classNames="btn btn-sm btn-default"}}{{tooltip-link icon="icon-share" text=(t 'tooltipLink.linkGraph') options=graphLinkOptions}}{{/link-to}}
{{#link-to "environment.code" classNames="btn btn-sm btn-default"}}{{tooltip-link icon="icon-file" text=(t 'tooltipLink.composeYaml') options=yamlLinkOptions}}{{/link-to}}
</div>
{{upgrade-btn environmentResource=model classNames="r-ml10"}}

View File

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

View File

@ -1,15 +1,8 @@
import Ember from 'ember';
export default Ember.Component.extend({
tagName : 'button',
classNames : ['btn', 'btn-sm', 'btn-default'],
tagName : '',
icon : null,
text : 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({
environmentResource: null,
upgradeStatus: null,
intl: Ember.inject.service(),
tagName: 'button',
classNames: ['btn','btn-sm'],
@ -90,6 +91,7 @@ export default Ember.Component.extend({
}.property('upgradeStatus','isUpgradeState'),
btnLabel: function() {
let intl = this.get('intl');
if ( this.get('isUpgradeState') )
{
return 'Upgrade in progress';
@ -99,17 +101,17 @@ export default Ember.Component.extend({
case NONE:
return '';
case LOADING:
return 'Checking upgrades...';
return intl.t('upgradeBtn.status.loading');
case CURRENT:
return 'Up to date';
return intl.t('upgradeBtn.status.current');
case AVAILABLE:
return 'Upgrade available';
return intl.t('upgradeBtn.status.available');
case NOTFOUND:
return 'Template version not found';
return intl.t('upgradeBtn.status.notfound');
default:
return 'Error checking for upgrade';
return intl.t('upgradeBtn.status.default');
}
}.property('upgradeStatus','isUpgradeState'),
}.property('upgradeStatus','isUpgradeState', 'intl._locale'),
updateStatus() {
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');
if ( serviceId )
{
this.showService(serviceId);
return;
}
}
@ -117,17 +117,24 @@ export default Ember.View.extend(ThrottledResize,{
showService: function(id) {
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
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);
if (this.get('context.showServiceInfo')) {
this.zoomAndScale(2);
}
this.set('context.showServiceInfo', null);
}
},
@ -233,26 +240,32 @@ export default Ember.View.extend(ThrottledResize,{
this.renderGraph();
},
renderGraph: function() {
zoomAndScale: function(scaleFactor=2.0) {
var zoom = this.get('graphZoom');
var render = this.get('graphRender');
var inner = this.get('graphInner');
var outer = this.get('graphOuter');
var g = this.get('graph');
inner.call(render, g);
// Zoom and scale to fit
var zoomScale = zoom.scale();
var graphWidth = g.graph().width;
var graphHeight = g.graph().height;
var width = $('#environment-svg').width();
var height = $('#environment-svg').height();
zoomScale = Math.min(2.0, Math.min(width / graphWidth, height / graphHeight));
var width = $('#environment-svg svg').width();
var height = $('#environment-svg svg').height();
zoomScale = Math.min(scaleFactor, Math.min(width / graphWidth, height / graphHeight));
var translate = [(width/2) - ((graphWidth*zoomScale)/2), (height/2) - ((graphHeight*zoomScale)/2)];
zoom.translate(translate);
zoom.scale(zoomScale);
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
$(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.
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:
addAction: Add Label
key:
@ -2369,6 +2372,16 @@ modalConfirmDeactiviate:
header: Are you sure you want to
protip: "ProTip: Hold the {alternateLabel} key while clicking {isServiceButton} to bypass this confirmation."
cancel: Cancel
buttons:
project:
message: deactivate your environment
button: Deactivate
environment:
message: stop services for
button: Stop Services
default:
message: deactivate
button: Deactivate
modalEditBackup:
edit: Edit Backup
@ -2650,6 +2663,14 @@ tooltipWarning:
notConfigured: Access Control Not Configured
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:
form:
name: