diff --git a/waltz-ng/client/common/services/enums/entity.js b/waltz-ng/client/common/services/enums/entity.js index 78ac71a3fd..c3c0f8e83c 100644 --- a/waltz-ng/client/common/services/enums/entity.js +++ b/waltz-ng/client/common/services/enums/entity.js @@ -44,7 +44,7 @@ export const entity = { ATTESTATION: { key: 'ATTESTATION', name: 'Attestation', - icon: 'check-square-o', + icon: 'check-square', description: null, position: 65 }, @@ -177,7 +177,7 @@ export const entity = { PROCESS: { key: 'PROCESS', name: 'Process', - icon: 'code-fork', + icon: 'code-branch', description: null, position: 230 }, diff --git a/waltz-ng/client/navbar/directives/navbar-profile.html b/waltz-ng/client/navbar/directives/navbar-profile.html index b4a4f45987..21bf9da8a2 100644 --- a/waltz-ng/client/navbar/directives/navbar-profile.html +++ b/waltz-ng/client/navbar/directives/navbar-profile.html @@ -58,7 +58,7 @@ + name="check-square"> Attestations ({ + previous: arr[0], + iconSet: arr[1], + current: arr[2] + })) + .keyBy('previous') + .value(); + + +export function mkIconSetName(currentIconSet, name) { + if (faReplacements[name]) { + const iconSet = faReplacements[name].iconSet; + if (iconSet && iconSet !== currentIconSet) { + console.warn(`Icon [${name}] namespace updated to [${iconSet}]`); + return `${iconSet}`; + } + } + return currentIconSet; +} + + +export function mkCurrentName(name) { + if (faReplacements[name]) { + const currentName = faReplacements[name].current; + if (currentName) { + console.warn(`Icon [${name}] name updated to [${currentName}]`); + return `fa-${currentName}`; + } + } + return `fa-${name}`; + +} diff --git a/waltz-ng/client/widgets/icon.js b/waltz-ng/client/widgets/icon.js index 9f097c63bf..ccd3faf30d 100644 --- a/waltz-ng/client/widgets/icon.js +++ b/waltz-ng/client/widgets/icon.js @@ -17,8 +17,13 @@ * along with this program. If not, see . */ +import '@fortawesome/fontawesome-free/js/all' +import {mkCurrentName, mkIconSetName} from './icon-utils'; +import {initialiseData} from "../common/index"; + const bindings = { name: '@', + iconSet: '@', size: '@', flip: '@', rotate: '@', @@ -28,16 +33,20 @@ const bindings = { spin: '@' }; +const initialState = { + iconSet: 'fa' +}; + const template = ''; function controller() { - const vm = this; + const vm = initialiseData(this, initialState); vm.$onChanges = () => { vm.classNames = [ - 'fa', - `fa-${vm.name}`, + mkIconSetName(vm.iconSet, vm.name), + mkCurrentName(vm.name), vm.flip ? `fa-flip-${vm.flip}` : '', vm.rotate ? `fa-rotate-${vm.rotate}` : '', vm.size ? `fa-${vm.size}` : '', diff --git a/waltz-ng/package.json b/waltz-ng/package.json index 671572a26d..14ae11bec4 100644 --- a/waltz-ng/package.json +++ b/waltz-ng/package.json @@ -17,6 +17,7 @@ "start": "node lib/server-production" }, "dependencies": { + "@fortawesome/fontawesome-free": "^5.1.0-4", "angular": "1.5.11", "angular-animate": "1.5.11", "angular-formly": "8.4.1", @@ -50,7 +51,6 @@ "d3-time-format": "2.0.5", "d3-transition": "1.0.4", "d3-zoom": "1.1.4", - "font-awesome": "4.7.0", "intro.js": "^2.3.0", "json-stable-stringify": "^1.0.1", "lodash": "4.17.4", diff --git a/waltz-ng/style/style.scss b/waltz-ng/style/style.scss index f3c8e5816f..1bdace3388 100644 --- a/waltz-ng/style/style.scss +++ b/waltz-ng/style/style.scss @@ -4,11 +4,6 @@ $icon-font-path: "../node_modules/bootstrap-sass/assets/fonts/bootstrap/"; @import "../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap"; -/* FONT-AWESOME */ -$fa-font-path: "../node_modules/font-awesome/fonts"; -@import "../node_modules/font-awesome/scss/font-awesome"; - - @import "../node_modules/ui-select/dist/select.css"; @import "../node_modules/angular-ui-grid/ui-grid.css"; @import "../node_modules/ng-tags-input/build/ng-tags-input.min.css";