Skip to content

Menu items list parent filter#17060

Merged
mbabker merged 17 commits intojoomla:stagingfrom
tonypartridge:staging-menu-items-parent-filter
Jul 25, 2017
Merged

Menu items list parent filter#17060
mbabker merged 17 commits intojoomla:stagingfrom
tonypartridge:staging-menu-items-parent-filter

Conversation

@tonypartridge
Copy link
Copy Markdown
Contributor

@tonypartridge tonypartridge commented Jul 10, 2017

Pull Request for Issue #16882 .

Summary of Changes

Removes duplicate state filter
Added parent_id filtering

Testing Instructions

Install patch, view list of menu items. Select search tools to show more search options and a new filter is on the right. called '- Select Parent Menu Item -'.

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-staging labels Jul 10, 2017
<option value="">JOPTION_SELECT_MAX_LEVELS</option>
</field>
<field
name="parent_id"
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.

Fix tab/spacing.

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.

It's late.. and drone didn't fail! :/ now fixed. Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Drone is JS tests...don't be blaming drone :P

COM_MENUS_XML_DESCRIPTION="Component for creating menus."
JLIB_RULES_SETTING_NOTES="Changes apply to this component only.<br /><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br /><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br /><em><strong>Allowed</strong></em> will enable the action for this component unless it is overruled by a Global Configuration setting."
COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM="- Select Parent Menu Item -"
COM_MENUS_FILTER_PARENT_MENU_ITEM="Parent Menu Item"
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.

COM_MENUS_FILTER_PARENT_MENU_ITEM_LABEL please

@tonypartridge tonypartridge changed the title Staging menu items parent filter Menu items list parent filter Jul 10, 2017
@coolcat-creations
Copy link
Copy Markdown
Contributor

Cool thank you :) Will test it asap

@GeraintEdwards
Copy link
Copy Markdown
Contributor

Test failed :(

Select 'Site Map' as parent_id and the list does indeed filter to show the correct subitems but the 'search tools disappear' - you need to add parent_id and a.parent_id to $config['filter_fields'] in the model constructor otherwise the 'search tools' disappear when you select a parent filter (with no other filters enabled).

Additionally it would be good for the parent item list to be filtered based on the main 'menu filter'.

@ghost
Copy link
Copy Markdown

ghost commented Jul 11, 2017

@GeraintEdwards i altered your unsuccessfully Test at issue Tracker.

@tonypartridge
Copy link
Copy Markdown
Contributor Author

Thanks @GeraintEdwards now resolved.

@GeraintEdwards
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on ad24cdb

Menu items are filtered correctly and the filter remains visible in the 'search tools'


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

@tonypartridge
Copy link
Copy Markdown
Contributor Author

Now updated @coolcat-creations @GeraintEdwards to include a custom field type which dynamically filters the menu items by menu type if the menu items in the list are already filter by type.

@tonypartridge
Copy link
Copy Markdown
Contributor Author

@rdeutz jenkis php70 docker isn't connecting?

@coolcat-creations
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 0b3ed6f

Thank you, it works! Great improvement for large sites :)


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

@ghost
Copy link
Copy Markdown

ghost commented Jul 11, 2017

@GeraintEdwards can you please retest?

@GeraintEdwards
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 0b3ed6f

Filtering by menu type is a big functional improvement - thanks for adding it in.


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

@ghost
Copy link
Copy Markdown

ghost commented Jul 11, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 11, 2017
@rdeutz rdeutz added this to the Joomla 3.8.0 milestone Jul 11, 2017
@rdeutz
Copy link
Copy Markdown
Contributor

rdeutz commented Jul 12, 2017

@tonypartridge you don't need to care about the new jenkins setup, we are still in testing mode

@tonypartridge
Copy link
Copy Markdown
Contributor Author

tonypartridge commented Jul 12, 2017 via email

@rdeutz
Copy link
Copy Markdown
Contributor

rdeutz commented Jul 12, 2017

travis and drone are required

// Build the options array.
foreach ($items as $key => $link)
{

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.

Remove empty line.

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.

This is standard from the original menuitem.php file

COM_MENUS_VIEW_NEW_MENU_TITLE="Menus: Add"
COM_MENUS_XML_DESCRIPTION="Component for creating menus."
JLIB_RULES_SETTING_NOTES="Changes apply to this component only.<br /><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br /><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br /><em><strong>Allowed</strong></em> will enable the action for this component unless it is overruled by a Global Configuration setting."
COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM="- Select Parent Menu Item -"
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.

Alpha order strings.

@tonypartridge
Copy link
Copy Markdown
Contributor Author

Made some slight changes as per @Quy 's request. Should not need retesting, nothing has changed apart from code style.

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Jul 12, 2017

Actually, the lines should be moved after line 39.

name="parent_id"
type="menuitembytype"
label="COM_MENUS_FILTER_PARENT_MENU_ITEM_LABEL"
description="COM_MENUS__FILTER_PARENT_MENU_DESC"
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.

Fix typo. Use COM_MENUS_FILTER_PARENT_MENU_ITEM_DESC

COM_MENUS_FIELD_VALUE_NEW_WITHOUT_NAV="New Without Navigation"
COM_MENUS_FIELD_VALUE_PARENT="Parent"
COM_MENUS_FIELDSET_RULES="Permissions"
COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM="- Select Parent Menu Item -"
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.

These have to be in alpha order.

COM_MENUS_FILTER_PARENT_MENU_ITEM_DESC
COM_MENUS_FILTER_PARENT_MENU_ITEM_LABEL
COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM

@tonypartridge
Copy link
Copy Markdown
Contributor Author

@rdeutz has someone changed AppVeyor? This passed last week without issue, all I have done is moved language strings around in the .xml for @Quy ?

@rdeutz
Copy link
Copy Markdown
Contributor

rdeutz commented Jul 17, 2017

@tonypartridge it's nothing you can really count on, if they have failed I look into it and most of the time it is simply a wrong test result

JFormHelper::loadFieldClass('groupedlist');

// Import the com_menus helper.
require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
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.

Use JLoader::register() here.

*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$app = JFactory::getApplication('administrator');
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 move this line down to inside the if (!$menuType) as you aren't always using the app.

}

$groups[$menu->title][] = JHtml::_('select.option',
$link->value, $levelPrefix . $link->text . $lang,
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.

If you're going to split the parameters across multiple lines, there should be one parameter per line (this line has two)

@tonypartridge
Copy link
Copy Markdown
Contributor Author

tonypartridge commented Jul 19, 2017 via email

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 25, 2017
@tonypartridge
Copy link
Copy Markdown
Contributor Author

tonypartridge commented Jul 25, 2017 via email

roland-d added a commit to roland-d/joomla-cms that referenced this pull request Jul 26, 2017
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants