Merge pull request #838 from hashicorp/feature-list-managed-groups

Add managed-groups basic list route to admin
This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2021-11-10 07:09:15 -08:00
commit 6bedc710d3
11 files changed
+97 -1

No files matched your search

@@ -351,3 +351,6 @@ scope:
title_plural: Scopes
messages:
cannot_read: While you do not have permission to read this scope, you may have permission to view resources within it.
managed-group:
title: Managed Group
title_plural: Managed Groups
+1
View File
@@ -55,6 +55,7 @@ Router.map(function () {
});
this.route('new');
});
this.route('managed-groups', function () {});
});
this.route('new');
});
@@ -0,0 +1,13 @@
import Route from '@ember/routing/route';
export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends Route {
/**
*
* @returns {Promise{[ManagedGroupsModel]}}
*/
model() {
const authMethod = this.modelFor('scopes.scope.auth-methods.auth-method');
const { id: auth_method_id } = authMethod;
return this.store.query('managed-group', { auth_method_id });
}
}
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';
export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsIndexRoute extends Route {}
@@ -8,4 +8,10 @@
{{t 'resources.account.title_plural'}}
</nav.link>
{{/if}}
{{#if (feature-flag 'managed-groups')}}
<nav.link @route='scopes.scope.auth-methods.auth-method.managed-groups'>
{{t 'resources.managed-group.title_plural'}}
</nav.link>
{{/if}}
</Rose::Nav::Tabs>
@@ -1,5 +1,4 @@
{{#if @model}}
{{! OIDC accounts display more fields }}
{{#if @model.firstObject.isOIDC}}
<Rose::Table as |table|>
@@ -0,0 +1,3 @@
{{page-title (t 'resources.managed-group.title_plural')}}
{{outlet}}
@@ -0,0 +1,33 @@
{{#if @model}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.description.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model as |managed-group|}}
<body.row as |row|>
<row.headerCell>{{managed-group.name}}</row.headerCell>
<row.cell>{{managed-group.description}}</row.cell>
<row.cell>
<Rose::Badge>{{managed-group.type}}</Rose::Badge>
</row.cell>
<row.cell>
<Copyable
@text={{managed-group.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{managed-group.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{/if}}
+3
View File
@@ -96,6 +96,7 @@ module.exports = function (environment) {
filter: false,
capabilities: true,
'credential-store': true,
'managed-groups': false,
},
};
@@ -133,6 +134,7 @@ module.exports = function (environment) {
// Enable features in development
ENV.featureFlags['capabilities'] = true;
ENV.featureFlags['filter'] = true;
ENV.featureFlags['managed-groups'] = true;
}
if (environment === 'test') {
@@ -159,6 +161,7 @@ module.exports = function (environment) {
// Enable tests for development features
ENV.featureFlags['capabilities'] = true;
ENV.featureFlags['filter'] = true;
ENV.featureFlags['managed-groups'] = true;
}
if (environment === 'production') {
@@ -0,0 +1,16 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module(
'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups',
function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/auth-methods/auth-method/managed-groups'
);
assert.ok(route);
});
}
);
@@ -0,0 +1,16 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module(
'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups/index',
function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/auth-methods/auth-method/managed-groups/index'
);
assert.ok(route);
});
}
);