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

Add event listener evolution to new standard supporting options object as third argument #2030

Open
wants to merge 415 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
415 commits
Select commit Hold shift + click to select a range
3268e38
Make inDocument a public API
marchant Apr 17, 2020
a7a6ee7
add files entry to make inlined projects accessible to other projects
marchant Apr 17, 2020
34370f9
trying to fix package.json for sub folders-projects
marchant Apr 17, 2020
cd98774
trying pre-install on mr
marchant Apr 17, 2020
116b94a
tweak to fix install issues
marchant Apr 17, 2020
38feeb3
remove require of collections, mr, frb, promise-io, as separate packages
marchant Apr 18, 2020
3883a87
fix time zones compilation and registration and a dependency issue
marchant Apr 18, 2020
aa003b5
fix for inDocument made public
marchant Apr 18, 2020
e559e27
Fix a bug when a package name ends in .js
marchant Apr 18, 2020
e75a77d
fix dependency refactor
marchant Apr 18, 2020
d8c4c81
Fix load of require/browser so it works ins .info
marchant Apr 24, 2020
dcafbb2
- fix bug in handling of browser field in package.json
marchant Jun 4, 2020
43b1f26
updates dependencies style
marchant Jun 4, 2020
905391a
add randomItem method
marchant Jul 2, 2020
6923efc
optimize a for in loop
marchant Jul 2, 2020
118be4f
- optimize a for in loop
marchant Jul 2, 2020
9bb2908
improve deserialization's handling of sync or async deserializer
marchant Jul 2, 2020
71a5749
fix collection dependency
marchant Jul 2, 2020
cf21d9c
add nextTarget property
marchant Jul 10, 2020
7cbb334
tweaks require
marchant Jul 10, 2020
2e57b1b
add default zoned-compiled.json
marchant Jul 10, 2020
f5caee6
add logic to compile time zones to runtime desired format
marchant Jul 10, 2020
8b20275
move locale to core
marchant Jul 10, 2020
292eafd
add properties matching standard get... methods
marchant Jul 10, 2020
82e6c31
latest iteration on Calendar/CalendarDate/TimeZone
marchant Jul 10, 2020
5eb42df
relocated stringByRemoving... methods
marchant Jul 10, 2020
86af0d3
- Add descendantDescriptors
marchant Jul 10, 2020
7cab4dd
- Fix isDerived to depend on definition
marchant Jul 10, 2020
e42443a
- comment for future iteration
marchant Jul 10, 2020
00819bd
Brings in q-io as promise-io
marchant Jul 10, 2020
b1ef979
- brings mr in plus some tweaks/fixes.
marchant Jul 10, 2020
0e195ab
bluebird-based q implementation for promise-q
marchant Jul 10, 2020
21ef443
- performance optimization
marchant Jul 10, 2020
f225a14
fix require
marchant Jul 10, 2020
d258943
- brings frb in
marchant Jul 10, 2020
cbf6452
add serializationl/deserialization
marchant Jul 10, 2020
be36350
- cleanup object->map internal implementation
marchant Jul 10, 2020
7414d78
add locale object descriptor
marchant Jul 10, 2020
c8b298b
add ModuleReference object descriptor
marchant Jul 10, 2020
12d9a65
add length property
marchant Jul 10, 2020
d90accf
refactor
marchant Jul 10, 2020
a6b9072
- rename prefetchExpression readExpression
marchant Jul 10, 2020
efa24b5
- remove de/serialization of "objectExpressions" property
marchant Jul 10, 2020
2a942dd
rename mappingWithType to mappingForType
marchant Jul 10, 2020
5cafe9a
add on DataStream's data array an objectDescriptor property with a va…
marchant Jul 10, 2020
a473e0e
avoid creating a trigger's setter for a read only property
marchant Jul 10, 2020
dd871a6
add abilty to specify a rawDataTypeName and delegate to the service …
marchant Jul 10, 2020
29b3812
uopdate to follow some API changes
marchant Jul 10, 2020
4059c1a
adapt to mappingWithType -> mappingForType
marchant Jul 10, 2020
779db76
text formatting cleanup
marchant Jul 10, 2020
f5c1d4f
Fix frb require
marchant Jul 10, 2020
e0ad035
remove q-bluebird dependency
marchant Jul 16, 2020
f8480ed
cache regex
marchant Jul 16, 2020
472a073
- fix a bug
marchant Jul 16, 2020
4be0a29
remove "export" from comments
marchant Jul 16, 2020
9e385c4
- fix dependencies
marchant Jul 16, 2020
2b3e3e4
- fix bug in Locale
marchant Jul 16, 2020
0ebf089
- add updated cached localizablePropertyDescriptors
marchant Jul 16, 2020
1152ed3
add userLocale & userLocaleCriteria properties
marchant Jul 16, 2020
2718d36
starting point of data-aware component super classes
marchant Jul 16, 2020
6c06672
Misc optimizations
marchant Jul 16, 2020
4bdde09
update frb dependency
marchant Jul 17, 2020
8a78ccc
add comments about a potential optimization avoiding a dual draw but …
marchant Jul 17, 2020
c0b91bc
Fix a spec regression
marchant Jul 17, 2020
afeab5a
Fix regression when evolving object to map
marchant Jul 18, 2020
c0a34cb
remove a filter() to improve performance
marchant Jul 19, 2020
638b124
replace a for in with .hasOwnProperty() by a for() on Object.keys()
marchant Jul 19, 2020
eb69ffc
- replace a for in by for on Object.keys()
marchant Jul 19, 2020
3fe38f4
replace a for in with hasOwnProperty by a for() on Object.keys()
marchant Jul 19, 2020
b6fceb8
add validity object to all-purpose Mock DOM element
marchant Jul 19, 2020
9f2542b
replace ._inDocument by .inDocument
marchant Jul 19, 2020
c17b748
fix missing backward compatibility setter for _inDocument
marchant Jul 19, 2020
0ccef43
add string-to-URL-converter
marchant Jul 20, 2020
bfc4207
changes bootstrapping bluebird location
marchant Jul 20, 2020
85aa7cc
- tenporarily bypassing authentication
marchant Jul 20, 2020
de59a67
activate back auth
marchant Jul 20, 2020
be48609
- fix content loss when exiting document. Will need to review later
marchant Jul 20, 2020
393877e
pass context to custom list item
marchant Jul 20, 2020
90ccae4
update dependency
marchant Jul 23, 2020
ba2e7c3
Fix bluebird location for apps and montage testing
marchant Jul 23, 2020
5e8aea0
avoid CustomEvent instanciation when using MutableEvent.fromType()
marchant Jul 23, 2020
6f0b8d3
Remove log
marchant Jul 25, 2020
0538c38
Adds a test with parameter $ by itself
marchant Jul 30, 2020
3ca2db7
avoid creating an extra criteria if this.foreignDescriptorMappings is…
marchant Jul 30, 2020
676f9a7
fix exception in node
marchant Aug 2, 2020
76c9234
fix formatting
marchant Aug 2, 2020
c3b7490
change localizablePropertyDescriptors to be a Set and not an Array
marchant Aug 2, 2020
c15c801
- change userLocale to userLocales
marchant Aug 2, 2020
974ebd7
- improve combining criteria by handling reconciliation of parameters
marchant Aug 2, 2020
1372c67
Fix collections jasmine tests
marchant Sep 15, 2020
d843310
- add first equals() implementation - not super tested
marchant Sep 22, 2020
25c3ef6
- improve support for template to load script tags in their template
marchant Sep 22, 2020
abb7192
fix bug in _buildLanguageRegion
marchant Sep 22, 2020
3141902
add singletons for Promise resolve of null, undefined, true and falde
marchant Sep 22, 2020
4a76e36
add fullDayTimeRangeFromDate class method
marchant Sep 22, 2020
1a6d04e
add join method to Set, similar to Array's one
marchant Sep 22, 2020
1cd51ab
add inversePropertyDescriptor method
marchant Sep 22, 2020
8f8a2f1
override mime type to javascript only if file extension is js, needed…
marchant Sep 22, 2020
ca5b86a
add first implementation of equals() method
marchant Sep 22, 2020
5be7a9c
- fix mising ;
marchant Sep 22, 2020
9a77df1
- add automatic propagation of value to inverse properties
marchant Sep 22, 2020
cc9515b
hmm, this one needs another look
marchant Sep 22, 2020
c575846
change last display separator before id from $=# to /
marchant Sep 22, 2020
d64ffca
overrides contains to make it work with both a single value, which it…
marchant Sep 23, 2020
2efda1c
fix contains bug when argument is another range
marchant Sep 28, 2020
b20bb87
rename path(someExpression) to evaluate(someExpression) while maintai…
marchant Sep 28, 2020
cac72a0
avoid fetching if we don't have a valid query
marchant Oct 5, 2020
809fe22
Fix bug to mirror the same done on collections project master
marchant Oct 5, 2020
fbef8d4
delay re-setting equal until we need it
marchant Oct 5, 2020
a4cfd80
fix bugs, improvements on calendar date, date, timezone
marchant Oct 5, 2020
e92f2f3
Fix bug for when converting using foreign descriptor raw data type ma…
marchant Oct 5, 2020
195b47f
avoid creating an ampty array when accessing Dataquery.orderings
marchant Oct 5, 2020
6492c45
- record object snapshot after first mapping to allow mapping to know…
marchant Oct 5, 2020
605277c
remove redundant registration
marchant Oct 5, 2020
71d71c4
cache systemTimeZone
marchant Oct 6, 2020
5248c76
Add new Date formatter using Intl.DateTimeFormat()
marchant Oct 6, 2020
2c99ed7
fix typo
marchant Oct 6, 2020
f2c3fb1
Fix a bug preventing the use of a converter in a binding in a values…
marchant Oct 6, 2020
2521ce1
- add support for fetchLimit on query
marchant Oct 6, 2020
cc2f164
quick-fix / WIP to better handle triggers on propertyDescriptors that…
marchant Oct 6, 2020
ee35557
remove weak-map polyfill
marchant Oct 6, 2020
c0f05e4
Fix minimal regression in Flow
Oct 7, 2020
197fab1
Fix regression in Flow not adding iterations
Oct 7, 2020
6958f4b
Merge pull request #4 from romancortes/experimental-variable-size-flow
marchant Oct 8, 2020
8e9944c
Push ExpressionDataMapping's service to the converters/reverters of i…
marchant Oct 8, 2020
2507f7c
Improvements to reduce DB access:
marchant Oct 8, 2020
95a9ced
Remove polyfills for ES5 Map and Set
marchant Oct 9, 2020
77c2831
update to additionally save each time zone in it's own file
marchant Oct 9, 2020
bb38375
add a way to call a data object property getter and pass an argument…
marchant Oct 9, 2020
b53c276
fix a regression caused by lookup of objects in memory that wasn't re…
marchant Oct 9, 2020
15d7cd5
take .vscode files
marchant Oct 15, 2020
2298872
remove specific node version
marchant Oct 15, 2020
02a7d72
- test to see if it's worth loading ical.js project files individuall…
marchant Oct 15, 2020
0e5d469
log a notoe about a bug found that will need to be fixed
marchant Oct 15, 2020
b784c96
avoid exception if deserialize is called when there's no string or an…
marchant Oct 15, 2020
e1a055b
add ability to use dataService's connection identifier property on to…
marchant Oct 15, 2020
8096e79
workaround bug caused by cyclic dependency
marchant Oct 15, 2020
8aa04d3
- add merge operation type to define a new kind of operation that is …
marchant Oct 15, 2020
89a77aa
add ability for DataService to use ObjectDescriptors as types on top …
marchant Oct 15, 2020
eb6fb78
Fix typo
marchant Oct 16, 2020
5854476
update Buffer API to newer node standards
marchant Oct 16, 2020
b7afd18
fix regression
marchant Oct 16, 2020
3354db4
change to support ws, WebSocket implementation in node.js that doesn'…
marchant Oct 21, 2020
94d54f8
- fix enumerability of methods added to prototype
marchant Oct 21, 2020
f4a4411
Fix nextTarget bug
marchant Oct 21, 2020
b76e568
fix serialization so it uses an object's constructor when serialized …
marchant Oct 21, 2020
82f0c04
- update operation type case
marchant Oct 21, 2020
f409a95
improve support for connectionDescriptor/connection/connectionIdentifier
marchant Oct 21, 2020
8fb08db
- fix bug in setting up child services if an object is deserialized m…
marchant Oct 21, 2020
279d715
optimizing for null/undefined
marchant Nov 13, 2020
7104647
- fix bugs related to isObjectCreated and child services
marchant Nov 14, 2020
1a61117
fix bug about isObjectCreated
marchant Nov 14, 2020
e44d665
add notion of stage where an app is running to support different deve…
marchant Dec 16, 2020
0fe63e0
add try/catch around deserialization to help with diagnostics
marchant Dec 16, 2020
2576c24
add argument to jshint to support ES6
marchant Dec 16, 2020
f7cef7d
- remove eventManager property as it's already in super type target
marchant Dec 17, 2020
eb47354
testing giving more control to object defining bindings
marchant Dec 17, 2020
42883c5
WIP - needs testing
marchant Dec 17, 2020
b9ad9af
- add predicateFunction property that enables the use of a criteria i…
marchant Dec 17, 2020
fbd7983
- add the ability to use "global" as a module and use global types li…
marchant Dec 17, 2020
deb8282
Fix bug where members wouldn't actually be built
marchant Dec 17, 2020
b33b3db
WIP: add missing options argument in initWithIdentifier and serialize…
marchant Dec 17, 2020
f5b1537
make Promise.is more robust by adding catch() to the list of checks,…
marchant Dec 17, 2020
3144330
- update deprecated findLast->findLastValue and find->findValue
marchant Dec 17, 2020
5934e83
fix bugs
marchant Dec 17, 2020
6db60e5
expose eventManager property
marchant Dec 17, 2020
bb40fdc
add support to resolving relative URL in object tag's data attribute …
marchant Dec 17, 2020
b94930e
fix docs and a bug
marchant Dec 17, 2020
1fcf646
- add a property to converter to assess wether they can convert an ob…
marchant Dec 17, 2020
fbe803f
add converter that can convert an object with keys and values propert…
marchant Dec 17, 2020
8f7bdb6
WIP: converter to convert each value of an array using map, more meth…
marchant Dec 17, 2020
55361ea
change to help environment acces current application
marchant Dec 17, 2020
a4389f1
add methods and fix a bug
marchant Dec 17, 2020
33082b9
make code more robust to avoid duplicate values in result array
marchant Dec 17, 2020
8997ce0
add property to help iterate propertyDescriptor names
marchant Dec 17, 2020
dd3f43e
add ability to have a property that has a Map type
marchant Dec 17, 2020
73427a8
fix a bug and avoid swallowing an exception
marchant Dec 17, 2020
d7f9a1d
wip - refactor
marchant Dec 17, 2020
4c50aee
improve foreignDescriptor setter
marchant Dec 17, 2020
16250c6
improve deserialization of target property
marchant Dec 17, 2020
47f502d
- fix bug in mappingForType when called on rootService
marchant Dec 17, 2020
2b6dd92
- performance improvements by adding cache
marchant Dec 17, 2020
d6ecd8c
Fix console.error
marchant Dec 17, 2020
746e360
need more baking, refactor of requirements using "core/frb/syntax-pro…
marchant Dec 17, 2020
24b4ac4
add a method to know the property used by a RawDataTypeMapping to set…
marchant Dec 17, 2020
e04dc0f
- add support to have a propertyDescriptor to describe primaryKeys, s…
marchant Dec 17, 2020
0766e28
- initial support for layout properties
marchant Dec 17, 2020
e616a90
First iteration to make DataEditor able to orchestrate that all data …
marchant Dec 17, 2020
f4402cc
fix bug and inline use of css visibility property that prevents furth…
marchant Dec 17, 2020
db23c90
fix to work with component that also overrides makePropertyObservable…
marchant Dec 17, 2020
d79ae8b
- add currentEnvironment property on DataService
marchant Dec 18, 2020
dbf52df
Fix a regression in node
marchant Dec 18, 2020
21722c2
Fix potential exception
marchant Dec 18, 2020
eb73b1f
- fix exception in tests in raw-foreign-value-to-object-converter.js
marchant Dec 19, 2020
58f5c1c
add bluebird injection to prevent double load of bluebird on node.js
marchant Dec 19, 2020
83ee373
Fix regression caused by typo/missing end of a property access
marchant Dec 20, 2020
19b9d2c
avoid to add undefined entries to rawDataSnapshot
marchant Dec 20, 2020
62c58f0
fix missing returned promise
marchant Dec 20, 2020
2954b4e
fix bug that had the wrong mainService being used
marchant Dec 23, 2020
ee19f70
add note
marchant Dec 23, 2020
d2be296
- fix a bug where an overriden property without a manually correspond…
marchant Dec 30, 2020
8a67792
add qualifiedProperties that returns all properties used in the crite…
marchant Dec 30, 2020
e66e834
update node version for running tests
marchant Dec 31, 2020
7f0b8bd
add check to catch that an "addedValue" would be set on an array, int…
marchant Dec 31, 2020
c5cd145
change to stop using the presence of a snapshot to avoid infinite loo…
marchant Dec 31, 2020
6ebb39f
so far, while dataTrigger calls fetchObjectProperty, exisiting implem…
marchant Dec 31, 2020
6b3dc6a
fix bugs in mapping added/removed values
marchant Dec 31, 2020
8f54bd7
- add performTransactionProgress
marchant Jan 3, 2021
a16a7b1
- remove serialization of clientId
marchant Jan 4, 2021
d2b3da4
add saveChangesProgress type
marchant Jan 4, 2021
1de1634
remove debug log
marchant Jan 6, 2021
4e37f34
add stringByDeletingLastPathComponent method
marchant Jan 6, 2021
a9ab15a
- add hasSnapshot... methods to assess if there's one instead of doin…
marchant Jan 7, 2021
db24ea4
use new hasSnapshotForObject
marchant Jan 7, 2021
e2f5de7
add comments and notes on changes to make to fix an issue that happen…
marchant Jan 7, 2021
8b1bb31
fix code format
marchant Jan 7, 2021
6493934
Fix an exception when value to convert is null
marchant Jan 8, 2021
1320cb3
- change mapping logic to map all properties in the raw data returned…
marchant Jan 8, 2021
26cedf7
fix a bug in how dtataoperation target is deserialized
marchant Jan 12, 2021
4b99112
Fix a bug from transition from Object internal structure to Map and a…
marchant Jan 12, 2021
d8fec63
tweak to engage the use of dataLoaded field in the canDrawGate only i…
marchant Jan 12, 2021
6f34bc8
Fix syntax error
marchant Jan 15, 2021
171cc98
WIP start renaming "path" methods to "expression" and depprecate as w…
marchant Jan 26, 2021
b3fe0e5
add ability to mutate a criteria's expression and streamlines reset s…
marchant Jan 26, 2021
a521793
remove one variable declaration not needed
marchant Jan 26, 2021
7df157d
add the definitionSyntax on propertyDescriptor to cache and minimize …
marchant Jan 26, 2021
303c51b
check and add ability to add raw primary key/values to fetched rawDat…
marchant Jan 27, 2021
290b86a
wip: first operation related utility method
marchant Jan 27, 2021
b376514
- add method to assess if DataService handles a type/ObjectDescriptor
marchant Jan 27, 2021
6cdeaf6
Fix flatten bug if receiver is already flat
marchant Jan 27, 2021
72adecf
add new syntax iterators inspired from binary trees and using generat…
marchant Jan 27, 2021
1de2b3a
change to minimize Promise creation
marchant Feb 2, 2021
8feeed6
fix a bug
marchant Feb 5, 2021
86bd607
add support for locales on operations
marchant Feb 5, 2021
5bc9a76
fix a bug using superForSet/superForGet/superForValue
marchant Feb 5, 2021
cfdccec
Fix a bug in node due to files loading each other
marchant Feb 5, 2021
403d7f1
add suffix to most types of DataOperations to set them apart from sim…
marchant Feb 9, 2021
ed9b98c
add visibilitychange event definition
marchant Feb 9, 2021
70d2abe
Fix log
marchant Feb 9, 2021
3ded174
add function name
marchant Feb 9, 2021
426d67d
WIP Iteration on DataEditor regarding coordination of data loaded bef…
marchant Feb 15, 2021
5f6c6a7
Fix a bug in handleOrganizedContentRangeChange
marchant Nov 26, 2019
9282328
fix deprecation warnings from methods in collection's array additions
marchant Mar 26, 2020
fda51a3
First implematatio passing specs of support for options object in add…
marchant Apr 6, 2020
6c9a31a
shift determination of listener's method to call to when we actually …
marchant Feb 9, 2021
5acddbd
Remove debug log
marchant Feb 9, 2021
3a32516
Fix regression
marchant Feb 9, 2021
18f375d
delay DragManager event listenening until there's at least a drag sou…
marchant Feb 9, 2021
f20960b
Further code optimization
marchant Feb 9, 2021
7f2ffdf
Update LICENSE.md
marchant Apr 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ log.txt
atlassian-ide-plugin.xml

