diff --git a/addons/rose/addon/styles/rose/components/form/_input.scss b/addons/rose/addon/styles/rose/components/form/_input.scss index 6c0186b50..7b11a0a8e 100644 --- a/addons/rose/addon/styles/rose/components/form/_input.scss +++ b/addons/rose/addon/styles/rose/components/form/_input.scss @@ -19,6 +19,7 @@ .rose-form-input-field { @include type.type(m); + box-sizing: border-box; margin-bottom: sizing.rems(xs); padding: sizing.rems(xs); color: var(--stark); diff --git a/addons/rose/addon/styles/rose/variables/_media.scss b/addons/rose/addon/styles/rose/variables/_media.scss index 289c96ad9..95d1ab86d 100644 --- a/addons/rose/addon/styles/rose/variables/_media.scss +++ b/addons/rose/addon/styles/rose/variables/_media.scss @@ -9,7 +9,7 @@ $width-breakpoints: ( xlarge: 1200px, large: 1024px, medium: 768px, - small: 480px, + small: 540px, xsmall: 320px, ); diff --git a/ui/core/app/authenticators/password.js b/ui/core/app/authenticators/password.js index 3224130a3..41e75d078 100644 --- a/ui/core/app/authenticators/password.js +++ b/ui/core/app/authenticators/password.js @@ -38,7 +38,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator { * @param {string} scopeID * @return {string} */ - buildDeauthEndpointURL({ scope: { id: scopeID } }) { + buildDeauthEndpointURL({ org_id: scopeID }) { const adapter = this.store.adapterFor('application'); const options = { adapterOptions: { method: 'deauthenticate' } }; return adapter.buildURL('scope', scopeID, options, 'findRecord'); diff --git a/ui/core/app/controllers/scopes/scope.js b/ui/core/app/controllers/scopes/scope.js new file mode 100644 index 000000000..5bc636752 --- /dev/null +++ b/ui/core/app/controllers/scopes/scope.js @@ -0,0 +1,10 @@ +import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; + +export default class ScopesScopeController extends Controller { + + // =services + + @service session; + +} diff --git a/ui/core/app/router.js b/ui/core/app/router.js index 3c95ac355..ef3536c60 100644 --- a/ui/core/app/router.js +++ b/ui/core/app/router.js @@ -18,7 +18,6 @@ Router.map(function () { this.route('new'); }); }); - this.route('cope'); }); this.route('orgs', function () { diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js index c9ecb358f..939ef5076 100644 --- a/ui/core/app/routes/scopes/scope.js +++ b/ui/core/app/routes/scopes/scope.js @@ -23,5 +23,4 @@ export default class ScopesScopeRoute extends Route { return maybeExistingScope || this.store.createRecord('scope', { id }); }); } - } diff --git a/ui/core/app/templates/scopes/scope.hbs b/ui/core/app/templates/scopes/scope.hbs index 2d1a73607..172eefc48 100644 --- a/ui/core/app/templates/scopes/scope.hbs +++ b/ui/core/app/templates/scopes/scope.hbs @@ -1,32 +1,33 @@ - + {{#if this.session.isAuthenticated}} + + + + {{t "resources.projects"}} + + - - - {{t "resources.projects"}} - - + {{outlet "sidebar"}} - {{outlet "sidebar"}} - - {{!-- - - - {{t "resources.users"}} - - - {{t "resources.groups"}} - + {{!-- + + + {{t "resources.users"}} + - - {{t "resources.roles"}} - - - --}} + + {{t "resources.groups"}} + - + + {{t "resources.roles"}} + + + --}} + + {{/if}}
diff --git a/ui/core/app/templates/scopes/scope/authenticate.hbs b/ui/core/app/templates/scopes/scope/authenticate.hbs index e2147cab0..43b329188 100644 --- a/ui/core/app/templates/scopes/scope/authenticate.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate.hbs @@ -1 +1,54 @@ -{{outlet}} \ No newline at end of file +{{title (t "actions.authenticate")}} + + + + + +

{{t "actions.authenticate"}}

+

{{t "auth.descriptions.authenticating-with-org" name=@model.scope.displayName}}

+
+ + + + + {{#each @model.scopes as |scope|}} + + {{scope.displayName}} + + {{/each}} + + + + + + {{#each @model.authMethods as |authMethod|}} + + {{t (concat "auth.method-types." authMethod.type)}} + + {{/each}} + + + + + {{#if @model.authMethods}} + {{outlet}} + {{/if}} + {{#unless @model.authMethods}} + + + + {{t "auth.descriptions.no-methods"}} + + + + {{/unless}} + + +
+
diff --git a/ui/core/app/templates/scopes/scope/authenticate/index.hbs b/ui/core/app/templates/scopes/scope/authenticate/index.hbs index e2147cab0..22cc46f4e 100644 --- a/ui/core/app/templates/scopes/scope/authenticate/index.hbs +++ b/ui/core/app/templates/scopes/scope/authenticate/index.hbs @@ -1 +1,12 @@ -{{outlet}} \ No newline at end of file +{{#unless @model}} + + + + {{t "auth.descriptions.no-methods"}} + + + +{{/unless}} diff --git a/ui/core/app/templates/scopes/scope/index.hbs b/ui/core/app/templates/scopes/scope/index.hbs index e2147cab0..c24cd6895 100644 --- a/ui/core/app/templates/scopes/scope/index.hbs +++ b/ui/core/app/templates/scopes/scope/index.hbs @@ -1 +1 @@ -{{outlet}} \ No newline at end of file +{{outlet}} diff --git a/ui/core/mirage/scenarios/default.js b/ui/core/mirage/scenarios/default.js index 9b498425a..1bbae80d5 100644 --- a/ui/core/mirage/scenarios/default.js +++ b/ui/core/mirage/scenarios/default.js @@ -10,6 +10,17 @@ export default function(server) { const scope = { id: orgScope.id, type: orgScope.type }; + // Create additional scopes for authentication organization selection + server.create('scope', { + type: 'org', + scope: { id: globalScope.id, type: globalScope.type } + }, 'withChildren'); + + server.create('scope', { + type: 'org', + scope: { id: globalScope.id, type: globalScope.type } + }, 'withChildren'); + // Auth // Auth methods exist both at the global scope and the org scope. diff --git a/ui/core/tests/unit/controllers/scopes/scope-test.js b/ui/core/tests/unit/controllers/scopes/scope-test.js new file mode 100644 index 000000000..ec2c389bb --- /dev/null +++ b/ui/core/tests/unit/controllers/scopes/scope-test.js @@ -0,0 +1,12 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Controller | scopes/scope', function(hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function(assert) { + let controller = this.owner.lookup('controller:scopes/scope'); + assert.ok(controller); + }); +}); diff --git a/ui/core/translations/en-us.yaml b/ui/core/translations/en-us.yaml index e770de25c..e4af341c7 100644 --- a/ui/core/translations/en-us.yaml +++ b/ui/core/translations/en-us.yaml @@ -4,6 +4,21 @@ actions: dismiss: Dismiss save: Save help: Need help? + authenticate: Authenticate + deauthenticate: Deauthenticate + choose-org: Choose Org + choose-different-org: Choose a Different Org +auth: + titles: + no-orgs: No Organizations Available + no-methods: No Authentication Method + descriptions: + no-orgs: No organizations were found. To authenticate, ask your administrator to create an organization and grant you access. + no-methods: No authentication methods were found for this organization. Switch organizations and try again. + choose-org: Choose an organization to authenticate. + authenticating-with-org: "You're authenticating with {name}." + method-types: + password: Password resources: user: User users: Users @@ -46,6 +61,8 @@ form: name: Name description: Description type: Type + identification: Username + password: Password errors: titles: unauthenticated-error: You are not signed in