Added agent & unit fields
This commit is contained in:
parent
b61a1c1f0b
commit
825a54c96d
@ -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>
|
||||
|
17
src/pages/admin/fields/agent.rs
Normal file
17
src/pages/admin/fields/agent.rs
Normal 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! {
|
||||
|
||||
}
|
||||
}
|
@ -1 +1,3 @@
|
||||
pub mod project;
|
||||
pub mod unit;
|
||||
pub mod agent;
|
17
src/pages/admin/fields/unit.rs
Normal file
17
src/pages/admin/fields/unit.rs
Normal 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! {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user