diff --git a/addons/auth/addon/authenticators/password.js b/addons/auth/addon/authenticators/password.js index 814fffc22..7403eae65 100644 --- a/addons/auth/addon/authenticators/password.js +++ b/addons/auth/addon/authenticators/password.js @@ -64,7 +64,7 @@ export default class PasswordAuthenticator extends BaseAuthenticator { case 404: return reject(); } - return resolve(data); + return resolve(this.normalizeData(data)); } /** @@ -93,7 +93,20 @@ export default class PasswordAuthenticator extends BaseAuthenticator { const authEndpointURL = this.buildAuthEndpointURL(options); const response = await fetch(authEndpointURL, { method: 'post', body }); const json = await response.json(); - return response.status < 400 ? resolve(json) : reject(); + return response.status < 400 ? resolve(this.normalizeData(json)) : reject(); + } + + /** + * Normalizes the auth data. Adds convenience booleans depending on the + * scope within which the session is authenticated: isGlobal, isOrg. + * @param {object} data + * @return {object} + */ + normalizeData(data) { + // Add booleans indicated the scope type + data.isGlobal = (data?.scope?.type === 'global'); + data.isOrg = (data?.scope?.type === 'org'); + return data; } /** diff --git a/addons/rose/addon/styles/rose/components/dropdown/_button.scss b/addons/rose/addon/styles/rose/components/dropdown/_button.scss index 2fe195562..b15bb016e 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_button.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_button.scss @@ -6,8 +6,7 @@ display: block; box-sizing: border-box; width: 100%; - // Targeting min-width of ~200 - min-width: (sizing.rems(m)) * 10; + min-width: (sizing.rems(m)) * 13; border: 0; padding: 0 sizing.rems(s); text-decoration: none; diff --git a/addons/rose/addon/styles/rose/components/dropdown/_link.scss b/addons/rose/addon/styles/rose/components/dropdown/_link.scss index 6fd5d039f..695b2e4ba 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_link.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_link.scss @@ -6,8 +6,7 @@ display: block; box-sizing: border-box; width: 100%; - // Targeting min-width of ~200 - min-width: (sizing.rems(m)) * 10; + min-width: (sizing.rems(m)) * 13; border: 0; padding: 0 sizing.rems(s); text-decoration: none; diff --git a/addons/rose/addon/styles/rose/components/header/_brand.scss b/addons/rose/addon/styles/rose/components/header/_brand.scss index 6da2d2baf..48de3e6b7 100644 --- a/addons/rose/addon/styles/rose/components/header/_brand.scss +++ b/addons/rose/addon/styles/rose/components/header/_brand.scss @@ -11,9 +11,9 @@ margin: 10px; svg { - $logoSize: sizing.rems(xl) * 3; + //$logoSize: sizing.rems(xl) * 3; display: block; - width: $logoSize; + //width: $logoSize; } .rose-header-brand-text { diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js index 2cbe96d88..ef8aa1273 100644 --- a/ui/core/app/routes/scopes/scope.js +++ b/ui/core/app/routes/scopes/scope.js @@ -38,6 +38,8 @@ export default class ScopesScopeRoute extends Route { * Set scope in application controller */ afterModel() { + const orgScopes = this.modelFor('scopes').filterBy('isOrg', true); + this.controllerFor('application').set('orgScopes', orgScopes); const scope = this.modelFor('scopes.scope'); this.controllerFor('application').set('scope', scope); } diff --git a/ui/core/app/styles/app.scss b/ui/core/app/styles/app.scss index db40fbf45..108e7c619 100644 --- a/ui/core/app/styles/app.scss +++ b/ui/core/app/styles/app.scss @@ -63,6 +63,16 @@ .rose-header { position: relative; + .logotype { + display: none; + } + + .rose-dropdown { + .rose-icon { + transform: scale(0.7); + } + } + &.loading { &::after { animation: gradient 1s linear infinite; diff --git a/ui/core/app/templates/application.hbs b/ui/core/app/templates/application.hbs index a40b1dcba..80472c19a 100644 --- a/ui/core/app/templates/application.hbs +++ b/ui/core/app/templates/application.hbs @@ -6,16 +6,34 @@ + {{#if this.session.isAuthenticated}} - - {{#if this.scope.isOrg}} - {{this.scope.displayName}} - {{/if}} - + {{#if this.scope.isOrg}} + + + {{#if this.session.data.authenticated.isGlobal}} + + {{t "titles.global"}} + + {{#each this.orgScopes as |scope|}} + + {{scope.displayName}} + + {{/each}} + {{else}} + + {{this.scope.displayName}} + + {{/if}} + + + {{/if}} @@ -29,7 +47,9 @@ + {{/if}} + diff --git a/ui/core/public/logo-boundary.svg b/ui/core/public/logo-boundary.svg index 21465bdef..3e65e7870 100644 --- a/ui/core/public/logo-boundary.svg +++ b/ui/core/public/logo-boundary.svg @@ -1,9 +1,33 @@ + viewBox="0 0 67 67"> - + + + + + + + + + + + + @@ -43,26 +67,5 @@ fill="#ffffff" 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"> - - - - - - - - -