Bug 40923 - Fallback for an empty favorites category is always the second element in the categories array
Fallback for an empty favorites category is always the second element in the ...
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-1-errata
Assigned To: Jürn Brodersen
Alexander Kläser
Depends on:
Blocks: 38957
  Show dependency treegraph
Reported: 2016-03-18 09:51 CET by Jürn Brodersen
Modified: 2016-04-13 14:56 CEST (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted after Product Owner Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:

Proposed patch (763 bytes, patch)
2016-03-18 09:51 CET, Jürn Brodersen
Details | Diff
Proposed patch v2 (769 bytes, patch)
2016-03-18 14:00 CET, Jürn Brodersen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jürn Brodersen univentionstaff 2016-03-18 09:51:35 CET
Created attachment 7543 [details]
Proposed patch

This is a problem for the app appliance branding package (Bug 40006). Where we add an app category with a higher priority than the favorites category.
Now the favorites category moves to the second place in the array and is chosen as the fall back for itself.
Comment 1 Jürn Brodersen univentionstaff 2016-03-18 14:00:30 CET
Created attachment 7544 [details]
Proposed patch v2

It would also be nice to select the category with the highest priority if no category is specified instead of selecting the favorites.
Comment 2 Florian Best univentionstaff 2016-03-21 11:47:33 CET
You can use array.filter() from dojo - this is cross browser compatible; object.id dot notation is easier to read instead of ['id'] - jshint complains otherwise. Add missing semicolon.

array.filter(this.getCategories(), function(category) { return category.id != '_favorites_'; })[0]
Comment 3 Jürn Brodersen univentionstaff 2016-03-23 10:54:44 CET

r68252: * make sure the fallback for an empty favorites category isn't the favorites category
r68254: YAML
Package: univention-management-console-frontend
Version: 5.0.63-31.1221.201603231043
Comment 4 Alexander Kläser univentionstaff 2016-04-06 13:53:18 CEST
Changes: OK, they work fine :) !
YAML file: OK, minor adjustment [r68423]

Comment 5 Janek Walkenhorst univentionstaff 2016-04-13 14:56:54 CEST