Closed tabacitu closed 2 years ago
@pxpm heads-up, I've moved the bugs you found here. To fix that branch let's use:
crud-form-javascript-library
;@pxpm let's centralize our testing in this table, using this demo branch. Legend:
Field | onChange() |
hide() |
show() |
enable() |
disable() |
require() |
unrequire() |
Custom |
---|---|---|---|---|---|---|---|---|
checkbox | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ check() , ✅ uncheck() |
checklist | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
checklist_dependency | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
color | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
custom_html | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ |
date | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
datetime | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - | |
enum | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
hidden | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
month | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
number | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
password | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
radio | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
range | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select (1-n relationship) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select_grouped | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select_multiple (n-n relationship) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select_from_array | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
summernote | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
text | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
textarea | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
time | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
upload | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
upload_multiple | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
url | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
view | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ |
week | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
address_algolia PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
address_google PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
browse PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
browse_multiple PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
base64_image PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
ckeditor PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
color_picker PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
date_range PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
date_picker PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
datetime_picker PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
easymde PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
icon_picker PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
image PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
relationship PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
repeatable PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2 (1-n relationship) PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2_multiple (n-n relationship) PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2_nested PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2_grouped PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select_and_order PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2_from_array PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2_from_ajax PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
select2_from_ajax_multiple PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
table PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
tinymce PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
video PRO | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - |
wysiwyg PRO | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ | ⛔️ |
@tabacitu I've added some PR's that cover alot of scenarios but I didn't update the table, I think it's better that when you test the PR's and they work you do the table update as a "I confirmed it works".
Cheers
@tabacitu I've added some PR's that cover alot of scenarios but I didn't update the table, I think it's better that when you test the PR's and they work you do the table update as a "I confirmed it works".
Exactly. That's what I've been doing 😉 Great minds think alike 😅🙏
TODO:
backpack:field.change
on keyup
instead of focusout
- done in https://github.com/Laravel-Backpack/CRUD/pull/4400change()
parameters would probably be better as field, event
instead of event, value, name, type
; just easier to work with field.name
, field.value
etc - see PR https://github.com/Laravel-Backpack/CRUD/pull/4400enable(false)
but we can't do disable(false)
? that's what I tried - done in https://github.com/Laravel-Backpack/CRUD/pull/4425repeatable
let's not re-do the selectors we have in CrudField; instead, let's use the CrudField API;change()
event on initial load (form_fields_script.blade.php
line 31); done in https://github.com/Laravel-Backpack/CRUD/pull/4427CrudField
selector uses *=
, that needs to be replaced because if you have two fields with similar names (like name
and name_and_surname
we'll get into trouble; addressed in https://github.com/Laravel-Backpack/CRUD/pull/4435enableWhen()
, disableWhen()
etc.? Would that make the API more readable or intuitive?backpack:field.show
as backpack:field
with show
as argument, JS reads it as backpack:field.show
); maybe we use:
backpackField:show
bpField:show
(ugly)field:show
(prettiest, but could maybe conflict with other stuff?)CrudField:show
- 🏆@tabacitu from my last tests (with pending pr's merged) it's only missing:
IMPORTANT - single-source-of-truth branches we're using:
From now on
Let's do this!!! 💪🎉
I'm SUPER-happy to announce that I've just tested this the 3rd time and I'm happy with it, I think it's FINAL:
@pxpm said (Originally posted by @pxpm in https://github.com/Laravel-Backpack/CRUD/pull/4312#pullrequestreview-944434626)
I'm ok with this... I don't think we should do anything about this, it's just the way these work. Wouldn't you agree? I'd say WON'T DO.
Thanks, we COULD fix this.
Great catch! We MUST fix this.
🤷♂️ I'm ok with it... to be honest... I'd say WON'T DO.
COULD DO