-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reactify users roles #20739
Merged
Merged
Reactify users roles #20739
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
1d209ca
partial progress on reactifying users
bmcconaghy 0b9f706
progress on EUIfication of users screen
bmcconaghy a8b6aa0
removing Angular stuff
bmcconaghy 3f2111c
adding data-test-subj="passwordConfirmationInput"
bmcconaghy 3dfc4e9
removing data-test-subj="userFormEmailInput" refs from tests
bmcconaghy 6ae9785
fixing selector for role assignment
bmcconaghy aba4df5
Merge branch 'master' of github.com:elastic/kibana into reactify_user…
bmcconaghy 1cdd642
some functional test fixes
bmcconaghy a6b9f0c
Merge branch 'master' of github.com:elastic/kibana into reactify_user…
bmcconaghy 0645315
fixing some functional tests
bmcconaghy a75d9f3
fixing last functional test
bmcconaghy 0e95c45
removing stray console log
bmcconaghy 29e5537
fixing warnings
bmcconaghy 89ae92a
attempting to fix flaky test
bmcconaghy 8c90d9c
trying again to fix flaky test
bmcconaghy f76a77c
PR feedback
bmcconaghy 4f9ab79
PR feedback
bmcconaghy 74cb8b4
fixing issue where form tried to submit
bmcconaghy 4c72e45
adding sleep to allow user to load
bmcconaghy fb4f27e
Design edits
cchaos 5819a4e
Fixed console error and added responsive prop to table
cchaos ed1040a
Merge pull request #1 from cchaos/bmcconaghy_reactify_users_roles
bmcconaghy 8f73767
addressing PR feedback
bmcconaghy f12db47
Merge branch 'master' of github.com:elastic/kibana into reactify_user…
bmcconaghy b1d41ac
A few more PR feedback
cchaos b4495d9
Merge pull request #2 from cchaos/bmcconaghy_reactify_users_roles
bmcconaghy f8afe3b
addressing more PR feedback
bmcconaghy 8480f43
Merge branch 'master' of github.com:elastic/kibana into reactify_user…
bmcconaghy 9624a2b
adding email field back in
bmcconaghy 61428b0
adding back username validation
bmcconaghy 70c0efc
restoring original error message
bmcconaghy f1bc298
fixing dumb null error
bmcconaghy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
x-pack/plugins/security/public/components/management/users/confirm_delete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { Component, Fragment } from 'react'; | ||
import { EuiOverlayMask, EuiConfirmModal } from '@elastic/eui'; | ||
import { toastNotifications } from 'ui/notify'; | ||
export class ConfirmDelete extends Component { | ||
deleteUsers = () => { | ||
const { usersToDelete, apiClient, callback } = this.props; | ||
const errors = []; | ||
usersToDelete.forEach(async username => { | ||
try { | ||
await apiClient.deleteUser(username); | ||
toastNotifications.addSuccess(`Deleted user ${username}`); | ||
} catch (e) { | ||
errors.push(username); | ||
toastNotifications.addDanger(`Error deleting user ${username}`); | ||
} | ||
if (callback) { | ||
callback(usersToDelete, errors); | ||
} | ||
}); | ||
}; | ||
render() { | ||
const { usersToDelete, onCancel } = this.props; | ||
const moreThanOne = usersToDelete.length > 1; | ||
const title = moreThanOne | ||
? `Delete ${usersToDelete.length} users` | ||
: `Delete user '${usersToDelete[0]}'`; | ||
return ( | ||
<EuiOverlayMask> | ||
<EuiConfirmModal | ||
title={title} | ||
onCancel={onCancel} | ||
onConfirm={this.deleteUsers} | ||
cancelButtonText="Cancel" | ||
confirmButtonText="Delete" | ||
buttonColor="danger" | ||
> | ||
<div> | ||
{moreThanOne ? ( | ||
<Fragment> | ||
<p> | ||
You are about to delete these users: | ||
</p> | ||
<ul>{usersToDelete.map(username => <li key={username}>{username}</li>)}</ul> | ||
</Fragment> | ||
) : null} | ||
<p>This operation cannot be undone.</p> | ||
</div> | ||
</EuiConfirmModal> | ||
</EuiOverlayMask> | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cchaos This modal looks like it's missing
flex-direction: column
. I reinstalled the dependencies. Is anyone else seeing this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will be fixed by the followup PR updating EUI in X-Pack.