ipeychev/liferay-portal — pull request #137 by laszlocsontos (2013-03-05 09:14:55+00:00)
Title: LPS-33236 Make the UI able to show which categories or vocabularies could not be deleted

Hi Iliyan,

1) Minor improvement here: please cache the length, like this:

Done.

2) In whole JavaScript in Portal and Alloy, we are using only single quotes, not double.

Done.

3) Why don't you call directly this attrLookup function, instead to wrap another one (A.bind does this)?

Done, I've removed A.bind(...) and changed that part this way:

+++ attrLookupFn = item[attrLookup];
---- attrLookupFn = A.bind(attrLookup, item);
+++ itemNameMap[itemId] = attrLookupFn.call(item, attr);
--- itemNameMap[itemId] = attrLookupFn(attr);

4) Could you please verify this? In short, try to search for Categories and then - to delete them. Then, try to achieve the same, but for Vocabularies

Done, it did not work indeed, but I've managed to fix it this way.

--- selectedCategories = instance._createItemNameMap(categoryIds, instance._getCategory, 'get', STR_LABEL);
+++ selectedCategories = instance._createItemNameMap(categoryIds, A.bind(instance._getCategory, instance), 'get', STR_TITLE);

* The context while _getCategory() was being called was wrong and
* STR_LABEL was not the correct attribute to fetch in case of livesearch.

Thank you for reviewing!

Cheers,
Laszlo.