From ef002bf406ff553fb607309d0ccfc0ec38f35993 Mon Sep 17 00:00:00 2001 From: irgendwas Date: Fri, 4 Apr 2025 11:26:14 +0200 Subject: [PATCH 1/5] revert 54ca7f90b1ff1f3d4d53739fe6c92a9c5147f8af revert commit fmt --- .woodpecker/check_fmt.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.woodpecker/check_fmt.yaml b/.woodpecker/check_fmt.yaml index ffaecc2..35d12fa 100644 --- a/.woodpecker/check_fmt.yaml +++ b/.woodpecker/check_fmt.yaml @@ -6,10 +6,4 @@ steps: - name: "Run nix flake check" image: docker.nix-community.org/nixpkgs/nix-flakes commands: - - nix fmt - - name: push commit - image: appleboy/drone-git-push - settings: - remote_name: origin - branch: main - local_ref: main + - nix fmt -- --fail-on-change From 00148b02eb5dff1d227d3728476a8bb7e60b59e8 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 4 Apr 2025 11:31:16 +0200 Subject: [PATCH 2/5] make ci run on prs --- .woodpecker/check_fmt.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.woodpecker/check_fmt.yaml b/.woodpecker/check_fmt.yaml index 35d12fa..fbee4b6 100644 --- a/.woodpecker/check_fmt.yaml +++ b/.woodpecker/check_fmt.yaml @@ -1,6 +1,5 @@ when: - - event: push - branch: main + - event: pull_request steps: - name: "Run nix flake check" From 3139bab32f046e8f43e4c263d05bbc91b4bebbe3 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 4 Apr 2025 11:32:19 +0200 Subject: [PATCH 3/5] run treefmt --- .vscode/settings.json | 6 +++--- README.md | 3 ++- bruno/bruno.json | 7 ++----- crates/backend/src/controller/auth.rs | 5 +++-- crates/backend/src/controller/class.rs | 2 +- crates/backend/src/controller/group.rs | 2 +- crates/backend/src/controller/project.rs | 4 ++-- crates/backend/src/controller/template.rs | 2 +- crates/backend/src/controller/user.rs | 4 ++-- crates/backend/src/db/user.rs | 4 ++-- crates/backend/src/error.rs | 2 +- crates/backend/src/main.rs | 6 +++--- crates/ldap/src/ldap.rs | 18 ++++++++++-------- dev-compose.yml | 14 +++++++++++--- 14 files changed, 44 insertions(+), 35 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 949809d..b1ff449 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { - "rust-analyzer.check.features": "all", - "rust-analyzer.cargo.features": "all" -} \ No newline at end of file + "rust-analyzer.check.features": "all", + "rust-analyzer.cargo.features": "all" +} diff --git a/README.md b/README.md index 6d28838..4475f86 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # peer-group-grading -Wir sind cool \ No newline at end of file + +Wir sind cool diff --git a/bruno/bruno.json b/bruno/bruno.json index 7dd5cbe..1f01e68 100644 --- a/bruno/bruno.json +++ b/bruno/bruno.json @@ -2,8 +2,5 @@ "version": "1", "name": "pgg-bruno", "type": "collection", - "ignore": [ - "node_modules", - ".git" - ] -} \ No newline at end of file + "ignore": ["node_modules", ".git"] +} diff --git a/crates/backend/src/controller/auth.rs b/crates/backend/src/controller/auth.rs index 19e0461..03cfb02 100644 --- a/crates/backend/src/controller/auth.rs +++ b/crates/backend/src/controller/auth.rs @@ -1,11 +1,12 @@ use actix_session::Session; use actix_web::{ - HttpResponse, Responder, post, + post, web::{self, ServiceConfig}, + HttpResponse, Responder, }; use serde::Deserialize; -use crate::{Database, error::ApiError}; +use crate::{error::ApiError, Database}; #[derive(Deserialize)] struct LoginRequest { diff --git a/crates/backend/src/controller/class.rs b/crates/backend/src/controller/class.rs index 999afac..2670d21 100644 --- a/crates/backend/src/controller/class.rs +++ b/crates/backend/src/controller/class.rs @@ -1,4 +1,4 @@ -use actix_web::{Responder, delete, get, post, put}; +use actix_web::{delete, get, post, put, Responder}; pub fn setup(cfg: &mut actix_web::web::ServiceConfig) { cfg.service(get_classes) diff --git a/crates/backend/src/controller/group.rs b/crates/backend/src/controller/group.rs index 74f46d7..441b60b 100644 --- a/crates/backend/src/controller/group.rs +++ b/crates/backend/src/controller/group.rs @@ -1,4 +1,4 @@ -use actix_web::{Responder, delete, get, post, put}; +use actix_web::{delete, get, post, put, Responder}; pub fn setup(cfg: &mut actix_web::web::ServiceConfig) { cfg.service(get_groups) diff --git a/crates/backend/src/controller/project.rs b/crates/backend/src/controller/project.rs index 1cec71c..6f55338 100644 --- a/crates/backend/src/controller/project.rs +++ b/crates/backend/src/controller/project.rs @@ -1,9 +1,9 @@ -use actix_web::{Result, delete, get, post, put, web}; +use actix_web::{delete, get, post, put, web, Result}; use uuid::Uuid; use validator::Validate; -use crate::db::Database; use crate::db::project::CreateProject; +use crate::db::Database; use crate::entity; use crate::error::ApiError; diff --git a/crates/backend/src/controller/template.rs b/crates/backend/src/controller/template.rs index 3d927f5..dd9ccc5 100644 --- a/crates/backend/src/controller/template.rs +++ b/crates/backend/src/controller/template.rs @@ -1,4 +1,4 @@ -use actix_web::{Responder, delete, get, post, put}; +use actix_web::{delete, get, post, put, Responder}; pub fn setup(cfg: &mut actix_web::web::ServiceConfig) { cfg.service(get_templates) diff --git a/crates/backend/src/controller/user.rs b/crates/backend/src/controller/user.rs index 14ddc00..c50281e 100644 --- a/crates/backend/src/controller/user.rs +++ b/crates/backend/src/controller/user.rs @@ -1,5 +1,5 @@ -use crate::{Database, entity, error::ApiError}; -use actix_web::{Responder, delete, get, post, put, web}; +use crate::{entity, error::ApiError, Database}; +use actix_web::{delete, get, post, put, web, Responder}; use serde::Deserialize; use validator::Validate; diff --git a/crates/backend/src/db/user.rs b/crates/backend/src/db/user.rs index ed0cca4..340ff49 100644 --- a/crates/backend/src/db/user.rs +++ b/crates/backend/src/db/user.rs @@ -1,7 +1,7 @@ use crate::error::ApiError; use argon2::{ + password_hash::{rand_core::OsRng, PasswordHasher, SaltString}, Argon2, PasswordHash, PasswordVerifier, - password_hash::{PasswordHasher, SaltString, rand_core::OsRng}, }; use sea_orm::{ ActiveModelTrait, @@ -10,7 +10,7 @@ use sea_orm::{ }; use uuid::Uuid; -use crate::{Database, entity}; +use crate::{entity, Database}; impl Database { pub async fn create_user( diff --git a/crates/backend/src/error.rs b/crates/backend/src/error.rs index 4fa1f90..dd52cb2 100644 --- a/crates/backend/src/error.rs +++ b/crates/backend/src/error.rs @@ -1,4 +1,4 @@ -use actix_web::{HttpResponse, ResponseError, cookie::time::error, http::StatusCode}; +use actix_web::{cookie::time::error, http::StatusCode, HttpResponse, ResponseError}; use sea_orm::TransactionError; use thiserror::Error; diff --git a/crates/backend/src/main.rs b/crates/backend/src/main.rs index fb70dff..d35d2e9 100644 --- a/crates/backend/src/main.rs +++ b/crates/backend/src/main.rs @@ -1,14 +1,14 @@ use actix_files::NamedFile; -use actix_session::{SessionMiddleware, storage::RedisSessionStore}; -use actix_web::{App, HttpResponse, HttpServer, cookie::Key, middleware::Logger, web}; +use actix_session::{storage::RedisSessionStore, SessionMiddleware}; +use actix_web::{cookie::Key, middleware::Logger, web, App, HttpResponse, HttpServer}; use log::debug; mod controller; mod db; mod error; -pub use db::Database; pub use db::entity; +pub use db::Database; #[derive(Clone)] struct AppConfig { diff --git a/crates/ldap/src/ldap.rs b/crates/ldap/src/ldap.rs index 7030b63..de0b418 100644 --- a/crates/ldap/src/ldap.rs +++ b/crates/ldap/src/ldap.rs @@ -30,17 +30,19 @@ fn authenticate_user(username: &str, password: &str) -> Result std::io::Result<()> { .bind(("127.0.0.1", 8080))? .run() .await -} \ No newline at end of file +} diff --git a/dev-compose.yml b/dev-compose.yml index 296bc54..5384b24 100644 --- a/dev-compose.yml +++ b/dev-compose.yml @@ -39,13 +39,21 @@ services: - ./crates/ldap/src/users.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/users.ldif healthcheck: - test: ["CMD", "ldapsearch", "-x", "-H", "ldap://localhost", "-b", "dc=Schule,dc=intern"] + test: + [ + "CMD", + "ldapsearch", + "-x", + "-H", + "ldap://localhost", + "-b", + "dc=Schule,dc=intern", + ] interval: 30s retries: 3 - volumes: postgres_data: redis: openldap_data: - openldap_config: \ No newline at end of file + openldap_config: From c6211418a667b9db2973e61eeda0142fca5ed291 Mon Sep 17 00:00:00 2001 From: Jan Hoegerle Date: Fri, 4 Apr 2025 11:20:46 +0200 Subject: [PATCH 4/5] Adding PrimeVue dependencies --- frontend/package.json | 2 ++ pnpm-lock.yaml | 71 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/frontend/package.json b/frontend/package.json index 3d4580a..9f3ed32 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,7 +14,9 @@ "format": "prettier --write src/" }, "dependencies": { + "@primeuix/themes": "^1.0.1", "pinia": "^3.0.1", + "primevue": "^4.3.3", "vue": "^3.5.13", "vue-router": "^4.5.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f13700..e7a0a7c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,9 +10,15 @@ importers: frontend: dependencies: + '@primeuix/themes': + specifier: ^1.0.1 + version: 1.0.1 pinia: specifier: ^3.0.1 version: 3.0.1(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2)) + primevue: + specifier: ^4.3.3 + version: 4.3.3(vue@3.5.13(typescript@5.8.2)) vue: specifier: ^3.5.13 version: 3.5.13(typescript@5.8.2) @@ -516,6 +522,30 @@ packages: '@polka/url@1.0.0-next.28': resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} + '@primeuix/styled@0.5.1': + resolution: {integrity: sha512-5Ftw/KSauDPClQ8F2qCyCUF7cIUEY4yLNikf0rKV7Vsb8zGYNK0dahQe7CChaR6M2Kn+NA2DSBSk76ZXqj6Uog==} + engines: {node: '>=12.11.0'} + + '@primeuix/styles@1.0.1': + resolution: {integrity: sha512-R7SX001ILHIJM9hh1opbsuOFFK8dOM8GY1y99jaCFnAc5gGy3mFPJMhoexRYV1a6UZ2YbfcsQVPbIhoONI1gfg==} + + '@primeuix/themes@1.0.1': + resolution: {integrity: sha512-RllttI3oGTZa66UQDCIA2lPnJvO/xqtNpy+0eNql6fIxdS2AUg5n7L81jTZrHNZ+31T5OBzL/SGFCDycmHTz2g==} + + '@primeuix/utils@0.5.3': + resolution: {integrity: sha512-7SGh7734wcF1/uK6RzO6Z6CBjGQ97GDHfpyl2F1G/c7R0z9hkT/V72ypDo82AWcCS7Ta07oIjDpOCTkSVZuEGQ==} + engines: {node: '>=12.11.0'} + + '@primevue/core@4.3.3': + resolution: {integrity: sha512-kSkN5oourG7eueoFPIqiNX3oDT/f0I5IRK3uOY/ytz+VzTZp5yuaCN0Nt42ZQpVXjDxMxDvUhIdaXVrjr58NhQ==} + engines: {node: '>=12.11.0'} + peerDependencies: + vue: ^3.5.0 + + '@primevue/icons@4.3.3': + resolution: {integrity: sha512-ouQaxHyeFB6MSfEGGbjaK5Qv9efS1xZGetZoU5jcPm090MSYLFtroP1CuK3lZZAQals06TZ6T6qcoNukSHpK5w==} + engines: {node: '>=12.11.0'} + '@rollup/pluginutils@5.1.4': resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} engines: {node: '>=14.0.0'} @@ -1713,6 +1743,10 @@ packages: resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} engines: {node: '>=18'} + primevue@4.3.3: + resolution: {integrity: sha512-nooYVoEz5CdP3EhUkD6c3qTdRmpLHZh75fBynkUkl46K8y5rksHTjdSISiDijwTA5STQIOkyqLb+RM+HQ6nC1Q==} + engines: {node: '>=12.11.0'} + proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} @@ -2550,6 +2584,33 @@ snapshots: '@polka/url@1.0.0-next.28': {} + '@primeuix/styled@0.5.1': + dependencies: + '@primeuix/utils': 0.5.3 + + '@primeuix/styles@1.0.1': + dependencies: + '@primeuix/styled': 0.5.1 + + '@primeuix/themes@1.0.1': + dependencies: + '@primeuix/styled': 0.5.1 + + '@primeuix/utils@0.5.3': {} + + '@primevue/core@4.3.3(vue@3.5.13(typescript@5.8.2))': + dependencies: + '@primeuix/styled': 0.5.1 + '@primeuix/utils': 0.5.3 + vue: 3.5.13(typescript@5.8.2) + + '@primevue/icons@4.3.3(vue@3.5.13(typescript@5.8.2))': + dependencies: + '@primeuix/utils': 0.5.3 + '@primevue/core': 4.3.3(vue@3.5.13(typescript@5.8.2)) + transitivePeerDependencies: + - vue + '@rollup/pluginutils@5.1.4(rollup@4.37.0)': dependencies: '@types/estree': 1.0.6 @@ -3779,6 +3840,16 @@ snapshots: dependencies: parse-ms: 4.0.0 + primevue@4.3.3(vue@3.5.13(typescript@5.8.2)): + dependencies: + '@primeuix/styled': 0.5.1 + '@primeuix/styles': 1.0.1 + '@primeuix/utils': 0.5.3 + '@primevue/core': 4.3.3(vue@3.5.13(typescript@5.8.2)) + '@primevue/icons': 4.3.3(vue@3.5.13(typescript@5.8.2)) + transitivePeerDependencies: + - vue + proto-list@1.2.4: {} punycode@2.3.1: {} From 4f6b5bab31c6322b79dcfd9cce07eaa809548383 Mon Sep 17 00:00:00 2001 From: Jan Hoegerle Date: Fri, 4 Apr 2025 11:21:19 +0200 Subject: [PATCH 5/5] Adding primevue to project --- frontend/src/main.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 5dcad83..16724be 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -2,12 +2,19 @@ import './assets/main.css' import { createApp } from 'vue' import { createPinia } from 'pinia' +import PrimeVue from 'primevue/config'; +import Aura from '@primeuix/themes/aura'; import App from './App.vue' import router from './router' const app = createApp(App) +app.use(PrimeVue, { + theme: { + preset: Aura + } +}) app.use(createPinia()) app.use(router)