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

New Feature: Implements a modal to edit the Redirect plugin settings when needed #16844

Merged
merged 12 commits into from Jul 26, 2017

Conversation

roland-d
Copy link
Contributor

@roland-d roland-d commented Jun 24, 2017

Pull Request for Issue #7259

Summary of Changes

This is a redo of the original done at #7259 with some small code changes

Testing Instructions

  1. Make sure that the Redirect plugin is either disabled or the Collection of URLs is disabled
  2. Go to administrator/index.php?option=com_redirect
  3. When the collection of URLs is disabled you will see this message:
    image

When the plugin is disabled you will see this message:
image

  1. Click on the Redirect System Plugin link and you are taken to a new page where you can edit the plugin settings. Now you need to navigate back to the Redirect plugin.
  2. Apply patch
  3. When the collection of URLs is disabled you will see this message:
    image

When the plugin is disabled you will see this message:
image

I changed the regular link to a button so it is easier to see where to click.
7. Click on the Redirect System Plugin link and you are shown a modal in which you can change the settings. Update the settings and click Save.
8. The page is refreshed and the message has changed.

Expected result

I stay on the same page and can edit the settings.

Actual result

I am taking to a new page and need to navigate back.

Documentation Changes Required

None

Pinging @brianteeman @franz-wohlkoenig for testing :)

@ghost
Copy link

ghost commented Jun 24, 2017

can you please change Color on hover for easier reading?
bildschirmfoto 2017-06-24 um 10 43 13

@roland-d
Copy link
Contributor Author

@franz-wohlkoenig I can if you tell me which class I should be using :)

@ghost
Copy link

ghost commented Jun 24, 2017

i can't, i'm the one who ask;-) CSS-Gurus here?

@ghost
Copy link

ghost commented Jun 24, 2017

I have tested this item ✅ successfully on 4a8b5f8


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

* @package Joomla.Administrator
* @subpackage com_plugins
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

2017

@Quy
Copy link
Contributor

Quy commented Jun 24, 2017

@roland-d Use the alert-link class instead of a button.

@brianteeman
Copy link
Contributor

@roland-d other than the previouslt mentioned css issue its all good - thanks


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

Changed reload of parent page
@roland-d
Copy link
Contributor Author

Thanks everybody for your input. I have made the following changes:

  • Fixed the copyright
  • Changed the CSS class from btn to alert-link
  • Changed the reload of the parent page because the old way showed JS errors and had issues if you filtered the list before clicking the plugin modal

@ghost
Copy link

ghost commented Jun 24, 2017

I have tested this item ✅ successfully on cb243fc

But Link is difficult to read:
bildschirmfoto 2017-06-24 um 17 05 59


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

@roland-d
Copy link
Contributor Author

@franz-wohlkoenig I could remove the label class and then it is just bold text. That just doesn't look clear enough to me that it is a link you can click. @Quy Any other options for styling this so it looks more like a clickable link?

@mbabker
Copy link
Contributor

mbabker commented Jun 24, 2017

Improve the implementation of the alert-link class if you don't think it stands out as a link (which is just a backport from Bootstrap 3). Please don't try to fudge the display with extra UI elements to make it "stand out".

@roland-d
Copy link
Contributor Author

Ok, I removed the label class. Declaring styling out of scope :)

@ghost
Copy link

ghost commented Jun 24, 2017

I have tested this item ✅ successfully on 6f1d7aa


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

@infograf768
Copy link
Member

Can't we make this generic? I mean not specific to the redirect plugin?
I am talking about the edit.php
window.top.setTimeout('window.parent.location = \"index.php?option=com_redirect&view=links\"', 1000);

We could use the modal for other instances of editing a plugin when we have such situation:
in com_associations for example for the system - languagefilter and in com_fields for system - Fields.

@roland-d
Copy link
Contributor Author

@infograf768 This was generic and then I made the mistake of putting that URL in there :P I will change this so it is generic.

@dgrammatiko
Copy link
Contributor

@infograf768 in Joomla4 we have events so this can be a lot nicer and of course not generic.

Also this probably needs some attention when merging static to j4 (we don't have inline scripts anymore)

else
{
$link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId());
$app->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'error');
$this->redirectPluginId = RedirectHelper::getRedirectPluginId();
Copy link
Contributor

Choose a reason for hiding this comment

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

since you already added the id to JPluginHelper db query return data, can't you just use JPluginHelper::getPlugin('system', 'redirect')->id and remove/deprecate RedirectHelper::getRedirectPluginId?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You cannot do that because when the plugin is disabled the function will return an empty array.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right! Forget that

<?php
if ($this->redirectPluginId)
{
$link = JRoute::_('index.php?option=com_plugins&amp;client_id=0&amp;task=plugin.edit&amp;extension_id=' . $this->redirectPluginId . '&amp;tmpl=component&amp;layout=modal');
Copy link
Contributor

Choose a reason for hiding this comment

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

why use &amp; in JRoute::_()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason, just copy and paste :)

@ghost
Copy link

ghost commented Jun 25, 2017

@roland-d please give a go if PR is ready for Test.

@roland-d
Copy link
Contributor Author

@franz-wohlkoenig Let's ask @andrepereiradasilva if he wants anymore changes. If not, we can test.

@roland-d
Copy link
Contributor Author

@franz-wohlkoenig Looks like we can test, @andrepereiradasilva has not raised any other issues.

@ghost
Copy link

ghost commented Jun 25, 2017

I have tested this item ✅ successfully on 6f5fc46


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


