Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Experimental Widget
Priority:
Critical
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
22 Mar 2017 at 15:27 UTC
Updated:
27 Apr 2017 at 12:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
toncic commentedI will do this.
Comment #3
drobnjak commentedAs it is follow-up on perspectives, I will continue with this
Comment #4
drobnjak commentedComment #5
miro_dietikerThis could be achievedd by creating the tabs in js and only do so conditionally.
Comment #6
miro_dietikerPromoting since the ux sucks for cases without plugins.
Comment #7
drobnjak commentedChecking the number of behavior elements and hiding tabs if there are no behavior behavior elements. We are not moving the tabs creation in the front-end, since selectors are created in the back-end, and they would have to be sent as parameters in Drupal settings. Therefore, there is no way to completely move it to the front-end, and we should do it with lightweight JS check.
Comment #8
miro_dietikerAdditionally, i would think that by default CSS should hide it.
We need the show and hide in JS to respond to added / removed paragraphs?
In any case, i think the user journey hiding / showing the tabs should be described with test coverage.
Comment #9
miro_dietikerComment #10
drobnjak commentedSetting default display for tabs to none. This automatically solves the no-JS fallback and we are displaying tabs only if there are behavior elements.
Comment #11
miro_dietikerWe have jQuery. So why not $('.paragraphs-behavior')
Comment #12
drobnjak commentedAddressing comment #11
Comment #13
drobnjak commentedComment #14
primsi commentedIMHO we should do it the other way around, show the tab in css but hide it in js. I think that we should be able to test this with js tests if I am not mistaken.
Comment #15
miro_dietiker@Primsi: The tabs should not be visible in NoJS. Also they should not be temporarily visible if the widget has no behavior tab.
I think the logic is correct to only add the tabs / make them visible if we detect a need for it.
Comment #16
miro_dietikerOh you dropped the hide() method here that was present before.
Unsure, but: Say a user removes all paragraphs and there are no behavior paragraphs remaining anymore, the tabs now still remains? Before it was removed again.
We need JS tests that proof the tabs are not present if there are is no behavior element.
Comment #17
drobnjak commentedAdding back .hide() method I removed for the case there are no behavior paragraphs. Expanded tests with method to check tabs visibility if there are no behavior elements. Since there is a lot of duplicated code in tests, most of it will be moved into traits in this issue #2867049: Extend JS tests for edit perspectives
Comment #19
drobnjak commentedComment #21
primsi commentedCommitted, thanks.