Skip to content

Commit 26c2832

Browse files
committed
Merge remote-tracking branch 'origin/develop'
* origin/develop: Fix styling update composer version remove using for aceEditor Fix styling try fix morph map error Fix styling
2 parents 39fc9cd + 9187dd7 commit 26c2832

8 files changed

Lines changed: 50 additions & 218 deletions

File tree

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^8.2",
26-
"laravel/framework": "^11.0",
25+
"php": ">=8.2",
26+
"laravel/framework": "^11.0|^12.0",
2727
"filament/spatie-laravel-translatable-plugin": "^3.2",
2828
"guava/filament-icon-picker": "^2.0",
2929
"pboivin/filament-peek": "^2.0",
30-
"riodwanto/filament-ace-editor": "^1.0",
3130
"solution-forest/filament-field-group": "^1.0.10",
3231
"solution-forest/filament-tree": "^2.1.0",
3332
"solution-forest/inspirecms-support": "self.version",
@@ -37,10 +36,10 @@
3736
"require-dev": {
3837
"laravel/pint": "^1.0",
3938
"nunomaduro/collision": "^8.0",
40-
"orchestra/testbench": "^9.0",
41-
"pestphp/pest": "^2.0",
42-
"pestphp/pest-plugin-arch": "^2.0",
43-
"pestphp/pest-plugin-laravel": "^2.0",
39+
"orchestra/testbench": "^9.0|^10.0",
40+
"pestphp/pest": "^2.0|^3.0",
41+
"pestphp/pest-plugin-arch": "^2.0|^3.0",
42+
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
4443
"spatie/laravel-ray": "^1.26"
4544
},
4645
"autoload": {

resources/views/filament/infolists/entries/json-entry.blade.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Filament/Infolists/Components/JsonEntry.php

Lines changed: 0 additions & 151 deletions
This file was deleted.

src/Filament/Resources/ExportResource.php

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,43 @@ public static function infolist(Infolist $infolist): Infolist
118118
->label(__('inspirecms::resources/export.exporter.label'))
119119
->inlineLabel(),
120120

121-
\SolutionForest\InspireCms\Filament\Infolists\Components\JsonEntry::make('payload')
121+
Infolists\Components\TextEntry::make('process_message')
122122
->label(__('inspirecms::resources/export.message.label'))
123123
->columnSpanFull()
124-
->darkTheme('tomorrow_night_eighties')
124+
->size('xs')->color('gray')
125+
->extraAttributes([
126+
'class' => 'bg-gray-100 dark:bg-gray-800 rounded-md p-2 overflow-x-auto',
127+
])
125128
->getStateUsing(function ($record) {
126129
$payload = $record->payload;
130+
if (! is_array($payload)) {
131+
return '';
132+
}
133+
$arr = Arr::except($payload, ['result']);
127134

128-
return collect($payload)->except('result')->all();
135+
return str(json_encode($arr, JSON_PRETTY_PRINT))->wrap('<code>', '</code>')->wrap('<pre>', '</pre>')->toHtmlString();
129136
}),
130137

131-
\SolutionForest\InspireCms\Filament\Infolists\Components\JsonEntry::make('payload.result')
138+
Infolists\Components\TextEntry::make('result')
132139
->label(__('inspirecms::resources/export.result.label'))
133140
->columnSpanFull()
134-
->darkTheme('tomorrow_night_eighties'),
141+
->size('xs')->color('gray')
142+
->extraAttributes([
143+
'class' => 'bg-gray-100 dark:bg-gray-800 rounded-md p-2 overflow-x-auto',
144+
])
145+
->html()
146+
->getStateUsing(function ($record) {
147+
$payload = $record->payload;
148+
if (! is_array($payload)) {
149+
return '';
150+
}
151+
$arr = $payload['result'] ?? [];
152+
if (! is_array($arr)) {
153+
$arr = [$arr];
154+
}
155+
156+
return str(json_encode($arr, JSON_PRETTY_PRINT))->wrap('<code>', '</code>')->wrap('<pre>', '</pre>')->toHtmlString();
157+
}),
135158
]),
136159
]);
137160
}

