Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External project wireframe #241

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
df68712
antrag view, progress component
thsstll Jun 5, 2024
15031b2
financial planning view & components
thsstll Jun 7, 2024
b00557a
antrag step 1,4,5 wip. TODO: summary, dropdown, fileupload, radio box…
thsstll Jun 7, 2024
e9e9491
fixed typos
thsstll Jun 7, 2024
4fa521e
minor improvements
lukas-staab Jun 11, 2024
b472471
npm update
thsstll Jun 13, 2024
0cfe0f9
summary components
thsstll Jun 15, 2024
bcfc42f
antrag summary wireframe
thsstll Jun 15, 2024
3a7226c
composer update
lukas-staab Jun 25, 2024
2c5be92
Fix csv: reverses csv depending on the saved reverse config (default:…
lukas-staab Jun 25, 2024
79acb6c
CSV: a lot more testing
lukas-staab Jul 26, 2024
492255c
added logging baseline
lukas-staab Aug 1, 2024
ce890e7
added pint linter
lukas-staab Aug 1, 2024
032b09e
initial linting
lukas-staab Aug 1, 2024
c67f3eb
composer update
lukas-staab Aug 2, 2024
e7ca331
WIP db design
lukas-staab Aug 2, 2024
edb3c74
Merge branch 'refs/heads/v4.1.5' into external-project-wireframe
lukas-staab Aug 16, 2024
9ab13ad
Fixed DB Migrations
lukas-staab Aug 19, 2024
085cabf
Models done
lukas-staab Aug 21, 2024
6d3d8f0
Factories done
lukas-staab Aug 21, 2024
ac0d4c4
optimized imports
lukas-staab Aug 23, 2024
795e64c
factories done
lukas-staab Aug 26, 2024
eb86ba2
model tests done
lukas-staab Aug 26, 2024
cb316ee
antrag controller wip
thsstll Aug 21, 2024
3281d12
antrag controller, requests, forms wip
thsstll Aug 26, 2024
6097e5d
small changes to model
lukas-staab Aug 30, 2024
2758102
changed iban validation dependency
lukas-staab Aug 30, 2024
9a31e0e
WIP new antrag
lukas-staab Aug 30, 2024
d89156c
WIP new antrag
lukas-staab Sep 6, 2024
4f791ef
WIP with flux HHP create
lukas-staab Nov 9, 2024
584d7ee
reworked web routes
lukas-staab Jan 10, 2025
6df282a
Merge remote-tracking branch 'origin/main' into external-project-wire…
lukas-staab Jan 10, 2025
f6cadd9
Fixes coding style with laravel pint
lukas-staab Jan 10, 2025
50f5fb6
npm+composer update
lukas-staab Jan 10, 2025
7904c25
cleanup testing
lukas-staab Jan 10, 2025
adb9111
implemented generic OIDC Authentication
lukas-staab Jan 14, 2025
a534aca
Fixes coding style with laravel pint
lukas-staab Jan 14, 2025
020b9a7
made migration more failsafe
lukas-staab Jan 17, 2025
4917b8a
adds some default scopes
lukas-staab Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_CONNECTION=mariadb
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=upgrade_to_laravel
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/storage/*.key
/vendor
.env
.env.testing
.env.backup
.phpunit.result.cache
.phpstorm.meta.php
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/LegacyMigrateFilesToStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function handle()
$link = $fileInfo->link;
$beleg = ExpensesReceipt::find($link);
$expenses_id = $beleg?->auslagen_id;
$pdfData = $data->data;
$pdfData = $data?->data;
$hash = $fileInfo->hashname;
$path = "auslagen/$expenses_id/$hash.pdf";
if ($pdfData !== null) {
Expand Down
19 changes: 19 additions & 0 deletions app/Events/UpdatingModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Events\ShouldDispatchAfterCommit;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class UpdatingModel implements ShouldDispatchAfterCommit
{
use Dispatchable, InteractsWithSockets, SerializesModels;

/**
* Create a new event instance.
*/
public function __construct(public Model $model) {}
}
11 changes: 11 additions & 0 deletions app/Http/Controllers/AntragController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Http\Controllers;

