diff --git a/extensions/ohif-cornerstone-extension/src/ToolbarModule.js b/extensions/ohif-cornerstone-extension/src/ToolbarModule.js index df3fb99ee..6f01cf867 100644 --- a/extensions/ohif-cornerstone-extension/src/ToolbarModule.js +++ b/extensions/ohif-cornerstone-extension/src/ToolbarModule.js @@ -29,7 +29,7 @@ class ToolbarModule extends Component { active={this.state.cineDialogOpen} onClick={this.onClickCineToolbarButton} text={'CINE'} - iconClasses={'fab fa-youtube'} + icon="tool-cineplay-toggle" />
diff --git a/extensions/ohif-vtk-extension/src/ConnectedToolbarSection.js b/extensions/ohif-vtk-extension/src/ConnectedToolbarSection.js index 19f2e18f0..963e01ce2 100644 --- a/extensions/ohif-vtk-extension/src/ConnectedToolbarSection.js +++ b/extensions/ohif-vtk-extension/src/ConnectedToolbarSection.js @@ -3,7 +3,6 @@ import { ToolbarSection } from 'react-viewerbase'; import OHIF from 'ohif-core'; const { setToolActive } = OHIF.redux.actions; -const Icons = `${window.config.routerBasename}/icons.svg`.replace('//', '/'); const mapStateToProps = state => { const activeButton = state.tools.buttons.find(tool => tool.active === true); @@ -14,7 +13,7 @@ const mapStateToProps = state => { command: 'Rotate', type: 'tool', text: 'Rotate', - svgUrl: `${Icons}#3d-rotate`, + icon: '3d-rotate', active: true } ], diff --git a/src/utils/getDefaultToolbarButtons.js b/src/utils/getDefaultToolbarButtons.js index 7c7d584fd..d9885a095 100644 --- a/src/utils/getDefaultToolbarButtons.js +++ b/src/utils/getDefaultToolbarButtons.js @@ -1,115 +1,101 @@ -/** - * - * @param {String} [baseDirectory='/'] - */ -export default function(baseDirectory = '/') { - const iconsFileName = 'icons.svg' - const sanitizedBaseDirectory = - baseDirectory[baseDirectory.length - 1] === '/' - ? baseDirectory - : `${baseDirectory}/` - const relativePathToIcons = `${sanitizedBaseDirectory}${iconsFileName}`.replace( - '//', - '/' - ) - +export default function() { return [ { command: 'StackScroll', type: 'tool', text: 'Stack Scroll', - svgUrl: `${relativePathToIcons}#icon-tools-stack-scroll`, + icon: 'tool-stack-scroll', active: false, }, { command: 'Zoom', type: 'tool', text: 'Zoom', - svgUrl: `${relativePathToIcons}#icon-tools-zoom`, + icon: 'tool-zoom', active: false, }, { command: 'Wwwc', type: 'tool', text: 'Levels', - svgUrl: `${relativePathToIcons}#icon-tools-levels`, + icon: 'tool-levels', active: true, }, { command: 'Pan', type: 'tool', text: 'Pan', - svgUrl: `${relativePathToIcons}#icon-tools-pan`, + icon: 'tool-pan', active: false, }, { command: 'Length', type: 'tool', text: 'Length', - svgUrl: `${relativePathToIcons}#icon-tools-measure-temp`, + icon: 'tool-measure-temp', active: false, }, /*{ command: 'Annotate', type: 'tool', text: 'Annotate', - svgUrl: `${Icons}#icon-tools-measure-non-target`, + icon: `${Icons}#icon-tools-measure-non-target`, active: false },*/ { command: 'Angle', type: 'tool', text: 'Angle', - iconClasses: 'fa fa-angle-left', + icon: 'angle-left', active: false, }, { command: 'Bidirectional', type: 'tool', text: 'Bidirectional', - svgUrl: `${relativePathToIcons}#icon-tools-measure-target`, + icon: 'tool-measure-target', active: false, }, { command: 'Brush', type: 'tool', text: 'Brush', - iconClasses: 'fa fa-circle', + icon: 'circle', active: false, }, { command: 'FreehandMouse', type: 'tool', text: 'Freehand', - iconClasses: 'fa fa-star', + icon: 'star', active: false, }, { command: 'EllipticalRoi', type: 'tool', text: 'EllipticalRoi', - iconClasses: 'far fa-circle', + icon: 'circle', active: false, }, { command: 'CircleRoi', type: 'tool', text: 'CircleRoi', - iconClasses: 'far fa-dot-circle', + icon: 'dot-circle', active: false, }, { command: 'RectangleRoi', type: 'tool', text: 'RectangleRoi', - iconClasses: 'far fa-square', + icon: 'square', active: false, }, { command: 'reset', type: 'command', text: 'Reset', - svgUrl: `${relativePathToIcons}#icon-tools-reset`, + icon: 'tool-reset', active: false, }, ] diff --git a/src/utils/getDefaultToolbarButtons.test.js b/src/utils/getDefaultToolbarButtons.test.js index 2fa45839b..dec3dc6c6 100644 --- a/src/utils/getDefaultToolbarButtons.test.js +++ b/src/utils/getDefaultToolbarButtons.test.js @@ -2,25 +2,8 @@ import getDefaultToolbarButtons from './getDefaultToolbarButtons.js' describe('getDefaultToolbarButtons.js', () => { it('returns a non-empty array', () => { - const basePath = '/' - - const buttons = getDefaultToolbarButtons(basePath) + const buttons = getDefaultToolbarButtons() expect(buttons.length).toBeGreaterThan(0) }) - - it('uses the provided basePath in buttons with an svgUrl property', () => { - const basePath = '/demo/' - - const buttons = getDefaultToolbarButtons(basePath) - const hasOneOrMoreButtonsWithSvgUrlProperty = buttons.some(btn => - btn.hasOwnProperty('svgUrl') - ) - const usesBasePathInButtonSvgUrls = buttons.every( - btn => !btn.hasOwnProperty('svgUrl') || btn.svgUrl.includes(basePath) - ) - - expect(hasOneOrMoreButtonsWithSvgUrlProperty).toBeTruthy() - expect(usesBasePathInButtonSvgUrls).toBeTruthy() - }) })