chore: 🤖 merge develop

This commit is contained in:
Randall Morey committed 2020-09-21 13:40:24 -04:00
commit e53419efda
18 files changed
+215 -80

No files matched your search

@@ -1,7 +0,0 @@
import Component from '@ember/component';
import layout from '../../../templates/components/rose/card/link';
export default Component.extend({
layout,
tagName: '',
});
@@ -1,7 +0,0 @@
import Component from '@ember/component';
import layout from '../../templates/components/rose/cards';
export default Component.extend({
layout,
tagName: '',
});
@@ -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;
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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",
+6
View File
@@ -0,0 +1,6 @@
<Rose::Message @title={{t (concat "errors." this.messageCode ".title")}} @subtitle={{concat (t "errors.titles.error") " " this.status}} @icon={{this.icon}} as |message|>
<message.description>{{t (concat "errors." this.messageCode ".description")}}</message.description>
{{#if this.helpRoute}}
<message.link @route={{this.helpRoute}}>{{t "actions.help"}}</message.link>
{{/if}}
</Rose::Message>
+61
View File
@@ -0,0 +1,61 @@
import Message from 'rose/components/rose/message';
import { computed } from '@ember/object';
/*
* 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 statuses = ['401', '403', '404', '500'];
export default class ErrorMessageComponent extends Message {
// =methods
/**
* Returns an icon for error status.
* @return {string}
*/
@computed('status')
get icon() {
switch (this.status) {
case '401':
case '403':
return 'disabled';
case '404':
return 'help-circle-outline';
default:
return 'alert-circle-outline';
}
}
// TODO: Enable when help documentation can be linked in.
/**
* Returns an route string for help text in message.
* @return {string}
*/
// get helpRoute() {
// return 'index'
// }
/**
* Returns 'unknown' status code when provided error status
* isn't part of predefined statuses.
* @return {string}
*/
@computed('status')
get messageCode() {
let messageCode = this.status;
if(!statuses.includes(messageCode)) messageCode = 'unknown';
return messageCode;
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<layout.header>
<Rose::Header as |header|>
<header.brand @logo="logo-hashi" @text={{app-name}} />
<header.brand @logo="logo-boundary" @text={{app-name}} />
{{#if this.session.isAuthenticated}}
<header.utilities as |utilities|>
@@ -0,0 +1,6 @@
{{title (t "errors.titles.error") }}
<Rose::Layout::Centered>
{{#each @model.errors as |error|}}
<Error::Message @status={{error.status}}/>
{{/each}}
</Rose::Layout::Centered>
+13
View File
@@ -326,4 +326,17 @@ export default function() {
return session.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.',
// }]
// }));
}
+69
View File
@@ -0,0 +1,69 @@
<svg
height="30"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 310 67">
<defs><style>.cls-1{fill:#fff;}.cls-2{fill:#f04e54;}</style></defs>
<g id="LOGOS">
<path
class="cls-1"
d="M104.58,32.17c3.08-1.33,4.48-3.21,4.48-6.54V21.45c0-5.44-3.09-8.59-10.72-8.59H82.5v40.3H99.44c7.32,0,11-3.57,11-9.26V39.61C110.45,35.67,108.27,33,104.58,32.17Zm-14.46-13h7.32c2.78,0,4,1,4,3.27V26c0,2.36-1.08,3.76-4.05,3.76H90.12Zm12.71,23.78c0,3-1.46,3.94-4.91,3.94h-7.8v-11h8.47c3,0,4.24,1.33,4.24,4Z">
</path>
<path
class="cls-1"
d="M126.48,23.09c-10.1,0-12.82,5.56-12.82,11.62v7.44c0,6.05,2.72,11.61,12.82,11.61s12.83-5.56,12.83-11.61V34.71C139.31,28.65,136.58,23.09,126.48,23.09Zm5.45,19.3c0,3.33-1.51,5.08-5.45,5.08S121,45.72,121,42.39V34.47c0-3.34,1.51-5.09,5.44-5.09s5.45,1.75,5.45,5.09Z">
</path>
<path
class="cls-1"
d="M161.46,23.69V44.15c-2.67,1.39-5.88,2.48-7.69,2.48s-2.36-.79-2.36-2.37V23.69H144V45.05c0,5.27,1.75,8.71,6.65,8.71a29.59,29.59,0,0,0,11.8-3.08l.73,2.48h5.63V23.69Z">
</path>
<path
class="cls-1"
d="M193.34,23.09a29.59,29.59,0,0,0-11.8,3.08l-.72-2.48h-5.63V53.16h7.38V32.71c2.66-1.39,5.87-2.48,7.68-2.48s2.36.79,2.36,2.36V53.16H200V31.8C200,26.54,198.24,23.09,193.34,23.09Z">
</path>
<path
class="cls-1"
d="M222.44,11.66V23.94a41,41,0,0,0-7.87-.85c-6.83,0-9.73,3.87-9.73,10.41v10c0,6.72,3.14,10.22,9.07,10.22a15.48,15.48,0,0,0,9.32-3.08l.72,2.48h5.87V10.63Zm0,33.15a10.43,10.43,0,0,1-6.59,2.66c-2.73,0-3.63-1.33-3.63-3.75V33.32c0-2.67,1-3.94,3.69-3.94a33,33,0,0,1,6.53.79Z">
</path>
<path
class="cls-1"
d="M245.74,23.09a38.76,38.76,0,0,0-10.11,1.39l.91,5.63a40.74,40.74,0,0,1,8.17-.91c4.71,0,5.62,1.15,5.62,4.42V36.7h-7.07c-6,0-8.6,2.3-8.6,8.29,0,5.09,2.3,8.77,7.69,8.77a16.06,16.06,0,0,0,8.77-2.6l.54,2h6.06V33.74C257.72,26.35,255,23.09,245.74,23.09Zm4.59,23.29a11.57,11.57,0,0,1-5.56,1.51c-2.3,0-3-.9-3-3,0-2.24.67-2.9,3.09-2.9h5.44Z">
</path>
<path
class="cls-1"
d="M277.92,23.09A33,33,0,0,0,270.18,27l-.48-3.27h-6.24V53.16h7.39v-19a56,56,0,0,1,7.8-4.29Z">
</path>
<path
class="cls-1"
d="M300.61,23.69l-6.77,22.39-6.72-22.39h-7.56l9.32,29.47h2.59l-3.68,11.92h7l3.93-11.92,9.44-29.47Z">
</path>
<polygon
class="cls-2"
points="9.89 64.1 9.89 59.28 19.9 59.28 19.9 56.3 15.05 56.3 15.05 51.45 37.97 51.45 27.32 33.01 37.97 14.57 14.47 14.57 14.47 40.15 1.82 40.15 1.82 1.92 45.34 1.92 52.61 14.5 41.92 33.01 52.83 51.9 45.78 64.1 9.89 64.1">
</polygon>
<rect
class="cls-2"
x="6.98"
y="51.45"
width="4.85"
height="4.85">
</rect>
<rect
class="cls-2"
x="1.82"
y="59.25"
width="4.85"
height="4.85">
</rect>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

@@ -0,0 +1,37 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | error/message', function (hooks) {
setupRenderingTest(hooks);
test('it renders predefined message for known error status', async function (assert) {
await render(hbs`<Error::Message @status='401' />`);
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.'
);
});
test('it renders default error for unknown error status', async function (assert) {
await render(hbs`<Error::Message @status='599' />`);
assert.equal(
find('.rose-message-title').textContent.trim(),
'Something went wrong'
);
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.'
);
});
});
+16 -11
View File
@@ -165,19 +165,24 @@ form:
started: Started
status: Status
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
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.
+3 -50
View File
@@ -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==
@@ -9289,13 +9284,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"
@@ -9333,26 +9321,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"
@@ -9939,11 +9907,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"
@@ -15676,7 +15639,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==
@@ -16497,16 +16460,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"
@@ -17795,7 +17748,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=