class AntragController extends Controller
{
public function index(int $site = 1)
{
return view("antrag.$site");
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function login()

public function callback(Request $request): RedirectResponse
{
if (Auth::guest()) {
if (Auth::guest() && ! \App::runningUnitTests()) {
[$identifiers, $userAttributes] = $this->authService->userFromCallback($request);

$user = User::updateOrCreate($identifiers, $userAttributes);
Expand Down
5 changes: 3 additions & 2 deletions app/Http/Controllers/BudgetPlanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
namespace App\Http\Controllers;

use App\Models\BudgetPlan;
use App\Models\FiscalYear;

class BudgetPlanController extends Controller
{
public function index()
{
$plans = BudgetPlan::orderByDesc('start_date')->get();
$years = FiscalYear::orderByDesc('start_date')->get();

return view('budget-plan.index', ['plans' => $plans]);
return view('budget-plan.index', ['years' => $years]);
}

public function show(BudgetPlan $plan)
Expand Down
10 changes: 9 additions & 1 deletion app/Http/Controllers/Dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

namespace App\Http\Controllers;

use App\Services\Auth\AuthService;

class Dev extends Controller
{
public function groups()
{
$groupsRaw = \App::get(AuthService::class)->userGroupsRaw();
$groupMapping = \App::get(AuthService::class)->groupMapping();
$groups = \Auth::user()?->getGroups();

return view('components.dump', ['dump' => $groups]);
return view('components.dump', ['dump' => [
'groups-raw' => $groupsRaw,
'groupMapping' => $groupMapping,
'groups' => $groups,
]]);
}
}
3 changes: 2 additions & 1 deletion app/Http/Controllers/Legacy/LegacyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ public function render(Request $request)
$this->bootstrap();
require base_path('legacy/www/index.php');
$output = ob_get_clean();

// if wanted by the unit test the content is delivered without the layout
if ($request->input('testing')) {
// if wanted by the unit test the content is delivered without the layout
return $output;
}

Expand Down
2 changes: 0 additions & 2 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Http;

use App\Http\Middleware\LegacyMiddleware;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
Expand Down Expand Up @@ -63,7 +62,6 @@ class Kernel extends HttpKernel
*/
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'legacy' => LegacyMiddleware::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
Expand Down
19 changes: 15 additions & 4 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,28 @@

namespace App\Http\Middleware;

use Closure;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;

class Authenticate extends Middleware
{
public function handle($request, Closure $next, ...$guards)
{
$this->authenticate($request, $guards);

// adds to parent: only user with the login group can authenticate
if (! \Auth::user()?->getGroups()->contains('login')) {
$this->unauthenticated($request, $guards);
}

return $next($request);
}

/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
protected function redirectTo(Request $request): string
{
if (! $request->expectsJson()) {
return route('login');
Expand Down
25 changes: 0 additions & 25 deletions app/Http/Middleware/LegacyMiddleware.php

This file was deleted.

36 changes: 36 additions & 0 deletions app/Listeners/LogModelChange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Listeners;

use App\Events\UpdatingModel;
use App\Models\Changelog;

class LogModelChange
{
/**
* Create the event listener.
*/
public function __construct()
{
//
}

/**
* Handle the event.
*/
public function handle(UpdatingModel $modelChange): void
{
$model = $modelChange->model;
// $m->getChanges() is only populated after the save,
// so we have to collect the old values from the dirty keys
$changes = collect($model->getDirty())
->map(fn ($item, $key) => $model->getOriginal($key));

Changelog::create([
'type' => get_class($model),
'type_id' => $model->getKey(),
'previous_data' => $changes,
'user_id' => \Auth::user()->id,
]);
}
}
30 changes: 30 additions & 0 deletions app/Livewire/ArrayInput.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App\Livewire;

use Livewire\Component;

class ArrayInput extends Component
{
public array $values;

public $name;

public $label;

public function render(): \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\View|\Illuminate\View\View|\Illuminate\Contracts\Foundation\Application
{
return view('livewire.array-input');
}

public function addValue(): void
{
$this->values[] = '';
}

public function removeValue($index): void
{
unset($this->values[$index]);
$this->values = array_values($this->values);
}
}
31 changes: 31 additions & 0 deletions app/Livewire/Budgetplan/Create.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace App\Livewire\Budgetplan;

use App\Models\FiscalYear;
use Livewire\Attributes\Url;
use Livewire\Component;

class Create extends Component
{
#[Url(as: 'org')]
public $organization;

#[Url(as: 'year')]
public $fiscal_year_id;

public $resolution_date;

public $approval_date;

public $state;

public $budget_items;

public function render()
{
$fiscal_years = FiscalYear::all();

return view('livewire.budgetplan.create', ['fiscal_years' => $fiscal_years]);
}
}
25 changes: 25 additions & 0 deletions app/Livewire/Budgetplan/Item.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Livewire\Budgetplan;

use Livewire\Component;

class Item extends Component
{
public $short_name;

public $name;

public $value;

public $is_expense = true;

public $is_group = true;

public $level = 0;

public function render()
{
return view('livewire.budgetplan.item');
}
}
72 changes: 72 additions & 0 deletions app/Livewire/CreateAntrag.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace App\Livewire;

use App\Livewire\Forms\ActorForm;
use App\Livewire\Forms\FundingRequestForm;
use App\Livewire\Forms\ProjectBudgetForm;
use App\Livewire\Forms\ProjectForm;
use App\Models\Actor;
use Livewire\Attributes\Url;
use Livewire\Component;

class CreateAntrag extends Component
{
#[Url]
public int $page = 1;

public ActorForm $userForm;

public ActorForm $organisationForm;

public ProjectForm $projectForm;

public ProjectBudgetForm $projectBudgetForm;

public FundingRequestForm $fundingRequestForm;

public function store()
{
// TODO: call all form store methods
}

// pro Antragsschritt die Page variable hochzählen und damit Weiterleitung zum nächsten Schritt:
// Step 1: User / Actor
// Step 2: Projekt + Aufgabe der Studischaft
// Step 3: Finanzplan
// Step 4: Antrag
// Step 5: Anhänge

public function render()
{

// for better code analysis, and better error handling a bit more verbose than needed
switch ($this->page) {
case 1:
$users = Actor::user()->get();
$orgs = Actor::organisation()->get();

return view('livewire.create-antrag.1', ['users' => $users, 'orgs' => $orgs]);
case 2:
return view('livewire.create-antrag.2');
case 3:
return view('livewire.create-antrag.3');
case 4:
return view('livewire.create-antrag.4');
case 5:
return view('livewire.create-antrag.5');
default:
abort(404);
}
}

public function nextPage(): void
{
$this->page = min($this->page + 1, 5);
}

public function previousPage(): void
{
$this->page = max($this->page - 1, 1);
}
}
Loading
Loading