FLUID-4128: Renderer expander converts all context-resolved values from the model to string type

Metadata

Source
FLUID-4128
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Colin Clark
Reporter
Antranig Basman
Created
2011-03-01T22:25:35.172-0500
Updated
2014-03-03T13:37:24.341-0500
Versions
  1. 1.3.1
Fixed Versions
  1. 1.4
Component
  1. Renderer

Description

(07:55:06) Isle of Yura: og I noticed one funny thing
(07:55:33) Isle of Yura: when using repeat expander for example
(07:55:41) Isle of Yura: and trying to resove pathAs value
(07:55:57) Isle of Yura: boolean is converted into string 🙂

(07:57:37) Isle of Yura: i noticed it depends on noCopy option
(07:57:39) Isle of Yura: i tihnk
(07:57:57) AntranigBasman: Interesting
(07:58:14) Isle of Yura: and expandLight, and the fact that that option cant propagate
(07:58:23) AntranigBasman: Can't propagate?
(07:58:37) Isle of Yura: yes as part of renderer expander resolution
(07:58:46) Isle of Yura: repeat expander that is
(07:58:47) AntranigBasman: What do you mean by propagate?
(07:59:10) Isle of Yura: i mean it wont get through even if i were to specify it somewhere
(08:00:23) AntranigBasman: Can you give an example?
(08:00:45) Isle of Yura: one sec
(08:03:29) Isle of Yura: so kasper has a branch in his github, where he 's trying to use condition expander
(08:03:36) Isle of Yura: and as an arg he passes a boolean
(08:03:50) Isle of Yura: but when we get to calling the function that will resolve condition
(08:04:06) Isle of Yura: that boolean turns to a string

https://github.com/collectionspace/ui/blob/master/src/main/webapp/js/Header.js

(08:10:41) Isle of Yura: so line 83
(08:10:51) Isle of Yura: ${{itemName}.hide} is actually a boolean
(08:11:07) Isle of Yura: but when cspace.header.assertMenuItemDisplay is called, it's already a string arg

Comments

  • Antranig Basman commented 2011-03-01T22:26:25.064-0500

    The code in question reads:

    cspace.header.produceTree = function (that) {
            var tree = {
                logout: {
                    messagekey: "logout"
                },
                user: {
                    messagekey: "user"
                },
                userName: {
                    messagekey: "userName",
                    args: {
                        userName: that.options.login.options.screenName
                    } //interpret %userName string
                },
                expander: {
                    repeatID: "menuItem",
                    type: "fluid.renderer.repeat",
                    pathAs: "item",
                    valueAs: "itemName",
                    controlledBy: "menuitems",
                    tree: { //check whether to display the menu items by calling assertMenuItemDisplay with the hide variable
                        expander: {
                            type: "fluid.renderer.condition",
                            condition: {
                                funcName: "cspace.header.assertMenuItemDisplay",
                                args: "${{itemName}.hide}"
                            },
                            trueTree: {
                                label: {
                                    target: "${{item}.href}",
                                    linktext: {
                                        messagekey: "${{item}.name}"
                                    }
                                }
                            }
                        }
                    }
                }
            };
            return tree;
        };
    
  • Antranig Basman commented 2011-03-01T23:15:37.649-0500

    Fixed at revision c6298c9db2fca7f385d1dfd83bbdd23fa328b03c