diff --git a/CHANGELOG.md b/CHANGELOG.md index 07431aba1afaef012b8a31013cd120f21ec2d244..e3bcbc010fef47ac99fe69bcbc6d72d5acf420a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,16 @@ All notable changes to this project will be documented in this file. - Improve schedule rerendering - Implement infinite scroll +- Add beta banner for release preparation ### 🛠Bug Fixes - Localstorage not updated - Autocomplete now take in charge the last character - Improve accessibility by shrinking automatically the tab +- Mobile view not showing with refactor of schedule generation call +- [**breaking**] Autoregeneration was broken by changement to autogen +- Mobile error reporting ### 🚜 Refactor diff --git a/aep-schedule-website/src/frontend/app.rs b/aep-schedule-website/src/frontend/app.rs index eca83922131fe3449f2d9a55211cf88014262733..8e96a4a9bbe8d2438ef61fb4ecf260b92c326899 100644 --- a/aep-schedule-website/src/frontend/app.rs +++ b/aep-schedule-website/src/frontend/app.rs @@ -13,7 +13,7 @@ pub fn App() -> impl IntoView { // Provides context that manages stylesheets, titles, meta tags, etc. provide_meta_context(); - let (is_active, set_active) = create_signal(String::new()); + let (is_active, set_active) = create_signal(false); view! { @@ -27,10 +27,11 @@ pub fn App() -> impl IntoView { // content for this welcome page <Router> <header> - <nav class=is_active> + <nav class=("active", is_active) class="flex-wrap overflow-x-hidden"> <span class="text-2xl font-semibold leading-none font-sans tracking-tight">"Générateur d'horaire de l'AEP" <span class="text-amber-600">"v2"</span> </span> + <span class="bg-red-200 text-red-800 text-lg font-sans tracking-tight font-medium me-2 px-2.5 py-0.5 rounded-full shrink">"Beta - "<a class="text-gray-800" href="https://horaires.aep.polymtl.ca/">"Retourner à l'ancien générateur"</a></span> <A class="rounded-md font-medium text-gray-700 text-lg font-sans tracking-tight" href="/">"Générateur d'horaire"</A> <A class="rounded-md font-medium text-gray-700 text-lg font-sans tracking-tight" href="/local">"Horaire d'un local"</A> <A class="rounded-md font-medium text-gray-700 text-lg font-sans tracking-tight" href="/apropos">"À propos"</A> @@ -40,15 +41,11 @@ pub fn App() -> impl IntoView { <span class="rounded-md font-medium text-gray-700 text-lg font-sans tracking-tight">"Signaler un bug"</span> <Bug weight=IconWeight::Regular size="3vh"/> </a> - <a href="https://git.step.polymtl.ca/Lemark/aep-schedule-generator-rusty" class="sources" target="_blank" ><span class="rounded-md font-medium text-gray-700 text-lg font-sans tracking-tight">"Sources "</span><GitlabLogo weight=IconWeight::Regular size="3vh"/></a> + <a href="https://git.step.polymtl.ca/Lemark/aep-schedule-generator-rusty" class="sources" target="_blank" ><span class="rounded-md font-medium text-gray-700 text-lg font-sans tracking-tight">"Sources "</span><GitlabLogo weight=IconWeight::Regular size="3vh"/></a> </nav> - <div class=move || is_active.get() + " hamburger" on:click=move |_| { - set_active.update(|text| { - if text == "active" { - text.clear(); - } else { - text.push_str("active"); - } + <div class=("active", is_active) class="hamburger" on:click=move |_| { + set_active.update(|active| { + *active = !*active; }); }> <span class="hamburger-bar"></span> diff --git a/aep-schedule-website/src/frontend/components/options/form.rs b/aep-schedule-website/src/frontend/components/options/form.rs index b8252a102db486e4bd5cbfa8fefe57bc7081ce9d..692623a768b41f475eb029b28d579890cccd1cd0 100644 --- a/aep-schedule-website/src/frontend/components/options/form.rs +++ b/aep-schedule-website/src/frontend/components/options/form.rs @@ -15,7 +15,7 @@ pub fn OptionsForms() -> impl IntoView { let first_generation_done: FirstGenerationDone = use_context().unwrap(); let submit = move || { state.validate(); - if !first_generation_done.0.get() || state.step.get() != 5 { + if !first_generation_done.0.get() || state.step.get() < 5 { return; } state.generate(); @@ -26,7 +26,14 @@ pub fn OptionsForms() -> impl IntoView { async move {} }); - let submit_mobile = move |_| state.generate(); + let submit_mobile = move |_| { + state.validate(); + if state.step.get() < 5 { + state.hide.set(true); + return; + } + state.generate(); + }; view! { <CoursesSelector state=state submit/> diff --git a/aep-schedule-website/src/frontend/state/mod.rs b/aep-schedule-website/src/frontend/state/mod.rs index 7ba428732c254c42eaf236c16b099714a9cc9694..6904f0a2539c2e0a8171dc7124a1f73a6dd8346e 100644 --- a/aep-schedule-website/src/frontend/state/mod.rs +++ b/aep-schedule-website/src/frontend/state/mod.rs @@ -84,7 +84,7 @@ impl OptionState { pub fn regenerate(&self) { self.max_size.update_value(|size| { let _ = size.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |v| { - Some(std::cmp::min(v * 2, 2usize.pow(12))) + Some(std::cmp::min(v * 2, 2usize.pow(10))) }); }); self.gen();