-
Notifications
You must be signed in to change notification settings - Fork 920
DataFormModal component #5863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
DataFormModal component #5863
Conversation
[ci skip] [skip ci]
[ci skip] [skip ci]
[ci skip] [skip ci]
…into modal-form # Conflicts: # src/CrudPanelManager.php
[ci skip] [skip ci]
src/resources/views/crud/components/dataform/modal-form.blade.php
Outdated
Show resolved
Hide resolved
|
||
@stack('after_styles') | ||
|
||
<script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move these to a global js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing on Github
[ci skip] [skip ci]
$controller->initializeCrudPanel($primaryControllerRequest, $crud); | ||
|
||
// If the panel isn't initialized at all, do full initialization | ||
if (! $crud->isInitialized()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something here smells a bit - maybe we can return early or smth
src/resources/views/crud/components/dataform/modal-form.blade.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick cleanup pls - indentation etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test the field stacks - try to push some widgets to before_content
and after_content
public function __construct( | ||
public string $controller, | ||
public string $id = 'backpack-form', | ||
public string $operation = 'create', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure we can also call a custom form operation. (not urgent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public string $operation = 'create', | |
public string $formOperation = 'create', |
public string $controller, | ||
public string $id = 'backpack-form', | ||
public string $operation = 'create', | ||
public string $name = '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public string $name = '', |
[ci skip] [skip ci]
…into modal-form
[ci skip] [skip ci]
data-has-upload-fields="{{ $hasUploadFields ? 'true' : 'false' }}" | ||
data-refresh-datatable="{{ $refreshDatatable ? 'true' : 'false' }}" | ||
> | ||
<div class="text-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an elegant way for us to tell the form
blade file to NOT use the card
and card-body
classes? Both the Dataform and DataformModal would benefit from this tiny change:
[ci skip] [skip ci]
[ci skip] [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's another round of testing. I discovered:
- quite a few fields don't work
select2s
,browse
- edit modal doesn't load the entry
- after an entry is created with DataFormModal, sometimes the datatable refreshes, sometimes it doesn't
Here's a 5-min tour of my experience:
https://www.loom.com/share/6bffaa54f65e4c7f8b4188e064ca0bb7
In development, this introduces a form in a modal 🙏