Skip to content

Commit 05f2725

Browse files
Merge pull request #23 from zhinea/revert-22-main
Revert "feat(custom tabs): add Rich Editor & Markdown Editor support"
2 parents 181143b + a74813c commit 05f2725

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

src/Enums/TypeFieldEnum.php

-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ enum TypeFieldEnum: string
1313
case Select = 'select';
1414
case Textarea = 'textarea';
1515
case Datetime = 'datetime';
16-
case RichEditor = 'rich_editor';
17-
case MarkdownEditor = 'markdown_editor';
1816
}

src/Forms/CustomForms.php

-11
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use Filament\Forms\Components\Checkbox;
66
use Filament\Forms\Components\DateTimePicker;
7-
use Filament\Forms\Components\MarkdownEditor;
8-
use Filament\Forms\Components\RichEditor;
97
use Filament\Forms\Components\Select;
108
use Filament\Forms\Components\Textarea;
119
use Filament\Forms\Components\TextInput;
@@ -52,16 +50,7 @@ public static function get(array $customFields): array
5250
->label(__($field['label']))
5351
->placeholder(__($field['placeholder']))
5452
->seconds($field['seconds']);
55-
} elseif ($field['type'] === TypeFieldEnum::RichEditor->value) {
56-
$fields[] = RichEditor::make($fieldKey)
57-
->label(__($field['label']))
58-
->toolbarButtons($field['toolbarButtons'] ?? []);
59-
} elseif ($field['type'] === TypeFieldEnum::MarkdownEditor->value) {
60-
$fields[] = MarkdownEditor::make($fieldKey)
61-
->label(__($field['label']))
62-
->toolbarButtons($field['toolbarButtons'] ?? []);
6353
}
64-
6554
}
6655

6756
return $fields;

src/Pages/GeneralSettingsPage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function form(Form $form): Form
147147
$arrTabs[] = Tabs\Tab::make($customTab['label'])
148148
->label(__($customTab['label']))
149149
->icon($customTab['icon'])
150-
->schema($customTab['fields'])
150+
->schema(CustomForms::get($customTab['fields']))
151151
->columns($customTab['columns'])
152152
->statePath('more_configs');
153153
}

0 commit comments

Comments
 (0)