if ($this->enabled && !$this->collect_urls_enabled)
{
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice');
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a space between sentences.

@infograf768
Copy link
Member

@roland-d
we also have to take care of RTL.
I suggest this

	<p class="footer-tip">
		<?php if ($this->enabled && $this->collect_urls_enabled) : ?>
			<span class="enabled"><?php echo JText::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', JText::_('COM_REDIRECT_PLUGIN_ENABLED')); ?></span>
		<?php elseif ($this->enabled && !$this->collect_urls_enabled) : ?>
			<span class="enabled"><?php echo JText::sprintf('COM_REDIRECT_COLLECT_MODAL_URLS_DISABLED', JText::_('COM_REDIRECT_PLUGIN_ENABLED'), 'index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); ?></span>
		<?php elseif (!$this->enabled) : ?>
			<span class="disabled"><?php echo JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', 'index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); ?></span>
		<?php endif; ?>
	</p>

@infograf768
Copy link
Member

hmm, still a small issue.
we get
The Redirect Plugin is enabled. The 'Collect URLs' option in the index.php?option=com_plugins&task=plugin.edit&extension_id=427 is disabled. Error page URLs will not be collected by this component.
coming back with corrected proposal

@infograf768
Copy link
Member

Here it is:

	<p class="footer-tip">
		<?php if ($this->enabled && $this->collect_urls_enabled) : ?>
			<span class="enabled"><?php echo JText::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', JText::_('COM_REDIRECT_PLUGIN_ENABLED')); ?></span>
		<?php elseif ($this->enabled && !$this->collect_urls_enabled) : ?>
			<?php $link = JHtml::_(
					'link',
					JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()),
					JText::_('COM_REDIRECT_SYSTEM_PLUGIN')
				);
			?>
			<span class="enabled"><?php echo JText::sprintf('COM_REDIRECT_COLLECT_MODAL_URLS_DISABLED', JText::_('COM_REDIRECT_PLUGIN_ENABLED'), $link); ?></span>
		<?php elseif (!$this->enabled) : ?>
			<span class="disabled"><?php echo JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', 'index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); ?></span>
		<?php endif; ?>
	</p>

this should work fine now.

roland-d added a commit to roland-d/joomla-cms that referenced this pull request Jul 5, 2017
@roland-d
Copy link
Contributor Author

roland-d commented Jul 5, 2017

Thank you @infograf768 I have added the code verbatim as I don't have time to test it further at this moment but at least if it is all good others can test as well.

@ghost
Copy link

ghost commented Jul 5, 2017

I have tested this item ✅ successfully on fc25aa7

Tested Hathor, Isis; English, Persian.


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

@infograf768
Copy link
Member

I have tested this item ✅ successfully on fc25aa7


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

@infograf768
Copy link
Member

RTC. Thanks!


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 6, 2017
@infograf768 infograf768 changed the title Implements a modal to edit the Redirect plugin settings when needed New Feature: Implements a modal to edit the Redirect plugin settings when needed Jul 6, 2017
@infograf768
Copy link
Member

@rdeutz
did not set milestone. I guess it can go into 3.7.4. as we can in further releases use the new modal for other places in admin.

@brianteeman
Copy link
Contributor

As its a new feature it should be 3.8 surely

@rdeutz rdeutz added this to the Joomla 3.8.0 milestone Jul 6, 2017
@rdeutz rdeutz removed their assignment Jul 6, 2017
@infograf768
Copy link
Member

@roland-d
Just remarked that you are deleting in this PR
administrator/manifests/packages/pkg_weblinks.xml

I guess it is just an error. Please correct.

@roland-d
Copy link
Contributor Author

roland-d commented Jul 6, 2017

@infograf768 That is a mistake, for some reason this thing keeps popping up. I don't think this file is even part of the core. I will fix this.

@roland-d roland-d force-pushed the redo-7259-modal-for-quicker-edit branch from fc25aa7 to 34dc757 Compare July 6, 2017 07:24
@infograf768
Copy link
Member

it IS part of core ;)

@infograf768
Copy link
Member

Looks like it solved itself, weird.

@roland-d
Copy link
Contributor Author

roland-d commented Jul 6, 2017

@infograf768 Still part huh? :/ No, it didn't solve itself, I removed the previous commit and made a new commit.

@infograf768
Copy link
Member

infograf768 commented Jul 6, 2017

Then github is weird as, normally, a new commit would take off the RTC label...
Anyhow, all is fine.

@mbabker
Copy link
Contributor

mbabker commented Jul 25, 2017

Needs to be synced with staging since the plugin helper class has now moved to its namespaced location (should just be able to git merge staging and be good, I had no issues testing another more complex PR).

* staging: (274 commits)
  Add JCryptCipherSodium to support libsodium (joomla#16754)
  Performance 2 (libraries/legacy) (joomla#12220)
  Performance 6 (templates) (joomla#12233)
  Fixed typehint (joomla#16425)
  Fix for: Repeatable field is no longer rendered with Chosen layout (joomla#16471)
  Fix the path for the ajax-loader.gif (joomla#16701)
  Menu items list parent filter (joomla#17060)
  Text Filters layout (joomla#17113)
  mod_login showon option (joomla#17153)
  com_banners incorret tooltip (joomla#17157)
  fix joomla.content.options_default (joomla#17123)
  remove the never working limitstart call (joomla#17184)
  Update phpDocumentor build
  set 3.8.0 Dev State
  Prepare 3.7.4 Stable Release
  fixed a logic change in joomla#12294, thanks @Hoffi1
  Update sv-SE.ini
  Update pt-BR.ini
  Update lv-LV.ini
  Update fa-IR.ini
  ...
@roland-d
Copy link
Contributor Author

@mbabker Done as requested

@mbabker mbabker merged commit bc1e0a0 into joomla:staging Jul 26, 2017
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 26, 2017
@brianteeman
Copy link
Contributor

thank you

@roland-d roland-d deleted the redo-7259-modal-for-quicker-edit branch July 28, 2017 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants