diff --git a/site/gatsby-site/cypress/e2e/integration/apps/submitted.cy.js b/site/gatsby-site/cypress/e2e/integration/apps/submitted.cy.js
index ea3b6af4a4..1c5e235cec 100644
--- a/site/gatsby-site/cypress/e2e/integration/apps/submitted.cy.js
+++ b/site/gatsby-site/cypress/e2e/integration/apps/submitted.cy.js
@@ -56,44 +56,34 @@ describe('Submitted reports', () => {
const submissions = submittedReports.data.submissions;
- cy.get('[data-cy="submissions"] > div').should('have.length', submissions.length);
+ cy.get('[data-cy="submissions"] [data-cy="row"]').should('have.length', submissions.length);
submissions.forEach((report, index) => {
- cy.get('[data-cy="submissions"]')
- .children(`:nth-child(${index + 1})`)
- .within(() => {
- cy.get('[data-cy="review-button"]').click();
+ cy.get('[data-cy="submissions"] [data-cy="row"]')
+ .eq(index)
+ .then((element) => {
+ cy.wrap(element)
+ .find('[data-cy="cell"] [data-cy="review-submission"]')
+ .should('not.exist');
});
- cy.get('[data-cy="submissions"]')
- .children(`:nth-child(${index + 1})`)
- .within(() => {
- const keys = [
- 'source_domain',
- 'authors',
- 'submitters',
- 'incident_id',
- 'date_published',
- 'date_submitted',
- 'date_downloaded',
- 'date_modified',
- 'url',
- 'incident_ids',
- ];
-
- for (const key of keys) {
- if (report[key]) {
- let value = report[key];
-
- if (isArray(value)) {
- value = arrayToList(value);
+ cy.get('[data-cy="submissions"] [data-cy="row"]')
+ .eq(index)
+ .then((element) => {
+ const keys = ['title', 'submitters', 'incident_date', 'editor', 'status'];
+
+ cy.wrap(element)
+ .find('[data-cy="cell"]')
+ .each((cell, cellIndex) => {
+ if (report[keys[cellIndex]]) {
+ let value = report[keys[cellIndex]];
+
+ if (isArray(value)) {
+ value = arrayToList(value);
+ }
+ cy.wrap(cell).should('contain', value);
}
-
- cy.get(`[data-cy="${key}"] div:nth-child(2)`).should('contain', value);
- } else {
- cy.get(`[data-cy="${key}"] div:nth-child(2)`).should('not.exist');
- }
- }
+ });
});
});
});
@@ -116,6 +106,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -131,13 +132,11 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.wait('@AllQuickAdd');
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.waitForStableDOM();
cy.conditionalIntercept(
'**/graphql',
@@ -183,7 +182,11 @@ describe('Submitted reports', () => {
}
);
- cy.get('@promoteForm').contains('button', 'Add new Incident').click();
+ cy.get('select[data-cy="promote-select"]').as('dropdown');
+
+ cy.get('@dropdown').select('Incident');
+
+ cy.get('[data-cy="promote-button"]').click();
cy.wait('@promoteSubmission')
.its('request.body.variables.input')
@@ -241,6 +244,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -256,13 +270,11 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
+ cy.visit(url + `?editSubmission=${submission._id}}`);
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.wait('@AllQuickAdd');
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.waitForStableDOM();
cy.conditionalIntercept(
'**/graphql',
@@ -291,7 +303,7 @@ describe('Submitted reports', () => {
}
);
- cy.get('@promoteForm').contains('button', 'Add to incident 10').click();
+ cy.get('[data-cy="promote-to-report-button"]').click();
cy.wait('@promoteSubmission')
.its('request.body.variables.input')
@@ -337,6 +349,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -352,13 +375,9 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
-
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.visit(url + `?editSubmission=${submission._id}}`);
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.wait('@AllQuickAdd');
cy.conditionalIntercept(
'**/graphql',
@@ -404,7 +423,7 @@ describe('Submitted reports', () => {
}
);
- cy.get('@promoteForm').contains('button', 'Add to incidents 52 and 53').click();
+ cy.get('[data-cy="promote-to-report-button"]').click();
cy.wait('@promoteSubmission')
.its('request.body.variables.input')
@@ -467,6 +486,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -482,13 +512,11 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.wait('@AllQuickAdd');
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.waitForStableDOM();
cy.conditionalIntercept(
'**/graphql',
@@ -504,7 +532,11 @@ describe('Submitted reports', () => {
}
);
- cy.get('@promoteForm').contains('button', 'Add as issue').click();
+ cy.get('select[data-cy="promote-select"]').as('dropdown');
+
+ cy.get('@dropdown').select('Issue');
+
+ cy.get('[data-cy="promote-button"]').click();
cy.wait('@promoteSubmission')
.its('request.body.variables.input')
@@ -537,6 +569,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -552,13 +595,11 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.wait('@AllQuickAdd');
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.waitForStableDOM();
cy.conditionalIntercept(
'**/graphql',
@@ -571,13 +612,11 @@ describe('Submitted reports', () => {
}
);
- cy.get('@promoteForm').contains('button', 'Reject New Report').click();
+ cy.get('[data-cy="reject-button"]').click();
cy.wait('@DeleteSubmission').then((xhr) => {
expect(xhr.request.body.variables._id).to.eq('6123bf345e740c1a81850e89');
});
-
- cy.get('[data-cy="submissions"]').children().should('have.length', 0);
});
maybeIt('Edits a submission - update just a text', () => {
@@ -619,15 +658,7 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
-
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
+ cy.visit(url + `?editSubmission=${submittedReports.data.submissions[0]._id}`);
cy.setEditorText(
'## Another one\n\n**More markdown**\n\nAnother paragraph with more text to reach the minimum character count!'
@@ -676,8 +707,6 @@ describe('Submitted reports', () => {
cy.clock(now);
- cy.get('@modal').contains('Update').click();
-
cy.wait('@UpsertGoogle').its('request.body.variables.entity.entity_id').should('eq', 'google');
cy.wait('@UpsertAdults').its('request.body.variables.entity.entity_id').should('eq', 'adults');
@@ -697,6 +726,7 @@ describe('Submitted reports', () => {
description:
'By NEIL BEDI and KATHLEEN McGRORY\nTimes staff writers\nNov. 19, 2020\nThe Pasco Sheriff’s Office keeps a secret list of kids it thinks could “fall into a life of crime” based on factors like wheth',
image_url: 'https://s3.amazonaws.com/ledejs/resized/s2020-pasco-ilp/600/nocco5.jpg',
+ incident_title: 'Submisssion 1 title',
incident_date: '2015-09-01',
incident_ids: [],
language: 'en',
@@ -721,8 +751,6 @@ describe('Submitted reports', () => {
},
});
});
-
- cy.get('@modal').should('not.exist');
});
maybeIt('Edits a submission - uses fetch info', () => {
@@ -752,11 +780,7 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.visit(url + `?editSubmission=${submittedReports.data.submissions[0]._id}`);
cy.conditionalIntercept(
'**/graphql',
@@ -772,10 +796,6 @@ describe('Submitted reports', () => {
}
);
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
-
cy.get('input[name="url"]').click();
cy.clickOutside();
@@ -818,6 +838,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -833,13 +864,9 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
-
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.wait('@AllQuickAdd');
cy.on('fail', (err) => {
expect(err.message).to.include(
@@ -854,7 +881,11 @@ describe('Submitted reports', () => {
{}
);
- cy.get('@promoteForm').contains('button', 'Add new Incident').click();
+ cy.get('select[data-cy="promote-select"]').as('dropdown');
+
+ cy.get('@dropdown').select('Incident');
+
+ cy.get('[data-cy="promote-button"]').click();
cy.contains('[data-cy="toast"]', 'Description is required.').should('exist');
@@ -882,6 +913,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -897,13 +939,9 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.wait('@AllQuickAdd');
cy.on('fail', (err) => {
expect(err.message).to.include(
@@ -918,7 +956,11 @@ describe('Submitted reports', () => {
{}
);
- cy.get('@promoteForm').contains('button', 'Add as issue').click();
+ cy.get('select[data-cy="promote-select"]').as('dropdown');
+
+ cy.get('@dropdown').select('Issue');
+
+ cy.get('[data-cy="promote-button"]').click();
cy.contains('[data-cy="toast"]', 'Title is required').should('exist');
@@ -946,6 +988,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'AllQuickAdd',
@@ -961,13 +1014,9 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
-
- cy.get('[data-cy="submission"]').first().as('promoteForm');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.wait('@AllQuickAdd');
cy.on('fail', (err) => {
expect(err.message).to.include(
@@ -982,7 +1031,7 @@ describe('Submitted reports', () => {
{}
);
- cy.get('@promoteForm').contains('button', 'Add to incident 12').click();
+ cy.get('[data-cy="promote-to-report-button"]').contains('Add to incident 12').click();
cy.contains('[data-cy="toast"]', '*Date is not valid, must be `YYYY-MM-DD`').should('exist');
@@ -990,7 +1039,8 @@ describe('Submitted reports', () => {
}
);
- maybeIt('Should display an error message if data is missing', () => {
+ it.skip('Should display an error message if data is missing', () => {
+ // With new submission list, we allow to save changes always
cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword'));
const submission = submittedReports.data.submissions.find(
@@ -1008,6 +1058,17 @@ describe('Submitted reports', () => {
}
);
+ cy.conditionalIntercept(
+ '**/graphql',
+ (req) => req.body.operationName == 'FindSubmission',
+ 'FindSubmission',
+ {
+ data: {
+ submission: submission,
+ },
+ }
+ );
+
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName == 'FindSubmission',
@@ -1023,19 +1084,13 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
-
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('@modal').contains('Please review submission. Some data is missing.').should('exist');
+ cy.get('[data-cy="submission-form"]')
+ .contains('Please review submission. Some data is missing.')
+ .should('exist');
- cy.get('[data-cy="update-btn"]').should('be.disabled');
+ cy.get('[data-cy="submission"]').contains('Changes not saved').should('exist');
cy.waitForStableDOM();
@@ -1053,14 +1108,14 @@ describe('Submitted reports', () => {
cy.get('input[name=date_downloaded]').type('2023-01-01');
- cy.get('@modal')
+ cy.get('[data-cy="submission-form"]')
.contains('Please review submission. Some data is missing.')
.should('not.exist');
- cy.get('[data-cy="update-btn"]').should('not.be.disabled');
+ cy.get('[data-cy="submission"]').contains('Changes not saved').should('not.exist');
});
- maybeIt('Should display submission image on edit modal', () => {
+ maybeIt('Should display submission image on edit page', () => {
cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword'));
const submission = submittedReports.data.submissions.find(
@@ -1118,17 +1173,9 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
-
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
+ cy.wait('@AllQuickAdd');
cy.waitForStableDOM();
@@ -1181,17 +1228,9 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.wait('@AllQuickAdd');
-
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
-
- cy.get('[data-cy="edit-submission"]').eq(0).click();
+ cy.visit(url + `?editSubmission=${submission._id}`);
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
+ cy.wait('@AllQuickAdd');
cy.get('[data-cy="image-preview-figure"] canvas').should('exist');
});
@@ -1229,25 +1268,13 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
-
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
+ cy.visit(url + `?editSubmission=${submission._id}`);
cy.waitForStableDOM();
cy.get('input[name=date_published]').type('3000-01-01');
- cy.get('@modal').contains('*Date must be in the past').should('exist');
-
- cy.get('@modal').contains('Please review submission. Some data is missing.').should('exist');
-
- cy.get('[data-cy="update-btn"]').should('be.disabled');
+ cy.get('[data-cy="submission-form"]').contains('*Date must be in the past').should('exist');
});
maybeIt('Should display an error message if Date Downloaded is not in the past', () => {
@@ -1283,25 +1310,13 @@ describe('Submitted reports', () => {
cy.wait('@FindSubmissions');
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
-
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
+ cy.visit(url + `?editSubmission=${submission._id}`);
cy.waitForStableDOM();
cy.get('input[name=date_downloaded]').type('3000-01-01');
- cy.get('@modal').contains('*Date must be in the past').should('exist');
-
- cy.get('@modal').contains('Please review submission. Some data is missing.').should('exist');
-
- cy.get('[data-cy="update-btn"]').should('be.disabled');
+ cy.get('[data-cy="submission-form"]').contains('*Date must be in the past').should('exist');
});
maybeIt(
@@ -1359,32 +1374,6 @@ describe('Submitted reports', () => {
}
);
- cy.visit(url);
-
- cy.wait('@FindSubmissions');
-
- cy.get('[data-cy="submission"]').first().as('promoteForm');
-
- cy.get('@promoteForm').within(() => {
- cy.get('[data-cy="review-button"]').click();
- });
-
- cy.get('[data-cy="edit-submission"]').eq(0).click();
-
- cy.get('[data-cy="submission-modal"]').as('modal').should('be.visible');
-
- cy.waitForStableDOM();
-
- cy.get(`input[name="incident_ids"]`).type('1');
-
- cy.waitForStableDOM();
-
- cy.get(`[role="option"]`).first().click();
-
- cy.waitForStableDOM();
-
- cy.get('[data-cy="incident-data-section"]').should('not.exist');
-
cy.conditionalIntercept(
'**/graphql',
(req) => req.body.operationName === 'UpdateSubmission',
@@ -1425,15 +1414,23 @@ describe('Submitted reports', () => {
}
);
- cy.get('@modal').contains('Update').click();
+ cy.visit(url);
- cy.wait('@UpsertGoogle')
- .its('request.body.variables.entity.entity_id')
- .should('eq', 'google');
+ cy.wait('@FindSubmissions');
- cy.wait('@UpsertAdults')
- .its('request.body.variables.entity.entity_id')
- .should('eq', 'adults');
+ cy.visit(url + `?editSubmission=${submittedReports.data.submissions[0]._id}`);
+
+ cy.waitForStableDOM();
+
+ cy.get(`input[name="incident_ids"]`).type('1');
+
+ cy.waitForStableDOM();
+
+ cy.get(`[role="option"]`).first().click();
+
+ cy.waitForStableDOM();
+
+ cy.get('[data-cy="incident-data-section"]').should('not.exist');
cy.wait('@UpdateSubmission').then((xhr) => {
expect(xhr.request.body.variables.query).to.deep.nested.include({
@@ -1445,7 +1442,13 @@ describe('Submitted reports', () => {
});
});
- cy.get('@modal').should('not.exist');
+ cy.wait('@UpsertGoogle')
+ .its('request.body.variables.entity.entity_id')
+ .should('eq', 'google');
+
+ cy.wait('@UpsertAdults')
+ .its('request.body.variables.entity.entity_id')
+ .should('eq', 'adults');
}
);
});
diff --git a/site/gatsby-site/cypress/e2e/integration/pages.cy.js b/site/gatsby-site/cypress/e2e/integration/pages.cy.js
index c507e007c3..ead36103eb 100644
--- a/site/gatsby-site/cypress/e2e/integration/pages.cy.js
+++ b/site/gatsby-site/cypress/e2e/integration/pages.cy.js
@@ -122,6 +122,7 @@ describe('Pages', () => {
if (selectorExists) {
cy.get('[data-cy="cloudinary-image-wrapper"]').each(($el) => {
cy.wrap($el)
+ .scrollIntoView()
.find('[data-cy="cloudinary-image"]')
.should('have.attr', 'src')
.then(($src) => {
diff --git a/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js b/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js
index d962f5599b..2ce4d4b2d5 100644
--- a/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js
+++ b/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js
@@ -51,6 +51,10 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => {
cy.get('[data-cy=btn-share-twitter]').first().click();
cy.get('@popup_twitter', { timeout: 8000 }).should('be.called');
+ cy.url().should(
+ 'contain',
+ `https://twitter.com/i/flow/login?redirect_after_login=%2Fintent%2Ftweet%3Ftext%3D`
+ );
cy.url().should('contain', `url%3D${encodeURIComponent(canonicalUrl)}`);
});
diff --git a/site/gatsby-site/cypress/e2e/integration/submit.cy.js b/site/gatsby-site/cypress/e2e/integration/submit.cy.js
index 482c57da7f..3d9940ef4a 100644
--- a/site/gatsby-site/cypress/e2e/integration/submit.cy.js
+++ b/site/gatsby-site/cypress/e2e/integration/submit.cy.js
@@ -1,5 +1,3 @@
-import { isArray } from 'lodash';
-import { arrayToList } from '../../../src/utils/typography';
import parseNews from '../../fixtures/api/parseNews.json';
import semanticallyRelated from '../../fixtures/api/semanticallyRelated.json';
import probablyRelatedIncidents from '../../fixtures/incidents/probablyRelatedIncidents.json';
@@ -401,41 +399,16 @@ describe('The Submit form', () => {
cy.contains('Report successfully added to review queue').should('exist');
+ cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword'));
+
cy.visit('/apps/submitted');
cy.wait('@findSubmissions');
cy.contains(
- '[data-cy="submission"]',
+ '[data-cy="row"]',
'YouTube to crack down on inappropriate content masked as kids’ cartoons'
).should('exist');
- cy.get('[data-cy="submission"] [data-cy="review-button"]').click();
-
- const expectedValues = {
- _id: '6272f2218933c7a9b512e13b',
- text: 'Something',
- submitters: 'Something',
- authors: 'Valentina Palladino',
- incident_date: '2021-09-21',
- date_published: '2017-11-10',
- image_url:
- 'https://cdn.arstechnica.net/wp-content/uploads/2017/11/Screen-Shot-2017-11-10-at-9.25.47-AM-760x380.png',
- incident_ids: [1],
- url: `https://www.arstechnica.com/gadgets/2017/11/youtube-to-crack-down-on-inappropriate-content-masked-as-kids-cartoons/`,
- source_domain: 'arstechnica.com',
- language: 'en',
- editor_notes: 'Here are some notes',
- };
-
- for (let key in expectedValues) {
- cy.get(`[data-cy="${key}"]`)
- .contains(
- isArray(expectedValues[key]) ? arrayToList(expectedValues[key]) : expectedValues[key]
- )
- .should('exist');
- }
-
- cy.contains('Please review. Some data is missing.').should('not.exist');
});
it('Should show a toast on error when failing to reach parsing endpoint', () => {
diff --git a/site/gatsby-site/cypress/fixtures/submissions/submitted.json b/site/gatsby-site/cypress/fixtures/submissions/submitted.json
index f8099d7f21..0314b73166 100644
--- a/site/gatsby-site/cypress/fixtures/submissions/submitted.json
+++ b/site/gatsby-site/cypress/fixtures/submissions/submitted.json
@@ -15,6 +15,7 @@
"epoch_date_modified": 1686163744,
"description": "By NEIL BEDI and KATHLEEN McGRORY\nTimes staff writers\nNov. 19, 2020\nThe Pasco Sheriff’s Office keeps a secret list of kids it thinks could “fall into a life of crime” based on factors like wheth",
"image_url": "https://s3.amazonaws.com/ledejs/resized/s2020-pasco-ilp/600/nocco5.jpg",
+ "incident_title": "Submisssion 1 title",
"incident_date": "2015-09-01",
"incident_ids": [],
"language": "en",
@@ -119,6 +120,7 @@
"date_submitted": "2021-08-23",
"epoch_date_modified": 1686163744,
"image_url": "https://skylightcyber.com/2019/07/18/cylance-i-kill-you/cylance-i-kill-you-small.gif",
+ "incident_title": "Submission 3 title",
"incident_date": "2019-07-18",
"incident_ids": [],
"language": "en",
diff --git a/site/gatsby-site/i18n/locales/es/submitted.json b/site/gatsby-site/i18n/locales/es/submitted.json
index 02caa7663f..025dd115dc 100644
--- a/site/gatsby-site/i18n/locales/es/submitted.json
+++ b/site/gatsby-site/i18n/locales/es/submitted.json
@@ -17,5 +17,25 @@
"Successfully promoted submission to Issue {{report_number}}": "Envío promocionado con éxito al Problema {{report_number}}",
"Are you sure this is a new incident? This will create a permanent record with all the details you provided about the incident.": "¿Seguro que desea promocionar este Envío a un nuevo Incidente?",
"Sure you want to promote this Submission and link it to Incident {{incident_id}}?": "¿Seguro que desea promocionar este Envío y vincularlo al Incidente {{incident_id}}?",
- "Are you sure you want to delete “{{url}}”?": "¿Estás seguro de que quieres eliminar “{{url}}”?"
+ "Are you sure you want to delete “{{url}}”?": "¿Estás seguro de que quieres eliminar “{{url}}”?",
+ "Editing Submission": "Editando Envío",
+ "Pending Review": "Revisión Pendiente",
+ "Back to Submission List": "Volver a la lista de envíos",
+ "Editors": "Editores",
+ "Unassigned": "Sin asignar",
+ "Status": "Estado",
+ "In Review": "En Revisión",
+ "Add as new": "Agregar como nuevo",
+ "Accept": "Aceptar",
+ "Reject": "Rechazar",
+ "Promoting to incident": "Promoviendo a incidente",
+ "Promoting to issue": "Promoviendo a problema",
+ "Adding as incident": "Agregando como incidente",
+ "Adding as issue": "Agregando como problema",
+ "Are you sure you want to reject this submission? This will permanently delete the submission.": "¿Estás seguro de que quieres rechazar este envío? Esto eliminará permanentemente el envío.",
+ "Changes saved": "Cambios guardados",
+ "There was an error claiming this submission. Please try again.": "Hubo un error al reclamar este envío. Por favor, inténtelo de nuevo.",
+ "Claim": "Reclamar",
+ "Claiming...": "Reclamando...",
+ "Reviewing": "Revisando"
}
diff --git a/site/gatsby-site/i18n/locales/es/translation.json b/site/gatsby-site/i18n/locales/es/translation.json
index d4d306a66b..c1535fb6af 100644
--- a/site/gatsby-site/i18n/locales/es/translation.json
+++ b/site/gatsby-site/i18n/locales/es/translation.json
@@ -265,6 +265,7 @@
"Subscribe to the AI Incident Briefing and get monthly incident round-ups along with occasional major database updates.": "Subscribe to the AI Incident Briefing and get monthly incident round-ups along with occasional major database updates.",
"Check your inbox for the AI Incident Briefing, which includes incident round-ups along with occasional major database updates. You can manage your subscription status from the links in the email footer.": "Check your inbox for the AI Incident Briefing, which includes incident round-ups along with occasional major database updates. You can manage your subscription status from the links in the email footer.",
"Image URL is invalid, using fallback image": "La URL de la imagen no es válida, se utilizará la imagen de respaldo",
+ "Issue": "Problema",
"You have successfully create Incident {{newIncidentId}}. <4>View incident4>.": "Incidente {{newIncidentId}} creado exitosamente. <4>Ver Incidente4>.",
"New Incident": "Nuevo Incidente",
diff --git a/site/gatsby-site/i18n/locales/fr/submitted.json b/site/gatsby-site/i18n/locales/fr/submitted.json
index 9966465bef..6e67305efb 100644
--- a/site/gatsby-site/i18n/locales/fr/submitted.json
+++ b/site/gatsby-site/i18n/locales/fr/submitted.json
@@ -17,5 +17,25 @@
"Successfully promoted submission to Issue {{report_number}}": "Soumission promue avec succès au problème {{report_number}}",
"Are you sure this is a new incident? This will create a permanent record with all the details you provided about the incident.": "Êtes-vous sûr qu'il s'agit d'un nouvel incident? Cela créera un enregistrement permanent avec tous les détails que vous avez fournis sur l'incident.",
"Sure you want to promote this Submission and link it to Incident {{incident_id}}?": "Voulez-vous vraiment promouvoir cette soumission et la lier à l'incident {{incident_id}}?",
- "Are you sure you want to delete “{{url}}”?": "Voulez-vous vraiment effacer « {{url}} » ?"
+ "Are you sure you want to delete “{{url}}”?": "Voulez-vous vraiment effacer « {{url}} » ?",
+ "Editing Submission": "Édition de la soumission",
+ "Pending Review": "En attente de révision",
+ "Back to Submission List": "Retour à la liste des soumissions",
+ "Editors": "Éditeurs",
+ "Unassigned": "Non assigné",
+ "Status": "Statut",
+ "In Review": "En révision",
+ "Add as new": "Ajouter comme",
+ "Accept": "Accepter",
+ "Reject": "Rejeter",
+ "Promoting to incident": "Promouvoir en tant qu'incident",
+ "Promoting to issue": "Promouvoir en tant que problème",
+ "Adding as incident": "Ajout en tant qu'incident",
+ "Adding as issue": "Ajout en tant que problème",
+ "Are you sure you want to reject this submission? This will permanently delete the submission.": "Voulez-vous vraiment rejeter cette soumission? Cela supprimera définitivement la soumission.",
+ "Changes saved": "Modifications enregistrées",
+ "There was an error claiming this submission. Please try again.": "Une erreur s'est produite lors de la réclamation de cette soumission. Veuillez réessayer.",
+ "Claim": "Réclamer",
+ "Claiming...": "En cours...",
+ "Reviewing": "Révision"
}
diff --git a/site/gatsby-site/i18n/locales/fr/translation.json b/site/gatsby-site/i18n/locales/fr/translation.json
index 9ece79754e..44590d5eae 100644
--- a/site/gatsby-site/i18n/locales/fr/translation.json
+++ b/site/gatsby-site/i18n/locales/fr/translation.json
@@ -254,6 +254,7 @@
"Subscribe to the AI Incident Briefing and get monthly incident round-ups along with occasional major database updates.": "Subscribe to the AI Incident Briefing and get monthly incident round-ups along with occasional major database updates.",
"Check your inbox for the AI Incident Briefing, which includes incident round-ups along with occasional major database updates. You can manage your subscription status from the links in the email footer.": "Check your inbox for the AI Incident Briefing, which includes incident round-ups along with occasional major database updates. You can manage your subscription status from the links in the email footer.",
"Image URL is invalid, using fallback image": "L'URL de l'image n'est pas valide, utilisation d'une image de remplacement",
+ "Issue": "Problème",
"You have successfully create Incident {{newIncidentId}}. <4>View incident4>.": "Vous avez réussi à créer l'incident {{newIncidentId}}. <4>Voir l'incident4>.",
"New Incident": "Nouvel Incident",
"csetCharts": "La taxonomie CSET AI Harm pour AIID est la deuxième édition de la taxonomie CSET incident. Il caractérise les dommages, les entités et les technologies impliquées dans les incidents d'IA et les circonstances de leur apparition. Les graphiques ci-dessous montrent certains champs de la taxonomie CSET AI Harm pour AIID. Des détails sur chaque champ peuvent être trouvés <1>ici1>. Cependant, de brèves descriptions du champ sont fournies au-dessus de chaque graphique.",
diff --git a/site/gatsby-site/src/components/Layout.js b/site/gatsby-site/src/components/Layout.js
index a99191c972..1587123009 100644
--- a/site/gatsby-site/src/components/Layout.js
+++ b/site/gatsby-site/src/components/Layout.js
@@ -12,7 +12,7 @@ const Layout = ({ children, className, sidebarCollapsed = false, location }) =>
<>