User tests: Successful: Unsuccessful:
First pass for files already using $wa to make sure all scripts are loaded with the web asset manager
code review
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_associations com_cache com_config com_content com_contenthistory com_finder com_installer com_joomlaupdate com_menus com_users |
Labels |
Added:
?
|
Category | Administration com_associations com_cache com_config com_content com_contenthistory com_finder com_installer com_joomlaupdate com_menus com_users | ⇒ | Administration com_associations com_cache com_config com_content com_contenthistory com_finder com_installer com_joomlaupdate com_menus com_messages com_plugins com_redirect com_users com_workflow Front End com_contact |
Can you give me an example please - as the current core was kind of hard to work out how it should be
did you mean that this
$wa ->useScript('multiselect')
->useScript('com_installer.changelog');
should be
$wa->useScript('multiselect')
->useScript('com_installer.changelog');
Well once again we reach a corner of the decade old Joomla Coding Standards that doesn't take modern code into account and there is no defined example in the standard (hence why phpcs passes in drone) however there are some examples (that contradict each other) in the last 2 code blocks on the https://developer.joomla.org/coding-standards/php-code.html page.
Yes, I mean those chained things.
In the absence of a defined standard I would go for something with the arrows aligned and no spaces before the first arrow and the object:
$wa->useScript('multiselect')
->useScript('com_installer.changelog');
PHPStorm seems to do something different
PSR-12 has nothing to say on the matter and neither does PSR-2
So I guess just pick one, and implement it consistently.
At the moment your PR has a myriad of different examples of indentation and spaces after the initial object.
Other well used examples are:
$this->fooService
->doBar()
->doBaz();
$this
->fooService
->doBar()
->doBaz();
they should all be the same now. viewing on github always accentuates the tab display
Yes I see they are all the same now and using tabs.... looks horrid in the Github diff still
Looks wrong in phpStorm too
but looks ok in markdown before submitting
and after using phpStorm to "cleanup" the file it looks even more crazy
I give up :) as long as they are consistent its not so obvious I guess. Thanks for trying.
the pr is just for using web assets and not coding standards. It was my copy/paste error that introduced an extra tab that I have now removed
Every PR should be about Code Standards. That's literally the whole point of standards.
sorry phil but that is exactly the same as this pr. you are getting confused by the github ui using 8spaces for a tab
Would be great if this could be tested and merged as there are dependent pull requests to be created afterwards
oh well another release goes by
There a bug in multiselect.js, it require scriptOption.
Your changes will load multiselect.js but it will be inactive.
Need to update this:
joomla-cms/build/media_source/system/js/multiselect.es6.js
Lines 101 to 114 in 2dc4447
To:
const onBoot = () => {
let formId = '#adminForm';
if (Joomla && Joomla.getOptions('js-multiselect', {}).formName) {
formId = `#${Joomla.getOptions('js-multiselect', {}).formName}`;
}
// eslint-disable-next-line no-new
new JMultiSelect(formId);
};
And it need to be tested, at least on "articles" view, if it works there, then it will work in other places also.
forgot to add I tested your change and it didnt fix it
Are you sure that its this change that is stopping it working?
Yes, I do not know all features, but I tested simple click on the row (and console.log() for check initialization), before the patch it worked, and after the patch it stopped.
So I did code changes (that I suggested previously), to fix the boot()
method.
I didn't observe any change in behaviour
I didn't observe any change in behaviour
Do next:
Open Articles table. Click on any row (not checkbox directly). You should see that associated checkbox checked automatically.
Then remove HTMLHelper::_('behavior.multiselect');
and add useScript('multiselect')
in administrator/components/com_content/tmpl/articles/default.php
, and try the same test, now the click on the row does not do anything.
didnt know you could click on the row - will fix that in this pr with your code. Still leaves the open shift select issue
Still leaves the open shift select issue
Yeap, that seems a main point of use multiselect.js (in joomla 2 and 3), without this feature it useless and can be just trashed.
But it another issue.
Also didnt help my tests that I had made a mistake in com_content and put the change inside an if block for workflows
Category | Administration com_associations com_cache com_config com_content com_contenthistory com_finder com_installer com_joomlaupdate com_menus com_users com_messages com_plugins com_redirect com_workflow Front End com_contact | ⇒ | Administration com_associations com_cache com_config com_content com_contenthistory com_finder com_installer com_joomlaupdate com_menus com_messages com_plugins com_redirect com_users com_workflow JavaScript Repository NPM Change Front End com_contact |
Multiselect is now working exactly as it was before this pr
Labels |
Added:
NPM Resource Changed
|
I have tested this item
Please fix conflicts.
Please fix conflicts.
Less of a conflict and more of a "shouldnt have been merged in the first place" - fixed
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Thx
great thanks - now I can fix the rest
The indentation of the chained method calls is wrong in almost every file modified and should be corrected.