Skip to content

Commit

Permalink
FLUID-4907: Fixed a aux builder unit test and having primaryBuilder a…
Browse files Browse the repository at this point in the history
…s an grade of auxBuilder so the primary schema is accessible to assembling rules and getting defaults.
  • Loading branch information
cindyli committed Jul 8, 2013
1 parent 1997004 commit ddd2e11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/webapp/components/uiOptions/js/AuxBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ var fluid_1_5 = fluid_1_5 || {};
* @param {object} altSource an alternative look up object. This is primarily used for the internal recursive call.
* @return {object} an expaneded version of the schema.
*/
var expandSchemaImpl = function (schemaToExpand, altSource) {
fluid.uiOptions.expandSchemaImpl = function (schemaToExpand, altSource) {
var expandedSchema = fluid.copy(schemaToExpand);
altSource = altSource || expandedSchema;

fluid.each(expandedSchema, function (value, key) {
if (typeof value === "object") {
expandedSchema[key] = expandSchemaImpl(value, altSource);
expandedSchema[key] = fluid.uiOptions.expandSchemaImpl(value, altSource);
} else if (typeof value === "string") {
var expandedVal = fluid.uiOptions.expandSchemaValue(altSource, value);
if (expandedVal !== undefined) {
Expand All @@ -103,14 +103,14 @@ var fluid_1_5 = fluid_1_5 || {};
return expandedSchema;
};
fluid.uiOptions.expandSchema = function (schemaToExpand, enactorsIndex, panelsIndex, schema) {
var auxSchema = expandSchemaImpl(schemaToExpand);
var auxSchema = fluid.uiOptions.expandSchemaImpl(schemaToExpand);
fluid.uiOptions.expandSchemaComponents(auxSchema, "enactors", enactorsIndex, schema);
fluid.uiOptions.expandSchemaComponents(auxSchema, "panels", panelsIndex, schema);
return auxSchema;
};

fluid.defaults("fluid.uiOptions.auxBuilder", {
gradeNames: ["fluid.littleComponent", "autoInit"],
gradeNames: ["fluid.uiOptions.primaryBuilder", "autoInit"],
auxiliarySchema: {},
enactorsIndex: {
expander: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<script type="text/javascript" src="../../../../components/uiOptions/js/Enactors.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/TextfieldSlider.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/Panels.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/PrimaryBuilder.js"></script>

<script type="text/javascript" src="../../../../components/uiOptions/schema/AuxiliarySchema.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/AuxBuilder.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
}
},
"enactors": [{
"type": "fluid.uiOptions.enactors.lineSpacing",
"type": "fluid.uiOptions.enactors.lineSpace",
"fontSizeMap": {
"xx-small": "9px",
"x-small": "11px",
Expand Down Expand Up @@ -173,7 +173,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
*******************************************************************************/

fluid.tests.testSchemaExpander = function (schema, expectedOutput) {
var output = fluid.uiOptions.expandSchema(schema);
var output = fluid.uiOptions.expandSchemaImpl(schema);
jqUnit.assertDeepEq("The source schema is expanded correctly", expectedOutput, output);
};

Expand Down

0 comments on commit ddd2e11

Please sign in to comment.