Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build testing #19

Open
wants to merge 40 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
86e0f71
Add migration to remove resources collection
lmcnulty Dec 20, 2022
482011b
Add csetV2taxon object
lmcnulty Dec 20, 2022
98cd354
Fix taxonomies to use classifications collection
lmcnulty Dec 29, 2022
8976eee
Remove console.log()s
lmcnulty Dec 29, 2022
1b3ceb3
Remove console.log()s
lmcnulty Dec 30, 2022
e21ea0d
Remove resource references
lmcnulty Dec 30, 2022
e171eec
Add namespace to mutation query
lmcnulty Dec 30, 2022
fae0f97
Switch to allMongodbAiidprodClassifications
lmcnulty Dec 30, 2022
d3d38db
Merge branch 'staging' into remove-resources
lmcnulty Jan 4, 2023
6d82ba0
Merge branch 'staging' into remove-resources
lmcnulty Jan 12, 2023
4e162a6
Use generic attributes for classifications
lmcnulty Jan 14, 2023
8a4167f
Add migration to update CSET to use attributes
lmcnulty Jan 14, 2023
61619fa
Integrate attributes further
lmcnulty Jan 17, 2023
6ec1819
Move towards us value_json, handle taxonomy template
lmcnulty Jan 18, 2023
878de37
Fix taxonomy visualizations
lmcnulty Jan 18, 2023
040da8c
Remove classification.classifications and attribute.value
lmcnulty Jan 18, 2023
3dfeea5
Make algolia update work with taxonomy attributes
lmcnulty Jan 18, 2023
2110d0f
Update CSET taxonomy major fields 1-4, 6-8
lmcnulty Jan 19, 2023
106e594
Add field 5 of new cset taxonomy
lmcnulty Jan 19, 2023
48f5078
Move object to bottom, remove mongodb
lmcnulty Jan 19, 2023
8f5a834
Get new CSET to load on cite page
lmcnulty Jan 19, 2023
08a6dab
Remove console.log()s
lmcnulty Jan 23, 2023
004974a
Add missing display types
lmcnulty Jan 23, 2023
63d1ee0
Make nested attributes work
lmcnulty Jan 25, 2023
d86b559
Fix merge conflicts
lmcnulty Jan 25, 2023
3d9695d
Update tsne
lmcnulty Jan 25, 2023
fd81790
Make tsne visualization work again
lmcnulty Jan 25, 2023
3ba0810
Improve tsne integration, remove logs
lmcnulty Jan 26, 2023
d64af4c
Merge branch 'staging' into remove-resources
lmcnulty Jan 30, 2023
0b38e1a
Remove graphql attributes[].value as value_json replaces it
lmcnulty Jan 31, 2023
d1a2530
Remove test taxonomy migration
lmcnulty Jan 31, 2023
ef388ec
Remove leftovers
lmcnulty Jan 31, 2023
4bdbfdb
Remove mongo_type from attributes
lmcnulty Jan 31, 2023
3326ec6
Remove commented-out/obsolete code
lmcnulty Jan 31, 2023
60206b1
Remove mongo_type, debounce update initial values
lmcnulty Jan 31, 2023
c99bcac
Remove TODO
lmcnulty Jan 31, 2023
752fac8
Update typedefs
lmcnulty Jan 31, 2023
4ef1951
Remove mongo_type from typedef
lmcnulty Feb 1, 2023
219d252
Fix initial display of booleans in TaxonomyForm
lmcnulty Feb 1, 2023
06e6040
Remove useMongo from TaxonomyForm, fix field key default
lmcnulty Feb 1, 2023
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
19 changes: 1 addition & 18 deletions site/gatsby-site/cypress/e2e/integration/cite.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,12 @@ describe('Cite pages', () => {
cy.get('@taxonomyForm').should('exist');
});

maybeIt('Should show the taxonomy form of resources', () => {
cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword'));

cy.visit(url);

cy.get('[data-cy="resources"]', { timeout: 8000 })
.should('be.visible')
.contains('Edit')
.click();

cy.get('[data-cy="resources"] [data-cy="taxonomy-form"]', { timeout: 8000 })
.should('be.visible')
.as('taxonomyForm');

cy.get('@taxonomyForm').should('exist');
});

it(`Should taxa table only when there are classifications and the user is not authenticated`, () => {
cy.visit(url);

cy.get('[data-cy="CSET"]').should('exist');

cy.get('[data-cy="resources"]').should('not.exist');
cy.get('[data-cy="CSETv1"]').should('not.exist');
});

it('Should flag an incident', () => {
Expand Down
1 change: 0 additions & 1 deletion site/gatsby-site/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const plugins = [
'duplicates',
'taxa',
'classifications',
'resources',
'reports',
'entities',
],
Expand Down
42 changes: 39 additions & 3 deletions site/gatsby-site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,49 @@ exports.createSchemaCustomization = ({ actions }) => {
field_list: [mongodbAiidprodTaxaField_list]
}

type mongodbAiidprodTaxaField_list {
type mongodbAiidprodClassificationsAttribute {
short_name: String
value_json: String
}
type mongodbAiidprodClassifications implements Node {
incident_id: Int
namespace: String
attributes: [mongodbAiidprodClassificationsAttribute]
}

type Subfield {
field_number: String
short_name: String
long_name: String
short_description: String
long_description: String
display_type: String
mongo_type: String
default: String
placeholder: String
permitted_values: [String]
weight: Int
instant_facet: Boolean
required: Boolean
public: Boolean
}

type mongodbAiidprodResourcesClassifications implements Node {
MSFT_AI_Fairness_Checklist: Boolean
type mongodbAiidprodTaxaField_list {
subfields: [Subfield]
field_number: String
short_name: String
long_name: String
short_description: String
long_description: String
display_type: String
mongo_type: String
default: String
placeholder: String
permitted_values: [String]
weight: Int
instant_facet: Boolean
required: Boolean
public: Boolean
}
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const config = require('../config');

/** @type {import('umzug').MigrationFn<any>} */
exports.up = async ({ context: { client } }) => {
const resourcesCollection = client.db(config.realm.production_db.db_name).collection('resources');

resourcesCollection.drop();

const taxaCollection = client.db(config.realm.production_db.db_name).collection('taxa');

taxaCollection.deleteOne({ namespace: 'resources' });
};

/** @type {import('umzug').MigrationFn<any>} */
exports.down = async () => {};
Loading