Skip to content

Commit

Permalink
Make card titles consistent across the UI (#1458)
Browse files Browse the repository at this point in the history
* Make card titles consistent across the UI

Fixes #1451

* Fix config maps and secret headers

* Fix header for config map details
  • Loading branch information
bryk authored and maciaszczykm committed Nov 23, 2016
1 parent 4932fa7 commit fa896fb
Show file tree
Hide file tree
Showing 23 changed files with 414 additions and 819 deletions.
931 changes: 174 additions & 757 deletions i18n/messages-en.xtb

Large diffs are not rendered by default.

151 changes: 150 additions & 1 deletion i18n/messages-ja.xtb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<div class="kd-resource-card-list-wrapper">
<div class="kd-resource-card-list-header-wrapper">
<div ng-transclude="header" class="kd-resource-card-list-header md-title"></div>
<div ng-transclude="header" class="kd-resource-card-list-header md-title" ng-if="::$ctrl.hasHeader()"></div>
<div ng-transclude="pagination" class="kd-resource-card-list-pagination"></div>
</div>
<div class="kd-resource-card-list"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const HEADER_SLOT = 'header';

/**
* @final
*/
export class ResourceCardListController {
/**
* @param {!angular.$transclude} $transclude
* @ngInject
*/
constructor() {
constructor($transclude) {
/**
* Whether this list is in a pending async state (e.g., loading new page);
* @export {boolean}
Expand All @@ -44,6 +47,9 @@ export class ResourceCardListController {
* @private {!./resourcecardheadercolumns_component.ResourceCardHeaderColumnsController}
*/
this.headerColumns_;

/** @private {!angular.$transclude} */
this.transclude_ = $transclude;
}

/**
Expand Down Expand Up @@ -71,6 +77,14 @@ export class ResourceCardListController {
setPending(pending) {
this.pending = pending;
}

/**
* @return {boolean}
* @export
*/
hasHeader() {
return this.transclude_.isSlotFilled(HEADER_SLOT);
}
}

/**
Expand Down Expand Up @@ -118,7 +132,7 @@ export const resourceCardListComponent = {
templateUrl: 'common/components/resourcecard/resourcecardlist.html',
transclude: {
'pagination': '?kdResourceCardListPagination',
'header': '?kdResourceCardListHeader',
[HEADER_SLOT]: '?kdResourceCardListHeader',
},
controller: ResourceCardListController,
bindings: {
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/configmapdetail/configmapdetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<div layout="column">
<kd-config-map-info config-map="::$ctrl.configMapDetail"></kd-config-map-info>
<kd-info-card>
<kd-info-card-section name="[[Data|Config map info details section name.]]">
<kd-info-card-header>[[Data|Header in a detail view of config map deta]]</kd-info-card-header>
<kd-info-card-section>
<kd-info-card-entry ng-repeat="(key, value) in ::$ctrl.configMapDetail.data"
title="{{::key}}">
<pre class="kd-pre-block">{{::value}}</pre>
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/configmapdetail/configmapinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Config map info details section name.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-info-card-entry title="[[Name|Config map info details section name entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.configMap.objectMeta.name}}">
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/daemonsetdetail/daemonsetinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Subtitle 'Details' for the left section with general information about a daemon set on the daemonset details page.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-info-card-entry title="[[Name|Label 'Name' for the daemon set name on the details page.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.daemonSet.objectMeta.name}}">
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/deploymentdetail/deploymentinfo.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<kd-info-card>
<kd-info-card-section name="[[Details|Subtitle 'Details' for the left section with general information about a deployment on the deployment details page.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-info-card-entry title="[[Name|Label 'Name' for the deployment name on the deployment details page.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.deployment.objectMeta.name}}">
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/ingressdetail/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Resource info details section name.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-info-card-entry title="[[Name|Resource info details section name entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.ingress.objectMeta.name}}">
Expand Down
2 changes: 1 addition & 1 deletion src/app/frontend/jobdetail/jobinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->

<kd-info-card>
<kd-info-card-header>[[Resource details|Resource details header. Appears on top of the page.]]</kd-info-card-header>
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section name="[[Details|Details section header. Appears below main header.]]">
<kd-info-card-entry title="[[Name|Job name. Appears in details section.]]">
<kd-middle-ellipsis
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/namespacedetail/namespaceinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Subtitle 'Details' for the left section with general information about a namespace on the namespace details page.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.namespace.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Status|Label 'Status' for the namespace namespace on the namespace details page.]]"
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/nodedetail/nodeinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Subtitle 'Details' for the left section with general information about a node on the node details page.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.node.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Phase|Label 'Phase' for the node namespace on the node details page.]]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Persistent volume claim info details section name.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.persistentVolumeClaim.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Status|Persistent volume claim info details section status entry.]]">
Expand Down
81 changes: 41 additions & 40 deletions src/app/frontend/persistentvolumedetail/persistentvolumeinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,45 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Persistent volume info details section name.]]">
<kd-object-meta-info-card object-meta="::$ctrl.statefulSet.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Status|Persistent volume info details section status entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.status}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.status">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Claim|Persistent volume info details section claim entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.claim}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.claim">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Reclaim policy|Persistent volume info details section reclaim policy entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.reclaimPolicy}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.reclaimPolicy">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Access modes|Persistent volume info details section access modes entry.]]">
<kd-middle-ellipsis ng-repeat="(key, value) in ::$ctrl.persistentVolume.accessModes"
display-string="{{::value}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.accessModes">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Capacity|Persistent volume info details section capacity entry.]]">
<kd-middle-ellipsis ng-repeat="(key, value) in ::$ctrl.persistentVolume.capacity"
display-string="{{::value}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.capacity">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Message|Persistent volume info details section message entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.message}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.message">-</div>
</kd-info-card-entry>
</kd-info-card-section>
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.statefulSet.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Status|Persistent volume info details section status entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.status}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.status">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Claim|Persistent volume info details section claim entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.claim}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.claim">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Reclaim policy|Persistent volume info details section reclaim policy entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.reclaimPolicy}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.reclaimPolicy">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Access modes|Persistent volume info details section access modes entry.]]">
<kd-middle-ellipsis ng-repeat="(key, value) in ::$ctrl.persistentVolume.accessModes"
display-string="{{::value}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.accessModes">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Capacity|Persistent volume info details section capacity entry.]]">
<kd-middle-ellipsis ng-repeat="(key, value) in ::$ctrl.persistentVolume.capacity"
display-string="{{::value}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.capacity">-</div>
</kd-info-card-entry>
<kd-info-card-entry title="[[Message|Persistent volume info details section message entry.]]">
<kd-middle-ellipsis
display-string="{{::$ctrl.persistentVolume.message}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.persistentVolume.message">-</div>
</kd-info-card-entry>
</kd-info-card-section>
</kd-info-card>
3 changes: 2 additions & 1 deletion src/app/frontend/poddetail/podinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Pod|Subtitle 'Details' at the top of the resource details column at the pod detail view.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.pod.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Status|Label 'Status' for the pod status in details part (left) of the pod details view.]]">
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/replicasetdetail/replicasetinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Subtitle 'Details' for the left section with general information about a replica set on the replica set details page.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.replicaSet.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Selector|Label 'selector' for replica sets.]]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Subtitle 'Details' for the left section with general information about a replication controller on the replication controller details page.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.replicationController.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Label selector|Label 'Label selector' for the replication controller's selector on the replication controller details page.]]">
Expand Down
2 changes: 1 addition & 1 deletion src/app/frontend/secretdetail/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div layout="column">
<kd-secret-info secret="::$ctrl.secretDetail"></kd-secret-info>
<kd-info-card>
<kd-info-card-header>[[Data | Secrets info details section data.]]</kd-info-card-header>
<kd-info-card-header>[[Data|Secrets info details section data.]]</kd-info-card-header>
<kd-info-card-section>
<div layout="row" class="kd-info-card-entry kd-secret-detail-row" ng-repeat="(key, value) in ::$ctrl.secretDetail.data">
<div flex="nogrow" style="position: relative">
Expand Down
2 changes: 1 addition & 1 deletion src/app/frontend/secretdetail/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->

<kd-info-card>
<kd-info-card-header>[[Details|Secret info details section name.]]</kd-info-card-header>
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.secret.objectMeta">
</kd-object-meta-info-card>
Expand Down
4 changes: 2 additions & 2 deletions src/app/frontend/servicedetail/servicedetailinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
-->

<kd-info-card>
<kd-info-card-header>[[Resource Details|Title 'Resource details' at the top service details view.]]</kd-info-card-header>
<kd-info-card-section name="[[Details|Subtitle 'Details' at the top of the resource details column at the service detail view.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.service.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Label selector|Label 'Label selector' for the service's label selector in the details part (left) of the service details view.]]">
Expand Down
3 changes: 2 additions & 1 deletion src/app/frontend/statefulsetdetail/statefulsetinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
-->

<kd-info-card>
<kd-info-card-section name="[[Details|Stateful set info details section name.]]">
<kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.statefulSet.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Labels|Stateful set info details section labels entry.]]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('Resource card list', () => {
it('should fill the card layout', () => {
let compileFn = compile(`
<kd-resource-card-list selectable="selectable" with-statuses="withStatuses">
<kd-resource-card-list-header>Foo</kd-resource-card-list-header>
<kd-resource-card-header-columns>
<kd-resource-card-header-column size="small" grow="nogrow">
NAME_COLUMN
Expand Down Expand Up @@ -91,6 +92,7 @@ describe('Resource card list', () => {
expect(elem.html()).not.toContain('STATUS');
expect(elem.html()).toContain('FOOTER');
expect(elem.html()).not.toContain('md-checkbox');
expect(elem.html()).toContain('kd-resource-card-list-header');

scope.withStatuses = true;
scope.$digest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Resource card list pagination', () => {

errDialog = errorDialog;
httpBackend = $httpBackend;
resourceCardListCtrl = $componentController('kdResourceCardList');
resourceCardListCtrl = $componentController('kdResourceCardList', {$transclude: {}});
scope = $rootScope;
ctrl = $componentController(
'kdResourceCardListPagination', {
Expand Down

0 comments on commit fa896fb

Please sign in to comment.