diff --git a/platform/commonUI/browse/bundle.js b/platform/commonUI/browse/bundle.js index bc62a1a36e..9c08521f5e 100644 --- a/platform/commonUI/browse/bundle.js +++ b/platform/commonUI/browse/bundle.js @@ -295,7 +295,7 @@ define([ "provides": "typeService", "type": "decorator", "implementation": TypeRegionDecorator - }, + } ], "runs": [ { diff --git a/platform/commonUI/browse/src/InspectorRegion.js b/platform/commonUI/browse/src/InspectorRegion.js index 72b71a1e01..accbac8fbd 100644 --- a/platform/commonUI/browse/src/InspectorRegion.js +++ b/platform/commonUI/browse/src/InspectorRegion.js @@ -62,7 +62,7 @@ define( } }; this.addPart(metadataPart, 0); - } + }; return InspectorRegion; } diff --git a/platform/commonUI/browse/src/TypeRegionDecorator.js b/platform/commonUI/browse/src/TypeRegionDecorator.js index 60e75cac24..7c3f60994f 100644 --- a/platform/commonUI/browse/src/TypeRegionDecorator.js +++ b/platform/commonUI/browse/src/TypeRegionDecorator.js @@ -29,16 +29,17 @@ define( "use strict"; /** - * Adds default screen regions to Type definitions. Screen regions - * are sections of the browse and edit view of an object that can be - * customized on a per-type basis. Within {@link Region}s are {@link RegionPart}s. - * Policies can be used to decide which parts are visible or not based on object state. + * Adds default browse screen regions to Type definitions. Screen + * regions are sections of the browse and edit view of an object + * that can be customized on a per-type basis. Within + * {@link Region}s are {@link RegionPart}s. Policies can be used to + * decide which parts are visible or not based on object state. * @memberOf platform/commonUI/regions * @see {@link Region}, {@link RegionPart}, {@link EditableRegionPolicy} * @constructor */ function TypeRegionDecorator(typeService) { - this.typeService = typeService + this.typeService = typeService; } /** diff --git a/platform/commonUI/regions/test/InspectorRegionSpec.js b/platform/commonUI/browse/test/InspectorRegionSpec.js similarity index 93% rename from platform/commonUI/regions/test/InspectorRegionSpec.js rename to platform/commonUI/browse/test/InspectorRegionSpec.js index 9192ba3f11..3eb9428518 100644 --- a/platform/commonUI/regions/test/InspectorRegionSpec.js +++ b/platform/commonUI/browse/test/InspectorRegionSpec.js @@ -33,11 +33,11 @@ define( var inspectorRegion; beforeEach(function () { - inspectorRegion = new InspectorRegion; + inspectorRegion = new InspectorRegion(); }); it("creates default region parts", function () { - expect(inspectorRegion.parts().length).toBe(2); + expect(inspectorRegion.parts.length).toBe(1); }); }); diff --git a/platform/commonUI/browse/test/TypeRegionDecoratorSpec.js b/platform/commonUI/browse/test/TypeRegionDecoratorSpec.js new file mode 100644 index 0000000000..a525df5b9b --- /dev/null +++ b/platform/commonUI/browse/test/TypeRegionDecoratorSpec.js @@ -0,0 +1,70 @@ +/***************************************************************************** + * Open MCT Web, Copyright (c) 2014-2015, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT Web is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT Web includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ +/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/ + +/** + * MCTIncudeSpec. Created by vwoeltje on 11/6/14. + */ +define( + ["../src/TypeRegionDecorator"], + function (TypeRegionDecorator) { + "use strict"; + + describe("The type region decorator", function () { + var typeRegionDecorator, + mockTypeService, + mockType, + mockTypeDefinition; + + beforeEach(function () { + mockTypeDefinition = {}; + + mockType = jasmine.createSpyObj('type', [ + 'getDefinition' + ]); + mockType.getDefinition.andReturn(mockTypeDefinition); + + mockTypeService = jasmine.createSpyObj('typeService', [ + 'listTypes', + 'getType' + ]); + mockTypeService.getType.andReturn(mockType); + mockTypeService.listTypes.andReturn([mockType]); + + typeRegionDecorator = new TypeRegionDecorator(mockTypeService); + }); + + it("decorates individual type definitions with basic inspector" + + " region", function () { + typeRegionDecorator.getType('someType'); + expect(mockTypeDefinition.regions).toBeDefined(); + }); + + it("decorates all type definitions with basic inspector" + + " region", function () { + typeRegionDecorator.listTypes(); + expect(mockTypeDefinition.regions).toBeDefined(); + }); + + }); + } +); \ No newline at end of file diff --git a/platform/commonUI/general/res/templates/controls/datetime-field.html b/platform/commonUI/general/res/templates/controls/datetime-field.html index 18eb9ec46d..793083ea60 100644 --- a/platform/commonUI/general/res/templates/controls/datetime-field.html +++ b/platform/commonUI/general/res/templates/controls/datetime-field.html @@ -23,6 +23,7 @@ ng-controller="DateTimeFieldController"> +
Display + + + + +
+ Plot Series +