Skip to content

Fix hiddenLabel and add hiddenLegend form attribute#29710

Merged
wilsonge merged 3 commits intojoomla:4.0-devfrom
Ruud68:fixhiddenlabeladdhiddenlegend
Sep 22, 2020
Merged

Fix hiddenLabel and add hiddenLegend form attribute#29710
wilsonge merged 3 commits intojoomla:4.0-devfrom
Ruud68:fixhiddenlabeladdhiddenlegend

Conversation

@Ruud68
Copy link
Contributor

@Ruud68 Ruud68 commented Jun 19, 2020

Pull Request for Issue #29611 and #29709 .

Summary of Changes

  1. This PR fixes [4.0b1] form attribute hiddenLabel not working as expected #29709
  2. This PR adds form attribute 'hiddenLegend' and fixes Fix for Note form field displaying description #29611

the PR introduces a new hiddenLegend form attribute that can be set in the xml file as attribute for toggling the legend on any field) or in the layout file to give the attribute an initial value (defaults to true when not set)

Testing Instructions

1.1 add form attribute hiddenLabel="false" to a form field
2.1 add a form field type Note to a config file
2.2 add form attribute hiddenLegend="false" to the 2.1 added field
2.3 add form attribute hiddenLegend="true" to a form field

Expected result

1.1 the label for the form field should NOT ( = false) be hidden
2.1 the legend for the Note field (which is the description that is part of the Note field) should not be displayed
2.2 the legend for the Note field should be DISPLAYED
2.3 the legend for the form field that you added the attribute to should be HIDDEN

Actual result

whithout this PR:
1.1 the label for the form field IS hidden
2.1 the legend IS shown with the same information as the note itself
2.2 the legend IS shown with the same information as the note itself
2.3 the legend IS shown for the form field that you added the attribute to

Documentation Changes Required

yes, same changes as made for the 'hiddenLabel' attribute

@brianteeman
Copy link
Contributor

Not checked this yet but legend has a specific meaning which is not this so it would be better to use some other name

@Ruud68
Copy link
Contributor Author

Ruud68 commented Jun 19, 2020

Not checked this yet but legend has a specific meaning which is not this so it would be better to use some other name

I am dutch so all sounds good in English :)
If you have a better name please let me know

Legend: "the words written on or next to a picture, map, coin, etc., that explain what it is about or what the symbols on it mean"

@brianteeman
Copy link
Contributor

@Ruud68
Copy link
Contributor Author

Ruud68 commented Jun 19, 2020

whats wrong with note

if users now that we mean this, then we are good I guess, your call. If it is okay with you the I refactor
Selection_002

@Ruud68
Copy link
Contributor Author

Ruud68 commented Jun 19, 2020

But then again, that might be confusing when applying it to a note field where you then set hiddenNote... what are we hiding here, the note or the note field?
So maybe hiddenDescription? as that is what we are hiding in the code (description value)

@richard67
Copy link
Member

So maybe hiddenDescription? as that is what we are hiding in the code (description value)

Makes sense to me, "hiddenDescription". @brianteeman What do you think?

@Ruud68
Copy link
Contributor Author

Ruud68 commented Jun 22, 2020

So just renamed legend to description. i also set the hiddenLabel to true on the Note field as this field doesn't have a label.
Let the testing begin :)

@SharkyKZ
Copy link
Contributor

SharkyKZ commented Jul 8, 2020

My 2c: introducing hiddenLabel attribute to base form field class might have been a mistake and same for this. If fields are misusing properties used in used in wrapper layout, they should come with their own layout.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Jul 8, 2020

@SharkyKZ using a seperate layout will not change the fact that everything goes through the renderer. What is basically wrong is that the renderer does more then render, it adds things that should be handled by the layout. (the description in this case). So when you remove that from the renderer, then you must refactor all (!) layout files to handle the description: that is a lot of code redundancy. This PR is not about refactoring all fields, it is about building and extending what is already there. changing layouts will most likely also break b/c as implemented layout overrides are then also impacted.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Sep 17, 2020

Working on 'fitting' my extensions into the Joomla 4.0 administrator UI.

Ran into this issue again where notes used to instruct users (you know, for a better UX) are totally useless and confusing as the notes contents are displayed twice...

trying to get some traction for this PR (you know: "hey extension devs, help us because you are the ones using it...")
screen shot 2020-09-17 at 09 42 51


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29710.

@wilsonge wilsonge merged commit 034a61d into joomla:4.0-dev Sep 22, 2020
@wilsonge
Copy link
Contributor

I think this makes sense and can see from the screenshot above the justification. So merging on review. Thanks!

@wilsonge wilsonge added this to the Joomla 4.0 milestone Sep 22, 2020
@Ruud68
Copy link
Contributor Author

Ruud68 commented Sep 23, 2020

Thanks for merging!

@Ruud68 Ruud68 deleted the fixhiddenlabeladdhiddenlegend branch September 23, 2020 07:56
dgrammatiko added a commit to dgrammatiko/joomla-cms that referenced this pull request Sep 26, 2020
* Joomla/4.0-dev: (844 commits)
  [4.0] Template layout select (joomla#30772)
  [4.0][CLI] com_finder use console command (joomla#30768)
  [4.0] Modifying com_actionlogs string (joomla#30758)
  [4.0] Fancy selectbox fix (joomla#30739)
  [4.0] Add missing Table Caption (joomla#30763)
  [4.0] Wrap all buttons in btn-group to improve styling (joomla#30761)
  [4.0] Cassiopeia missing string (joomla#30765)
  Improve batch text (joomla#28447)
  Fix icons not displaying (joomla#30749)
  Remove the chrome "cardGrey". The same effect can be achieved by using the module class "card-grey" with the "card" chrome (joomla#30734)
  Remove obsolete html code (joomla#30737)
  [4.0] Check out improvements related to nullable columns (joomla#30747)
  Removing card.scss overrides as we don't use those classes
  Use renderField() method to render fields (joomla#30738)
  [4.0] spelling (joomla#30742)
  [4.0] Remove use of ReflectionParameter::getClass() (joomla#30581)
  [4.0] Fix saving images (joomla#30730)
  [4.0] Cleanup cassiopeia chromes and rename "default" to "card" (joomla#30729)
  Fix hiddenLabel and add hiddenLegend form attribute (joomla#29710)
  [4.0] Fix Debug plugin to display query parameters (joomla#30717)
  ...
sakiss pushed a commit to sakiss/joomla-cms that referenced this pull request Oct 16, 2020
@brianteeman brianteeman mentioned this pull request Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants