Skip to content

Commit

Permalink
Merge pull request #13 from istresearch/dev/add-timeout into develop
Browse files Browse the repository at this point in the history
add timeout selection.
  • Loading branch information
baracudda authored Sep 8, 2023
2 parents ec0160a + 1c21c5e commit 4e7a214
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/form/timeout/TimeoutControl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ describe(TimeoutControl.name, () => {
instance.handleChecked();
expect(props.onChanged).toMatchCallSnapshot('check');

instance.handleTimeoutChanged(TIMEOUT_OPTIONS[0]);
instance.handleTimeoutChanged(TIMEOUT_OPTIONS[1]);
expect(props.onChanged).toMatchCallSnapshot('update');
});

it('handles initial values', () => {
const { wrapper, instance } = setup(true, {
timeout: { $set: 60 },
timeout: { $set: parseInt(TIMEOUT_OPTIONS[1].value) },
onChanged: setMock()
});

Expand Down
3 changes: 2 additions & 1 deletion src/components/form/timeout/TimeoutControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import TembaSelect, { TembaSelectStyle } from 'temba/TembaSelect';
import { SelectOption } from '../select/SelectElement';

export const TIMEOUT_OPTIONS: SelectOption[] = [
{ value: '1', name: i18n.t('forms.timeout_1 second', 'ASAP') },
{ value: '60', name: i18n.t('forms.timeout_1 minute', '1 minute') },
{ value: '120', name: i18n.t('forms.timeout_2 minutes', '2 minutes') },
{ value: '180', name: i18n.t('forms.timeout_3 minutes', '3 minutes') },
Expand All @@ -28,7 +29,7 @@ export const TIMEOUT_OPTIONS: SelectOption[] = [
{ value: '604800', name: i18n.t('forms.timeout_1 week', '1 week') }
];

export const DEFAULT_TIMEOUT = TIMEOUT_OPTIONS[4];
export const DEFAULT_TIMEOUT = TIMEOUT_OPTIONS[5];

export const ellipsize = (str: string) => `${str}...`;

Expand Down
3 changes: 2 additions & 1 deletion src/config/i18n/cs/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"timeout_1 day": "1 den",
"timeout_1 hour": "1 hodina",
"timeout_1 minute": "1 minuta",
"timeout_1 second": "1 sekunda",
"timeout_1 week": "1 týden",
"timeout_10 minutes": "10 minut",
"timeout_12 hours": "12 hodin",
Expand Down Expand Up @@ -501,4 +502,4 @@
"header": "Překlad Toku",
"label": "Překlady"
}
}
}
3 changes: 2 additions & 1 deletion src/config/i18n/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"timeout_1 day": "1 day",
"timeout_1 hour": "1 hour",
"timeout_1 minute": "1 minute",
"timeout_1 second": "ASAP",
"timeout_1 week": "1 week",
"timeout_10 minutes": "10 minutes",
"timeout_12 hours": "12 hours",
Expand Down Expand Up @@ -501,4 +502,4 @@
"header": "Flow Translation",
"label": "Translations"
}
}
}
3 changes: 2 additions & 1 deletion src/config/i18n/es/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"timeout_1 day": "1 día",
"timeout_1 hour": "1 hora",
"timeout_1 minute": "1 minuto",
"timeout_1 second": "1 segundo",
"timeout_1 week": "1 semana",
"timeout_10 minutes": "10 minutos",
"timeout_12 hours": "12 horas",
Expand Down Expand Up @@ -501,4 +502,4 @@
"header": "Traducción de Flujo",
"label": "Traducciones"
}
}
}
3 changes: 2 additions & 1 deletion src/config/i18n/fr/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"timeout_1 day": "1 jour",
"timeout_1 hour": "1 heure",
"timeout_1 minute": "1 minute",
"timeout_1 second": "1 seconde",
"timeout_1 week": "1 semaine",
"timeout_10 minutes": "10 minutes",
"timeout_12 hours": "12 heures",
Expand Down Expand Up @@ -501,4 +502,4 @@
"header": "Traduction de flux",
"label": "Traductions"
}
}
}
3 changes: 2 additions & 1 deletion src/config/i18n/mn/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"timeout_1 day": "1 өдөр",
"timeout_1 hour": "1 цаг",
"timeout_1 minute": "1 минут",
"timeout_1 second": "1 секунд",
"timeout_1 week": "1 долоо хоног",
"timeout_10 minutes": "10 минут ",
"timeout_12 hours": "12 цаг",
Expand Down Expand Up @@ -501,4 +502,4 @@
"header": "Урсгал орчуулга",
"label": "Орчуулга "
}
}
}
3 changes: 2 additions & 1 deletion src/config/i18n/pt-br/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"timeout_1 day": "1 dia",
"timeout_1 hour": "1 hora",
"timeout_1 minute": "1 minuto",
"timeout_1 second": "1 segundo",
"timeout_1 week": "1 semana",
"timeout_10 minutes": "10 minutos",
"timeout_12 hours": "12 horas",
Expand Down Expand Up @@ -501,4 +502,4 @@
"header": "Tradução do fluxo",
"label": "Traduções"
}
}
}

0 comments on commit 4e7a214

Please sign in to comment.