提交 fa76e6dc 编写于 作者: P Piotr Bryk

Merge pull request #236 from floreks/zerostate-as-child

Changed zerostate to be child of replicasetlist state
......@@ -17,7 +17,7 @@ limitations under the License.
<md-content class="kd-content">
<md-toolbar class="kd-toolbar">
<div class="md-toolbar-tools kd-toolbar-tools">
<a ui-sref="replicasets">
<a ui-sref="replicasets" ui-sref-opts="{ reload: true }">
<md-icon md-svg-icon="assets/images/kubernetes-logo.svg" class="kd-toolbar-logo"></md-icon>
</a>
<h2>
......
......@@ -23,7 +23,6 @@ import logsModule from './logs/logs_module';
import routeConfig from './index_route';
import replicaSetDetailModule from './replicasetdetail/replicasetdetail_module';
import replicaSetListModule from './replicasetlist/replicasetlist_module';
import zerostateModule from './zerostate/zerostate_module';
export default angular.module(
'kubernetesDashboard',
......@@ -40,7 +39,6 @@ export default angular.module(
logsModule.name,
replicaSetDetailModule.name,
replicaSetListModule.name,
zerostateModule.name,
])
.config(indexConfig)
.config(routeConfig);
......@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import {stateName as zerostate} from 'zerostate/zerostate_state';
import {stateName as zerostate} from './zerostate/zerostate_state';
import {stateName as replicasets} from './replicasetlist_state';
import {stateUrl as replicasetsUrl} from './replicasetlist_state';
import ReplicaSetListController from './replicasetlist_controller';
import ZeroStateController from './zerostate/zerostate_controller';
/**
* Configures states for the service view.
......@@ -34,6 +35,16 @@ export default function stateConfig($stateProvider) {
templateUrl: 'replicasetlist/replicasetlist.html',
onEnter: redirectIfNeeded,
});
$stateProvider.state(zerostate, {
views: {
'@': {
controller: ZeroStateController,
controllerAs: 'ctrl',
templateUrl: 'replicasetlist/zerostate/zerostate.html',
},
},
url: '/zerostate',
});
}
/**
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
@import '../variables';
@import '../../variables';
.kd-content {
background-color: $body;
......
......@@ -12,5 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import {stateName as replicasets} from './../replicasetlist_state';
/** Name of the state. Can be used in, e.g., $state.go method. */
export const stateName = 'zero';
export const stateName = `${replicasets}.zero`;
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import stateConfig from './zerostate_stateconfig';
/**
* Angular module for the zero state view.
*
* The view is active on the first launch of the application and is used for onboarding new users.
*/
export default angular.module(
'kubernetesDashboard.zerostate',
[
'ui.router',
])
.config(stateConfig);
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import ZeroStateController from './zerostate_controller';
import {stateName} from './zerostate_state';
/**
* Configures states for the zero state view.
*
* @param {!ui.router.$stateProvider} $stateProvider
* @ngInject
*/
export default function stateConfig($stateProvider) {
$stateProvider.state(stateName, {
controller: ZeroStateController,
controllerAs: 'ctrl',
url: '/zerostate',
templateUrl: 'zerostate/zerostate.html',
});
}
......@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import ZerostateController from 'zerostate/zerostate_controller';
import ZerostateController from 'replicasetlist/zerostate/zerostate_controller';
describe('Main controller', () => {
describe('Zerostate controller', () => {
let ctrl;
beforeEach(angular.mock.inject(() => { ctrl = new ZerostateController(); }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册