Have a place in the admin panel were you can specify either accepted combinations, or unaccepted combinations of filterable items, based on an individual site's own styleguide standards.
Then upon entry into the database we validate each row as 1, 0 or NULL where 1 = Compliant, 0 = Non-Compliant and NULL = No compliance rules govern this combination.
When viewing the report, you will either see a checkmark for compliant, an X for non compliance, or nothing if it's non in either list. We would also add a filter for this, so users could easily see patterns that are either compliant, or non-compliant in one shot.
Comments
Comment #2
WidgetsBurritos commentedComment #3
WidgetsBurritos commentedThis is an initial proof of concept. We may wish to clean it up a bit more, but it shows us what is possible here.
Comment #4
WidgetsBurritos commentedThis version of the patch uses JSON instead of the proprietary string splitter. This allows us portability later, and provides a nice format so we could potentially build a better admin experience with down the road. For a quick explanation of how everything works:
1. Go to admin/config/system/panels_pane_report:
2. Enter json for either your allowed/disallowed combinations. Here is an example:
[{"bundle":"article","display_layout":"threecol_25_50_25"},{"bundle":"article","build_mode":"teaser"},{"bundle":"display_storage_type","display_layout":"panelizer_entity"}]The above sets up three separate rule combinations. If any of those combinations are found when adding a row to the database, it will get flagged as either passing or failing. The following keys can be used in any combination here:
- build_mode
- bundle
- display_layout
- display_storage_type
- display_storage_id
- entity_type
- page_status
- page_title
- page_storage_id
- pattern_status
- pattern_storage_id
- pattern_title
- style_mode
3. After saving your criteria, go regenerate the report and you should see matching/failing items. Any item that neither pass nor fail criteria sets, get marked as neutral.
Comment #5
WidgetsBurritos commentedComment #7
WidgetsBurritos commentedThis should resolve that last test failure.
Comment #8
WidgetsBurritos commentedComment #9
WidgetsBurritos commentedFor ease of use, and to also not interfere with users who don't necessarily need this functionality, I've decided to take a much different approach. Now it is going to live as a submodule of PPR. This is going to require a bit of restructuring, but I think that allows us to keep this separate functionality separate. This will require creating some hooks. I will identify the necessary hooks here, but will implement those separately, which can be tracked as part of a separate issue: #2856866: Identify and implement alter hooks
For now this is back in progress until I have something to show.
Comment #10
WidgetsBurritos commentedOkay so this is a completely new approach, using the entity api to define styleguide criteria. It's ready for an initial review.
Note: The patch itself is based on three commits (2 of which come from other pending issues). I also included a separate patch file which only shows the changes introduced by the particular patch.
Comment #12
WidgetsBurritos commentedAlright, now that the pre-reqs are merged, here is a smaller patch. Let's hope this fixes that test error.
Comment #14
WidgetsBurritos commentedMinor tweaks to the test cases
Comment #16
WidgetsBurritos commentedTrying again now that the submodule base is already in the repo
Comment #17
WidgetsBurritos commentedOkay now that the tests are working here, I'm gonna clean up a few things and then hopefully have a final candidate ready for review.
Comment #18
WidgetsBurritos commentedComment #19
WidgetsBurritos commentedComment #20
WidgetsBurritos commented@bighappyface would you mind reviewing this when you get the chance?
Comment #21
bighappyface commented@WidgetsBurritos are you cool to wait for me to review this with you in person next week?
Comment #22
WidgetsBurritos commented@bighappyface yeah for sure. I realize it's pretty code heavy.
Comment #23
WidgetsBurritos commentedWalked through this with @brant.darilek and we discovered these issues needed fixed. I will jump on them and submit a new patch.
confirm all three values exist
use the new operator from #2853271: Add "No Reference" option to page status filter
check these tests
add test to confirm row that both matches and fails different criteria sets
add options for missing operators, or values.
are these last two still necessary?
Comment #24
WidgetsBurritos commentedComment #25
WidgetsBurritos commentedI've made the changes mentioned in comment #23 and also a few other minor tweaks.
Comment #26
WidgetsBurritos commentedComment #29
WidgetsBurritos commentedComment #30
WidgetsBurritos commented