### VisualStudioCode ###
.vscode/*
#.vscode/*
.vscode-upload.json
.eslintrc.json

Expand Down
80 changes: 80 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/services/shopify-admin-scripts/get-customers.js"
},
{
"type": "node",
"request": "launch",
"name": "npm test",
"runtimeVersion": "12.18.4",
"runtimeArgs": [
"${workspaceFolder}/test/run-node.js",
]
},
{
"type": "node",
"request": "launch",
"name": "Run collections Jasmine Tests",
"runtimeExecutable": "node",
"program": "${workspaceFolder}/core/collections/test/run-node.js",
"args": [ "core/collections/test/spec", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"autoAttachChildProcesses": true,
"trace": false,
"enableContentValidation": false
},
{
"type": "node",
"request": "launch",
"name": "Run frb Jasmine Tests",
"program": "${workspaceFolder}/node_modules/jasmine-node/bin/jasmine-node",
"args": [ "core/frb/spec", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"autoAttachChildProcesses": true,
"trace": false,
"enableContentValidation": false
},
{
"type": "node",
"request": "launch",
"name": "npm test mr",
"runtimeExecutable": "~/.nvm/versions/node/v12.18.4/bin/node",
"program": "${workspaceFolder}/core/mr/test/run-node.js"
},
{
"type": "node",
"request": "launch",
"name": "compile time zones",
"runtimeVersion": "default",
"cwd": "${workspaceFolder}/core/date/tools/",
"program": "${workspaceFolder}/core/date/tools/compile-zones.js"
},
{
"type": "node",
"request": "launch",
"name": "Run promise-io Jasmine Tests",
"runtimeExecutable": "~/.nvm/versions/node/v12.18.4/bin/node",
"autoAttachChildProcesses": true,
"program": "${workspaceFolder}/node_modules/jasmine-node/bin/jasmine-node",
"args": [ "${workspaceFolder}/core/promise-io/spec", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"

}


]
}
3 changes: 3 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ALL CHANGES IN THIS FORK ARE NOT OPEN SOURCE NOR AVAILABLE UNDER THE ORIGINAL LICENSE


Montage
============
Copyright (c) 2013, Adam Solove
Expand Down
32 changes: 31 additions & 1 deletion composer/composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @requires montage/core/target
*/
var Target = require("../core/target").Target,
defaultEventManager = require("../core/event/event-manager").defaultEventManager;
defaultEventManager = require("../core/event/event-manager").defaultEventManager;

