chore: Managed groups edit integration fix
This commit is contained in:
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'
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+5
-1
@@ -1 +1,5 @@
|
||||
<Form::ManagedGroup @model={{@model}} />
|
||||
<Form::ManagedGroup
|
||||
@model={{@model}}
|
||||
@submit={{route-action 'save' @model}}
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
/>
|
||||
Reference in new issue
Block a user