Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 2 deletions src/Components/Forms/Actions/CreatePageBuilderBlockAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ protected function setUp(): void
$block->toArray(),
]);

$this->sendSuccessNotification();

$component->callAfterStateUpdated();

$this->success();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected function setUp(): void

$component->callAfterStateUpdated();

$action->sendSuccessNotification();
$this->success();
});
}
}
7 changes: 6 additions & 1 deletion src/Components/Forms/PageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Redberry\PageBuilderPlugin\Components\Forms;

use Carbon\Carbon;
use Closure;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Field;
Expand Down Expand Up @@ -341,16 +342,20 @@ public function relationship(
$query->clone()->whereIn('id', $recordsNeedingDeletion)->delete();

$record->{$this->relationship}()->upsert(array_map(function ($item) {
$item['updated_at'] = now()->format('Y-m-d H:i:s');
$item['created_at'] = (new Carbon($item['created_at'] ?? null))->format('Y-m-d H:i:s');

return [
...$item,
'data' => json_encode($item['data'] ?? []),
];
}, $state), uniqueBy: ['id'], update: ['data', 'order']);
}, $state), uniqueBy: ['id'], update: ['data', 'order', 'updated_at']);

DB::commit();

} catch (\Throwable $th) {
DB::rollBack();

Notification::make()
->title('failed saving page builder blocks')
->body($th->getMessage())
Expand Down
2 changes: 1 addition & 1 deletion stubs/block.view.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class {{ class }} extends BaseBlock

public static function getView(): ?string
{
return '{{ panelId }}blocks.{{ viewName }}';
return '{{ panelId }}.blocks.{{ viewName }}';
}
}
2 changes: 1 addition & 1 deletion tests/ArchTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

it('will not use debugging functions')
->expect(['dd', 'dump', 'ray'])
->expect(['dd', 'dump', 'ray', 'info'])
->each->not->toBeUsed();

it('ensures `env` is only used in config files')
Expand Down