Remove progressbar.js dependency from com_finder (admin)#5386
Remove progressbar.js dependency from com_finder (admin)#5386roland-d merged 4 commits intojoomla:stagingfrom dgrammatiko:_finder_progressbar
Conversation
|
Preview: Video |
|
tested. Works fine. But I'm getting Unexpected token '}' |
|
@losedk I get that as well also on statistics. There must be something with the modal code but is not related with this PR |
|
@DGT41 Ahh yeah, just spotted that! Well the PR is fine then :) |
|
Latest commit adds one more progress bar (orange) for the optimize process (follows after indexing) |
|
@waader please clear your browsers cache |
|
@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 |
|
Well, that would be much better. |
|
@waader at the end of the optimization process, the progress bar is removed, right? |
|
@test success, however I got a couple of JS errors:
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
This one seems unrelated with the finder. |
|
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.. |
|
@DGT41 The modal problem is related with the onclick, it has an Url intead of Javascript code.... but it works... very odd indeed. |
|
@anibalsanchez but according to this the code seems fine (?) |
|
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. |
|
@anibalsanchez you’ll do a PR for that? |
|
@DGT41 Sure ... but I don't know what it should return, Bootstrap modal does not need any onClick |
|
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 |
|
@DGT41 the problem is in the toolbar button, where the Url is inserted as a command https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/toolbar/button/popup.php#L59 |
|
@anibalsanchez The easiest solution is to change |
|
@anibalsanchez check #5420 |
There was a problem hiding this comment.
You can remove the entire method if all it's doing is calling the parent method - just have an empty class!
|
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. |
Remove progressbar.js dependency from com_finder (admin)
|
@DGT41 The progress bar is not removed as you can see from the screenshot. I tested with current staging branch and "test sample data". |
|
@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. |
|
@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. |
|
@waader since I can’t reproduce this can you replace line 88 of indexer.js with if (progress >= 200) {and report the results? |
|
When optimizing is done progress has a value of 109.09090909090908. >= 100 would help. |
|
@waader Yes you are right, I just tested that. 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 |




Use the bootstrap javascript for rendering the progress bar
bootstrap.frameworkis 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