Skip to content

Commit 09e65b6

Browse files
Sebastian Florekfloreks
Sebastian Florek
authored andcommitted
Initial implementation of zerostate view.
1 parent 48b6a93 commit 09e65b6

File tree

6 files changed

+108
-16
lines changed

6 files changed

+108
-16
lines changed

‎src/app/frontend/zerostate/zerostate.controller.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
*/
2121
export default class ZeroStateController {
2222
/**
23-
* @param {!angular.$timeout} $timeout
2423
* @ngInject
2524
*/
26-
constructor($timeout) {
27-
/** @export {number} */
28-
this.testValue = 7;
29-
30-
$timeout(() => {
31-
this.testValue = 8;
32-
}, 4000);
25+
constructor() {
26+
/** @export {!Array<{title:string, link:string}>} */
27+
this.learnMoreLinks = [
28+
{title: 'Dasard Tour', link: "#"},
29+
{title: 'Deploying your App', link: "#"},
30+
{title: 'Monitoring your App', link: "#"},
31+
{title: 'Troubleshooting', link: "#"},
32+
];
3333
}
3434
}

‎src/app/frontend/zerostate/zerostate.html

+30-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,34 @@
1414
limitations under the License.
1515
-->
1616

17-
<div layout="vertical" layout-fill>
18-
<header>
19-
Zero state page. <a ui-sref="microservicelist">Go to microservices page</a> or
20-
<a ui-sref="deploy">deploy an app</a>.
21-
</header>
17+
<div layout="row" layout-align="center center" layout-padding class="kd-zerostate-content">
18+
<md-content layout layout-align="center" class="kd-content">
19+
<md-card flex="50" class="kd-zerostate-deploy-card">
20+
<md-toolbar layout="row" class="md-primary kd-zerostate-card-header"
21+
layout-align="center center" flex>
22+
<md-icon md-svg-icon="assets/images/kubernetes-logo.svg"
23+
class="kd-zerostate-card-logo"></md-icon>
24+
<span class="md-padding" flex>The <b>Kubernetes Dasard</b> lets you deploy, monitor
25+
and troubleshoot containerized apps and services</span>
26+
</md-toolbar>
27+
<md-card-content layout-align="center center">
28+
<md-button ui-sref="deploy" class="md-raised md-primary kd-zerostate-deploy-bt">Deploy an
29+
app
30+
</md-button>
31+
</md-card-content>
32+
</md-card>
33+
<md-card flex="15" class="kd-zerostate-lm-card">
34+
<md-card-content>
35+
<md-text-float class="kd-zerostate-lm-text"><b>Learn more</b></md-text-float>
36+
<md-list class="kd-zerostate-lm-list">
37+
<md-list-item class="kd-zerostate-lm-list-item"
38+
ng-repeat="option in ctrl.learnMoreLinks">
39+
<a ui-sref="{{option.link}}">
40+
{{option.title}} <i class="material-icons kd-zerostate-ext-link-icon">open_in_new</i>
41+
</a>
42+
</md-list-item>
43+
</md-list>
44+
</md-card-content>
45+
</md-card>
46+
</md-content>
2247
</div>
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright 2015 Google Inc. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
.kd-zerostate-content {
16+
position: fixed;
17+
height: 90%;
18+
width: 100%;
19+
}
20+
21+
.kd-zerostate-card-header {
22+
font-size: 1em;
23+
}
24+
25+
.kd-zerostate-card-logo {
26+
height: 80px;
27+
width: 80px;
28+
padding: 0 0 0 15px;
29+
}
30+
31+
.kd-zerostate-deploy-card {
32+
min-width: 300px;
33+
color: white;
34+
}
35+
36+
.kd-zerostate-deploy-bt {
37+
font-size: 12px;
38+
min-width: 120px;
39+
}
40+
41+
.kd-zerostate-lm-list {
42+
margin-top: 10px;
43+
44+
> .kd-zerostate-lm-list-item {
45+
padding: 0;
46+
min-height: 30px;
47+
color: royalblue;
48+
}
49+
}
50+
51+
.kd-zerostate-ext-link-icon {
52+
font-size: 1em;
53+
}
54+
55+
.kd-zerostate-lm-card {
56+
min-width: 200px;
57+
font-size: 15px;
58+
}
59+
60+
.kd-zerostate-lm-text {
61+
color: darkgray;
62+
}

‎src/test/frontend/zerostate/zerostate.controller.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ describe('Main controller', () => {
2323
}));
2424

2525
it('should do something', () => {
26-
expect(vm.testValue).toEqual(7);
26+
expect(vm.learnMoreLinks).toEqual([
27+
{title: 'Dasard Tour', link: "#"},
28+
{title: 'Deploying your App', link: "#"},
29+
{title: 'Monitoring your App', link: "#"},
30+
{title: 'Troubleshooting', link: "#"},
31+
]);
2732
});
2833
});

‎src/test/integration/zerostate.po.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
export default class ZeroStatePageObject {
1717
constructor() {
18-
this.header = element(by.css('header'));
18+
this.deployButton = element(by.css('.kd-zerostate-deploy-bt'));
1919
}
2020
}

‎src/test/integration/zerostate.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ describe('Zero state view', function () {
2424
});
2525

2626
it('should do something', function() {
27-
expect(page.header.getText()).toContain('page');
27+
expect(page.deployButton.getText()).toContain('DEPLOY');
2828
});
2929
});

0 commit comments

Comments
 (0)