Skip to content

Commit

Permalink
Archive and hide domains by org (#4219)
Browse files Browse the repository at this point in the history
* add archived and hidden values in create/update domain

* exclude archived and hidden domains from summaries

* exclude archived domains from scans

* permission required to load hidden and archived domains

* add archived and hidden fields to queries and mutations

* add mutations and values to admin page

* add hidden and archived tags to domain cards

* fix bug when creating and updating hidden values

* add log for archiving domain

* update tests

* add frontend translations

* api translations

* put hide and archive toggles behind AB testing

* fix api tests

* remove commented code

* add 24 hour disclaimer to hide domain switch

* allow archived domains to be scanned manually and on creation

* update archive tooltip

* fix bfs option

* add number of affected orgs to archive toggle
  • Loading branch information
lcampbell2 authored Mar 3, 2023
1 parent f5130b6 commit ec4fd12
Show file tree
Hide file tree
Showing 28 changed files with 1,285 additions and 762 deletions.
34 changes: 34 additions & 0 deletions api/src/domain/loaders/__tests__/load-domain-conn-org-id.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ describe('given the load domain connection using org id function', () => {
spf: 'pass',
ssl: 'pass',
},
archived: false,
})
await collections.claims.save({
_from: org._id,
_to: domain._id,
tags: [],
hidden: false,
})
domainTwo = await collections.domains.save({
domain: 'test.domain.canada.ca',
Expand All @@ -115,11 +117,13 @@ describe('given the load domain connection using org id function', () => {
spf: 'fail',
ssl: 'fail',
},
archived: false,
})
await collections.claims.save({
_from: org._id,
_to: domainTwo._id,
tags: [],
hidden: false,
})
})
afterEach(async () => {
Expand Down Expand Up @@ -163,6 +167,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -213,6 +218,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -262,6 +268,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -311,6 +318,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -363,6 +371,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomain,
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -421,6 +430,7 @@ describe('given the load domain connection using org id function', () => {
_from: org._id,
_to: domainThree._id,
tags: [],
hidden: false,
})
await collections.ownership.save({
_from: org._id,
Expand Down Expand Up @@ -460,6 +470,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -508,20 +519,23 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
{
cursor: toGlobalId('domain', expectedDomains[1]._key),
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
{
cursor: toGlobalId('domain', expectedDomains[2]._key),
node: {
...expectedDomains[2],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -579,6 +593,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -633,6 +648,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -689,6 +705,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -743,6 +760,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -799,6 +817,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -853,6 +872,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -909,6 +929,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -963,6 +984,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1019,6 +1041,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1073,6 +1096,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1131,6 +1155,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1185,6 +1210,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1241,6 +1267,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1295,6 +1322,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1351,6 +1379,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1405,6 +1434,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1461,6 +1491,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1515,6 +1546,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1571,6 +1603,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[1],
claimTags: [],
hidden: false,
},
},
],
Expand Down Expand Up @@ -1625,6 +1658,7 @@ describe('given the load domain connection using org id function', () => {
node: {
...expectedDomains[0],
claimTags: [],
hidden: false,
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ describe('given the load domain connections by user id function', () => {
describe('given a successful load', () => {
beforeAll(async () => {
;({ query, drop, truncate, collections } = await ensure({
variables: {
dbname: dbNameFromFile(__filename),
username: 'root',
rootPassword: rootPass,
password: rootPass,
url,
},

schema: dbschema,
}))
variables: {
dbname: dbNameFromFile(__filename),
username: 'root',
rootPassword: rootPass,
password: rootPass,
url,
},

schema: dbschema,
}))
})
beforeEach(async () => {
user = await collections.users.save({
Expand Down
Loading

0 comments on commit ec4fd12

Please sign in to comment.