|
@@ -1,5 +1,6 @@
|
|
|
import PropTypes from 'prop-types';
|
|
|
import React from 'react';
|
|
|
+import styled from 'react-emotion';
|
|
|
import {debounce} from 'lodash';
|
|
|
|
|
|
import {Panel, PanelBody, PanelHeader} from 'app/components/panels';
|
|
@@ -9,9 +10,11 @@ import AsyncView from 'app/views/asyncView';
|
|
|
import Button from 'app/components/button';
|
|
|
import EmptyMessage from 'app/views/settings/components/emptyMessage';
|
|
|
import ConfigStore from 'app/stores/configStore';
|
|
|
+import InlineSvg from 'app/components/inlineSvg';
|
|
|
import Pagination from 'app/components/pagination';
|
|
|
import SentryTypes from 'app/sentryTypes';
|
|
|
import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader';
|
|
|
+import space from 'app/styles/space';
|
|
|
import routeTitleGen from 'app/utils/routeTitle';
|
|
|
import {redirectToRemainingOrganization} from 'app/actionCreators/organizations';
|
|
|
import {openInviteMembersModal} from 'app/actionCreators/modal';
|
|
@@ -224,7 +227,7 @@ class OrganizationMembersView extends AsyncView {
|
|
|
const {organization} = this.context;
|
|
|
const {orgId} = params || {};
|
|
|
const {name: orgName, access} = organization;
|
|
|
- const canAddMembers = access.indexOf('org:write') > -1;
|
|
|
+ const canAddMembers = access.indexOf('member:write') > -1;
|
|
|
const canRemove = access.indexOf('member:admin') > -1;
|
|
|
const currentUser = ConfigStore.get('user');
|
|
|
// Find out if current user is the only owner
|
|
@@ -236,26 +239,30 @@ class OrganizationMembersView extends AsyncView {
|
|
|
|
|
|
return (
|
|
|
<div>
|
|
|
- <SettingsPageHeader
|
|
|
- title="Members"
|
|
|
- action={
|
|
|
- <Button
|
|
|
- priority="primary"
|
|
|
- size="small"
|
|
|
- disabled={!canAddMembers}
|
|
|
- title={
|
|
|
- !canAddMembers
|
|
|
- ? t('You do not have enough permission to add new members')
|
|
|
- : undefined
|
|
|
- }
|
|
|
- onClick={openInviteMembersModal}
|
|
|
- icon="icon-circle-add"
|
|
|
- data-test-id="invite-member"
|
|
|
- >
|
|
|
- {t('Invite Member')}
|
|
|
- </Button>
|
|
|
- }
|
|
|
- />
|
|
|
+ <SettingsPageHeader title="Members" />
|
|
|
+
|
|
|
+ <StyledPanel>
|
|
|
+ <InlineSvg src="icon-mail" size="36px" />
|
|
|
+ <TextContainer>
|
|
|
+ <Heading>{t('Invite new members')}</Heading>
|
|
|
+ <SubText>
|
|
|
+ {t('Invite new members by email to join your organization.')}
|
|
|
+ </SubText>
|
|
|
+ </TextContainer>
|
|
|
+ <Button
|
|
|
+ priority="primary"
|
|
|
+ size="small"
|
|
|
+ disabled={!canAddMembers}
|
|
|
+ title={
|
|
|
+ !canAddMembers
|
|
|
+ ? t('You do not have enough permission to add new members')
|
|
|
+ : undefined
|
|
|
+ }
|
|
|
+ onClick={openInviteMembersModal}
|
|
|
+ >
|
|
|
+ {t('Invite Members')}
|
|
|
+ </Button>
|
|
|
+ </StyledPanel>
|
|
|
|
|
|
<OrganizationAccessRequests
|
|
|
onApprove={this.handleApprove}
|
|
@@ -309,4 +316,33 @@ class OrganizationMembersView extends AsyncView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const StyledPanel = styled(Panel)`
|
|
|
+ padding: 18px;
|
|
|
+ margin-top: -14px;
|
|
|
+ margin-bottom: 40px;
|
|
|
+ background: none;
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: max-content auto max-content;
|
|
|
+ grid-gap: ${space(3)};
|
|
|
+ align-items: center;
|
|
|
+ align-content: center;
|
|
|
+`;
|
|
|
+
|
|
|
+const TextContainer = styled('div')`
|
|
|
+ display: inline-grid;
|
|
|
+ grid-gap: ${space(1)};
|
|
|
+`;
|
|
|
+
|
|
|
+const Heading = styled('h1')`
|
|
|
+ margin: 0;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: ${p => p.theme.fontSizeExtraLarge};
|
|
|
+`;
|
|
|
+
|
|
|
+const SubText = styled('p')`
|
|
|
+ margin: 0;
|
|
|
+ color: ${p => p.theme.gray3};
|
|
|
+ font-size: 15px;
|
|
|
+`;
|
|
|
+
|
|
|
export default OrganizationMembersView;
|