? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
16 Feb 2020

Pull Request for Issue #27876 .

This is a draft for com_content articles list only. There are NO sql updates at this time.

Anyone telling me to change tab or a space will be ignored at this time.

Summary of Changes

The list views are getting busier and busier and for many sites a lot of the information really isnt needed.

Testing Instructions

Apply PR
Go to com_content and play with the options to hide show columns

  • It is language aware
  • It is vote plugin aware

Questions

  • Good or bad idea?
  • Apply to all components?
  • If a column is hidden should any ordering option and/or filter for that column also be hidden

Known Issue??

  • This is per site and not per user or usergroup. For me adding that is adding a level of complexity when the aim was to remove it.
  • A different approach would be a screen options with session storage like this but I have no idea or skill to create that
1731e9b 16 Feb 2020 avatar brianteeman debug
4db6a3f 16 Feb 2020 avatar brianteeman wip
420d4b9 16 Feb 2020 avatar brianteeman wip
avatar brianteeman brianteeman - open - 16 Feb 2020
avatar brianteeman brianteeman - change - 16 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Feb 2020
Category Administration com_content
avatar brianteeman brianteeman - change - 17 Feb 2020
Labels Added: ?
avatar dgrammatiko
dgrammatiko - comment - 17 Feb 2020

A different approach would be a screen options with session storage like this but I have no idea or skill to create that

@ciar4n already had implemented this some Atum iterations ago...

avatar brianteeman
brianteeman - comment - 17 Feb 2020

If he did then great - not aware of one

avatar Quy
Quy - comment - 17 Feb 2020

Please fix Access and Category.

27956

avatar wilsonge
wilsonge - comment - 18 Feb 2020

I think it's good. I'd rather do sessionStorage though and I can help you through that on skype or something.

avatar brianteeman
brianteeman - comment - 18 Feb 2020

problem with session storage though is that you would have to set it up every time.

avatar wilsonge
wilsonge - comment - 18 Feb 2020

You would - that's the same way WP works right?

If I try and be super smart we can find a way to dump it in the user table (would require a fresh column) that's submitted to by ajax to com_users whenever we change the filter values. It's probably not as complicated as it sounds and could definitely be a second part after the inital sessionStorage part

avatar brianteeman
brianteeman - comment - 18 Feb 2020

You would - that's the same way WP works right?

I don't know - never used WP ;)

could definitely be a second part after the inital sessionStorage part

sounds like a plan

avatar wilsonge
wilsonge - comment - 18 Feb 2020

I don't know - never used WP ;)

You linked to the screenshot ?

avatar brianteeman
brianteeman - comment - 18 Feb 2020

@ciar4n took that

avatar ciar4n
ciar4n - comment - 18 Feb 2020

@ciar4n already had implemented this some Atum iterations ago...

I think that was @C-Lodder

@ciar4n took that

whats WP? ? ?

avatar C-Lodder
C-Lodder - comment - 18 Feb 2020

@wilsonge You should use localStorage over sessionStorage.

avatar brianteeman
brianteeman - comment - 18 Feb 2020

That would be better although I am still not 100% convinced as that makes it per browser/machine not per user

avatar wilsonge
wilsonge - comment - 18 Feb 2020

The way I read https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage sessionStorage will only die when the window closes. if you log out/in as another user in the same browser/window/tab etc then sessionStorage would still be conserved too?

avatar dgrammatiko
dgrammatiko - comment - 18 Feb 2020

then sessionStorage would still be conserved too?

Nope

avatar wilsonge
wilsonge - comment - 18 Feb 2020

Nope

Can you link me to this. Because I can't see why not? Obviously if you open a new tab or whatever the data goes. But I can't see from the docs on a user hitting logout in Joomla why the sessionStorage would get cleared

avatar brianteeman
brianteeman - comment - 18 Feb 2020

Check the living standard here https://html.spec.whatwg.org/multipage/webstorage.html as it provides a bit more information

And this is an old test I made
https://brian.teeman.net/ws1/page1.html

avatar dgrammatiko
dgrammatiko - comment - 18 Feb 2020

Can you link me to this.

