From 7aa52d3d0afb2cf2b26c18982c84f45f5fcccb30 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Thu, 3 Dec 2015 17:16:05 -0500 Subject: [PATCH] Implement user dashboard view This changes the way the change list view is layed out (flexbox instead of tables) for a couple reasons: + Table elements (td, tr, etc.) cannot be arbitrarily appended to just any DOM node, which caused breakage when I originally attempted to use a tag to bring in the header or group title content into gr-change-list-item. + The flexibility of flexbox allows us to style the change list much easier on smaller screens, so it was probably going to happen anyway. + Full-width (colspan="") rows for the headers is much more difficult when using elements outside of the gr-change-list-item brought in via as described above. + gr-change-list-item was doing too much anyway. Feature: Issue 3700 Change-Id: I6536bf7d18adfa460507f8050a15d83e84af82a7 --- .../app/elements/gr-change-list-item.html | 119 ++++++++---------- .../app/elements/gr-change-list.html | 83 +++++++++--- .../app/elements/gr-dashboard-view.html | 21 ++++ polygerrit-ui/app/scripts/changes.js | 7 ++ .../app/styles/gr-change-list-styles.html | 63 ++++++++++ .../app/test/gr-change-list-item-test.html | 18 ++- .../app/test/gr-change-list-test.html | 107 +++++++++++++--- 7 files changed, 314 insertions(+), 104 deletions(-) create mode 100644 polygerrit-ui/app/styles/gr-change-list-styles.html diff --git a/polygerrit-ui/app/elements/gr-change-list-item.html b/polygerrit-ui/app/elements/gr-change-list-item.html index 629f492021..b0f196415f 100644 --- a/polygerrit-ui/app/elements/gr-change-list-item.html +++ b/polygerrit-ui/app/elements/gr-change-list-item.html @@ -15,25 +15,22 @@ limitations under the License. --> + + @@ -42,15 +43,22 @@ limitations under the License. assert.equal(element._computeChangeStatusString({mergeable: true}), ''); assert.equal(element._computeChangeStatusString({mergeable: false}), 'Merge Conflict'); + assert.equal(element._computeChangeStatusString({status: 'NEW'}), ''); + assert.equal(element._computeChangeStatusString({status: 'MERGED'}), + 'Merged'); + assert.equal(element._computeChangeStatusString({status: 'ABANDONED'}), + 'Abandoned'); + assert.equal(element._computeChangeStatusString({status: 'DRAFT'}), + 'Draft'); - assert.equal(element._computeCodeReviewClass(), ''); - assert.equal(element._computeCodeReviewClass({}), ''); + assert.equal(element._computeCodeReviewClass(), 'cell codeReview'); + assert.equal(element._computeCodeReviewClass({}), 'cell codeReview'); assert.equal(element._computeCodeReviewClass({approved: true, value: 1}), - 'u-green'); + 'cell codeReview u-green u-monospace'); assert.equal(element._computeCodeReviewClass({value: 1}), - 'u-monospace u-green'); + 'cell codeReview u-green u-monospace'); assert.equal(element._computeCodeReviewClass({value: -1}), - 'u-monospace u-red'); + 'cell codeReview u-monospace u-red'); assert.equal(element._computeCodeReviewLabel(), ''); assert.equal(element._computeCodeReviewLabel({}), ''); diff --git a/polygerrit-ui/app/test/gr-change-list-test.html b/polygerrit-ui/app/test/gr-change-list-test.html index afbd32ac87..d713368659 100644 --- a/polygerrit-ui/app/test/gr-change-list-test.html +++ b/polygerrit-ui/app/test/gr-change-list-test.html @@ -22,6 +22,7 @@ limitations under the License. + @@ -33,49 +34,115 @@ limitations under the License. + + + +