diff --git a/extensions/default/src/ViewerLayout/index.tsx b/extensions/default/src/ViewerLayout/index.tsx index 3125dd136..dac359e7a 100644 --- a/extensions/default/src/ViewerLayout/index.tsx +++ b/extensions/default/src/ViewerLayout/index.tsx @@ -156,7 +156,7 @@ function ViewerLayout({ ) : null} - + ); diff --git a/platform/app/public/config/default.js b/platform/app/public/config/default.js index 4bfde813d..42cae0c7f 100644 --- a/platform/app/public/config/default.js +++ b/platform/app/public/config/default.js @@ -332,30 +332,8 @@ window.config = { }, advanceOn: { selector: '.cornerstone-viewport-element', - event: 'CORNERSTONE_CAMERA_MODIFIED', + event: 'CORNERSTONE_TOOLS_MOUSE_UP', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ }, { id: 'pan', @@ -365,30 +343,8 @@ window.config = { }, advanceOn: { selector: '.cornerstone-viewport-element', - event: 'CORNERSTONE_TOOLS_MOUSE_DRAG', + event: 'CORNERSTONE_TOOLS_MOUSE_UP', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ }, { id: 'windowing', @@ -397,28 +353,10 @@ window.config = { element: '.viewport-element', on: 'left-start', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '.cornerstone-viewport-element', + event: 'CORNERSTONE_TOOLS_MOUSE_UP', + }, }, { id: 'length', @@ -427,28 +365,10 @@ window.config = { element: '[data-cy="MeasurementTools-split-button-primary"]', on: 'bottom', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '[data-cy="MeasurementTools-split-button-primary"]', + event: 'click', + }, }, { id: 'drawAnnotation', @@ -457,28 +377,10 @@ window.config = { element: '.viewport-element', on: 'left-start', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: 'body', + event: 'event::measurement_added', + }, }, { id: 'trackMeasurement', @@ -487,28 +389,10 @@ window.config = { element: '[data-cy="prompt-begin-tracking-yes-btn"]', on: 'bottom', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '[data-cy="prompt-begin-tracking-yes-btn"]', + event: 'click', + }, }, { id: 'openMeasurementPanel', @@ -517,58 +401,22 @@ window.config = { element: '#trackedMeasurements-btn', on: 'left-start', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '#trackedMeasurements-btn', + event: 'click', + }, }, { id: 'scrollAwayFromMeasurement', text: 'Scroll the images using the mouse wheel away from the measurement.', attachTo: { - element: '.viewport-element', + element: '.scroll', on: 'left-start', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '.cornerstone-viewport-element', + event: 'CORNERSTONE_TOOLS_MOUSE_WHEEL', + }, }, { id: 'jumpToMeasurement', @@ -577,28 +425,10 @@ window.config = { element: '[data-cy="measurement-item"]', on: 'left-start', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '[data-cy="measurement-item"]', + event: 'click', + }, }, { id: 'changeLayout', @@ -607,28 +437,10 @@ window.config = { element: '[data-cy="Layout"]', on: 'bottom', }, - /** - buttons: [ - { - text: 'Next', - action() { - this.next(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '[data-cy="Layout"]', + event: 'click', + }, }, { id: 'selectLayout', @@ -637,28 +449,10 @@ window.config = { element: '[data-cy="MPR"]', on: 'left-start', }, - /** - buttons: [ - { - text: 'Complete', - action() { - this.complete(); - }, - }, - { - text: 'Skip', - action() { - this.cancel(); - }, - }, - { - text: 'Back', - action() { - this.back(); - }, - }, - ], - */ + advanceOn: { + selector: '[data-cy="MPR"]', + event: 'click', + }, }, ], tourOptions: {}, diff --git a/platform/app/src/routes/WorkList/WorkList.tsx b/platform/app/src/routes/WorkList/WorkList.tsx index 785810ca3..f8a6c76d3 100644 --- a/platform/app/src/routes/WorkList/WorkList.tsx +++ b/platform/app/src/routes/WorkList/WorkList.tsx @@ -535,7 +535,7 @@ function WorkList({ WhiteLabeling={appConfig.whiteLabeling} showPatientInfo={PatientInfoVisibility.DISABLED} /> - +
0; const hasCallbacks = Array.isArray(this.listeners[eventName]); + const event = new CustomEvent(eventName, { detail: callbackProps }); + document.body.dispatchEvent(event); + if (hasListeners && hasCallbacks) { this.listeners[eventName].forEach(listener => { listener.callback(callbackProps); diff --git a/platform/ui-next/src/components/Onboarding/Onboarding.tsx b/platform/ui-next/src/components/Onboarding/Onboarding.tsx index 415ffff90..da257f8c4 100644 --- a/platform/ui-next/src/components/Onboarding/Onboarding.tsx +++ b/platform/ui-next/src/components/Onboarding/Onboarding.tsx @@ -17,7 +17,7 @@ const markTourAsShown = (tourId: string) => { } }; -const Onboarding = () => { +const Onboarding = ({ servicesManager }: withAppTypes) => { const Shepherd = useShepherd(); const location = useLocation(); const tours = window.config.tours as Array<{ @@ -50,7 +50,7 @@ const Onboarding = () => { } }); - if (!hasTourBeenShown(matchingTour.id)) { + if (true) { observer.observe(document.body, { childList: true, subtree: true }); setTimeout(() => observer.disconnect(), 5000); } @@ -59,6 +59,7 @@ const Onboarding = () => { startTour(); } }, [Shepherd, tours, location.pathname]); + return null; };