Added agent & unit fields

This commit is contained in:
Franklin 2023-04-25 08:26:11 -04:00
parent b61a1c1f0b
commit 825a54c96d
4 changed files with 40 additions and 4 deletions

View File

@ -11,7 +11,7 @@ use crate::{
components::{
admin_nav_bar::AdminNavigationBar,
},
pages::admin::{fields::project::ProjectFields},
pages::admin::{fields::{project::ProjectFields, unit::UnitFields, agent::AgentFields}},
};
/// All of the editing actions of the admin panel will lead to here. This should take an id of anything. A unit, a project, an agent. And its corresponding ID.
@ -61,9 +61,9 @@ pub fn edit_page(props: &AdminEditPageProps) -> Html {
<div class={"admin-project-fields-container"}>
{
match props.edit_item {
EditItem::Agent => {html! {}},
EditItem::Agent => {html! { <AgentFields /> }},
EditItem::Project => {html! { <ProjectFields listing={(*listing).clone()} edittype={props.edit_type.clone()}/> }},
EditItem::Unit(_) => {html! {}},
EditItem::Unit(_) => {html! { <UnitFields /> }},
}
}
</div>

View File

@ -0,0 +1,17 @@
use jl_types::domain::agent::Agent;
use yew::prelude::*;
use crate::pages::admin::edit::EditType;
#[derive(Properties, PartialEq, Clone)]
pub struct AgentFieldsProps {
pub agent: Option<Agent>,
pub edittype: EditType,
}
#[function_component(AgentFields)]
pub fn agent_fields() -> Html {
html! {
}
}

View File

@ -1 +1,3 @@
pub mod project;
pub mod unit;
pub mod agent;

View File

@ -0,0 +1,17 @@
use jl_types::domain::unit::Unit;
use yew::prelude::*;
use crate::pages::admin::edit::EditType;
#[derive(Properties, PartialEq, Clone)]
pub struct UnitFieldsProps {
pub unit: Option<Unit>,
pub edittype: EditType,
}
#[function_component(UnitFields)]
pub fn unit_fields() -> Html {
html! {
}
}