No need. Open Joomla.org, open console and run sessionStorage.setItem('george', true)
open another tab to Joomla.org, open console and run sessionStorage.getItem('george)

There you have it ?

By the way the reason is the same as to why CDN assets are not widely available (everything is encapsulated per tab/site). These changes are here since meltdown and spectre

avatar Fedik
Fedik - comment - 18 Feb 2020

There you have it

syntax error at line 1 ?

a value in session storge will die after close window/tab, that will force user to reconfigure his setting each and every time, that why @C-Lodder suggested localStorage that store a data per Document's origin, persistently

avatar dgrammatiko
dgrammatiko - comment - 18 Feb 2020

syntax error at line 1

It's the variable name that causes the segmentation fault. ?

avatar wilsonge
wilsonge - comment - 18 Feb 2020

No need. Open Joomla.org, open console and run sessionStorage.setItem('george', true)
open another tab to Joomla.org, open console and run sessionStorage.getItem('george)

I understand this. I'm talking about something different. If in a tab, log in as superadmin, do some stuff, log out and in the same tab log back in as a different user idk with author privilege or something. it's going to inherit right?

avatar dgrammatiko
dgrammatiko - comment - 18 Feb 2020

@wilsonge just test it, it's 2 lines of code. Fwiw Joomla's session !== Browser's session, so in that scenario probably it would but also Joomla would want to assign data specifically per user. Sharing is not caring in this case...

WP is storing all this data in the db iirc

avatar Fedik
Fedik - comment - 18 Feb 2020

do some stuff, log out and in the same tab log back in as a different user idk

that depend how localStorage will be organised,
to avoid such colision it need to store per user ID

articleColumns:{
  "<userId 1>": {column1, column2}
  "<userId 2>": {column3, column2}
}
avatar peteruoi
peteruoi - comment - 18 Feb 2020

Let's consider the case that wp does it is in a worse way than the one proposed.
Let's first decide what is best and then find the way to do it like wp.

Imo setting the configuration for the list views one time when sitebuilding and having customised for everyone is much better and covers 90% of the usecases
while the other way may cover 100% but has a lot practical problems for example when i want to site manage with incognito view, or change prowsers or change pcs.

avatar brianteeman
brianteeman - comment - 18 Feb 2020

I guess that if they are going to be stored for the user instead of the component then I should change the params so that they indicate the component

show_list_featured ==> com_content_show_list_featured

??

avatar joomla-cms-bot joomla-cms-bot - change - 20 Feb 2020
Category Administration com_content Administration com_content Language & Strings
avatar brianteeman brianteeman - change - 20 Feb 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Feb 2020
Category Administration com_content Language & Strings Administration com_content Language & Strings Layout
avatar brianteeman brianteeman - change - 20 Feb 2020
The description was changed
avatar brianteeman brianteeman - edited - 20 Feb 2020
avatar brianteeman
brianteeman - comment - 20 Feb 2020

updated to make sure the params are named component specific
updated to add language strings
updated to address the display of the stage

avatar brianteeman
brianteeman - comment - 20 Feb 2020

and also removed unused $only_icon code from the transitions button layout

avatar SharkyKZ
SharkyKZ - comment - 20 Feb 2020

and also removed unused $only_icon code from the transitions button layout

It's used.

avatar brianteeman
brianteeman - comment - 20 Feb 2020

Where? Benjamin said it was not

avatar SharkyKZ
SharkyKZ - comment - 21 Feb 2020

This check removes transition dropdown for users who have no permissions to execute transitions. With your changes the dropdown is always rendered and for users without permissions shows only current state:

trnaisitions

avatar brianteeman
brianteeman - comment - 21 Feb 2020

Ah - that makes sense - easy for me to make the change. Shame on me for relying on someone else to tell me what it was for ;)

avatar brianteeman
brianteeman - comment - 21 Feb 2020

@SharkyKZ and resolved.

avatar brianteeman
brianteeman - comment - 1 Mar 2020

How do I proceed here or should it be closed?

avatar wilsonge
wilsonge - comment - 3 Mar 2020

I like the concept. I think it probably needs to be per user (i mean extra ideally defaults per user group but i think that's too complicated). So I revert back to the initial thing I said here #27956 (comment) - sessionStorage - and more than happy to help you through it on skype or something

avatar brianteeman
brianteeman - comment - 3 Mar 2020

My issue with the session storage is that a site builder can not set it up for the user

avatar dgrammatiko
dgrammatiko - comment - 3 Mar 2020

My issue with the session storage is that a site builder can not set it up for the user

Not totally true, you can pass any state from PHP to JS (client, browser) either with addScriptOptions or data-* attributes. In sort, as long as there is js available in the browser it's totally doable

avatar brianteeman
brianteeman - comment - 3 Mar 2020

fine - you do it then

avatar wilsonge
wilsonge - comment - 3 Mar 2020

My issue with the session storage is that a site builder can not set it up for the user

But if a site builder is setting it up then presumably you want it to be per user group (i.e. super admin different to either admin/author - depending on what access your giving your content creators)

avatar brianteeman
brianteeman - comment - 3 Mar 2020

possibly. I probably wouldn't for sites myself.

avatar brianteeman
brianteeman - comment - 3 Mar 2020

How about the approach I proposed here in this PR to be able to set the site defaults and then an additional option to configure it per session

avatar wilsonge
wilsonge - comment - 3 Mar 2020

I guess that can work.

@HLeithner @bembelimen would be interested in your thoughts here as you use Joomla more day unlike me.

avatar richard67
richard67 - comment - 3 Mar 2020

I would love it most if it would be per user, not per user group, and a global setting used as starting values for new users. Just my preference. Any other way is ok for me, too.

@brianteeman Does per session mean it will be forgotten after session end? If so (and so I understand it) then it would be useful for people working much in the backend, for hours in the same session, having lots of content and so on, but for small one man sites with a 5 minute visit of the backend every few weeks it would be more useful to have it persistent.

avatar brianteeman
brianteeman - comment - 3 Mar 2020

The intention of this PR was that it would be per site. I believe anything more than that is plain over engineering. The concept was that if the site doesn't have any value in showing the author field then that column can be hidden for the site. In the same way the default setting can be simpler than it is today with 9 million useless pieces of content and they are only enabled if they are of value to the site. This results in a simpler, cleaner interface. Remember we have lots of requests to simplify the UI.

avatar Fedik
Fedik - comment - 3 Mar 2020

only thing that makes me scary is amount of XML and options ?

avatar richard67
richard67 - comment - 3 Mar 2020

@brianteeman If per site ... or per session .. or per user ... or per user group: Anything will be an improvement to what we have now (no possibility at all to hide columns except of writing a template override which might be easy for you or me but seems not to be accepted by many users), so whatever you will decide to do will be ok for me.

avatar brianteeman
brianteeman - comment - 3 Mar 2020

@Fedik another reason for it to be something hidden from view and something only a site builder does - if they want to

avatar brianteeman
brianteeman - comment - 3 Mar 2020

Forgot to include some screenshots

image

image

avatar brianteeman
brianteeman - comment - 10 Mar 2020

@wilsonge I guess I should close this due to complete lack of interest

avatar richard67
richard67 - comment - 10 Mar 2020

@brianteeman Lack of interest? I guess we are just waiting for the draft status being removed, then we can test it.

avatar richard67
richard67 - comment - 10 Mar 2020

Hmm, I see, feedback from @bembelimen and @HLeithner which was requested by George is still missing.

avatar richard67
richard67 - comment - 10 Mar 2020

I'm interested in this feature because on my private website I want to hide the "author" column .. it always shows the same value and so is useless to me ;-)

avatar HLeithner
HLeithner - comment - 11 Mar 2020

I would like to have the list view configurable but the approach is wrong. In my opinion this there should be a more generic framework for core and 3rd party components and the list views there and of course configurable per user.

avatar brianteeman
brianteeman - comment - 11 Mar 2020

good luck creating that

avatar HLeithner
HLeithner - comment - 11 Mar 2020

good luck creating that

The question was about my opinion ;-) and adding one band aid on a monster does make it better. We should find a better solution for the complete list view but not in 4.0

avatar brianteeman
brianteeman - comment - 20 Mar 2020

I've been giving this a lot of thought and I cant see any way to achieve what @HLeithner suggests with the current architecture. In order to achieve that a prerequisite would be that the tables are generated dynamically and not the current method which is basically hard coded.

In addition having a ui that would allow every user to configure every view would make it an even more messy ui than it is right now.

So other than adding some acl to decide who is able to set these options I dont see any way to achieve customised list views in any other way than this approach for 4.0. (I suspect that changing the way tables are created etc would mean that approach would have to wait for 5.0)

avatar HLeithner
HLeithner - comment - 20 Mar 2020

To be honest I didn't thought much about such a approach but I think there could be 2 ways.
One do it only in the interface and hide the columns with javascript and css and save the information in the user session/cookie/session store.

Alternative this could be done serverside by adding a css class for hidden columns also saved in session or user object.

Both approaches (which maybe is a combination of both) could be done without big change requirements to the developer. I think about something like hide column 1,2,3,4 and don't care too much about the actual content, alternative the each column needs a unique id in the header and corresponding classes in the rows.

Don't know if there are some pidfalls but thats the first comes to my mind, this maybe would allow reordering too if we build a drag'n'drop option to the list but that maybe too much for the beginning.

avatar brianteeman
brianteeman - comment - 20 Mar 2020

I am not a fan of hiding things with css.

I did look at an approach that was just based on the column number but its really unfriendly

avatar HLeithner
HLeithner - comment - 21 Mar 2020

I am not a fan of hiding things with css.

If you want it without page reload there is no way around hiding them ;-)

