提交 23e07ed7 编写于 作者: S Sebastian Florek 提交者: Marcin Maciaszczyk

Revert configmap actionbar controller (#2680)

* Revert configmap actionbar controller

* Revert test

* Fix formatting
上级 3abe7a75
// Copyright 2017 The Kubernetes Authors.
//
// 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.
/**
* @final
*/
export class ActionBarController {
/**
* @param {!backendApi.ConfigMapDetail} configMapDetail
* @ngInject
*/
constructor(configMapDetail) {
/** @export {!backendApi.ConfigMapDetail} */
this.details = configMapDetail;
}
}
......@@ -16,7 +16,7 @@ limitations under the License.
<div layout="column">
<kd-config-map-info config-map="$ctrl.configMapDetail"></kd-config-map-info>
<kd-info-card>
<kd-info-card>
<kd-info-card-header>[[Data|Config map data header on details page]]</kd-info-card-header>
<kd-info-card-section ng-if="$ctrl.configMapDetail.data">
<kd-info-card-entry ng-repeat="(key, value) in $ctrl.configMapDetail.data"
......@@ -24,12 +24,12 @@ limitations under the License.
<pre class="kd-pre-block">{{value}}</pre>
</kd-info-card-entry>
</kd-info-card-section>
<kd-info-card-section class="kd-config-map-zero-state"
ng-if="!$ctrl.configMapDetail.data">
<kd-zero-state>
<kd-zero-state-title>[[There is no data to display|Zero state text on config map details view.]]</kd-zero-state-title>
<kd-zero-state-text>[[You can edit config map to add data.|Zero state text on config map details view.]]</kd-zero-state-text>
</kd-zero-state>
</kd-info-card-section>
<kd-info-card-section class="kd-config-map-zero-state"
ng-if="!$ctrl.configMapDetail.data">
<kd-zero-state>
<kd-zero-state-title>[[There is no data to display|Zero state text on config map details view.]]</kd-zero-state-title>
<kd-zero-state-text>[[You can edit config map to add data.|Zero state text on config map details view.]]</kd-zero-state-text>
</kd-zero-state>
</kd-info-card-section>
</kd-info-card>
</div>
......@@ -16,8 +16,9 @@ import {actionbarViewName, stateName as chromeStateName} from '../../chrome/stat
import {breadcrumbsConfig} from '../../common/components/breadcrumbs/service';
import {appendDetailParamsToUrl} from '../../common/resource/resourcedetail';
import {stateName as configMapList} from '../../configmap/list/state';
import {stateName as parentState, stateUrl} from '../state';
import {ActionBarController} from './actionbar_controller';
import {ConfigMapDetailController} from './controller';
/**
......@@ -45,6 +46,7 @@ export const config = {
templateUrl: 'configmap/detail/detail.html',
},
[`${actionbarViewName}@${chromeStateName}`]: {
controller: ActionBarController,
controllerAs: '$ctrl',
templateUrl: 'configmap/detail/actionbar.html',
},
......
// Copyright 2017 The Kubernetes Authors.
//
// 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 {ActionBarController} from 'configmap/detail/actionbar_controller';
import module from 'configmap/module';
describe('Action Bar controller', () => {
/** @type {!ActionBarController} */
let ctrl;
let details = {};
beforeEach(() => {
angular.mock.module(module.name);
angular.mock.inject(($controller) => {
ctrl = $controller(ActionBarController, {configMapDetail: details});
});
});
it('should initialize details', () => {
expect(ctrl.details).toBe(details);
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册