Closed (fixed)
Project:
Smart Content
Version:
3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
9 Jul 2020 at 07:39 UTC
Updated:
27 Oct 2020 at 19:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gantal commentedAn initial patch adding an API for plugins to provide summaries for themselves.
Comment #3
gantal commentedThe updated patch adds summary functionality for global segment sets.
Comment #4
gantal commentedComment #5
switzernHey @gantal - I've started testing this patch and was able to apply it to the HEAD of the 3.x dev branch without issues. However, when I try to view a segment set I get the following error:
Class 'Drupal\smart_content\SegmentSetStateHandler' not found in Drupal\smart_content\Form\SegmentSetConfigEntityForm->buildWidget() (line 187 of modules/contrib/smart_content/src/Form/SegmentSetConfigEntityForm.php).Looking in modules/contrib/smart_content/src, I don't see SegmentSetStateHandler in there at all - it looks like that was excluded from your patch. Could you take a look and re-roll the patch with that included?
Comment #6
gantal commentedUpdated the patch to include previously untracked new classes! And an interdiff.
Comment #7
gantal commentedComment #8
switzernComment #9
switzernThanks for the updated patch @gantal. This one applied cleanly and I am now able to access all of the pages I need to test and I see the expand/collapse functionality available. I tested two scenarios in each of three locations around the site:
Scenarios
Locations
I came across a couple bugs in each location and scenario where new or updated values are not saved if the summary is collapsed before the page is saved. Here's how those bugs manifested in each place:
Editing Segment Set directly
Create/edit Segment Set in Layout Builder modal
Create/edit Segment Set on core Block Layout page
Let me know if you need more detailed information about how to recreate.
Comment #10
michaellander commentedComment #11
gantal commentedSlight improvement in this one: decision blocks should collapse/save correctly but global segments still won't save correctly on collapse, for some reason.
Comment #12
michaellander commentedThis should correct the issue on global segment sets.
Comment #13
michaellander commentedComment #14
switzernHey @michaellander - Your patch in #12 applies cleanly against 3.x-beta3 for me. I went through all of the test cases I mentioned in #9 and made sure to test each of the bugs I reported there. Everything seems to be resolved with the exception of the issues with the value of the "Set as default segment" checkbox losing its value when the Segment Set is collapsed before it is saved. I've broken each issue out into the use case where I saw it below:
Create/edit global Segment Set
Create/edit Segment Set in Layout Builder modal
Create/edit Segment Set on core Block Layout page
Let me know if you need any more information or clarification.
Comment #15
michaellander commentedThis should correct the default not saving. I think we need to do some testing around multiple defaults being set however. I also want to make sure we are properly validating form elements on collapse.
Comment #16
michaellander commentedIt looks like we are good on avoiding multiple defaults, so now it's down to properly validating subforms. Once we confirm that's working as expected, we can move back to 'Needs Review'.
Comment #17
michaellander commentedThis should add proper validation on collapse. I think now we are down to code cleanup.
I'd also like to make sure we test multiple decision blocks on the same page, referencing the same exact segment set.
An example of this would be a block field, reference 2 separate decision blocks and the same segment set. We need to confirm that the collapse and expand don't affect both of them.
Comment #18
michaellander commentedNeed to add the summary functionality to decision blocks with a global segment set selected. Otherwise we are looking good!
Comment #19
gantal commentedThis adds the summary functionality we know and love to selected segment set widgets.
Comment #20
switzernHey @michaellander and @gantal - This is working great for me! The patch in #19 applies cleanly and works as advertised. All of the issues I previously mentioned are fixed. Here is a list of all the cases I tested:
Let me know if you need clarification on any of the cases I tested. As far as I'm concerned this is ready to go, so I'm marking this as RTBC.
Comment #21
gantal commentedNo new functionality in this patch but it adds some coding standard fixes for the patch in #19.
Comment #23
michaellander commented