Merge pull request #5480 from opf/fix/rename-query-item

Fix renaming/saving a query item in the frontend missing the icon

[ci skip]
pull/5496/head
Oliver Günther 8 years ago committed by GitHub
commit 69127d366f
  1. 2
      frontend/app/layout/query-menu-item-factory.js
  2. 2
      frontend/app/templates/layout/menu_item.html
  3. 2
      frontend/tests/unit/tests/layout/query-menu-item-directive-test.js
  4. 2
      lib/redmine/menu_manager/menu_helper.rb

@ -72,7 +72,7 @@ module.exports = function(menuItemFactory, $state, $stateParams, $animate, $time
scope.$on('openproject.layout.renameMenuItem', function(event, itemData) {
if (itemData.itemType === QUERY_MENU_ITEM_TYPE && itemData.objectId == scope.queryId) {
element.html(itemData.objectName);
element.find('.menu-item--title').html(itemData.objectName);
}
});
}

@ -6,5 +6,5 @@
lang="{{lang || 'en'}}"
title="{{title}}">
<op-icon icon-classes="icon2 icon-pin ellipsis"></op-icon>
{{ title }}
<span class="menu-item--title" ng-bind="title"></span>
</li>

@ -57,7 +57,7 @@ describe('queryMenuItem Directive', function() {
}));
beforeEach(inject(function($rootScope, $compile) {
html = '<div query-menu-item object-id=' + queryId + '></div>';
html = '<div query-menu-item object-id=' + queryId + '><span class="menu-item--title">title</span></div>';
compile = function() {
element = angular.element(html);

@ -191,7 +191,7 @@ module Redmine::MenuManager::MenuHelper
link_text = ''.html_safe
link_text << op_icon(item.icon) if item.icon.present?
link_text << you_are_here_info(selected)
link_text << content_tag(:span, caption, lang: menu_item_locale(item))
link_text << content_tag(:span, caption, class: 'menu-item--title', lang: menu_item_locale(item))
html_options = item.html_options(selected: selected)
html_options[:title] ||= selected ? t(:description_current_position) + caption : caption

Loading…
Cancel
Save