Add user header to the dashboard view

Rework of the change reverted by 8380b02d6.

Change-Id: Ic50144ae7a0c1c075b1922e6b6387a38073da606
This commit is contained in:
Wyatt Allen
2017-10-03 10:41:32 +01:00
parent ffd100f66f
commit 809fef2b35
2 changed files with 12 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ limitations under the License.
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../change-list/gr-change-list/gr-change-list.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../gr-user-header/gr-user-header.html">
<dom-module id="gr-dashboard-view">
<template>
@@ -34,6 +35,9 @@ limitations under the License.
gr-change-list {
width: 100%;
}
.hide {
display: none;
}
@media only screen and (max-width: 50em) {
.loading {
padding: 0 var(--default-horizontal-margin);
@@ -42,6 +46,9 @@ limitations under the License.
</style>
<div class="loading" hidden$="[[!_loading]]">Loading...</div>
<div hidden$="[[_loading]]" hidden>
<gr-user-header
user-id="[[params.user]]"
class$="[[_computeUserHeaderClass(params.user)]]"></gr-user-header>
<gr-change-list
show-star
show-reviewed-state

View File

@@ -53,6 +53,8 @@
},
/** @type {{ selectedChangeIndex: number }} */
viewState: Object,
/** @type {{ user: string }} */
params: {
type: Object,
},
@@ -144,5 +146,8 @@
return query.replace(/\$\{user\}/g, user);
},
_computeUserHeaderClass(userParam) {
return userParam === 'self' ? 'hide' : '';
},
});
})();