Skip to content

Commit

Permalink
Merge remote-tracking branch 'antranig/FLUID-6192'
Browse files Browse the repository at this point in the history
* antranig/FLUID-6192:
  FLUID-6192: Updating copyright years following review
  FLUID-6192: Support modelRelay rule with source of ""
  • Loading branch information
cindyli committed Sep 20, 2017
2 parents 1fe9140 + 2d2d986 commit 3be1824
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/framework/core/js/DataBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright 2008-2009 University of Toronto
Copyright 2010-2011 Lucendo Development Ltd.
Copyright 2010-2014 OCAD University
Copyright 2012-2014 Raising the Floor - US
Copyright 2014-2016 Raising the Floor - International
Copyright 2014-2017 Raising the Floor - International
Licensed under the Educational Community License (ECL), Version 2.0 or the New
BSD license. You may not use this file except in compliance with one these
Expand Down Expand Up @@ -772,7 +772,7 @@ var fluid_3_0_0 = fluid_3_0_0 || {};
};

fluid.parseModelRelay = function (that, mrrec, key) {
var parsedSource = mrrec.source ? fluid.parseValidModelReference(that, "modelRelay record member \"source\"", mrrec.source) :
var parsedSource = mrrec.source !== undefined ? fluid.parseValidModelReference(that, "modelRelay record member \"source\"", mrrec.source) :
{path: null, modelSegs: null};
var parsedTarget = fluid.parseValidModelReference(that, "modelRelay record member \"target\"", mrrec.target);
var namespace = mrrec.namespace || key;
Expand Down
28 changes: 27 additions & 1 deletion tests/framework-tests/core/js/DataBindingTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright 2008-2009 University of Toronto
Copyright 2010-2011 Lucendo Development Ltd.
Copyright 2012-2014 Raising the Floor - US
Copyright 2014 OCAD University
Copyright 2015-2016 Raising the Floor - International
Copyright 2015-2017 Raising the Floor - International
Licensed under the Educational Community License (ECL), Version 2.0 or the New
BSD license. You may not use this file except in compliance with one these
Expand Down Expand Up @@ -1273,6 +1273,32 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
}, "source");
});

/** FLUID-6192: Model relay with source of "" **/

fluid.defaults("fluid.tests.fluid6192root", {
gradeNames: "fluid.modelComponent",
modelRelay: {
source: "",
target: "{that}.relayTarget.model",
singleTransform: {
type: "fluid.transforms.identity"
}
},
components: {
relayTarget: {
type: "fluid.modelComponent"
}
}
});

jqUnit.test("FLUID-6192: Model relay with source of \"\"", function () {
var root = fluid.tests.fluid6192root();
root.applier.change("key", "value");
jqUnit.assertDeepEq("Model relay successfully established", {
key: "value"
}, root.relayTarget.model);
});

/** FLUID-6191: Proper diagnostic on indirect model reference which fails to resolve **/

fluid.defaults("fluid.tests.fluid6191root1", {
Expand Down

0 comments on commit 3be1824

Please sign in to comment.