Skip to content

Remove progressbar.js dependency from com_finder (admin)#5386

Merged
roland-d merged 4 commits intojoomla:stagingfrom
dgrammatiko:_finder_progressbar
Dec 14, 2014
Merged

Remove progressbar.js dependency from com_finder (admin)#5386
roland-d merged 4 commits intojoomla:stagingfrom
dgrammatiko:_finder_progressbar

Conversation

@dgrammatiko
Copy link
Copy Markdown
Contributor

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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

Preview: Video

screen shot 2014-12-10 at 3 32 54

@peterlose
Copy link
Copy Markdown
Contributor

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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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

@peterlose
Copy link
Copy Markdown
Contributor

@DGT41 Ahh yeah, just spotted that!

Well the PR is fine then :)

@dgrammatiko dgrammatiko changed the title Remove progressbar.js dependency form com_finder (admin) Remove progressbar.js dependency from com_finder (admin) Dec 10, 2014
@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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

@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 11, 2014

I get a javascript error. Please see the screenshot.

j34_after_5386

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@waader please clear your browsers cache

@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 11, 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.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@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

@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 11, 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.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@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

@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 11, 2014

Well, that would be much better.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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

@anibalsanchez
Copy link
Copy Markdown
Contributor

@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.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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..

@anibalsanchez
Copy link
Copy Markdown
Contributor

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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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

@anibalsanchez
Copy link
Copy Markdown
Contributor

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.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@anibalsanchez you’ll do a PR for that?

@anibalsanchez
Copy link
Copy Markdown
Contributor

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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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

@anibalsanchez
Copy link
Copy Markdown
Contributor

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@anibalsanchez check #5420

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the entire method if all it's doing is calling the parent method - just have an empty class!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed!

@roland-d
Copy link
Copy Markdown
Contributor

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.

roland-d added a commit that referenced this pull request Dec 14, 2014
Remove progressbar.js dependency from com_finder (admin)
@roland-d roland-d merged commit 1b5fd27 into joomla:staging Dec 14, 2014
@dgrammatiko dgrammatiko deleted the _finder_progressbar branch December 14, 2014 15:22
@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 15, 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

@anibalsanchez
Copy link
Copy Markdown
Contributor

@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.

@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 15, 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.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

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

        if (progress >= 200) {

and report the results?
PS it has to be >=

@waader
Copy link
Copy Markdown
Contributor

waader commented Dec 15, 2014

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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@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

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@waader check #5433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants