Skip to content

Commit 057fa7a

Browse files
committed
Temporarily disable repeater
1 parent fca30b4 commit 057fa7a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Concerns/HasFieldsMapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait HasFieldsMapper
3030
'text' => Text::class,
3131
'textarea' => Textarea::class,
3232
'rich-editor' => RichEditor::class,
33-
'repeater' => Repeater::class,
33+
// 'repeater' => Repeater::class, WIP
3434
// 'select' => Select::class, WIP
3535
'checkbox' => Checkbox::class,
3636
// 'checkbox-list' => CheckboxList::class, WIP
@@ -106,7 +106,7 @@ private function resolveFormFields(): array
106106
$customFields = $this->resolveCustomFields();
107107

108108
return $this->record->fields
109-
->map(fn ($field) => $this->resolveFieldInput($field, $customFields))
109+
->map(fn($field) => $this->resolveFieldInput($field, $customFields))
110110
->filter()
111111
->values()
112112
->all();
@@ -115,7 +115,7 @@ private function resolveFormFields(): array
115115
private function resolveCustomFields(): Collection
116116
{
117117
return collect(Fields::getFields())
118-
->map(fn ($fieldClass) => new $fieldClass);
118+
->map(fn($fieldClass) => new $fieldClass);
119119
}
120120

121121
private function resolveFieldInput(Model $field, Collection $customFields): ?object
@@ -134,4 +134,4 @@ private function resolveFieldInput(Model $field, Collection $customFields): ?obj
134134

135135
return null;
136136
}
137-
}
137+
}

src/Fields/Repeater.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ public function getForm(): array
109109
Forms\Components\Toggle::make('config.reorderableWithButtons')
110110
->label(__('Reorderable with buttons'))
111111
->dehydrated()
112-
->disabled(fn (Forms\Get $get): bool => $get('config.reorderable') === false)
112+
->disabled(fn(Forms\Get $get): bool => $get('config.reorderable') === false)
113113
->inline(false),
114114
]),
115115
Forms\Components\Toggle::make('config.collapsible')
116116
->label(__('Collapsible'))
117117
->inline(false),
118118
Forms\Components\Toggle::make('config.collapsed')
119119
->label(__('Collapsed'))
120-
->visible(fn (Forms\Get $get): bool => $get('config.collapsible') === true)
120+
->visible(fn(Forms\Get $get): bool => $get('config.collapsible') === true)
121121
->inline(false),
122122
Forms\Components\Toggle::make('config.cloneable')
123123
->label(__('Cloneable'))
@@ -132,9 +132,9 @@ public function getForm(): array
132132
->live(debounce: 250)
133133
->labelKey('name')
134134
->maxDepth(0)
135-
->addable(fn (string $operation) => $operation !== 'create')
136-
->disabled(fn (string $operation) => $operation === 'create')
137-
->hint(fn (string $operation) => $operation === 'create' ? __('Fields can be added once the field is created.') : '')
135+
->addable(fn(string $operation) => $operation !== 'create')
136+
->disabled(fn(string $operation) => $operation === 'create')
137+
->hint(fn(string $operation) => $operation === 'create' ? __('Fields can be added once the field is created.') : '')
138138
->hintColor('primary')
139139
->form([
140140
Section::make('Field')
@@ -149,7 +149,7 @@ public function getForm(): array
149149
->required()
150150
->placeholder(__('Name'))
151151
->live(debounce: 250)
152-
->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state))),
152+
->afterStateUpdated(fn(Set $set, ?string $state) => $set('slug', Str::slug($state))),
153153
TextInput::make('slug')
154154
->readonly(),
155155
Select::make('field_type')
@@ -162,7 +162,7 @@ public function getForm(): array
162162
function () {
163163
$options = array_merge(
164164
EnumsField::array(),
165-
$this->prepareCustomFieldOptions(Backstage::getFields())
165+
$this->prepareCustomFieldOptions(Fields::getFields())
166166
);
167167

168168
asort($options);
@@ -179,10 +179,10 @@ function () {
179179
])->columnSpanFull(),
180180
Section::make('Configuration')
181181
->columns(3)
182-
->schema(fn (Get $get) => $this->getFieldTypeFormSchema(
182+
->schema(fn(Get $get) => $this->getFieldTypeFormSchema(
183183
$get('field_type')
184184
))
185-
->visible(fn (Get $get) => filled($get('field_type'))),
185+
->visible(fn(Get $get) => filled($get('field_type'))),
186186
]),
187187
])->columns(2),
188188
])->columnSpanFull(),
@@ -209,4 +209,4 @@ private static function generateSchemaFromChildren(Collection $children): array
209209

210210
return $schema;
211211
}
212-
}
212+
}

0 commit comments

Comments
 (0)