Skip to content

Commit 07fd7d1

Browse files
brykSebastian Florek
authored andcommitted
A couple of fixes in zerostate code (#936)
1. Make the link include namespace that is selected. We should use `$state` for all links, anyway. 1. Increase padding to make the information more prominent. 1. Add info that in order to see something you can change namespace. 1. Align external link icon vertically 1. Change wording to be similar to what we have in other places (e.g., "deploy a containerized app".
1 parent 3c6dcf8 commit 07fd7d1

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

i18n/messages-en.xtb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,5 +472,5 @@
472472
<translation id="2055003113871137121" key="MSG_NODE_DETAIL_ALLOCATED_RESOURCES_PODS" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' for the allocated resources table header on the node details page.">Memory limits (bytes)</translation>
473473
<translation id="5154496218567149713" key="MSG_NODE_DETAIL_ALLOCATED_RESOURCES_PODS" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' for the allocated resources table header on the node details page.">Pods</translation>
474474
<translation id="1538072409274591134" key="MSG_ZERO_STATE_TITLE" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title text which appears on zero state view.">There is nothing to display here</translation>
475-
<translation id="843228251260108399" key="MSG_ZERO_STATE_TEXT" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Text which appears on zero state view under the title. It provides to deploy view or offers user to take the Dashboard Tour.">Let's <ph name="CREATE_NEW_LINK" /> create a new app <ph name="CREATE_NEW_CLOSE_LINK" /> or learn more and <ph name="OPEN_LINK" /> take the Dashboard Tour <ph name="LINK_ICON" /> <ph name="CLOSE_LINK" /></translation>
475+
<translation id="6640815328418723695" key="MSG_ZERO_STATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Text which appears on zero state view under the title. It provides to deploy view or offers user to take the Dashboard Tour.">You can <ph name="CREATE_NEW_LINK" />deploy a containerized app<ph name="CREATE_NEW_CLOSE_LINK" />, select other namespace or <ph name="OPEN_LINK" />take the Dashboard Tour <ph name="LINK_ICON" /><ph name="CLOSE_LINK" /> to learn more</translation>
476476
</translationbundle>

i18n/messages-ja.xtb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,5 +659,5 @@
659659
<translation id="2055003113871137121" key="MSG_NODE_DETAIL_ALLOCATED_RESOURCES_PODS" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' for the allocated resources table header on the node details page.">メモリー上限(バイト)</translation>
660660
<translation id="5154496218567149713" key="MSG_NODE_DETAIL_ALLOCATED_RESOURCES_PODS" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' for the allocated resources table header on the node details page.">ポッド</translation>
661661
<translation id="1538072409274591134" key="MSG_ZERO_STATE_TITLE" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title text which appears on zero state view.">There is nothing to display here</translation>
662-
<translation id="843228251260108399" key="MSG_ZERO_STATE_TEXT" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Text which appears on zero state view under the title. It provides to deploy view or offers user to take the Dashboard Tour.">Let's <ph name="CREATE_NEW_LINK" /> create a new app <ph name="CREATE_NEW_CLOSE_LINK" /> or learn more and <ph name="OPEN_LINK" /> take the Dashboard Tour <ph name="LINK_ICON" /> <ph name="CLOSE_LINK" /></translation>
663-
</translationbundle>
662+
<translation id="6640815328418723695" key="MSG_ZERO_STATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Text which appears on zero state view under the title. It provides to deploy view or offers user to take the Dashboard Tour.">You can <ph name="CREATE_NEW_LINK" />deploy a containerized app<ph name="CREATE_NEW_CLOSE_LINK" />, select other namespace or <ph name="OPEN_LINK" />take the Dashboard Tour <ph name="LINK_ICON" /><ph name="CLOSE_LINK" /> to learn more</translation>
663+
</translationbundle>

src/app/frontend/common/components/zerostate/zerostate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<kd-content-card>
1818
<kd-content>
19-
<div class="kd-zerostate-message">
19+
<div class="kd-zerostate-message" layout-padding>
2020
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_ZERO_STATE_TITLE}}</div>
2121
<div class="kd-zerostate-text">
2222
<span ng-bind-html="::$ctrl.i18n.MSG_ZERO_STATE_TEXT"></span>

src/app/frontend/common/components/zerostate/zerostate.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
.kd-zerostate-icon {
2222
color: $primary;
2323
font-size: $body-font-size-base;
24-
margin-bottom: $baseline-grid;
24+
vertical-align: middle;
2525
}
2626

2727
.kd-zerostate-title {

src/app/frontend/common/components/zerostate/zerostate_component.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,48 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import {deployAppStateName} from 'deploy/deploy_state';
16+
1517
/**
1618
* @final
1719
*/
1820
export class ZeroStateController {
1921
/**
22+
* @param {!ui.router.$state} $state
2023
* @ngInject
2124
*/
22-
constructor() {
25+
constructor($state) {
2326
/** @export */
24-
this.i18n = i18n;
27+
this.i18n = i18n($state);
2528
}
2629
}
2730

2831
/**
29-
* Returns zero state component.
30-
*
31-
* @return {!angular.Directive}
32+
* @return {!angular.Component}
3233
*/
3334
export const zeroStateComponent = {
3435
templateUrl: 'common/components/zerostate/zerostate.html',
3536
transclude: true,
3637
controller: ZeroStateController,
3738
};
3839

39-
const i18n = {
40+
/**
41+
* @param {!ui.router.$state} $state
42+
*/
43+
let i18n = ($state) => ({
4044
/** @export {string} @desc Title text which appears on zero state view. */
4145
MSG_ZERO_STATE_TITLE: goog.getMsg('There is nothing to display here'),
4246
/** @export {string} @desc Text which appears on zero state view under the title. It provides
4347
* to deploy view or offers user to take the Dashboard Tour. */
4448
MSG_ZERO_STATE_TEXT: goog.getMsg(
45-
'Let\'s {$createNewLink} create a new app {$createNewCloseLink} or learn more' +
46-
' and {$openLink} take the Dashboard Tour {$linkIcon} {$closeLink}',
49+
'You can {$createNewLink}deploy a containerized app{$createNewCloseLink},' +
50+
' select other namespace or {$openLink}take the Dashboard Tour {$linkIcon}{$closeLink}' +
51+
' to learn more',
4752
{
48-
'createNewLink': `<a href="#/deploy/file">`,
53+
'createNewLink': `<a href="${$state.href(deployAppStateName)}">`,
4954
'createNewCloseLink': `</a>`,
5055
'openLink': `<a href="http://kubernetes.io/docs/user-guide/ui/" target="_blank">`,
5156
'linkIcon': `<i class="material-icons kd-zerostate-icon">open_in_new</i>`,
5257
'closeLink': `</a>`,
5358
}),
54-
};
59+
});

0 commit comments

Comments
 (0)