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

Commit

Permalink
Design rehaul (#308)
Browse files Browse the repository at this point in the history
* Reorganize deployment list

* Add ChartIcon to deployment

* Add filters + Search input

* Fix link + default namespace

* Deployment details layout update

* ChartIcon in release extended

* Add chart icon color theming

* Fix list alignments

* Prevent chart icon not showing up

* Update Swagger spec for chartIcon

* Deployment subtitle style clean

* Cleanup headerbar

* Add deployment to small menu

* Improve small navbar style/animation

* Colorful card style chart-item

* Reorganize charts list

* Chart Details profile style

* Charts list overall ui fixes

* Allow search in repo

* Use custom module for color picking

* Fix too long chart/deployment name #16

* Add search icon on charts/deployments search field

* Fix UI Tests

* Fix chart list alignment + no charts result

* Improve search bars

* Remove chart-search route

* Fix empty charts list state

* Clean sass selector alignment

* Css variable cleanup + Fix most review comments

* Use colors from theme.scss everywhere

* Optimize search svg

* Refactor List Item

* Refactor list filters for chart & deployments

* Relayout header-bar + maxwidth layout on main page

* Fix test and compile script

* Back to previous chart layout + large max layout width

* Add xlarge breakpoint

* Fix url-join and marked imports

* Update swagger spec
  • Loading branch information
remstos authored and prydonius committed Jul 19, 2017
1 parent 2ab28c6 commit 078e531
Show file tree
Hide file tree
Showing 82 changed files with 1,485 additions and 807 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ repo-data/
coverage.txt
*.log
src/api/.glide
.vscode
**/.DS_Store
.vscode
2 changes: 2 additions & 0 deletions src/api/handlers/releases/releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func makeReleaseResource(release *hapi_release5.Release) *models.Resource {
ret.Attributes = &models.Release{
ChartName: &release.Chart.Metadata.Name,
ChartVersion: &release.Chart.Metadata.Version,
ChartIcon: &release.Chart.Metadata.Icon,
Updated: helpers.StrToPtr(timeconv.String(release.Info.LastDeployed)),
Name: &release.Name,
Namespace: &release.Namespace,
Expand All @@ -143,6 +144,7 @@ func makeReleaseExtendedResource(release *hapi_release5.Release) *models.Resourc
ret.Attributes = &models.ReleaseExtended{
ChartName: &release.Chart.Metadata.Name,
ChartVersion: &release.Chart.Metadata.Version,
ChartIcon: &release.Chart.Metadata.Icon,
Updated: helpers.StrToPtr(timeconv.String(release.Info.LastDeployed)),
Name: &release.Name,
Namespace: &release.Namespace,
Expand Down
2 changes: 2 additions & 0 deletions src/api/handlers/releases/releases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func TestMakeReleaseResource(t *testing.T) {
assert.Equal(t, *res.Attributes.(*models.Release).Namespace, "my-namespace", "namespace")
assert.Equal(t, *res.Attributes.(*models.Release).ChartVersion, "1.2.3", "version")
assert.Equal(t, *res.Attributes.(*models.Release).ChartName, "my-chart", "chart name")
assert.Equal(t, *res.Attributes.(*models.Release).ChartIcon, "chart-icon", "chart icon")
assert.Equal(t, *res.Attributes.(*models.Release).Status, "200", "Status")
assert.NotNil(t, res.Attributes.(*models.Release).Updated, "Has updated at timestamp")

Expand All @@ -207,6 +208,7 @@ func TestMakeReleaseExtendedResource(t *testing.T) {
assert.Equal(t, *res.Attributes.(*models.ReleaseExtended).Namespace, "my-namespace", "namespace")
assert.Equal(t, *res.Attributes.(*models.ReleaseExtended).ChartVersion, "1.2.3", "version")
assert.Equal(t, *res.Attributes.(*models.ReleaseExtended).ChartName, "my-chart", "chart name")
assert.Equal(t, *res.Attributes.(*models.ReleaseExtended).ChartIcon, "chart-icon", "chart icon")
assert.Equal(t, *res.Attributes.(*models.ReleaseExtended).Status, "200", "Status")
assert.NotNil(t, res.Attributes.(*models.ReleaseExtended).Updated, "Has updated at timestamp")
assert.Equal(t, *res.Attributes.(*models.ReleaseExtended).Notes, "my-notes", "Notes")
Expand Down
1 change: 1 addition & 0 deletions src/api/mocks/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var Resource = helm_releases.Release{
Metadata: &chart.Metadata{
Name: "my-chart",
Version: "1.2.3",
Icon: "chart-icon",
},
},
Info: &helm_releases.Info{
Expand Down
6 changes: 6 additions & 0 deletions src/api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ definitions:
- updated
- chartName
- chartVersion
- chartIcon
- namespace
properties:
name:
Expand All @@ -543,6 +544,8 @@ definitions:
type: string
chartVersion:
type: string
chartIcon:
type: string
namespace:
type: string
releaseExtended:
Expand All @@ -553,6 +556,7 @@ definitions:
- updated
- chartName
- chartVersion
- chartIcon
- namespace
- resources
- notes
Expand All @@ -567,6 +571,8 @@ definitions:
type: string
chartVersion:
type: string
chartIcon:
type: string
namespace:
type: string
resources:
Expand Down
20 changes: 20 additions & 0 deletions src/api/swagger/models/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ swagger:model release
*/
type Release struct {

/* chart icon
Required: true
*/
ChartIcon *string `json:"chartIcon"`

/* chart name
Required: true
Expand Down Expand Up @@ -57,6 +63,11 @@ type Release struct {
func (m *Release) Validate(formats strfmt.Registry) error {
var res []error

if err := m.validateChartIcon(formats); err != nil {
// prop
res = append(res, err)
}

if err := m.validateChartName(formats); err != nil {
// prop
res = append(res, err)
Expand Down Expand Up @@ -93,6 +104,15 @@ func (m *Release) Validate(formats strfmt.Registry) error {
return nil
}

func (m *Release) validateChartIcon(formats strfmt.Registry) error {

if err := validate.Required("chartIcon", "body", m.ChartIcon); err != nil {
return err
}

return nil
}

func (m *Release) validateChartName(formats strfmt.Registry) error {

if err := validate.Required("chartName", "body", m.ChartName); err != nil {
Expand Down
20 changes: 20 additions & 0 deletions src/api/swagger/models/release_extended.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ swagger:model releaseExtended
*/
type ReleaseExtended struct {

/* chart icon
Required: true
*/
ChartIcon *string `json:"chartIcon"`

/* chart name
Required: true
Expand Down Expand Up @@ -69,6 +75,11 @@ type ReleaseExtended struct {
func (m *ReleaseExtended) Validate(formats strfmt.Registry) error {
var res []error

if err := m.validateChartIcon(formats); err != nil {
// prop
res = append(res, err)
}

if err := m.validateChartName(formats); err != nil {
// prop
res = append(res, err)
Expand Down Expand Up @@ -115,6 +126,15 @@ func (m *ReleaseExtended) Validate(formats strfmt.Registry) error {
return nil
}

func (m *ReleaseExtended) validateChartIcon(formats strfmt.Registry) error {

if err := validate.Required("chartIcon", "body", m.ChartIcon); err != nil {
return err
}

return nil
}

func (m *ReleaseExtended) validateChartName(formats strfmt.Registry) error {

if err := validate.Required("chartName", "body", m.ChartName); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/api/swagger/restapi/embedded_spec.go

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
}
}
7 changes: 6 additions & 1 deletion src/ui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
<nav class="App__Menu">
<ul>
<li>
<a routerLink="/charts" routerLinkActive="active">
<a class="reverse" routerLink="/charts" routerLinkActive="active">
Charts
</a>
</li>
<li *ngIf="config.releasesEnabled">
<a class="reverse" routerLink="/deployments" routerLinkActive="active">
Deployments
</a>
</li>
<li>
<a href="https://github.com/kubernetes-helm/monocular/blob/master/docs/about.md" target="_blank">
About
Expand Down
26 changes: 16 additions & 10 deletions src/ui/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
// Import your custom theme
@import '../theme.scss';

$menu-height: 120px;

.App {

&__Wrap {
background: $background-white;
display: flex;
min-height: 100vh;
flex-direction: column;
Expand All @@ -14,40 +17,43 @@

.App__Content {
flex: 1;
padding-top: 70px;
}
}

&__Menu {
position: absolute;
background-color: $layout-base;
top: 0;
visibility: hidden;
transition: transform .3s ease-out;
will-change: transform;
height: 0;
width: 100%;
transition: height .3s ease-out;
will-change: height;

ul {
list-style: none;
}

li {
font-weight: bold;
font-weight: normal;
margin-bottom: .5em;
font-size: 1.2em;
color: md-color($monocular-app-primary);
a.active {
font-weight: bold;
color: $text-white;
}
}
}

&--openMenu {

.App__Wrap {
display: block;
position: relative;
transform: translateY(120px);
box-shadow: 0px 0px 20px rgba(0, 0, 0, .3);
transform: translateY($menu-height);
}

.App__Menu {
visibility: visible;
transform: translateY(1em);
height: $menu-height;
}
}
}
4 changes: 3 additions & 1 deletion src/ui/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FooterComponent } from './footer/footer.component';
import { FooterListComponent } from './footer-list/footer-list.component';

import { Angulartics2GoogleAnalytics } from 'angulartics2';
import { ConfigService } from './shared/services/config.service';

describe('AppComponent', () => {
let component: AppComponent;
Expand All @@ -21,7 +22,8 @@ describe('AppComponent', () => {
RouterTestingModule
],
providers: [
{ provide: Angulartics2GoogleAnalytics }
{ provide: Angulartics2GoogleAnalytics },
{ provide: ConfigService, useValue: { appName: 'appName' } }
]
})
.compileComponents();
Expand Down
5 changes: 5 additions & 0 deletions src/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { MenuService } from './shared/services/menu.service';
import { ChartsService } from './shared/services/charts.service';
import { ConfigService } from './shared/services/config.service';

@Component({
selector: 'app-root',
Expand All @@ -13,9 +14,12 @@ import { ChartsService } from './shared/services/charts.service';
export class AppComponent {
// Show the global menu
public showMenu: boolean = false;
// Config
public config;

constructor(
angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics,
config: ConfigService,
private menuService: MenuService,
private router: Router
) {
Expand All @@ -27,5 +31,6 @@ export class AppComponent {
router.events.subscribe(() => {
menuService.hideMenu();
});
this.config = config;
}
}
14 changes: 8 additions & 6 deletions src/ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { ChartListComponent } from './chart-list/chart-list.component';
import { ChartItemComponent } from './chart-item/chart-item.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { ChartDetailsComponent } from './chart-details/chart-details.component';
import { ChartSearchComponent } from './chart-search/chart-search.component';
import { HeaderBarComponent } from './header-bar/header-bar.component';
import { ChartDetailsUsageComponent } from './chart-details/chart-details-usage/chart-details-usage.component';
import { ChartDetailsReadmeComponent } from './chart-details/chart-details-readme/chart-details-readme.component';
Expand All @@ -41,14 +40,16 @@ import { ChartDetailsInfoComponent } from './chart-details/chart-details-info/ch
import { ChartDetailsVersionsComponent } from './chart-details/chart-details-versions/chart-details-versions.component';
import { ChartsComponent } from './charts/charts.component';
import { DeploymentsComponent } from './deployments/deployments.component';
import { DeploymentItemComponent } from './deployment-item/deployment-item.component';
import { DeploymentComponent } from './deployment/deployment.component';
import { DeploymentControlsComponent } from './deployment-controls/deployment-controls.component';
import { ChartsFiltersComponent } from './charts-filters/charts-filters.component';
import { LoaderComponent } from './loader/loader.component';
import { ConfirmDialog } from './confirm-dialog/confirm-dialog.component';
import { DeploymentResourceComponent } from './deployment/deployment-resource/deployment-resource.component';
import { ListItemComponent } from './list-item/list-item.component';
import { ListFiltersComponent } from './list-filters/list-filters.component';

require('hammerjs');
import 'hammerjs';

const metaConfig: MetaConfig = {
//Append a title suffix such as a site name to all titles
Expand All @@ -66,7 +67,6 @@ const metaConfig: MetaConfig = {
ChartItemComponent,
PageNotFoundComponent,
ChartDetailsComponent,
ChartSearchComponent,
HeaderBarComponent,
ChartDetailsUsageComponent,
ChartDetailsVersionsComponent,
Expand All @@ -78,13 +78,15 @@ const metaConfig: MetaConfig = {
FooterListComponent,
ChartDetailsInfoComponent,
ChartsComponent,
ChartsFiltersComponent,
LoaderComponent,
DeploymentControlsComponent,
DeploymentsComponent,
DeploymentItemComponent,
DeploymentComponent,
ConfirmDialog,
DeploymentResourceComponent
DeploymentResourceComponent,
ListItemComponent,
ListFiltersComponent
],
imports: [
MaterialModule.forRoot(),
Expand Down
5 changes: 0 additions & 5 deletions src/ui/src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ModuleWithProviders } from '@angular/core';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { ChartIndexComponent } from './chart-index/chart-index.component';
import { ChartDetailsComponent } from './chart-details/chart-details.component';
import { ChartSearchComponent } from './chart-search/chart-search.component';
import { ChartsComponent } from './charts/charts.component';
import { DeploymentsComponent } from './deployments/deployments.component';
import { DeploymentComponent } from './deployment/deployment.component';
Expand Down Expand Up @@ -36,10 +35,6 @@ const appRoutes: Routes = [
path: 'charts',
component: ChartsComponent
},
{
path: 'charts/search',
component: ChartSearchComponent
},
{
path: 'charts/:repo',
component: ChartsComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<div class="chartInfo">
<div class="chartInfo__chart">
<app-chart-item [chart]=chart [showVersion]=false [showDescription]=true>
</app-chart-item>
</div>

<app-chart-details-usage [chart]=chart *ngIf="currentVersion" [currentVersion]=currentVersion.attributes.version></app-chart-details-usage>

Expand Down
Loading

0 comments on commit 078e531

Please sign in to comment.