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?",
"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)",
"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. ",
"Question of the election": "Zur Wahl stehende 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",
"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.)",
"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.",
"Question of the election": "Question of the 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",
"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.)",
"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).",
"Question of the election": "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",
"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.)",
"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.",
"Question of the election": "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": "Вы уверены в удалении",
"the row": "ряд",
"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 кандидатов",
"Question of the election": "Суть голосования",
"Write here the question of your election": "Напишите вопрос вашего голосования",

@ -138,7 +138,7 @@ const SortableCandidate = sortableElement(
<Col xs="auto" className="align-self-center pl-0">
<HelpButton>
{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>
</Col>
@ -229,7 +229,7 @@ class CreateElection extends Component {
editCandidateLabel = (event, index) => {
let candidates = this.state.candidates;
candidates[index].label = event.currentTarget.value;
candidates.map((candidate) => {
candidates.map(candidate => {
return candidate.label;
});
this.setState({
@ -264,14 +264,13 @@ class CreateElection extends Component {
checkFields() {
const { candidates, title } = this.state;
if (!candidates) {
return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR };
}
let numCandidates = 0;
candidates.forEach(c => {
if (c !== "") numCandidates += 1;
if (c.label !== "") numCandidates += 1;
});
if (numCandidates < 2) {
return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR };
@ -470,10 +469,10 @@ class CreateElection extends Component {
<Card>
<CardBody className="text-primary">
<Row>
<Col xs="12" md="3" lg="3" >
<Col xs="12" md="3" lg="3">
<Label for="title">{t("Access to results")}</Label>
</Col>
<Col xs="12" md="4" lg="3" >
<Col xs="12" md="4" lg="3">
<Label className="radio " htmlFor="restrict_result_false">
<span className="small text-dark">
{t("Immediately")}
@ -490,7 +489,7 @@ class CreateElection extends Component {
<span className="checkround checkround-gray" />
</Label>
</Col>
<Col xs="12" md="4" lg="3" >
<Col xs="12" md="4" lg="3">
<Label className="radio" htmlFor="restrict_result_true">
<span className="small">
<span className="text-dark">
@ -698,19 +697,19 @@ class CreateElection extends Component {
<FontAwesomeIcon icon={faCheck} className="mr-2" />
{t("Validate")}
</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 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")}
</div>
<div className="p-2 pl-3 bg-light mb-3">
{title}
</div>
<div className="text-white bg-primary p-2 rounded">
<div className="p-2 pl-3 pr-3 bg-light mb-3">{title}</div>
<div className="text-white bg-primary p-2 pl-3 pr-3 rounded">
{t("Candidates/Proposals")}
</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">
{candidates.map((candidate, i) => {
if (candidate.label !== "") {
@ -725,10 +724,10 @@ class CreateElection extends Component {
})}
</ul>
</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")}
</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")}{" "}
<b>
{start.toLocaleDateString()}, {t("at")}{" "}
@ -740,10 +739,10 @@ class CreateElection extends Component {
{finish.toLocaleTimeString()}
</b>
</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")}
</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) => {
return i < numGrades ? (
<span
@ -761,10 +760,10 @@ class CreateElection extends Component {
);
})}
</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")}
</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.join(", ")
) : (

Loading…
Cancel
Save