Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Modal: Apply (save) button + normalize #18913

Merged
merged 5 commits into from
Dec 2, 2017
Merged

Plugin Modal: Apply (save) button + normalize #18913

merged 5 commits into from
Dec 2, 2017

Conversation

Ruud68
Copy link
Contributor

@Ruud68 Ruud68 commented Nov 29, 2017

Pull Request for Issue # .

Summary of Changes

This PR normalizes the plugin modal as currently used in com_redirect. It also adds a [save] button to the modal footer.

Testing Instructions

  1. normalization:
    1.1 disable the plg_redirect
    1.2 go to component / Redirect
    1.3 in the error message click on the link: "Redirect System Plugin"
    [A]
  2. save button
    2.1 change plugin status in modal to 'enabled'
    2.2 change Collect URLs to 'disabled'
    2.3 click on [Save] button (the modal should stay open)
    2.4 click on [Close] button
    [B]

Expected result

[A] The modal should open and should be same size / form / shape / etc. as other modals (like edit article in menu single article

[B] after closing the modal, the com_redirect page should refresh and the error message must be replaced with a Notice 'The Redirect Plugin is enabled. The 'Collect URLs' option in the Redirect System Plugin is disabled. Error page URLs will not be collected by this component.'
If you did not change the Collect URLs vanlue to 'disabled' there will be no warning / notice.

Actual result

[A] modal is small (width and heigth) the other modals
[B] There is no [Save] button, just a [Close] and [Save & Close] button

Documentation Changes Required

None

JFactory::getDocument()->addScriptDeclaration("
Joomla.submitbutton = function(task)
{
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) {
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form')))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Please let the curly brace on the same line as the if, javascript doesn't have the same code style as PHP

JFactory::getDocument()->addScriptDeclaration("
Joomla.submitbutton = function(task)
{
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) {
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form')))
Copy link
Member

Choose a reason for hiding this comment

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

== >> ===

$input = JFactory::getApplication()->input;

// In case of modal
$isModal = $input->get('layout') == 'modal' ? true : false;
Copy link
Member

Choose a reason for hiding this comment

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

== >> ===

@Ruud68
Copy link
Contributor Author

Ruud68 commented Nov 30, 2017

Thanks @C-Lodder, changes made as pointed out by you :)

@ladyjer
Copy link
Contributor

ladyjer commented Nov 30, 2017

I have tested this item ✅ successfully on 95a6d3b


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

@Ruud68
Copy link
Contributor Author

Ruud68 commented Nov 30, 2017

Thanks for testing @ladyjer :)


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


if (task !== 'plugin.apply') {
if (self !== top ) {
window.top.setTimeout('window.parent.location = window.top.location.href', 1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 34-36: Fix whitespace. Use tabs.

@infograf768
Copy link
Member

Test fine here, waiting for cs to mark it such.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 1, 2017

@Quy @infograf768 Fixed, not sure why my own code style checker didn't 'catch' these. Thanks for reporting and testing!

@infograf768
Copy link
Member

I have tested this item ✅ successfully on cc34df8


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

@infograf768
Copy link
Member

RTC. Thanks.


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 1, 2017
@infograf768 infograf768 added this to the Joomla 3.8.3 milestone Dec 1, 2017
@mbabker mbabker merged commit ebecce1 into joomla:staging Dec 2, 2017
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 2, 2017
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.

None yet

8 participants