Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Mar 2017 at 09:14 UTC
Updated:
20 Jun 2017 at 13:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
erik seifert commentedComment #3
erik seifert commentedComment #4
erik seifert commentedAdd new validation for DefaultSelection
Comment #5
erik seifert commentedRemove notices.
Comment #6
johnchqueNot sure what you want to do exactly, but did you try with disabling all, as the help text says, "All disabled is all enabled".
Comment #7
erik seifert commentedNo, i want to exclude some types and allow the remaining..
Comment #8
erik seifert commentedComment #9
ginovski commentedMaybe "Choose allowed paragraph types" or "Choose paragraph types" would be more proper, since the exclude might mix with the include option and would not make sense.
array() -> []
Comment #10
erik seifert commentedFor test i need more time. A little help would be nice ;- )
Add (1) and (2).
Comment #11
jeroentWrote a test for this issue.
Comment #12
jeroentAdded the negotate item to the schema + made some changes to the backend screen. I changed the select to a checkbox. What do you think?
Comment #17
miro_dietikerPlease always add screenshots for UI change proposals. It allows much easier UX review.
Comment #18
jeroentUndid the UI changes.
Comment #20
jeroentComment #29
miro_dietikerBefore adding more configurability to Paragraphs that is not simply catching up with core patterns, we should define the final goal of how we want to manage paragraph types.
That makes it related to the paragraph type grouping we are also introducing:
#2831762: Add grouping for Paragraph types in "Modal" add mode
People asked to define sets of paragraph types and only allow that set, so adding a new type to a set doesn't require editing every single other paragraph type adding that new type... Others are proposing better tools for batch updates.
See also #2504583: A way to select between predefined sets of paragraphs?
Comment #30
miro_dietikerComment #31
ginovski commentedAdded in the experimental and change some descriptions.
Screenshot:

Comment #32
ginovski commentedRenamed config setting negotate -> negate
Comment #33
miro_dietikerI don't think this is correct.
(BTW some more comments in the logic would help read it faster.)
If no paragraph type is selected, thus it seems getAllowedTypes() returns emptyness now, still all should be allowed.
Is this selection thing well test covered or am i wrong?
I'm very unhappy we need to put this type of setting into the widget.
Instead, a heper method should just interprete the setting and provide us the list of allowed paragraph types. Like getAllowedBundles().
Comment #34
ginovski commentedCreated an issue #2881145: Get allowed paragraph types from ParagraphSelection, this can wait for that
Comment #35
ginovski commentedThis is build on top of #2881145: Get allowed paragraph types from ParagraphSelection
Comment #36
ginovski commented#2881145: Get allowed paragraph types from ParagraphSelection is committed.

So adding a patch with the negate setting. Works properly atm.
Screenshot of the form:
Comment #37
primsi commentedWouldn't this be integer? Because I think if its bool, radios would interprete false as not selected.
Options are not translated.
Also I am not sure about those options. Maybe like that (not really happy with those either)?
1 All selected below
0 All, except the ones selected below
I am not really familiar with return_value. What does this do?
Hm, if we change the schema to int, we might want to fallback to 0 here.
So if we make this a int, will it still evaluate to '1'?
Comment #38
ginovski commentedAddressed #37.
For the descriptions I used:
Exclude the selected below
Include the selected below
Comment #40
miro_dietikerCommitted. :-)
But i noticed that the base of ParagraphSelection is DefaultSelection that implements many methods that are not overridden. There are methods like getReferenceableEntities() countReferenceableEntities() buildEntityQuery() and even createNewEntity() that keep the old (at least not negated) behavior. Where are those methods used?
Needs work for discussion and then to be closed.
Comment #41
berdirYes, this was too early, it's has incomplete test coverage. Validation doesn't work and entities can't be saved.
Not sure if it's worth to revert, @Ginovski is working on improving it.
Comment #42
ginovski commentedAdding buildEntityQuery() and validate.
Comment #44
ginovski commentedFixed methods and extended tests.
Comment #45
ginovski commentedAdding test-only patch.
Comment #49
miro_dietikerCommitted, thx. :-)
Comment #50
miro_dietiker