fix(ui) - user list show member

This commit is contained in:
Shekar Siri 2022-08-19 13:16:01 +02:00
parent 72738d5343
commit afedcb52d6
2 changed files with 2 additions and 5 deletions

View file

@ -13,16 +13,13 @@ interface Props {
isOnboarding?: boolean;
account: any;
isEnterprise: boolean;
limits: any;
}
function UsersView(props: Props) {
const { account, limits, isEnterprise, isOnboarding = false } = props;
const { account, isEnterprise, isOnboarding = false } = props;
const { userStore, roleStore } = useStore();
const userCount = useObserver(() => userStore.list.length);
const roles = useObserver(() => roleStore.list);
const { showModal } = useModal();
const reachedLimit = limits.remaining + userStore.modifiedCount <= 0;
const isAdmin = account.admin || account.superAdmin;
const editHandler = (user: any = null) => {
@ -60,5 +57,4 @@ function UsersView(props: Props) {
export default connect((state: any) => ({
account: state.getIn(['user', 'account']),
isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee',
limits: state.getIn(['user', 'account', 'limits', 'teamMember']),
}))(UsersView);

View file

@ -9,6 +9,7 @@ const AdminPrivilegeLabel = ({ user }) => {
<>
{user.isAdmin && <span className="px-2 py-1 bg-gray-lightest rounded border text-sm capitalize">Admin</span>}
{user.isSuperAdmin && <span className="px-2 py-1 bg-gray-lightest rounded border text-sm capitalize">Owner</span>}
{!user.isAdmin && !user.isSuperAdmin && <span className="px-2 py-1 bg-gray-lightest rounded border text-sm capitalize">Member</span>}
</>
);
};