From aa9eb4f8d4892c8225b6edc41081eeab99fcf040 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 14 Sep 2020 10:31:43 -0400 Subject: [PATCH 1/8] feat: Introduce error component --- ui/core/app/components/error/message.hbs | 4 + ui/core/app/components/error/message.js | 104 ++++++++++++++++++ ui/core/app/routes/application.js | 2 - ui/core/app/routes/scopes/scope.js | 1 + ui/core/app/templates/scopes/scope/error.hbs | 6 + ui/core/mirage/config.js | 16 ++- .../components/error/message-test.js | 26 +++++ ui/core/translations/en-us.yaml | 6 + 8 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 ui/core/app/components/error/message.hbs create mode 100644 ui/core/app/components/error/message.js create mode 100644 ui/core/app/templates/scopes/scope/error.hbs create mode 100644 ui/core/tests/integration/components/error/message-test.js diff --git a/ui/core/app/components/error/message.hbs b/ui/core/app/components/error/message.hbs new file mode 100644 index 000000000..7cc59f8c9 --- /dev/null +++ b/ui/core/app/components/error/message.hbs @@ -0,0 +1,4 @@ + + {{t this.description}} + {{t "actions.help"}} + \ No newline at end of file diff --git a/ui/core/app/components/error/message.js b/ui/core/app/components/error/message.js new file mode 100644 index 000000000..c949ba822 --- /dev/null +++ b/ui/core/app/components/error/message.js @@ -0,0 +1,104 @@ +import Message from 'rose/components/rose/message'; + +/* + * Helpful error booleans are attached based on the error status code: + * + * - 401 - `error.isUnauthenticated`: the session isn't authenticated + * - 403 - `error.isForbidden`: the session is authenticated but does not have + * permission to perform the requested action + * - 404 - `error.isNotFound`: the requested resource could not be found + * - 500 - `error.isServer`: an internal server error occurred + * + * For an unknown error state, i.e error state not matching to the above defined list: + * - unknown - `error.isUnknown`: an error occurred, but we don't know which or + * we don't distinguish it yet +*/ + +const status_messages = { + '401' : { + icon: 'disabled', + title: 'errors.titles.unauthenticated-error', + subtitle: 'errors.subtitles.unauthenticated-error', + description: 'errors.descriptions.unauthenticated-error', + }, + '403' : { + icon: 'disabled', + title: 'errors.titles.forbidden-error', + subtitle: 'errors.subtitles.forbidden-error', + description: 'errors.descriptions.forbidden-error', + }, + '404' : { + icon: 'help-circle-outline', + title: 'errors.titles.notfound-error', + subtitle: 'errors.subtitles.notfound-error', + description: 'errors.descriptions.notfound-error', + }, + '500' : { + icon: 'alert-circle-outline', + title: 'errors.titles.server-error', + subtitle: 'errors.subtitles.server-error', + description: 'errors.descriptions.server-error', + }, + 'unknown' : { + icon: 'alert-circle-outline', + title: 'errors.titles.unknown-error', + subtitle: 'errors.subtitles.unknown-error', + description: 'errors.descriptions.unknown-error', + } +}; + +export default class ErrorMessageComponent extends Message { + // =methods + + /** + * Returns an icon name based on error status. + * @return {string} + */ + get icon() { + return this.statusMessage.icon; + } + + /** + * Returns a message title based on error status. + * @return {string} + */ + get title() { + return this.statusMessage.title; + } + + /** + * Returns a message subtitle of error status prefixed with 'Error'. + * @return {string} + */ + get subtitle() { + return this.statusMessage.subtitle; + } + + /** + * Returns an error description based on error status. + * @return {string} + */ + get description() { + return this.statusMessage.description; + } + + /** + * Returns an route string for help text in message. + * @return {string} + */ + get helpRoute() { + return 'index' + } + + /** + * Returns an object with message details based on error status. + * Return message for `unkown` error when error status isn't part of + * predefined message set. + * @return {object} + */ + get statusMessage() { + let status = this.status; + if(!status_messages[status]) { status = 'unknown'; } + return status_messages[status]; + } +} \ No newline at end of file diff --git a/ui/core/app/routes/application.js b/ui/core/app/routes/application.js index 0a6c58271..1ee2b2ce2 100644 --- a/ui/core/app/routes/application.js +++ b/ui/core/app/routes/application.js @@ -50,8 +50,6 @@ export default class ApplicationRoute extends Route.extend( if (!Ember.testing) later(location, location.reload, 150); } - // =actions - /** * Delegates invalidation to the session service. */ diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js index 820f7caf2..def116b51 100644 --- a/ui/core/app/routes/scopes/scope.js +++ b/ui/core/app/routes/scopes/scope.js @@ -33,4 +33,5 @@ export default class ScopesScopeRoute extends Route { ); }); } + } diff --git a/ui/core/app/templates/scopes/scope/error.hbs b/ui/core/app/templates/scopes/scope/error.hbs new file mode 100644 index 000000000..417feb0ea --- /dev/null +++ b/ui/core/app/templates/scopes/scope/error.hbs @@ -0,0 +1,6 @@ + + {{#each @model.errors as |error|}} + {{title error.status}} + + {{/each}} + \ No newline at end of file diff --git a/ui/core/mirage/config.js b/ui/core/mirage/config.js index 7f2ea5ba0..846da6b99 100644 --- a/ui/core/mirage/config.js +++ b/ui/core/mirage/config.js @@ -1,6 +1,6 @@ import config from '../config/environment'; import { authHandler, deauthHandler } from './route-handlers/auth'; -//import { Response } from 'miragejs'; +import { Response } from 'miragejs'; export default function() { @@ -288,4 +288,18 @@ export default function() { } return target.update(updatedAttrs); }); + + /* Uncomment the following line and the Response import above + * Then change the response code to simulate error responses. + * this.get('/scopes', () => new Response(505)); + * + * Update error payload to simulate specific error responses. + */ + // this.get('/host-catalogs', () => new Response(404)); + // this.get('/scopes/:id', () => new Response(505, {}, { + // errors: [{ + // status: 505, + // message: 'HTTP version not supported.', + // }] + // })); } diff --git a/ui/core/tests/integration/components/error/message-test.js b/ui/core/tests/integration/components/error/message-test.js new file mode 100644 index 000000000..811a0a138 --- /dev/null +++ b/ui/core/tests/integration/components/error/message-test.js @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | error/message', function(hooks) { + setupRenderingTest(hooks); + + test('it renders', async function(assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.equal(this.element.textContent.trim(), ''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.equal(this.element.textContent.trim(), 'template block text'); + }); +}); diff --git a/ui/core/translations/en-us.yaml b/ui/core/translations/en-us.yaml index 301ac40a2..756b98b98 100644 --- a/ui/core/translations/en-us.yaml +++ b/ui/core/translations/en-us.yaml @@ -162,6 +162,12 @@ errors: server-error: Server error unknown-error: Something went wrong authentication-failed: Authentication Failed + subtitles: + unauthenticated-error: Error 401 + forbidden-error: Error 403 + notfound-error: Error 404 + server-error: Error 500 + unknown-error: Error descriptions: unauthenticated-error: You are not authenticated. Please authenticate and try again later. forbidden-error: You must be granted permissions to view this data. Ask your administrator if you think you should have access. From cfd1ac81fbe7abbfbfd3e0d5bdc445f80ffd957f Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 16 Sep 2020 15:25:35 -0400 Subject: [PATCH 2/8] refactor: Update comments and tests for error message --- ui/core/app/components/error/message.hbs | 4 +- ui/core/app/components/error/message.js | 51 ++++++++++--------- ui/core/app/routes/scopes/scope.js | 1 - ui/core/mirage/config.js | 3 +- .../components/error/message-test.js | 45 ++++++++++------ 5 files changed, 62 insertions(+), 42 deletions(-) diff --git a/ui/core/app/components/error/message.hbs b/ui/core/app/components/error/message.hbs index 7cc59f8c9..200395481 100644 --- a/ui/core/app/components/error/message.hbs +++ b/ui/core/app/components/error/message.hbs @@ -1,4 +1,6 @@ {{t this.description}} - {{t "actions.help"}} + {{#if this.helpRoute}} + {{t "actions.help"}} + {{/if}} \ No newline at end of file diff --git a/ui/core/app/components/error/message.js b/ui/core/app/components/error/message.js index c949ba822..1c476e71f 100644 --- a/ui/core/app/components/error/message.js +++ b/ui/core/app/components/error/message.js @@ -1,50 +1,50 @@ import Message from 'rose/components/rose/message'; /* - * Helpful error booleans are attached based on the error status code: - * - * - 401 - `error.isUnauthenticated`: the session isn't authenticated - * - 403 - `error.isForbidden`: the session is authenticated but does not have - * permission to perform the requested action - * - 404 - `error.isNotFound`: the requested resource could not be found - * - 500 - `error.isServer`: an internal server error occurred - * - * For an unknown error state, i.e error state not matching to the above defined list: - * - unknown - `error.isUnknown`: an error occurred, but we don't know which or - * we don't distinguish it yet -*/ + * Helpful error booleans are attached based on the error status code: + * + * - 401 - `error.isUnauthenticated`: the session isn't authenticated + * - 403 - `error.isForbidden`: the session is authenticated but does not have + * permission to perform the requested action + * - 404 - `error.isNotFound`: the requested resource could not be found + * - 500 - `error.isServer`: an internal server error occurred + * + * For an unknown error state, i.e error state not matching to the above defined list: + * - unknown - `error.isUnknown`: an error occurred, but we don't know which or + * we don't distinguish it yet + */ const status_messages = { - '401' : { + '401': { icon: 'disabled', title: 'errors.titles.unauthenticated-error', subtitle: 'errors.subtitles.unauthenticated-error', description: 'errors.descriptions.unauthenticated-error', }, - '403' : { + '403': { icon: 'disabled', title: 'errors.titles.forbidden-error', subtitle: 'errors.subtitles.forbidden-error', description: 'errors.descriptions.forbidden-error', }, - '404' : { + '404': { icon: 'help-circle-outline', title: 'errors.titles.notfound-error', subtitle: 'errors.subtitles.notfound-error', description: 'errors.descriptions.notfound-error', }, - '500' : { + '500': { icon: 'alert-circle-outline', title: 'errors.titles.server-error', subtitle: 'errors.subtitles.server-error', description: 'errors.descriptions.server-error', }, - 'unknown' : { + unknown: { icon: 'alert-circle-outline', title: 'errors.titles.unknown-error', subtitle: 'errors.subtitles.unknown-error', description: 'errors.descriptions.unknown-error', - } + }, }; export default class ErrorMessageComponent extends Message { @@ -82,23 +82,26 @@ export default class ErrorMessageComponent extends Message { return this.statusMessage.description; } + // Disable until help documentation can be linked in. /** * Returns an route string for help text in message. * @return {string} */ - get helpRoute() { - return 'index' - } + // get helpRoute() { + // return 'index' + // } /** * Returns an object with message details based on error status. - * Return message for `unkown` error when error status isn't part of + * Return message for `unknown` error when error status isn't part of * predefined message set. * @return {object} */ get statusMessage() { let status = this.status; - if(!status_messages[status]) { status = 'unknown'; } + if (!status_messages[status]) { + status = 'unknown'; + } return status_messages[status]; } -} \ No newline at end of file +} diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js index def116b51..820f7caf2 100644 --- a/ui/core/app/routes/scopes/scope.js +++ b/ui/core/app/routes/scopes/scope.js @@ -33,5 +33,4 @@ export default class ScopesScopeRoute extends Route { ); }); } - } diff --git a/ui/core/mirage/config.js b/ui/core/mirage/config.js index 846da6b99..e0f1cfce3 100644 --- a/ui/core/mirage/config.js +++ b/ui/core/mirage/config.js @@ -1,6 +1,7 @@ import config from '../config/environment'; import { authHandler, deauthHandler } from './route-handlers/auth'; -import { Response } from 'miragejs'; +// Uncomment to use in simulating error responses +// import { Response } from 'miragejs'; export default function() { diff --git a/ui/core/tests/integration/components/error/message-test.js b/ui/core/tests/integration/components/error/message-test.js index 811a0a138..e4e6b1428 100644 --- a/ui/core/tests/integration/components/error/message-test.js +++ b/ui/core/tests/integration/components/error/message-test.js @@ -1,26 +1,41 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -module('Integration | Component | error/message', function(hooks) { +module('Integration | Component | error/message', function (hooks) { setupRenderingTest(hooks); - test('it renders', async function(assert) { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); + test('it renders predefined message for known error status', async function (assert) { + this.set('status', '401'); - await render(hbs``); + await render(hbs``); + assert.equal( + find('.rose-message-title').textContent.trim(), + 'You are not signed in' + ); + assert.equal( + find('.rose-message-subtitle').textContent.trim(), + 'Error 401' + ); + assert.equal( + find('.rose-message-description').textContent.trim(), + 'You are not authenticated. Please authenticate and try again later.' + ); + }); - assert.equal(this.element.textContent.trim(), ''); + test('it renders default error for undefined error status', async function (assert) { + this.set('status', '510'); - // Template block usage: - await render(hbs` - - template block text - - `); - - assert.equal(this.element.textContent.trim(), 'template block text'); + await render(hbs``); + assert.equal( + find('.rose-message-title').textContent.trim(), + 'Something went wrong' + ); + assert.equal(find('.rose-message-subtitle').textContent.trim(), 'Error'); + assert.equal( + find('.rose-message-description').textContent.trim(), + 'Please contact your administrator or try again later.' + ); }); }); From 5b7bbf979ef7a9c77930729cc3ec93ea45192f68 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 16 Sep 2020 15:29:45 -0400 Subject: [PATCH 3/8] style: Add in accidentally deleted actions jsdoc notation --- ui/core/app/routes/application.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/core/app/routes/application.js b/ui/core/app/routes/application.js index 1ee2b2ce2..0a6c58271 100644 --- a/ui/core/app/routes/application.js +++ b/ui/core/app/routes/application.js @@ -50,6 +50,8 @@ export default class ApplicationRoute extends Route.extend( if (!Ember.testing) later(location, location.reload, 150); } + // =actions + /** * Delegates invalidation to the session service. */ From 0690620a8ef1bc6d8e132da029cefec2b2047564 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 18 Sep 2020 12:00:52 -0400 Subject: [PATCH 4/8] refactor: Simplify error message component --- ui/core/app/components/error/message.hbs | 4 +- ui/core/app/components/error/message.js | 92 +++++-------------- ui/core/app/templates/scopes/scope/error.hbs | 2 +- .../components/error/message-test.js | 12 +-- ui/core/translations/en-us.yaml | 33 ++++--- 5 files changed, 46 insertions(+), 97 deletions(-) diff --git a/ui/core/app/components/error/message.hbs b/ui/core/app/components/error/message.hbs index 200395481..54813a844 100644 --- a/ui/core/app/components/error/message.hbs +++ b/ui/core/app/components/error/message.hbs @@ -1,5 +1,5 @@ - - {{t this.description}} + + {{t (concat "errors." statusCode ".description")}} {{#if this.helpRoute}} {{t "actions.help"}} {{/if}} diff --git a/ui/core/app/components/error/message.js b/ui/core/app/components/error/message.js index 1c476e71f..7ae6ca0d1 100644 --- a/ui/core/app/components/error/message.js +++ b/ui/core/app/components/error/message.js @@ -1,4 +1,5 @@ import Message from 'rose/components/rose/message'; +import { computed } from '@ember/object'; /* * Helpful error booleans are attached based on the error status code: @@ -14,75 +15,29 @@ import Message from 'rose/components/rose/message'; * we don't distinguish it yet */ -const status_messages = { - '401': { - icon: 'disabled', - title: 'errors.titles.unauthenticated-error', - subtitle: 'errors.subtitles.unauthenticated-error', - description: 'errors.descriptions.unauthenticated-error', - }, - '403': { - icon: 'disabled', - title: 'errors.titles.forbidden-error', - subtitle: 'errors.subtitles.forbidden-error', - description: 'errors.descriptions.forbidden-error', - }, - '404': { - icon: 'help-circle-outline', - title: 'errors.titles.notfound-error', - subtitle: 'errors.subtitles.notfound-error', - description: 'errors.descriptions.notfound-error', - }, - '500': { - icon: 'alert-circle-outline', - title: 'errors.titles.server-error', - subtitle: 'errors.subtitles.server-error', - description: 'errors.descriptions.server-error', - }, - unknown: { - icon: 'alert-circle-outline', - title: 'errors.titles.unknown-error', - subtitle: 'errors.subtitles.unknown-error', - description: 'errors.descriptions.unknown-error', - }, -}; +const statuses = ['401', '403', '404', '500']; export default class ErrorMessageComponent extends Message { // =methods /** - * Returns an icon name based on error status. + * Returns an icon for error status. * @return {string} */ + @computed('status') get icon() { - return this.statusMessage.icon; + switch (this.status) { + case '401': + case '403': + return 'disabled'; + case '404': + return 'help-circle-outline'; + default: + return 'alert-circle-outline'; + } } - /** - * Returns a message title based on error status. - * @return {string} - */ - get title() { - return this.statusMessage.title; - } - - /** - * Returns a message subtitle of error status prefixed with 'Error'. - * @return {string} - */ - get subtitle() { - return this.statusMessage.subtitle; - } - - /** - * Returns an error description based on error status. - * @return {string} - */ - get description() { - return this.statusMessage.description; - } - - // Disable until help documentation can be linked in. + // TODO: Enable when help documentation can be linked in. /** * Returns an route string for help text in message. * @return {string} @@ -92,16 +47,15 @@ export default class ErrorMessageComponent extends Message { // } /** - * Returns an object with message details based on error status. - * Return message for `unknown` error when error status isn't part of - * predefined message set. - * @return {object} + * Returns 'unknown' status code when provided error status + * isn't part of predefined statuses. + * @return {string} */ - get statusMessage() { - let status = this.status; - if (!status_messages[status]) { - status = 'unknown'; - } - return status_messages[status]; + @computed('status') + get statusCode() { + let statusCode = this.status; + if(!statuses.includes(statusCode)) statusCode = 'unknown'; + return statusCode; } + } diff --git a/ui/core/app/templates/scopes/scope/error.hbs b/ui/core/app/templates/scopes/scope/error.hbs index 417feb0ea..8d56c81ce 100644 --- a/ui/core/app/templates/scopes/scope/error.hbs +++ b/ui/core/app/templates/scopes/scope/error.hbs @@ -1,6 +1,6 @@ +{{title (t "errors.titles.error") }} {{#each @model.errors as |error|}} - {{title error.status}} {{/each}} \ No newline at end of file diff --git a/ui/core/tests/integration/components/error/message-test.js b/ui/core/tests/integration/components/error/message-test.js index e4e6b1428..2671c9b7e 100644 --- a/ui/core/tests/integration/components/error/message-test.js +++ b/ui/core/tests/integration/components/error/message-test.js @@ -7,9 +7,7 @@ module('Integration | Component | error/message', function (hooks) { setupRenderingTest(hooks); test('it renders predefined message for known error status', async function (assert) { - this.set('status', '401'); - - await render(hbs``); + await render(hbs``); assert.equal( find('.rose-message-title').textContent.trim(), 'You are not signed in' @@ -24,15 +22,13 @@ module('Integration | Component | error/message', function (hooks) { ); }); - test('it renders default error for undefined error status', async function (assert) { - this.set('status', '510'); - - await render(hbs``); + test('it renders default error for unknown error status', async function (assert) { + await render(hbs``); assert.equal( find('.rose-message-title').textContent.trim(), 'Something went wrong' ); - assert.equal(find('.rose-message-subtitle').textContent.trim(), 'Error'); + assert.equal(find('.rose-message-subtitle').textContent.trim(), 'Error 599'); assert.equal( find('.rose-message-description').textContent.trim(), 'Please contact your administrator or try again later.' diff --git a/ui/core/translations/en-us.yaml b/ui/core/translations/en-us.yaml index f5708a5a0..fdfb779f9 100644 --- a/ui/core/translations/en-us.yaml +++ b/ui/core/translations/en-us.yaml @@ -158,25 +158,24 @@ form: current_password: Current Password new_password: New Password errors: + 401: + title: You are not signed in + description: You are not authenticated. Please authenticate and try again later. + 403: + title: You are not authorized + description: You must be granted permissions to view this data. Ask your administrator if you think you should have access. + 404: + title: Resource not found + description: We could not find the requested resource. You can ask your administrator or try again later. + 500: + title: Server error + description: We ran into a problem and could not continue. You can ask your administrator or try again later. + unknown: + title: Something went wrong + description: Please contact your administrator or try again later. titles: - unauthenticated-error: You are not signed in - forbidden-error: You are not authorized - notfound-error: Resource not found - server-error: Server error - unknown-error: Something went wrong authentication-failed: Authentication Failed - subtitles: - unauthenticated-error: Error 401 - forbidden-error: Error 403 - notfound-error: Error 404 - server-error: Error 500 - unknown-error: Error - descriptions: - unauthenticated-error: You are not authenticated. Please authenticate and try again later. - forbidden-error: You must be granted permissions to view this data. Ask your administrator if you think you should have access. - notfound-error: We could not find the requested resource. You can ask your administrator or try again later. - server-error: We ran into a problem and could not continue. You can ask your administrator or try again later. - unknown-error: Please contact your administrator or try again later. + error: Error notify: create-success: Created succesfully. save-success: Saved succesfully. From 8768118aba49cfff0b319a39a1a8d576aa2d411a Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 18 Sep 2020 14:22:54 -0400 Subject: [PATCH 5/8] fix: Error message component lint errors --- ui/core/app/components/error/message.hbs | 4 ++-- ui/core/app/components/error/message.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/core/app/components/error/message.hbs b/ui/core/app/components/error/message.hbs index 54813a844..90c471554 100644 --- a/ui/core/app/components/error/message.hbs +++ b/ui/core/app/components/error/message.hbs @@ -1,5 +1,5 @@ - - {{t (concat "errors." statusCode ".description")}} + + {{t (concat "errors." this.messageCode ".description")}} {{#if this.helpRoute}} {{t "actions.help"}} {{/if}} diff --git a/ui/core/app/components/error/message.js b/ui/core/app/components/error/message.js index 7ae6ca0d1..21b362c5f 100644 --- a/ui/core/app/components/error/message.js +++ b/ui/core/app/components/error/message.js @@ -52,10 +52,10 @@ export default class ErrorMessageComponent extends Message { * @return {string} */ @computed('status') - get statusCode() { - let statusCode = this.status; - if(!statuses.includes(statusCode)) statusCode = 'unknown'; - return statusCode; + get messageCode() { + let messageCode = this.status; + if(!statuses.includes(messageCode)) messageCode = 'unknown'; + return messageCode; } } From 607816a1af2a83236c16c50a77a11ce2226eae66 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 18 Sep 2020 17:01:34 -0400 Subject: [PATCH 6/8] =?UTF-8?q?chore:=20=F0=9F=A4=96=20drop=20in=20new=20b?= =?UTF-8?q?randing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../styles/rose/components/header/_brand.scss | 3 +- ui/core/app/templates/application.hbs | 2 +- ui/core/public/logo-boundary.svg | 69 +++++++++++++++++++ 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 ui/core/public/logo-boundary.svg diff --git a/addons/rose/addon/styles/rose/components/header/_brand.scss b/addons/rose/addon/styles/rose/components/header/_brand.scss index 8d0438285..6da2d2baf 100644 --- a/addons/rose/addon/styles/rose/components/header/_brand.scss +++ b/addons/rose/addon/styles/rose/components/header/_brand.scss @@ -11,8 +11,7 @@ margin: 10px; svg { - // 28px... header sizes do not follow the sizing system - $logoSize: sizing.rems(l) + sizing.rems(xxs); + $logoSize: sizing.rems(xl) * 3; display: block; width: $logoSize; } diff --git a/ui/core/app/templates/application.hbs b/ui/core/app/templates/application.hbs index 2f295e9b4..06a6a4291 100644 --- a/ui/core/app/templates/application.hbs +++ b/ui/core/app/templates/application.hbs @@ -5,7 +5,7 @@ - + {{#if this.session.isAuthenticated}} diff --git a/ui/core/public/logo-boundary.svg b/ui/core/public/logo-boundary.svg new file mode 100644 index 000000000..ea71154fb --- /dev/null +++ b/ui/core/public/logo-boundary.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6c55811631e96b53aa6c2a48e9834ff25e38381c Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sat, 19 Sep 2020 10:05:33 -0400 Subject: [PATCH 7/8] =?UTF-8?q?chore:=20=F0=9F=A4=96=20upgrade=20rose=20to?= =?UTF-8?q?=20ember-source=203.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so that we can use nested components --- addons/rose/index.js | 2 +- addons/rose/package.json | 2 +- yarn.lock | 53 +++------------------------------------- 3 files changed, 5 insertions(+), 52 deletions(-) diff --git a/addons/rose/index.js b/addons/rose/index.js index 73cccf517..6de73c3ca 100644 --- a/addons/rose/index.js +++ b/addons/rose/index.js @@ -7,7 +7,7 @@ var mergeTrees = require('broccoli-merge-trees'); module.exports = { name: require('./package').name, included(app) { - this._super.included(app); + this._super.included.apply(this, arguments); this.includeStyles(app); this.includeIcons(app); diff --git a/addons/rose/package.json b/addons/rose/package.json index 5a8cccc67..fcf5cd228 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -61,7 +61,7 @@ "ember-qunit": "^4.6.0", "ember-radio-button": "^2.0.1", "ember-resolver": "^7.0.0", - "ember-source": "~3.12.0", + "ember-source": "~3.16.0", "ember-source-channel-url": "^2.0.1", "ember-try": "^1.4.0", "ember-uuid": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index 5304e5ace..5fd953ce0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4295,11 +4295,6 @@ ast-types@0.13.3: resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.3.tgz#50da3f28d17bdbc7969a3a2d83a0e4a72ae755a7" integrity sha512-XTZ7xGML849LkQP86sWdQzfhwbt3YwIO6MqbX9mUNYY98VKaaVZP7YNNm70IpwecbkkxmfC5IYAzOQ/2p29zRA== -ast-types@0.9.6: - version "0.9.6" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" - integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk= - astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -8434,7 +8429,7 @@ ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.11.0, ember-cli-babel@^6.12.0, ember-cli-version-checker "^2.1.2" semver "^5.5.0" -ember-cli-babel@^7.1.2, ember-cli-babel@^7.10.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.11.1, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0, ember-cli-babel@^7.19.0, ember-cli-babel@^7.4.1, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.0, ember-cli-babel@^7.7.3: +ember-cli-babel@^7.1.2, ember-cli-babel@^7.10.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.11.1, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0, ember-cli-babel@^7.19.0, ember-cli-babel@^7.4.1, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3: version "7.20.0" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.20.0.tgz#aa77eadd15036a053534fc68f7933bb97c5a1e25" integrity sha512-DwV5Cbn8wlRFpG8zQXxYPRb0NRnnaj/2qVDODeUEjM/doDhoDDbTSSaEI5Pf0kIlkVIimyGB8qpGv1fkgj2IfQ== @@ -9280,13 +9275,6 @@ ember-route-action-helper@^2.0.8: ember-cli-babel "^6.8.1" ember-getowner-polyfill "^2.0.0" -ember-router-generator@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/ember-router-generator/-/ember-router-generator-1.2.3.tgz#8ed2ca86ff323363120fc14278191e9e8f1315ee" - integrity sha1-jtLKhv8yM2MSD8FCeBkeno8TFe4= - dependencies: - recast "^0.11.3" - ember-router-generator@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ember-router-generator/-/ember-router-generator-2.0.0.tgz#d04abfed4ba8b42d166477bbce47fccc672dbde0" @@ -9324,26 +9312,6 @@ ember-source-channel-url@^2.0.1: dependencies: got "^8.0.1" -ember-source@~3.12.0: - version "3.12.3" - resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.12.3.tgz#112462b8c1dfa124c0d021ca7eeeb04b5a5488ca" - integrity sha512-uzyoOVg1ygTY/InjwP0sgIkHiMiRylDauMY9K+vM15WkmmfrMaetklxxnqWThvsL4onBRRW8MKCj+q41Ra/NQQ== - dependencies: - broccoli-funnel "^2.0.2" - broccoli-merge-trees "^3.0.2" - chalk "^2.4.2" - ember-cli-babel "^7.7.0" - ember-cli-get-component-path-option "^1.0.0" - ember-cli-is-package-missing "^1.0.0" - ember-cli-normalize-entity-name "^1.0.0" - ember-cli-path-utils "^1.0.0" - ember-cli-string-utils "^1.1.0" - ember-cli-version-checker "^3.1.3" - ember-router-generator "^1.2.3" - inflection "^1.12.0" - jquery "^3.4.1" - resolve "^1.11.1" - ember-source@~3.16.0: version "3.16.8" resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.16.8.tgz#83f1a55a2b9835b272d7ec5b121a7af490c86725" @@ -9930,11 +9898,6 @@ esprima@~3.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.0.0.tgz#53cf247acda77313e551c3aa2e73342d3fb4f7d9" integrity sha1-U88kes2ncxPlUcOqLnM0LT+099k= -esprima@~3.1.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - esquery@^1.0.1: version "1.3.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" @@ -15667,7 +15630,7 @@ prismjs@~1.17.0: optionalDependencies: clipboard "^2.0.0" -private@^0.1.6, private@^0.1.8, private@~0.1.5: +private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -16488,16 +16451,6 @@ realpath-native@^1.1.0: dependencies: util.promisify "^1.0.0" -recast@^0.11.3: - version "0.11.23" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" - integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM= - dependencies: - ast-types "0.9.6" - esprima "~3.1.0" - private "~0.1.5" - source-map "~0.5.0" - recast@^0.17.3: version "0.17.6" resolved "https://registry.yarnpkg.com/recast/-/recast-0.17.6.tgz#64ae98d0d2dfb10ff92ff5fb9ffb7371823b69fa" @@ -17786,7 +17739,7 @@ source-map@0.4.x, source-map@^0.4.2: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.0, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= From 5d8a6db6b1079d1484134554ba0582fbecd1ec3d Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sat, 19 Sep 2020 10:29:57 -0400 Subject: [PATCH 8/8] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20convert=20card?= =?UTF-8?q?=20components=20to=20nested=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/card/link.js | 7 ------- .../card/link.hbs => components/rose/card/link/index.hbs} | 0 .../rose/card/{link.stories.mdx => link/index.stories.mdx} | 0 addons/rose/addon/components/rose/cards.js | 7 ------- .../rose/cards.hbs => components/rose/cards/index.hbs} | 0 .../rose/{cards.stories.mdx => cards/index.stories.mdx} | 0 6 files changed, 14 deletions(-) delete mode 100644 addons/rose/addon/components/rose/card/link.js rename addons/rose/addon/{templates/components/rose/card/link.hbs => components/rose/card/link/index.hbs} (100%) rename addons/rose/addon/components/rose/card/{link.stories.mdx => link/index.stories.mdx} (100%) delete mode 100644 addons/rose/addon/components/rose/cards.js rename addons/rose/addon/{templates/components/rose/cards.hbs => components/rose/cards/index.hbs} (100%) rename addons/rose/addon/components/rose/{cards.stories.mdx => cards/index.stories.mdx} (100%) diff --git a/addons/rose/addon/components/rose/card/link.js b/addons/rose/addon/components/rose/card/link.js deleted file mode 100644 index 162a08a0e..000000000 --- a/addons/rose/addon/components/rose/card/link.js +++ /dev/null @@ -1,7 +0,0 @@ -import Component from '@ember/component'; -import layout from '../../../templates/components/rose/card/link'; - -export default Component.extend({ - layout, - tagName: '', -}); diff --git a/addons/rose/addon/templates/components/rose/card/link.hbs b/addons/rose/addon/components/rose/card/link/index.hbs similarity index 100% rename from addons/rose/addon/templates/components/rose/card/link.hbs rename to addons/rose/addon/components/rose/card/link/index.hbs diff --git a/addons/rose/addon/components/rose/card/link.stories.mdx b/addons/rose/addon/components/rose/card/link/index.stories.mdx similarity index 100% rename from addons/rose/addon/components/rose/card/link.stories.mdx rename to addons/rose/addon/components/rose/card/link/index.stories.mdx diff --git a/addons/rose/addon/components/rose/cards.js b/addons/rose/addon/components/rose/cards.js deleted file mode 100644 index c54fb638d..000000000 --- a/addons/rose/addon/components/rose/cards.js +++ /dev/null @@ -1,7 +0,0 @@ -import Component from '@ember/component'; -import layout from '../../templates/components/rose/cards'; - -export default Component.extend({ - layout, - tagName: '', -}); diff --git a/addons/rose/addon/templates/components/rose/cards.hbs b/addons/rose/addon/components/rose/cards/index.hbs similarity index 100% rename from addons/rose/addon/templates/components/rose/cards.hbs rename to addons/rose/addon/components/rose/cards/index.hbs diff --git a/addons/rose/addon/components/rose/cards.stories.mdx b/addons/rose/addon/components/rose/cards/index.stories.mdx similarity index 100% rename from addons/rose/addon/components/rose/cards.stories.mdx rename to addons/rose/addon/components/rose/cards/index.stories.mdx