From a6a81788d7e461276d308da79fd871946e22a384 Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Mon, 16 Dec 2024 10:49:01 -0300 Subject: [PATCH 1/7] Update translations to replace "Implicated AI system(s)" with "Alleged implicated AI system(s)" in multiple locales and components --- site/gatsby-site/i18n/locales/es/entities.json | 4 ++-- site/gatsby-site/i18n/locales/fr/entities.json | 4 ++-- site/gatsby-site/i18n/locales/ja/entities.json | 4 ++-- site/gatsby-site/playwright/e2e-full/cite.spec.ts | 2 +- site/gatsby-site/playwright/e2e-full/dynamicCite.spec.ts | 2 +- site/gatsby-site/src/components/entities/AllegedEntities.js | 2 +- site/gatsby-site/src/components/submissions/SubmissionForm.js | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/site/gatsby-site/i18n/locales/es/entities.json b/site/gatsby-site/i18n/locales/es/entities.json index ad0e9a5f5e..0f593958e0 100644 --- a/site/gatsby-site/i18n/locales/es/entities.json +++ b/site/gatsby-site/i18n/locales/es/entities.json @@ -21,8 +21,8 @@ "Incidents involved as both Developer and Deployer": "Incidentes involucrados como desarrollador e implementador", "Incidents Harmed By": "Afectado por Incidentes", "Alleged: <2> developed and deployed an AI system, which harmed <6>.": "Presunto: un sistema de IA desarrollado e implementado por <2>, perjudicó a <6>.", - "Implicated AI system:": "Sistema de IA implicado:", - "Implicated AI systems:": "Sistemas de IA implicados:", + "Alleged implicated AI system:": "Sistema de IA implicado:", + "Alleged implicated AI systems:": "Sistemas de IA implicados:", "Alleged: <1> developed an AI system deployed by <4>, which harmed <6>.": "Presunto: un sistema de IA desarrollado por <1> e implementado por <4>, perjudicó a <6>.", "Entities involved in AI Incidents": "^Entities involved in AI Incidents", "{{count}} Incident responses": "{{count}} respuestas de incidentes", diff --git a/site/gatsby-site/i18n/locales/fr/entities.json b/site/gatsby-site/i18n/locales/fr/entities.json index 6eac29c7fc..d0828ed407 100644 --- a/site/gatsby-site/i18n/locales/fr/entities.json +++ b/site/gatsby-site/i18n/locales/fr/entities.json @@ -28,6 +28,6 @@ "Back to Entity: {{name}}": "Retour à l'entité: {{name}}", "Entity updated successfully.": "Entité mise à jour avec succès.", "Error updating Entity.": "Erreur lors de la mise à jour de l'entité.", - "Implicated AI system:": "Système de l'IA impliqué:", - "Implicated AI systems:": "Systèmes de l'IA impliqués:" + "Alleged implicated AI system:": "Système de l'IA impliqué:", + "Alleged implicated AI systems:": "Systèmes de l'IA impliqués:" } diff --git a/site/gatsby-site/i18n/locales/ja/entities.json b/site/gatsby-site/i18n/locales/ja/entities.json index 462109f69a..9f8f4c5e51 100644 --- a/site/gatsby-site/i18n/locales/ja/entities.json +++ b/site/gatsby-site/i18n/locales/ja/entities.json @@ -29,6 +29,6 @@ "Back to Entity: {{name}}": "組織に戻る: {{name}}", "Entity updated successfully.": "組織が正常に更新されました。", "Error updating Entity.": "組織の更新中にエラーが発生しました。", - "Implicated AI system:": "AI関連システム:", - "Implicated AI systems:": "AI関連システム:" + "Alleged implicated AI system:": "AI関連システム:", + "Alleged implicated AI systems:": "AI関連システム:" } diff --git a/site/gatsby-site/playwright/e2e-full/cite.spec.ts b/site/gatsby-site/playwright/e2e-full/cite.spec.ts index 9595ad4663..474a01a504 100644 --- a/site/gatsby-site/playwright/e2e-full/cite.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/cite.spec.ts @@ -452,7 +452,7 @@ test.describe('Cite pages', () => { test('Should show proper entities card text', async ({ page }) => { await page.goto('/cite/3/'); await expect(page.locator('[data-cy="alleged-entities"]')).toHaveText( - 'Alleged: Kronos developed an AI system deployed by Starbucks, which harmed Starbucks Employees.Implicated AI system: Entity 1' + 'Alleged: Kronos developed an AI system deployed by Starbucks, which harmed Starbucks Employees.Alleged implicated AI system: Entity 1' ); }); diff --git a/site/gatsby-site/playwright/e2e-full/dynamicCite.spec.ts b/site/gatsby-site/playwright/e2e-full/dynamicCite.spec.ts index 05493b33f7..bdd17025d4 100644 --- a/site/gatsby-site/playwright/e2e-full/dynamicCite.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/dynamicCite.spec.ts @@ -34,7 +34,7 @@ test.describe('Dynamic Cite pages', () => { await expect(page.getByText(`Kronos’s scheduling algorithm and its use by Starbucks managers allegedly negatively impacted financial and scheduling stability for Starbucks employees, which disadvantaged wage workers.`)).toBeVisible(); await expect(page.locator('[data-cy="alleged-entities"]')).toHaveText( - 'Alleged: Kronos developed an AI system deployed by Starbucks, which harmed Starbucks Employees.Implicated AI system: Entity 1' + 'Alleged: Kronos developed an AI system deployed by Starbucks, which harmed Starbucks Employees.Alleged implicated AI system: Entity 1' ); await expect(page.locator('[data-cy="citation"]').getByText("Report Count", { exact: true }).locator('xpath=following-sibling::div[1]')).toHaveText('2'); diff --git a/site/gatsby-site/src/components/entities/AllegedEntities.js b/site/gatsby-site/src/components/entities/AllegedEntities.js index b3d193c742..31b41b1b7f 100644 --- a/site/gatsby-site/src/components/entities/AllegedEntities.js +++ b/site/gatsby-site/src/components/entities/AllegedEntities.js @@ -51,7 +51,7 @@ function ImplicatedSystemsList({ entities }) {
{entities.length > 0 && ( <> - Implicated AI system{entities.length > 1 ? 's' : ''}:{' '} + Alleged implicated AI system{entities.length > 1 ? 's' : ''}:{' '} {' '} )} diff --git a/site/gatsby-site/src/components/submissions/SubmissionForm.js b/site/gatsby-site/src/components/submissions/SubmissionForm.js index 537cf9bcf4..b634a0b1d6 100644 --- a/site/gatsby-site/src/components/submissions/SubmissionForm.js +++ b/site/gatsby-site/src/components/submissions/SubmissionForm.js @@ -434,7 +434,7 @@ const SubmissionForm = ({ onChange = null }) => { Date: Mon, 16 Dec 2024 10:53:34 -0300 Subject: [PATCH 2/7] Update translations for "Alleged implicated AI system(s)" in Spanish, French, and Japanese locales --- site/gatsby-site/i18n/locales/es/entities.json | 4 ++-- site/gatsby-site/i18n/locales/fr/entities.json | 4 ++-- site/gatsby-site/i18n/locales/ja/entities.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/site/gatsby-site/i18n/locales/es/entities.json b/site/gatsby-site/i18n/locales/es/entities.json index 0f593958e0..0a8c30d0b2 100644 --- a/site/gatsby-site/i18n/locales/es/entities.json +++ b/site/gatsby-site/i18n/locales/es/entities.json @@ -21,8 +21,8 @@ "Incidents involved as both Developer and Deployer": "Incidentes involucrados como desarrollador e implementador", "Incidents Harmed By": "Afectado por Incidentes", "Alleged: <2> developed and deployed an AI system, which harmed <6>.": "Presunto: un sistema de IA desarrollado e implementado por <2>, perjudicó a <6>.", - "Alleged implicated AI system:": "Sistema de IA implicado:", - "Alleged implicated AI systems:": "Sistemas de IA implicados:", + "Alleged implicated AI system:": "Presunto: sistema de IA implicado:", + "Alleged implicated AI systems:": "Presunto: sistemas de IA implicados:", "Alleged: <1> developed an AI system deployed by <4>, which harmed <6>.": "Presunto: un sistema de IA desarrollado por <1> e implementado por <4>, perjudicó a <6>.", "Entities involved in AI Incidents": "^Entities involved in AI Incidents", "{{count}} Incident responses": "{{count}} respuestas de incidentes", diff --git a/site/gatsby-site/i18n/locales/fr/entities.json b/site/gatsby-site/i18n/locales/fr/entities.json index d0828ed407..cc602b73c3 100644 --- a/site/gatsby-site/i18n/locales/fr/entities.json +++ b/site/gatsby-site/i18n/locales/fr/entities.json @@ -28,6 +28,6 @@ "Back to Entity: {{name}}": "Retour à l'entité: {{name}}", "Entity updated successfully.": "Entité mise à jour avec succès.", "Error updating Entity.": "Erreur lors de la mise à jour de l'entité.", - "Alleged implicated AI system:": "Système de l'IA impliqué:", - "Alleged implicated AI systems:": "Systèmes de l'IA impliqués:" + "Alleged implicated AI system:": "Présumé : système de l'IA impliqué:", + "Alleged implicated AI systems:": "Présumé : systèmes de l'IA impliqués:" } diff --git a/site/gatsby-site/i18n/locales/ja/entities.json b/site/gatsby-site/i18n/locales/ja/entities.json index 9f8f4c5e51..ea045a1104 100644 --- a/site/gatsby-site/i18n/locales/ja/entities.json +++ b/site/gatsby-site/i18n/locales/ja/entities.json @@ -29,6 +29,6 @@ "Back to Entity: {{name}}": "組織に戻る: {{name}}", "Entity updated successfully.": "組織が正常に更新されました。", "Error updating Entity.": "組織の更新中にエラーが発生しました。", - "Alleged implicated AI system:": "AI関連システム:", - "Alleged implicated AI systems:": "AI関連システム:" + "Alleged implicated AI system:": "推定: AI関連システム:", + "Alleged implicated AI systems:": "推定: AI関連システム:" } From 8c6b098a042806d2f86ae66f7aa6e13d0f7cce16 Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Mon, 16 Dec 2024 10:55:52 -0300 Subject: [PATCH 3/7] Update translations for "Alleged implicated AI system(s)" in Spanish, French, and Japanese locales --- site/gatsby-site/i18n/locales/es/entities.json | 4 ++-- site/gatsby-site/i18n/locales/fr/entities.json | 4 ++-- site/gatsby-site/i18n/locales/ja/entities.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/site/gatsby-site/i18n/locales/es/entities.json b/site/gatsby-site/i18n/locales/es/entities.json index 0a8c30d0b2..bb9e996cae 100644 --- a/site/gatsby-site/i18n/locales/es/entities.json +++ b/site/gatsby-site/i18n/locales/es/entities.json @@ -21,8 +21,8 @@ "Incidents involved as both Developer and Deployer": "Incidentes involucrados como desarrollador e implementador", "Incidents Harmed By": "Afectado por Incidentes", "Alleged: <2> developed and deployed an AI system, which harmed <6>.": "Presunto: un sistema de IA desarrollado e implementado por <2>, perjudicó a <6>.", - "Alleged implicated AI system:": "Presunto: sistema de IA implicado:", - "Alleged implicated AI systems:": "Presunto: sistemas de IA implicados:", + "Alleged implicated AI system:": "Sistema de IA presuntamente implicado:", + "Alleged implicated AI systems:": "Sistemas de IA presuntamente implicados:", "Alleged: <1> developed an AI system deployed by <4>, which harmed <6>.": "Presunto: un sistema de IA desarrollado por <1> e implementado por <4>, perjudicó a <6>.", "Entities involved in AI Incidents": "^Entities involved in AI Incidents", "{{count}} Incident responses": "{{count}} respuestas de incidentes", diff --git a/site/gatsby-site/i18n/locales/fr/entities.json b/site/gatsby-site/i18n/locales/fr/entities.json index cc602b73c3..af94f35660 100644 --- a/site/gatsby-site/i18n/locales/fr/entities.json +++ b/site/gatsby-site/i18n/locales/fr/entities.json @@ -28,6 +28,6 @@ "Back to Entity: {{name}}": "Retour à l'entité: {{name}}", "Entity updated successfully.": "Entité mise à jour avec succès.", "Error updating Entity.": "Erreur lors de la mise à jour de l'entité.", - "Alleged implicated AI system:": "Présumé : système de l'IA impliqué:", - "Alleged implicated AI systems:": "Présumé : systèmes de l'IA impliqués:" + "Alleged implicated AI system:": "Systèmes d'IA présumés impliqués:", + "Alleged implicated AI systems:": "Systèmes d'IA présumés impliqués:" } diff --git a/site/gatsby-site/i18n/locales/ja/entities.json b/site/gatsby-site/i18n/locales/ja/entities.json index ea045a1104..8d37e689ed 100644 --- a/site/gatsby-site/i18n/locales/ja/entities.json +++ b/site/gatsby-site/i18n/locales/ja/entities.json @@ -29,6 +29,6 @@ "Back to Entity: {{name}}": "組織に戻る: {{name}}", "Entity updated successfully.": "組織が正常に更新されました。", "Error updating Entity.": "組織の更新中にエラーが発生しました。", - "Alleged implicated AI system:": "推定: AI関連システム:", - "Alleged implicated AI systems:": "推定: AI関連システム:" + "Alleged implicated AI system:": "関与が疑われるAIシステム:", + "Alleged implicated AI systems:": "関与が疑われるAIシステム:" } From 4e55b586283009704ed7f94f1cd3f5ee25964c84 Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Fri, 20 Dec 2024 10:11:04 -0300 Subject: [PATCH 4/7] Update translations and validation messages for "Alleged implicated AI systems" in Spanish, French, and Japanese locales --- site/gatsby-site/i18n/locales/es/submit.json | 4 +++- site/gatsby-site/i18n/locales/es/validation.json | 5 +++-- site/gatsby-site/i18n/locales/fr/submit.json | 4 +++- site/gatsby-site/i18n/locales/fr/validation.json | 5 +++-- site/gatsby-site/i18n/locales/ja/submit.json | 4 +++- site/gatsby-site/i18n/locales/ja/validation.json | 10 +++++++--- .../src/components/forms/SubmissionWizard/StepThree.js | 4 ++-- site/gatsby-site/src/components/submissions/schemas.js | 5 +++++ 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/site/gatsby-site/i18n/locales/es/submit.json b/site/gatsby-site/i18n/locales/es/submit.json index 37289145f7..44ae192c7d 100644 --- a/site/gatsby-site/i18n/locales/es/submit.json +++ b/site/gatsby-site/i18n/locales/es/submit.json @@ -64,5 +64,7 @@ "Saving as draft...": "Guardando como borrador...", "Implicated Systems": "Sistemas Implicados", "What systems were involved in the incident?": "¿Qué sistemas estuvieron involucrados en el incidente?", - "Please confirm you are ready to submit this report. Report details cannot be changed after submission.": "Por favor confirma que estás listo para enviar este informe. Los detalles del informe no se pueden cambiar después de la presentación." + "Please confirm you are ready to submit this report. Report details cannot be changed after submission.": "Por favor confirma que estás listo para enviar este informe. Los detalles del informe no se pueden cambiar después de la presentación.", + "Alleged implicated AI systems": "Sistemas de IA presuntamente implicados", + "Which AI systems were involved?": "¿Qué sistemas de IA estuvieron involucrados?" } diff --git a/site/gatsby-site/i18n/locales/es/validation.json b/site/gatsby-site/i18n/locales/es/validation.json index 8b25ed4c09..785a263de8 100644 --- a/site/gatsby-site/i18n/locales/es/validation.json +++ b/site/gatsby-site/i18n/locales/es/validation.json @@ -35,6 +35,7 @@ "*Incident Date is required": "*Fecha del incidente es obligatoria", "*Incident Date required": "*Fecha del incidente es obligatoria", "*Incident ID(s) must be a number": "*El ID del incidente debe ser un número", - "Implicated Systems must have at least 3 characters": "Los sistemas implicados deben tener al menos 3 caracteres", - "Implicated Systems can't be longer than 200 characters": "Los sistemas implicados no pueden tener más de 200 caracteres" + "Alleged implicated AI Systems must have at least 3 characters": "Los sistemas implicados deben tener al menos 3 caracteres", + "Alleged implicated AI Systems can't be longer than 200 characters": "Los sistemas implicados no pueden tener más de 200 caracteres", + "*Alleged Implicated AI Systems is required": "Se requieren los sistemas de IA presuntamente implicados" } diff --git a/site/gatsby-site/i18n/locales/fr/submit.json b/site/gatsby-site/i18n/locales/fr/submit.json index dc101887be..a853d31453 100644 --- a/site/gatsby-site/i18n/locales/fr/submit.json +++ b/site/gatsby-site/i18n/locales/fr/submit.json @@ -61,5 +61,7 @@ "Saving as draft...": "Enregistrement en tant que brouillon...", "Implicated Systems": "Systèmes impliqués", "What systems were involved in the incident?": "Quels systèmes étaient impliqués dans l'incident ?", - "Please confirm you are ready to submit this report. Report details cannot be changed after submission.": "Veuillez confirmer que vous êtes prêt à soumettre ce rapport. Les détails du rapport ne peuvent pas être modifiés après la soumission." + "Please confirm you are ready to submit this report. Report details cannot be changed after submission.": "Veuillez confirmer que vous êtes prêt à soumettre ce rapport. Les détails du rapport ne peuvent pas être modifiés après la soumission.", + "Alleged implicated AI systems": "Systèmes IA impliqués présumés", + "Which AI systems were involved?": "Quels systèmes IA étaient impliqués ?" } diff --git a/site/gatsby-site/i18n/locales/fr/validation.json b/site/gatsby-site/i18n/locales/fr/validation.json index 75fb77e759..212464f4bc 100644 --- a/site/gatsby-site/i18n/locales/fr/validation.json +++ b/site/gatsby-site/i18n/locales/fr/validation.json @@ -29,6 +29,7 @@ "*Incident Date is required": "*Date de l'incident requise", "*Incident Date required": "*Date de l'incident requise", "*Incident ID(s) must be a number": "*L'ID de l'incident doit être un nombre", - "Implicated Systems must have at least 3 characters": "Les systèmes impliqués doivent comporter au moins 3 caractères", - "Implicated Systems can't be longer than 200 characters": "Les systèmes impliqués ne peuvent pas comporter plus de 200 caractères" + "Alleged implicated AI Systems must have at least 3 characters": "Les systèmes impliqués doivent avoir au moins 3 caractères", + "Alleged implicated AI Systems can't be longer than 200 characters": "Les systèmes impliqués ne peuvent pas comporter plus de 200 caractères", + "*Alleged Implicated AI Systems is required": "Les systèmes d'IA présumés impliqués sont requis" } diff --git a/site/gatsby-site/i18n/locales/ja/submit.json b/site/gatsby-site/i18n/locales/ja/submit.json index be5758583e..a068400a1c 100644 --- a/site/gatsby-site/i18n/locales/ja/submit.json +++ b/site/gatsby-site/i18n/locales/ja/submit.json @@ -63,5 +63,7 @@ "Saving as draft...": "下書きとして保存中...", "Implicated Systems": "関連システム", "What systems were involved in the incident?": "このインシデントに関わるシステムは何ですか?", - "Please confirm you are ready to submit this report. Report details cannot be changed after submission.": "このレポートを送信する準備ができていることを確認してください。送信後にレポートの詳細を変更することはできません" + "Please confirm you are ready to submit this report. Report details cannot be changed after submission.": "このレポートを送信する準備ができていることを確認してください。送信後にレポートの詳細を変更することはできません", + "Alleged implicated AI systems": "推定される関連AIシステム", + "Which AI systems were involved?": "どのAIシステムが関わっていましたか?" } diff --git a/site/gatsby-site/i18n/locales/ja/validation.json b/site/gatsby-site/i18n/locales/ja/validation.json index 2f030128d5..24dd5e2d10 100644 --- a/site/gatsby-site/i18n/locales/ja/validation.json +++ b/site/gatsby-site/i18n/locales/ja/validation.json @@ -14,6 +14,10 @@ "Please review submission. Some data is missing.": "投稿を確認してください。足りない情報があります", "Some data is missing.": "足りない情報があります", "Please review. Some data is missing.": "確認してください。足りない情報があります", - "Implicated Systems must have at least 3 characters": "関連システムは3文字以上でなければいけません", - "Implicated Systems can't be longer than 200 characters": "関連システムは200文字を超えることはできません" -} + "Alleged implicated AI Systems must have at least 3 characters": "関連システムは3文字以上でなければいけません", + "Alleged implicated AI Systems can't be longer than 200 characters": "関連システムは200文字を超えることはできません", + "*Alleged Implicated AI Systems is required": "関連システムは必須です", + "*Alleged developers is required": "開発者は必須です", + "*Alleged deployers is required": "デプロイヤーは必須です", + "*Alleged Harmed Parties is required": "被害を受けたとされる当事者は必須です" +} \ No newline at end of file diff --git a/site/gatsby-site/src/components/forms/SubmissionWizard/StepThree.js b/site/gatsby-site/src/components/forms/SubmissionWizard/StepThree.js index 13090e0f11..4a4c2d2d2a 100644 --- a/site/gatsby-site/src/components/forms/SubmissionWizard/StepThree.js +++ b/site/gatsby-site/src/components/forms/SubmissionWizard/StepThree.js @@ -79,11 +79,11 @@ const StepThree = (props) => { .string() .matches(/^.{3,}$/, { excludeEmptyString: true, - message: 'Implicated Systems must have at least 3 characters', + message: 'Alleged implicated AI Systems must have at least 3 characters', }) .matches(/^.{3,200}$/, { excludeEmptyString: true, - message: "Implicated Systems can't be longer than 200 characters", + message: "Alleged implicated AI Systems can't be longer than 200 characters", }) .nullable(), }); diff --git a/site/gatsby-site/src/components/submissions/schemas.js b/site/gatsby-site/src/components/submissions/schemas.js index f31e11b8bb..5b20b6dc3e 100644 --- a/site/gatsby-site/src/components/submissions/schemas.js +++ b/site/gatsby-site/src/components/submissions/schemas.js @@ -76,6 +76,11 @@ export const schema = yup.object().shape({ then: yup.string().required('*Alleged Harmed Parties is required'), otherwise: yup.string().nullable(), }), + implicated_systems: yup.string().when('incident_ids', { + is: (incident_ids) => !incident_ids || incident_ids.length == 0, + then: yup.string().required('*Alleged Implicated AI Systems is required'), + otherwise: yup.string().nullable(), + }), authors: yup .array( yup From e1aad55e78e38a680e7292e9c8f55a12ae383d82 Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Fri, 20 Dec 2024 10:32:58 -0300 Subject: [PATCH 5/7] Add implicated systems to submitted reports test data --- site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts b/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts index f3e665a520..5f8a1bd476 100644 --- a/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts @@ -326,6 +326,7 @@ test.describe('Submitted reports', () => { editor_notes: "", description: 'Sarasa', title: "", + implicated_systems: ["entity-1"], }] await init({ aiidprod: { submissions } }); From 77f339d9effd3f3cfeac287403c496f8802a3421 Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Fri, 20 Dec 2024 17:54:20 -0300 Subject: [PATCH 6/7] Add validation messages and schema for implicated AI systems in multiple locales --- .../i18n/locales/es/validation.json | 4 +- .../i18n/locales/fr/validation.json | 4 +- .../i18n/locales/ja/validation.json | 4 +- .../e2e-full/apps/submitted.spec.ts | 79 +++++++++++++++++++ .../src/components/submissions/schemas.js | 14 ++-- 5 files changed, 96 insertions(+), 9 deletions(-) diff --git a/site/gatsby-site/i18n/locales/es/validation.json b/site/gatsby-site/i18n/locales/es/validation.json index 785a263de8..a66368aa72 100644 --- a/site/gatsby-site/i18n/locales/es/validation.json +++ b/site/gatsby-site/i18n/locales/es/validation.json @@ -37,5 +37,7 @@ "*Incident ID(s) must be a number": "*El ID del incidente debe ser un número", "Alleged implicated AI Systems must have at least 3 characters": "Los sistemas implicados deben tener al menos 3 caracteres", "Alleged implicated AI Systems can't be longer than 200 characters": "Los sistemas implicados no pueden tener más de 200 caracteres", - "*Alleged Implicated AI Systems is required": "Se requieren los sistemas de IA presuntamente implicados" + "*Alleged Implicated AI Systems is required": "Se requieren los sistemas de IA presuntamente implicados", + "Implicated AI systems must have at least 3 characters": "Los sistemas de IA implicados deben tener al menos 3 caracteres", + "Implicated AI systems can't be longer than 200 characters": "Los sistemas de IA implicados no pueden tener más de 200 caracteres" } diff --git a/site/gatsby-site/i18n/locales/fr/validation.json b/site/gatsby-site/i18n/locales/fr/validation.json index 212464f4bc..a9c9e3d2cd 100644 --- a/site/gatsby-site/i18n/locales/fr/validation.json +++ b/site/gatsby-site/i18n/locales/fr/validation.json @@ -31,5 +31,7 @@ "*Incident ID(s) must be a number": "*L'ID de l'incident doit être un nombre", "Alleged implicated AI Systems must have at least 3 characters": "Les systèmes impliqués doivent avoir au moins 3 caractères", "Alleged implicated AI Systems can't be longer than 200 characters": "Les systèmes impliqués ne peuvent pas comporter plus de 200 caractères", - "*Alleged Implicated AI Systems is required": "Les systèmes d'IA présumés impliqués sont requis" + "*Alleged Implicated AI Systems is required": "Les systèmes d'IA présumés impliqués sont requis", + "Implicated AI systems must have at least 3 characters": "Les systèmes de l'IA impliqués doivent avoir au moins 3 caractères", + "Implicated AI systems can't be longer than 200 characters": "Les systèmes de l'IA impliqués ne peuvent pas comporter plus de 200 caractères" } diff --git a/site/gatsby-site/i18n/locales/ja/validation.json b/site/gatsby-site/i18n/locales/ja/validation.json index 24dd5e2d10..e867f96b7c 100644 --- a/site/gatsby-site/i18n/locales/ja/validation.json +++ b/site/gatsby-site/i18n/locales/ja/validation.json @@ -19,5 +19,7 @@ "*Alleged Implicated AI Systems is required": "関連システムは必須です", "*Alleged developers is required": "開発者は必須です", "*Alleged deployers is required": "デプロイヤーは必須です", - "*Alleged Harmed Parties is required": "被害を受けたとされる当事者は必須です" + "*Alleged Harmed Parties is required": "被害を受けたとされる当事者は必須です", + "Implicated AI systems must have at least 3 characters": "関連AIシステムは3文字以上でなければいけません", + "Implicated AI systems can't be longer than 200 characters": "関連AIシステムは200文字を超えることはできません" } \ No newline at end of file diff --git a/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts b/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts index 5f8a1bd476..15dd2184c8 100644 --- a/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts @@ -80,6 +80,49 @@ test.describe('Submitted reports', () => { await page.goto(url + `?editSubmission=6140e4b4b9b4f7b3b3b1b1b1`); + const { data: {submission} } = await query({ + query: gql`{ + submission(filter: {_id: {EQ: "6140e4b4b9b4f7b3b3b1b1b1"}}) { + title + text + submitters + incident_date + incident_editors { + userId + } + status + date_published + date_downloaded + url + authors + tags + language + source_domain + image_url + cloudinary_id + deployers { + entity_id + } + developers { + entity_id + } + harmed_parties { + entity_id + } + implicated_systems { + entity_id + } + editor_notes + user { + userId + } + incident_title + description + } + } + `, + }); + await page.locator('select[data-cy="promote-select"]').selectOption('Incident'); page.on('dialog', dialog => dialog.accept()); @@ -95,6 +138,21 @@ test.describe('Submitted reports', () => { title reports { report_number + title + text + } + description + AllegedDeployerOfAISystem { + entity_id + } + AllegedDeveloperOfAISystem { + entity_id + } + AllegedHarmedOrNearlyHarmedParties { + entity_id + } + implicated_systems { + entity_id } } } @@ -102,6 +160,23 @@ test.describe('Submitted reports', () => { }); expect(incidents.find((i) => i.incident_id === 4).reports.map((r) => r.report_number)).toContain(9); + + expect(incidents.find((i) => i.incident_id === 4)).toMatchObject({ + incident_id: 4, + title: submission.incident_title, + description: submission.description, + AllegedDeployerOfAISystem: submission.deployers.map((d) => ({ entity_id: d.entity_id })), + AllegedDeveloperOfAISystem: submission.developers.map((d) => ({ entity_id: d.entity_id })), + AllegedHarmedOrNearlyHarmedParties: submission.harmed_parties.map((d) => ({ entity_id: d.entity_id })), + implicated_systems: submission.implicated_systems.map((d) => ({ entity_id: d.entity_id })), + reports: [ + { + report_number: 9, + title: submission.title, + text: submission.text + } + ] + }); }); test('Promotes a submission to a new report and links it to an existing incident', async ({ page, login }) => { @@ -284,6 +359,7 @@ test.describe('Submitted reports', () => { incident_title: "Incident title", incident_date: "2021-09-14", editor_notes: "", + implicated_systems: ["entity-1"], }] await init({ aiidprod: { submissions } }); @@ -426,6 +502,7 @@ test.describe('Submitted reports', () => { editor_notes: "", description: 'Sarasa', title: "Already Claimed", + implicated_systems: [] }] await seedCollection({ name: 'submissions', docs: submissions, drop: false }); @@ -483,6 +560,7 @@ test.describe('Submitted reports', () => { editor_notes: "", description: 'Sarasa', title: "Submission " + i, + implicated_systems: [] } }) @@ -551,6 +629,7 @@ test.describe('Submitted reports', () => { editor_notes: "", description: 'Sarasa', title: "Already Claimed", + implicated_systems: [] }] await seedCollection({ name: 'submissions', docs: submissions, drop: false }); diff --git a/site/gatsby-site/src/components/submissions/schemas.js b/site/gatsby-site/src/components/submissions/schemas.js index 5b20b6dc3e..328749aa10 100644 --- a/site/gatsby-site/src/components/submissions/schemas.js +++ b/site/gatsby-site/src/components/submissions/schemas.js @@ -29,6 +29,13 @@ const harmed_parties = yup.array( .max(200, "Harmed Parties can't be longer than 200 characters") ); +const implicated_systems = yup.array( + yup + .string() + .min(3, 'Implicated AI systems must have at least 3 characters') + .max(200, "Implicated AI systems can't be longer than 200 characters") +); + const incident_ids = yup.array(yup.number().integer().positive()); const incident_date = yup @@ -76,11 +83,6 @@ export const schema = yup.object().shape({ then: yup.string().required('*Alleged Harmed Parties is required'), otherwise: yup.string().nullable(), }), - implicated_systems: yup.string().when('incident_ids', { - is: (incident_ids) => !incident_ids || incident_ids.length == 0, - then: yup.string().required('*Alleged Implicated AI Systems is required'), - otherwise: yup.string().nullable(), - }), authors: yup .array( yup @@ -155,7 +157,7 @@ export const incidentSchema = schema.shape({ description: description.required('*Description is required'), incident_date: incident_date.required('*Incident Date required'), incident_ids: yup.mixed(), - implicated_systems: yup.array().required('*Implicated Systems is required'), + implicated_systems, }); export const reportSchema = schema.shape({ From ad75c0e7c0954a242f1f7c299e4d28133a0fc7ca Mon Sep 17 00:00:00 2001 From: Clara Youdale Date: Fri, 20 Dec 2024 18:10:40 -0300 Subject: [PATCH 7/7] Refactor submitted reports tests to remove unused fields and streamline data handling --- .../e2e-full/apps/submitted.spec.ts | 85 ++----------------- 1 file changed, 9 insertions(+), 76 deletions(-) diff --git a/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts b/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts index 15dd2184c8..937837cab2 100644 --- a/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts @@ -78,50 +78,7 @@ test.describe('Submitted reports', () => { await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { first_name: 'Test', last_name: 'User', roles: ['admin'] } }); - await page.goto(url + `?editSubmission=6140e4b4b9b4f7b3b3b1b1b1`); - - const { data: {submission} } = await query({ - query: gql`{ - submission(filter: {_id: {EQ: "6140e4b4b9b4f7b3b3b1b1b1"}}) { - title - text - submitters - incident_date - incident_editors { - userId - } - status - date_published - date_downloaded - url - authors - tags - language - source_domain - image_url - cloudinary_id - deployers { - entity_id - } - developers { - entity_id - } - harmed_parties { - entity_id - } - implicated_systems { - entity_id - } - editor_notes - user { - userId - } - incident_title - description - } - } - `, - }); + await page.goto(url + `?editSubmission=6140e4b4b9b4f7b3b3b1b1b1`); await page.locator('select[data-cy="promote-select"]').selectOption('Incident'); @@ -138,21 +95,6 @@ test.describe('Submitted reports', () => { title reports { report_number - title - text - } - description - AllegedDeployerOfAISystem { - entity_id - } - AllegedDeveloperOfAISystem { - entity_id - } - AllegedHarmedOrNearlyHarmedParties { - entity_id - } - implicated_systems { - entity_id } } } @@ -160,23 +102,6 @@ test.describe('Submitted reports', () => { }); expect(incidents.find((i) => i.incident_id === 4).reports.map((r) => r.report_number)).toContain(9); - - expect(incidents.find((i) => i.incident_id === 4)).toMatchObject({ - incident_id: 4, - title: submission.incident_title, - description: submission.description, - AllegedDeployerOfAISystem: submission.deployers.map((d) => ({ entity_id: d.entity_id })), - AllegedDeveloperOfAISystem: submission.developers.map((d) => ({ entity_id: d.entity_id })), - AllegedHarmedOrNearlyHarmedParties: submission.harmed_parties.map((d) => ({ entity_id: d.entity_id })), - implicated_systems: submission.implicated_systems.map((d) => ({ entity_id: d.entity_id })), - reports: [ - { - report_number: 9, - title: submission.title, - text: submission.text - } - ] - }); }); test('Promotes a submission to a new report and links it to an existing incident', async ({ page, login }) => { @@ -685,6 +610,9 @@ test.describe('Submitted reports', () => { AllegedHarmedOrNearlyHarmedParties { entity_id } + implicated_systems { + entity_id + } date description editor_dissimilar_incidents @@ -737,6 +665,11 @@ test.describe('Submitted reports', () => { entity_id: "entity-3", }, ], + implicated_systems: [ + { + entity_id: "entity-1", + }, + ], date: "2021-09-14", description: "Sample description", editor_dissimilar_incidents: [],