Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Oct 23, 2024
1 parent 734028a commit 38413b0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/js/components/Mappings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
<tbody>
<tr v-for="field in fields">
<td class="w-96">
<label class="text-base" :for="`mappings.${field.handle}.key`">
<label class="text-base font-medium" :for="`mappings.${field.handle}.key`">
{{ field.display }}
</label>
<span class="text-xs">{{ field.fieldtype_title }}</span>
</td>
<td class="flex flex-col">
<td>
<publish-container
:name="`mappings-${field.handle}`"
:values="mappings[field.handle]"
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/MappingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function __invoke(MappingsRequest $request)
'handle' => $field->handle(),
'display' => $field->display(),
'config' => $field->config(),
'fieldtype_title' => $field->fieldtype()->title(),
'fields' => $blueprint->fields()->toPublishArray(),
'meta' => $blueprint->fields()->meta(),
'values' => $blueprint->fields()
Expand Down
1 change: 1 addition & 0 deletions src/Transformers/AssetsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function fieldItems(): array
'type' => 'select',
'display' => __('Related Field'),
'instructions' => __('Which field does the data reference?'),
'default' => 'url',
'options' => [
['key' => 'path', 'value' => __('Path')],
['key' => 'url', 'value' => __('URL')],
Expand Down
2 changes: 2 additions & 0 deletions src/Transformers/BardTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ private function enableBardButtons(): void
'table',
'horizontalrule',
'codeblock',
'underline',
'superscript',
],
])
);
Expand Down
2 changes: 2 additions & 0 deletions src/Transformers/EntriesTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ public function fieldItems(): array
'type' => 'select',
'display' => __('Related Field'),
'instructions' => __('Which field does the data reference?'),
'default' => 'id',
'options' => $fields
->map(fn ($field) => ['key' => $field->handle(), 'value' => $field->display()])
->prepend(['key' => 'id', 'value' => __('ID')])
->values()
->all(),
],
Expand Down
2 changes: 2 additions & 0 deletions src/Transformers/TermsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public function fieldItems(): array
'type' => 'select',
'display' => __('Related Field'),
'instructions' => __('Which field does the data reference?'),
'default' => 'id',
'options' => $fields
->map(fn ($field) => ['key' => $field->handle(), 'value' => $field->display()])
->prepend(['key' => 'id', 'value' => __('ID')])
->values()
->all(),
],
Expand Down
2 changes: 2 additions & 0 deletions src/Transformers/UsersTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ public function fieldItems(): array
'type' => 'select',
'display' => __('Related Field'),
'instructions' => __('Which field does the data reference?'),
'default' => 'id',
'options' => User::blueprint()
->fields()
->all()
->map(fn ($field) => ['key' => $field->handle(), 'value' => $field->display()])
->prepend(['key' => 'id', 'value' => __('ID')])
->values()
->all(),
],
Expand Down

0 comments on commit 38413b0

Please sign in to comment.