提交 bd46a59c 编写于 作者: P Piotr Bryk 提交者: GitHub

Navigation progress 4 (#1154)

* Navigation progress 4

* merged app abr, top bar and tabs into one bar
* improved navigation highlighting (now menu item is highlighted when,
  e.g., a RC is selected)
* Fixed zerostate pages for RCs
* Moved events tables out from tabs to just a card
上级 6757991d
......@@ -569,4 +569,11 @@
<translation id="1546082571745741755" key="MSG_NAMESPACE_NOT_SELECTED" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for dropdown item that indicates that no namespace was selected">All namespaces</translation>
<translation id="1024358167652076581" key="MSG_ALL_NAMESPACES" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for dropdown item that indicates that no namespace was selected">All namespaces</translation>
<translation id="8827015449851505134" key="MSG_NAMESPACE" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title for namespace select.">Namespace</translation>
<translation id="9183905402242013542" key="MSG_EVENTS_CARD" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label for the events card.">Events</translation>
<translation id="3538793608564323810" key="MSG_EVENTS_NO_EVENTS_TITLE" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title of section when there are no events.">There is nothing to display here</translation>
<translation id="7050746505431266585" key="MSG_EVENTS_NO_EVENTS_USER_HELP" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help on the events page when no events are to be displayed.">It is possible that all events have expired.</translation>
<translation id="3610014951719533291" key="MSG_JOB_DETAIL_PODS" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title for a pods section.">Pods</translation>
<translation id="873716249176769410" key="MSG_RC_DETAIL_SERVICES_ZEROSTATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for services card zerostate in replication controller details page.">There are currently no Services with the same label selector as this Replication Controller</translation>
<translation id="4924028459458420869" key="MSG_RC_DETAIL_PODS_ZEROSTATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for pods card zerostate in replication controller details page.">There are currently no Pods selected by this Replication Controller</translation>
<translation id="6335211681012316099" key="MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for pods card zerostate in pet set details page.">There are currently no Pods selected by this Pet Set</translation>
</translationbundle>
\ No newline at end of file
......@@ -758,4 +758,11 @@
<translation id="1546082571745741755" key="MSG_NAMESPACE_NOT_SELECTED" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for dropdown item that indicates that no namespace was selected">All namespaces</translation>
<translation id="1024358167652076581" key="MSG_ALL_NAMESPACES" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for dropdown item that indicates that no namespace was selected">All namespaces</translation>
<translation id="8827015449851505134" key="MSG_NAMESPACE" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title for namespace select.">Namespace</translation>
<translation id="9183905402242013542" key="MSG_EVENTS_CARD" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label for the events card.">Events</translation>
<translation id="3538793608564323810" key="MSG_EVENTS_NO_EVENTS_TITLE" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title of section when there are no events.">There is nothing to display here</translation>
<translation id="7050746505431266585" key="MSG_EVENTS_NO_EVENTS_USER_HELP" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help on the events page when no events are to be displayed.">It is possible that all events have expired.</translation>
<translation id="3610014951719533291" key="MSG_JOB_DETAIL_PODS" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title for a pods section.">Pods</translation>
<translation id="873716249176769410" key="MSG_RC_DETAIL_SERVICES_ZEROSTATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for services card zerostate in replication controller details page.">There are currently no Services with the same label selector as this Replication Controller</translation>
<translation id="4924028459458420869" key="MSG_RC_DETAIL_PODS_ZEROSTATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for pods card zerostate in replication controller details page.">There are currently no Pods selected by this Replication Controller</translation>
<translation id="6335211681012316099" key="MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TEXT" source="/usr/local/google/home/bryk/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for pods card zerostate in pet set details page.">There are currently no Pods selected by this Pet Set</translation>
</translationbundle>
\ No newline at end of file
......@@ -26,7 +26,7 @@ func FilterNamespacedServicesBySelector(services []api.Service, namespace string
var matchingServices []api.Service
for _, service := range services {
if service.ObjectMeta.Namespace == namespace &&
IsSelectorMatching(resourceSelector, service.Labels) {
IsSelectorMatching(service.Spec.Selector, resourceSelector) {
matchingServices = append(matchingServices, service)
}
}
......
......@@ -95,21 +95,21 @@ type ResourceKind string
// List of all resource kinds supported by the UI.
const (
ResourceKindReplicaSet = "replicaset"
ResourceKindService = "service"
ResourceKindDeployment = "deployment"
ResourceKindPod = "pod"
ResourceKindEvent = "event"
ResourceKindReplicationController = "replicationcontroller"
ResourceKindDaemonSet = "daemonset"
ResourceKindJob = "job"
ResourceKindPetSet = "petset"
ResourceKindNamespace = "namespace"
ResourceKindNode = "node"
ResourceKindSecret = "secret"
ResourceKindConfigMap = "configmap"
ResourceKindPersistentVolume = "persistentvolume"
ResourceKindPersistentVolumeClaim = "persistentvolumeclaim"
ResourceKindReplicaSet = "replicaset"
ResourceKindService = "service"
ResourceKindDeployment = "deployment"
ResourceKindPod = "pod"
ResourceKindEvent = "event"
ResourceKindReplicationController = "replicationcontroller"
ResourceKindDaemonSet = "daemonset"
ResourceKindJob = "job"
ResourceKindPetSet = "petset"
ResourceKindNamespace = "namespace"
ResourceKindNode = "node"
ResourceKindSecret = "secret"
ResourceKindConfigMap = "configmap"
ResourceKindPersistentVolume = "persistentvolume"
ResourceKindPersistentVolumeClaim = "persistentvolumeclaim"
)
// ClientType represents type of client that is used to perform generic operations on resources.
......
......@@ -49,6 +49,7 @@ $foreground-1: rgba(0, 0, 0, .87);
$foreground-2: rgba(0, 0, 0, .54);
$foreground-3: rgba(0, 0, 0, .26);
$foreground-4: rgba(0, 0, 0, .12);
$hue-2: rgba(255, 255, 255, .54);
$background-1: rgba(158, 158, 158, .2);
......@@ -61,6 +62,7 @@ $layout-breakpoint-sm: 960px;
$layout-breakpoint-xs: 600px;
$whiteframe-shadow-1dp: 0 1px 3px 0 rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 2px 1px -1px rgba(0, 0, 0, .12);
$baseline-grid: 8px;
$nav-width: 30 * $baseline-grid;
$logo-width: 8 * $baseline-grid;
$logo-height: 8 * $baseline-grid;
$table-cell-height: 6 * $baseline-grid;
......
......@@ -16,16 +16,16 @@ limitations under the License.
<md-toolbar class="kd-toolbar">
<div class="md-toolbar-tools kd-toolbar-tools">
<kd-nav-hamburger></kd-nav-hamburger>
<h2>
<kd-nav-hamburger flex="none"></kd-nav-hamburger>
<h2 class="kd-logo-menu" flex="none">
<span>kubernetes</span>
</h2>
<kd-breadcrumbs class="kd-actionbar-breadcrumbs" limit="2" flex="auto" layout="row"></kd-breadcrumbs>
<div flex="auto" ui-view="toolbar"></div>
<div ui-view="actionbar"></div>
</div>
</md-toolbar>
<kd-actionbar flex="none"></kd-actionbar>
<div layout="row">
<kd-nav></kd-nav>
<div layout="column" flex="shrink" class="kd-chrome-content-container">
......
......@@ -36,16 +36,10 @@ body,
a {
color: $primary;
text-decoration: inherit;
&:visited {
color: $primary;
}
}
.md-toolbar-tools {
a {
color: $primary;
}
.kd-logo-menu {
width: $nav-width - 5.5 * $baseline-grid;
}
.kd-success {
......
......@@ -21,12 +21,12 @@
overflow: hidden;
overflow-y: auto;
white-space: nowrap;
width: 30 * $baseline-grid;
width: $nav-width;
&.md-closed {
&.md-locked-open-add-active {
min-width: 30 * $baseline-grid;
width: 30 * $baseline-grid;
min-width: $nav-width;
width: $nav-width;
}
}
......
......@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import {breadcrumbsConfig} from 'common/components/breadcrumbs/breadcrumbs_service';
/**
* @final
*/
......@@ -38,7 +40,20 @@ export class NavItemController {
* @return {boolean}
* @export
*/
isActive() { return this.state_.current.name === this.state; }
isActive() {
let state = this.state_.current;
while (state) {
if (state.name === this.state) {
return true;
}
if (state && state.data && state.data[breadcrumbsConfig]) {
state = this.state_.get(state.data[breadcrumbsConfig]['parent']);
} else {
state = null;
}
}
return false;
}
}
/**
......
......@@ -16,11 +16,11 @@ limitations under the License.
<div ng-switch="$last" ng-repeat="breadcrumb in ctrl.breadcrumbs" class="md-title kd-breadcrumbs-ellipsised"
ng-class="{'kd-inline-breadcrumb': !$last}" flex="shrink">
<a ng-switch-when="false" href="{{::breadcrumb.stateLink}}">
<a ng-switch-when="false" href="{{::breadcrumb.stateLink}}" class="kd-faded-breadcrumb">
{{::breadcrumb.label}}
</a>
<div ng-switch-when="true" class="kd-breadcrumbs-ellipsised">
<kd-middle-ellipsis display-string="{{::breadcrumb.label}}"></kd-middle-ellipsis>
</div>
<span ng-switch-when="false">></span>
<span ng-switch-when="false" class="kd-faded-breadcrumb">></span>
</div>
......@@ -19,6 +19,10 @@
float: left;
font-weight: $regular-font-weight;
max-width: 100%;
>.kd-faded-breadcrumb {
color: $hue-2;
}
}
.kd-inline-breadcrumb {
......
......@@ -31,7 +31,7 @@ limitations under the License.
<md-icon class="kd-endpoint-icon">open_in_new</md-icon>
</a>
</div>
<div>
<div ng-if="::!port.port">
<a href="http://{{::endpoint.host}}:{{::port.nodePort}}" target="_blank"
layout layout-align="start center">
<kd-middle-ellipsis display-string="{{::endpoint.host}}:{{::port.nodePort}}">
......
......@@ -31,5 +31,6 @@
}
.kd-zerostate-text {
color: $delicate;
word-break: break-all;
}
......@@ -14,36 +14,26 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_OVERVIEW_LABEL}}">
<kd-daemon-set-info daemon-set="::ctrl.daemonSetDetail"></kd-daemon-set-info>
<kd-content-card ng-if="::ctrl.daemonSetDetail.serviceList.services.length">
<kd-title>{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_SERVICES_TITLE}}</kd-title>
<kd-content>
<kd-service-card-list service-list="::ctrl.daemonSetDetail.serviceList"
service-list-resource="::ctrl.daemonSetServicesResource">
</kd-service-card-list>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list pod-list="::ctrl.daemonSetDetail.podList"
pod-list-resource="::ctrl.daemonSetPodsResource"
with-statuses="true" ng-show="::ctrl.daemonSetDetail.podList.pods.length">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.daemonSetDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list event-list="::ctrl.daemonSetDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-daemon-set-info daemon-set="::ctrl.daemonSetDetail"></kd-daemon-set-info>
<kd-content-card ng-if="::ctrl.daemonSetDetail.serviceList.services.length">
<kd-title>{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_SERVICES_TITLE}}</kd-title>
<kd-content>
<kd-service-card-list service-list="::ctrl.daemonSetDetail.serviceList"
service-list-resource="::ctrl.daemonSetServicesResource">
</kd-service-card-list>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list pod-list="::ctrl.daemonSetDetail.podList"
pod-list-resource="::ctrl.daemonSetPodsResource"
with-statuses="true" ng-show="::ctrl.daemonSetDetail.podList.pods.length">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.daemonSetDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-event-card-list event-list="::ctrl.daemonSetDetail.eventList"></kd-event-card-list>
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OVERVIEW_LABEL}}">
<kd-deployment-info deployment="::ctrl.deploymentDetail"></kd-deployment-info>
<kd-deployment-info deployment="::ctrl.deploymentDetail"></kd-deployment-info>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_NEW_REPLICAS_TITLE}}</kd-title>
<kd-content>
<kd-replica-set-card-list ng-show="::ctrl.deploymentDetail.newReplicaSet.objectMeta.name"
replica-set-list="::ctrl.newReplicaSetList">
</kd-replica-set-card-list>
<div class="kd-zerostate-message" layout-padding
ng-hide="::ctrl.deploymentDetail.newReplicaSet.objectMeta.name">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_NEW_REPLICAS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_NEW_REPLICAS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_NEW_REPLICAS_TITLE}}</kd-title>
<kd-content>
<kd-replica-set-card-list ng-show="::ctrl.deploymentDetail.newReplicaSet.objectMeta.name"
replica-set-list="::ctrl.newReplicaSetList">
</kd-replica-set-card-list>
<div class="kd-zerostate-message" layout-padding
ng-hide="::ctrl.deploymentDetail.newReplicaSet.objectMeta.name">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_NEW_REPLICAS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_NEW_REPLICAS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OLD_REPLICAS_TITLE}}</kd-title>
<kd-content>
<kd-replica-set-card-list
ng-show="::ctrl.deploymentDetail.oldReplicaSetList.replicaSets.length"
replica-set-list="::ctrl.deploymentDetail.oldReplicaSetList">
</kd-replica-set-card-list>
<div class="kd-zerostate-message" layout-padding
ng-hide="::ctrl.deploymentDetail.oldReplicaSetList.replicaSets.length">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OLD_REPLICAS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OLD_REPLICAS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list event-list="::ctrl.deploymentDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OLD_REPLICAS_TITLE}}</kd-title>
<kd-content>
<kd-replica-set-card-list
ng-show="::ctrl.deploymentDetail.oldReplicaSetList.replicaSets.length"
replica-set-list="::ctrl.deploymentDetail.oldReplicaSetList">
</kd-replica-set-card-list>
<div class="kd-zerostate-message" layout-padding
ng-hide="::ctrl.deploymentDetail.oldReplicaSetList.replicaSets.length">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OLD_REPLICAS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_DEPLOYMENT_DETAIL_OLD_REPLICAS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-event-card-list event-list="::ctrl.deploymentDetail.eventList"></kd-event-card-list>
......@@ -15,8 +15,9 @@ limitations under the License.
-->
<kd-content-card>
<kd-title>{{::$ctrl.i18n.MSG_EVENTS_CARD}}</kd-title>
<kd-content>
<div class="kd-replicationcontrollerevents-options" layout="row">
<div class="kd-replicationcontrollerevents-options" layout="row" ng-if="::$ctrl.hasEvents()">
<md-input-container>
<label>{{::$ctrl.i18n.MSG_EVENTS_TYPE_LABEL}}</label>
<md-select aria-label="Event Type" ng-model="$ctrl.eventType"
......@@ -87,16 +88,9 @@ limitations under the License.
</kd-resource-card-list-footer>
</kd-resource-card-list>
<div class="kd-replicationcontrollerevents-no-events" ng-if="!$ctrl.hasEvents()">
<md-icon class="material-icons kd-replicationcontrollerevents-no-events-icon">
info_outline
</md-icon>
<div class="kd-replicationcontrollerevents-no-events-text">
{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_TITLE}}
</div>
<div class="kd-replicationcontrollerevents-no-events-info">
{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_USER_HELP}}
</div>
<div class="kd-zerostate-message" layout-padding ng-hide="$ctrl.hasEvents()">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_USER_HELP}}</div>
</div>
</kd-content>
</kd-content-card>
......@@ -31,16 +31,6 @@ md-icon {
}
}
.kd-replicationcontrollerevents-no-events-text {
color: $muted;
font-size: $headline-font-size-base;
}
.kd-replicationcontrollerevents-no-events-info {
color: $delicate;
font-size: $subhead-font-size-base;
}
.kd-replicationcontrollerevents-warning-icon {
color: $warning;
}
......
......@@ -62,7 +62,7 @@ export class EventCardListController {
* @export
*/
hasEvents() {
return this.filteredEventList !== undefined && this.filteredEventList.listMeta.totalItems > 0;
return this.filteredEventList !== undefined && this.filteredEventList.events.length > 0;
}
/**
......@@ -105,6 +105,8 @@ export const eventCardListComponent = {
};
const i18n = {
/** @export {string} @desc Label for the events card. */
MSG_EVENTS_CARD: goog.getMsg('Events'),
/** @export {string} @desc Label 'Type' for the event type selection box on the events list page. */
MSG_EVENTS_TYPE_LABEL: goog.getMsg('Type'),
/** @export {string} @desc Label 'Message' for the event message column of the events table (events list page). */
......@@ -119,13 +121,10 @@ const i18n = {
MSG_EVENTS_FIRST_SEEN_LABEL: goog.getMsg('First seen'),
/** @export {string} @desc Label 'Last seen' for the respective column of the events table (events list page). */
MSG_EVENTS_LAST_SEEN_LABEL: goog.getMsg('Last seen'),
/** @export {string} @desc Title 'No events were found', which appears in the center of the events page when
there are no events to display */
MSG_EVENTS_NO_EVENTS_TITLE: goog.getMsg('No events were found'),
/** @export {string} @desc Title of section when there are no events. */
MSG_EVENTS_NO_EVENTS_TITLE: goog.getMsg('There is nothing to display here'),
/** @export {string} @desc User help on the events page when no events are to be displayed. */
MSG_EVENTS_NO_EVENTS_USER_HELP: goog.getMsg(
`There are no events to display. ` +
`It's possible that all of them have expired.`),
MSG_EVENTS_NO_EVENTS_USER_HELP: goog.getMsg(`It is possible that all events have expired.`),
/** @export {string} @desc Label 'All' for the event selection drop-down. */
MSG_EVENTS_ALL_LABEL: goog.getMsg('All'),
/** @export {string} @desc Label 'Warning' for the event selection drop-down. */
......
......@@ -14,24 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="Overview">
<kd-job-info job="::ctrl.jobDetail"></kd-job-info>
<kd-job-info job="::ctrl.jobDetail"></kd-job-info>
<kd-content-card>
<kd-title>Pods</kd-title>
<kd-content>
<kd-pod-card-list pod-list="::ctrl.jobDetail.podList" with-statuses="true"
pod-list-resource="::ctrl.jobPodsResource">
</kd-pod-card-list>
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="Events">
<kd-event-card-list event-list="::ctrl.jobDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-content-card>
<kd-title>{{::$ctrl.i18n.MSG_JOB_DETAIL_PODS}}</kd-title>
<kd-content>
<kd-pod-card-list pod-list="::ctrl.jobDetail.podList" with-statuses="true"
pod-list-resource="::ctrl.jobPodsResource">
</kd-pod-card-list>
</kd-content>
</kd-content-card>
<kd-event-card-list event-list="::ctrl.jobDetail.eventList"></kd-event-card-list>
......@@ -27,5 +27,13 @@ export class JobDetailController {
/** @export {!angular.Resource} */
this.jobPodsResource = kdJobPodsResource;
/** @export */
this.i18n = i18n;
}
}
const i18n = {
/** @export {string} @desc Title for a pods section. */
MSG_JOB_DETAIL_PODS: goog.getMsg('Pods'),
};
......@@ -26,9 +26,7 @@ export default class JobInfoController {
*/
this.job;
/**
* @export
*/
/** @export */
this.i18n = i18n;
}
}
......
......@@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="row" flex="auto" layout-fill>
<md-content layout-padding flex="auto" layout-fill ng-class=ctrl.getStyleClass()>
<kd-content-card>
<kd-content>
<md-content layout-padding flex="auto" layout-fill ng-class=ctrl.getStyleClass()>
<div ng-repeat="n in ctrl.logsSet track by $index" ng-class=ctrl.getLogsClass()>
<pre ng-bind-html="n"></pre>
</div>
</md-content>
</div>
</kd-content>
</kd-content-card>
......@@ -14,16 +14,5 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_NAMESPACE_DETAIL_OVERVIEW_LABEL}}">
<kd-namespace-info namespace="::ctrl.namespaceDetail"></kd-namespace-info>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_NAMESPACE_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list
event-list="::ctrl.namespaceDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-namespace-info namespace="::ctrl.namespaceDetail"></kd-namespace-info>
<kd-event-card-list event-list="::ctrl.namespaceDetail.eventList"></kd-event-card-list>
......@@ -23,17 +23,5 @@ export class NamespaceDetailController {
constructor(namespaceDetail) {
/** @export {!backendApi.NamespaceDetail} */
this.namespaceDetail = namespaceDetail;
/** @export */
this.i18n = i18n;
}
}
const i18n = {
/** @export {string} @desc Label 'Overview' for the left navigation tab on the namespace details
page. */
MSG_NAMESPACE_DETAIL_OVERVIEW_LABEL: goog.getMsg('Overview'),
/** @export {string} @desc Label 'Events' for the left navigation tab on the namespace details
page. */
MSG_NAMESPACE_DETAIL_EVENTS_LABEL: goog.getMsg('Events'),
};
......@@ -14,15 +14,5 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_NODE_DETAIL_OVERVIEW_LABEL}}">
<kd-node-info node="::ctrl.nodeDetail"></kd-node-info>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_NODE_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list event-list="::ctrl.nodeDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-node-info node="::ctrl.nodeDetail"></kd-node-info>
<kd-event-card-list event-list="::ctrl.nodeDetail.eventList"></kd-event-card-list>
......@@ -23,16 +23,5 @@ export class NodeDetailController {
constructor(nodeDetail) {
/** @export {!backendApi.NodeDetail} */
this.nodeDetail = nodeDetail;
/** @export */
this.i18n = i18n;
}
}
const i18n = {
/** @export {string} @desc Label 'Overview' for the left navigation tab on the node details
page. */
MSG_NODE_DETAIL_OVERVIEW_LABEL: goog.getMsg('Overview'),
/** @export {string} @desc Label 'Events' for the pods tab on the node details page. */
MSG_NODE_DETAIL_EVENTS_LABEL: goog.getMsg('Events'),
};
......@@ -14,30 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_PET_SET_DETAIL_OVERVIEW_TAB}}">
<kd-pet-set-info pet-set="::ctrl.petSetDetail"></kd-pet-set-info>
<kd-pet-set-info pet-set="::ctrl.petSetDetail"></kd-pet-set-info>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_PET_SET_DETAIL_PODS_CARD_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list ng-show="::ctrl.petSetDetail.podList.pods.length"
pod-list="::ctrl.petSetDetail.podList"
pod-list-resource="::ctrl.petSetPodsResource"
with-statuses="true">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.petSetDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_PET_SET_DETAIL_EVENTS_TAB}}">
<kd-event-card-list event-list="::ctrl.petSetDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_PET_SET_DETAIL_PODS_CARD_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list ng-show="::ctrl.petSetDetail.podList.pods.length"
pod-list="::ctrl.petSetDetail.podList"
pod-list-resource="::ctrl.petSetPodsResource"
with-statuses="true">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.petSetDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::ctrl.i18n.MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::ctrl.i18n.MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-event-card-list event-list="::ctrl.petSetDetail.eventList"></kd-event-card-list>
......@@ -34,15 +34,11 @@ export class PetSetDetailController {
}
const i18n = {
/** @export {string} @desc Overview tab label on the pet set detail page. */
MSG_PET_SET_DETAIL_OVERVIEW_TAB: goog.getMsg('Overview'),
/** @export {string} @desc Related pods card title on the pet set detail page. */
MSG_PET_SET_DETAIL_PODS_CARD_TITLE: goog.getMsg('Pods'),
/** @export {string} @desc Events tab label on the pet set detail page. */
MSG_PET_SET_DETAIL_EVENTS_TAB: goog.getMsg('Events'),
/** @export {string} @desc Title for pods card zerostate in pet set details page. */
MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TITLE: goog.getMsg('There is nothing to display here'),
/** @export {string} @desc Text for pods card zerostate in pet set details page. */
MSG_PET_SET_DETAIL_PODS_ZEROSTATE_TEXT:
goog.getMsg('There are currently no Pods scheduled on this Pet Set'),
goog.getMsg('There are currently no Pods selected by this Pet Set'),
};
......@@ -14,15 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_POD_DETAIL_OVERVIEW_LABEL}}">
<kd-pod-info pod="::ctrl.podDetail"></kd-pod-info>
<kd-container-info containers="::ctrl.podDetail.containers"
namespace="::ctrl.podDetail.objectMeta.namespace">
</kd-container-info>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-pod-info pod="::ctrl.podDetail"></kd-pod-info>
<kd-container-info containers="::ctrl.podDetail.containers"
namespace="::ctrl.podDetail.objectMeta.namespace">
</kd-container-info>
......@@ -14,37 +14,28 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_OVERVIEW_LABEL}}">
<kd-replica-set-info replica-set="::ctrl.replicaSetDetail"></kd-replica-set-info>
<kd-replica-set-info replica-set="::ctrl.replicaSetDetail"></kd-replica-set-info>
<kd-content-card ng-if="::ctrl.replicaSetDetail.serviceList.services.length">
<kd-title>{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_SERVICES_TITLE}}</kd-title>
<kd-content>
<kd-service-card-list service-list="::ctrl.replicaSetDetail.serviceList"
service-list-resource="::ctrl.replicaSetServicesResource">
</kd-service-card-list>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list ng-show="::ctrl.replicaSetDetail.podList.pods.length"
pod-list="::ctrl.replicaSetDetail.podList" with-statuses="true"
pod-list-resource="::ctrl.replicaSetPodsResource">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.replicaSetDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list event-list="::ctrl.replicaSetDetail.eventList"></kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-content-card ng-if="::ctrl.replicaSetDetail.serviceList.services.length">
<kd-title>{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_SERVICES_TITLE}}</kd-title>
<kd-content>
<kd-service-card-list service-list="::ctrl.replicaSetDetail.serviceList"
service-list-resource="::ctrl.replicaSetServicesResource">
</kd-service-card-list>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list ng-show="::ctrl.replicaSetDetail.podList.pods.length"
pod-list="::ctrl.replicaSetDetail.podList" with-statuses="true"
pod-list-resource="::ctrl.replicaSetPodsResource">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.replicaSetDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-event-card-list event-list="::ctrl.replicaSetDetail.eventList"></kd-event-card-list>
......@@ -14,46 +14,37 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="{{::ctrl.i18n.MSG_RC_DETAIL_OVERVIEW_LABEL}}">
<kd-replication-controller-info replication-controller="::ctrl.replicationControllerDetail">
</kd-replication-controller-info>
<kd-replication-controller-info replication-controller="::$ctrl.replicationControllerDetail">
</kd-replication-controller-info>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_RC_DETAIL_SERVICES_TITLE}}</kd-title>
<kd-content>
<kd-service-card-list ng-show="::ctrl.replicationControllerDetail.serviceList.services.length"
service-list="::ctrl.replicationControllerDetail.serviceList"
service-list-resource="::ctrl.serviceListResource">
</kd-service-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.replicationControllerDetail.serviceList.services.length">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_RC_DETAIL_SERVICES_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_RC_DETAIL_SERVICES_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::$ctrl.i18n.MSG_RC_DETAIL_SERVICES_TITLE}}</kd-title>
<kd-content>
<kd-service-card-list ng-show="::$ctrl.replicationControllerDetail.serviceList.services.length"
service-list="::$ctrl.replicationControllerDetail.serviceList"
service-list-resource="::$ctrl.serviceListResource">
</kd-service-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::$ctrl.replicationControllerDetail.serviceList.services.length">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_RC_DETAIL_SERVICES_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_RC_DETAIL_SERVICES_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-content-card>
<kd-title>{{::ctrl.i18n.MSG_RC_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list ng-show="::ctrl.replicationControllerDetail.podList.pods.length"
pod-list="::ctrl.replicationControllerDetail.podList"
pod-list-resource="::ctrl.podListResource"
with-statuses="true">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::ctrl.replicationControllerDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_RC_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_RC_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="{{::ctrl.i18n.MSG_RC_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list event-list="::ctrl.replicationControllerDetail.eventList">
</kd-event-card-list>
</md-tab>
</md-tabs>
</md-content>
</div>
<kd-content-card>
<kd-title>{{::$ctrl.i18n.MSG_RC_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list ng-show="::$ctrl.replicationControllerDetail.podList.pods.length"
pod-list="::$ctrl.replicationControllerDetail.podList"
pod-list-resource="::$ctrl.podListResource"
with-statuses="true">
</kd-pod-card-list>
<div class="kd-zerostate-message" layout-padding ng-hide="::$ctrl.replicationControllerDetail.podList.pods.length">
<div class="kd-zerostate-title">{{::$ctrl.i18n.MSG_RC_DETAIL_PODS_ZEROSTATE_TITLE}}</div>
<div class="kd-zerostate-text">{{::$ctrl.i18n.MSG_RC_DETAIL_PODS_ZEROSTATE_TEXT}}</div>
</div>
</kd-content>
</kd-content-card>
<kd-event-card-list event-list="::$ctrl.replicationControllerDetail.eventList">
</kd-event-card-list>
// 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 '../variables';
md-tabs {
background: $body;
md-tabs-canvas {
background: $content-background;
}
}
......@@ -74,21 +74,16 @@ const i18n = {
/** @export {string} @desc Title 'Service', which appears at the top of the services list on the
replication controller detail view. */
MSG_RC_DETAIL_SERVICES_TITLE: goog.getMsg('Services'),
/** @export {string} @desc Label 'Overview' for the left navigation tab on the replication
controller details page. */
MSG_RC_DETAIL_OVERVIEW_LABEL: goog.getMsg('Overview'),
/** @export {string} @desc Label 'Events' for the right navigation tab on the replication
controller details page. */
MSG_RC_DETAIL_EVENTS_LABEL: goog.getMsg('Events'),
/** @export {string} @desc Title for services card zerostate in replication controller details page. */
MSG_RC_DETAIL_SERVICES_ZEROSTATE_TITLE: goog.getMsg('There is nothing to display here'),
/** @export {string} @desc Text for services card zerostate in replication controller details page. */
MSG_RC_DETAIL_SERVICES_ZEROSTATE_TEXT:
goog.getMsg('There are currently no Services scheduled on this Replication Controller'),
MSG_RC_DETAIL_SERVICES_ZEROSTATE_TEXT: goog.getMsg(
'There are currently no Services with the same label selector ' +
'as this Replication Controller'),
/** @export {string} @desc Title for pods card zerostate in replication controller details page. */
MSG_RC_DETAIL_PODS_ZEROSTATE_TITLE: goog.getMsg('There is nothing to display here'),
/** @export {string} @desc Text for pods card zerostate in replication controller details page. */
MSG_RC_DETAIL_PODS_ZEROSTATE_TEXT:
goog.getMsg('There are currently no Pods scheduled on this Replication Controller'),
goog.getMsg('There are currently no Pods selected by this Replication Controller'),
};
......@@ -45,7 +45,7 @@ export default function stateConfig($stateProvider) {
views: {
'': {
controller: ReplicationControllerDetailController,
controllerAs: 'ctrl',
controllerAs: '$ctrl',
templateUrl: 'replicationcontrollerdetail/replicationcontrollerdetail.html',
},
[actionbarViewName]: {
......
......@@ -51,9 +51,8 @@ limitations under the License.
<div ng-hide="::$ctrl.service.internalEndpoint">-</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div ng-if="::$ctrl.service.externalEndpoints"
ng-repeat="endpoint in ::$ctrl.service.externalEndpoints">
<kd-external-endpoint endpoint="endpoint"></kd-external-endpoint>
<div ng-if="::$ctrl.service.externalEndpoints">
<kd-external-endpoint endpoints="::$ctrl.service.externalEndpoints"></kd-external-endpoint>
</div>
<div ng-hide="::$ctrl.service.externalEndpoints">-</div>
</kd-resource-card-column>
......@@ -66,4 +65,4 @@ limitations under the License.
</kd-resource-card-menu>
</kd-resource-card-column>
</kd-resource-card-columns>
</kd-resource-card>
\ No newline at end of file
</kd-resource-card>
......@@ -39,21 +39,28 @@ func TestFilterNamespacedServicesBySelector(t *testing.T) {
{
ObjectMeta: api.ObjectMeta{
Name: "first-service-ok",
Labels: firstLabelSelectorMap,
Namespace: "test-ns-1",
},
Spec: api.ServiceSpec{
Selector: firstLabelSelectorMap,
},
},
{
ObjectMeta: api.ObjectMeta{
Name: "second-service-ok",
Labels: firstLabelSelectorMap,
Name: "second-service-wrong",
Namespace: "test-ns-2",
},
Spec: api.ServiceSpec{
Selector: firstLabelSelectorMap,
},
},
{
ObjectMeta: api.ObjectMeta{
Name: "third-service-wrong",
Labels: secondLabelSelectorMap,
Name: "third-service-wrong",
Namespace: "test-ns-1",
},
Spec: api.ServiceSpec{
Selector: secondLabelSelectorMap,
},
},
},
......@@ -61,9 +68,11 @@ func TestFilterNamespacedServicesBySelector(t *testing.T) {
{
ObjectMeta: api.ObjectMeta{
Name: "first-service-ok",
Labels: firstLabelSelectorMap,
Namespace: "test-ns-1",
},
Spec: api.ServiceSpec{
Selector: firstLabelSelectorMap,
},
},
},
},
......@@ -72,7 +81,7 @@ func TestFilterNamespacedServicesBySelector(t *testing.T) {
for _, c := range cases {
actual := FilterNamespacedServicesBySelector(c.services, c.namespace, c.selector)
if !reflect.DeepEqual(actual, c.expected) {
t.Errorf("FilterNamespacedServicesBySelector(%+v, %+v) == %+v, expected %+v",
t.Errorf("FilterNamespacedServicesBySelector(%+v, %+v) == \n%+v, expected \n%+v",
c.services, c.selector, actual, c.expected)
}
}
......
......@@ -13,6 +13,7 @@
// limitations under the License.
import module from 'chrome/nav/module';
import {breadcrumbsConfig} from 'common/components/breadcrumbs/breadcrumbs_service';
describe('Nav item component', () => {
/** @type {!chrome/nav/navitem_component.NavItemController} */
......@@ -25,6 +26,19 @@ describe('Nav item component', () => {
url: 'fakeStateUrl',
template: '<ui-view>Foo</ui-view>',
});
$stateProvider.state('fakeNonActive', {
url: 'fakeStateUrl',
template: '<ui-view>Foo</ui-view>',
});
$stateProvider.state('fakeStateWithParent', {
url: 'fakeStateUrl',
template: '<ui-view>Foo</ui-view>',
data: {
[breadcrumbsConfig]: {
parent: 'fakeState',
},
},
});
});
angular.mock.module(module.name);
angular.mock.module(fakeModule.name);
......@@ -40,11 +54,18 @@ describe('Nav item component', () => {
expect(ctrl.getHref()).toBe('#fakeStateUrl');
});
it('should detect activity', angular.mock.inject(($state) => {
it('should detect activity', angular.mock.inject(($state, $rootScope) => {
expect(ctrl.isActive()).toBe(false);
$state.current.name = 'fakeState';
expect(ctrl.isActive()).toBe(true);
$state.current.name = 'fakeNonActive';
expect(ctrl.isActive()).toBe(false);
$state.go('fakeStateWithParent');
$rootScope.$digest();
expect(ctrl.isActive()).toBe(true);
}));
});
......@@ -14,14 +14,6 @@
export default class ReplicationControllerDetailPageObject {
constructor() {
this.mdTabItemsQuery = by.tagName('md-tab-item');
this.eventsTab = element.all(this.mdTabItemsQuery).get(1);
this.podsTab = element.all(this.mdTabItemsQuery).get(0);
this.mdTabsItemQuery = by.css('md-tabs');
this.mdTabsItem = element(this.mdTabsItemQuery);
this.eventsTypeFilterQuery = by.model('$ctrl.eventType');
this.eventsTypeFilter = element(this.eventsTypeFilterQuery);
......
......@@ -23,9 +23,9 @@ import ReplicationControllerDetailPageObject from '../replicationcontrollerdetai
* - [Deploy Page] - provide data for not existing image and click deploy
* - [Replication Controller List Page] - wait for card status error to appear and go to
* details page
* - [Replication Controller Details Page] - Go to events tab, filter by warnings and check
* - [Replication Controller Details Page] - See events table, filter by warnings and check
* results
* - [Replication Controller Details Page] - Go to Pods tab and click on Logs link near the
* - [Replication Controller Details Page] - See pods table and click on Logs link near the
* existing pod
* - [Logs Page] - Check if pod logs show that pod is in pending state.
* - Clean up and delete created resources
......@@ -104,12 +104,6 @@ describe('Deploy not existing image story', () => {
// then
expect(browser.getCurrentUrl()).toContain(`replicationcontroller/default/${appName}`);
// it should switch to events tab and check for errors
// when
// Switch to events tab
replicationControllerDetailPage.eventsTab.click();
// Filter events by warnings
replicationControllerDetailPage.eventsTypeFilter.click().then(
() => { replicationControllerDetailPage.eventsTypeWarning.click(); });
......@@ -117,12 +111,6 @@ describe('Deploy not existing image story', () => {
// then
expect(replicationControllerDetailPage.eventsTable.isDisplayed()).toBeTruthy();
// it should switch to pods tab and go to pod logs page
// when
// Switch to pods tab
replicationControllerDetailPage.podsTab.click();
// Click pod log link
replicationControllerDetailPage.podLogsLink.click().then(() => {
// then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册