src/Filament/Resources/Helpers/TemplateResourceHelper.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Filament\Forms;
66
use Filament\Support\Facades\FilamentIcon;
77
use Illuminate\Support\Str;
8-
use Riodwanto\FilamentAceEditor\AceEditor;
98
use SolutionForest\InspireCms\InspireCmsConfig;
109

1110
class TemplateResourceHelper
@@ -34,15 +33,11 @@ public static function getThemeFormComponent()
3433

3534
/**
3635
* @param string $name
37-
* @return Forms\Components\Field|Forms\Components\Component|AceEditor
36+
* @return Forms\Components\Field|Forms\Components\Component
3837
*/
3938
public static function getContentFormComponent($name = 'content')
4039
{
41-
return AceEditor::make($name)
42-
->label(__('inspirecms::resources/template.content.label'))
43-
->mode('php')
44-
->darkTheme('tomorrow_night_eighties')
45-
->height('48rem');
40+
return \Dotswan\FilamentCodeEditor\Fields\CodeEditor::make($name);
4641
}
4742

4843
/** @return Forms\Components\Field|Forms\Components\Component */

src/Filament/Resources/ImportResource.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,21 @@ public static function infolist(Infolist $infolist): Infolist
116116
))
117117
->copyable()->copyableState(fn ($record) => $record->author?->email),
118118

119-
\SolutionForest\InspireCms\Filament\Infolists\Components\JsonEntry::make('payload')
119+
Infolists\Components\TextEntry::make('payload')
120120
->label(__('inspirecms::resources/import.payload.label'))
121121
->columnSpanFull()
122-
->darkTheme('tomorrow_night_eighties'),
122+
->size('xs')->color('gray')
123+
->extraAttributes([
124+
'class' => 'bg-gray-100 dark:bg-gray-800 rounded-md p-2 overflow-x-auto',
125+
])
126+
->getStateUsing(function ($record) {
127+
$payload = $record->payload;
128+
if (! is_array($payload)) {
129+
return '';
130+
}
131+
132+
return str(json_encode($payload, JSON_PRETTY_PRINT))->wrap('<code>', '</code>')->wrap('<pre>', '</pre>')->toHtmlString();
133+
}),
123134
]);
124135
}
125136

src/Filament/Resources/TemplateResource/Pages/ListTemplates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function table(Table $table): Table
6161
})
6262
->form([
6363
TemplateResourceHelper::getThemeFormComponent()->disabled(),
64-
TemplateResourceHelper::getContentFormComponent(),
64+
TemplateResourceHelper::getContentFormComponent()->isReadOnly(true),
6565
])
6666
->mutateRecordDataUsing(fn (Template $record) => [
6767
'theme' => $this->theme,

src/InspireCmsServiceProvider.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Filament\Support\Facades\FilamentAsset;
1010
use Filament\Support\Facades\FilamentIcon;
1111
use Illuminate\Auth\Events as AuthEvents;
12-
use Illuminate\Database\Eloquent\Relations\Relation;
1312
use Illuminate\Filesystem\Filesystem;
1413
use Illuminate\Foundation\Console\AboutCommand;
1514
use Illuminate\Support\Arr;
@@ -102,8 +101,6 @@ public function registeringPackage(): void
102101

103102
public function packageRegistered(): void
104103
{
105-
$this->registerPolymorphism();
106-
107104
$this->app->singleton(BaseManifests\ModelManifestInterface::class, fn () => $this->app->make(BaseManifests\ModelManifest::class));
108105
$this->app->singleton(BaseManifests\ContentStatusManifestInterface::class, fn () => $this->app->make(BaseManifests\ContentStatusManifest::class));
109106
$this->app->singleton(BaseManifests\PermissionManifestInterface::class, fn () => $this->app->make(BaseManifests\PermissionManifest::class));
@@ -299,18 +296,6 @@ protected function getMigrations(): array
299296
];
300297
}
301298

302-
/**
303-
* Register Polymorphic Types
304-
*/
305-
protected function registerPolymorphism(): void
306-
{
307-
$map = Arr::pluck(InspireCmsConfig::get('models'), 'fqcn', 'polymorphic_type');
308-
309-
if (! empty($map)) {
310-
Relation::enforceMorphMap($map);
311-
}
312-
}
313-
314299
protected function registerModels(): void
315300
{
316301
Facades\ModelManifest::register();

0 commit comments

Comments
 (0)