diff --git a/package.json b/package.json index d1d675df19..a1ac01f437 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "start": "node app.js", "test": "karma start --single-run", "jshint": "jshint platform example || exit 0", + "watch": "karma start", "jsdoc": "jsdoc -c jsdoc.json -r -d target/docs/api", "otherdoc": "node docs/gendocs.js --in docs/src --out target/docs", "docs": "npm run jsdoc ; npm run otherdoc" diff --git a/platform/commonUI/browse/bundle.json b/platform/commonUI/browse/bundle.json index 7355a6b69c..6e166edb02 100644 --- a/platform/commonUI/browse/bundle.json +++ b/platform/commonUI/browse/bundle.json @@ -69,8 +69,8 @@ { "key": "grid-item", "templateUrl": "templates/items/grid-item.html", - "uses": [ "type", "action" ], - "gestures": [ "info","menu" ] + "uses": [ "type", "action", "location" ], + "gestures": [ "info", "menu" ] }, { "key": "object-header", @@ -88,12 +88,12 @@ { "key": "navigationService", "implementation": "navigation/NavigationService.js" - }, + }, { "key": "creationService", "implementation": "creation/CreationService.js", "depends": [ "persistenceService", "$q", "$log" ] - } + } ], "actions": [ { diff --git a/platform/commonUI/browse/res/templates/items/grid-item.html b/platform/commonUI/browse/res/templates/items/grid-item.html index e64afd4a9f..64282a9ee1 100644 --- a/platform/commonUI/browse/res/templates/items/grid-item.html +++ b/platform/commonUI/browse/res/templates/items/grid-item.html @@ -27,12 +27,18 @@
- +
P
-
{{type.getGlyph()}}
+
+ {{type.getGlyph()}} + +
}
@@ -44,4 +50,4 @@
- \ No newline at end of file + diff --git a/platform/commonUI/browse/src/creation/CreationService.js b/platform/commonUI/browse/src/creation/CreationService.js index 015573c8bd..17cc5ce6b3 100644 --- a/platform/commonUI/browse/src/creation/CreationService.js +++ b/platform/commonUI/browse/src/creation/CreationService.js @@ -93,6 +93,12 @@ define( }); } + // Store the location of an object relative to it's parent. + function addLocationToModel(modelId, model, parent) { + model.location = parent.getId(); + return model; + } + // Create a new domain object with the provided model as a // member of the specified parent's composition function createObject(model, parent) { @@ -112,6 +118,7 @@ define( return $q.when( uuid() ).then(function (id) { + model = addLocationToModel(id, model, parent); return doPersist(persistence.getSpace(), id, model); }).then(function (id) { return addToComposition(id, parent, persistence); diff --git a/platform/commonUI/browse/test/creation/CreationServiceSpec.js b/platform/commonUI/browse/test/creation/CreationServiceSpec.js index 277b195eaf..7f15afe061 100644 --- a/platform/commonUI/browse/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/browse/test/creation/CreationServiceSpec.js @@ -38,6 +38,7 @@ define( mockMutationCapability, mockPersistenceCapability, mockCompositionCapability, + mockContextCapability, mockCapabilities, creationService; @@ -87,10 +88,15 @@ define( "composition", ["invoke"] ); + mockContextCapability = jasmine.createSpyObj( + "context", + ["getPath"] + ); mockCapabilities = { mutation: mockMutationCapability, persistence: mockPersistenceCapability, - composition: mockCompositionCapability + composition: mockCompositionCapability, + context: mockContextCapability }; mockPersistenceService.createObject.andReturn( @@ -103,6 +109,7 @@ define( mockParentObject.useCapability.andCallFake(function (key, value) { return mockCapabilities[key].invoke(value); }); + mockParentObject.getId.andReturn('parentId'); mockPersistenceCapability.persist.andReturn( mockPromise(true) @@ -194,7 +201,16 @@ define( expect(mockLog.error).toHaveBeenCalled(); }); + it("stores location on new domainObjects", function () { + var model = { name: "my model" }, + objectPromise = creationService.createObject( + model, + mockParentObject + ); + + expect(model.location).toBe('parentId'); + }); }); } -); \ No newline at end of file +); diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index 2b8f63c243..33242ccdcf 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -196,7 +196,7 @@ { "key": "label", "templateUrl": "templates/label.html", - "uses": [ "type" ], + "uses": [ "type", "location" ], "gestures": [ "drag", "menu", "info" ] }, { diff --git a/platform/commonUI/general/res/css/theme-espresso.css b/platform/commonUI/general/res/css/theme-espresso.css index 5d41793946..35b9db87bd 100644 --- a/platform/commonUI/general/res/css/theme-espresso.css +++ b/platform/commonUI/general/res/css/theme-espresso.css @@ -2566,7 +2566,7 @@ label.checkbox.custom { box-sizing: border-box; border-top: 1px solid #737373; color: #d9d9d9; - line-height: 1.4rem; + line-height: 1.5rem; padding: 3px 10px 3px 30px; white-space: nowrap; } /* line 46, ../sass/controls/_menus.scss */ diff --git a/platform/commonUI/general/res/css/tree.css b/platform/commonUI/general/res/css/tree.css index af2b7d4bd9..8f3ac4871a 100644 --- a/platform/commonUI/general/res/css/tree.css +++ b/platform/commonUI/general/res/css/tree.css @@ -124,8 +124,8 @@ ul.tree { transition: background-color 0.25s; display: block; font-size: 0.8em; - height: 1.4rem; - line-height: 1.4rem; + height: 1.5rem; + line-height: 1.5rem; margin-bottom: 3px; position: relative; } /* line 39, ../sass/tree/_tree.scss */ diff --git a/platform/commonUI/general/res/sass/_constants.scss b/platform/commonUI/general/res/sass/_constants.scss index 2202aabd81..22518172da 100644 --- a/platform/commonUI/general/res/sass/_constants.scss +++ b/platform/commonUI/general/res/sass/_constants.scss @@ -146,7 +146,7 @@ $controlDisabledOpacity: 0.3; $formLabelW: 20%; $formInputH: 22px; $formRowCtrlsH: 14px; -$menuLineH: 1.4rem; +$menuLineH: 1.5rem; $scrollbarTrackSize: 10px; $scrollbarTrackColorBg: rgba(#000, 0.4); $btnStdH: 25px; diff --git a/platform/commonUI/general/res/templates/label.html b/platform/commonUI/general/res/templates/label.html index bfa7bd56ff..7ca73bb026 100644 --- a/platform/commonUI/general/res/templates/label.html +++ b/platform/commonUI/general/res/templates/label.html @@ -22,7 +22,13 @@ {{type.getGlyph()}} - + + + + + {{model.name}} - {{model.name}} diff --git a/platform/commonUI/general/res/templates/tree-node.html b/platform/commonUI/general/res/templates/tree-node.html index f584befb1a..1228604b2e 100644 --- a/platform/commonUI/general/res/templates/tree-node.html +++ b/platform/commonUI/general/res/templates/tree-node.html @@ -22,29 +22,29 @@ + class="tree-item menus-to-left" + ng-class="{selected: treeNode.isSelected()}" + > + class='ui-symbol view-control' + ng-click="toggle.toggle(); treeNode.trackExpansion()" + ng-if="model.composition !== undefined" + > {{toggle.isActive() ? "v" : ">"}} + key="'label'" + mct-object="domainObject" + ng-model="ngModel" + ng-click="ngModel.selectedObject = domainObject" + > + class="tree-item-subtree" + ng-show="toggle.isActive()" + ng-if="model.composition !== undefined" + >