Skip to content

Commit

Permalink
Revert pull update
Browse files Browse the repository at this point in the history
  • Loading branch information
cannycookie committed Aug 25, 2024
1 parent fb564c3 commit b3c2e43
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/Resources/EmailTemplateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function getCluster(): string
return config('filament-email-templates.navigation.templates.cluster');
}

public static function getSubNavigationPosition(): SubNavigationPosition
public static function getSubNavigationPosition()
{
return config('filament-email-templates.navigation.templates.position');
}
Expand All @@ -71,8 +71,6 @@ public static function form(Form $form): Form

$formHelper = app(FormHelperInterface::class);
$templates = $formHelper->getTemplateViewOptions();
$recipients = $formHelper->getRecipientOptions();


return $form->schema(
[
Expand All @@ -93,32 +91,25 @@ public static function form(Form $form): Form
Grid::make(['default' => 1, 'sm' => 1, 'md' => 2])
->schema(
[
Select::make('key')
TextInput::make('key')
->afterStateUpdated(
fn(Set $set, ?string $state) => $set('key', Str::slug($state))
fn (Set $set, ?string $state) => $set('key', Str::slug($state))
)
->options(function () {
$options = [];
foreach (config('filament-email-templates.template_keys') as $key => $value) {
$options[$key] = __($value);
}
return $options;
})
->label(__('vb-email-templates::email-templates.form-fields-labels.key'))
->hint(__('vb-email-templates::email-templates.form-fields-labels.key-hint'))
->required()
->unique(ignorable: fn($record) => $record),
->unique(ignorable: fn ($record) => $record),
Select::make('language')
->options($formHelper->getLanguageOptions())
->default(config('filament-email-templates.default_locale'))
->searchable()
->allowHtml(),
TextInput::make('from.email')->default(config('mail.from.address'))
->label(__('vb-email-templates::email-templates.form-fields-labels.email-from'))
->email(),
->label(__('vb-email-templates::email-templates.form-fields-labels.email-from'))
->email(),
TextInput::make('from.name')->default(config('mail.from.name'))
->label(__('vb-email-templates::email-templates.form-fields-labels.email-from-name'))
->string(),
->label(__('vb-email-templates::email-templates.form-fields-labels.email-from-name'))
->string(),

Select::make('view')
->label(__('vb-email-templates::email-templates.form-fields-labels.template-view'))
Expand Down

0 comments on commit b3c2e43

Please sign in to comment.