Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Design rehaul #308

Merged
merged 41 commits into from
Jul 19, 2017
Merged

Design rehaul #308

merged 41 commits into from
Jul 19, 2017

Conversation

remstos
Copy link
Contributor

@remstos remstos commented Jul 3, 2017

Cherry-picking all design/ui work

@remstos remstos changed the title Design rehaul [WIP] Design rehaul Jul 3, 2017
@sebgoa
Copy link

sebgoa commented Jul 4, 2017

let's try to get @Angelmmiguel to review.

Copy link
Member

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the general refactoring. I added some comments related to the CSS and the structure of the new components.

Can you attach some screenshots with the result of the changes? It would be nice to have that information associated to the PR.

Also, I saw you changed the warn color from deep-orange to red. What's the motivation to change the main palette of the project?

Thanks!

<app-chart-details-info [chart]=chart [currentVersion]=currentVersion></app-chart-details-info>
</aside>
<div class="chart-details__header">
<div class="chart-details__header__background" [style.background-color]="chartColor"></div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this concept but we don't control the color of icons. If the "main" color of an icon is to bright or dark, the readability of the content will be affected. Also, if the color is too saturated, the general design will look weird for that page.

&__background {
width: 100%;
height: 200px;
background: md-color($monocular-app-primary);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This color will be overridden by the Icon's color when it's calculated. This will cause a flashing effect in the UI.

}
}
&__content {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This selector is duplicated on this file.

display: flex;
flex-direction: column-reverse;
padding: 0 1em;
padding-bottom: 1em;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge this value in the previous CSS property

width: 100%;
margin-top: -80px;
margin-bottom: 40px;
&__background {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability of the CSS code, can you add an space before every selector? It's helpful to follow the hierarchy in the files :)

return list;
}

filterDeployments() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can create a common filter component that generate the select elements and trigger an event when some of them change.

transition: background 0.2s ease;
padding: 0.3em 0.5em;
svg {
fill: rgba(255, 255, 255, 0.6);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? We can update the SVG file to use the color defined in color property instead of force the color in the fill property.


.md-input-wrapper {
margin: .4em 0;
background: rgba(255, 255, 255, 0.125);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have a base color and change the alpha using SASS methods

@@ -0,0 +1,8 @@
<svg height="32px" version="1.1" viewBox="0 0 32 32" width="32px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use svgo to reduce the size of the SVG file

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
(function(i, s, o, g, r, a, m) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you uncompress the Google Analytics method and change the indentation of the script?

@Angelmmiguel
Copy link
Member

Related to my comments about taking the color of the icons, this is the problem I see:

Locust card

Mongo details page

Also, what's the motivation to fix the size of the UI to 1000px? I think it's too narrow for some of the pages like details. At the beginning of the project we decided to use the 100% of the screen.

Details view

Related to the cards, the icon is very relevant to identify a product. Now, the main element in the card is the color of the icon and they are smaller. Also, sometimes that color doesn't match with the real brand color.

Locus card

About the Home page, the cards have more margin on the right of the page:

Home page

@remstos
Copy link
Contributor Author

remstos commented Jul 4, 2017

Thank you @Angelmmiguel , this is probably the best review I've ever seen. I definitely moved without being aware of some guidelines you use, I'll fix this first and then I reply to each question.

@Angelmmiguel
Copy link
Member

Great @kemcake! Btw, the purpose of some requested changes is to be consistent with the rest of the project. If you have any suggestion about how to improve the current approach, please feel free to propose them so we can do a review. Thanks!

@remstos
Copy link
Contributor Author

remstos commented Jul 7, 2017

So the remaining questions are:

  • Should we use that color theming depending on the logo, looks nice most of the time but I agree it has some risks. The idea was to put more color and add some life to a chart. There's some checks on the color script to make sure we don't select too bright/dark color, but this is maybe not enough.

  • max width layout is a common thing (github...), 100% looks really strange on a wide screen and is usually bad for readable stuff like the readme. Once again this is a suggestion, I moved the value to theme.scss so it's easily editable.

@codecov-io
Copy link

codecov-io commented Jul 7, 2017

Codecov Report

Merging #308 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
+ Coverage   88.96%   88.99%   +0.03%     
==========================================
  Files          15       15              
  Lines         616      618       +2     
==========================================
+ Hits          548      550       +2     
  Misses         45       45              
  Partials       23       23
Impacted Files Coverage Δ
src/api/mocks/client.go 100% <ø> (ø) ⬆️
src/api/handlers/releases/releases.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ab28c6...6176220. Read the comment docs.

@sebgoa
Copy link

sebgoa commented Jul 8, 2017

personally I am fine with the fixed width. I agree that on big screens it stretches things to a very weird point.

For the colors, I don't really care. The main problem is that we do not have logos for all charts.

@Angelmmiguel can you do a final review so that we can move forward.

This can always be revisited.

@Angelmmiguel
Copy link
Member

@kemcake great job! Thanks for the improvements and refactoring. About the remaining items:

Should we use that color theming depending on the logo, looks nice most of the time but I agree it has some risks. The idea was to put more color and add some life to a chart. There's some checks on the color script to make sure we don't select too bright/dark color, but this is maybe not enough.

I'd remove this feature. I prefer to have a controlled UI since the base color of the logos may not fit with the current design. Also, I think it's better to continue with the initial design of the cards. We did a research about the cards and decided to keep logos as the main and more important element.

max width layout is a common thing (github...), 100% looks really strange on a wide screen and is usually bad for readable stuff like the readme. Once again this is a suggestion, I moved the value to theme.scss so it's easily editable.

That's solution works for me! Also, can you increase a bit that fixed width value? I believe that a value between 1150-1250px will work in most use cases.

Thanks!

Copy link
Member

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review my last comments before merge it :)

@prydonius
Copy link
Member

This looks great to me, only thing I noticed was the arrows in the Install section:
screen shot 2017-07-12 at 16 48 23

Oddly, if you click on "Helm CLI" it goes back to normal:

screen shot 2017-07-12 at 16 48 36

I don't mind if you prefer to merge this and fix this in a separate PR though.

@sebgoa
Copy link

sebgoa commented Jul 17, 2017

@kemcake can you fix the conflicts, rebase and then we will merge.

@prydonius
Copy link
Member

This worked before but I'm now unable to compile this again:

ui_1   | Time: 62932ms
ui_1   | chunk    {0} main.bundle.js, main.bundle.map (main) 591 kB {2} [initial] [rendered]
ui_1   | chunk    {1} styles.bundle.css, styles.bundle.map, styles.bundle.map (styles) 69.5 kB {3} [initial] [rendered]
ui_1   | chunk    {2} vendor.bundle.js, vendor.bundle.map (vendor) 4.75 MB [initial] [rendered]
ui_1   | chunk    {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ui_1   |
ui_1   | ERROR in /app/src/app/chart-details/chart-details-readme/chart-details-readme.component.ts (2,22): Cannot find module 'marked'.
ui_1   |
ui_1   | ERROR in /app/src/app/chart-details/chart-details-info/chart-details-info.component.ts (6,21): Cannot find module 'url-join'.
ui_1   | webpack: Failed to compile.

Really not sure why these errors keep coming up...

@prydonius
Copy link
Member

@kemkake I managed to get rid of the error I was getting above by installing the typings (https://www.reddit.com/r/Angular2/comments/59b2mc/import_vs_require_why_one_work_and_the_other/) and changing the import line.

npm install --save-dev @types/marked
npm install --save-dev @types/url-join
diff --git a/src/ui/package.json b/src/ui/package.json
index 5e5fe7a..c7e28ac 100644
--- a/src/ui/package.json
+++ b/src/ui/package.json
@@ -46,6 +46,8 @@
   },
   "devDependencies": {
     "@types/jasmine": "^2.2.30",
+    "@types/marked": "0.0.28",
+    "@types/url-join": "^0.8.2",
     "angular-cli": "1.0.0-beta.24",
     "bootstrap-sass": "^3.3.7",
     "codelyzer": "~0.0.26",
@@ -57,6 +59,7 @@
     "karma-cli": "^1.0.1",
     "karma-jasmine": "^1.0.2",
     "karma-remap-istanbul": "^0.2.1",
+    "mappy-breakpoints": "^0.2.3",
     "node-sass": "^3.9.3",
     "protractor": "4.0.5",
     "resolve-url-loader": "^1.6.0",
@@ -66,7 +69,6 @@
     "tslint": "3.13.0",
     "typescript": "^2.0.0",
     "url-loader": "^0.5.7",
-    "mappy-breakpoints": "^0.2.3",
     "webpack": "2.2.0-rc.3"
   }
 }
diff --git a/src/ui/src/app/chart-details/chart-details-info/chart-details-info.component.ts b/src/ui/src/app/chart-details/chart-details-info/chart-details-info.component.ts
index 115453a..51445c1 100644
--- a/src/ui/src/app/chart-details/chart-details-info/chart-details-info.component.ts
+++ b/src/ui/src/app/chart-details/chart-details-info/chart-details-info.component.ts
@@ -3,7 +3,7 @@ import { ChartsService } from '../../shared/services/charts.service';
 import { Chart } from '../../shared/models/chart';
 import { Maintainer } from '../../shared/models/maintainer';
 import { ChartVersion } from '../../shared/models/chart-version';
-import urljoin from 'url-join';
+import * as urljoin from 'url-join';

 @Component({
   selector: 'app-chart-details-info',
diff --git a/src/ui/src/app/chart-details/chart-details-readme/chart-details-readme.component.ts b/src/ui/src/app/chart-details/chart-details-readme/chart-details-readme.component.ts
index 840b0c8..4f3022f 100644
--- a/src/ui/src/app/chart-details/chart-details-readme/chart-details-readme.component.ts
+++ b/src/ui/src/app/chart-details/chart-details-readme/chart-details-readme.component.ts
@@ -1,5 +1,5 @@
 import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
-import markdown from 'marked';
+import * as markdown from 'marked';
 import { Chart } from '../../shared/models/chart';
 import { ChartsService } from '../../shared/services/charts.service';
 import { ChartVersion } from '../../shared/models/chart-version';

@prydonius
Copy link
Member

If the above works in your environment too, can we update to it and then land? We can revisit these issues when we move start from the new angular project with yarn.

@prydonius prydonius merged commit 078e531 into helm:master Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants