Skip to content

Commit

Permalink
Content QA - Add modal (#3128)
Browse files Browse the repository at this point in the history
* consistent contact copy and generic address copy

* consistency in heading level for all templated blocks

* oxford comma

* clean up file input strings

* consistency numbers and text in fr

* hint text

* numbers in fr

* fix tests

* text on translation view

* fix test

---------

Co-authored-by: Tim Arney <[email protected]>
  • Loading branch information
anikbrazeau and timarney authored Jan 23, 2024
1 parent 932efe2 commit 0424ec8
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion components/form-builder/app/edit/SelectedElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const SelectedElement = ({
element = <ShortAnswer>{t("longAnswerText")}</ShortAnswer>;
break;
case "fileInput":
element = <ShortAnswer>{t("addElementDialog.fileInput.label")}</ShortAnswer>;
element = <ShortAnswer>{t("addElementDialog.fileInput.title")}</ShortAnswer>;
break;
case "radio":
if (elIndex !== -1) {
Expand Down
2 changes: 1 addition & 1 deletion components/form-builder/hooks/useElementOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const useElementOptions = (filterElements?: ElementOptionsFilter | undefi

const fileInputOption: ElementOption = {
id: "fileInput",
value: t("addElementDialog.fileInput.label"),
value: t("addElementDialog.fileInput.title"),
icon: UploadIcon,
description: FileInput,
className: "",
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/form-builder/add-elements.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe("Test FormBuilder Add Elements", () => {

cy.get('[id="item-1"]').should("have.attr", "placeholder", "Question");

cy.get('[data-testid="description-text"]').should("contain", "Only enter numbers");
cy.get('[data-testid="description-text"]').should("contain", "Enter a number");
cy.get('[data-testid="number"]').should("contain", "0123456789");

cy.visitPage("/form-builder/preview");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Form builder description text", () => {
cy.get('[data-testid="preset-filter"]').click();
cy.get('[data-testid="number"]').click();
cy.get('[data-testid="element-description-add-element"]').click();
cy.get(".description-text").should("be.visible").contains("Only enter numbers");
cy.get(".description-text").should("be.visible").contains("Enter a number");
cy.get(".example-text").should("be.visible").contains("0123456789");
});
});
6 changes: 3 additions & 3 deletions cypress/e2e/form-builder/form-builder-modal-description.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ describe("Form builder modal description", () => {
cy.get('[data-testid="preset-filter"]').click();
cy.get('[data-testid="number"]').click();
cy.get('[data-testid="element-description-add-element"]').click();
cy.get(".description-text").should("be.visible").contains("Only enter numbers");
cy.get(".description-text").should("be.visible").contains("Enter a number");
cy.get(".example-text").should("be.visible").contains("0123456789");

cy.get('#element-2 [data-testid="more"]').click();
cy.get('[data-testid="description-input"]').contains("Only enter numbers");
cy.get('[data-testid="description-input"]').contains("Enter a number");
cy.get("button").contains("Close").click();

// rearrange the first element
Expand All @@ -38,7 +38,7 @@ describe("Form builder modal description", () => {
cy.get("button").contains("Close").click();

cy.get('#element-2 [data-testid="more"]').click();
cy.get('[data-testid="description-input"]').contains("Only enter numbers");
cy.get('[data-testid="description-input"]').contains("Enter a number");
cy.get("button").contains("Close").click();
});
});
10 changes: 5 additions & 5 deletions form-builder-templates/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"validation": {
"required": false
},
"descriptionEn": "### What is your address?",
"descriptionFr": "### Quelle est votre adresse?",
"descriptionEn": "## What is your address?",
"descriptionFr": "## Quelle est votre adresse?",
"placeholderEn": "",
"placeholderFr": ""
}
Expand All @@ -35,8 +35,8 @@
"validation": {
"required": false
},
"descriptionEn": "Include your street name and number. For example: 123 Main St. Apt 10",
"descriptionFr": "Indiquez le nom de rue et le numéro d'unité. Par exemple : 123 Rue Principale Apt 10",
"descriptionEn": "Include street name and number.",
"descriptionFr": "Indiquez le nom de rue et le numéro d'unité.",
"placeholderEn": "",
"placeholderFr": "",
"autoComplete": "address-line1"
Expand All @@ -52,7 +52,7 @@
"fr": ""
}
],
"titleEn": "City, town or community",
"titleEn": "City, town, or community",
"titleFr": "Ville ou communauté",
"validation": {
"required": false
Expand Down
2 changes: 1 addition & 1 deletion form-builder-templates/contact.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
}
],
"titleEn": "Preferred language for communication",
"titleFr": "Langue préférée de communication",
"titleFr": "Langue de communication préférée",
"validation": {
"required": false
},
Expand Down
8 changes: 4 additions & 4 deletions public/static/locales/en/form-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
},
"address": {
"whatIsYourAddress": "What is your address?",
"city": "City, town or community",
"city": "City, town, or community",
"country": "Country",
"description": "A pattern to collect a Canadian address, including fields for address, city, province, and postal code.",
"label": "Address",
"postal": "Postal code",
"province": "Province or territory",
"street": {
"description": "Include your street name and number. For example: 123 Main St. Apt 10",
"description": "Include street name and number.",
"label": "Street address"
},
"title": "Address"
Expand Down Expand Up @@ -273,7 +273,7 @@
"defaultElementDescription": {
"date": "Format the date as: mm/dd/yyyy",
"email": "For example: [email protected]",
"number": "Only enter numbers",
"number": "Enter a number",
"phone": "For example: 111-222-3333"
},
"description": "Description",
Expand Down Expand Up @@ -461,7 +461,7 @@
"title": "Button"
}
},
"questionTitle": "Question title",
"questionTitle": "Question",
"remove": "Remove",
"removeFromSet": "Remove from set",
"removeOption": "Remove option:",
Expand Down
14 changes: 7 additions & 7 deletions public/static/locales/fr/form-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"postal": "Code postal",
"province": "Province ou territoire",
"street": {
"description": "Indiquez le nom de rue et le numéro d'unité. Par exemple : 123 Rue Principale Apt 10.",
"description": "Indiquez le nom de rue et le numéro d'unité.",
"label": "Adresse municipale"
},
"title": "Adresse"
Expand Down Expand Up @@ -272,7 +272,7 @@
"defaultElementDescription": {
"date": "Saisissez une date dans ce format : mm/jj/aaaa",
"email": "Par exemple : [email protected]",
"number": "N'entrez que des chiffres",
"number": "Saisissez un chiffre",
"phone": "Par exemple : 111-222-3333"
},
"description": "Description ",
Expand All @@ -297,7 +297,7 @@
"confirmReceipt": "Confirmer la réception",
"downloadResponse": "Télécharger la réponse",
"lastDownloadedBy": "Dernier téléchargement par",
"number": "Numéro",
"number": "Chiffre",
"removal": "Suppresssion",
"select": "Sélectionner",
"status": "État",
Expand All @@ -321,7 +321,7 @@
},
"dropdown": "Liste déroulante",
"duplicate": "Dupliquer",
"dyanamicRow": "Série de questions répétées",
"dyanamicRow": "Ensemble de réponses",
"edit": "Modifier",
"editingIn": "Modifier en :",
"editLink": "Modifier un lien ",
Expand Down Expand Up @@ -415,13 +415,13 @@
"moveUp": "Déplacer vers le haut ",
"navLabelEditor": "Navigation de l’onglet modifier",
"navLabelFormBuilder": "Navigation de Formulaires GC",
"numericField": "Numéro",
"numericField": "Chiffre",
"openModal": "Ouvrir fenêtre modale",
"option": "Option",
"optionText": "Option",
"pagePreview": "Prévisualiser",
"pageSettings": "Paramètres",
"pageText": "Texte",
"pageText": "Texte de page",
"paragraph": "Réponse longue",
"phoneNumber": "Numéro de téléphone",
"placeHolderFormTitle": "Titre du formulaire",
Expand Down Expand Up @@ -460,7 +460,7 @@
"title": "Bouton"
}
},
"questionTitle": "Titre de question",
"questionTitle": "Question",
"remove": "Supprimer",
"removeFromSet": "Enlever de la série",
"removeOption": "Supprimer l'option : ",
Expand Down

0 comments on commit 0424ec8

Please sign in to comment.