feat: ability to create a project #9

Merged
matous-volf merged 50 commits from feat/project-create into main 2024-08-18 21:36:06 +00:00
3 changed files with 4 additions and 4 deletions
Showing only changes of commit 6f3312ac2f - Show all commits

View File

@ -1,4 +1,4 @@
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
use crate::components::form_project::FormProject;
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
use crate::components::project_form::ProjectForm;
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
use crate::server::projects::create_project;
use dioxus::core_macro::rsx;
use dioxus::dioxus_core::Element;
@ -7,7 +7,7 @@ use dioxus::prelude::*;
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
#[component]
pub(crate) fn Home() -> Element {
rsx! {
FormProject {
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
ProjectForm {
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
onsubmit: move |title| {
spawn(async move {
let _ = create_project(title).await;

coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Consider adding error handling for the create_project call.

The create_project function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.

onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
**Consider adding error handling for the `create_project` call.** The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users. ```rust onsubmit: move |title| { spawn(async move { if let Err(e) = create_project(title).await { // Handle the error, e.g., log it or display a message to the user } }); } ``` <!-- This is an auto-generated reply by CodeRabbit -->
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
matous-volf commented 2024-08-17 08:11:10 +00:00 (Migrated from github.com)
Review

This will be addressed in a later development stage. The project creation should probably result in a redirect.

This will be addressed in a later development stage. The project creation should probably result in a redirect.
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] commented 2024-08-17 08:11:26 +00:00 (Migrated from github.com)
Review

@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.

<!-- [monologue] [observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage. [analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed. [actions] Respond to the user acknowledging their plan and offering further assistance if required. --> @matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- This is an auto-generated reply by CodeRabbit -->

View File

@ -1,3 +1,3 @@
pub(crate) mod app;
pub(crate) mod form_project;
pub(crate) mod home;
pub(crate) mod project_form;

View File

@ -3,7 +3,7 @@ use dioxus::dioxus_core::Element;
coderabbitai[bot] commented 2024-08-17 10:13:37 +00:00 (Migrated from github.com)
Review

Handle potential panic from unwrap().

The use of unwrap() on event.values().get("title") could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.

onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
**Handle potential panic from `unwrap()`.** The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors. ```rust onsubmit: move |event| { if let Some(title) = event.values().get("title") { onsubmit(title.as_value()); } else { // Handle the error, e.g., log a message or provide user feedback } } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-17 10:13:37 +00:00 (Migrated from github.com)
Review

Handle potential panic from unwrap().

The use of unwrap() on event.values().get("title") could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.

onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
**Handle potential panic from `unwrap()`.** The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors. ```rust onsubmit: move |event| { if let Some(title) = event.values().get("title") { onsubmit(title.as_value()); } else { // Handle the error, e.g., log a message or provide user feedback } } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use dioxus::prelude::*;
#[component]
pub(crate) fn FormProject(onsubmit: EventHandler<String>) -> Element {
coderabbitai[bot] commented 2024-08-17 10:13:37 +00:00 (Migrated from github.com)
Review

Handle potential panic from unwrap().

The use of unwrap() on event.values().get("title") could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.

onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
**Handle potential panic from `unwrap()`.** The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors. ```rust onsubmit: move |event| { if let Some(title) = event.values().get("title") { onsubmit(title.as_value()); } else { // Handle the error, e.g., log a message or provide user feedback } } ``` <!-- This is an auto-generated comment by CodeRabbit -->
pub(crate) fn ProjectForm(onsubmit: EventHandler<String>) -> Element {
coderabbitai[bot] commented 2024-08-17 10:13:37 +00:00 (Migrated from github.com)
Review

Handle potential panic from unwrap().

The use of unwrap() on event.values().get("title") could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.

onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
**Handle potential panic from `unwrap()`.** The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors. ```rust onsubmit: move |event| { if let Some(title) = event.values().get("title") { onsubmit(title.as_value()); } else { // Handle the error, e.g., log a message or provide user feedback } } ``` <!-- This is an auto-generated comment by CodeRabbit -->
rsx! {
form {
onsubmit: move |event| {