Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
args:
[
'-c',
'docker run -d --network=cloudbuild -p=8529:8529 -e ARANGO_ROOT_PASSWORD=$_DB_PASS --name=arangodb arangodb',
'docker run -d --network=cloudbuild -p=8529:8529 -e ARANGO_ROOT_PASSWORD=$_DB_PASS --name=arangodb arangodb/arangodb:3.10.4',
]

- name: mikewilliamson/wait-for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export const loadDomainConnectionsByOrgId =
showArchivedDomains = aql``
}
let showHiddenDomains = aql`FILTER e.hidden != true`
if (['super_admin'].includes(permission)) {
if (['super_admin', 'owner', 'admin', 'user'].includes(permission)) {
showHiddenDomains = aql``
}

Expand Down
33 changes: 14 additions & 19 deletions frontend/src/admin/AdminDomainCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Trans } from '@lingui/macro'
import { array, bool, string } from 'prop-types'
import { Flex, Grid, Link, ListItem, Stack, Tag, TagLabel, Text } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@chakra-ui/icons'
import { ABTestVariant, ABTestingWrapper } from '../app/ABTestWrapper'

import { sanitizeUrl } from '../utilities/sanitizeUrl'

Expand Down Expand Up @@ -36,24 +35,20 @@ export function AdminDomainCard({ url, tags, isHidden, isArchived, ...rest }) {
</Tag>
)
})}
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="B">
{isHidden && (
<Tag m="1" borderRadius="full" borderWidth="1px" borderColor="gray.900">
<TagLabel mx="auto">
<Trans>Hidden</Trans>
</TagLabel>
</Tag>
)}
{isArchived && (
<Tag m="1" borderRadius="full" borderWidth="1px" borderColor="gray.900">
<TagLabel mx="auto">
<Trans>Archived</Trans>
</TagLabel>
</Tag>
)}
</ABTestVariant>
</ABTestingWrapper>
{isHidden && (
<Tag m="1" borderRadius="full" borderWidth="1px" borderColor="gray.900">
<TagLabel mx="auto">
<Trans>Hidden</Trans>
</TagLabel>
</Tag>
)}
{isArchived && (
<Tag m="1" borderRadius="full" borderWidth="1px" borderColor="gray.900">
<TagLabel mx="auto">
<Trans>Archived</Trans>
</TagLabel>
</Tag>
)}
</Flex>
</Grid>
</ListItem>
Expand Down
79 changes: 37 additions & 42 deletions frontend/src/admin/AdminDomainModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { useMutation } from '@apollo/client'

import { DomainField } from '../components/fields/DomainField'
import { CREATE_DOMAIN, UPDATE_DOMAIN } from '../graphql/mutations'
import { ABTestVariant, ABTestingWrapper } from '../app/ABTestWrapper'

