Skip to content

Commit

Permalink
[Frontend] Removing glyph definitions; updating tests
Browse files Browse the repository at this point in the history
Fixes #1047
Search and removal of "glyph" definitions in bundle
and other JS files; updating tests accordingly;
  • Loading branch information
charlesh88 committed Jul 25, 2016
1 parent 574b8bd commit 650fbcc
Show file tree
Hide file tree
Showing 34 changed files with 22 additions and 102 deletions.
1 change: 0 additions & 1 deletion example/eventGenerator/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ define([
{
"key": "eventGenerator",
"name": "Event Message Generator",
"glyph": "\u0066",
"cssclass": "icon-folder-new",
"description": "For development use. Creates sample event message data that mimics a live data stream.",
"priority": 10,
Expand Down
2 changes: 1 addition & 1 deletion example/export/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ define([
"name": "Export Telemetry as CSV",
"implementation": ExportTelemetryAsCSVAction,
"category": "contextual",
"glyph": "\u0033",
"cssclass": "icon-download",
"depends": [ "exportService" ]
}
]
Expand Down
1 change: 0 additions & 1 deletion example/generator/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ define([
{
"key": "generator",
"name": "Sine Wave Generator",
"glyph": "\u0054",
"cssclass": "icon-telemetry",
"description": "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
"priority": 10,
Expand Down
1 change: 0 additions & 1 deletion example/imagery/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ define([
{
"key": "imagery",
"name": "Example Imagery",
"glyph": "\u00e3",
"cssclass": "icon-image",
"features": "creation",
"description": "For development use. Creates example imagery data that mimics a live imagery stream.",
Expand Down
6 changes: 3 additions & 3 deletions example/msl/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ define([
{
"name":"Mars Science Laboratory",
"key": "msl.curiosity",
"glyph": "o"
"cssclass": "icon-object"
},
{
"name": "Instrument",
"key": "msl.instrument",
"glyph": "o",
"cssclass": "icon-object",
"model": {"composition": []}
},
{
"name": "Measurement",
"key": "msl.measurement",
"glyph": "\u0054",
"cssclass": "icon-telemetry",
"model": {"telemetry": {}},
"telemetry": {
"source": "rems.source",
Expand Down
2 changes: 1 addition & 1 deletion example/plotOptions/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ define([
{
"key": "plot",
"name": "Example Telemetry Plot",
"glyph": "\u0074",
"cssclass": "icon-telemetry-panel",
"description": "For development use. A plot for displaying telemetry.",
"priority": 10,
"delegates": [
Expand Down
2 changes: 1 addition & 1 deletion platform/commonUI/browse/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ define([
{
"key": "items",
"name": "Items",
"glyph": "9",
"cssclass": "icon-thumbs-strip",
"description": "Grid of available items",
"template": itemsTemplate,
"uses": [
Expand Down
3 changes: 0 additions & 3 deletions platform/commonUI/edit/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ define([
],
"description": "Edit",
"category": "view-control",
"glyph": "p",
"cssclass": "major icon-pencil"
},
{
Expand All @@ -184,7 +183,6 @@ define([
"view-control"
],
"implementation": PropertiesAction,
"glyph": "p",
"cssclass": "major icon-pencil",
"name": "Edit Properties...",
"description": "Edit properties of this object.",
Expand All @@ -196,7 +194,6 @@ define([
"key": "remove",
"category": "contextual",
"implementation": RemoveAction,
"glyph": "Z",
"cssclass": "icon-trash",
"name": "Remove",
"description": "Remove this object from its containing object.",
Expand Down
1 change: 0 additions & 1 deletion platform/commonUI/edit/src/creation/AddAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ define(
function AddAction(type, parent, context, $q, dialogService, policyService) {
this.metadata = {
key: 'add',
glyph: type.getGlyph(),
cssclass: type.getCssClass(),
name: type.getName(),
type: type.getKey(),
Expand Down
1 change: 0 additions & 1 deletion platform/commonUI/edit/src/creation/CreateAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ define(
function CreateAction(type, parent, context) {
this.metadata = {
key: 'create',
glyph: type.getGlyph(),
cssclass: type.getCssClass(),
name: type.getName(),
type: type.getKey(),
Expand Down
2 changes: 0 additions & 2 deletions platform/commonUI/edit/test/creation/CreateActionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ define(
mockParent.useCapability.andReturn(mockDomainObject);

mockType.getKey.andReturn("test");
mockType.getGlyph.andReturn("T");
mockType.getCssClass.andReturn("icon-telemetry");
mockType.getDescription.andReturn("a test type");
mockType.getName.andReturn("Test");
Expand All @@ -139,7 +138,6 @@ define(

expect(metadata.name).toEqual("Test");
expect(metadata.description).toEqual("a test type");
expect(metadata.glyph).toEqual("T");
expect(metadata.cssclass).toEqual("icon-telemetry");
});

Expand Down
1 change: 0 additions & 1 deletion platform/commonUI/edit/test/creation/CreateWizardSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ define(
testModel = { someKey: "some value" };

mockType.getKey.andReturn("test");
mockType.getGlyph.andReturn("T");
mockType.getCssClass.andReturn("icon-telemetry");
mockType.getDescription.andReturn("a test type");
mockType.getName.andReturn("Test");
Expand Down
6 changes: 3 additions & 3 deletions platform/commonUI/general/res/sass/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@
// Used in grid-item.html, tree-item, inspector location
@extend .ui-symbol;
@extend .icon;
line-height: inherit; // This is Ok for the symbolsfont
line-height: inherit;
position: relative;
&.l-icon-link {
.t-item-icon-glyph {
&:after {
color: $colorIconLink;
content: "\e921";
content: $glyph-icon-link;
height: auto; width: auto;
position: absolute;
left: 0; top: 0; right: 0; bottom: 10%;
left: 0; top: 0; right: 0; bottom: 20%;
@include transform-origin(bottom left);
@include transform(scale(0.3));
z-index: 2;
Expand Down
5 changes: 1 addition & 4 deletions platform/core/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,11 @@ define([
{
"key": "root",
"name": "Root",
"glyph": "\u0046"
"cssclass": "icon-folder"
},
{
"key": "folder",
"name": "Folder",
"glyph": "\u0046",
"cssclass": "icon-folder",
"features": "creation",
"description": "Create folders to organize other objects or links to objects.",
Expand All @@ -275,12 +274,10 @@ define([
{
"key": "unknown",
"name": "Unknown Type",
"glyph": "\u003f",
"cssclass": "icon-object-unknown"
},
{
"name": "Unknown Type",
"glyph": "\u003f",
"cssclass": "icon-object-unknown"
}
],
Expand Down
3 changes: 1 addition & 2 deletions platform/core/src/actions/ActionAggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ define(
* @property {string} key machine-readable identifier for this action
* @property {string} name human-readable name for this action
* @property {string} description human-readable description
* @property {string} glyph character to display as icon
* @property {string} cssclass CSS class for icon, supercedes glyph
* @property {string} cssclass CSS class for icon
* @property {ActionContext} context the context in which the action
* will be performed.
*/
Expand Down
13 changes: 4 additions & 9 deletions platform/core/src/types/TypeImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ define(
* @method Type#getDescription
*/
/**
* Get the glyph associated with this type. Glyphs are
* single-character strings which will appear as icons (when
* Get the cssclass associated with this type. cssclass is a
* string which will appear as an icon (when
* displayed in an appropriate font) which visually
* distinguish types from one another.
*
* @returns {string} the glyph to be displayed
* @method Type#getGlyph
* @returns {string} the cssclass for this type
* @method Type#getCssClass
*/
/**
* Get an array of properties associated with objects of
Expand Down Expand Up @@ -144,11 +144,6 @@ define(
return this.typeDef.description;
};

TypeImpl.prototype.getGlyph = function () {
// TO-DO: remove this function
return this.typeDef.glyph;
};

TypeImpl.prototype.getCssClass = function () {
return this.typeDef.cssclass;
};
Expand Down
2 changes: 1 addition & 1 deletion platform/core/src/views/ViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ define(
* domain object's whose `type` capability matches or inherits
* from that type.
*
* Views themselves are primarily metadata, such as name, glyph, and
* Views themselves are primarily metadata, such as name, icon and
* description (to be shown in the UI); they do not contain any
* information directly applicable to rendering to the DOM, although
* they do contain sufficient information (such as a `templateUrl`,
Expand Down
7 changes: 1 addition & 6 deletions platform/core/test/types/TypeImplSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ define(
key: 'test-type',
name: 'Test Type',
description: 'A type, for testing',
glyph: 't',
cssclass: 'icon-telemetry-panel',
inherits: ['test-parent-1', 'test-parent-2'],
features: ['test-feature-1'],
Expand All @@ -55,11 +54,7 @@ define(
expect(type.getDescription()).toEqual('A type, for testing');
});

it("exposes glyph from definition", function () {
expect(type.getGlyph()).toEqual('t');
});

it("exposes glyph CSS class from definition", function() {
it("exposes CSS class from definition", function() {
expect(type.getCssClass()).toEqual('icon-telemetry-panel');
});

Expand Down
6 changes: 0 additions & 6 deletions platform/core/test/types/TypeProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,17 @@ define(
testTypeDefinitions = [
{
key: 'basic',
glyph: "X",
cssclass: "icon-magnify-in",
name: "Basic Type"
},
{
key: 'multi1',
glyph: "Z",
cssclass: "icon-trash",
description: "Multi1 Description",
capabilities: ['a1', 'b1']
},
{
key: 'multi2',
glyph: "Y",
cssclass: "icon-magnify-out",
capabilities: ['a2', 'b2', 'c2']
},
Expand Down Expand Up @@ -73,7 +70,6 @@ define(
it("looks up non-inherited types by name", function () {
captured.type = provider.getType('basic');

expect(captured.type.getGlyph()).toEqual("X");
expect(captured.type.getCssClass()).toEqual("icon-magnify-in");
expect(captured.type.getName()).toEqual("Basic Type");
expect(captured.type.getDescription()).toBeUndefined();
Expand All @@ -82,7 +78,6 @@ define(
it("supports single inheritance", function () {
captured.type = provider.getType('single-subtype');

expect(captured.type.getGlyph()).toEqual("X");
expect(captured.type.getCssClass()).toEqual("icon-magnify-in");
expect(captured.type.getName()).toEqual("Basic Subtype");
expect(captured.type.getDescription()).toEqual("A test subtype");
Expand All @@ -91,7 +86,6 @@ define(
it("supports multiple inheritance", function () {
captured.type = provider.getType('multi-subtype');

expect(captured.type.getGlyph()).toEqual("Y");
expect(captured.type.getCssClass()).toEqual("icon-magnify-out");
expect(captured.type.getName()).toEqual("Multi-parent Subtype");
expect(captured.type.getDescription()).toEqual("Multi1 Description");
Expand Down
5 changes: 0 additions & 5 deletions platform/entanglement/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ define([
"key": "move",
"name": "Move",
"description": "Move object to another location.",
"glyph": "f",
"cssclass": "icon-move",
"category": "contextual",
"implementation": MoveAction,
Expand All @@ -80,7 +79,6 @@ define([
"key": "copy",
"name": "Duplicate",
"description": "Duplicate object to another location.",
"glyph": "+",
"cssclass": "icon-duplicate",
"category": "contextual",
"implementation": CopyAction,
Expand All @@ -97,7 +95,6 @@ define([
"key": "link",
"name": "Create Link",
"description": "Create Link to object in another location.",
"glyph": "è",
"cssclass": "icon-link",
"category": "contextual",
"implementation": LinkAction,
Expand All @@ -111,7 +108,6 @@ define([
"key": "follow",
"name": "Go To Original",
"description": "Go to the original, un-linked instance of this object.",
"glyph": "",
"cssclass": "",
"category": "contextual",
"implementation": GoToOriginalAction
Expand All @@ -120,7 +116,6 @@ define([
"key": "locate",
"name": "Set Primary Location",
"description": "Set a domain object's primary location.",
"glyph": "",
"cssclass": "",
"category": "contextual",
"implementation": SetPrimaryLocationAction
Expand Down
4 changes: 0 additions & 4 deletions platform/features/clock/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ define([
],
"category": "contextual",
"name": "Start",
"glyph": "ï",
"cssclass": "icon-play",
"priority": "preferred"
},
Expand All @@ -148,7 +147,6 @@ define([
],
"category": "contextual",
"name": "Restart at 0",
"glyph": "r",
"cssclass": "icon-refresh",
"priority": "preferred"
}
Expand All @@ -157,7 +155,6 @@ define([
{
"key": "clock",
"name": "Clock",
"glyph": "\u0043",
"cssclass": "icon-clock",
"description": "A UTC-based clock that supports a variety of display formats. Clocks can be added to Display Layouts.",
"priority": 101,
Expand Down Expand Up @@ -215,7 +212,6 @@ define([
{
"key": "timer",
"name": "Timer",
"glyph": "\u00f5",
"cssclass": "icon-timer",
"description": "A timer that counts up or down to a datetime. Timers can be started, stopped and reset whenever needed, and support a variety of display formats. Each Timer displays the same value to all users. Timers can be added to Display Layouts.",
"priority": 100,
Expand Down
4 changes: 0 additions & 4 deletions platform/features/clock/src/indicators/ClockIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ define(
return "icon-clock";
};

ClockIndicator.prototype.getGlyphClass = function () {
return "no-icon no-collapse float-right subtle";
};

ClockIndicator.prototype.getText = function () {
return this.text;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ define(

it("implements the Indicator interface", function () {
expect(indicator.getCssClass()).toEqual(jasmine.any(String));
expect(indicator.getGlyphClass()).toEqual(jasmine.any(String));
expect(indicator.getText()).toEqual(jasmine.any(String));
expect(indicator.getDescription()).toEqual(jasmine.any(String));
});
Expand Down
1 change: 0 additions & 1 deletion platform/features/imagery/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ define([
{
"name": "Imagery",
"key": "imagery",
"glyph": "ã",
"cssclass": "icon-image",
"template": imageryTemplate,
"priority": "preferred",
Expand Down
Loading

0 comments on commit 650fbcc

Please sign in to comment.