foam-framework / foam

Feature-Oriented Active Modeller
Apache License 2.0
787 stars 55 forks source link

GroupBySearchView label broken with change on toHTML at commit a732436 #332

Closed jlhughes closed 9 years ago

jlhughes commented 9 years ago

The recent change to GroupBySearchView at commit: https://github.com/foam-framework/foam/commit/a732436454054dfe7b3375ea808bb920d615bbd9 has broken our use of 'label' in GroupByMultiSearchView.

The default view sets floatingLabel to true, and in toHTML the new test of floatingLabel$ executes the new call to view.toHTML().

I tried setting floatingLabel to false in our create on GroupByMultiSearchView but it had no effect.

/* Workorder.js properties */ { model: 'StringArrayProperty', name: 'workers', label: 'Team Members', hidden: true, transient: true }, { model: 'ReferenceProperty', name: 'jbbfcWork_Order_Statusc', subType: 'com.serviceecho.Status', subKey: 'ID', view: 'foam.ui.KeyView', label: 'Status', }, 'wostatus', 'woworkers',

/* WorkorderController search manager setup in init()*/ this.woworkers = this.searchMgr.add(this.GroupByMultiSearchView\ .create({size: 5, property: Workorder.WORKERS, op: INTERSECTS, label: 'Team Mem\ bers'})); this.wostatus = this.searchMgr.add(this.GroupByMultiSearchView\ .create({property: Workorder.JBBFCWORK_ORDER_STATUSC, size: 5, op: IN, labe\ l: 'Status', floatingLabel: false}));

/* WorkorderController template */ templates: [ function toHTML() ... %%woworkers %%wostatus %%woreason ...

jlhughes commented 9 years ago

The fix: js/foam/ui/search/GroupBySearchView.js @@ -90,7 +90,8 @@ CLASS({ this.view.data = ''; }, function toHTML() { (delete) if (this.view.floatingLabel$) { (add) (add) if (this.model_.FLOATING_LABEL) { return this.view.toHTML(); }

NOTE: - / + symbols are replaced by bullets so commented with 'delete' and 'add'.

kgrgreer commented 9 years ago

Thanks. Fixed.