Closed (fixed)
Project:
Diff
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
26 Aug 2016 at 20:24 UTC
Updated:
26 Sep 2016 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
johnchqueLet's try this :)
Comment #3
johnchqueMade some changes, not really sure how to set a default layout since we are setting the default one in the routing file.
Comment #5
johnchqueSorry, fixed the schema.
Comment #6
miro_dietikerThat's cool, but we need strict test coverage.
The most important purpose of the weight is to move one item to the first place and thus make it the default.
We need to check that the button displays the plugins in the right order.
And we need to check that disabled plugins go away and are not accessible through the route.
Comment #7
johnchqueAdded initial tests. Still not really sure how to set the new layout filter as default.
Comment #9
miro_dietikerYeah then we can also split introducing weight stuff from the default as two separate issues.
In the worst case we can really also separately consider a/the default setting.
Comment #10
johnchqueFollowup created.
Comment #11
johnchqueMade some other changes. The dropdown button now displays the plugins sorted. Added the "none selected, all selected". Fixed the tests. Define the default plugin will be done in the followup.
Comment #12
miro_dietikerWhat field?
We could simply force population of the settings on install time and then drop this else on runtime.
Every line less here helps.
Not true.
I would skip this any=all part. It is only needed to have something grow if instances are created often. Make sure enabled is the default.
Can't see where those are saved?
Comment #13
johnchqueFixed based on comments above, I think this might break if we disable the classic layout.
Comment #15
johnchqueNot really sure if I should enable all the plugins in an update function.
Comment #16
miro_dietikerGetting the options reads straight forward now. So this seems fine.
Enabling all makes sense IMHO, it's how it is now.
What breaks if we disable classic layout?
Test fails are uncool. ;-)
Comment #17
johnchqueIt breaks because it is set in the routing.yml file as default one.
Comment #18
miro_dietikerYeah then sure no default like that and make the method negotiate the default in code. That sounds pretty straight forward.
Comment #19
johnchqueTrue, now it doesn't break if classic is disabled. Also added tests. Works nice IMHO.
Comment #21
johnchqueAlso fixed views. :)
Comment #23
johnchqueThis should fix all tests.
Comment #24
miro_dietikerWeights are hardcoded. You make the loop start at a position that depends the plugin count. That doesn't allow to hardcode things.
BTW Isn't there a standard method that is called on submit that reorders weight?
Hm, this reads so much repetitive, as if we need to do it again and again for every tiny test.
Can you quickly check tests and if it makes sense to prepare this better?
I think it belongs to the DiffTestBase.
You should use reset to pick the first.
Comment #25
miro_dietikerOK simple solution:
I'd start at 0.
Let's take max() +1
Comment #26
johnchqueFixed small stuff. I think it can be better to refactor the tests in another issue, the code pointed is used a lot so better to change it all. :)
Comment #28
johnchqueAFAIK the max can be used when the weight is already set. Should it be better to keep this?
Comment #30
johnchquehmm small mistake.
Comment #32
johnchqueSmall thing that need to be changed. :)
Comment #34
miro_dietikerOK committing this. But i'm not happy with count() as it can produce clashes when new plugins are added and custom weights are in place.