Skip to content

Commit df0d4df

Browse files
authored
Merge pull request nasa#1515 from nasa/open1498
Removed contextualization warning.
2 parents 251438e + a867cd6 commit df0d4df

File tree

11 files changed

+30
-266
lines changed

11 files changed

+30
-266
lines changed

platform/core/bundle.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ define([
4949
"./src/services/Now",
5050
"./src/services/Throttle",
5151
"./src/services/Topic",
52-
"./src/services/Contextualize",
5352
"./src/services/Instantiate",
5453
'legacyRegistry'
5554
], function (
@@ -81,7 +80,6 @@ define([
8180
Now,
8281
Throttle,
8382
Topic,
84-
Contextualize,
8583
Instantiate,
8684
legacyRegistry
8785
) {
@@ -284,8 +282,7 @@ define([
284282
"key": "composition",
285283
"implementation": CompositionCapability,
286284
"depends": [
287-
"$injector",
288-
"contextualize"
285+
"$injector"
289286
]
290287
},
291288
{
@@ -380,13 +377,6 @@ define([
380377
"$log"
381378
]
382379
},
383-
{
384-
"key": "contextualize",
385-
"implementation": Contextualize,
386-
"depends": [
387-
"$log"
388-
]
389-
},
390380
{
391381
"key": "instantiate",
392382
"implementation": Instantiate,

platform/core/src/capabilities/CompositionCapability.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
* Module defining CompositionCapability. Created by vwoeltje on 11/7/14.
2525
*/
2626
define(
27-
function () {
27+
['./ContextualDomainObject'],
28+
function (ContextualDomainObject) {
2829

2930
/**
3031
* Composition capability. A domain object's composition is the set of
@@ -38,13 +39,12 @@ define(
3839
* @constructor
3940
* @implements {Capability}
4041
*/
41-
function CompositionCapability($injector, contextualize, domainObject) {
42+
function CompositionCapability($injector, domainObject) {
4243
// Get a reference to the object service from $injector
4344
this.injectObjectService = function () {
4445
this.objectService = $injector.get("objectService");
4546
};
4647

47-
this.contextualize = contextualize;
4848
this.domainObject = domainObject;
4949
}
5050

@@ -115,7 +115,6 @@ define(
115115
CompositionCapability.prototype.invoke = function () {
116116
var domainObject = this.domainObject,
117117
model = domainObject.getModel(),
118-
contextualize = this.contextualize,
119118
ids;
120119

121120
// Then filter out non-existent objects,
@@ -125,7 +124,7 @@ define(
125124
return ids.filter(function (id) {
126125
return objects[id];
127126
}).map(function (id) {
128-
return contextualize(objects[id], domainObject);
127+
return new ContextualDomainObject(objects[id], domainObject);
129128
});
130129
}
131130

platform/core/src/capabilities/InstantiationCapability.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
*****************************************************************************/
2222

2323
define(
24-
[],
25-
function () {
24+
['./ContextualDomainObject'],
25+
function (ContextualDomainObject) {
2626

2727
/**
2828
* Implements the `instantiation` capability. This allows new domain
@@ -70,11 +70,7 @@ define(
7070

7171
var newObject = this.instantiateFn(model, id);
7272

73-
this.contextualizeFn = this.contextualizeFn ||
74-
this.$injector.get("contextualize");
75-
76-
77-
return this.contextualizeFn(newObject, this.domainObject);
73+
return new ContextualDomainObject(newObject, this.domainObject);
7874
};
7975

8076
/**

platform/core/src/services/Contextualize.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

platform/core/test/capabilities/CompositionCapabilitySpec.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ define(
4141
describe("The composition capability", function () {
4242
var mockDomainObject,
4343
mockInjector,
44-
mockContextualize,
4544
mockObjectService,
4645
composition;
4746

@@ -72,19 +71,11 @@ define(
7271
return (name === "objectService") && mockObjectService;
7372
}
7473
};
75-
mockContextualize = jasmine.createSpy('contextualize');
76-
77-
// Provide a minimal (e.g. no error-checking) implementation
78-
// of contextualize for simplicity
79-
mockContextualize.andCallFake(function (domainObject, parentObject) {
80-
return new ContextualDomainObject(domainObject, parentObject);
81-
});
8274

8375
mockObjectService.getObjects.andReturn(mockPromise([]));
8476

8577
composition = new CompositionCapability(
8678
mockInjector,
87-
mockContextualize,
8879
mockDomainObject
8980
);
9081
});

platform/core/test/capabilities/InstantiationCapabilitySpec.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ define(
2828
var mockInjector,
2929
mockIdentifierService,
3030
mockInstantiate,
31-
mockContextualize,
3231
mockIdentifier,
3332
mockNow,
3433
mockDomainObject,
@@ -37,7 +36,6 @@ define(
3736
beforeEach(function () {
3837
mockInjector = jasmine.createSpyObj("$injector", ["get"]);
3938
mockInstantiate = jasmine.createSpy("instantiate");
40-
mockContextualize = jasmine.createSpy("contextualize");
4139
mockIdentifierService = jasmine.createSpyObj(
4240
'identifierService',
4341
['parse', 'generate']
@@ -53,8 +51,7 @@ define(
5351

5452
mockInjector.get.andCallFake(function (key) {
5553
return {
56-
'instantiate': mockInstantiate,
57-
'contextualize': mockContextualize
54+
'instantiate': mockInstantiate
5855
}[key];
5956
});
6057
mockIdentifierService.parse.andReturn(mockIdentifier);
@@ -85,18 +82,12 @@ define(
8582
'hasCapability'
8683
]), testModel = { someKey: "some value" };
8784
mockInstantiate.andReturn(mockDomainObj);
88-
mockContextualize.andCallFake(function (x) {
89-
return x;
90-
});
91-
expect(instantiation.instantiate(testModel))
92-
.toBe(mockDomainObj);
85+
instantiation.instantiate(testModel);
9386
expect(mockInstantiate)
9487
.toHaveBeenCalledWith({
9588
someKey: "some value",
9689
modified: mockNow()
9790
}, jasmine.any(String));
98-
expect(mockContextualize)
99-
.toHaveBeenCalledWith(mockDomainObj, mockDomainObject);
10091
});
10192

10293
});

platform/core/test/services/ContextualizeSpec.js

Lines changed: 0 additions & 103 deletions
This file was deleted.

platform/entanglement/bundle.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ define([
132132
"provides": "objectService",
133133
"implementation": LocatingObjectDecorator,
134134
"depends": [
135-
"contextualize",
136135
"$q",
137136
"$log"
138137
]

0 commit comments

Comments
 (0)