feat: some comparison naming and category changes
This commit is contained in:
1 parent
0401027e7d
commit
f479fb8030
6 files changed
+46
-34
No files matched your search
@@ -207,21 +207,7 @@ fn make_comp_list() -> Vec<ComparisonData> {
|
||||
"Academic Information",
|
||||
"Math SAT Score > 650",
|
||||
);
|
||||
|
||||
let service_hours_25 = ComparisonData::new(
|
||||
"map_sum_comp",
|
||||
"community_involvement",
|
||||
ComparisonType::MapList(MapListComparison::FlattenToNumberList(
|
||||
"service_hours".to_string(),
|
||||
Box::new(NumberListComparison::Sum(Box::new(
|
||||
NumberComparison::GreaterThanOrEqual,
|
||||
))),
|
||||
)),
|
||||
ValueType::Number(Some(25.to_string())),
|
||||
"Community Service",
|
||||
"25 service hours",
|
||||
);
|
||||
|
||||
|
||||
let service_hours_20 = ComparisonData::new(
|
||||
"service_hours_20",
|
||||
"community_involvement",
|
||||
@@ -233,7 +219,21 @@ fn make_comp_list() -> Vec<ComparisonData> {
|
||||
)),
|
||||
ValueType::Number(Some(20.to_string())),
|
||||
"Community Service",
|
||||
"20 service hours",
|
||||
"20+ service hours",
|
||||
);
|
||||
|
||||
let service_hours_25 = ComparisonData::new(
|
||||
"service_hours_25",
|
||||
"community_involvement",
|
||||
ComparisonType::MapList(MapListComparison::FlattenToNumberList(
|
||||
"service_hours".to_string(),
|
||||
Box::new(NumberListComparison::Sum(Box::new(
|
||||
NumberComparison::GreaterThanOrEqual,
|
||||
))),
|
||||
)),
|
||||
ValueType::Number(Some(25.to_string())),
|
||||
"Community Service",
|
||||
"25+ service hours",
|
||||
);
|
||||
|
||||
let service_hours_30 = ComparisonData::new(
|
||||
@@ -273,7 +273,7 @@ fn make_comp_list() -> Vec<ComparisonData> {
|
||||
"attended_bas",
|
||||
ComparisonType::Text(TextComparison::Matches),
|
||||
ValueType::String(Some("Yes".to_string())),
|
||||
"Miscellaneous",
|
||||
"Additional Eligibility Factors",
|
||||
"Attended BAS",
|
||||
);
|
||||
|
||||
@@ -282,7 +282,7 @@ fn make_comp_list() -> Vec<ComparisonData> {
|
||||
"middsouth_church",
|
||||
ComparisonType::Text(TextComparison::Matches),
|
||||
ValueType::String(Some("Yes".to_string())),
|
||||
"Miscellaneous",
|
||||
"Additional Eligibility Factors",
|
||||
"Member of Midd-South Church",
|
||||
);
|
||||
|
||||
@@ -291,7 +291,7 @@ fn make_comp_list() -> Vec<ComparisonData> {
|
||||
"family_military_service",
|
||||
ComparisonType::Text(TextComparison::Matches),
|
||||
ValueType::String(Some("Yes".to_string())),
|
||||
"Miscellaneous",
|
||||
"Additional Eligibility Factors",
|
||||
"Family with Military Service",
|
||||
);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use serde_dynamo::{from_item, to_item};
|
||||
use crate::common::ValueType;
|
||||
|
||||
use crate::common::ExpandableInfo;
|
||||
use crate::components::{ActionButton, Banner, DashboardButton, OutlinedTextField, Panel, Row, Select, TextFieldType, ValidatedForm};
|
||||
use crate::components::{ActionButton, Banner, DashboardButton, OutlinedTextField, Panel, Row, Select, TextFieldType, Toast, ToastContext, ToastList, ValidatedForm};
|
||||
use chrono::{FixedOffset, TimeZone};
|
||||
use leptos::Params;
|
||||
use leptos::either::{Either, EitherOf3};
|
||||
@@ -212,6 +212,7 @@ pub fn LoanerPage() -> impl IntoView {
|
||||
// We'll create the page here - the sidebar contains all the buttons, while the form
|
||||
// container either shows forms or shows placeholder text.
|
||||
view! {
|
||||
<ToastList>
|
||||
<Banner
|
||||
title="Chromebook Loaners"
|
||||
logo="/PHS_Stacked_Acronym.png"
|
||||
@@ -238,6 +239,7 @@ pub fn LoanerPage() -> impl IntoView {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ToastList>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,6 +259,20 @@ pub fn LoanerBorrowForm() -> impl IntoView {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//#region Toast Logic
|
||||
let mut toast_context = expect_context::<ToastContext>();
|
||||
Effect::new(move || {
|
||||
if let Some(Ok(_)) = create_entry_action.value().get() {
|
||||
create_entry_action.clear();
|
||||
toast_context.toast(
|
||||
Toast::new()
|
||||
.id(uuid::Uuid::new_v4().to_string())
|
||||
.msg("From the form!")
|
||||
);
|
||||
}
|
||||
});
|
||||
//#endregion
|
||||
|
||||
view! {
|
||||
<ValidatedForm on_submit=Callback::new(on_submit)>
|
||||
|
||||
@@ -17,7 +17,7 @@ pub fn ProviderPortal() -> impl IntoView {
|
||||
title="Profile"
|
||||
description="Edit user profile"
|
||||
icon="/Person_Black.png"
|
||||
path="/"
|
||||
path="/providers/profile"
|
||||
/>
|
||||
<DashboardButton
|
||||
title="Create Scholarship"
|
||||
|
||||
@@ -3,14 +3,13 @@ use leptos::either::Either;
|
||||
use leptos::html::Dialog;
|
||||
use leptos::logging::log;
|
||||
use leptos::prelude::*;
|
||||
use leptos::task::spawn_local;
|
||||
use leptos_oidc::{AuthLoaded, Authenticated};
|
||||
use leptos_router::hooks::{use_navigate, use_params};
|
||||
use crate::common::{ExpandableInfo, ScholarshipFormParams, SubmitStatus, ValueType};
|
||||
use crate::components::{ActionButton, Banner, ChipsList, Loading, OutlinedTextField, Panel, RadioList, Row, TextFieldType, ValidatedForm};
|
||||
use super::UnauthenticatedPage;
|
||||
use crate::pages::utils::get_user_claims;
|
||||
use super::api::{get_comparison_info, get_provider_scholarships, get_scholarship_info, CreateScholarshipInfo, RegisterScholarship, DeleteProviderScholarship, get_comparisons_categorized, create_test_comparisons, CreateTestComparisons};
|
||||
use super::api::{get_comparison_info, get_provider_scholarships, get_scholarship_info, CreateScholarshipInfo, RegisterScholarship, DeleteProviderScholarship, get_comparisons_categorized, CreateTestComparisons};
|
||||
|
||||
|
||||
/// # Scholarship Info Page
|
||||
@@ -461,8 +460,8 @@ fn ScholarshipForm(
|
||||
let sports_ids = Signal::derive(move || get_comp_ids("Sports Participation"));
|
||||
let sports_text = Signal::derive(move || get_comp_text("Sports Participation"));
|
||||
|
||||
let misc_ids = Signal::derive(move || get_comp_ids("Miscellaneous"));
|
||||
let misc_text = Signal::derive(move || get_comp_text("Miscellaneous"));
|
||||
let misc_ids = Signal::derive(move || get_comp_ids("Additional Eligibility Factors"));
|
||||
let misc_text = Signal::derive(move || get_comp_text("Additional Eligibility Factors"));
|
||||
|
||||
let comm_ids = Signal::derive(move || get_comp_ids("Community Service"));
|
||||
let comm_text = Signal::derive(move || get_comp_text("Community Service"));
|
||||
@@ -539,7 +538,7 @@ fn ScholarshipForm(
|
||||
</Row>
|
||||
<Row>
|
||||
<OutlinedTextField
|
||||
label="Total amount of all awards:"
|
||||
label="Total amount of all award(s): (estimates are acceptable)"
|
||||
placeholder="Enter an amount..."
|
||||
disabled=elements_disabled
|
||||
data_member="total_awards"
|
||||
@@ -553,7 +552,7 @@ fn ScholarshipForm(
|
||||
data_map=form_data
|
||||
items=vec!["Yes".to_string(), "No".to_string()]
|
||||
disabled=elements_disabled
|
||||
label="Do you require student financial information?"
|
||||
label="Do you require student FAFSA information?"
|
||||
/>
|
||||
</Row>
|
||||
<Row>
|
||||
@@ -630,7 +629,7 @@ fn ScholarshipForm(
|
||||
</Row>
|
||||
<Row>
|
||||
<ChipsList
|
||||
label="Miscellaneous"
|
||||
label="Additional Eligibility Factors"
|
||||
data_member="misc"
|
||||
data_map=chips_data
|
||||
values=misc_ids
|
||||
|
||||
Reference in new issue
Block a user