From 931ae29dea40df52d2172adab24cd40c3ca63b43 Mon Sep 17 00:00:00 2001 From: Twyco Date: Wed, 15 Apr 2026 15:46:44 +0200 Subject: [PATCH] pr improvements --- .../Git/ResolveTicketBranchMatches.php | 2 +- .../Git/ResolveTicketPullRequestMatches.php | 2 +- .../ProjectRepositorySettingsController.php | 2 +- .../ProjectTicketBranchController.php | 6 +-- .../Settings/GitConnectionController.php | 4 +- docs/missing-features.md | 45 +++++-------------- 6 files changed, 18 insertions(+), 43 deletions(-) diff --git a/app/Actions/Git/ResolveTicketBranchMatches.php b/app/Actions/Git/ResolveTicketBranchMatches.php index b8fd908..41346f2 100644 --- a/app/Actions/Git/ResolveTicketBranchMatches.php +++ b/app/Actions/Git/ResolveTicketBranchMatches.php @@ -83,7 +83,7 @@ class ResolveTicketBranchMatches $error = null; } catch (Throwable) { $branches = []; - $error = ((string) config('app.name')).' could not load branches from this repository right now.'; + $error = sprintf('%s could not load branches from this repository right now.', config('app.name')); } return [ diff --git a/app/Actions/Git/ResolveTicketPullRequestMatches.php b/app/Actions/Git/ResolveTicketPullRequestMatches.php index 78fa896..787c405 100644 --- a/app/Actions/Git/ResolveTicketPullRequestMatches.php +++ b/app/Actions/Git/ResolveTicketPullRequestMatches.php @@ -92,7 +92,7 @@ class ResolveTicketPullRequestMatches $error = null; } catch (Throwable) { - $error = ((string) config('app.name')).' could not load pull requests from this repository right now.'; + $error = sprintf('%s could not load pull requests from this repository right now.', config('app.name')); $pullRequests = []; } diff --git a/app/Http/Controllers/ProjectRepositorySettingsController.php b/app/Http/Controllers/ProjectRepositorySettingsController.php index e55ef96..33c858c 100644 --- a/app/Http/Controllers/ProjectRepositorySettingsController.php +++ b/app/Http/Controllers/ProjectRepositorySettingsController.php @@ -189,7 +189,7 @@ class ProjectRepositorySettingsController extends Controller $error = null; } catch (Throwable) { $repositories = []; - $error = ((string) config('app.name')).' could not load repositories from this Git connection right now.'; + $error = sprintf('%s could not load repositories from this Git connection right now.', config('app.name')); } return [ diff --git a/app/Http/Controllers/ProjectTicketBranchController.php b/app/Http/Controllers/ProjectTicketBranchController.php index 778aff1..a3f663b 100644 --- a/app/Http/Controllers/ProjectTicketBranchController.php +++ b/app/Http/Controllers/ProjectTicketBranchController.php @@ -83,7 +83,7 @@ class ProjectTicketBranchController extends Controller } catch (Throwable) { return response()->json([ 'is_valid' => false, - 'message' => ((string) config('app.name')).' could not validate this branch name right now.', + 'message' => sprintf('%s could not validate this branch name right now.', config('app.name')), ]); } @@ -154,7 +154,7 @@ class ProjectTicketBranchController extends Controller ); } catch (Throwable) { throw ValidationException::withMessages([ - 'branch_name' => ((string) config('app.name')).' could not validate this branch name right now.', + 'branch_name' => sprintf('%s could not validate this branch name right now.', config('app.name')), ]); } @@ -182,7 +182,7 @@ class ProjectTicketBranchController extends Controller ); } catch (Throwable) { throw ValidationException::withMessages([ - 'branch_name' => ((string) config('app.name')).' could not create this branch right now.', + 'branch_name' => sprintf('%s could not create this branch right now.', config('app.name')), ]); } diff --git a/app/Http/Controllers/Settings/GitConnectionController.php b/app/Http/Controllers/Settings/GitConnectionController.php index c80cd3a..a57c7df 100644 --- a/app/Http/Controllers/Settings/GitConnectionController.php +++ b/app/Http/Controllers/Settings/GitConnectionController.php @@ -61,7 +61,7 @@ class GitConnectionController extends Controller } catch (Throwable) { return back() ->withErrors([ - 'api_token' => ((string) config('app.name')).' could not authenticate against Gitea with this base URL and token.', + 'api_token' => sprintf('%s could not authenticate against Gitea with this base URL and token.', config('app.name')), ]); } @@ -99,7 +99,7 @@ class GitConnectionController extends Controller } catch (Throwable) { return back() ->withErrors([ - 'api_token' => ((string) config('app.name')).' could not authenticate against Gitea with this base URL and token.', + 'api_token' => sprintf('%s could not authenticate against Gitea with this base URL and token.', config('app.name')), ]); } diff --git a/docs/missing-features.md b/docs/missing-features.md index 6a43be5..a17ac00 100644 --- a/docs/missing-features.md +++ b/docs/missing-features.md @@ -1,37 +1,12 @@ ## Missing features -- (mehr über middlewares steuern) -- mehrere actions/quereys in services/actions auslagern - - generell, aber besonders UpdateProjectTicket ist sehr unübersichtlich -- repository_connections check base Url maybe unnessecary? -- Git listBranches replace baseUrl, owner, rperoName with GItReprository -- Git prs replace baseUrl, owner, rperoName with GItReprository -- replace Kanbangit with env App Name -- change Project Backlog Controller → Project Controller - - handle backlog as a normal column -> only difference is an seperate view in frontend /backlog and /board bleibt bestehen -- remove store ticket from backlog -> create ticket create view. -- always show create on board and backlog -> rediurect to ticket create -- ggf worklog überarbeiten? → type als worklog enum → json je nach enum type oder so - - ziel ist einheitlicherere worklog struktur - - falls sinnvoll, sonst verwerfen -- app/Http/Controllers/ProjectTicketController.php parent ids anderes queren. nicht alle child ids berechnen und excluden -> immer parent vom parent bis null - -## Umsetzung 2026-04-15 - -### Umgesetzt - -- (mehr über middlewares steuern) -- mehrere actions/quereys in services/actions auslagern -- Git listBranches replace baseUrl, owner, rperoName with GItReprository -- Git prs replace baseUrl, owner, rperoName with GItReprository -- replace Kanbangit with env App Name -- change Project Backlog Controller → Project Controller -- remove store ticket from backlog -> create ticket create view. -- always show create on board and backlog -> rediurect to ticket create -- ggf worklog überarbeiten? → type als worklog enum -- app/Http/Controllers/ProjectTicketController.php parent ids anderes queren. nicht alle child ids berechnen und excluden -> immer parent vom parent bis null - -### Nicht umgesetzt - -- repository_connections check base Url maybe unnessecary? - `base_url` bleibt nötig, um Self-hosted-Git-Instanzen und passende User-Credentials eindeutig zuzuordnen. -- handle backlog as a normal column - Backlog bleibt bewusst ein Status ohne `board_column_id`; `/backlog` und `/board` sind nur getrennte Views. +- resources benutzen + - Für jedes Model / Route, resources benutzen, kein mapping/feste arrays mehr in den controller. + - kein 'model' => $model (bspw. 'project' => $project) mehr. + - niemals das model in reponse return. für jedes model deshalb eine resource und diese benutzen. + - in der resource niemals mit only oder manuel die props übergeben. + - Ziel: neue attribute von model sollen nicht ausversehen in responses auftauchen & responses kleiner, falls manche attr nicht gebraucht werden + - folgende actions löschen und durch resource benutzen: + - app/Actions/Projects/BuildProjectBacklogPageProps.php + - app/Actions/Projects/BuildProjectBoardPageProps.php + - app/Actions/Tickets/BuildProjectTicketUpdateAttributes.php