Skip to content

Commit

Permalink
FLUID-5759: Fixed a bug with the aux builder: when more than one pane…
Browse files Browse the repository at this point in the history
…l names defined in the aux schema use single letters, and these panels compose a composite panel using the expression of "panels: ["x", "y", ...], the builder mistakenly sets the renderOnPrefs option to true for some panels even though all panels should always be rendered.
  • Loading branch information
cindyli committed Nov 19, 2015
1 parent e4e9462 commit 3980099
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/framework/preferences/js/AuxBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
var subPanels = {};
var subPanelRenderOn = {};

// panels can contain an array of always on panels, or an object
// describing which panels are always and which are initialized by a preference value
if (!fluid.isPrimitive(thisCompositeOptions.panels)) {
// thisCompositeOptions.panels can be in two forms:
// 1. an array of names of panels that should always be rendered;
// 2. an object that describes what panels should be always rendered,
// and what panels should be rendered when a preference is turned on
// The loop below is only needed for processing the latter.
if (!fluid.isPrimitive(thisCompositeOptions.panels) && !fluid.isArrayable(thisCompositeOptions.panels)) {
fluid.each(thisCompositeOptions.panels, function (subpanelArray, pref) {
subPanelList = subPanelList.concat(subpanelArray);
if (pref !== "always") {
Expand Down
16 changes: 8 additions & 8 deletions tests/framework-tests/preferences/js/AuxBuilderTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1202,11 +1202,11 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
"template": "%templatePrefix/combinedBoth.html",
"message": "%messagePrefix/combinedBoth.json",
"type": "fluid.prefs.panel.combinedBoth",
"panels": ["subPanel1", "subPanel2"],
"panels": ["x", "y"],
"extraOption": 1
}
},
"subPanel1": {
"x": {
"type": "fluid.prefs.subPanel1",
"enactor": {
"type": "fluid.prefs.enactor.subPanel1",
Expand All @@ -1220,7 +1220,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
"subPanelOption": 1
}
},
"subPanel2": {
"y": {
"type": "fluid.prefs.subPanel2",
"enactor": {
"type": "fluid.prefs.enactor.subPanel2",
Expand Down Expand Up @@ -1250,11 +1250,11 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
"template": "%templatePrefix/combinedBoth.html",
"message": "%messagePrefix/combinedBoth.json",
"type": "fluid.prefs.panel.combinedBoth",
"panels": ["subPanel1", "subPanel2"],
"panels": ["x", "y"],
"extraOption": 1
}
},
"subPanel1": {
"x": {
"type": "fluid.prefs.subPanel1",
"enactor": {
"type": "fluid.prefs.enactor.subPanel1",
Expand All @@ -1268,7 +1268,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
"subPanelOption": 1
}
},
"subPanel2": {
"y": {
"type": "fluid.prefs.subPanel2",
"enactor": {
"type": "fluid.prefs.enactor.subPanel2",
Expand Down Expand Up @@ -1353,7 +1353,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
}
}
},
panelsToIgnore: ["subPanel1", "subPanel2"]
panelsToIgnore: ["x", "y"]
};

fluid.tests.auxSchema.expandedCompositeFull = $.extend(true, {}, fluid.tests.auxSchema.expandedComposite, {
Expand Down Expand Up @@ -1619,7 +1619,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
}
}
},
panelsToIgnore: ["subPanel1", "subPanel2", "subPanel3", "subPanel4"]
panelsToIgnore: ["x", "y", "subPanel3", "subPanel4"]
};

fluid.tests.auxSchema.multiCompositePanelSchema = $.extend(true, {}, fluid.tests.auxSchema.compositePanelSchema, fluid.tests.auxSchema.anotherCompositePanelSchema);
Expand Down

0 comments on commit 3980099

Please sign in to comment.