Merge pull request #854 from hashicorp/feature-managed-groups-edit

Managed Groups Edit Integration
This commit is contained in:
Susmitha Girumala authored and GitHub committed 2021-11-11 18:11:56 -05:00
commit ff5cc71f60
5 files changed
+26 -7

No files matched your search

@@ -1,3 +1,10 @@
import ApplicationSerializer from './application';
export default class ManagedGroupSerializer extends ApplicationSerializer {}
export default class ManagedGroupSerializer extends ApplicationSerializer {
// =properties
/**
* @type {boolean}
*/
serializeScopeID = false;
}
@@ -0,0 +1 @@
export { default } from 'api/serializers/managed-group';
@@ -56,9 +56,16 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
)
async save(managedGroup) {
await managedGroup.save();
await this.transitionTo(
'scopes.scope.auth-methods.auth-method.managed-groups'
);
if (this.can.can('read model', managedGroup)) {
await this.transitionTo(
'scopes.scope.auth-methods.auth-method.managed-groups.managed-group',
managedGroup
);
} else {
await this.transitionTo(
'scopes.scope.auth-methods.auth-method.managed-groups'
);
}
this.refresh();
}
@@ -71,7 +78,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
@confirm('questions.delete-confirm')
@notifyError(({ message }) => message, { catch: true })
@notifySuccess('notifications.delete-success')
async deleteManagedGroup(managedGroup) {
async delete(managedGroup) {
await managedGroup.destroyRecord();
await this.replaceWith(
'scopes.scope.auth-methods.auth-method.managed-groups'
@@ -7,7 +7,7 @@
<dropdown.button
@style='danger'
@disabled={{@model.canSave}}
{{on 'click' (route-action 'deleteManagedGroup' @model)}}
{{on 'click' (route-action 'delete' @model)}}
>
{{t 'resources.managed-group.actions.delete'}}
</dropdown.button>
@@ -1 +1,5 @@
<Form::ManagedGroup @model={{@model}} />
<Form::ManagedGroup
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>