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 9e49caf commit 734028a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions resources/js/components/EditImportForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,17 @@ export default {
errors: {},
saving: false,
config: this.initialConfig,
quickSaveKeyBinding: null,
}
},
mounted() {
this.quickSaveKeyBinding = this.$keys.bindGlobal(['mod+s'], e => {
e.preventDefault();
this.save();
});
},
methods: {
clearErrors() {
this.error = null;
Expand Down
10 changes: 6 additions & 4 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class="mb-10"
:initial-values='@json($values)'
></create-import-form>

<div>
<h2 class="mb-2">{{ __('Recent Imports') }}</h2>
<imports-listing :initial-rows='@json($imports)'></imports-listing>
</div>
@if($imports->isNotEmpty())
<div>
<h2 class="mb-2">{{ __('Recent Imports') }}</h2>
<imports-listing :initial-rows='@json($imports)'></imports-listing>
</div>
@endif
@stop
3 changes: 2 additions & 1 deletion src/Http/Controllers/MappingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Statamic\Importer\Importer;
use Statamic\Importer\Sources\Csv;
use Statamic\Importer\Sources\Xml;
use Statamic\Support\Str;

class MappingsController extends CpController
{
Expand Down Expand Up @@ -42,7 +43,7 @@ public function __invoke(MappingsRequest $request)
'hide_display' => true,
'options' => collect($row)->map(fn ($value, $key) => [
'key' => $key,
'value' => "<{$key}>: {$value}",
'value' => "<{$key}>: " . Str::truncate($value, 200),
])->values(),
'clearable' => true,
],
Expand Down
1 change: 1 addition & 0 deletions src/Transformers/UsersTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function fieldItems(): array
'display' => __('Create user when missing?'),
'instructions' => __("Create the user if it doesn't exist."),
'default' => false,
'unless' => ['related_field' => 'name'],
],
];
}
Expand Down

0 comments on commit 734028a

Please sign in to comment.