Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLUID-6148: Implement "potentia II" constituting aligned, transactional records of author's creational intent #824

Open
wants to merge 53 commits into
base: master
from
Open
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d412600
FLUID-6148: First "smoke test ready" version which passes linting and…
amb26 Mar 28, 2017
b6db163
FLUID-6148: Fully repaired all existing FluidIoC.js tests with the ex…
amb26 Apr 1, 2017
52e16b3
Merge branch 'master' into FLUID-6148
amb26 Oct 21, 2017
e2b656d
Merge branch 'FLUID-6234' into FLUID-6148
amb26 Jan 11, 2018
b5f647d
FLUID-6148: All tests repaired except for FLUID-5869 self-reaction
amb26 Jan 16, 2018
d9b90e5
FLUID-6148: ViewComponent and some prefs editor tests fixed - next st…
amb26 Jan 22, 2018
914a8c0
FLUID-6148: All existing test cases repaired!
amb26 Jan 30, 2018
2107aa9
FLUID-6148: Tidy-up following self-review, and first dedicated test -…
amb26 Jan 30, 2018
fbf812a
Merge branch 'master' into FLUID-6148
amb26 Mar 2, 2018
5b0d27f
FLUID-6148: Updating to contemporary gpii-testem
amb26 Mar 5, 2018
e4fb347
FLUID-6148: Further update to gpii-testem
amb26 Mar 5, 2018
dab4fb5
FLUID-6148: Restore fluid.pushSoftFailure until we can push kettle up…
amb26 Mar 6, 2018
8557277
Merge branch 'master' into FLUID-6148
amb26 Mar 14, 2018
cbbbc0a
Reverting file permissions
amb26 Mar 14, 2018
ad2d83f
Reverting to trunk's version of testem
amb26 Mar 14, 2018
5711a24
FLUID-6148: Updated to dev version of gpii-testem which uses portable…
amb26 Mar 19, 2018
217fe8d
Reverted file permissions
amb26 Mar 19, 2018
59e9500
FLUID-6184: Updated to "pure JS" version of gpii-testem
amb26 Mar 20, 2018
2d6ffd0
FLUID-6148: "Ponyfill" for Number.isInteger whilst we still support IE11
amb26 Mar 22, 2018
0d27fab
Merge branch 'master' into FLUID-6148
amb26 Mar 22, 2018
9009646
FLUID-6148: Beginning to rationalise JSDocs
amb26 Mar 23, 2018
253cf6d
Merged up with JSDocs branch, further additions of documentation
amb26 Mar 29, 2018
e8d080a
FLUID-6148: Adding package-lock.json back in
amb26 Mar 29, 2018
450e80e
FLUID-6148: Implemented PARTIAL EVALUATION
amb26 Mar 30, 2018
6d119a7
FLUID-6148: Test and fix for atomicity of component construction in t…
amb26 Apr 17, 2018
ba5376f
FLUID-6148: Added include to FLUIDIoCStandalone-test.html
amb26 Apr 17, 2018
9fe840e
FLUID-5614: Incomplete work implementing "double deep trees"
amb26 Jun 9, 2018
c362282
FLUID-5614: Fully working version of potentia II with fix for FLUID-5…
amb26 Sep 20, 2018
c61c3f9
FLUID-6148: Improvements following review
amb26 Sep 20, 2018
03298a0
Merge branch 'master' into FLUID-6148
amb26 Sep 21, 2018
cdfa92f
Merge branch 'FLUID-5633-returns' into FLUID-6148
amb26 Sep 21, 2018
de8b044
Merge branch 'master' into FLUID-6148
amb26 Sep 21, 2018
b62e8f9
FLUID-6148: Cleaning up copyright declarations
amb26 Sep 21, 2018
60f15ce
FLUID-6148: Test case and fix for out-of-order injection issue found …
amb26 Oct 9, 2018
aeaa6e3
FLUID-6148: Added further circularity test
amb26 Oct 10, 2018
c85a18e
FLUID-6148: Fixes following "cancellation of mixed creation and destr…
amb26 Oct 11, 2018
1a3acfd
Merge branch 'master' into FLUID-6148
amb26 Oct 18, 2018
7cbe00b
FLUID-6148: Merged up with master and improved fluid.loadInContext
amb26 Oct 18, 2018
7a50e38
FLUID-6347: Corrected misspelled grade name
amb26 Oct 18, 2018
44387c4
FLUID-6148: Framework diagnostic when constructing component with no …
amb26 Oct 18, 2018
03a21f6
FLUID-5668: Improve mergePolicies to be able to act at least at the t…
amb26 Nov 2, 2018
b94a23d
FLUID-4982: Preparing work by deleting caching implementation from fl…
amb26 Dec 7, 2018
6d9a793
FLUID-6148: Corrected number of assertions
amb26 Dec 7, 2018
b7b4c2b
Merge branch 'master' into FLUID-6148
amb26 Dec 7, 2018
fe70a1e
FLUID-4982: Normalised "href" to "url" for all resourceSpecs, general…
amb26 Dec 8, 2018
07e468b
FLUID-6148: Stabilised test cases once more after rewrite of fluid.fe…
amb26 Dec 20, 2018
e8bc473
FLUID-4982: Fully working tests with basic support for **ASSYNCCHROUW…
amb26 Jan 29, 2019
67b527e
FLUID-4982: Removed jQuery AJAX in favour of XHR, removed mockjax in …
amb26 Feb 5, 2019
f249e03
FLUID-4982: Valid construction of asynchronous free components with o…
amb26 Feb 6, 2019
9bf518e
FLUID-6148: Added wait for failed component
amb26 Feb 12, 2019
7d55211
FLUID-4982: Stabilised framework again after abolishing FluidRequests…
amb26 Mar 23, 2019
8bc4247
FLUID-6371: Fix and test cases for memory leak with dynamic components
amb26 Mar 23, 2019
90cc3a9
Merge branch 'FLUID-6371' into FLUID-6148
amb26 Mar 24, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+175 −226
Diff settings

