diff --git a/frontend/src/pages/basic_pages.rs b/frontend/src/pages/basic_pages.rs
index 64e2901..27c6b93 100644
--- a/frontend/src/pages/basic_pages.rs
+++ b/frontend/src/pages/basic_pages.rs
@@ -1,6 +1,7 @@
use gloo_net::http::Request;
use wasm_bindgen_futures::spawn_local;
use yew::prelude::*;
+use yew_router::prelude::*;
#[component(Home)]
pub fn home_component() -> Html {
@@ -31,7 +32,7 @@ pub fn home_component() -> Html {
match *is_admin {
None => html! {
{ "Loading..." }
},
Some(true) => html! { { "You are admin" }
},
- Some(false) => html! { { "You are a normal user" }
},
+ Some(false) => html! { to={crate::Route::Ticket}/> },
}
}
diff --git a/frontend/src/pages/ticket.rs b/frontend/src/pages/ticket.rs
index 72500b9..1d9383a 100644
--- a/frontend/src/pages/ticket.rs
+++ b/frontend/src/pages/ticket.rs
@@ -5,6 +5,7 @@ use wasm_bindgen::JsCast;
use wasm_bindgen_futures::spawn_local;
use web_sys::HtmlSelectElement;
use yew::prelude::*;
+use yew_router::prelude::*;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct TicketCreateScheme {
@@ -155,6 +156,8 @@ pub fn submit_ticket_component() -> Html {
+ to={crate::Route::AllTickets}>{ "Tickets ansehen" }>
+
{
if let Some(s) = &*status {
html!{ { s }
}
@@ -338,6 +341,8 @@ pub fn ticket_by_id_component(props: &TicketProps) -> Html {
+
+ to={crate::Route::AllTickets}>{ "Zurück zur Ticketübersicht" }>
if let Some(err) = &*delete_error {
{ err.clone() }
}
@@ -428,17 +433,21 @@ pub fn all_tickets_component() -> Html {
html! {
{ for tickets.iter().filter(|t| if user.is_admin { true } else if let Some(uid) = user.id { t.user_id == uid } else { false }).map(|t| html! {
- -
-
{ format!("{} - #{}", t.betreff, t.id) }
- { &t.description }
- { match t.status.as_str() {
- "ToDo" => "Zu tun",
- "InProgress" => "In Bearbeitung",
- "Completed" => "Erledigt",
- "Archived" => "Archiviert",
- _ => "Ungültiger Status"
- }}
-
+
+
-
+ to={crate::Route::TicketById{id: t.id}}>
{ format!("{} - #{}", t.betreff, t.id) }
>
+ { &t.description }
+ { match t.status.as_str() {
+ "ToDo" => "Zu tun",
+ "InProgress" => "In Bearbeitung",
+ "Completed" => "Erledigt",
+ "Archived" => "Archiviert",
+ _ => "Ungültiger Status"
+ }}
+
+
+
to={crate::Route::Ticket}>{ "Zurück zur Startseite" }>
+
})}
}
diff --git a/frontend/src/pages/user.rs b/frontend/src/pages/user.rs
index f42abb7..320da7d 100644
--- a/frontend/src/pages/user.rs
+++ b/frontend/src/pages/user.rs
@@ -2,7 +2,7 @@ use gloo_net::http::Request;
use serde::{Deserialize, Serialize};
use wasm_bindgen_futures::spawn_local;
use yew::prelude::*;
-use yew_router::prelude::use_navigator;
+use yew_router::prelude::*;
// #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
// pub struct User {
@@ -298,7 +298,7 @@ pub fn all_users_component() -> Html {
{ for users.iter().map(|t| html! {
-
-
{ format!("{} {}- #{}", t.first_name, t.last_name, t.id) }
+ to={crate::Route::UserByID{id: t.id}}>{ format!("{} {}- #{}", t.first_name, t.last_name, t.id) }
>
})}
@@ -576,6 +576,8 @@ pub fn user_by_id_component(props: &UserProps) -> Html {
+
+ to={crate::Route::AllUsers}>{ "Zurück zur Benutzerübersicht" }>
if let Some(err) = &*delete_error {
{ err.clone() }
}