diff --git a/example/notifications/res/dialog-launch.html b/example/notifications/res/dialog-launch.html index 9eebd2e3e5..c810f7f605 100644 --- a/example/notifications/res/dialog-launch.html +++ b/example/notifications/res/dialog-launch.html @@ -1,9 +1,9 @@ - + - + Known | Unknown | Error | Info - Dialogs + \ No newline at end of file diff --git a/example/notifications/res/notification-launch.html b/example/notifications/res/notification-launch.html index e5f5cbac6b..41aee23e63 100644 --- a/example/notifications/res/notification-launch.html +++ b/example/notifications/res/notification-launch.html @@ -1,9 +1,9 @@ - + - + Success | Error | Alert | Progress - Notifications + \ No newline at end of file diff --git a/example/notifications/src/DialogLaunchIndicator.js b/example/notifications/src/DialogLaunchIndicator.js index 9330ce2194..7a392169e1 100644 --- a/example/notifications/src/DialogLaunchIndicator.js +++ b/example/notifications/src/DialogLaunchIndicator.js @@ -32,17 +32,15 @@ define( * launched for demonstration and testing purposes. * @constructor */ + function DialogLaunchIndicator() { } DialogLaunchIndicator.template = 'dialogLaunchTemplate'; - DialogLaunchIndicator.prototype.getGlyph = function () { - return "i"; - }; DialogLaunchIndicator.prototype.getGlyphClass = function () { - return 'caution'; + return 'ok'; }; DialogLaunchIndicator.prototype.getText = function () { return "Launch test dialog"; diff --git a/example/notifications/src/NotificationLaunchIndicator.js b/example/notifications/src/NotificationLaunchIndicator.js index 174810d721..1f1a5e166a 100644 --- a/example/notifications/src/NotificationLaunchIndicator.js +++ b/example/notifications/src/NotificationLaunchIndicator.js @@ -26,17 +26,21 @@ define( function () { "use strict"; + /** + * A tool for manually invoking notifications. When included this + * indicator will allow for notifications of different types to be + * launched for demonstration and testing purposes. + * @constructor + */ + function NotificationLaunchIndicator() { } NotificationLaunchIndicator.template = 'notificationLaunchTemplate'; - NotificationLaunchIndicator.prototype.getGlyph = function () { - return "i"; - }; NotificationLaunchIndicator.prototype.getGlyphClass = function () { - return 'caution'; + return 'ok'; }; NotificationLaunchIndicator.prototype.getText = function () { return "Launch notification"; diff --git a/example/profiling/src/DigestIndicator.js b/example/profiling/src/DigestIndicator.js index f19f28b548..d964be3ab2 100644 --- a/example/profiling/src/DigestIndicator.js +++ b/example/profiling/src/DigestIndicator.js @@ -59,8 +59,14 @@ define( update(); return { - getGlyph: function () { - return "."; + /** + * Get the glyph CSS class (single character used as an icon) + * to display in this indicator. This will return ".", + * which should appear as a dataflow icon. + * @returns {string} the character of the dataflow icon + */ + getCssClass: function () { + return "icon-connectivity"; }, getGlyphClass: function () { return undefined; diff --git a/example/profiling/src/WatchIndicator.js b/example/profiling/src/WatchIndicator.js index 1fe8c649a4..a55ab37c0d 100644 --- a/example/profiling/src/WatchIndicator.js +++ b/example/profiling/src/WatchIndicator.js @@ -55,13 +55,13 @@ define( return { /** - * Get the glyph (single character used as an icon) + * Get the glyph CSS class (single character used as an icon) * to display in this indicator. This will return ".", - * which should appear as a dataflow icon. + * which should appear as a database icon. * @returns {string} the character of the database icon */ - getGlyph: function () { - return "E"; + getCssClass: function () { + return "icon-database"; }, /** * Get the name of the CSS class to apply to the glyph. diff --git a/example/worker/src/FibonacciIndicator.js b/example/worker/src/FibonacciIndicator.js index 77a55bc531..d8b77f760e 100644 --- a/example/worker/src/FibonacciIndicator.js +++ b/example/worker/src/FibonacciIndicator.js @@ -50,8 +50,8 @@ define( requestNext(); return { - getGlyph: function () { - return "?"; + getCssClass: function () { + return "icon-object-unknown"; }, getText: function () { return latest; diff --git a/platform/commonUI/edit/src/creation/AddAction.js b/platform/commonUI/edit/src/creation/AddAction.js index 0ac56957a2..6e982352c9 100644 --- a/platform/commonUI/edit/src/creation/AddAction.js +++ b/platform/commonUI/edit/src/creation/AddAction.js @@ -52,6 +52,7 @@ define( this.metadata = { key: 'add', glyph: type.getGlyph(), + cssclass: type.getCssClass(), name: type.getName(), type: type.getKey(), description: type.getDescription(), diff --git a/platform/commonUI/edit/test/creation/AddActionProviderSpec.js b/platform/commonUI/edit/test/creation/AddActionProviderSpec.js index 121f9b193d..7bb1a9611e 100644 --- a/platform/commonUI/edit/test/creation/AddActionProviderSpec.js +++ b/platform/commonUI/edit/test/creation/AddActionProviderSpec.js @@ -45,6 +45,7 @@ define( [ "getKey", "getGlyph", + "getCssClass", "getName", "getDescription", "getProperties", diff --git a/platform/commonUI/edit/test/creation/CreateActionProviderSpec.js b/platform/commonUI/edit/test/creation/CreateActionProviderSpec.js index d8aefe17fa..521b9c22a5 100644 --- a/platform/commonUI/edit/test/creation/CreateActionProviderSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionProviderSpec.js @@ -41,6 +41,7 @@ define( [ "getKey", "getGlyph", + "getCssClass", "getName", "getDescription", "getProperties", diff --git a/platform/commonUI/edit/test/creation/CreateActionSpec.js b/platform/commonUI/edit/test/creation/CreateActionSpec.js index c2d8e64279..f6c0439cab 100644 --- a/platform/commonUI/edit/test/creation/CreateActionSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionSpec.js @@ -51,6 +51,7 @@ define( [ "getKey", "getGlyph", + "getCssClass", "getName", "getDescription", "getProperties", @@ -120,6 +121,7 @@ define( mockType.getKey.andReturn("test"); mockType.getGlyph.andReturn("T"); + mockType.getCssClass.andReturn("icon-telemetry"); mockType.getDescription.andReturn("a test type"); mockType.getName.andReturn("Test"); mockType.getProperties.andReturn([]); @@ -138,6 +140,7 @@ define( expect(metadata.name).toEqual("Test"); expect(metadata.description).toEqual("a test type"); expect(metadata.glyph).toEqual("T"); + expect(metadata.cssclass).toEqual("icon-telemetry"); }); describe("the perform function", function () { diff --git a/platform/commonUI/edit/test/creation/CreateWizardSpec.js b/platform/commonUI/edit/test/creation/CreateWizardSpec.js index 628fdbc447..0e25b87a82 100644 --- a/platform/commonUI/edit/test/creation/CreateWizardSpec.js +++ b/platform/commonUI/edit/test/creation/CreateWizardSpec.js @@ -54,6 +54,7 @@ define( [ "getKey", "getGlyph", + "getCssClass", "getName", "getDescription", "getProperties", @@ -75,6 +76,7 @@ define( mockType.getKey.andReturn("test"); mockType.getGlyph.andReturn("T"); + mockType.getCssClass.andReturn("icon-telemetry"); mockType.getDescription.andReturn("a test type"); mockType.getName.andReturn("Test"); mockType.getInitialModel.andReturn(testModel); diff --git a/platform/commonUI/general/res/templates/indicator.html b/platform/commonUI/general/res/templates/indicator.html index 7b1f11a4d3..2e89ad24ec 100644 --- a/platform/commonUI/general/res/templates/indicator.html +++ b/platform/commonUI/general/res/templates/indicator.html @@ -24,12 +24,10 @@ title="{{ngModel.getDescription()}}" ng-click='ngModel.configure()' ng-show="ngModel.getText().length > 0"> - - {{ngModel.getGlyph()}} - {{ngModel.getText()}} - G + \ No newline at end of file diff --git a/platform/commonUI/general/test/controllers/BottomBarControllerSpec.js b/platform/commonUI/general/test/controllers/BottomBarControllerSpec.js index cc58d4558c..3c994a6585 100644 --- a/platform/commonUI/general/test/controllers/BottomBarControllerSpec.js +++ b/platform/commonUI/general/test/controllers/BottomBarControllerSpec.js @@ -35,7 +35,7 @@ define( beforeEach(function () { mockIndicator = jasmine.createSpyObj( "indicator", - ["getGlyph", "getText"] + ["getGlyph", "getCssClass", "getText"] ); testIndicatorA = {}; diff --git a/platform/commonUI/general/test/ui/TreeViewSpec.js b/platform/commonUI/general/test/ui/TreeViewSpec.js index c889c31090..06b4e70c3c 100644 --- a/platform/commonUI/general/test/ui/TreeViewSpec.js +++ b/platform/commonUI/general/test/ui/TreeViewSpec.js @@ -107,6 +107,7 @@ define([ return { context: jasmine.createSpyObj('context', ['getPath']), type: jasmine.createSpyObj('type', ['getGlyph']), + cssclass: jasmine.createSpyObj('cssclass', ['getCssClass']), location: jasmine.createSpyObj('location', ['isLink']), mutation: jasmine.createSpyObj('mutation', ['listen']), status: mockStatus diff --git a/platform/commonUI/notification/res/notification-indicator.html b/platform/commonUI/notification/res/notification-indicator.html index 2a2ec074df..95a1a32620 100644 --- a/platform/commonUI/notification/res/notification-indicator.html +++ b/platform/commonUI/notification/res/notification-indicator.html @@ -2,7 +2,7 @@ - + {{notifications.length}} Notifications {{notifications.length}} diff --git a/platform/core/src/types/TypeImpl.js b/platform/core/src/types/TypeImpl.js index b761cc0a1c..6d3d27a511 100644 --- a/platform/core/src/types/TypeImpl.js +++ b/platform/core/src/types/TypeImpl.js @@ -145,6 +145,7 @@ define( }; TypeImpl.prototype.getGlyph = function () { + // TO-DO: remove this function return this.typeDef.glyph; }; diff --git a/platform/core/test/types/TypeImplSpec.js b/platform/core/test/types/TypeImplSpec.js index 9f911de157..0c1c8e7347 100644 --- a/platform/core/test/types/TypeImplSpec.js +++ b/platform/core/test/types/TypeImplSpec.js @@ -34,6 +34,7 @@ define( 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'], properties: [{}], @@ -58,6 +59,10 @@ define( expect(type.getGlyph()).toEqual('t'); }); + it("exposes glyph CSS class from definition", function() { + expect(type.getCssClass()).toEqual('icon-telemetry-panel'); + }); + it("exposes its underlying type definition", function () { expect(type.getDefinition()).toEqual(testTypeDef); }); diff --git a/platform/core/test/types/TypeProviderSpec.js b/platform/core/test/types/TypeProviderSpec.js index 4d2a359e33..9496c02a05 100644 --- a/platform/core/test/types/TypeProviderSpec.js +++ b/platform/core/test/types/TypeProviderSpec.js @@ -31,17 +31,20 @@ define( { 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'] }, { @@ -71,6 +74,7 @@ define( 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(); }); @@ -79,6 +83,7 @@ define( 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"); }); @@ -87,6 +92,7 @@ define( 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"); }); diff --git a/platform/features/clock/src/indicators/ClockIndicator.js b/platform/features/clock/src/indicators/ClockIndicator.js index 731b87e625..385e42d51e 100644 --- a/platform/features/clock/src/indicators/ClockIndicator.js +++ b/platform/features/clock/src/indicators/ClockIndicator.js @@ -44,8 +44,8 @@ define( }); } - ClockIndicator.prototype.getGlyph = function () { - return "C"; + ClockIndicator.prototype.getCssClass = function () { + return "icon-clock"; }; ClockIndicator.prototype.getGlyphClass = function () { diff --git a/platform/features/clock/test/indicators/ClockIndicatorSpec.js b/platform/features/clock/test/indicators/ClockIndicatorSpec.js index dd4b9e9a46..48960fd84d 100644 --- a/platform/features/clock/test/indicators/ClockIndicatorSpec.js +++ b/platform/features/clock/test/indicators/ClockIndicatorSpec.js @@ -48,7 +48,7 @@ define( }); it("implements the Indicator interface", function () { - expect(indicator.getGlyph()).toEqual(jasmine.any(String)); + 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)); diff --git a/platform/identity/src/IdentityIndicator.js b/platform/identity/src/IdentityIndicator.js index ae553b60cd..e97ca9ec0f 100644 --- a/platform/identity/src/IdentityIndicator.js +++ b/platform/identity/src/IdentityIndicator.js @@ -43,8 +43,8 @@ define( }); } - IdentityIndicator.prototype.getGlyph = function () { - return this.text && "P"; + IdentityIndicator.prototype.getCssClass = function () { + return "icon-person"; }; IdentityIndicator.prototype.getGlyphClass = function () { return undefined; diff --git a/platform/identity/test/IdentityIndicatorSpec.js b/platform/identity/test/IdentityIndicatorSpec.js index 66c2b790b9..06df7445e9 100644 --- a/platform/identity/test/IdentityIndicatorSpec.js +++ b/platform/identity/test/IdentityIndicatorSpec.js @@ -46,8 +46,7 @@ define( key: "testuserid", name: "A User" }); - // Should have a single character glyph - expect(indicator.getGlyph().length).toEqual(1); + expect(indicator.getCssClass()).toEqual("icon-person"); expect(indicator.getGlyphClass()).toBeUndefined(); expect(indicator.getText()).toEqual("A User"); expect(indicator.getDescription().indexOf("testuserid")) @@ -55,7 +54,7 @@ define( }); it("shows nothing while no user information is available", function () { - expect(indicator.getGlyph()).toBeUndefined(); + expect(indicator.getCssClass()).toBeUndefined(); expect(indicator.getGlyphClass()).toBeUndefined(); expect(indicator.getText()).toBeUndefined(); expect(indicator.getDescription()).toBeUndefined(); @@ -63,7 +62,7 @@ define( it("shows nothing when there is no identity information", function () { mockPromise.then.mostRecentCall.args[0](undefined); - expect(indicator.getGlyph()).toBeUndefined(); + expect(indicator.getCssClass()).toBeUndefined(); expect(indicator.getGlyphClass()).toBeUndefined(); expect(indicator.getText()).toBeUndefined(); expect(indicator.getDescription()).toBeUndefined(); diff --git a/platform/persistence/couch/src/CouchIndicator.js b/platform/persistence/couch/src/CouchIndicator.js index 223a12b7c4..32cb855f47 100644 --- a/platform/persistence/couch/src/CouchIndicator.js +++ b/platform/persistence/couch/src/CouchIndicator.js @@ -95,8 +95,8 @@ define( $interval(updateIndicator, interval); } - CouchIndicator.prototype.getGlyph = function () { - return "D"; + CouchIndicator.prototype.getCssClass = function () { + return "icon-database"; }; CouchIndicator.prototype.getGlyphClass = function () { diff --git a/platform/persistence/couch/test/CouchIndicatorSpec.js b/platform/persistence/couch/test/CouchIndicatorSpec.js index 5d056a42cf..e00bc68cf6 100644 --- a/platform/persistence/couch/test/CouchIndicatorSpec.js +++ b/platform/persistence/couch/test/CouchIndicatorSpec.js @@ -57,7 +57,7 @@ define( }); it("has a database icon", function () { - expect(indicator.getGlyph()).toEqual("D"); + expect(indicator.getCssClass()).toEqual("icon-database"); }); it("consults the database at the configured path", function () { diff --git a/platform/persistence/elastic/src/ElasticIndicator.js b/platform/persistence/elastic/src/ElasticIndicator.js index b55878f0b9..9aa84d4fd0 100644 --- a/platform/persistence/elastic/src/ElasticIndicator.js +++ b/platform/persistence/elastic/src/ElasticIndicator.js @@ -81,8 +81,8 @@ define( $interval(updateIndicator, interval, 0, false); } - ElasticIndicator.prototype.getGlyph = function () { - return "D"; + ElasticIndicator.prototype.getCssClass = function () { + return "icon-database"; }; ElasticIndicator.prototype.getGlyphClass = function () { return this.state.glyphClass; diff --git a/platform/persistence/elastic/test/ElasticIndicatorSpec.js b/platform/persistence/elastic/test/ElasticIndicatorSpec.js index 9f675c5f00..b0f2d50988 100644 --- a/platform/persistence/elastic/test/ElasticIndicatorSpec.js +++ b/platform/persistence/elastic/test/ElasticIndicatorSpec.js @@ -59,7 +59,7 @@ define( }); it("has a database icon", function () { - expect(indicator.getGlyph()).toEqual("D"); + expect(indicator.getCssClass()).toEqual("icon-database"); }); it("consults the database at the configured path", function () { diff --git a/platform/persistence/local/src/LocalStorageIndicator.js b/platform/persistence/local/src/LocalStorageIndicator.js index 37ab457098..b188ae1ccb 100644 --- a/platform/persistence/local/src/LocalStorageIndicator.js +++ b/platform/persistence/local/src/LocalStorageIndicator.js @@ -40,8 +40,8 @@ define( function LocalStorageIndicator() { } - LocalStorageIndicator.prototype.getGlyph = function () { - return "D"; + LocalStorageIndicator.prototype.getCssClass = function () { + return "icon-database"; }; LocalStorageIndicator.prototype.getGlyphClass = function () { return 'caution'; diff --git a/platform/persistence/local/test/LocalStorageIndicatorSpec.js b/platform/persistence/local/test/LocalStorageIndicatorSpec.js index 566275f0b6..8774ab45cb 100644 --- a/platform/persistence/local/test/LocalStorageIndicatorSpec.js +++ b/platform/persistence/local/test/LocalStorageIndicatorSpec.js @@ -38,7 +38,7 @@ define( }); it("has a database icon", function () { - expect(indicator.getGlyph()).toEqual("D"); + expect(indicator.getCssClass()).toEqual("icon-database"); }); it("has a 'caution' class to draw attention", function () {