Always

Just for now

FLUID-6148: ViewComponent and some prefs editor tests fixed - next st…

…ep is rendererComponent
  • Loading branch information...
amb26 committed Jan 22, 2018
commit d9b90e50bf4842108f5dc81bbd94b179bf076c06
@@ -2657,9 +2657,9 @@ var fluid = fluid || fluid_3_0_0;
var transactionId = fluid.registerPotentia(potentia);
if (!fluid.globalInstantiator.currentTreeTransaction) {
// TODO: In future, we may like to go as far as operateCreatePotentia and return a shell instead of nothing
var shadows = fluid.commitPotentiae(transactionId);
var shadow = fluid.commitPotentiae(transactionId);
// Use this strange style to make sure we return a self-destructed component for FLUID-5333
return shadows[shadows.length - 1].that;
return shadow.that;
}
};

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -22,12 +22,12 @@ var fluid_3_0_0 = fluid_3_0_0 || {};

fluid.defaults("fluid.viewComponent", {
gradeNames: ["fluid.modelComponent"],
initFunction: "fluid.initView",
argumentMap: {
container: 0,
options: 1
},
members: { // Used to allow early access to DOM binder via IoC, but to also avoid triggering evaluation of selectors
members: {
container: "@expand:fluid.containerForViewComponent({that}, {that}.options.container)",
dom: "@expand:fluid.initDomBinder({that}, {that}.options.selectors)"
}
});
@@ -98,8 +98,10 @@ var fluid_3_0_0 = fluid_3_0_0 || {};
containerSpec = container.selector;
}
var count = container.length !== undefined ? container.length : 0;
var extraMessage = container.selectorName ? " with selector name " + container.selectorName +
" in context " + fluid.dumpEl(containerSpec.context) : "";
fluid.fail((count > 1 ? "More than one (" + count + ") container elements were"
: "No container element was") + " found for selector " + containerSpec);
: "No container element was") + " found for selector " + containerSpec + extraMessage );
}
if (!fluid.isDOMNode(container[0])) {
fluid.fail("fluid.container was supplied a non-jQueryable element");
@@ -210,45 +212,11 @@ var fluid_3_0_0 = fluid_3_0_0 || {};
}
};

/**
* The central initialiation method called as the first act of every Fluid
* component. This function automatically merges user options with defaults,
* attaches a DOM Binder to the instance, and configures events.
*
* @param {String} componentName The unique "name" of the component, which will be used
* to fetch the default options from store. By recommendation, this should be the global
* name of the component's creator function.
* @param {jQueryable} container A specifier for the single root "container node" in the
* DOM which will house all the markup for this component.
* @param {Object} userOptions The configuration options for this component.
*/
// 4th argument is NOT SUPPORTED, see comments for initLittleComponent
fluid.initView = function (componentName, containerSpec, userOptions, localOptions) {
var container = fluid.container(containerSpec, true);
fluid.expectFilledSelector(container, "Error instantiating component with name \"" + componentName);
if (!container) {
return null;
}
// Need to ensure container is set early, without relying on an IoC mechanism - rethink this with asynchrony
var receiver = function (that) {
that.container = container;
};
// THIS is the only point localOptions was used - now trashed
var that = fluid.initLittleComponent(componentName, userOptions, localOptions || {gradeNames: ["fluid.viewComponent"]}, receiver);

if (!that.dom) {
fluid.initDomBinder(that);
}
// TODO: cannot afford a mutable container - put this into proper workflow
var userJQuery = that.options.jQuery; // Do it a second time to correct for jQuery injection
// if (userJQuery) {
// container = fluid.container(containerSpec, true, userJQuery);
// }
fluid.log("Constructing view component " + componentName + " with container " + container.constructor.expando +
(userJQuery ? " user jQuery " + userJQuery.expando : "") + " env: " + $.expando);

return that;
};
fluid.containerForViewComponent = function (that, containerSpec) {
var container = fluid.container(containerSpec);
fluid.expectFilledSelector(container, "Error instantiating viewComponent at path \"" + fluid.pathForComponent(that));
return container;
}

