mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactor(webapp): invite and user form with new blueprintjs-formik components
This commit is contained in:
@@ -22,6 +22,14 @@ function UsersDataTable({
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
}) {
|
||||
const { mutateAsync: resendInviation } = useResendInvitation();
|
||||
|
||||
// Users list columns.
|
||||
const columns = useUsersListColumns();
|
||||
|
||||
// Users list context.
|
||||
const { users, isUsersLoading, isUsersFetching } = useUsersListContext();
|
||||
|
||||
// Handle edit user action.
|
||||
const handleEditUserAction = useCallback(
|
||||
(user) => {
|
||||
@@ -50,9 +58,6 @@ function UsersDataTable({
|
||||
},
|
||||
[openAlert],
|
||||
);
|
||||
|
||||
const { mutateAsync: resendInviation } = useResendInvitation();
|
||||
|
||||
const handleResendInvitation = useCallback((user) => {
|
||||
resendInviation(user.id)
|
||||
.then(() => {
|
||||
@@ -71,17 +76,12 @@ function UsersDataTable({
|
||||
AppToaster.show({
|
||||
message:
|
||||
'This person was recently invited. No need to invite them again just yet.',
|
||||
intent: Intent.DANGER,
|
||||
intent: Intent.WARNING,
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
// Users list columns.
|
||||
const columns = useUsersListColumns();
|
||||
|
||||
// Users list context.
|
||||
const { users, isUsersLoading, isUsersFetching } = useUsersListContext();
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
|
||||
@@ -132,15 +132,9 @@ export const useUsersListColumns = () => {
|
||||
{
|
||||
id: 'role_name',
|
||||
Header: intl.get('users.column.role_name'),
|
||||
accessor: 'role.name',
|
||||
accessor: 'role_name',
|
||||
width: 120,
|
||||
},
|
||||
// {
|
||||
// id: 'phone_number',
|
||||
// Header: intl.get('phone_number'),
|
||||
// accessor: 'phone_number',
|
||||
// width: 120,
|
||||
// },
|
||||
{
|
||||
id: 'status',
|
||||
Header: intl.get('status'),
|
||||
|
||||
Reference in New Issue
Block a user