-
Notifications
You must be signed in to change notification settings - Fork 28
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
datagridfield pattern #106
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thet
force-pushed
the
thet-fixes
branch
2 times, most recently
from
March 3, 2021 10:52
3bd0467
to
9f98380
Compare
Remove non-unique id attributes from UI buttons and add classes instead. Let the button functionality be initialized by the pattern. Breaking change: In this version a pattern handles all the JavaScript functionality to ensure best possible encapsulation between different instances of the datagridfield widget. If you have customized templates, make sure you do the following: - Add the class ``pat-datagridfield`` to the ``datagridwidget-table-view`` nodes (files: datagridfield_input.pt, datagridfield_input_block.pt). - Add the following classes instead of ids to the ui buttons as shown in this map (files: datagridfieldobject_input.pt, datagridfieldobject_input_block.pt_): - #btn-addrow -> .dgf--row-add - #btn-deleterow -> .dgf--row-delete - #btn-moveup -> .dgf--row-moveup - #btn-movedown -> .dgf--row-movedown
thet
force-pushed
the
thet-fixes
branch
5 times, most recently
from
March 3, 2021 14:29
3e02bd8
to
86c2408
Compare
Change row UI elements from anchor to buttons for better semantics. Fix Boostrap classes, remove unused attributes, add a title to buttons.
thet
force-pushed
the
thet-fixes
branch
3 times, most recently
from
March 4, 2021 11:07
38c85a1
to
607102b
Compare
- Factor out countRows function for reuse. - Bring count field into reach of pattern.
This was referenced Mar 8, 2021
Closed
jensens
approved these changes
Mar 15, 2021
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.
Looks good to me, I would release a beta of 2.0 first and let more people use it in the wild.
For Plone 6 this would need other classes applied to the HTML, right?
Breaking change: The JavaScript resources have changed a lot. Please run the provided upgrade steps! If you were customizing templates which loaded these JavaScript resources or customized the JavaScript functionality itself, take special care. The bundle is loaded only for logged-in users.
@jensens tnx for the review! will merge. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To improve the current unstable javascript situation this PR rebuilds the JS functionality within a pattern.
This provides a defined scope to operate on and should give automatic initialization within modals, mosaic and so on.
..Upgrade notice::
In this version a pattern handles all the JavaScript functionality to ensure best possible encapsulation between different instances of the datagridfield widget.
If you have customized templates, make sure you do the following:
Add the class
pat-datagridfield
to thedatagridwidget-table-view
nodes (files: datagridfield_input.pt, datagridfield_input_block.pt).Add the following classes instead of ids to the ui buttons as shown in this map (files: datagridfieldobject_input.pt, datagridfieldobject_input_block.pt_):
Clean up upgrade profile definitions and align to Plone standards.
Remove non-unique id attributes from UI buttons and add classes instead.
Let the button functionality be initialized by the pattern.
Remove
extra
parameter for datagridfield widget as it was unused and untested.Use pat-datagridfield in templates.
Rework JavaScript as a Pattern for better initialization.
This targets Plone 5.1 and Plone 5.2, as master does.
A quick screenshot with some rows and enabled/disabled buttons. The last row have all buttons disabled as this is a auto-append row - it will automatically add another row if a input-focusout event happens in one of the auto append row fields. Here the buttons do not make any sense.