提交 4b304010 编写于 作者: D Denis Poisson 提交者: Marcin Maciaszczyk

Add namespace column to resource cards when more than one namespace is selected (#1063)

上级 5837d686
...@@ -524,4 +524,23 @@ ...@@ -524,4 +524,23 @@
<translation id="3684607543489263600" key="MSG_ENV_FROM_CONFIG_MAP" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label for environment variable that comes from a Config Map">value from ConfigMap <ph name="NAME" />/<ph name="KEY" /></translation> <translation id="3684607543489263600" key="MSG_ENV_FROM_CONFIG_MAP" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label for environment variable that comes from a Config Map">value from ConfigMap <ph name="NAME" />/<ph name="KEY" /></translation>
<translation id="6987669710926523285" key="MSG_NODE_LIST_READY_LABEL" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Ready' which appears as a column label in the table of nodes (node list view).">Ready</translation> <translation id="6987669710926523285" key="MSG_NODE_LIST_READY_LABEL" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Ready' which appears as a column label in the table of nodes (node list view).">Ready</translation>
<translation id="6106340570580081121" key="MSG_DAEMON_SET_DETAIL_SERVICES_TITLE" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title 'Services' for the services information section on the daemon set detail page.">Services</translation> <translation id="6106340570580081121" key="MSG_DAEMON_SET_DETAIL_SERVICES_TITLE" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title 'Services' for the services information section on the daemon set detail page.">Services</translation>
<translation id="6537383105836584689" key="MSG_DEPLOYMENT_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of deployments (deployment list view).">Namespace</translation>
<translation id="2872431258829082433" key="MSG_JOB_LIST_NAME_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' which appears as a column label in the table of jobs (Job list view).">Name</translation>
<translation id="8978854967234873489" key="MSG_JOB_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (Job list view).">Namespace</translation>
<translation id="6310730601576371329" key="MSG_JOB_LIST_LABELS_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Labels' which appears as a column label in the table of replication controllers (Job list view).">Labels</translation>
<translation id="6160307955179693927" key="MSG_JOB_LIST_PODS_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' which appears as a column label in the table of replication controllers (Job list view).">Pods</translation>
<translation id="7287602791689381779" key="MSG_JOB_LIST_AGE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Age' which appears as a column label in the table of replication controllers (Job list view).">Age</translation>
<translation id="2678441499396017713" key="MSG_JOB_LIST_IMAGES_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Images' which appears as a column label in the table of replication controllers (Job list view).">Images</translation>
<translation id="6174070521345623465" key="MSG_REPLICA_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (RC list view).">Namespace</translation>
<translation id="7353393581531104052" key="MSG_POD_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of pods (pod list view).">Namespace</translation>
<translation id="6859808734310490214" key="MSG_SERVICE_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of services (service list view).">Namespace</translation>
<translation id="4677646778972512564" key="MSG_RC_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (RC list view).">Namespace</translation>
<translation id="7091154364335994224" key="MSG_DAEMON_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of daemon sets (daemon set list view).">Namespace</translation>
<translation id="3842998446932089885" key="MSG_PET_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Pet set list header: namespace.">Namespace</translation>
<translation id="1932088152662132374" key="MSG_SECRET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of secrets (secret list view).">Namespace</translation>
<translation id="910153156225182799" key="MSG_CONFIG_MAP_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Config map list header: namespace.">Namespace</translation>
<translation id="910153156225182799" key="MSG_CONFIG_MAP_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Config map list header: namespace.">Namespace</translation>
<translation id="7091154364335994224" key="MSG_DAEMON_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of daemon sets (daemon set list view).">Namespace</translation>
<translation id="4677646778972512564" key="MSG_RC_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (RC list view).">Namespace</translation>
<translation id="6106340570580081121" key="MSG_DAEMON_SET_DETAIL_SERVICES_TITLE" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title 'Services' for the services information section on the daemon set detail page.">Services</translation>
</translationbundle> </translationbundle>
\ No newline at end of file
...@@ -712,5 +712,24 @@ ...@@ -712,5 +712,24 @@
<translation id="7249897739191369792" key="MSG_CONTAINER_DETAILS_NO_ENV_VARS" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label when there is no container environment variables.">-</translation> <translation id="7249897739191369792" key="MSG_CONTAINER_DETAILS_NO_ENV_VARS" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label when there is no container environment variables.">-</translation>
<translation id="3684607543489263600" key="MSG_ENV_FROM_CONFIG_MAP" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label for environment variable that comes from a Config Map">value from ConfigMap <ph name="NAME" />/<ph name="KEY" /></translation> <translation id="3684607543489263600" key="MSG_ENV_FROM_CONFIG_MAP" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label for environment variable that comes from a Config Map">value from ConfigMap <ph name="NAME" />/<ph name="KEY" /></translation>
<translation id="6987669710926523285" key="MSG_NODE_LIST_READY_LABEL" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Ready' which appears as a column label in the table of nodes (node list view).">Ready</translation> <translation id="6987669710926523285" key="MSG_NODE_LIST_READY_LABEL" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Ready' which appears as a column label in the table of nodes (node list view).">Ready</translation>
<translation id="910153156225182799" key="MSG_CONFIG_MAP_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Config map list header: namespace.">Namespace</translation>
<translation id="7091154364335994224" key="MSG_DAEMON_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of daemon sets (daemon set list view).">Namespace</translation>
<translation id="4677646778972512564" key="MSG_RC_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (RC list view).">Namespace</translation>
<translation id="6537383105836584689" key="MSG_DEPLOYMENT_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of deployments (deployment list view).">Namespace</translation>
<translation id="2872431258829082433" key="MSG_JOB_LIST_NAME_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' which appears as a column label in the table of jobs (Job list view).">Name</translation>
<translation id="8978854967234873489" key="MSG_JOB_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (Job list view).">Namespace</translation>
<translation id="6310730601576371329" key="MSG_JOB_LIST_LABELS_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Labels' which appears as a column label in the table of replication controllers (Job list view).">Labels</translation>
<translation id="6160307955179693927" key="MSG_JOB_LIST_PODS_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' which appears as a column label in the table of replication controllers (Job list view).">Pods</translation>
<translation id="7287602791689381779" key="MSG_JOB_LIST_AGE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Age' which appears as a column label in the table of replication controllers (Job list view).">Age</translation>
<translation id="2678441499396017713" key="MSG_JOB_LIST_IMAGES_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Images' which appears as a column label in the table of replication controllers (Job list view).">Images</translation>
<translation id="6174070521345623465" key="MSG_REPLICA_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (RC list view).">Namespace</translation>
<translation id="7353393581531104052" key="MSG_POD_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of pods (pod list view).">Namespace</translation>
<translation id="6859808734310490214" key="MSG_SERVICE_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of services (service list view).">Namespace</translation>
<translation id="4677646778972512564" key="MSG_RC_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of replication controllers (RC list view).">Namespace</translation>
<translation id="7091154364335994224" key="MSG_DAEMON_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of daemon sets (daemon set list view).">Namespace</translation>
<translation id="3842998446932089885" key="MSG_PET_SET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Pet set list header: namespace.">Namespace</translation>
<translation id="1932088152662132374" key="MSG_SECRET_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' which appears as a column label in the table of secrets (secret list view).">Namespace</translation>
<translation id="910153156225182799" key="MSG_CONFIG_MAP_LIST_NAMESPACE_LABEL" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Config map list header: namespace.">Namespace</translation>
<translation id="6106340570580081121" key="MSG_DAEMON_SET_DETAIL_SERVICES_TITLE" source="/home/denis/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title 'Services' for the services information section on the daemon set detail page.">Services</translation>
<translation id="6106340570580081121" key="MSG_DAEMON_SET_DETAIL_SERVICES_TITLE" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title 'Services' for the services information section on the daemon set detail page.">Services</translation> <translation id="6106340570580081121" key="MSG_DAEMON_SET_DETAIL_SERVICES_TITLE" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Title 'Services' for the services information section on the daemon set detail page.">Services</translation>
</translationbundle> </translationbundle>
\ No newline at end of file
// Copyright 2015 Google Inc. All Rights Reserved. // Copyright 2015 Google Inc. All Rights Reserved.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
...@@ -13,6 +12,7 @@ ...@@ -13,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import {NamespaceService} from './namespace_service';
import {namespaceSelectComponent} from './namespaceselect_component'; import {namespaceSelectComponent} from './namespaceselect_component';
/** /**
...@@ -25,4 +25,5 @@ export default angular ...@@ -25,4 +25,5 @@ export default angular
'ngMaterial', 'ngMaterial',
'ngResource', 'ngResource',
]) ])
.component('kdNamespaceSelect', namespaceSelectComponent); .component('kdNamespaceSelect', namespaceSelectComponent)
.service('kdNamespaceService', NamespaceService);
// 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.
/**
* Service class for registering namespace.
* @final
*/
export class NamespaceService {
/**
* @ngInject
*/
constructor() {
/** @private {boolean} */
this.multipleNamespacesSelected_ = true;
}
/**
* Getter for multipleNamespacesSelected_ flag.
* @return {boolean}
*/
areMultipleNamespacesSelected() { return this.multipleNamespacesSelected_; }
/**
* Switches the multipleNamespacesSelected flag.
* @param {boolean} multipleSelected
*/
setMultipleNamespacesSelected(multipleSelected) {
this.multipleNamespacesSelected_ = multipleSelected;
}
}
...@@ -25,9 +25,10 @@ export class NamespaceSelectController { ...@@ -25,9 +25,10 @@ export class NamespaceSelectController {
* @param {!angular.$resource} $resource * @param {!angular.$resource} $resource
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.Scope} $scope * @param {!angular.Scope} $scope
* @param {!./namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($resource, $state, $scope) { constructor($resource, $state, $scope, kdNamespaceService) {
/** /**
* Initialized with all namespaces on first open. * Initialized with all namespaces on first open.
* @export {!Array<string>} * @export {!Array<string>}
...@@ -49,6 +50,11 @@ export class NamespaceSelectController { ...@@ -49,6 +50,11 @@ export class NamespaceSelectController {
*/ */
this.selectedNamespace; this.selectedNamespace;
/**
* @private {!./namespace_service.NamespaceService}
*/
this.namespaceService_ = kdNamespaceService;
/** @private {!angular.$resource} */ /** @private {!angular.$resource} */
this.resource_ = $resource; this.resource_ = $resource;
...@@ -85,16 +91,20 @@ export class NamespaceSelectController { ...@@ -85,16 +91,20 @@ export class NamespaceSelectController {
if (this.namespacesInitialized_) { if (this.namespacesInitialized_) {
if (this.namespaces.indexOf(newNamespace) >= 0) { if (this.namespaces.indexOf(newNamespace) >= 0) {
this.selectedNamespace = newNamespace; this.selectedNamespace = newNamespace;
this.namespaceService_.setMultipleNamespacesSelected(false);
} else { } else {
this.selectedNamespace = NAMESPACE_NOT_SELECTED; this.selectedNamespace = NAMESPACE_NOT_SELECTED;
this.namespaceService_.setMultipleNamespacesSelected(true);
} }
this.changeNamespace(); this.changeNamespace();
} else { } else {
this.namespaces = [newNamespace]; this.namespaces = [newNamespace];
this.selectedNamespace = newNamespace; this.selectedNamespace = newNamespace;
this.namespaceService_.setMultipleNamespacesSelected(false);
} }
} else { } else {
this.selectedNamespace = NAMESPACE_NOT_SELECTED; this.selectedNamespace = NAMESPACE_NOT_SELECTED;
this.namespaceService_.setMultipleNamespacesSelected(true);
} }
} }
} }
......
...@@ -24,6 +24,12 @@ limitations under the License. ...@@ -24,6 +24,12 @@ limitations under the License.
</a> </a>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.configMap.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.configMap.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.configMap.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -24,9 +24,10 @@ export default class ConfigMapCardController { ...@@ -24,9 +24,10 @@ export default class ConfigMapCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** /**
* Initialized from the scope. * Initialized from the scope.
* @export {!backendApi.ConfigMap} * @export {!backendApi.ConfigMap}
...@@ -39,10 +40,21 @@ export default class ConfigMapCardController { ...@@ -39,10 +40,21 @@ export default class ConfigMapCardController {
/** @private */ /** @private */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_CONFIG_MAP_LIST_HEADER_NAME}} {{::$ctrl.i18n.MSG_CONFIG_MAP_LIST_HEADER_NAME}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_CONFIGMAP_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_CONFIG_MAP_LIST_HEADER_LABELS}} {{::$ctrl.i18n.MSG_CONFIG_MAP_LIST_HEADER_LABELS}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -19,12 +19,24 @@ ...@@ -19,12 +19,24 @@
*/ */
export class ConfigMapCardListController { export class ConfigMapCardListController {
/** /**
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor() { constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -41,10 +53,12 @@ export const configMapCardListComponent = { ...@@ -41,10 +53,12 @@ export const configMapCardListComponent = {
}; };
const i18n = { const i18n = {
/** @export {string} @desc Pet set list header: name. */ /** @export {string} @desc Config map list header: name. */
MSG_CONFIG_MAP_LIST_HEADER_NAME: goog.getMsg('Name'), MSG_CONFIG_MAP_LIST_HEADER_NAME: goog.getMsg('Name'),
/** @export {string} @desc Pet set list header: labels. */ /** @export {string} @desc Config map list header: namespace. */
MSG_CONFIG_MAP_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Config map list header: labels. */
MSG_CONFIG_MAP_LIST_HEADER_LABELS: goog.getMsg('Labels'), MSG_CONFIG_MAP_LIST_HEADER_LABELS: goog.getMsg('Labels'),
/** @export {string} @desc Pet set list header: age. */ /** @export {string} @desc Config map list header: age. */
MSG_CONFIG_MAP_LIST_HEADER_AGE: goog.getMsg('Age'), MSG_CONFIG_MAP_LIST_HEADER_AGE: goog.getMsg('Age'),
}; };
...@@ -17,6 +17,7 @@ import filtersModule from 'common/filters/filters_module'; ...@@ -17,6 +17,7 @@ import filtersModule from 'common/filters/filters_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import chromeModule from 'chrome/chrome_module'; import chromeModule from 'chrome/chrome_module';
import configMapDetailModule from 'configmapdetail/configmapdetail_module'; import configMapDetailModule from 'configmapdetail/configmapdetail_module';
import namespaceModule from 'common/namespace/namespace_module';
import {configMapCardComponent} from './configmapcard_component'; import {configMapCardComponent} from './configmapcard_component';
import {configMapCardListComponent} from './configmapcardlist_component'; import {configMapCardListComponent} from './configmapcardlist_component';
...@@ -34,6 +35,7 @@ export default angular ...@@ -34,6 +35,7 @@ export default angular
componentsModule.name, componentsModule.name,
configMapDetailModule.name, configMapDetailModule.name,
chromeModule.name, chromeModule.name,
namespaceModule.name,
]) ])
.config(stateConfig) .config(stateConfig)
.component('kdConfigMapCardList', configMapCardListComponent) .component('kdConfigMapCardList', configMapCardListComponent)
......
...@@ -35,6 +35,12 @@ limitations under the License. ...@@ -35,6 +35,12 @@ limitations under the License.
</kd-middle-ellipsis> </kd-middle-ellipsis>
</a> </a>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.daemonSet.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.daemonSet.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.daemonSet.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -24,9 +24,10 @@ export class DaemonSetCardController { ...@@ -24,9 +24,10 @@ export class DaemonSetCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** @export {!backendApi.DaemonSet} - Initialized from binding. */ /** @export {!backendApi.DaemonSet} - Initialized from binding. */
this.daemonSet; this.daemonSet;
...@@ -36,10 +37,21 @@ export class DaemonSetCardController { ...@@ -36,10 +37,21 @@ export class DaemonSetCardController {
/** @private {!angular.$interpolate} */ /** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column> <kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_NAME_LABEL}} {{::$ctrl.i18n.MSG_DAEMON_SET_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column> <kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_LABELS_LABEL}} {{::$ctrl.i18n.MSG_DAEMON_SET_LIST_LABELS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -16,11 +16,25 @@ ...@@ -16,11 +16,25 @@
* @final * @final
*/ */
export class DaemonSetCardListController { export class DaemonSetCardListController {
/** @ngInject */ /**
constructor() { * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -47,6 +61,9 @@ const i18n = { ...@@ -47,6 +61,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
daemon sets (daemon set list view). */ daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_DAEMON_SET_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of /** @export {string} @desc Label 'Labels' which appears as a column label in the table of
daemon sets (daemon set list view). */ daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_LABELS_LABEL: goog.getMsg('Labels'), MSG_DAEMON_SET_LIST_LABELS_LABEL: goog.getMsg('Labels'),
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import chromeModule from 'chrome/chrome_module'; import chromeModule from 'chrome/chrome_module';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import namespaceModule from 'common/namespace/namespace_module';
import stateConfig from './daemonsetlist_stateconfig'; import stateConfig from './daemonsetlist_stateconfig';
import {daemonSetCardListComponent} from './daemonsetcardlist_component'; import {daemonSetCardListComponent} from './daemonsetcardlist_component';
import {daemonSetCardComponent} from './daemonsetcard_component'; import {daemonSetCardComponent} from './daemonsetcard_component';
...@@ -33,6 +34,7 @@ export default angular ...@@ -33,6 +34,7 @@ export default angular
'ngResource', 'ngResource',
'ui.router', 'ui.router',
filtersModule.name, filtersModule.name,
namespaceModule.name,
componentsModule.name, componentsModule.name,
chromeModule.name, chromeModule.name,
daemonSetDetailModule.name, daemonSetDetailModule.name,
......
...@@ -41,6 +41,12 @@ limitations under the License. ...@@ -41,6 +41,12 @@ limitations under the License.
</a> </a>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.deployment.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.deployment.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.deployment.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -24,9 +24,10 @@ export default class DeploymentCardController { ...@@ -24,9 +24,10 @@ export default class DeploymentCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** /**
* Initialized from the scope. * Initialized from the scope.
* @export {!backendApi.Deployment} * @export {!backendApi.Deployment}
...@@ -39,10 +40,21 @@ export default class DeploymentCardController { ...@@ -39,10 +40,21 @@ export default class DeploymentCardController {
/** @private {!angular.$interpolate} */ /** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_DEPLOYMENT_LIST_NAME_LABEL}} {{::$ctrl.i18n.MSG_DEPLOYMENT_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_DEPLOYMENT_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_DEPLOYMENT_LIST_LABELS_LABEL}} {{::$ctrl.i18n.MSG_DEPLOYMENT_LIST_LABELS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -16,8 +16,25 @@ ...@@ -16,8 +16,25 @@
* @final * @final
*/ */
class DeploymentCardListController { class DeploymentCardListController {
/** @ngInject */ /**
constructor() { this.i18n = i18n; } * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */
this.i18n = i18n;
}
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -37,6 +54,9 @@ const i18n = { ...@@ -37,6 +54,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
deployments (deployment list view). */ deployments (deployment list view). */
MSG_DEPLOYMENT_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_DEPLOYMENT_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of deployments (deployment list view). */
MSG_DEPLOYMENT_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of /** @export {string} @desc Label 'Labels' which appears as a column label in the table of
deployments (deployment list view). */ deployments (deployment list view). */
MSG_DEPLOYMENT_LIST_LABELS_LABEL: goog.getMsg('Labels'), MSG_DEPLOYMENT_LIST_LABELS_LABEL: goog.getMsg('Labels'),
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import stateConfig from './deploymentlist_stateconfig'; import stateConfig from './deploymentlist_stateconfig';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import namespaceModule from 'common/namespace/namespace_module';
import chromeModule from 'chrome/chrome_module'; import chromeModule from 'chrome/chrome_module';
import {deploymentCardComponent} from './deploymentcard_component'; import {deploymentCardComponent} from './deploymentcard_component';
import {deploymentCardListComponent} from './deploymentcardlist_component'; import {deploymentCardListComponent} from './deploymentcardlist_component';
...@@ -34,6 +35,7 @@ export default angular ...@@ -34,6 +35,7 @@ export default angular
'ui.router', 'ui.router',
filtersModule.name, filtersModule.name,
componentsModule.name, componentsModule.name,
namespaceModule.name,
chromeModule.name, chromeModule.name,
deploymentDetailModule.name, deploymentDetailModule.name,
]) ])
......
...@@ -41,6 +41,12 @@ limitations under the License. ...@@ -41,6 +41,12 @@ limitations under the License.
</a> </a>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.job.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.job.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.job.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -23,9 +23,10 @@ import {stateName} from 'jobdetail/jobdetail_state'; ...@@ -23,9 +23,10 @@ import {stateName} from 'jobdetail/jobdetail_state';
export default class JobCardController { export default class JobCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state) { constructor($state, kdNamespaceService) {
/** /**
* Initialized from the scope. * Initialized from the scope.
* @export {!backendApi.Job} * @export {!backendApi.Job}
...@@ -34,6 +35,17 @@ export default class JobCardController { ...@@ -34,6 +35,17 @@ export default class JobCardController {
/** @private {!ui.router.$state} */ /** @private {!ui.router.$state} */
this.state_ = $state; this.state_ = $state;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
}
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
} }
/** /**
......
...@@ -17,19 +17,22 @@ limitations under the License. ...@@ -17,19 +17,22 @@ limitations under the License.
<kd-resource-card-list selectable="false" with-statuses="true"> <kd-resource-card-list selectable="false" with-statuses="true">
<kd-resource-card-header-columns> <kd-resource-card-header-columns>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
Name {{::$ctrl.i18n.MSG_JOB_LIST_NAME_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_JOB_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
Labels {{::$ctrl.i18n.MSG_JOB_LIST_LABELS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="nogrow" size="small"> <kd-resource-card-header-column grow="nogrow" size="small">
Pods {{::$ctrl.i18n.MSG_JOB_LIST_PODS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="nogrow" size="small"> <kd-resource-card-header-column grow="nogrow" size="small">
Age {{::$ctrl.i18n.MSG_JOB_LIST_AGE_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column> <kd-resource-card-header-column>
Images {{::$ctrl.i18n.MSG_JOB_LIST_IMAGES_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="nogrow"> <kd-resource-card-header-column size="small" grow="nogrow">
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -12,6 +12,31 @@ ...@@ -12,6 +12,31 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
/**
* @final
*/
class JobListController {
/**
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */
this.i18n = i18n;
}
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
}
/** /**
* @return {!angular.Component} * @return {!angular.Component}
*/ */
...@@ -23,4 +48,26 @@ export const jobCardListComponent = { ...@@ -23,4 +48,26 @@ export const jobCardListComponent = {
'jobListResource': '<', 'jobListResource': '<',
}, },
templateUrl: 'joblist/jobcardlist.html', templateUrl: 'joblist/jobcardlist.html',
controller: JobListController,
};
const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of
jobs (Job list view). */
MSG_JOB_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of replication controllers (Job list view). */
MSG_JOB_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of
replication controllers (Job list view). */
MSG_JOB_LIST_LABELS_LABEL: goog.getMsg('Labels'),
/** @export {string} @desc Label 'Pods' which appears as a column label in the table of
replication controllers (Job list view). */
MSG_JOB_LIST_PODS_LABEL: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Age' which appears as a column label in the
table of replication controllers (Job list view). */
MSG_JOB_LIST_AGE_LABEL: goog.getMsg('Age'),
/** @export {string} @desc Label 'Images' which appears as a column label in the
table of replication controllers (Job list view). */
MSG_JOB_LIST_IMAGES_LABEL: goog.getMsg('Images'),
}; };
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import stateConfig from './joblist_stateconfig'; import stateConfig from './joblist_stateconfig';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import namespaceModule from 'common/namespace/namespace_module';
import {jobCardComponent} from './jobcard_component'; import {jobCardComponent} from './jobcard_component';
import {jobCardListComponent} from './jobcardlist_component'; import {jobCardListComponent} from './jobcardlist_component';
import jobDetailModule from 'jobdetail/jobdetail_module'; import jobDetailModule from 'jobdetail/jobdetail_module';
...@@ -34,6 +35,7 @@ export default angular ...@@ -34,6 +35,7 @@ export default angular
filtersModule.name, filtersModule.name,
componentsModule.name, componentsModule.name,
jobDetailModule.name, jobDetailModule.name,
namespaceModule.name,
]) ])
.config(stateConfig) .config(stateConfig)
.component('kdJobCardList', jobCardListComponent) .component('kdJobCardList', jobCardListComponent)
......
...@@ -39,6 +39,12 @@ limitations under the License. ...@@ -39,6 +39,12 @@ limitations under the License.
</a> </a>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.petSet.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.petSet.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.petSet.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -24,9 +24,10 @@ export default class PetSetCardController { ...@@ -24,9 +24,10 @@ export default class PetSetCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** /**
* Initialized from the scope. * Initialized from the scope.
* @export {!backendApi.PetSet} * @export {!backendApi.PetSet}
...@@ -39,10 +40,21 @@ export default class PetSetCardController { ...@@ -39,10 +40,21 @@ export default class PetSetCardController {
/** @private */ /** @private */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_PET_SET_LIST_HEADER_NAME}} {{::$ctrl.i18n.MSG_PET_SET_LIST_HEADER_NAME}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_PET_SET_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_PET_SET_LIST_HEADER_LABELS}} {{::$ctrl.i18n.MSG_PET_SET_LIST_HEADER_LABELS}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -19,12 +19,24 @@ ...@@ -19,12 +19,24 @@
*/ */
export class PetSetCardListController { export class PetSetCardListController {
/** /**
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor() { constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -43,6 +55,8 @@ export const petSetCardListComponent = { ...@@ -43,6 +55,8 @@ export const petSetCardListComponent = {
const i18n = { const i18n = {
/** @export {string} @desc Pet set list header: name. */ /** @export {string} @desc Pet set list header: name. */
MSG_PET_SET_LIST_HEADER_NAME: goog.getMsg('Name'), MSG_PET_SET_LIST_HEADER_NAME: goog.getMsg('Name'),
/** @export {string} @desc Pet set list header: namespace. */
MSG_PET_SET_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Pet set list header: labels. */ /** @export {string} @desc Pet set list header: labels. */
MSG_PET_SET_LIST_HEADER_LABELS: goog.getMsg('Labels'), MSG_PET_SET_LIST_HEADER_LABELS: goog.getMsg('Labels'),
/** @export {string} @desc Pet set list header: pods. */ /** @export {string} @desc Pet set list header: pods. */
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import stateConfig from './petsetlist_stateconfig'; import stateConfig from './petsetlist_stateconfig';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import namespaceModule from 'common/namespace/namespace_module';
import chromeModule from 'chrome/chrome_module'; import chromeModule from 'chrome/chrome_module';
import petSetDetailModule from 'petsetdetail/petsetdetail_module'; import petSetDetailModule from 'petsetdetail/petsetdetail_module';
import {petSetCardComponent} from './petsetcard_component'; import {petSetCardComponent} from './petsetcard_component';
...@@ -34,6 +35,7 @@ export default angular ...@@ -34,6 +35,7 @@ export default angular
'ui.router', 'ui.router',
filtersModule.name, filtersModule.name,
componentsModule.name, componentsModule.name,
namespaceModule.name,
petSetDetailModule.name, petSetDetailModule.name,
chromeModule.name, chromeModule.name,
]) ])
......
...@@ -20,6 +20,9 @@ limitations under the License. ...@@ -20,6 +20,9 @@ limitations under the License.
<kd-resource-card-header-column size="medium" grow="4"> <kd-resource-card-header-column size="medium" grow="4">
{{::$ctrl.i18n.MSG_POD_LIST_NAME_LABEL}} {{::$ctrl.i18n.MSG_POD_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_POD_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="nogrow">{{::$ctrl.i18n.MSG_POD_LIST_STATUS_LABEL}} <kd-resource-card-header-column grow="nogrow">{{::$ctrl.i18n.MSG_POD_LIST_STATUS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="nogrow"> <kd-resource-card-header-column size="small" grow="nogrow">
...@@ -64,6 +67,12 @@ limitations under the License. ...@@ -64,6 +67,12 @@ limitations under the License.
</a> </a>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.isMultipleNamespaces">
<div>
<kd-middle-ellipsis display-string="{{::pod.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column>{{::pod.podPhase}}</kd-resource-card-column> <kd-resource-card-column>{{::pod.podPhase}}</kd-resource-card-column>
<kd-resource-card-column>{{::pod.restartCount}}</kd-resource-card-column> <kd-resource-card-column>{{::pod.restartCount}}</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
......
...@@ -24,8 +24,9 @@ export class PodCardListController { ...@@ -24,8 +24,9 @@ export class PodCardListController {
* @ngInject * @ngInject
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** /**
* List of pods. Initialized from the scope. * List of pods. Initialized from the scope.
* @export {!backendApi.PodList} * @export {!backendApi.PodList}
...@@ -41,10 +42,21 @@ export class PodCardListController { ...@@ -41,10 +42,21 @@ export class PodCardListController {
/** @private {!angular.$interpolate} */ /** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {boolean} * @return {boolean}
* @export * @export
...@@ -166,6 +178,9 @@ const i18n = { ...@@ -166,6 +178,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
pods (pod list view). */ pods (pod list view). */
MSG_POD_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_POD_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of pods (pod list view). */
MSG_POD_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Status' which appears as a column label in the table of /** @export {string} @desc Label 'Status' which appears as a column label in the table of
pods (pod list view). */ pods (pod list view). */
MSG_POD_LIST_STATUS_LABEL: goog.getMsg('Status'), MSG_POD_LIST_STATUS_LABEL: goog.getMsg('Status'),
......
...@@ -17,6 +17,7 @@ import stateConfig from './podlist_stateconfig'; ...@@ -17,6 +17,7 @@ import stateConfig from './podlist_stateconfig';
import {podCardListComponent} from './podcardlist_component'; import {podCardListComponent} from './podcardlist_component';
import paginationModule from 'common/pagination/pagination_module'; import paginationModule from 'common/pagination/pagination_module';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import namespaceModule from 'common/namespace/namespace_module';
/** /**
* Angular module for the Pods list view. * Angular module for the Pods list view.
...@@ -33,6 +34,7 @@ export default angular ...@@ -33,6 +34,7 @@ export default angular
chromeModule.name, chromeModule.name,
paginationModule.name, paginationModule.name,
filtersModule.name, filtersModule.name,
namespaceModule.name,
]) ])
.config(stateConfig) .config(stateConfig)
.component('kdPodCardList', podCardListComponent) .component('kdPodCardList', podCardListComponent)
......
...@@ -41,6 +41,12 @@ limitations under the License. ...@@ -41,6 +41,12 @@ limitations under the License.
</a> </a>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.replicaSet.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.replicaSet.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.replicaSet.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -24,9 +24,10 @@ export default class ReplicaSetCardController { ...@@ -24,9 +24,10 @@ export default class ReplicaSetCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** /**
* Initialized from the scope. * Initialized from the scope.
* @export {!backendApi.ReplicaSet} * @export {!backendApi.ReplicaSet}
...@@ -39,10 +40,21 @@ export default class ReplicaSetCardController { ...@@ -39,10 +40,21 @@ export default class ReplicaSetCardController {
/** @private */ /** @private */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_NAME_LABEL}} {{::$ctrl.i18n.MSG_REPLICA_SET_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_LABELS_LABEL}} {{::$ctrl.i18n.MSG_REPLICA_SET_LIST_LABELS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -17,14 +17,27 @@ ...@@ -17,14 +17,27 @@
*/ */
export class ReplicaSetCardListController { export class ReplicaSetCardListController {
/** /**
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor() { constructor(kdNamespaceService) {
/** @export {!backendApi.ReplicaSetList} Initialized from binding. */ /** @export {!backendApi.ReplicaSetList} Initialized from binding. */
this.replicaSetList; this.replicaSetList;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -44,6 +57,9 @@ const i18n = { ...@@ -44,6 +57,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
replica sets (replica set list view). */ replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_REPLICA_SET_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of replication controllers (RC list view). */
MSG_REPLICA_SET_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of /** @export {string} @desc Label 'Labels' which appears as a column label in the table of
replica sets (replica set list view). */ replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_LABELS_LABEL: goog.getMsg('Labels'), MSG_REPLICA_SET_LIST_LABELS_LABEL: goog.getMsg('Labels'),
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import stateConfig from './replicasetlist_stateconfig'; import stateConfig from './replicasetlist_stateconfig';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import namespaceModule from 'common/namespace/namespace_module';
import {replicaSetCardComponent} from './replicasetcard_component'; import {replicaSetCardComponent} from './replicasetcard_component';
import {replicaSetCardListComponent} from './replicasetcardlist_component'; import {replicaSetCardListComponent} from './replicasetcardlist_component';
import replicaSetDetailModule from 'replicasetdetail/replicasetdetail_module'; import replicaSetDetailModule from 'replicasetdetail/replicasetdetail_module';
...@@ -34,6 +35,7 @@ export default angular ...@@ -34,6 +35,7 @@ export default angular
'ui.router', 'ui.router',
filtersModule.name, filtersModule.name,
componentsModule.name, componentsModule.name,
namespaceModule.name,
replicaSetDetailModule.name, replicaSetDetailModule.name,
paginationModule.name, paginationModule.name,
]) ])
......
...@@ -38,6 +38,12 @@ limitations under the License. ...@@ -38,6 +38,12 @@ limitations under the License.
</div> </div>
</a> </a>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.replicationController.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.replicationController.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.replicationController.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -24,9 +24,10 @@ export default class ReplicationControllerCardController { ...@@ -24,9 +24,10 @@ export default class ReplicationControllerCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state, $interpolate) { constructor($state, $interpolate, kdNamespaceService) {
/** /**
* Initialized from the scope. * Initialized from the scope.
* @export {!backendApi.ReplicationController} * @export {!backendApi.ReplicationController}
...@@ -39,10 +40,21 @@ export default class ReplicationControllerCardController { ...@@ -39,10 +40,21 @@ export default class ReplicationControllerCardController {
/** @private {!angular.$interpolate} */ /** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_RC_LIST_NAME_LABEL}} {{::$ctrl.i18n.MSG_RC_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_RC_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2"> <kd-resource-card-header-column grow="2">
{{::$ctrl.i18n.MSG_RC_LIST_LABELS_LABEL}} {{::$ctrl.i18n.MSG_RC_LIST_LABELS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -16,10 +16,25 @@ ...@@ -16,10 +16,25 @@
* @final * @final
*/ */
class RCCardListController { class RCCardListController {
constructor() { /**
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -39,6 +54,9 @@ const i18n = { ...@@ -39,6 +54,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
replication controllers (RC list view). */ replication controllers (RC list view). */
MSG_RC_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_RC_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of replication controllers (RC list view). */
MSG_RC_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of /** @export {string} @desc Label 'Labels' which appears as a column label in the table of
replication controllers (RC list view). */ replication controllers (RC list view). */
MSG_RC_LIST_LABELS_LABEL: goog.getMsg('Labels'), MSG_RC_LIST_LABELS_LABEL: goog.getMsg('Labels'),
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import stateConfig from './replicationcontrollerlist_stateconfig'; import stateConfig from './replicationcontrollerlist_stateconfig';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import namespaceModule from 'common/namespace/namespace_module';
import {replicationControllerCardComponent} from './replicationcontrollercard_component'; import {replicationControllerCardComponent} from './replicationcontrollercard_component';
import {replicationControllerCardMenuComponent} from './replicationcontrollercardmenu_component'; import {replicationControllerCardMenuComponent} from './replicationcontrollercardmenu_component';
import {replicationControllerCardListComponent} from './replicationcontrollercardlist_component'; import {replicationControllerCardListComponent} from './replicationcontrollercardlist_component';
...@@ -35,6 +36,7 @@ export default angular ...@@ -35,6 +36,7 @@ export default angular
filtersModule.name, filtersModule.name,
componentsModule.name, componentsModule.name,
replicationControllerDetailModule.name, replicationControllerDetailModule.name,
namespaceModule.name,
]) ])
.config(stateConfig) .config(stateConfig)
.component('kdReplicationControllerCardList', replicationControllerCardListComponent) .component('kdReplicationControllerCardList', replicationControllerCardListComponent)
......
...@@ -22,6 +22,12 @@ limitations under the License. ...@@ -22,6 +22,12 @@ limitations under the License.
</kd-middle-ellipsis> </kd-middle-ellipsis>
</div> </div>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::$ctrl.secret.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<div ng-if="::$ctrl.secret.objectMeta.creationTimestamp"> <div ng-if="::$ctrl.secret.objectMeta.creationTimestamp">
{{::$ctrl.secret.objectMeta.creationTimestamp | relativeTime}} {{::$ctrl.secret.objectMeta.creationTimestamp | relativeTime}}
......
...@@ -2,8 +2,9 @@ class SecretCardController { ...@@ -2,8 +2,9 @@ class SecretCardController {
/** /**
* @ngInject * @ngInject
* @param {!angular.$interpolate} $interpolate * @param {!angular.$interpolate} $interpolate
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
*/ */
constructor($interpolate) { constructor($interpolate, kdNamespaceService) {
/** /**
* Secret initialised from scope * Secret initialised from scope
* @export {!backendApi.Secret} * @export {!backendApi.Secret}
...@@ -12,6 +13,17 @@ class SecretCardController { ...@@ -12,6 +13,17 @@ class SecretCardController {
/** @private {!angular.$interpolate} */ /** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate; this.interpolate_ = $interpolate;
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
}
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
} }
/** /**
......
...@@ -18,6 +18,9 @@ limitations under the License. ...@@ -18,6 +18,9 @@ limitations under the License.
<kd-resource-card-header-columns> <kd-resource-card-header-columns>
<kd-resource-card-header-column size="medium" grow="4">{{::$ctrl.i18n.MSG_SECRET_LIST_NAME_LABEL}} <kd-resource-card-header-column size="medium" grow="4">{{::$ctrl.i18n.MSG_SECRET_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column grow="2" ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_SECRET_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="nogrow">{{::$ctrl.i18n.MSG_SECRET_LIST_AGE_LABEL}} <kd-resource-card-header-column grow="nogrow">{{::$ctrl.i18n.MSG_SECRET_LIST_AGE_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
</kd-resource-card-header-columns> </kd-resource-card-header-columns>
......
...@@ -16,11 +16,25 @@ ...@@ -16,11 +16,25 @@
* @final * @final
*/ */
export class SecretCardListController { export class SecretCardListController {
/** @ngInject */ /**
constructor() { * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -42,6 +56,9 @@ const i18n = { ...@@ -42,6 +56,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
secrets (secret list view). */ secrets (secret list view). */
MSG_SECRET_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_SECRET_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of secrets (secret list view). */
MSG_SECRET_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Age' which appears as a column label in the /** @export {string} @desc Label 'Age' which appears as a column label in the
table of secrets (secret list view). */ table of secrets (secret list view). */
MSG_SECRET_LIST_AGE_LABEL: goog.getMsg('Age'), MSG_SECRET_LIST_AGE_LABEL: goog.getMsg('Age'),
......
...@@ -17,6 +17,7 @@ import stateConfig from './secretlist_stateconfig'; ...@@ -17,6 +17,7 @@ import stateConfig from './secretlist_stateconfig';
import paginationModule from 'common/pagination/pagination_module'; import paginationModule from 'common/pagination/pagination_module';
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import namespaceModule from 'common/namespace/namespace_module';
import {secretCardListComponent} from './secretcardlist_component'; import {secretCardListComponent} from './secretcardlist_component';
import {secretCardComponent} from './secretcard_component'; import {secretCardComponent} from './secretcard_component';
...@@ -36,6 +37,7 @@ export default angular ...@@ -36,6 +37,7 @@ export default angular
componentsModule.name, componentsModule.name,
paginationModule.name, paginationModule.name,
filtersModule.name, filtersModule.name,
namespaceModule.name,
]) ])
.config(stateConfig) .config(stateConfig)
.component('kdSecretCardList', secretCardListComponent) .component('kdSecretCardList', secretCardListComponent)
......
...@@ -32,6 +32,12 @@ limitations under the License. ...@@ -32,6 +32,12 @@ limitations under the License.
</kd-middle-ellipsis> </kd-middle-ellipsis>
</a> </a>
</kd-resource-card-column> </kd-resource-card-column>
<kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
<div>
<kd-middle-ellipsis display-string="{{::service.objectMeta.namespace}}">
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column> <kd-resource-card-column>
<kd-labels labels="::$ctrl.service.objectMeta.labels"></kd-labels> <kd-labels labels="::$ctrl.service.objectMeta.labels"></kd-labels>
</kd-resource-card-column> </kd-resource-card-column>
......
...@@ -21,9 +21,13 @@ import {stateName} from 'servicedetail/servicedetail_state'; ...@@ -21,9 +21,13 @@ import {stateName} from 'servicedetail/servicedetail_state';
export class ServiceCardController { export class ServiceCardController {
/** /**
* @param {!ui.router.$state} $state * @param {!ui.router.$state} $state
* @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject * @ngInject
*/ */
constructor($state) { constructor($state, kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export {!backendApi.Service} */ /** @export {!backendApi.Service} */
this.service; this.service;
...@@ -34,6 +38,14 @@ export class ServiceCardController { ...@@ -34,6 +38,14 @@ export class ServiceCardController {
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/** /**
* @return {string} * @return {string}
* @export * @export
......
...@@ -19,6 +19,9 @@ limitations under the License. ...@@ -19,6 +19,9 @@ limitations under the License.
<kd-resource-card-header-column> <kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_SERVICE_LIST_NAME_LABEL}} {{::$ctrl.i18n.MSG_SERVICE_LIST_NAME_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
<kd-resource-card-header-column ng-if="$ctrl.areMultipleNamespacesSelected()">
{{::$ctrl.i18n.MSG_SERVICE_LIST_NAMESPACE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column> <kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_SERVICE_LIST_LABELS_LABEL}} {{::$ctrl.i18n.MSG_SERVICE_LIST_LABELS_LABEL}}
</kd-resource-card-header-column> </kd-resource-card-header-column>
......
...@@ -16,11 +16,25 @@ ...@@ -16,11 +16,25 @@
* @final * @final
*/ */
export class ServiceCardListController { export class ServiceCardListController {
/** @ngInject */ /**
constructor() { * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
constructor(kdNamespaceService) {
/** @private {!./../common/namespace/namespace_service.NamespaceService} */
this.kdNamespaceService_ = kdNamespaceService;
/** @export */ /** @export */
this.i18n = i18n; this.i18n = i18n;
} }
/**
* @return {boolean}
* @export
*/
areMultipleNamespacesSelected() {
return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
} }
/** /**
...@@ -45,6 +59,9 @@ const i18n = { ...@@ -45,6 +59,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of /** @export {string} @desc Label 'Name' which appears as a column label in the table of
services (service list view). */ services (service list view). */
MSG_SERVICE_LIST_NAME_LABEL: goog.getMsg('Name'), MSG_SERVICE_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Namespace' which appears as a column label in the
table of services (service list view). */
MSG_SERVICE_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of /** @export {string} @desc Label 'Labels' which appears as a column label in the table of
services (service list view). */ services (service list view). */
MSG_SERVICE_LIST_LABELS_LABEL: goog.getMsg('Labels'), MSG_SERVICE_LIST_LABELS_LABEL: goog.getMsg('Labels'),
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import componentsModule from 'common/components/components_module'; import componentsModule from 'common/components/components_module';
import chromeModule from 'chrome/chrome_module'; import chromeModule from 'chrome/chrome_module';
import filtersModule from 'common/filters/filters_module'; import filtersModule from 'common/filters/filters_module';
import namespaceModule from 'common/namespace/namespace_module';
import stateConfig from './servicelist_stateconfig'; import stateConfig from './servicelist_stateconfig';
import {serviceCardListComponent} from './servicecardlist_component'; import {serviceCardListComponent} from './servicecardlist_component';
import {serviceCardComponent} from './servicecard_component'; import {serviceCardComponent} from './servicecard_component';
...@@ -34,6 +35,7 @@ export default angular ...@@ -34,6 +35,7 @@ export default angular
filtersModule.name, filtersModule.name,
componentsModule.name, componentsModule.name,
chromeModule.name, chromeModule.name,
namespaceModule.name,
]) ])
.config(stateConfig) .config(stateConfig)
.component('kdServiceCardList', serviceCardListComponent) .component('kdServiceCardList', serviceCardListComponent)
......
// 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 namespaceModule from 'common/namespace/namespace_module';
describe('Namespace service', () => {
/** @type {!common/namespace/namespace_service.NamespaceService} */
let namespaceService;
beforeEach(() => angular.mock.module(namespaceModule.name));
beforeEach(angular.mock.inject((kdNamespaceService) => {
namespaceService = kdNamespaceService;
}));
it(`should initialise multipleNamespacesSelected as true`,
() => { expect(namespaceService.areMultipleNamespacesSelected()).toBe(true); });
it(`should set multipleNamespacesSelected to true`, () => {
namespaceService.setMultipleNamespacesSelected(true);
expect(namespaceService.areMultipleNamespacesSelected()).toBe(true);
});
it(`should set multipleNamespacesSelected to false`, () => {
namespaceService.setMultipleNamespacesSelected(false);
expect(namespaceService.areMultipleNamespacesSelected()).toBe(false);
});
});
...@@ -21,6 +21,8 @@ describe('Namespace select component ', () => { ...@@ -21,6 +21,8 @@ describe('Namespace select component ', () => {
let scope; let scope;
/** @type {!common/namespace/namespaceselect_component.NamespaceSelectController} */ /** @type {!common/namespace/namespaceselect_component.NamespaceSelectController} */
let ctrl; let ctrl;
/** @type {!common/namespace/namespace_service.NamespaceService} */
let service;
/** @type {!angular.$httpBackend} */ /** @type {!angular.$httpBackend} */
let httpBackend; let httpBackend;
/** @type {!ui.router.$state} */ /** @type {!ui.router.$state} */
...@@ -39,12 +41,14 @@ describe('Namespace select component ', () => { ...@@ -39,12 +41,14 @@ describe('Namespace select component ', () => {
angular.mock.module(fakeModule.name); angular.mock.module(fakeModule.name);
angular.mock.module(chromeModule.name); angular.mock.module(chromeModule.name);
angular.mock.inject(($componentController, $rootScope, $httpBackend, $state) => { angular.mock.inject(
scope = $rootScope; ($componentController, $rootScope, $httpBackend, $state, kdNamespaceService) => {
ctrl = $componentController('kdNamespaceSelect', {$scope: $rootScope}); scope = $rootScope;
httpBackend = $httpBackend; ctrl = $componentController('kdNamespaceSelect', {$scope: $rootScope});
state = $state; service = kdNamespaceService;
}); httpBackend = $httpBackend;
state = $state;
});
}); });
it('should initialize from non-exisitng namespace and watch for state changes', () => { it('should initialize from non-exisitng namespace and watch for state changes', () => {
...@@ -106,4 +110,15 @@ describe('Namespace select component ', () => { ...@@ -106,4 +110,15 @@ describe('Namespace select component ', () => {
ctrl.selectedNamespace = 'foo'; ctrl.selectedNamespace = 'foo';
expect(ctrl.formatNamespace('foo')).toBe('foo'); expect(ctrl.formatNamespace('foo')).toBe('foo');
}); });
it('should change this.isMultipleNamespaces depending on namespaces selected', () => {
ctrl.$onInit();
expect(service.areMultipleNamespacesSelected()).toBe(true);
scope.$broadcast('$stateChangeSuccess', {}, {namespace: 'a'});
scope.$digest();
expect(ctrl.selectedNamespace).toBe('a');
expect(service.areMultipleNamespacesSelected()).toBe(false);
});
}); });
...@@ -16,14 +16,28 @@ import configMapListModule from 'configmaplist/configmaplist_module'; ...@@ -16,14 +16,28 @@ import configMapListModule from 'configmaplist/configmaplist_module';
describe('Config Map card list', () => { describe('Config Map card list', () => {
/** @type {!configmaplist/configmapcard_component.ConfigMapCardListController} */ /** @type {!configmaplist/configmapcard_component.ConfigMapCardListController} */
let ctrl; let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => { beforeEach(() => {
angular.mock.module(configMapListModule.name); angular.mock.module(configMapListModule.name);
angular.mock.inject(($componentController, $rootScope) => { angular.mock.inject(($componentController, $rootScope, kdNamespaceService) => {
ctrl = $componentController('kdConfigMapCardList', {$scope: $rootScope}); /** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!ConfigMapCardListController} */
ctrl = $componentController(
'kdConfigMapCardList', {$scope: $rootScope, kdNamespaceService_: data}, {});
}); });
}); });
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
it('should init i18n', () => { expect(ctrl.i18n).not.toBeUndefined(); }); it('should init i18n', () => { expect(ctrl.i18n).not.toBeUndefined(); });
}); });
// 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 daemonsetListModule from 'daemonsetlist/daemonsetlist_module';
describe('Daemon Set Card List controller', () => {
/**
* @type {!daemonsetlist/daemonsetcardlist_component.DaemonSetCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(daemonsetListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!DaemonSetCardListController} */
ctrl = $componentController('kdDaemonSetCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
// 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 deploymentListModule from 'deploymentlist/deploymentlist_module';
describe('Deployment Card List controller', () => {
/**
* @type {!deploymentlist/deploymentcardlist_component.DeploymentCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(deploymentListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!DeploymentCardListController} */
ctrl = $componentController('kdDeploymentCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
// 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 jobListModule from 'joblist/joblist_module';
describe('Job Card List controller', () => {
/**
* @type {!joblist/jobcardlist_component.JobCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(jobListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!JobCardListController} */
ctrl = $componentController('kdJobCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
// 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 petsetListModule from 'petsetlist/petsetlist_module';
describe('Pet Set Card List controller', () => {
/**
* @type {!petsetlist/petsetcardlist_component.PetSetCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(petsetListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!PetSetCardListController} */
ctrl = $componentController('kdPetSetCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
...@@ -20,16 +20,30 @@ describe('Pod card list controller', () => { ...@@ -20,16 +20,30 @@ describe('Pod card list controller', () => {
* @type {!podlist/podcardlist_component.PodCardListController} * @type {!podlist/podcardlist_component.PodCardListController}
*/ */
let ctrl; let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => { beforeEach(() => {
angular.mock.module(podsListModule.name); angular.mock.module(podsListModule.name);
angular.mock.module(podDetailModule.name); angular.mock.module(podDetailModule.name);
angular.mock.inject(($componentController, $rootScope) => { angular.mock.inject(($componentController, $rootScope, kdNamespaceService) => {
ctrl = $componentController('kdPodCardList', {$scope: $rootScope}, {}); /** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!podCardListController} */
ctrl = $componentController(
'kdPodCardList', {$scope: $rootScope, kdNamespaceService_: data}, {});
}); });
}); });
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
it('should execute logs href callback function', () => { it('should execute logs href callback function', () => {
expect(ctrl.getPodDetailHref({ expect(ctrl.getPodDetailHref({
objectMeta: { objectMeta: {
......
// 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 replicasetListModule from 'replicasetlist/replicasetlist_module';
describe('Replica Set Card List controller', () => {
/**
* @type {!replicasetlist/replicasetcardlist_component.ReplicaSetCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(replicasetListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!ReplicaSetCardListController} */
ctrl = $componentController('kdReplicaSetCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
// 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 replicationControllerListModule from 'replicationcontrollerlist/replicationcontrollerlist_module';
describe('Replication Controller Card List controller', () => {
/**
* @type {!replicationcontrollerlist/replicationcontrollercardlist_component.RCCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(replicationControllerListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!RCCardListController} */
ctrl = $componentController('kdReplicationControllerCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
// 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 secretListModule from 'secretlist/secretlist_module';
describe('Secret Card List controller', () => {
/**
* @type {!secretlist/secretcardlist_component.SecretCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
*/
let data;
beforeEach(() => {
angular.mock.module(secretListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!SecretListController} */
ctrl = $componentController('kdSecretCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
// 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 serviceListModule from 'servicelist/servicelist_module';
describe('Service Card List controller', () => {
/**
* @type {!servicelist/servicecardlist_component.ServiceCardListController}
*/
let ctrl;
/**
* @type {!./../common/namespace/namespace_service.NamespaceService}
* */
let data;
beforeEach(() => {
angular.mock.module(serviceListModule.name);
angular.mock.inject(($componentController, kdNamespaceService) => {
/** @type {!./../common/namespace/namespace_service.NamespaceService} */
data = kdNamespaceService;
/** @type {!ServiceCardListController} */
ctrl = $componentController('kdServiceCardList', {kdNamespaceService_: data});
});
});
it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
it('should return the value from Namespace service', () => {
expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册