Commit Graph

83 Commits

Author SHA1 Message Date
Victor Woeltjen
70bbd3cf97 [Entanglement] Add test cases for Go To Original 2015-10-06 16:37:37 -07:00
Victor Woeltjen
60f2f9fb6c [Location] Add getOriginal method
Add a getOriginal method to the location capability, to simplify
loading of original versions of objects. nasa/openmctweb#147
2015-10-06 16:18:51 -07:00
Pete Richards
70bc17c79f Merge remote-tracking branch 'github-open/open97' into open-master 2015-09-23 13:44:48 -07:00
Victor Woeltjen
fa60d62039 [Entanglement] Simplify test case
...per review feedback from nasa/openmctweb#98
2015-09-23 12:49:04 -07:00
Victor Woeltjen
082122ddec [Entanglement] Move policyService.allow.andReturn
...to locations where the specified return value
can be more closely correlated to the relevant
test cases. nasa/openmctweb#98
2015-09-23 12:46:23 -07:00
Victor Woeltjen
6dbccd5000 [Entanglement] Update test cases around error-throwing
...per code review feedback, nasa/openmctweb#97
2015-09-23 12:43:03 -07:00
Victor Woeltjen
4743833f7c [Entanglement] Verify revalidation
Verify that move/copy/link revalidate when performed and
throw errors when moving/copying/linking would be invalid.
nasa/openmctweb#98
2015-09-22 15:49:22 -07:00
Victor Woeltjen
6996883b85 [Entanglement] Update specs
Update specs for move/copy/link services to account
for re-validation at time an action is performed.
nasa/openmctweb#98
2015-09-22 15:42:39 -07:00
Victor Woeltjen
597b18af1c [LinkService] Amend test cases
Remove redundant test case; modify composition-checking
test case to expose correct capability information.
In response to feedback from nasa/openmctweb#98
2015-09-22 14:07:46 -07:00
Victor Woeltjen
411f0d904d [Entanglement] Test LocatingObjectDecorator 2015-09-17 14:45:05 -07:00
Victor Woeltjen
b2649de649 [Composition] Update specs
Update specs for changes to the return value of
composition.add, nasa/openmctweb#97
2015-09-02 11:45:52 -07:00
Victor Woeltjen
8759fdbd95 [Composition] Update specs
Update specs to reflect usage of the add method in
the composition capability.
2015-09-02 09:37:26 -07:00
Victor Woeltjen
b39753d0a6 [Entanglement] Separate out location
Separate out location property from the CreationService,
instead handle in the entanglement bundle; this is
consistent with changes for identity management (attaching
a creator to newly-created domain object models).
for nasa/openmctweb#92
2015-09-01 10:57:56 -07:00
Victor Woeltjen
f27e4d6e06 Merge branch 'open-master' into open1482c
Merge in latest in preparation to merge; WTD-1482

Conflicts:
	platform/commonUI/browse/src/creation/CreationService.js
	platform/core/src/models/RootModelProvider.js
	platform/entanglement/src/services/LinkService.js
	platform/entanglement/src/services/MoveService.js
2015-08-19 15:00:52 -07:00
Pete Richards
a94763041e [Move] correct logic and specification 2015-08-19 13:16:36 -07:00
Pete Richards
94854e5965 [Location] can retrieve contextual location
Clarify naming of method for retrieving contextual location of a domain
object.

Default behavior for objects that do not have a context is to return
undefined.  Note that default behavior is not specified and could change
if needed.
2015-08-19 11:33:45 -07:00
Pete Richards
9cf30f4213 [Location] setPrimaryLocation takes location.
Rename "persistLocation" to be more clearly named, and make it take an
argument to allow for greater control outside the capability.
2015-08-19 11:25:41 -07:00
Victor Woeltjen
b93d752c88 [Code Style] Use prototypes in entanglement bundle
WTD-1482
2015-08-11 14:58:31 -07:00
Pete Richards
c80e9bfa26 [Style] JSLint Compliance 2015-08-06 15:21:28 -07:00
Pete Richards
f72f88adfa [Location] Use parent id as location
Use the parent id as the location for a model.

This greatly reduces the recursive work that must be done
during move operations to keep the location accurate.

Additionally, the locationService now implements a method
`persistLocation` which can be used to persist the current object
location as it's original location.
2015-08-06 15:05:47 -07:00
Pete Richards
10ec30ba76 [Entanglement] MoveService updates the location of moved objects
The move service updates the location of moved objects when those
objects are originals.
2015-08-06 15:05:46 -07:00
Pete Richards
3fb4296d23 [Testing] MockLinkService returns linked object
MockLinkService.perform returns a promise for the linked domainObject.

When resolving the promise and not specifying an object to resolve it
with, it will resolve it with the domainObject that was originally
passed to it.
2015-08-06 15:05:46 -07:00
Pete Richards
197ec0eb2c [Tests] Update Link Service Tests 2015-08-06 15:05:42 -07:00
Pete Richards
1d162888dd [Tests] Fix location capability tests 2015-08-06 15:05:00 -07:00
Pete Richards
3783ed69d7 [Entanglement] Move updates location of originals
When moving original objects, the location is updated to match the new
location.
2015-08-06 15:03:08 -07:00
Pete Richards
4a755e259f [Entanglement] Link service returns object in new context
The link service return the object in the new context.
2015-08-06 14:55:50 -07:00
Pete Richards
4c56e4ffdc [Test] add a synchronous controlled promise for testing
Add ControlledPromise, a synchronous promise that can be controlled,
allowing for easier testing of promise resolution flow.
2015-08-06 14:53:59 -07:00
larkin
9ea1d24121 [Entanglement] Add LocationCapability
DomainObjects with a context capability also gain a LocationCapability.

This capability allows you to determine the location of the current
instance of a domain object, and also provides methods for determining
if the current instance of a domain object is a link, or if it is an
original.
2015-08-04 11:24:50 -07:00
larkin
d32c05a313 [Style] Add newline at end of file 2015-06-12 09:57:28 -07:00
larkin
c6186ae186 [Entanglement] Correctly Call Policy Service
Move, Copy, and Link services correctly call the policy service to
check whether composition is allowed.  Fixes open-1254.
2015-06-12 09:45:12 -07:00
larkin
d041655546 [Licenses] Add License Headers 2015-06-11 14:22:18 -07:00
larkin
1525657ac2 [Task] Remove TODOS 2015-06-11 13:09:02 -07:00
larkin
9123078293 [Entanglement] Add entanglement bundle
The entanglement bundle defines move, copy, and link actions, and
exposes them as context menu actions.

* The Move action moves an object from it's current parent to a new
parent object.
* The Copy action deep-copies an object to a new parent object.
* The Link action links an object to a new parent object.

These actions are implemented by three new services: moveService,
copyService, and linkService.

Mocks are provided for each service for easy testing of components
that depend on them.

Additionally, this bundle provides a DomainObjectFactory that simplifies
the construction of mockDomainObjects for tests.

These actions are exposed to the user as context menu options.
2015-06-11 13:09:01 -07:00