/**
* The `Composer` helps to keep event normalization and calculation out of
Expand Down Expand Up @@ -70,6 +70,36 @@ exports.Composer = Target.specialize( /** @lends Composer# */ {
}
},

/**
* @private
* @property {Target} value
*/
_nextTarget: {
value: null
},

/**
* The next Target to consider in the event target chain
*
* Currently, components themselves do not allow this chain to be broken;
* setting a component's nextTarget to a falsy value will cause nextTarget
* to resolve as the parentComponent.
*
* To interrupt the propagation path a Target that accepts a falsy
* nextTarget needs to be set at a component's nextTarget.
*
* @param {Target} value
* @returns {Target}
*/
nextTarget: {
get: function () {
return this._nextTarget || this._component;
},
set: function (value) {
this._nextTarget = value;
}
},

_shawdowRoot: {
value: null
},
Expand Down
140 changes: 121 additions & 19 deletions core/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
var Target = require("./target").Target,
Template = require("./template"),
MontageWindow = require("../window-loader/montage-window").MontageWindow,
Criteria = require("core/criteria").Criteria,
DataQuery = require("data/model/data-query").DataQuery,
UserIdentityService = undefined,
UserIdentityManager = require("data/service/user-identity-manager").UserIdentityManager,
Slot;

require("./dom");
Expand All @@ -32,17 +36,6 @@ var FIRST_LOAD_KEY_SUFFIX = "-is-first-load";
*/
var Application = exports.Application = Target.specialize( /** @lends Application.prototype # */ {

/**
* Provides a reference to the Montage event manager used in the
* application.
*
* @property {EventManager} value
* @default null
*/
eventManager: {
value: null
},

/**
* Provides a reference to the parent application.
*
Expand All @@ -67,6 +60,14 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
}
},

url: {
get: function() {
return document && document.location
? new URL(document.location)
: null;
}
},

/**
* Provides a reference to the main application.
*
Expand Down Expand Up @@ -428,6 +429,8 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
) {
this.parentApplication = window.loadInfo.parent.document.application;
}

UserIdentityManager.delegate = this;
}
},

Expand All @@ -443,14 +446,86 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
exports.application = self;

return require.async("ui/component").then(function(exports) {
var authorizationPromise;

self.rootComponent = rootComponent = exports.__root__;
if (typeof document !== "undefined") {
rootComponent.element = document;
}


/*

TODO!!! Modify loading sequence to combine loader -> Authorization Panel -> Main

While bringing the login panel up when there's an UpfrontAuthorizationPolicy before loading Main
makes sense from both security and performance stand point, we shouldn't be skipping the loader.

We should deserialize the loader, set the authentication panel as loader's Main, show the AuthenticationManager panel,
and then bring the Main in
*/

//URGENT: We need to further test that we don't already have a valid Authorization to use before authenticating.
return require.async("data/service/user-identity-service");
})
.then(function(exports) {
UserIdentityService = exports.UserIdentityService;

var userIdentityServices = UserIdentityService.userIdentityServices,
userIdentityObjectDescriptors,
authenticationPromise,
// userObjectDescriptor = this.
selfUserCriteria,
userIdentityQuery;

rootComponent = exports.__root__;
//Temporarily Bypassing authentication:
if(userIdentityServices && userIdentityServices.length > 0) {
//Shortcut, there could be multiple one we need to flatten.
userIdentityObjectDescriptors = userIdentityServices[0].types;

if(userIdentityObjectDescriptors.length > 0) {
//selfUserCriteria = new Criteria().initWithExpression("identity == $", "self");
userIdentityQuery = DataQuery.withTypeAndCriteria(userIdentityObjectDescriptors[0]);

authenticationPromise = self.mainService.fetchData(userIdentityQuery)
.then(function(userIdenties) {
self.userIdentity = userIdenties[0];
});

}
}
else {
//Needs to beef-up the case we have a first anonymous user who could come back later.
authenticationPromise = Promise.resolve(true);
}

return authenticationPromise.finally(function() {
// if (typeof document !== "undefined") {
// rootComponent.element = document;
// }

if (typeof document !== "undefined") {
return Template.instantiateDocument(document, applicationRequire);
}

});


/*

if (typeof document !== "undefined") {
rootComponent.element = document;
return Template.instantiateDocument(document, applicationRequire);
}

return authorizationPromise.then(function(authorization) {
if (typeof document !== "undefined") {
return Template.instantiateDocument(document, applicationRequire);
}
}, function(error) {
console.error(error);
});
*/

}).then(function (part) {
self.callDelegateMethod("willFinishLoading", self);
rootComponent.needsDraw = true;
Expand All @@ -462,6 +537,8 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
}
},

