Merge pull request #45 from MieuxVoter/hotfix/check-fields

Hotfix/check fields
pull/73/head
guhur 4 years ago committed by GitHub
commit 8b8882fd2f

@ -11,6 +11,7 @@
"Are you sure to delete": "Sind Sie sich sicher, dass Sie dies löschen möchten?", "Are you sure to delete": "Sind Sie sich sicher, dass Sie dies löschen möchten?",
"the row": "die Zeile", "the row": "die Zeile",
"Write here your question or introduce simple your election (250 characters max.)": "Schreiben Sie hier Ihre Frage oder erklären Sie kurz ihre Wahl (bis 250 Zeichen)", "Write here your question or introduce simple your election (250 characters max.)": "Schreiben Sie hier Ihre Frage oder erklären Sie kurz ihre Wahl (bis 250 Zeichen)",
"Enter the name of your candidate or proposal here (250 characters max.)": "Geben Sie hier den Namen Ihres Kandidaten oder Antrags ein (max. 250 Zeichen)",
"Please add at least 2 candidates.": "Bitte geben Sie mindestens zwei Kandidaten vor. ", "Please add at least 2 candidates.": "Bitte geben Sie mindestens zwei Kandidaten vor. ",
"Question of the election": "Zur Wahl stehende Frage", "Question of the election": "Zur Wahl stehende Frage",
"Write here the question of your election": "Schreiben Sie hier die zur Wahl stehenden Frage", "Write here the question of your election": "Schreiben Sie hier die zur Wahl stehenden Frage",

@ -11,6 +11,7 @@
"Are you sure to delete": "Are you sure to delete", "Are you sure to delete": "Are you sure to delete",
"the row": "the row", "the row": "the row",
"Write here your question or introduce simple your election (250 characters max.)": "Write here your question or introduce simple your election (250 characters max.)", "Write here your question or introduce simple your election (250 characters max.)": "Write here your question or introduce simple your election (250 characters max.)",
"Enter the name of your candidate or proposal here (250 characters max.)":"Enter the name of your candidate or proposal here (250 characters max.)",
"Please add at least 2 candidates.": "Please add at least 2 candidates.", "Please add at least 2 candidates.": "Please add at least 2 candidates.",
"Question of the election": "Question of the election", "Question of the election": "Question of the election",
"Write here the question of your election": "Write here the question of your election", "Write here the question of your election": "Write here the question of your election",

@ -11,6 +11,7 @@
"Are you sure to delete": "Estás seguro de querer borrar", "Are you sure to delete": "Estás seguro de querer borrar",
"the row": "la fila", "the row": "la fila",
"Write here your question or introduce simple your election (250 characters max.)": "Escriba aquí su pregunta o introduzca simplemente su elección (250 caracteres máx.)", "Write here your question or introduce simple your election (250 characters max.)": "Escriba aquí su pregunta o introduzca simplemente su elección (250 caracteres máx.)",
"Enter the name of your candidate or proposal here (250 characters max.)": "Escriba aquí el nombre de su candidato o propuesta (250 caracteres como máximo)",
"Please add at least 2 candidates.": "Por favor, añada al menos dos canidatos(as).", "Please add at least 2 candidates.": "Por favor, añada al menos dos canidatos(as).",
"Question of the election": "Pregunta de su elección", "Question of the election": "Pregunta de su elección",
"Write here the question of your election": "Escriba aquí la pregunta de su elección", "Write here the question of your election": "Escriba aquí la pregunta de su elección",

