? Success

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
21 Dec 2016

Pull Request for Issue #13267

Summary of Changes

After comments in this PR, i have made usage of

Joomla.loadingLayer('load');
Joomla.loadingLayer('show');

thus replacing the fixed message and the inline styles,
that were originally proposed by this PR

NOTE:
-- in all cases the semi-transparent overlay and the image should shown
-- in some older browsers (IE8 / IE9) the image animation may freezing a little, but that is not a problem, it is expected

Testing Instructions

  1. Apply patch
  2. Go to an article form that has custom fields
  3. Change category so that form submit to display the fields assigned to newly selected category
  4. The following picture should be shown

Also same effect on new field form, go to fields, click new field button,
and change field type in the new field form, the same overlay should appear

loading_please_wait

Documentation Changes Required

none

avatar ggppdk ggppdk - open - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Dec 2016
Category Administration com_fields
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
Labels Added: ?
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar ggppdk ggppdk - change - 21 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 21 Dec 2016
avatar tonypartridge
tonypartridge - comment - 21 Dec 2016

What about simplifying it with a simple rotating circle? The text to me looks a bit crud..

avatar ggppdk
ggppdk - comment - 21 Dec 2016

Animated image in most browsers

  • will freeze during / after form submision

so displaying a frozen image is not much of an option

A CSS3 solution animation (circle or similar) works,
... but it will not work in IE8-IE9 (... for IE9 i will need to check)

avatar ggppdk
ggppdk - comment - 21 Dec 2016

You will even need to set a small timeout for form submission to be delayed a little
so that DOM will be updated and show the image and then it will be shown frozen or mostly frozen

avatar dgt41
dgt41 - comment - 21 Dec 2016

@ggppdk my point was that we already have some code for this, maybe enhance it to render test for css spinner...

avatar ggppdk
ggppdk - comment - 21 Dec 2016

my point was that we already have some code for this, maybe enhance it to render text for css spinner...

yes, thanks, i was asking if this or similar existed,

just as said above, animated images in IE8-IE10 and even IE11 ? will not be animated well, during: form submit / page reload

and will need a good delay before we do the form submit, so that DOM is updated to even show them

[EDIT]
partly the problem is image loading, if we add the animated image on page load and just toggle their display, then image will show without need to add delay to form submit, but still it will not animate well

So, i think currently proposed solution offers best browser compatibility

avatar joomla-cms-bot joomla-cms-bot - change - 21 Dec 2016
Category Administration com_fields Administration com_fields Language & Strings
avatar laoneo
laoneo - comment - 22 Dec 2016

For me the styling and also the old javascript code are added on the wrong place. But unfortunately I don't have a better way to suggest. Any ideas?

avatar ggppdk
ggppdk - comment - 23 Dec 2016

@dgt41 , @laoneo

I checked CSS3 animations, when navigating to other URLs (or reloading current URL)
do not work at all with IE8 / IE9

About Joomla.loadingLayer()
yes i was asking if there is an already usuable overlay-loading JS method

  • and i see it already has an option to preload the animation image (and hide it) into the DOM doing:
    Joomla.loadingLayer('load');

But there are 2 other issues with Joomla.loadingLayer()


Problem 1:
The image itself is not suitable because it is Joomla LOGO
(it was meant for Joomla Installation / Update tasks) so it does not look appropriate for showing such an image (Joomla LOGO) to users editing content, especially in frontend

Solution: I think either replace with a neutral one, like a spining circle or add option to the loadingLayer() method to use either Joomla logo or a neutral one


Problem 2:
Image animation only shows if doing AJAX tasks

  • usually image animation not done / not showing well, when navigating to other URL (or reloading current)

To summarize, proposed solution by this PR is best

@dgt41 ... can we add the case proposed by this PR to Joomla.loadingLayer ?
introducing a "type" parameter to the method ?

type: 0, overlay + Joomla logo animation
type: 1, overlay + Neutral image animation
type: 2, overlay + Static text loading message

type 0 and 1 good for AJAX requests
type 2 good for navigating to other URL / or reopening current URL