/**
* Creates a new DOM Binder instance for the specified component and mixes it in.
@@ -119,7 +119,7 @@ var fluid_3_0_0 = fluid_3_0_0 || {};
prefsEditorLoader: {
type: "fluid.viewComponent",
container: "{fluid.prefs.assembler.prefsEd}.container",
priority: "last",
// priority: "last",
options: {
gradeNames: [
"{fluid.prefs.assembler.prefsEd}.options.componentGrades.terms",
@@ -26,7 +26,6 @@ var fluid_3_0_0 = fluid_3_0_0 || {};
outerUiEnhancerGrades: "{originalEnhancerOptions}.uiEnhancer.options.userGrades",
components: {
prefsEditor: {
container: "{that}.container",
options: {
components: {
preview: {
@@ -41,7 +41,7 @@ var fluid_3_0_0 = fluid_3_0_0 || {};
},
components: {
prefsEditor: {
priority: "last",
// priority: "last",
type: "fluid.prefs.prefsEditor",
createOnEvent: "onCreatePrefsEditorReady",
options: {
@@ -4415,9 +4415,11 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
jqUnit.test("FLUID-5333 - destruction during listener notification", function () {
var that = fluid.tests.fluid5333component();
jqUnit.assertEquals("Component should be returned in destroyed condition", true, fluid.isDestroyed(that));
jqUnit.assertUndefined("Listeners after destruction point should not be notified", that.noted);
// Note: Change in behaviour after FLUID-6148: Component tree modification is now out of step with onCreate
jqUnit.assertTrue("Listeners after destruction point should be notified", that.noted);
delete that.noted;
that.events.ourEvent.fire(that);
jqUnit.assertUndefined("Listeners after destruction point should not be notified", that.noted);
jqUnit.assertUndefined("Listeners after destruction should not be notified", that.noted);
});

/*** FLUID-5266 diagnostic when accessing createOnEvent component before construction ***/
@@ -16,120 +16,26 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt

fluid.setLogging(true);

/**
* Deferred expander tests (these are in "view" tests since they require a working $.ajax)
*/
jqUnit.asyncTest("Basic fetch tests", function () {

var buildUrl = function (recordType) {
return "../data/" + recordType + ".json";
};

var makeArrayExpander = function (recordType) {
return fluid.expander.makeFetchExpander({
url: buildUrl(recordType),
disposer: function (model) {
return {
items: model,
selectionIndex: -1
};
},
options: {
async: false
},
fetchKey: recordType
});
};

jqUnit.asyncTest("Deferred expander Tests", function () {
var pageBuilder = {
uispec: {
objects: "These Objects",
proceduresIntake: "Are Intake"
}
};

var dependencies = {
objects: {
funcName: "cspace.recordList",
args: [".object-records-group",
makeArrayExpander("objects"),
"{pageBuilder}.uispec.objects",
"stringOptions"]
},
proceduresIntake: {
funcName: "cspace.recordList",
args: [
".intake-records-group",
makeArrayExpander("intake"),
"{pageBuilder}.uispec.proceduresIntake",
"stringOptions"
]
}
};

var resourceSpecs = {};

var expanded;

fluid.withEnvironment({
resourceSpecCollector: resourceSpecs,
pageBuilder: pageBuilder
}, function () {
expanded = fluid.expand(dependencies, {fetcher: fluid.makeEnvironmentFetcher()});
});

var func = function () {}; // dummy function to compare equality

var requiredSpecs = {
var resourceSpecs = {
objects: {
href: "../data/objects.json",
options: {
dataType: "text",
success: func,
error: func,
async: false
}
},
intake: {
href: "../data/intake.json",
options: {
dataType: "text",
success: func,
error: func,
async: false
}
}
};

jqUnit.assertCanoniseEqual("Accumulated resourceSpecs", requiredSpecs, resourceSpecs, jqUnit.canonicaliseFunctions);

var expectedRes = {
objects: {
funcName: "cspace.recordList",
args: [".object-records-group",
{items: [1, 2, 3],
selectionIndex: -1},
"These Objects",
"stringOptions"]
},
proceduresIntake: {
funcName: "cspace.recordList",
args: [
".intake-records-group",
{
items: [4, 5, 6],
selectionIndex: -1
},
"Are Intake",
"stringOptions"
]
}
};

fluid.fetchResources(resourceSpecs, function () {
jqUnit.assertUndefined("No fetch error", resourceSpecs.objects.fetchError);
jqUnit.assertValue("Request completed", resourceSpecs.objects.completeTime);
jqUnit.assertDeepEq("Resolved model", expectedRes, expanded);
jqUnit.start();
});
});
@@ -178,9 +178,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
});

jqUnit.test("FLUID-5277: Improve the error message when an nonexistent container is provided for fluid.viewComponent and fluid.rendererComponent", function () {
jqUnit.expectFrameworkDiagnostic("Nonexist container for relay component", function () {
jqUnit.expectFrameworkDiagnostic("Nonexistent container", function () {
fluid.tests.fluid5277("#nonexistent-container");
}, "did not match any markup");
}, ["No container element was found", "#nonexistent-container"]);
});

fluid.defaults("fluid.tests.testGradedView", {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.