Skip to content

Commit

Permalink
Merge pull request rrze-mmz#93 from rrze-mmz/92-cannot-update-video-w…
Browse files Browse the repository at this point in the history
…orkflow-settings

Fix update workflow settings bug
  • Loading branch information
stefanosgeo authored Apr 30, 2024
2 parents 06e921f + b984d37 commit 02d799d
Show file tree
Hide file tree
Showing 10 changed files with 494 additions and 495 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public function show(): Application|Factory|View
*/
public function update(UpdateVideoWorkflowSettings $request): RedirectResponse
{

$setting = Setting::opencast();

$setting->data = $request->validated();

$setting->save();

return to_route('settings.opencast.show');
return to_route('settings.workflow.show');
}
}
21 changes: 12 additions & 9 deletions app/Http/Requests/UpdateVideoWorkflowSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;

class UpdateVideoWorkflowSettings extends FormRequest
{
protected $stopOnFirstFailure = true;

/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
public function authorize(): bool
{
return auth()->user()->can('administrate-superadmin-portal-pages');
}
Expand All @@ -26,15 +27,17 @@ public function rules()
return [
'url' => ['required', 'url'],
'username' => ['required', 'string'],
'password' => ['required'],
'archive_path' => ['required'],
'password' => ['required', Password::min(6)],
'default_workflow_id' => ['required', 'string'],
'upload_workflow_id' => ['required', 'string'],
'theme_id_top_right' => ['required', 'numeric'],
'theme_id_top_left' => ['required', 'string'],
'theme_id_bottom_left' => ['required', 'string'],
'theme_id_bottom_right' => ['required', 'string'],
'assistant_group_name' => ['required', 'string'],
'theme_id_top_left' => ['required', 'numeric'],
'theme_id_bottom_left' => ['required', 'numeric'],
'theme_id_bottom_right' => ['required', 'numeric'],
'archive_path' => ['required', 'string'],
'assistants_group_name' => ['required', 'string'],
'opencast_purge_end_date' => ['required', 'date'],
'opencast_purge_events_per_minute' => ['required', 'numeric'],
];
}
}
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion config/settings.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Carbon\Carbon;

return [
'portal' => [
'maintenance_mode' => false,
Expand Down Expand Up @@ -28,13 +30,15 @@
'username' => 'admin',
'password' => 'opencast',
'archive_path' => 'archive/mh_default_org',
'default_workflow' => 'fast',
'default_workflow_id' => 'fast',
'upload_workflow_id' => 'fast',
'theme_id_top_right' => '500',
'theme_id_top_left' => '501',
'theme_id_bottom_left' => '502',
'theme_id_bottom_right' => '503',
'assistants_group_name' => 'ROLE_GROUP_TIDES_ASSISTANTS',
'opencast_purge_end_date' => Carbon::now(),
'opencast_purge_events_per_minute' => '20',
],
'streaming' => [
'wowza_vod_engine_url' => 'localhost:1935',
Expand Down
Loading

0 comments on commit 02d799d

Please sign in to comment.