diff --git a/ui/core/app/routes/orgs/org/users.js b/ui/core/app/routes/orgs/org/users.js index c4dacd2f6..7833312e3 100644 --- a/ui/core/app/routes/orgs/org/users.js +++ b/ui/core/app/routes/orgs/org/users.js @@ -1,4 +1,13 @@ import Route from '@ember/routing/route'; export default class OrgsOrgUsersRoute extends Route { + // =methods + + /** + * Returns all users from the store. + * @return {Promise[UserModel]} + */ + model() { + return this.store.findAll('user'); + } } diff --git a/ui/core/app/templates/orgs/org/users.hbs b/ui/core/app/templates/orgs/org/users.hbs index e2147cab0..67ccbeb9e 100644 --- a/ui/core/app/templates/orgs/org/users.hbs +++ b/ui/core/app/templates/orgs/org/users.hbs @@ -1 +1,3 @@ -{{outlet}} \ No newline at end of file +{{title (t "resources.users")}} + +{{outlet}} diff --git a/ui/core/app/templates/orgs/org/users/index.hbs b/ui/core/app/templates/orgs/org/users/index.hbs index e2147cab0..fe38c0c7f 100644 --- a/ui/core/app/templates/orgs/org/users/index.hbs +++ b/ui/core/app/templates/orgs/org/users/index.hbs @@ -1 +1,63 @@ -{{outlet}} \ No newline at end of file + + + + + + + +

{{t "resources.users"}}

+
+ + + {{#if @model}} + {{t 'titles.new'}} + {{/if}} + + + + + {{#if @model}} + + + + + {{t 'form.label.name'}} + {{t 'form.label.description'}} + + + + {{#each @model as |user|}} + + + + {{user.name}} + + + {{user.description}} + + {{/each}} + + + + {{else}} + + + + + {{t 'descriptions.users-welcome'}} + + + + {{t 'titles.new'}} + + + + + {{/if}} + + + +
diff --git a/ui/core/mirage/config.js b/ui/core/mirage/config.js index 247fc6f36..f6dd9bf6d 100644 --- a/ui/core/mirage/config.js +++ b/ui/core/mirage/config.js @@ -40,6 +40,14 @@ export default function() { this.patch('/orgs/:org_id/auth-methods/:id'); this.del('/orgs/:org_id/auth-methods/:id'); + // IAM : Users + + this.get('/orgs/:org_id/users'); + this.post('/orgs/:org_id/users'); + this.get('/orgs/:org_id/users/:id'); + this.patch('/orgs/:org_id/users/:id'); + this.del('/orgs/:org_id/users/:id'); + // Other resources // host-catalog diff --git a/ui/core/mirage/factories/user.js b/ui/core/mirage/factories/user.js index 6c0997f8f..77ed8e69d 100644 --- a/ui/core/mirage/factories/user.js +++ b/ui/core/mirage/factories/user.js @@ -1,3 +1,3 @@ -import { Factory } from 'ember-cli-mirage'; +import factory from '../generated/factories/user'; -export default Factory.extend(); +export default factory.extend(); diff --git a/ui/core/translations/en-us.yaml b/ui/core/translations/en-us.yaml index 29ba0c47f..9b925155f 100644 --- a/ui/core/translations/en-us.yaml +++ b/ui/core/translations/en-us.yaml @@ -5,6 +5,8 @@ actions: save: Save help: Need help? resources: + user: User + users: Users projects: Projects project: Project host-catalog: Host Catalog @@ -16,11 +18,13 @@ titles: empty-set: No Items Yet projects-welcome: Welcome to Projects host-catalogs-welcome: Welcome to Host Catalogs + users-welcome: Welcome to Users descriptions: host-catalogs: Overview of collections of hosts and host sets. empty-set: There are no items to display yet. You may be able to add items or try back later. projects-welcome: Projects allow you to create and manage host catalogs. To start, create a project. host-catalogs-welcome: Host catalogs allow you to configure to collect and create hosts and host sets. To start, create a host catalog. + users-welcome: Users are authorized to access Watchtower. states: info: Info success: Success