Skip to content
Snippets Groups Projects
Commit 4bff0c49 authored by Marc-Antoine Manningham's avatar Marc-Antoine Manningham
Browse files

Merge branch 'beta-preparation' into 'main'

Beta preparation

See merge request Lemark/aep-schedule-generator-rusty!7
parents d8a01737 e4fd0b88
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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>
......
......@@ -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/>
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment