protonemedia / laravel-splade

💫 The magic of Inertia.js with the simplicity of Blade 💫 - Splade provides a super easy way to build Single Page Applications (SPA) using standard Laravel Blade templates, and sparkle it to make it interactive. All without ever leaving Blade.
https://splade.dev
MIT License
1.47k stars 111 forks source link

Enhancement Request: Dynamic Form Inputs for User Interactions in Bulk Actions #640

Open Adel-Kazem opened 5 months ago

Adel-Kazem commented 5 months ago

challenge description: I have allowed the users to translate the records inside Datatable (using bulk action) but the issue is that I can't allow the users to select which language they want to translate (options should be predefined). I have done a workaround solution but it doesn't seems or feel good it adds some step of complexity especially for the user experience. I've to force the user to submit the languages in advance but it doesn't seem good for the user experience..

code details: foreach ($this->userSelectedLanguages as $languageCode) { $languageName = config("languages.languages.$languageCode") ?? strtoupper($languageCode); $table->bulkAction( label: "Create {$languageName} Translations for Reviews", before: function (array $selectedIds) use ($languageCode) { $this->createNewReviewTranslationForSelectedReviews($selectedIds, $languageCode); }, confirm: "Create {$languageName} translations for reviews", confirmText: "Are you sure you want to create {$languageName} translations for the selected reviews?", confirmButton: "Yes, create {$languageName} translations!", cancelButton: "No, do not create!", extraParameters: $this->productId ); }

This process diminishes the overall user experience by enforcing unnecessary preparatory steps. Constraining users to a static set of options and thereby complicating what could be a more intuitive and responsive workflow.

This is the only missing piece inside this package and I really hope that it can be resolved.

With my all love & support for this beautiful & creative package.