From 8ee2ca5c144890e7658150afaacd3489d7734600 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Fri, 7 Jul 2023 21:23:52 +0200 Subject: [PATCH] feat: with updated things Signed-off-by: kjuulh --- Cargo.lock | 1 + Cargo.toml | 2 + input.css | 12 +++ scripts/dev.sh | 6 +- scripts/nodev.sh | 2 +- scripts/refresh:schema.sh | 12 ++- src/api/graphql/schema/schema.json | 4 +- src/common/layout.rs | 9 +- src/features.rs | 2 + src/features/command_line/mod.rs | 56 +++++++++++ src/features/dashboard_list_view.rs | 4 + .../dashboard_list_view.rs | 93 +++++++++++++++++++ src/features/dashboard_list_view/gen/mod.rs | 1 + .../dashboard_list_view/gen/queries.rs | 81 ++++++++++++++++ .../graphql/queries.graphql | 13 +++ src/features/navbar_projects/gen/queries.rs | 6 +- .../navbar_projects/navbar_projects.rs | 11 ++- src/routes.rs | 1 - src/routes/dash/home.rs | 4 +- src/routes/features_view.rs | 2 +- style/output.css | 88 +++++++++++++++++- 21 files changed, 386 insertions(+), 24 deletions(-) create mode 100644 src/features/command_line/mod.rs create mode 100644 src/features/dashboard_list_view.rs create mode 100644 src/features/dashboard_list_view/dashboard_list_view.rs create mode 100644 src/features/dashboard_list_view/gen/mod.rs create mode 100644 src/features/dashboard_list_view/gen/queries.rs create mode 100644 src/features/dashboard_list_view/graphql/queries.graphql diff --git a/Cargo.lock b/Cargo.lock index 8970762..7dfc854 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -401,6 +401,7 @@ dependencies = [ "lazy_static", "leptos", "leptos_axum", + "leptos_dom", "leptos_meta", "leptos_router", "log", diff --git a/Cargo.toml b/Cargo.toml index cea2abf..b6fa681 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ console_log = "0.2" cfg-if = "1" lazy_static = "1" leptos = { version = "*", default-features = false, features = ["serde"] } +leptos_dom = { version = "*", default-features = false } leptos_meta = { version = "*", default-features = false } leptos_axum = { version = "*", default-features = false, optional = true } leptos_router = { version = "*", default-features = false } @@ -54,6 +55,7 @@ ssr = [ "leptos/ssr", "leptos_meta/ssr", "leptos_router/ssr", + "leptos_dom/ssr", "dep:leptos_axum", "dep:tracing-subscriber", "dep:tracing", diff --git a/input.css b/input.css index 11d9dbe..29276d5 100644 --- a/input.css +++ b/input.css @@ -12,3 +12,15 @@ html, body { .feature-case { @apply m-8 border-blue-700 border-2 rounded-lg p-4; } + +.dashboard-list-item { + @apply flex flex-col justify-center hover:dark:bg-blue-900 cursor-pointer select-none px-4 py-2 border-y border-y-gray-800; +} + +.dashboard-list-project { + @apply dark:bg-gray-800 hover:dark:bg-blue-900 text-gray-300; +} + +.dashboard-item { + @apply pl-6 +} diff --git a/scripts/dev.sh b/scripts/dev.sh index 2782f16..e203e71 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,16 +1,16 @@ #!/bin/bash -tmux new-session -d -s dev +tmux new-window -n dev # allow for user input tmux split-window -h # leptos -tmux send-keys -t dev "cuddle_cli x leptos:dev" C-m +tmux send-keys -t dev "cuddle x leptos:dev" C-m tmux split-window -v # tailwind -tmux send-keys -t dev "cuddle_cli x tailwind:watch" C-m +tmux send-keys -t dev "cuddle x tailwind:watch" C-m # set user input to first tmux select-pane -t 0 diff --git a/scripts/nodev.sh b/scripts/nodev.sh index 52562f5..0e997d7 100755 --- a/scripts/nodev.sh +++ b/scripts/nodev.sh @@ -1,3 +1,3 @@ #!/bin/bash -tmux kill-session -t dev || true +tmux kill-window -t dev || true diff --git a/scripts/refresh:schema.sh b/scripts/refresh:schema.sh index 22ccd7b..25a757e 100755 --- a/scripts/refresh:schema.sh +++ b/scripts/refresh:schema.sh @@ -9,4 +9,14 @@ graphql-client generate \ --schema-path src/api/graphql/schema/schema.json \ src/features/navbar_projects/graphql/queries.graphql \ --output-directory src/features/navbar_projects/gen \ - --custom-scalars-module='crate::common::graphql' + --custom-scalars-module='crate::common::graphql' \ + --variables-derives='Clone,Debug' \ + --response-derives='Clone,Debug' + +graphql-client generate \ + --schema-path src/api/graphql/schema/schema.json \ + src/features/dashboard_list_view/graphql/queries.graphql \ + --output-directory src/features/dashboard_list_view/gen \ + --custom-scalars-module='crate::common::graphql' \ + --variables-derives='Clone,Debug' \ + --response-derives='Clone,Debug' diff --git a/src/api/graphql/schema/schema.json b/src/api/graphql/schema/schema.json index c01c432..3d8dad3 100644 --- a/src/api/graphql/schema/schema.json +++ b/src/api/graphql/schema/schema.json @@ -767,7 +767,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "ProjectDto", + "name": "Project", "ofType": null } } @@ -789,7 +789,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "ProjectDto", + "name": "Project", "ofType": null } } diff --git a/src/common/layout.rs b/src/common/layout.rs index 677074e..d834991 100644 --- a/src/common/layout.rs +++ b/src/common/layout.rs @@ -1,12 +1,13 @@ use leptos::*; use leptos_router::*; +use crate::features::command_line::CommandLine; use crate::features::navbar_projects::NavbarProjects; #[component] pub fn DashNav(cx: Scope) -> impl IntoView { view! { cx, -