@ -11,6 +11,7 @@
"Are you sure to delete": "Êtes-vous sûr(e) de supprimer", "Are you sure to delete": "Êtes-vous sûr(e) de supprimer",
"the row": "la ligne", "the row": "la ligne",
"Write here your question or introduce simple your election (250 characters max.)": "Décrire ici votre question ou introduire simplement votre élection (250 caractères max.)", "Write here your question or introduce simple your election (250 characters max.)": "Décrire ici votre question ou introduire simplement votre élection (250 caractères max.)",
"Enter the name of your candidate or proposal here (250 characters max.)": "Saisissez ici le nom de votre candidat ou de votre proposition (250 caractères max.)",
"Please add at least 2 candidates.": "Merci d'ajouter au moins 2 candidats.", "Please add at least 2 candidates.": "Merci d'ajouter au moins 2 candidats.",
"Question of the election": "Question de votre élection", "Question of the election": "Question de votre élection",
"Write here the question of your election": "Ecrire ici la question de votre élection", "Write here the question of your election": "Ecrire ici la question de votre élection",

@ -11,6 +11,7 @@
"Are you sure to delete": "Вы уверены в удалении", "Are you sure to delete": "Вы уверены в удалении",
"the row": "ряд", "the row": "ряд",
"Write here your question or introduce simple your election (250 characters max.)": "Напишите свой вопрос или опишите голосование (250 символов максимум.)", "Write here your question or introduce simple your election (250 characters max.)": "Напишите свой вопрос или опишите голосование (250 символов максимум.)",
"Enter the name of your candidate or proposal here (250 characters max.)": "Введите имя вашего кандидата или предложение здесь (не более 250 символов).",
"Please add at least 2 candidates.": "Пожалуйста добавьте как минимум 2 кандидатов", "Please add at least 2 candidates.": "Пожалуйста добавьте как минимум 2 кандидатов",
"Question of the election": "Суть голосования", "Question of the election": "Суть голосования",
"Write here the question of your election": "Напишите вопрос вашего голосования", "Write here the question of your election": "Напишите вопрос вашего голосования",

