From 05d639342d6d6de5453f6d2c0f22ffffe36b8da6 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 28 May 2020 09:14:51 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Add=20rose=20layout=20t?= =?UTF-8?q?o=20ui/core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/rose/layout/page.stories.mdx | 38 +++++++++++++++++-- .../styles/rose/components/layout/_index.scss | 4 +- .../components/rose/layout/page/header.hbs | 4 +- .../components/rose/layout/page-test.js | 6 +-- .../rose/layout/page/header-test.js | 1 - ui/core/app/templates/application.hbs | 18 ++++++--- 6 files changed, 54 insertions(+), 17 deletions(-) diff --git a/addons/rose/addon/components/rose/layout/page.stories.mdx b/addons/rose/addon/components/rose/layout/page.stories.mdx index d8d239fa2..0984bbbd2 100644 --- a/addons/rose/addon/components/rose/layout/page.stories.mdx +++ b/addons/rose/addon/components/rose/layout/page.stories.mdx @@ -8,6 +8,7 @@ import { text, boolean, select } from '@storybook/addon-knobs'; # Layout|Page A page layout/positioning component that allows three distinct sections to be configured: header, sidebar, and main. +Sidebar's content width determines it's column width. ```htmlbars @@ -21,9 +22,40 @@ A page layout/positioning component that allows three distinct sections to be co {{ template: hbs` - Header - Sidebar - Main + Header + Main + Sidebar + + `, + }} + + +Header, main, and sidebar components are optional. + + {{ + template: hbs` + + Header + + `, + }} + + + + {{ + template: hbs` + + Main + + `, + }} + + + + {{ + template: hbs` + + Sidebar `, }} diff --git a/addons/rose/addon/styles/rose/components/layout/_index.scss b/addons/rose/addon/styles/rose/components/layout/_index.scss index 1d7a445e3..3da20011a 100644 --- a/addons/rose/addon/styles/rose/components/layout/_index.scss +++ b/addons/rose/addon/styles/rose/components/layout/_index.scss @@ -5,8 +5,8 @@ grid-template-areas: 'header header header header' 'sidebar main main main'; - grid-template-columns: 0.5fr repeat(3, 1fr); - grid-template-rows: 0.1fr auto; + grid-template-columns: auto 1fr; + grid-template-rows: auto 1fr; height: 100vh; } diff --git a/addons/rose/addon/templates/components/rose/layout/page/header.hbs b/addons/rose/addon/templates/components/rose/layout/page/header.hbs index 545ac6c22..0f77561b5 100644 --- a/addons/rose/addon/templates/components/rose/layout/page/header.hbs +++ b/addons/rose/addon/templates/components/rose/layout/page/header.hbs @@ -1,3 +1,3 @@ -
+
{{yield}} -
+ diff --git a/addons/rose/tests/integration/components/rose/layout/page-test.js b/addons/rose/tests/integration/components/rose/layout/page-test.js index ec21ff507..f1f7feb87 100644 --- a/addons/rose/tests/integration/components/rose/layout/page-test.js +++ b/addons/rose/tests/integration/components/rose/layout/page-test.js @@ -28,20 +28,20 @@ module('Integration | Component | rose/layout/page', function (hooks) { await render(hbs` `); - assert.ok(find('header')); + assert.ok(find('.rose-layout-header')); }); test('it renders with main', async function (assert) { await render(hbs` `); - assert.ok(find('main')); + assert.ok(find('.rose-layout-main')); }); test('it renders with sidebar', async function (assert) { await render(hbs` `); - assert.ok(find('aside')); + assert.ok(find('.rose-layout-sidebar')); }); }); diff --git a/addons/rose/tests/integration/components/rose/layout/page/header-test.js b/addons/rose/tests/integration/components/rose/layout/page/header-test.js index 8976dd726..6a8b305ad 100644 --- a/addons/rose/tests/integration/components/rose/layout/page/header-test.js +++ b/addons/rose/tests/integration/components/rose/layout/page/header-test.js @@ -8,7 +8,6 @@ module('Integration | Component | rose/layout/page/header', function (hooks) { test('it renders', async function (assert) { await render(hbs``); - assert.ok(find('header')); assert.ok(find('.rose-layout-header')); }); diff --git a/ui/core/app/templates/application.hbs b/ui/core/app/templates/application.hbs index 1ac60bbce..ff8c801fe 100644 --- a/ui/core/app/templates/application.hbs +++ b/ui/core/app/templates/application.hbs @@ -1,8 +1,14 @@ - -{{title (app-name)}} + + + + + + - - - + + {{title (app-name)}} + {{outlet}} + -{{outlet}} + +