//This should be replaced by a more robust user / session system with opt-in/delegate/configured
//from the outside.
_loadApplicationContext: {
value: function () {
if (this._isFirstLoad === null) {
Expand All @@ -471,7 +548,7 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio

if (typeof localStorage !== "undefined") {
localStorage.getItem(alreadyLoadedLocalStorageKey);

if (hasAlreadyBeenLoaded === null) {
try {
localStorage.setItem(alreadyLoadedLocalStorageKey, true);
Expand Down Expand Up @@ -513,15 +590,17 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
/**
* @private
*/
_createPopupSlot: {value: function (zIndex) {
_createPopupSlot: {value: function (zIndex, className) {
var slotEl = document.createElement('div');
document.body.appendChild(slotEl);
slotEl.style.zIndex = zIndex;
slotEl.style.position = 'absolute';
slotEl.classList.add(className);

var popupSlot = new Slot();
popupSlot.delegate = this;
popupSlot.element = slotEl;
popupSlot.attachToParentComponent();
//popupSlot.attachToParentComponent();
return popupSlot;
}},

Expand All @@ -533,19 +612,22 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
.then(function (exports) {
Slot = Slot || exports.Slot;
type = type || "custom";
var isSystemPopup = self._isSystemPopup(type), zIndex, popupSlot;
var isSystemPopup = self._isSystemPopup(type), zIndex, popupSlot, className;
self.popupSlots = self.popupSlots || {};

if(isSystemPopup) {
switch (type) {
case "alert":
zIndex = 19004;
className = "montage-alert";
break;
case "confirm":
zIndex = 19003;
className = "montage-confirm";
break;
case "notify":
zIndex = 19002;
className = "montage-notify";
break;
}
} else {
Expand All @@ -556,15 +638,24 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio
self._zIndex = self._zIndex + 1;
}
zIndex = self._zIndex;
className = self.name;
className += "-";
className += type;
}

popupSlot = self.popupSlots[type];
if (!popupSlot) {
popupSlot = self.popupSlots[type] = self._createPopupSlot(zIndex);
popupSlot = self.popupSlots[type] = self._createPopupSlot(zIndex, className);
}

if(!popupSlot.inDocument) {
self.rootComponent.addChildComponent(popupSlot);
}

// use the new zIndex for custom popup
if(!isSystemPopup) {
popupSlot.element.style.zIndex = zIndex;
//Benoit: Modifying DOM outside of draw loop here, though it's early...
popupSlot.element.style.zIndex = zIndex;
}

popupSlot.content = content;
Expand All @@ -585,6 +676,17 @@ var Application = exports.Application = Target.specialize( /** @lends Applicatio

}},

slotDidSwitchContent: {
value: function (slot) {
if(slot.content === null) {
slot.detachFromParentComponent();
//Benoit: can't believe we have to do that in 2 steps....
slot.element.parentNode.removeChild(slot.element);

}
}
},

/**
* @private
*/
Expand Down
2 changes: 1 addition & 1 deletion core/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ require("./deprecate").deprecationWarning("montage/core/bindings", "montage/core
/**
* @deprecated console.log montage/core/bindings is deprecated, use montage/core/core instead
*/
exports.Bindings = require("frb");
exports.Bindings = require("core/frb/bindings");
Loading