Skip to content

Commit 5eacd38

Browse files
committed
remove unnecessary conditional logic schema
1 parent a99c605 commit 5eacd38

File tree

4 files changed

+11
-67
lines changed

4 files changed

+11
-67
lines changed

src/Fields/Base.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Backstage\Fields\Contracts\FieldContract;
66
use Backstage\Fields\Fields\FormSchemas\BasicSettingsSchema;
7-
use Backstage\Fields\Fields\FormSchemas\ConditionalLogicSchema;
87
use Backstage\Fields\Fields\FormSchemas\ValidationRulesSchema;
98
use Backstage\Fields\Fields\FormSchemas\VisibilityRulesSchema;
109
use Backstage\Fields\Fields\Logic\ConditionalLogicApplier;
@@ -26,7 +25,6 @@ public function getRulesForm(): array
2625
return [
2726
Forms\Components\Grid::make(2)
2827
->schema([
29-
...ConditionalLogicSchema::make(),
3028
...ValidationRulesSchema::make(),
3129
...VisibilityRulesSchema::make(),
3230
]),

src/Fields/FormSchemas/ConditionalLogicSchema.php

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

src/Fields/FormSchemas/ValidationRulesSchema.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ class ValidationRulesSchema
1010
public static function make(): array
1111
{
1212
return [
13-
Forms\Components\Fieldset::make('Validation rules')
13+
Forms\Components\Section::make('Validation rules')
14+
->collapsible()
15+
->collapsed(false)
16+
->compact(true)
17+
->description(__('Validate the value of this field based on the rules below'))
1418
->schema([
1519
Forms\Components\Repeater::make('config.validationRules')
1620
->hiddenLabel()

src/Fields/FormSchemas/VisibilityRulesSchema.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ class VisibilityRulesSchema
1010
public static function make(): array
1111
{
1212
return [
13-
Forms\Components\Fieldset::make('Visibility rules')
13+
Forms\Components\Section::make('Visibility rules')
14+
->collapsible()
15+
->collapsed(false)
16+
->compact(true)
17+
->description(__('Show or hide this field based on the value of another field'))
1418
->schema([
1519
Forms\Components\Repeater::make('config.visibilityRules')
1620
->hiddenLabel()
@@ -44,6 +48,7 @@ public static function make(): array
4448
->required(),
4549
Forms\Components\Select::make('operator')
4650
->label(__('Condition'))
51+
->live()
4752
->options([
4853
'equals' => __('Equals'),
4954
'not_equals' => __('Does not equal'),

0 commit comments

Comments
 (0)