This commit is contained in:
Ibrahim 2024-09-27 15:44:01 -04:00
parent ea7a3e07cb
commit 579c0c9d01
5 changed files with 47 additions and 249 deletions

View File

@ -156,7 +156,7 @@ function ViewerLayout({
) : null}
</React.Fragment>
</div>
<Onboarding />
<Onboarding servicesManager={servicesManager} />
<InvestigationalUseDialog dialogConfiguration={appConfig?.investigationalUseDialog} />
</div>
);

View File

@ -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: {},

View File

@ -535,7 +535,7 @@ function WorkList({
WhiteLabeling={appConfig.whiteLabeling}
showPatientInfo={PatientInfoVisibility.DISABLED}
/>
<Onboarding />
<Onboarding servicesManager={servicesManager} />
<InvestigationalUseDialog dialogConfiguration={appConfig?.investigationalUseDialog} />
<div className="ohif-scrollbar ohif-scrollbar-stable-gutter flex grow flex-col overflow-y-auto sm:px-5">
<StudyListFilter

View File

@ -80,6 +80,9 @@ function _broadcastEvent(eventName, callbackProps) {
const hasListeners = Object.keys(this.listeners).length > 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);

View File

@ -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;
};