Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions resources/js/bootstrap/fieldtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Vue.component('textarea-fieldtype', require('../components/fieldtypes/TextareaFi
Vue.component('slug-fieldtype', require('../components/fieldtypes/SlugFieldtype.vue').default);

// Fieldtypes
import FieldsetFieldtype from '../components/fieldtypes/FieldsetFieldtype.vue'
import RevealerFieldtype from '../components/fieldtypes/RevealerFieldtype.vue'
import StatusFieldtype from '../components/fieldtypes/StatusFieldtype.vue'
import TemplateFieldtype from '../components/fieldtypes/TemplateFieldtype.vue'
Expand All @@ -28,7 +27,6 @@ Vue.component('code-fieldtype', require('../components/fieldtypes/CodeFieldtype.
Vue.component('collection_routes-fieldtype', require('../components/collections/Routes.vue').default);
Vue.component('color-fieldtype', require('../components/fieldtypes/ColorFieldtype.vue').default);
Vue.component('date-fieldtype', require('../components/fieldtypes/DateFieldtype.vue').default);
Vue.component('fieldset-fieldtype', FieldsetFieldtype);
Vue.component('fields-fieldtype', require('../components/fieldtypes/grid/FieldsFieldtype.vue').default);
Vue.component('float-fieldtype', require('../components/fieldtypes/FloatFieldtype.vue').default);
Vue.component('global_set_sites-fieldtype', require('../components/globals/Sites.vue').default);
Expand Down
130 changes: 0 additions & 130 deletions resources/js/components/fieldtypes/FieldsetFieldtype.vue

This file was deleted.

2 changes: 0 additions & 2 deletions routes/cp.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@
Route::post('update', 'FieldsController@update')->name('fields.update');
Route::get('field-meta', 'MetaController@show');
Route::resource('fieldsets', 'FieldsetController');
Route::post('fieldsets/quick', 'FieldsetController@quickStore');
Route::post('fieldsets/{fieldset}/fields', 'FieldsetFieldController@store');
Route::get('blueprints', 'BlueprintController@index')->name('blueprints.index');
Route::get('fieldtypes', 'FieldtypesController@index');
});
Expand Down
3 changes: 3 additions & 0 deletions src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ public function toPublishArray()
]);
}

/**
* @deprecated
*/
public function toBlueprintArray()
{
return [
Expand Down
8 changes: 5 additions & 3 deletions src/Fields/FieldTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static function referenceFieldToVue($field): array
'field_reference' => $field['field'],
'config' => $mergedConfig,
'config_overrides' => array_keys($config),
'fieldtype' => $type = $fieldsetField['type'],
'fieldtype' => $type = $mergedConfig['type'],
'icon' => FieldtypeRepository::find($type)->icon(),
];
}
Expand Down Expand Up @@ -119,12 +119,14 @@ public static function fieldsetFields()

$fields = Fieldset::all()->flatMap(function ($fieldset) {
return collect($fieldset->fields()->all())->mapWithKeys(function ($field, $handle) use ($fieldset) {
return [$fieldset->handle().'.'.$field->handle() => array_merge($field->toBlueprintArray(), [
return [$fieldset->handle().'.'.$field->handle() => [
'display' => $field->display(),
'config' => $field->config(),
'fieldset' => [
'handle' => $fieldset->handle(),
'title' => $fieldset->title(),
],
])];
]];
});
})->sortBy('display')->all();

Expand Down
21 changes: 0 additions & 21 deletions src/Http/Controllers/CP/Fields/FieldsetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,4 @@ public function destroy($fieldset)

return response('');
}

/**
* Quickly create a new barebones fieldset from within the fieldtype.
*
* @return array
*/
public function quickStore(Request $request)
{
$title = $request->title;

if (Facades\Fieldset::exists($handle = snake_case($title))) {
return ['success' => true];
}

$fieldset = (new Fieldset)->setHandle($handle)->setContents([
'title' => $request->title,
'fields' => [],
])->save();

return ['success' => true];
}
}
34 changes: 0 additions & 34 deletions src/Http/Controllers/CP/Fields/FieldsetFieldController.php

This file was deleted.

9 changes: 1 addition & 8 deletions tests/Fieldtypes/NestedFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,7 @@ public function it_preprocesses_from_blueprint_format_to_vue()
'type' => 'reference',
'field_reference' => 'test.bar',
'config' => [
'placeholder' => null,
'input_type' => 'text',
'character_limit' => 0,
'prepend' => null,
'append' => null,
'antlers' => false,
'default' => null,
'component' => 'text',
'type' => 'text',
'width' => 50,
'display' => 'Second Field',
'localizable' => false,
Expand Down