avatar brianteeman
brianteeman - comment - 21 Mar 2020

true but thats not something I think we need.

avatar Fedik
Fedik - comment - 21 Mar 2020

I just add how WP doing:

  • it use css for show/hide columns
  • it store "unselected columns" in User options (ajax call, on click), however User do not have dedicated page to edit it, he/she need to visit the content overview page and change selected columns (that make sense)

I do not say it is good or bad, just for info.

avatar bembelimen
bembelimen - comment - 21 Mar 2020

@HLeithner @bembelimen would be interested in your thoughts here as you use Joomla more day unlike me.

For the backend template @Hackwar and myself started a first try for the same problem. What we did was, that extensions could deliver an array of "hideable colums" and from that array the filter classes/layouts (which use the filter_xxx.xml files) generated a new button, which opens a box with all listed columns + checkboxes. Now a user could check/uncheck this checkboxes and the columns were hidden. At the same time the selection is stored in the user state (or was it in the params, I'm not sure) and on site load, the classes were set.
It was something like td:nth-child(xxx) { display: none; } while every column had a key (1-x).

But due to priority it was never really implemented for 100%. Perhaps @Hackwar has some code left.

avatar brianteeman
brianteeman - comment - 21 Mar 2020

Wow thats really annoying that you never replied to the multiple requests last year to say you had started some code #24495

avatar micker
micker - comment - 21 Mar 2020

This solution was integrate in flexicontent backend hidden columns statement was saved in session i can share you the commit for inspiration ?

avatar richard67
richard67 - comment - 21 Mar 2020

@micker Sharing information for inspiration is always good, so please share. If it helps here or not we will see then. Thanks in advance.

avatar micker
micker - comment - 21 Mar 2020
avatar ceford
ceford - comment - 10 Jun 2020

With last nights J4 Beta-2-Dev nightly build install update I get this:

An error has occurred.

0 Argument 1 passed to Joomla\CMS\Button\ActionButton::getState() must be of the type int, null given, called in /Users/ceford/Sites/j4beta2/libraries/src/Button/PublishedButton.php on line 55 

Return to Dashboard


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

avatar brianteeman
brianteeman - comment - 2 Aug 2020

Closed due to lack of interest

avatar brianteeman brianteeman - change - 2 Aug 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-08-02 20:01:30
Closed_By brianteeman
avatar brianteeman brianteeman - close - 2 Aug 2020

Add a Comment

Login with GitHub to post a comment