From eb393aeaee41fe860598526b0e199f2f165322fa Mon Sep 17 00:00:00 2001 From: Abdo Date: Thu, 7 Nov 2024 01:35:39 +0300 Subject: [PATCH] Warn if no day is set to Normal (#3557) --- ftl/core/deck-config.ftl | 1 + ts/routes/deck-options/EasyDays.svelte | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index ca34c4b1e..fe47ef824 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -290,6 +290,7 @@ deck-config-easy-days-sunday = Sunday deck-config-easy-days-normal = Normal deck-config-easy-days-reduced = Reduced deck-config-easy-days-minimum = Minimum +deck-config-easy-days-no-normal-days = At least one day should be set to '{ deck-config-easy-days-normal }'. ## Adding/renaming diff --git a/ts/routes/deck-options/EasyDays.svelte b/ts/routes/deck-options/EasyDays.svelte index c87c6aba8..9b4d9c2a2 100644 --- a/ts/routes/deck-options/EasyDays.svelte +++ b/ts/routes/deck-options/EasyDays.svelte @@ -8,6 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import Item from "$lib/components/Item.svelte"; import TitledContainer from "$lib/components/TitledContainer.svelte"; import type { DeckOptionsState } from "./lib"; + import Warning from "./Warning.svelte"; export let state: DeckOptionsState; export let api: Record; @@ -20,6 +21,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $config.easyDaysPercentages = defaults.easyDaysPercentages; } + $: noNormalDay = $config.easyDaysPercentages.some((p) => p === 1.0) + ? "" + : tr.deckConfigEasyDaysNoNormalDays(); + const easyDays = [ tr.deckConfigEasyDaysMonday(), tr.deckConfigEasyDaysTuesday(), @@ -81,6 +86,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + + +