? Success

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
22 Oct 2016

Pull Request for Issue # .
The problem: Many people stated that they experience odd behaviour with the tabs when a page loads (admin area).

Summary of Changes

The javascript that controlled this behaviour was way to liberal.
So the old behaviour:

  • One key-value pair
  • As a user is browsing and clicking on tabs these tabs (as their ID) is stored in an array in the key-value of local storage.
  • The problem is that the script will loop all this values and set for each one the relative tab as active.

The new logic:

  • many key-value pairs
  • regular expression removes the &id=0000 part (could be improved, help is welcome)
  • there is a unique key-value pair per view (not per item, e.g. article->edit but not article[123]->edit)
  • should be faster and glitch free ### Testing Instructions

Apply the patch and try any view with tabs

Before:
screen shot 2016-10-22 at 03 18 13

After:
screen shot 2016-10-22 at 03 17 03

Documentation Changes Required

None

81d95f0 22 Oct 2016 avatar dgt41 fix
avatar dgt41 dgt41 - open - 22 Oct 2016
avatar dgt41 dgt41 - change - 22 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2016
Category JavaScript
avatar dgt41 dgt41 - change - 22 Oct 2016
The description was changed
avatar dgt41 dgt41 - edited - 22 Oct 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 22 Oct 2016

Testes dwith success (cannot mark it on the tracker)

Animated gif of the problem and the success test
tabs

avatar andrepereiradasilva andrepereiradasilva - test_item - 22 Oct 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 22 Oct 2016

I have tested this item successfully on 81d95f0


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

avatar zero-24 zero-24 - change - 22 Oct 2016
Milestone Added:
avatar zero-24 zero-24 - test_item - 22 Oct 2016 - Tested successfully
avatar zero-24
zero-24 - comment - 22 Oct 2016

I have tested this item successfully on 81d95f0

much better ?


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

avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2016
Milestone Removed:
avatar zero-24 zero-24 - change - 22 Oct 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 22 Oct 2016

RTC


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

avatar dgt41 dgt41 - change - 22 Oct 2016
Status Ready to Commit Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2016
Labels Added: ?
avatar dgt41
dgt41 - comment - 23 Oct 2016

@zero-24 I set this again to pending, because the regular expression I use is matching only &id=0000 should be more generic like&anyword=anynumber, but as I said before regular expressions is not my strong point

avatar joomla-cms-bot joomla-cms-bot - change - 23 Oct 2016
Labels Removed: ?
avatar dgt41
dgt41 - comment - 23 Oct 2016

screen shot 2016-10-23 at 18 38 46
that should be more generic now

avatar brianteeman brianteeman - change - 29 Oct 2016
Labels Added: ?
Removed: ?
avatar zero-24
zero-24 - comment - 29 Oct 2016

What is the status here? Just re testing?

avatar eshiol
eshiol - comment - 29 Oct 2016

I tested it and solve the issue #12316.
What do you think to remove the parameter return too.

avatar dgt41
dgt41 - comment - 29 Oct 2016

@zero-24 yes, just re-test

avatar dgt41
dgt41 - comment - 29 Oct 2016

remove the parameter return too

What do you mean? give me an example

avatar eshiol
eshiol - comment - 29 Oct 2016

You used regular expression to remove &myStrangeId=0000
In the localStorage I found /j364/administrator/index.php?option=com_config&view=component&component=com_patchtester&path=&return=aHR0cDovL2xvY2FsaG9zdC9qMzY0L2FkbWluaXN0cmF0b3IvaW5kZXgucGhwP29wdGlvbj1jb21fcGF0Y2h0ZXN0ZXI%3D
I'd add .replace(/&return=[a-zA-Z0-9%]+$/, '') to remove the parameter return

avatar dgt41
dgt41 - comment - 29 Oct 2016

@eshiol ok, i see what you mean, what about &[a-zA-Z]+=[a-zA-Z0-9%]+$, will work both ways?
screen shot 2016-10-30 at 02 51 30
`

avatar eshiol
eshiol - comment - 30 Oct 2016

I don't think so. The regular expression ends with $, so you process only the last parameter. If you put &view=component at the end of the url it doesn't work anymore. Your regex removes the parameter view.
Please try with .replace(/&[a-zA-Z]+=\d+/, '').replace(/&return=[a-zA-Z0-9%]+/, '')

avatar dgt41 dgt41 - change - 31 Oct 2016
The description was changed
avatar dgt41
dgt41 - comment - 31 Oct 2016

@eshiol I added your suggestion and also I expanded the other reg ex to include items like item_id and item-id. So this should be complete now

avatar eshiol
eshiol - comment - 31 Oct 2016

That's ok, but if you use the $ at the end of the regular expression you process only the last parameter. /&[a-zA-Z-_]+=[0-9]+$/ doesn't work with
index.php?option=com_mycomponent&myparam=123&view=myview

avatar dgt41
dgt41 - comment - 31 Oct 2016

@eshiol following the core paradigm all components for their singular view have the id as the last param. Now 3rd PD may not follow that (?) but if I remove that then a url like
index.php?option=com_dfdsadfad&view=component&catid=33&mynice_id=2342 will eliminate both id and catId, which might not be what we want?
Anyways I am gonna remove it and if it misbehave then we can rework the regex

avatar eshiol
eshiol - comment - 31 Oct 2016

of course, you are right.
But, what the difference between
index.php?option=com_dfdsadfad&view=component&catid=33&mynice_id=2342
index.php?option=com_dfdsadfad&view=component&catid=33&mynice_id=5555
index.php?option=com_dfdsadfad&view=component&catid=34&mynice_id=8888
I'd like to open the same tab in all of the three cases. But I agree with you, this kind of filter is more complex than it seems

avatar dgt41
dgt41 - comment - 31 Oct 2016

But, what the difference between

Probably the same view and the same tabs, unless some ACL removes access to some tabs and then no tab will be selected )or something like that)

avatar andrepereiradasilva andrepereiradasilva - test_item - 3 Nov 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 3 Nov 2016

I have tested this item successfully on 41ba14f

again


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

avatar ggppdk ggppdk - test_item - 3 Nov 2016 - Tested successfully
avatar ggppdk
ggppdk - comment - 3 Nov 2016

I have tested this item successfully on 41ba14f


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

avatar brianteeman brianteeman - change - 3 Nov 2016
The description was changed
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 3 Nov 2016

RTC


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

avatar brianteeman brianteeman - edited - 3 Nov 2016
avatar brianteeman brianteeman - change - 3 Nov 2016
Milestone Added:
avatar brianteeman brianteeman - change - 3 Nov 2016
Labels Added: ?
avatar rdeutz rdeutz - close - 4 Nov 2016
avatar rdeutz rdeutz - merge - 4 Nov 2016
avatar rdeutz rdeutz - reference | c22ced1 - 4 Nov 16
avatar rdeutz rdeutz - merge - 4 Nov 2016
avatar rdeutz rdeutz - close - 4 Nov 2016
avatar rdeutz rdeutz - change - 4 Nov 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-11-04 09:06:06
Closed_By rdeutz

Add a Comment

Login with GitHub to post a comment