fix-Update minor UI changes
This commit is contained in:
parent
e02242ff59
commit
4e9685b8d5
|
|
@ -7,6 +7,9 @@ import { isPermitted } from "pages/Applications/permissionHelpers";
|
||||||
const StyledDialog = styled(Dialog)<{ setMaxWidth?: boolean }>`
|
const StyledDialog = styled(Dialog)<{ setMaxWidth?: boolean }>`
|
||||||
&& {
|
&& {
|
||||||
background: white;
|
background: white;
|
||||||
|
& .bp3-dialog-header {
|
||||||
|
padding: 36px;
|
||||||
|
}
|
||||||
& .bp3-dialog-footer-actions {
|
& .bp3-dialog-footer-actions {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,22 +11,28 @@ import {
|
||||||
getRoles,
|
getRoles,
|
||||||
getDefaultRole,
|
getDefaultRole,
|
||||||
getRolesForField,
|
getRolesForField,
|
||||||
|
getAllUsers,
|
||||||
} from "selectors/organizationSelectors";
|
} from "selectors/organizationSelectors";
|
||||||
import { ReduxActionTypes } from "constants/ReduxActionConstants";
|
import { ReduxActionTypes } from "constants/ReduxActionConstants";
|
||||||
import { InviteUsersToOrgFormValues, inviteUsersToOrg } from "./helpers";
|
import { InviteUsersToOrgFormValues, inviteUsersToOrg } from "./helpers";
|
||||||
import { OrgRole } from "constants/orgConstants";
|
import { OrgRole } from "constants/orgConstants";
|
||||||
import { INVITE_USERS_TO_ORG_FORM } from "constants/forms";
|
import { INVITE_USERS_TO_ORG_FORM } from "constants/forms";
|
||||||
|
import { Classes } from "@blueprintjs/core";
|
||||||
|
|
||||||
const StyledForm = styled.div`
|
const StyledForm = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: white;
|
background: white;
|
||||||
padding: ${props => props.theme.spaces[11]}px;
|
padding: ${props => props.theme.spaces[5]}px;
|
||||||
|
|
||||||
&&& {
|
&&& {
|
||||||
.bp3-input {
|
.bp3-input {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.manageUsers {
|
||||||
|
float: right;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
const StyledInviteFieldGroup = styled.div`
|
const StyledInviteFieldGroup = styled.div`
|
||||||
&& {
|
&& {
|
||||||
|
|
@ -35,22 +41,37 @@ const StyledInviteFieldGroup = styled.div`
|
||||||
flex-wrap: none;
|
flex-wrap: none;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
& > div {
|
.bp3-popover-target {
|
||||||
min-width: 150px;
|
padding-right: 10px;
|
||||||
margin: 0em 1em 1em 0em;
|
padding-top: 5px;
|
||||||
}
|
}
|
||||||
& > div:last-of-type {
|
`;
|
||||||
min-width: 0;
|
|
||||||
display: flex;
|
const UserList = styled.div`
|
||||||
align-self: center;
|
max-height: 100px;
|
||||||
}
|
overflow-y: scroll;
|
||||||
|
.user {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StyledButton = styled(Button)`
|
||||||
|
&&&.${Classes.BUTTON} {
|
||||||
|
width: 100px;
|
||||||
|
height: 32px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const InviteUsersForm = (props: any) => {
|
const InviteUsersForm = (props: any) => {
|
||||||
const { handleSubmit } = props;
|
const { handleSubmit, allUsers } = props;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
props.fetchUser(props.orgId);
|
||||||
props.fetchAllRoles(props.orgId);
|
props.fetchAllRoles(props.orgId);
|
||||||
}, [props.orgId]);
|
}, [props.orgId]);
|
||||||
|
|
||||||
|
|
@ -66,21 +87,41 @@ const InviteUsersForm = (props: any) => {
|
||||||
intent="success"
|
intent="success"
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<SelectField
|
<FormGroup fill>
|
||||||
name={`role`}
|
<SelectField
|
||||||
placeholder="Select a role"
|
name="role"
|
||||||
options={props.roles}
|
placeholder="Select a role"
|
||||||
size="large"
|
options={props.roles}
|
||||||
/>
|
size="large"
|
||||||
<Button
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
<StyledButton
|
||||||
|
className="invite"
|
||||||
text="Invite"
|
text="Invite"
|
||||||
filled
|
|
||||||
intent="primary"
|
intent="primary"
|
||||||
|
filled
|
||||||
onClick={handleSubmit((values: any, dispatch: any) => {
|
onClick={handleSubmit((values: any, dispatch: any) => {
|
||||||
inviteUsersToOrg({ ...values, orgId: props.orgId }, dispatch);
|
inviteUsersToOrg({ ...values, orgId: props.orgId }, dispatch);
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
</StyledInviteFieldGroup>
|
</StyledInviteFieldGroup>
|
||||||
|
<UserList style={{ justifyContent: "space-between" }}>
|
||||||
|
{allUsers.map((user: { username: string; roleName: string }) => {
|
||||||
|
return (
|
||||||
|
<div className="user" key={user.username}>
|
||||||
|
<div>{user.username}</div>
|
||||||
|
<div>{user.roleName}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</UserList>
|
||||||
|
<Button
|
||||||
|
className="manageUsers"
|
||||||
|
text="Manage Users"
|
||||||
|
intent="primary"
|
||||||
|
filled
|
||||||
|
onClick={() => {}}
|
||||||
|
/>
|
||||||
</StyledForm>
|
</StyledForm>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -90,6 +131,7 @@ export default connect(
|
||||||
return {
|
return {
|
||||||
roles: getRolesForField(state),
|
roles: getRolesForField(state),
|
||||||
defaultRole: getDefaultRole(state),
|
defaultRole: getDefaultRole(state),
|
||||||
|
allUsers: getAllUsers(state),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
(dispatch: any) => ({
|
(dispatch: any) => ({
|
||||||
|
|
@ -100,6 +142,13 @@ export default connect(
|
||||||
orgId,
|
orgId,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
fetchUser: (orgId: string) =>
|
||||||
|
dispatch({
|
||||||
|
type: ReduxActionTypes.FETCH_ALL_USERS_INIT,
|
||||||
|
payload: {
|
||||||
|
orgId,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
)(
|
)(
|
||||||
reduxForm<
|
reduxForm<
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user