export function AdminDomainModal({ isOpen, onClose, validationSchema, orgId, ...props }) {
const {
Expand Down Expand Up @@ -327,62 +326,58 @@ export function AdminDomainModal({ isOpen, onClose, validationSchema, orgId, ...
</Box>
)}
/>
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="B">
<Flex align="center">
<Tooltip label={t`Prevent this domain from being counted in your organization's summaries.`}>
<QuestionOutlineIcon tabIndex={0} />
</Tooltip>
<label>
<Switch
isFocusable={true}
name="hideDomain"
mx="2"
defaultChecked={values.hideDomain}
onChange={handleChange}
/>
</label>
<Badge variant="outline" color="gray.900" p="1.5">
<Trans>Hide domain</Trans>
</Badge>
</Flex>
{permission === 'SUPER_ADMIN' && (
<Box>
<Flex align="center">
<Tooltip label={t`Prevent this domain from being counted in your organization's summaries.`}>
<Tooltip
label={t`Prevent this domain from being visible, scanned, and being counted in any summaries.`}
>
<QuestionOutlineIcon tabIndex={0} />
</Tooltip>
<label>
<Switch
colorScheme="red"
isFocusable={true}
name="hideDomain"
name="archiveDomain"
mx="2"
defaultChecked={values.hideDomain}
defaultChecked={values.archiveDomain}
onChange={handleChange}
/>
</label>
<Badge variant="outline" color="gray.900" p="1.5">
<Trans>Hide domain</Trans>
<Trans>Archive domain</Trans>
</Badge>
</Flex>
{permission === 'SUPER_ADMIN' && (
<Box>
<Flex align="center">
<Tooltip
label={t`Prevent this domain from being visible, scanned, and being counted in any summaries.`}
>
<QuestionOutlineIcon tabIndex={0} />
</Tooltip>
<label>
<Switch
colorScheme="red"
isFocusable={true}
name="archiveDomain"
mx="2"
defaultChecked={values.archiveDomain}
onChange={handleChange}
/>
</label>
<Badge variant="outline" color="gray.900" p="1.5">
<Trans>Archive domain</Trans>
</Badge>
</Flex>

<Text fontSize="sm">
{orgCount > 0 ? (
<Trans>Note: This will affect results for {orgCount} organizations</Trans>
) : (
<Trans>Note: This could affect results for multiple organizations</Trans>
)}
</Text>
</Box>
)}
<Text>
<Trans>Please allow up to 24 hours for summaries to reflect any changes.</Trans>
<Text fontSize="sm">
{orgCount > 0 ? (
<Trans>Note: This will affect results for {orgCount} organizations</Trans>
) : (
<Trans>Note: This could affect results for multiple organizations</Trans>
)}
</Text>
</ABTestVariant>
</ABTestingWrapper>
</Box>
)}
<Text>
<Trans>Please allow up to 24 hours for summaries to reflect any changes.</Trans>
</Text>
</Stack>
</ModalBody>

Expand Down
33 changes: 14 additions & 19 deletions frontend/src/domains/DomainCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from '@chakra-ui/react'
import { Link as RouteLink, useLocation } from 'react-router-dom'
import { array, bool, object, string } from 'prop-types'
import { ABTestingWrapper, ABTestVariant } from '../app/ABTestWrapper'
import { StatusBadge } from './StatusBadge'
import { ScanDomainButton } from './ScanDomainButton'
import { StarIcon } from '@chakra-ui/icons'
Expand Down Expand Up @@ -154,24 +153,20 @@ export function DomainCard({
</Tag>
)
})}
<ABTestingWrapper insiderVariantName="B">
<ABTestVariant name="B">
{isHidden && (
<Tag m="0.5" bg="gray.50" borderWidth="1px" borderColor="gray.900">
<TagLabel textColor="primary" fontWeight="bold" mx="auto">
<Trans>HIDDEN</Trans>
</TagLabel>
</Tag>
)}
{isArchived && (
<Tag m="0.5" bg="gray.50" borderWidth="1px" borderColor="gray.900">
<TagLabel textColor="primary" fontWeight="bold" mx="auto">
<Trans>ARCHIVED</Trans>
</TagLabel>
</Tag>
)}{' '}
</ABTestVariant>
</ABTestingWrapper>
{isHidden && (
<Tag m="0.5" bg="gray.50" borderWidth="1px" borderColor="gray.900">
<TagLabel textColor="primary" fontWeight="bold" mx="auto">
<Trans>HIDDEN</Trans>
</TagLabel>
</Tag>
)}
{isArchived && (
<Tag m="0.5" bg="gray.50" borderWidth="1px" borderColor="gray.900">
<TagLabel textColor="primary" fontWeight="bold" mx="auto">
<Trans>ARCHIVED</Trans>
</TagLabel>
</Tag>
)}
</Flex>
</Box>
<Divider variant="card" display={{ md: 'none' }} />
Expand Down
2 changes: 1 addition & 1 deletion services/summaries/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:
- name: 'gcr.io/cloud-builders/docker'
id: start_testdb
entrypoint: /bin/sh
args: ["-c", "docker run --net cloudbuild --name testdb -e ARANGO_NO_AUTH=1 -d -p 127.0.0.1:8529:8529 arangodb"]
args: ["-c", "docker run --net cloudbuild --name testdb -e ARANGO_NO_AUTH=1 -d -p 127.0.0.1:8529:8529 arangodb/arangodb:3.10.4"]

- name: mikewilliamson/wait-for
id: wait_testdb
Expand Down
3 changes: 1 addition & 2 deletions services/summaries/summaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def update_chart_summaries(host=DB_URL, name=DB_NAME, user=DB_USER, password=DB_

for domain in db.collection("domains"):
archived = domain.get("archived")
hidden = is_domain_hidden(domain, db)
if archived != True and hidden != True:
if archived != True:
# Update chart summaries
for chart_type in chartSummaries:
chart = chartSummaries[chart_type]
Expand Down