chore: cleanup warnings and unused code
This commit is contained in:
1 parent
9925e753d8
commit
75a8f2d6d4
13 files changed
+6
-187
No files matched your search
@@ -1,4 +1,3 @@
|
||||
use std::collections::HashMap;
|
||||
#[cfg(feature = "ssr")]
|
||||
use aws_sdk_dynamodb::{error::ProvideErrorMetadata, types::AttributeValue, Client};
|
||||
use crate::app::Unauthenticated;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
//! Contains the action selection component.
|
||||
|
||||
use leptos::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn ActionSelection() -> impl IntoView {
|
||||
view! {}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
//! This defines the base component of the Chromebook loaner kiosk application.
|
||||
//! There are going to be 3 definitive screens that the users are able to see and use:
|
||||
//! - The username entry screen: users will enter their name and email.
|
||||
//! - The action selection screen: users will be given a choice regarding their loaner status.
|
||||
//! - The completion screen: users will be given a success message should their information save.
|
||||
//! Refer to each component's file for more information about how they work.
|
||||
|
||||
use super::{action_selection::ActionSelection, user_entry::UserEntry};
|
||||
use crate::common::LoanerUser;
|
||||
use leptos::prelude::*;
|
||||
|
||||
/// Used to keep track of the currently displayed controls.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum LoanerKioskState {
|
||||
UserEntry,
|
||||
ActionSelection,
|
||||
Complete,
|
||||
}
|
||||
|
||||
/// The base Chromebook loaner kiosk component.
|
||||
///
|
||||
/// Controls the state of the loaner application and gives a space for the subcomponents to display.
|
||||
#[component]
|
||||
pub fn LoanerKiosk() -> impl IntoView {
|
||||
let current_state = RwSignal::new(LoanerKioskState::UserEntry);
|
||||
let user = RwSignal::new(LoanerUser::new());
|
||||
|
||||
view! {
|
||||
<div class="flex w-screen h-screen justify-center items-center">
|
||||
<UserEntry
|
||||
on_submit={move || { current_state.set(LoanerKioskState::ActionSelection); }}
|
||||
user={user}
|
||||
shown={current_state.get() == LoanerKioskState::UserEntry}
|
||||
/>
|
||||
<ActionSelection
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
mod action_selection;
|
||||
mod loaner_kiosk;
|
||||
mod user_entry;
|
||||
@@ -1,72 +0,0 @@
|
||||
//! Contains the user entry component.
|
||||
//! It would be preferred if the user was restricted to a real user account. This is the URL:
|
||||
//! https://admin.googleapis.com/admin/directory/v1/users?domain=region15.org&projection=BASIC&query=isArchived=false%20isAdmin=false
|
||||
//! Once they select this, they can then check in/out the loaners under their account.
|
||||
//! That means that the Leptos server will now REQUIRE a user token of some sort, probably
|
||||
//! a service account. That's going to be a pain to set up.
|
||||
//! For example's sake here, we're just going to take a first name, last name, and email address.
|
||||
|
||||
use crate::common::LoanerUser;
|
||||
use crate::components::{ActionButton, OutlinedTextField};
|
||||
use leptos::leptos_dom::logging::console_log;
|
||||
use leptos::prelude::*;
|
||||
|
||||
/// The user entry component for the loaner kiosk.
|
||||
///
|
||||
/// Users are able to input their first name, last name, and email address. In the future, this
|
||||
/// component should call out to a server function that allows the application to check if the
|
||||
/// information provided is correct. This may be by creating storing a series of user records
|
||||
/// or simply querying Google's Admin API to check if the user is valid.
|
||||
#[component]
|
||||
pub fn UserEntry(
|
||||
/// A callback function used when the control has determined this stage is finished.
|
||||
#[prop()]
|
||||
mut on_submit: impl FnMut() + 'static,
|
||||
/// The global user record.
|
||||
#[prop()]
|
||||
user: RwSignal<LoanerUser>,
|
||||
/// Whether this control is shown. Required for use with CSS animations.
|
||||
#[prop()]
|
||||
shown: bool,
|
||||
) -> impl IntoView {
|
||||
let disabled = RwSignal::new(false);
|
||||
let on_click = move |_| {
|
||||
disabled.set(true);
|
||||
on_submit();
|
||||
console_log("Clicked!");
|
||||
disabled.set(false);
|
||||
};
|
||||
|
||||
view! {
|
||||
<div
|
||||
class="transition-all duration-300 flex flex-col"
|
||||
class=(["opacity-100 delay-300"], shown)
|
||||
class=(["opacity-0"], !shown)
|
||||
>
|
||||
<OutlinedTextField
|
||||
label="First Name".into()
|
||||
placeholder="John".into()
|
||||
disabled={disabled}
|
||||
value=RwSignal::new("".to_owned())
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Last Name".into()
|
||||
placeholder="Smith".into()
|
||||
disabled={disabled}
|
||||
value=RwSignal::new("".to_owned())
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Region 15 Email".into()
|
||||
placeholder="jsmith@region15.org".into()
|
||||
disabled={disabled}
|
||||
value=RwSignal::new("".to_owned())
|
||||
/>
|
||||
<ActionButton
|
||||
on:click=on_click
|
||||
disabled={disabled}
|
||||
>
|
||||
"Submit"
|
||||
</ActionButton>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
mod about_page;
|
||||
mod home_page;
|
||||
mod loaner_kiosk;
|
||||
mod provider_entry;
|
||||
|
||||
pub use self::{about_page::*, home_page::*, provider_entry::*};
|
||||
Reference in new issue
Block a user