avatar dgt41
dgt41 - comment - 23 Dec 2016

@ggppdk adding one more flag to that function should be ok (if there is a fallback for the case that this flag is not set, to current behaviour).

I will suggest to pass the image link through addScriptOptions, so no inline script needs to be introduced. e.g.
JFactory::getDocument()->addScriptOption('loadingLayer', 'path/to/image.gif');

avatar ggppdk ggppdk - change - 23 Dec 2016
Labels Added: ?
avatar Bakual Bakual - change - 23 Dec 2016
Title
Add overlay box and message box for form submit and reload due to category selector change
[com_fields] Add overlay box and message box for form submit and reload due to category selector change
avatar Bakual Bakual - edited - 23 Dec 2016
avatar Bakual
Bakual - comment - 23 Dec 2016

The image itself is not suitable because it is Joomla LOGO
(it was meant for Joomla Installation / Update tasks) so it does not look appropriate for showing such an image (Joomla LOGO) to users editing content, especially in frontend

That's not true. It's meant as a "loading" spinner that can be used in any case where we have a delay. It's perfectly fine to be used in 3rd party extensions.

Image animation only shows if doing AJAX tasks
usually image animation not done / not showing well, when navigating to other URL (or reloading current)

In the language installer we use the regular loading spinner just fine (https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_installer/views/languages/tmpl/default.php#L19-L30). I think it's a similar case as here as the form is submitted and reloaded.

If the spinner isn't animated in some older browsers, then so be it. It's not that important that it is animated. Your message box wouldn't be animated as well :)

So please don't invent other ways to do the same thing. Just use the one already present. Don't make things complicater than needed ?

avatar ggppdk
ggppdk - comment - 23 Dec 2016

In the language installer we use the regular loading spinner just fine

Yes, agreed, that the image solution is good , and in the above case it is always shown properly,
because it is preloaded (as i mentioned above, in case it is preloaded with: Joomla.loadingLayer('load'); it always shown)

-- and then image animation depends on the browser and its current load too
i do not disagree with this solution, it is good

but the image itself is a problem, (please read below)

That's not true. It's meant as a "loading" spinner that can be used in any case where we have a delay. It's perfectly fine to be used in 3rd party extensions.

hhmm, i meant it like this:

e.g. i have a website made by Joomla and i have frontend editors
... and i do not want to show JOOMLA! LOGO as loading animation to them
when they edit an article in frontend and they change the category

= which is advertising to frontend users that website is using Joomla

do you see the problem ? or maybe the above is ok, i do not mind it personally

avatar joomla-cms-bot joomla-cms-bot - change - 23 Dec 2016
Category Administration com_fields Language & Strings Administration com_fields
avatar ggppdk
ggppdk - comment - 23 Dec 2016

@Bakual , @dgt41

I have made usage of

Joomla.loadingLayer('load');
Joomla.loadingLayer('show');

replacing the fixed message and the inline styles,
it should work well now,
later if someone adds a different image file as animation,
then at the same PR he / she should update this code to use that new image ...

avatar Bakual
Bakual - comment - 23 Dec 2016

I don't see it as an issue if a frontend editor gets to see the logo of the CMS they use for free. If they even recognize the logo ?

avatar laoneo
laoneo - comment - 24 Dec 2016

The page got also reloaded when you create a new field and do change the type. Can we add that functionality there as well? Code is here https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/models/fields/type.php#L149

avatar tonypartridge
tonypartridge - comment - 24 Dec 2016

Why are we reloading the whole page btw? Would it not make sense to make a Json call or use the Ajax component and just fetch the relevant data and insert it in the current view? a whole page reload seems a bit slow an excessive to me.

avatar Bakual
Bakual - comment - 24 Dec 2016

@tonypartridge Because basically more or less the whol form may change and need preprocessing on server side. While it could be done using AJAX, it's just way easier doing it this way as we can use the existing API.

avatar ggppdk
ggppdk - comment - 24 Dec 2016

Why are we reloading the whole page btw? Would it not make sense to make a Json call or use the Ajax component and just fetch the relevant data and insert it in the current view? a whole page reload seems a bit slow an excessive to me.

Because basically more or less the whol form may change and need preprocessing on server side

I think currently the above is not happening / not needed

The biggest problem is that adding the fields HTML is not enough,
problems:

  1. any inline JS code will not be execute
  2. any header added JS and JS files will not be retrieved
  3. any header added CSS and CSS files will not retrieved

Only inline style blocks are ok

All fields would need to converted to provide an AJAX safe display() method ...
-- providing a JSON response with:

  1. their HTML
  2. their otherwise header-added JS
  3. their otherwise header-added CSS

and then their JS will need to be appropriate so that it executes without errors ...
and then also care that features like showon do not break

Then also you need to apply the JS-based template styles and other initialization stuff, and currently the templates do not conform to some API / do not implements some "Interface" to provide such a method for this ...

  • never the less there is a "common" JS code to apply bootstrap styling, in protostar and isis templates that is usually found in all templates that we could use ... and this "hack" is already done (i think) by subform field
08745a0 24 Dec 2016 avatar ggppdk CS
avatar ggppdk ggppdk - change - 24 Dec 2016
Labels Removed: ?
avatar ggppdk ggppdk - edited - 24 Dec 2016
avatar ggppdk ggppdk - change - 24 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 24 Dec 2016
avatar ggppdk ggppdk - change - 24 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 24 Dec 2016
avatar ggppdk
ggppdk - comment - 24 Dec 2016

I have fixed code styling, and updated the testing instructions

This PR is easy and quick to test if you already have some custom fields created,
please go ahead test it

avatar ggppdk ggppdk - change - 24 Dec 2016
Title
[com_fields] Add overlay box and message box for form submit and reload due to category selector change
[com_fields] Add Joomla loading overlay when form submit is triggered by category selector change
avatar ggppdk ggppdk - edited - 24 Dec 2016
avatar laoneo
laoneo - comment - 24 Dec 2016

The page got also reloaded when you create a new field and do change the type. Can we add that functionality there as well? Code is here https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/models/fields/type.php#L149

avatar ggppdk
ggppdk - comment - 24 Dec 2016

The page got also reloaded when you create a new field and do change the type. Can we add that functionality there as well? Code is here

Right, all similar cases should be in this PR,
will add there too, when i am at my workstation again, a little later today

avatar ggppdk ggppdk - change - 25 Dec 2016
The description was changed
avatar ggppdk ggppdk - edited - 25 Dec 2016
avatar laoneo
laoneo - comment - 7 Jan 2017

I have tested this item successfully on 0ee2b7b


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

avatar laoneo laoneo - test_item - 7 Jan 2017 - Tested successfully
avatar ggppdk ggppdk - change - 7 Jan 2017
The description was changed
avatar ggppdk ggppdk - edited - 7 Jan 2017
avatar ggppdk ggppdk - change - 7 Jan 2017
The description was changed
avatar ggppdk ggppdk - edited - 7 Jan 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jan 2017

I have tested this item ? unsuccessfully on 0ee2b7b

- After PR "Field Group" isn't shown in "Articles: Edit".

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 14 Jan 2017 - Tested unsuccessfully
avatar Bakual
Bakual - comment - 14 Jan 2017

It ma ybe that this branch is a bit older. Due to the way the patchtester works, this may have an effect on testing.
I've updated the branch now so it's up to date with staging, can you test again?

avatar dgt41
dgt41 - comment - 14 Jan 2017

I have tested this item successfully on 56fc576


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

avatar dgt41 dgt41 - test_item - 14 Jan 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jan 2017

I have tested this item successfully on 56fc576


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

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 14 Jan 2017 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 14 Jan 2017
Status Pending Ready to Commit
avatar jeckodevelopment
jeckodevelopment - comment - 14 Jan 2017

RTC


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

avatar wilsonge wilsonge - change - 14 Jan 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-01-14 20:18:18
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 14 Jan 2017
avatar wilsonge wilsonge - merge - 14 Jan 2017

Add a Comment

Login with GitHub to post a comment