Skip to content

Commit

Permalink
Reveal 2.1615 features (#4589)
Browse files Browse the repository at this point in the history
* reveal Request Invite button

* show hidden score toggle btn

* allow filtering by hidden tags

* include org owners in invite request emails
  • Loading branch information
lcampbell2 authored Jun 16, 2023
1 parent 32db3e5 commit af5d359
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 59 deletions.
2 changes: 1 addition & 1 deletion api/src/affiliation/mutations/request-org-affiliation.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const requestOrgAffiliation = new mutationWithClientMutationId({
orgAdminsCursor = await query`
WITH affiliations, organizations, users
FOR v, e IN 1..1 OUTBOUND ${org._id} affiliations
FILTER e.permission == "admin"
FILTER e.permission == "admin" || e.permission == "super_admin" || e.permission == "owner"
RETURN v._key
`
} catch (err) {
Expand Down
2 changes: 2 additions & 0 deletions frontend/mocking/faked_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ export const getTypeNames = () => gql`
# CSV formatted output of all domains in the organization including their email and web scan statuses.
toCsv: String
userHasPermission: Boolean
# The domains which are associated with this organization.
domains(
# Ordering options for domain connections.
Expand Down
33 changes: 14 additions & 19 deletions frontend/src/organizationDetails/OrganizationDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { RadialBarChart } from '../summaries/RadialBarChart'
import { ExportButton } from '../components/ExportButton'
import { RequestOrgInviteModal } from '../organizations/RequestOrgInviteModal'
import { useUserVar } from '../utilities/userState'
import { ABTestingWrapper, ABTestVariant } from '../app/ABTestWrapper'

export default function OrganizationDetails() {
const { isLoggedIn } = useUserVar()
Expand Down Expand Up @@ -107,24 +106,20 @@ export default function OrganizationDetails() {
{data?.organization?.verified && <CheckCircleIcon ml="1" color="blue.500" boxSize="icons.lg" />}
</Flex>
</Heading>
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="B">
{isLoggedIn() && (
<>
<Button ml="auto" order={{ base: 2, md: 1 }} variant="primary" onClick={onOpen}>
<Trans>Request Invite</Trans>
<UserIcon ml="1" color="white" boxSize="icons.md" />
</Button>
<RequestOrgInviteModal
onClose={onClose}
isOpen={isOpen}
orgId={data?.organization?.id}
orgName={data?.organization?.name}
/>
</>
)}
</ABTestVariant>
</ABTestingWrapper>
{isLoggedIn() && (
<>
<Button ml="auto" order={{ base: 2, md: 1 }} variant="primary" onClick={onOpen}>
<Trans>Request Invite</Trans>
<UserIcon ml="1" color="white" boxSize="icons.md" />
</Button>
<RequestOrgInviteModal
onClose={onClose}
isOpen={isOpen}
orgId={data?.organization?.id}
orgName={data?.organization?.name}
/>
</>
)}
</Flex>
<Tabs
isFitted
Expand Down
19 changes: 7 additions & 12 deletions frontend/src/organizationDetails/OrganizationDomains.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { SearchBox } from '../components/SearchBox'
import { Formik } from 'formik'
import { getRequirement, schemaToValidation } from '../utilities/fieldRequirements'
import { CheckCircleIcon, InfoIcon, WarningIcon } from '@chakra-ui/icons'
import { ABTestVariant, ABTestingWrapper } from '../app/ABTestWrapper'

export function OrganizationDomains({ orgSlug }) {
const [orderDirection, setOrderDirection] = useState('ASC')
Expand Down Expand Up @@ -202,17 +201,13 @@ export function OrganizationDomains({ orgSlug }) {
</option>
)
})}
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="B">
{hiddenFilterOptions.map(({ value, text }, idx) => {
return (
<option key={idx} value={value}>
{text}
</option>
)
})}
</ABTestVariant>
</ABTestingWrapper>
{hiddenFilterOptions.map(({ value, text }, idx) => {
return (
<option key={idx} value={value}>
{text}
</option>
)
})}
</>
) : (
<>
Expand Down
41 changes: 18 additions & 23 deletions frontend/src/organizations/Organizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { SearchBox } from '../components/SearchBox'
import { UserIcon } from '../theme/Icons'
import { RequestOrgInviteModal } from './RequestOrgInviteModal'
import { useUserVar } from '../utilities/userState'
import { ABTestingWrapper, ABTestVariant } from '../app/ABTestWrapper'

export default function Organizations() {
const { isLoggedIn } = useUserVar()
Expand Down Expand Up @@ -97,28 +96,24 @@ export default function Organizations() {
mr="2"
w="100%"
/>
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="B">
{isLoggedIn() && (
<>
<IconButton
variant="primary"
icon={<UserIcon color="white" boxSize="icons.md" />}
onClick={() => {
setOrgInfo({ id, name })
onOpen()
}}
/>
<RequestOrgInviteModal
isOpen={inviteRequestIsOpen}
onClose={onClose}
orgId={orgInfo.id}
orgName={orgInfo.name}
/>
</>
)}
</ABTestVariant>
</ABTestingWrapper>
{isLoggedIn() && (
<>
<IconButton
variant="primary"
icon={<UserIcon color="white" boxSize="icons.md" />}
onClick={() => {
setOrgInfo({ id, name })
onOpen()
}}
/>
<RequestOrgInviteModal
isOpen={inviteRequestIsOpen}
onClose={onClose}
orgId={orgInfo.id}
orgName={orgInfo.name}
/>
</>
)}
</Flex>
</ErrorBoundary>
)}
Expand Down
22 changes: 18 additions & 4 deletions frontend/src/summaries/TieredSummaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,24 @@ export function TieredSummaries({ summaries }) {
<Box>
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="A">
<TierOneSummaries
https={show && hidden ? hidden.https : https}
dmarc={show && hidden ? hidden.dmarc : dmarc}
/>
<Box>
<Flex align="center" justify="flex-end" mb="2">
{hidden && (
<Tooltip label={t`Include hidden domains in summaries.`}>
<IconButton
aria-label={t`Include hidden domains in summaries.`}
variant="primaryOutline"
onClick={() => setShow(!show)}
icon={show ? <ViewOffIcon /> : <ViewIcon />}
/>
</Tooltip>
)}
</Flex>
<TierOneSummaries
https={show && hidden ? hidden.https : https}
dmarc={show && hidden ? hidden.dmarc : dmarc}
/>
</Box>
</ABTestVariant>
<ABTestVariant name="B">
<Accordion allowMultiple defaultIndex={[0, 1, 2]}>
Expand Down

0 comments on commit af5d359

Please sign in to comment.