mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 15:37:53 +00:00
fix: playlist default weeksdays null (= all), create form appears when new selected
This commit is contained in:
parent
4c8cdf992c
commit
8a5a813540
2 changed files with 7 additions and 7 deletions
|
|
@ -17,7 +17,7 @@ new class extends Component {
|
||||||
// Playlist properties
|
// Playlist properties
|
||||||
public $playlists;
|
public $playlists;
|
||||||
public $playlist_name;
|
public $playlist_name;
|
||||||
public $selected_weekdays = [];
|
public $selected_weekdays = null;
|
||||||
public $active_from;
|
public $active_from;
|
||||||
public $active_until;
|
public $active_until;
|
||||||
|
|
||||||
|
|
@ -74,7 +74,7 @@ new class extends Component {
|
||||||
{
|
{
|
||||||
$this->validate([
|
$this->validate([
|
||||||
'playlist_name' => 'required|string|max:255',
|
'playlist_name' => 'required|string|max:255',
|
||||||
'selected_weekdays' => 'array',
|
'selected_weekdays' => 'nullable|array',
|
||||||
'active_from' => 'nullable|date_format:H:i',
|
'active_from' => 'nullable|date_format:H:i',
|
||||||
'active_until' => 'nullable|date_format:H:i',
|
'active_until' => 'nullable|date_format:H:i',
|
||||||
]);
|
]);
|
||||||
|
|
@ -226,10 +226,10 @@ new class extends Component {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<flux:modal.trigger name="edit-device">
|
<flux:modal.trigger name="edit-device">
|
||||||
<flux:button icon="pencil-square" variant="subtle"/>
|
<flux:button icon="pencil-square" />
|
||||||
</flux:modal.trigger>
|
</flux:modal.trigger>
|
||||||
<flux:modal.trigger name="delete-device">
|
<flux:modal.trigger name="delete-device">
|
||||||
<flux:button icon="trash" variant="danger"/>
|
<flux:button icon="trash" variant="subtle"/>
|
||||||
</flux:modal.trigger>
|
</flux:modal.trigger>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ new class extends Component {
|
||||||
public $data_payload;
|
public $data_payload;
|
||||||
public array $checked_devices = [];
|
public array $checked_devices = [];
|
||||||
public string $playlist_name = '';
|
public string $playlist_name = '';
|
||||||
public array $selected_weekdays = [];
|
public array|null $selected_weekdays = null;
|
||||||
public string $active_from = '';
|
public string $active_from = '';
|
||||||
public string $active_until = '';
|
public string $active_until = '';
|
||||||
public string $selected_playlist = '';
|
public string $selected_playlist = '';
|
||||||
|
|
@ -67,7 +67,7 @@ new class extends Component {
|
||||||
'blade_code' => 'nullable|string',
|
'blade_code' => 'nullable|string',
|
||||||
'checked_devices' => 'array',
|
'checked_devices' => 'array',
|
||||||
'playlist_name' => 'required_if:selected_playlist,new|string|max:255',
|
'playlist_name' => 'required_if:selected_playlist,new|string|max:255',
|
||||||
'selected_weekdays' => 'array',
|
'selected_weekdays' => 'nullable|array',
|
||||||
'active_from' => 'nullable|date_format:H:i',
|
'active_from' => 'nullable|date_format:H:i',
|
||||||
'active_until' => 'nullable|date_format:H:i',
|
'active_until' => 'nullable|date_format:H:i',
|
||||||
'selected_playlist' => 'nullable|string',
|
'selected_playlist' => 'nullable|string',
|
||||||
|
|
@ -202,7 +202,7 @@ HTML;
|
||||||
|
|
||||||
@if(count($checked_devices) === 1)
|
@if(count($checked_devices) === 1)
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<flux:radio.group wire:model="selected_playlist" label="Select Playlist"
|
<flux:radio.group wire:model.live.debounce="selected_playlist" label="Select Playlist"
|
||||||
variant="segmented">
|
variant="segmented">
|
||||||
<flux:radio value="new" label="Create New"/>
|
<flux:radio value="new" label="Create New"/>
|
||||||
@foreach($this->getDevicePlaylists($checked_devices[0]) as $playlist)
|
@foreach($this->getDevicePlaylists($checked_devices[0]) as $playlist)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue