mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fixes #23542 - old error handling was not working when API calls to create/update roles returned an error
This commit is contained in:
parent
aeda9cfec9
commit
ad8dc820c2
2 changed files with 4 additions and 8 deletions
|
@ -44,7 +44,6 @@ interface Props {
|
|||
allowDocumentLevelSecurity: boolean;
|
||||
allowFieldLevelSecurity: boolean;
|
||||
kibanaAppPrivileges: KibanaPrivilege[];
|
||||
notifier: any;
|
||||
spaces?: Space[];
|
||||
spacesEnabled: boolean;
|
||||
userProfile: UserProfile;
|
||||
|
@ -275,7 +274,7 @@ export class EditRolePage extends Component<Props, State> {
|
|||
formError: null,
|
||||
});
|
||||
|
||||
const { httpClient, notifier } = this.props;
|
||||
const { httpClient } = this.props;
|
||||
|
||||
const role = {
|
||||
...this.state.role,
|
||||
|
@ -292,13 +291,13 @@ export class EditRolePage extends Component<Props, State> {
|
|||
this.backToRoleList();
|
||||
})
|
||||
.catch((error: any) => {
|
||||
notifier.error(get(error, 'data.message'));
|
||||
toastNotifications.addDanger(get(error, 'data.message'));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
public handleDeleteRole = () => {
|
||||
const { httpClient, role, notifier } = this.props;
|
||||
const { httpClient, role } = this.props;
|
||||
|
||||
deleteRole(httpClient, role.name)
|
||||
.then(() => {
|
||||
|
@ -306,7 +305,7 @@ export class EditRolePage extends Component<Props, State> {
|
|||
this.backToRoleList();
|
||||
})
|
||||
.catch((error: any) => {
|
||||
notifier.error(get(error, 'data.message'));
|
||||
toastNotifications.addDanger(get(error, 'data.message'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -91,8 +91,6 @@ routes.when(`${EDIT_ROLES_PATH}/:name?`, {
|
|||
const $route = $injector.get('$route');
|
||||
const Private = $injector.get('Private');
|
||||
|
||||
const Notifier = $injector.get('Notifier');
|
||||
|
||||
const role = $route.current.locals.role;
|
||||
|
||||
const xpackInfo = Private(XPackInfoProvider);
|
||||
|
@ -139,7 +137,6 @@ routes.when(`${EDIT_ROLES_PATH}/:name?`, {
|
|||
httpClient={$http}
|
||||
allowDocumentLevelSecurity={allowDocumentLevelSecurity}
|
||||
allowFieldLevelSecurity={allowFieldLevelSecurity}
|
||||
notifier={Notifier}
|
||||
spaces={spaces}
|
||||
spacesEnabled={enableSpaceAwarePrivileges}
|
||||
userProfile={userProfile}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue