? Success
Referenced as Related to: # 6769

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
10 Dec 2014

Use the bootstrap javascript for rendering the progress bar

bootstrap.framework is always loaded in ISIS and HATHOR so it’s better to use that library instead of loading one more script!

B/C

The html markup is changed
The relative css file is not loaded anymore
The relative js file is not loaded anymore

Testing

To test this make sure you have plenty of data!
Apply the patch with patch tester ( make sure you are on staging)
purge the indexes if there are any
Re index, and observe that the progress bar is still there, working

avatar dgt41 dgt41 - open - 10 Dec 2014
avatar jissues-bot jissues-bot - change - 10 Dec 2014
Labels Added: ?
avatar dgt41
dgt41 - comment - 10 Dec 2014

Preview:
screen shot 2014-12-10 at 3 32 54

avatar losedk
losedk - comment - 10 Dec 2014

tested. Works fine. But I'm getting Unexpected token '}'

avatar dgt41
dgt41 - comment - 10 Dec 2014

@losedk I get that as well also on statistics. There must be something with the modal code but is not related with this PR

avatar losedk
losedk - comment - 10 Dec 2014

@dgt41 Ahh yeah, just spotted that!

Well the PR is fine then :)

avatar brianteeman brianteeman - change - 10 Dec 2014
Category JavaScript Search
avatar dgt41 dgt41 - change - 11 Dec 2014
Title
Remove progressbar.js dependency form com_finder (admin)
Remove progressbar.js dependency from com_finder (admin)
avatar dgt41
dgt41 - comment - 11 Dec 2014

Latest commit adds one more progress bar (orange) for the optimize process (follows after indexing)

avatar waader
waader - comment - 11 Dec 2014

I get a javascript error. Please see the screenshot.

j34_after_5386

avatar dgt41
dgt41 - comment - 11 Dec 2014

@waader please clear your browsers cache

avatar waader
waader - comment - 11 Dec 2014

Better now, but I get these errors:
j34_after_5386_2

And one small suggestion: maybe it would be more clear that the optimizing is done if some sort of checkmark would be display. Currently you have the orange bar with only the text that says the process is done. But users don´t read.

avatar dgt41
dgt41 - comment - 11 Dec 2014

@waader for the joomla.toggleSidebar check #5259
I guess we can add some icons there, but just to remind you that the previous version didn’t have 2nd progress bar at all, it was just the text message

avatar waader
waader - comment - 11 Dec 2014

@test works!

I applied also #5259 and the ReferenceError has gone. I am aware of the new 2nd progress bar. I made the suggestion because it is animated and when you only watch this hypnotizing animation you could get the impression that the process isn´t done.

avatar waader waader - test_item - 11 Dec 2014 - Tested successfully
avatar dgt41
dgt41 - comment - 11 Dec 2014

@waader what would be nice, I think, is to have a close button (green) at the end! And maybe remove the ability to close the modal and also remove the x icon on the top right corner

avatar waader
waader - comment - 11 Dec 2014

Well, that would be much better.

avatar dgt41
dgt41 - comment - 12 Dec 2014

@waader at the end of the optimization process, the progress bar is removed, right?

avatar anibalsanchez
anibalsanchez - comment - 12 Dec 2014

@test success, however I got a couple of JS errors:

  • SyntaxError: syntax error ator/index.php?option=com_finder&view=indexer&tmpl=component index.p...w=index (line 1, col 60)

The button has an Url in onClick button: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_finder/views/index/view.html.php#L73

  • ReferenceError: Joomla is not defined template.js (line 60) Joomla.toggleSidebar = function(force)

This one seems unrelated with the finder.

avatar anibalsanchez anibalsanchez - test_item - 12 Dec 2014 - Tested successfully
avatar dgt41
dgt41 - comment - 13 Dec 2014

Thanks @anibalsanchez! For the second error there is a solution: #5259. The first one is related to bootstrap modal (?) or toolbar button (?). Trying to find the root of the problem there, but still I have no success. If you have any idea what is wrong please make a PR to get rid of that..

avatar anibalsanchez
anibalsanchez - comment - 13 Dec 2014

@dgt41 The modal problem is related with the onclick, it has an Url intead of Javascript code.... but it works... very odd indeed.

avatar dgt41
dgt41 - comment - 13 Dec 2014

@anibalsanchez but according to this the code seems fine (?)

avatar anibalsanchez
anibalsanchez - comment - 13 Dec 2014

Here _getCommand according to the description should return a Javascript command, but it returns just the URL: https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/toolbar/button/popup.php#L115 ... that it's assigned to the onClick.

avatar dgt41
dgt41 - comment - 13 Dec 2014

@anibalsanchez you’ll do a PR for that?

avatar anibalsanchez
anibalsanchez - comment - 13 Dec 2014

Sure ... but I don't know what it should return, Bootstrap modal does not need any onClick

avatar dgt41
dgt41 - comment - 13 Dec 2014

It seems that bootstrap all it needs is a url for the iframe: https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/html/bootstrap.php#L319

avatar dgt41
dgt41 - comment - 13 Dec 2014

One simple work around would be: set the button url wrapped with onclick and on popup button remove it…

avatar dgt41
dgt41 - comment - 13 Dec 2014

@anibalsanchez The easiest solution is to change onclick with value in the layout: https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/toolbar/popup.php#L19

avatar dgt41
dgt41 - comment - 13 Dec 2014
avatar roland-d roland-d - change - 14 Dec 2014
Status Pending Ready to Commit
avatar roland-d
roland-d - comment - 14 Dec 2014

Moving to RTC since we have 2 successful tests.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5386.
avatar roland-d roland-d - close - 14 Dec 2014
avatar roland-d roland-d - change - 14 Dec 2014
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2014-12-14 15:01:34
avatar waader
waader - comment - 15 Dec 2014

@dgt41 The progress bar is not removed as you can see from the screenshot. I tested with current staging branch and "test sample data".

j34_151214_0952

avatar anibalsanchez
anibalsanchez - comment - 15 Dec 2014

@waader This PR removes the internal dependency with mootools (behavior.framework). It does not change how the progressbar works now, for example, it does not auto-close it at the end.

avatar waader
waader - comment - 15 Dec 2014

@anibalsanchez The progress bar for the optimization is new and the behaviour is different when I test with the default data sample versus test with the test data sample. With the default sample the progress bar disappears when optimization is done, with the test data sample it stays.

avatar dgt41
dgt41 - comment - 15 Dec 2014

@waader since I can’t reproduce this can you replace line 88 of indexer.js with

        if (progress == 200) {

and report the results?

avatar waader
waader - comment - 15 Dec 2014

When optimizing is done progress has a value of 109.09090909090908. >= 100 would help.

avatar dgt41
dgt41 - comment - 15 Dec 2014

@waader Yes you are right, I just tested that.
The solution is quite simple:
in indexer.js line 88 has to be:

        if (message == msg) {

And we have to add in views/indexer/tmpl/default.php

JHtml::_('behavior.core');
JFactory::getDocument()->addScriptDeclaration('var msg = "' . JText::_('COM_FINDER_INDEXER_MESSAGE_COMPLETE') . '"');

before line 15

avatar dgt41
dgt41 - comment - 15 Dec 2014

@waader check #5433

Add a Comment

Login with GitHub to post a comment