Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
467f8c9020 | ||
|
|
909f33b044 | ||
|
|
44450f407c | ||
|
|
70a86f4545 | ||
|
|
e6409cc423 | ||
|
|
4e3161a05f |
No files matched your search
+7
-7
@@ -1,11 +1,11 @@
|
||||
use crate::components::ToastList;
|
||||
use crate::components::login::ProviderLoginContext;
|
||||
use crate::pages::student;
|
||||
use crate::pages::{
|
||||
AdminHomePage, AdminProviderPage, AdminScholarshipPage, AdminShell, AdminUtilsPage,
|
||||
ApplicantsPageFallback, AuthCallbackPage, LoanerBorrowForm, LoanerFallback, LoanerReturnForm,
|
||||
LoanerShell, ProviderContactPage, ProviderPortal, ScholarshipInfoPage,
|
||||
LoanerShell, ProviderContactPage, ProviderPortal,
|
||||
};
|
||||
use crate::pages::{FormClosedPage, student};
|
||||
use leptos::prelude::*;
|
||||
use leptos_meta::{MetaTags, Stylesheet, Title, provide_meta_context};
|
||||
use leptos_oidc::AuthSignal;
|
||||
@@ -89,11 +89,11 @@ fn ProviderRoutes() -> impl MatchNestedRoutes + Clone {
|
||||
<Route path=path!("/applicants") view=ApplicantsPageFallback />
|
||||
<Route path=path!("/callback") view=AuthCallbackPage />
|
||||
<Route path=path!("/profile") view=ProviderContactPage />
|
||||
// <Route path=path!("/scholarships") view=FormClosedPage />
|
||||
<ParentRoute path=path!("/scholarships") view=ScholarshipInfoPage>
|
||||
<Route path=path!(":id") view=ScholarshipInfoPage />
|
||||
<Route path=path!("") view=ScholarshipInfoPage />
|
||||
</ParentRoute>
|
||||
<Route path=path!("/scholarships") view=FormClosedPage />
|
||||
// <ParentRoute path=path!("/scholarships") view=ScholarshipInfoPage>
|
||||
// <Route path=path!(":id") view=ScholarshipInfoPage />
|
||||
// <Route path=path!("") view=ScholarshipInfoPage />
|
||||
// </ParentRoute>
|
||||
</ParentRoute>
|
||||
}
|
||||
.into_inner()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::pages::api::files::{DeleteFile, upload_file};
|
||||
use leptos::html::{Input, Label};
|
||||
use leptos::logging::debug_log;
|
||||
use leptos::logging::{debug_error, debug_log};
|
||||
use leptos::prelude::*;
|
||||
use leptos::web_sys::{File, FormData};
|
||||
use leptos_icons::Icon;
|
||||
@@ -28,6 +28,7 @@ pub fn FileDrop(
|
||||
|
||||
let file_name_list = RwSignal::new(Vec::new());
|
||||
let hovering = RwSignal::new(false);
|
||||
let error_msg = RwSignal::new(String::new());
|
||||
let name = StoredValue::new(name);
|
||||
let form_id = StoredValue::new(form_id);
|
||||
let auth = expect_context::<AuthSignal>();
|
||||
@@ -172,10 +173,18 @@ pub fn FileDrop(
|
||||
existing_files
|
||||
.get()
|
||||
.map(|result| {
|
||||
if let Ok(files) = result {
|
||||
file_name_list.set(files);
|
||||
match result {
|
||||
Ok(files) => {
|
||||
error_msg.set("".to_string());
|
||||
file_name_list.set(files);
|
||||
}
|
||||
Err(err) => {
|
||||
let msg = err.to_string();
|
||||
debug_error!("Error while getting files: {}", msg);
|
||||
error_msg.set(msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}}
|
||||
<label
|
||||
node_ref=zone_ref
|
||||
@@ -194,6 +203,9 @@ pub fn FileDrop(
|
||||
<div class="text-sm text-gray-400">"Or click to select a file"</div>
|
||||
<input node_ref=input_ref type="file" class="hidden" on:change=on_input_change />
|
||||
</label>
|
||||
<Show when=move || !error_msg.get().is_empty()>
|
||||
<div class="flex-1">{error_msg}</div>
|
||||
</Show>
|
||||
<For
|
||||
each=move || file_name_list.get()
|
||||
key=|file| file.clone()
|
||||
|
||||
@@ -146,7 +146,7 @@ pub fn StudentEligibilityPage() -> impl IntoView {
|
||||
),
|
||||
async move |(access_token, form_id, scholarship_id)| {
|
||||
let Some(access_token) = access_token else {
|
||||
return Ok(Vec::new());
|
||||
return Err(ServerFnError::new("Couldn't find access token"));
|
||||
};
|
||||
list_files(access_token, form_id, scholarship_id).await
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user