@ -138,7 +138,7 @@ const SortableCandidate = sortableElement(
<Col xs="auto" className="align-self-center pl-0"> <Col xs="auto" className="align-self-center pl-0">
<HelpButton> <HelpButton>
{t( {t(
"Write here your question or introduce simple your election (250 characters max.)" "Enter the name of your candidate or proposal here (250 characters max.)"
)} )}
</HelpButton> </HelpButton>
</Col> </Col>
@ -229,7 +229,7 @@ class CreateElection extends Component {
editCandidateLabel = (event, index) => { editCandidateLabel = (event, index) => {
let candidates = this.state.candidates; let candidates = this.state.candidates;
candidates[index].label = event.currentTarget.value; candidates[index].label = event.currentTarget.value;
candidates.map((candidate) => { candidates.map(candidate => {
return candidate.label; return candidate.label;
}); });
this.setState({ this.setState({
@ -264,14 +264,13 @@ class CreateElection extends Component {
checkFields() { checkFields() {
const { candidates, title } = this.state; const { candidates, title } = this.state;
if (!candidates) { if (!candidates) {
return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR }; return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR };
} }
let numCandidates = 0; let numCandidates = 0;
candidates.forEach(c => { candidates.forEach(c => {
if (c !== "") numCandidates += 1; if (c.label !== "") numCandidates += 1;
}); });
if (numCandidates < 2) { if (numCandidates < 2) {
return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR }; return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR };
@ -470,10 +469,10 @@ class CreateElection extends Component {
<Card> <Card>
<CardBody className="text-primary"> <CardBody className="text-primary">
<Row> <Row>
<Col xs="12" md="3" lg="3" > <Col xs="12" md="3" lg="3">
<Label for="title">{t("Access to results")}</Label> <Label for="title">{t("Access to results")}</Label>
</Col> </Col>
<Col xs="12" md="4" lg="3" > <Col xs="12" md="4" lg="3">
<Label className="radio " htmlFor="restrict_result_false"> <Label className="radio " htmlFor="restrict_result_false">
<span className="small text-dark"> <span className="small text-dark">
{t("Immediately")} {t("Immediately")}
@ -490,7 +489,7 @@ class CreateElection extends Component {
<span className="checkround checkround-gray" /> <span className="checkround checkround-gray" />
</Label> </Label>
</Col> </Col>
<Col xs="12" md="4" lg="3" > <Col xs="12" md="4" lg="3">
<Label className="radio" htmlFor="restrict_result_true"> <Label className="radio" htmlFor="restrict_result_true">
<span className="small"> <span className="small">
<span className="text-dark"> <span className="text-dark">
@ -698,19 +697,19 @@ class CreateElection extends Component {
<FontAwesomeIcon icon={faCheck} className="mr-2" /> <FontAwesomeIcon icon={faCheck} className="mr-2" />
{t("Validate")} {t("Validate")}
</div> </div>
<div key="modal-title" className="text-primary bold">{t("Confirm your vote")}</div> <div key="modal-title" className="text-primary bold">
{t("Confirm your vote")}
</div>
<div key="modal-body"> <div key="modal-body">
<div className="mt-1 mb-1"> <div className="mt-1 mb-1">
<div className="text-white bg-primary p-2 rounded"> <div className="text-white bg-primary p-2 pl-3 pr-3 rounded">
{t("Question of the election")} {t("Question of the election")}
</div> </div>
<div className="p-2 pl-3 bg-light mb-3"> <div className="p-2 pl-3 pr-3 bg-light mb-3">{title}</div>
{title} <div className="text-white bg-primary p-2 pl-3 pr-3 rounded">
</div>
<div className="text-white bg-primary p-2 rounded">
{t("Candidates/Proposals")} {t("Candidates/Proposals")}
</div> </div>
<div className="p-2 pl-3 bg-light mb-3"> <div className="p-2 pl-3 pr-3 bg-light mb-3">
<ul className="m-0 pl-4"> <ul className="m-0 pl-4">
{candidates.map((candidate, i) => { {candidates.map((candidate, i) => {
if (candidate.label !== "") { if (candidate.label !== "") {
@ -725,10 +724,10 @@ class CreateElection extends Component {
})} })}
</ul> </ul>
</div> </div>
<div className="text-white bg-primary p-2 rounded"> <div className="text-white bg-primary p-2 pl-3 pr-3 rounded">
{t("Dates")} {t("Dates")}
</div> </div>
<div className="p-2 pl-3 bg-light mb-3"> <div className="p-2 pl-3 pr-3 bg-light mb-3">
{t("The election will take place from")}{" "} {t("The election will take place from")}{" "}
<b> <b>
{start.toLocaleDateString()}, {t("at")}{" "} {start.toLocaleDateString()}, {t("at")}{" "}
@ -740,10 +739,10 @@ class CreateElection extends Component {
{finish.toLocaleTimeString()} {finish.toLocaleTimeString()}
</b> </b>
</div> </div>
<div className="text-white bg-primary p-2 rounded"> <div className="text-white bg-primary p-2 pl-3 pr-3 rounded">
{t("Grades")} {t("Grades")}
</div> </div>
<div className="p-2 pl-3 bg-light mb-3"> <div className="p-2 pl-3 pr-3 bg-light mb-3">
{grades.map((mention, i) => { {grades.map((mention, i) => {
return i < numGrades ? ( return i < numGrades ? (
<span <span
@ -761,10 +760,10 @@ class CreateElection extends Component {
); );
})} })}
</div> </div>
<div className="text-white bg-primary p-2 rounded"> <div className="text-white bg-primary p-2 pl-3 pr-3 rounded">
{t("Voters' list")} {t("Voters' list")}
</div> </div>
<div className="p-2 pl-3 bg-light mb-3"> <div className="p-2 pl-3 pr-3 bg-light mb-3">
{electorEmails.length > 0 ? ( {electorEmails.length > 0 ? (
electorEmails.join(", ") electorEmails.join(", ")
) : ( ) : (

Loading…
Cancel
Save