Skip to content

Commit

Permalink
Update "Implicated AI system(s)" copy adding "Alleged" (#3286)
Browse files Browse the repository at this point in the history
* Update translations to replace "Implicated AI system(s)" with "Alleged implicated AI system(s)" in multiple locales and components

* Update translations for "Alleged implicated AI system(s)" in Spanish, French, and Japanese locales

* Update translations for "Alleged implicated AI system(s)" in Spanish, French, and Japanese locales

* Update translations and validation messages for "Alleged implicated AI systems" in Spanish, French, and Japanese locales

* Add implicated systems to submitted reports test data

* Add validation messages and schema for implicated AI systems in multiple locales

* Refactor submitted reports tests to remove unused fields and streamline data handling
  • Loading branch information
clari182 authored Dec 23, 2024
1 parent 9fe3ac5 commit 8494f26
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 20 deletions.
4 changes: 2 additions & 2 deletions site/gatsby-site/i18n/locales/es/entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"Incidents involved as both Developer and Deployer": "Incidentes involucrados como desarrollador e implementador",
"Incidents Harmed By": "Afectado por Incidentes",
"Alleged: <2></2> developed and deployed an AI system, which harmed <6></6>.": "Presunto: un sistema de IA desarrollado e implementado por <2></2>, perjudicó a <6></6>.",
"Implicated AI system:": "Sistema de IA implicado:",
"Implicated AI systems:": "Sistemas de IA implicados:",
"Alleged implicated AI system:": "Sistema de IA presuntamente implicado:",
"Alleged implicated AI systems:": "Sistemas de IA presuntamente implicados:",
"Alleged: <1></1> developed an AI system deployed by <4></4>, which harmed <6></6>.": "Presunto: un sistema de IA desarrollado por <1></1> e implementado por <4></4>, perjudicó a <6></6>.",
"Entities involved in AI Incidents": "^Entities involved in AI Incidents",
"{{count}} Incident responses": "{{count}} respuestas de incidentes",
Expand Down
4 changes: 3 additions & 1 deletion site/gatsby-site/i18n/locales/es/submit.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"Incident IDs": "IDs de Incidentes",
"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?"
}
7 changes: 5 additions & 2 deletions site/gatsby-site/i18n/locales/es/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"*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",
"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"
}
2 changes: 2 additions & 0 deletions site/gatsby-site/i18n/locales/fr/entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"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èmes d'IA présumés impliqués:",
"Alleged implicated AI systems:": "Systèmes d'IA présumés impliqués:",
"Incident Responses": "Réponses aux incidents",
"Implicated AI system:": "Système de l'IA impliqué:",
"Implicated AI systems:": "Systèmes de l'IA impliqués:"
Expand Down
4 changes: 3 additions & 1 deletion site/gatsby-site/i18n/locales/fr/submit.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"Fetching...": "Chargement...",
"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 ?"
}
5 changes: 5 additions & 0 deletions site/gatsby-site/i18n/locales/fr/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"*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",
"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",
"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",
"*Text must have at least 80 characters": "*Le texte doit comporter au moins 80 caractères",
"*Text can’t be longer than 50000 characters": "*Le texte ne peut pas comporter plus de 50000 caractères",
"Please review report. Some data is missing.": "Veuillez vérifier le rapport. Certaines données manquent.",
Expand Down
4 changes: 2 additions & 2 deletions site/gatsby-site/i18n/locales/ja/entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -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システム:"
}
4 changes: 3 additions & 1 deletion site/gatsby-site/i18n/locales/ja/submit.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"Incident ID": "インシデントID",
"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システムが関わっていましたか?"
}
11 changes: 8 additions & 3 deletions site/gatsby-site/i18n/locales/ja/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"Please review submission. Some data is missing.": "投稿を確認してください。足りない情報があります",
"Some data is missing.": "足りない情報があります",
"Please review. Some data is missing.": "確認してください。足りない情報があります",
"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": "被害を受けたとされる当事者は必須です",
"Implicated AI systems must have at least 3 characters": "関連AIシステムは3文字以上でなければいけません",
"Implicated AI systems can't be longer than 200 characters": "関連AIシステムは200文字を超えることはできません",
"*Title must have at least 6 characters": "*タイトルは少なくとも6文字必要です",
"*Titles can't be longer than 500 characters": "*タイトルは500文字を超えることはできません",
"Alleged Developer must have at least 3 characters": "推定される開発者は少なくとも3文字必要です",
Expand All @@ -25,11 +33,8 @@
"Description must have at least 3 characters": "説明は少なくとも3文字必要です",
"Description can't be longer than 500 characters": "説明は500文字を超えることはできません",
"*Incident title is required": "*インシデントタイトルは必須です",
"*Alleged developers is required": "*推定されるAIシステムの開発者は必須です",
"*Alleged developer of AI system is required": "*推定されるAIシステムの開発者は必須です",
"*Alleged deployers is required": "*推定されるAIシステムのデプロイヤーは必須です",
"*Alleged deployer of AI system is required": "*推定されるAIシステムのデプロイヤーは必須です",
"*Alleged Harmed Parties is required": "*推定される被害グループは必須です",
"*Alleged harmed or nearly harmed parties is required": "*推定される被害グループは必須です",
"*Description is required": "*説明は必須です",
"*Incident Date is required": "*インシデント日は必須です",
Expand Down
15 changes: 14 additions & 1 deletion site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +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`);
await page.goto(url + `?editSubmission=6140e4b4b9b4f7b3b3b1b1b1`);

await page.locator('select[data-cy="promote-select"]').selectOption('Incident');

Expand Down Expand Up @@ -284,6 +284,7 @@ test.describe('Submitted reports', () => {
incident_title: "Incident title",
incident_date: "2021-09-14",
editor_notes: "",
implicated_systems: ["entity-1"],
}]

await init({ aiidprod: { submissions } });
Expand Down Expand Up @@ -326,6 +327,7 @@ test.describe('Submitted reports', () => {
editor_notes: "",
description: 'Sarasa',
title: "",
implicated_systems: ["entity-1"],
}]

await init({ aiidprod: { submissions } });
Expand Down Expand Up @@ -425,6 +427,7 @@ test.describe('Submitted reports', () => {
editor_notes: "",
description: 'Sarasa',
title: "Already Claimed",
implicated_systems: []
}]

await seedCollection({ name: 'submissions', docs: submissions, drop: false });
Expand Down Expand Up @@ -482,6 +485,7 @@ test.describe('Submitted reports', () => {
editor_notes: "",
description: 'Sarasa',
title: "Submission " + i,
implicated_systems: []
}
})

Expand Down Expand Up @@ -550,6 +554,7 @@ test.describe('Submitted reports', () => {
editor_notes: "",
description: 'Sarasa',
title: "Already Claimed",
implicated_systems: []
}]

await seedCollection({ name: 'submissions', docs: submissions, drop: false });
Expand Down Expand Up @@ -605,6 +610,9 @@ test.describe('Submitted reports', () => {
AllegedHarmedOrNearlyHarmedParties {
entity_id
}
implicated_systems {
entity_id
}
date
description
editor_dissimilar_incidents
Expand Down Expand Up @@ -657,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: [],
Expand Down
2 changes: 1 addition & 1 deletion site/gatsby-site/playwright/e2e-full/cite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
});

Expand Down
2 changes: 1 addition & 1 deletion site/gatsby-site/playwright/e2e-full/dynamicCite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function ImplicatedSystemsList({ entities }) {
<div className="mt-2">
{entities.length > 0 && (
<>
<Trans ns="entities">Implicated AI system{entities.length > 1 ? 's' : ''}:</Trans>{' '}
<Trans ns="entities">Alleged implicated AI system{entities.length > 1 ? 's' : ''}:</Trans>{' '}
<EntitiesList entities={entities} />{' '}
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ const SubmissionForm = ({ onChange = null }) => {

<TagsInputGroup
name="implicated_systems"
label={t('Implicated AI systems')}
label={t('Alleged implicated AI systems')}
icon={faGear}
placeholder={t('Which AI systems were involved?')}
className="mt-3"
Expand Down
9 changes: 8 additions & 1 deletion site/gatsby-site/src/components/submissions/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -150,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({
Expand Down

0 comments on commit 8494f26

Please sign in to comment.