Merge branch 'main' into feature/multi-entry-final

# Conflicts:
#	src/app.rs
#	src/pages/home_page.rs
#	src/pages/mod.rs
#	src/pages/provider_entry.rs
This commit is contained in:
alphafetus committed 2025-10-16 12:23:40 -04:00
commit 5178dcbffa
8 files changed
+126 -19

No files matched your search

+1 -9
View File
@@ -7,7 +7,7 @@ use leptos_router::{
};
use url::Url;
use crate::pages::{AboutPage, HomePage};
use crate::pages::{AboutPage, HomePage, UnauthenticatedPage};
pub fn shell(options: LeptosOptions) -> impl IntoView {
view! {
@@ -73,14 +73,6 @@ pub fn App() -> impl IntoView {
}
}
#[component]
pub fn Unauthenticated() -> impl IntoView {
view! {
<p>"Error 401: Unauthorized"</p>
<LoginLink class="text-login">"Sign in"</LoginLink>
}
}
#[component]
pub fn AuthErrorView() -> impl IntoView {
let auth = use_context::<AuthSignal>().expect("AuthError: RwSignal<AuthStore> was not found");
+1 -1
View File
@@ -8,7 +8,7 @@ pub fn ActionButton(
) -> impl IntoView {
view! {
<button
class="m-1.5 p-2 rounded-lg text-white transition-all duration-400"
class="m-1.5 p-2.5 rounded-lg font-semibold text-white transition-all duration-400"
class=(["bg-red-700", "hover:bg-red-800"], move || !disabled.get())
class=(["bg-gray-600", "pointer-events-none"], move || disabled.get())
r#type=button_type
+2 -2
View File
@@ -5,8 +5,8 @@ use aws_sdk_dynamodb::{Client, error::ProvideErrorMetadata, types::AttributeValu
#[cfg(feature = "ssr")]
use serde_dynamo::{from_item, to_item};
use crate::app::Unauthenticated;
use crate::common::{ExpandableInfo, UserClaims};
use crate::pages::UnauthenticatedPage;
use crate::components::{
ActionButton, CheckboxList, Loading, MultiEntry, OutlinedTextField, Panel, RadioList, Row,
Select,
@@ -132,7 +132,7 @@ pub fn HomePage() -> impl IntoView {
view! {
<AuthLoaded fallback=Loading>
<Authenticated unauthenticated=Unauthenticated>
<Authenticated unauthenticated=UnauthenticatedPage>
// Replace this fallback with a real loading screen.
<Suspense fallback=Loading>
{move || {
+2 -1
View File
@@ -1,4 +1,5 @@
mod about_page;
mod home_page;
mod unauthenticated_page;
pub use self::{about_page::*, home_page::*};
pub use self::{about_page::*, home_page::*, unauthenticated_page::*};
View File
Whitespace-only changes.
+33
View File
@@ -0,0 +1,33 @@
use crate::components::ActionButton;
use leptos::prelude::*;
use leptos_oidc::AuthSignal;
#[component]
pub fn UnauthenticatedPage() -> impl IntoView {
let auth = use_context::<AuthSignal>().expect("AuthSignal not present in LoginLink");
let login_url = move || {
auth.with(|auth| {
auth.unauthenticated()
.map(|unauthenticated| unauthenticated.login_url())
})
};
let navigate = leptos_router::hooks::use_navigate();
view! (
<div class="flex h-screen justify-center items-center pb-50">
<div class="bg-white p-8 border rounded-lg shadow-lg">
<h3> "You're not signed in. Please sign in with your Region 15 email." </h3>
<div class="flex pt-4 justify-center items-center">
<ActionButton on:click=move |_| {
if let Some(url) = login_url() {
navigate(&url, Default::default())
}
}>
"Sign in"
</ActionButton>
</div>
</div>
</div>
)
}