diff --git a/static/styles/main.less b/static/styles/main.less index 8745e3833..cd9305ff0 100644 --- a/static/styles/main.less +++ b/static/styles/main.less @@ -4751,9 +4751,14 @@ input[type=range] { background-color: @base-light-color; width: @page-width; margin: 0 0 @dashboard-offset -@dashboard-offset * 2; - padding: @dashboard-offset @dashboard-offset * 2; + padding: @dashboard-offset @dashboard-offset * 2 @dashboard-offset * 2; + + .title { + padding: 0; + } + .go-to-healthcheck { - margin-bottom: @dashboard-offset; + margin-bottom: @dashboard-offset * 2; } .cluster-info-value, .cluster-info-title { height: auto; @@ -4767,6 +4772,7 @@ input[type=range] { &.cluster-info-value { &.name { .btn-link { + height: 30px; padding: 0; border: none; text-align: left; @@ -4775,7 +4781,6 @@ input[type=range] { overflow: hidden; cursor: pointer; text-overflow: ellipsis; - line-height: 19px; } .glyphicon { margin-left: 10px; @@ -4785,60 +4790,31 @@ input[type=range] { } } } + .rename-block { - height: 30px; - line-height: 13px; - margin-bottom: 4px; - text-align: left; - &.has-error { - height: auto; - .text-danger { + .form-group { + margin: 0; + left: -13px; + input[type=text] { + height: 30px; + margin: 0; + } + .help-block { font-size: 12px; - width: 215px; - padding-top: 30px; - margin-bottom: 10px; + margin-bottom: 0; } - } - input[type=text] { - width: 240px; - height: 32px; - margin: -21px 0 0 -12px; - float: left; - } - } - .capacity-block { - margin-bottom: 15px; - .capacity-items { - margin-top: -9px; - > div { - cursor: default; - background-color: @white; - padding: 4px 10px; - &.cpu { - border: 1px solid @dashboard-gray; - } - &.hdd { - border: 1px solid @dashboard-gray; - } - &.ram { - border-top: 1px solid @dashboard-gray; - border-bottom: 1px solid @dashboard-gray; - } - .capacity-value { - .font-semibold; - float: right; - } + &:not(.has-error) .help-block { + display: none; } } } - .statistics-block { - margin-bottom: 15px; - .cluster-info-title { - margin-bottom: @dashboard-offset; - } + .cluster-info-value.name, .rename-block .form-group { + position: relative; + top: -6px; } + .dashboard-actions-wrapper { - margin: @dashboard-offset 0 @dashboard-offset 0; + margin: 0; .reset-environment { margin-right: 87px; } @@ -4849,6 +4825,43 @@ input[type=range] { vertical-align: sub; } } + + .statistics { + .title { + padding-left: 15px; + } + .capacity-block { + margin-bottom: 15px; + .capacity-items { + > div { + background-color: @white; + padding: 4px 10px; + &.cpu { + border: 1px solid @dashboard-gray; + } + &.hdd { + border: 1px solid @dashboard-gray; + } + &.ram { + border-top: 1px solid @dashboard-gray; + border-bottom: 1px solid @dashboard-gray; + } + .capacity-value { + .font-semibold; + float: right; + } + } + } + } + .statistics-block { + .btn-add-nodes { + padding: 0; + } + } + .cluster-info-title { + margin-bottom: @dashboard-offset; + } + } } @dashboard-border-color: #d3d3d3; diff --git a/static/tests/functional/test_cluster_dashboard.js b/static/tests/functional/test_cluster_dashboard.js index 569fb074b..24b30108e 100644 --- a/static/tests/functional/test_cluster_dashboard.js +++ b/static/tests/functional/test_cluster_dashboard.js @@ -69,12 +69,12 @@ registerSuite(() => { .then(() => clusterPage.goToTab('Dashboard')) .then(() => dashboardPage.setClusterName(initialName)) .assertElementAppears( - '.rename-block.has-error', + '.rename-block .has-error', 1000, 'Error style for duplicate name is applied' ) .assertElementTextEquals( - '.rename-block .text-danger', + '.rename-block .help-block', 'Environment with this name already exists', 'Duplicate name error text appears' ) diff --git a/static/views/cluster_page_tabs/dashboard_tab.js b/static/views/cluster_page_tabs/dashboard_tab.js index 4a26d7795..97c22189a 100644 --- a/static/views/cluster_page_tabs/dashboard_tab.js +++ b/static/views/cluster_page_tabs/dashboard_tab.js @@ -819,7 +819,13 @@ var ClusterActionsPanel = React.createClass({
{i18n(ns + 'no_nodes_instruction')}
- + + + {i18n(ns + 'go_to_nodes')} + @@ -984,7 +990,7 @@ var ClusterInfo = React.createClass({ _.map(['status', 'openstack_release', 'compute', 'network', 'storage_backends'], (field) => { var value = this.getClusterValue(field); return ( -
+
{i18n(ns + 'cluster_info_fields.' + field)} @@ -1094,7 +1100,16 @@ var ClusterInfo = React.createClass({
{this.renderLegend(roles, true)} {!cluster.task({group: 'deployment', active: true}) && - + }
,
@@ -1115,8 +1130,8 @@ var ClusterInfo = React.createClass({
+
{i18n(ns + 'summary')}
-
{i18n(ns + 'summary')}
{i18n(ns + 'cluster_info_fields.name')} @@ -1138,25 +1153,25 @@ var ClusterInfo = React.createClass({
}
- {this.renderClusterInfoFields()} - {(cluster.get('status') === 'operational') && -
- {i18n(ns + 'healthcheck')} - - {i18n(ns + 'healthcheck_tab')} - -
- } -
- - +
+ {this.renderClusterInfoFields()} + {(cluster.get('status') === 'operational') && +
+ {i18n(ns + 'healthcheck')} + + {i18n(ns + 'healthcheck_tab')} +
+ } +
+ +
-
+
{this.renderClusterCapacity()} {this.renderStatistics()}
@@ -1166,20 +1181,6 @@ var ClusterInfo = React.createClass({ } }); -var AddNodesButton = React.createClass({ - render() { - return ( - - - {i18n(ns + 'go_to_nodes')} - - ); - } -}); - var RenameEnvironmentAction = React.createClass({ applyAction(e) { e.preventDefault(); @@ -1221,13 +1222,13 @@ var RenameEnvironmentAction = React.createClass({ return { name: this.props.cluster.get('name'), disabled: false, - error: '' + error: null }; }, onChange(inputName, newValue) { this.setState({ name: newValue, - error: '' + error: null }); }, handleKeyDown(e) { @@ -1241,27 +1242,18 @@ var RenameEnvironmentAction = React.createClass({ } }, render() { - var classes = { - 'rename-block': true, - 'has-error': !!this.state.error - }; return ( -
-
- - {this.state.error && -
{this.state.error}
- } -
+
+
); }