feat(toolbox): Refactor Toolbar and Toolbox to enable sections (#4825)

This commit is contained in:
Alireza authored and GitHub committed 2025-03-06 22:19:47 -05:00
1 parent 86c12246ac
commit cc5cdfb081
79 files changed
+3527 -2992

No files matched your search

@@ -1,108 +1,95 @@
describe('OHIF Download Snapshot File', () => {
beforeEach(() => {
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.openDownloadImageModal();
});
// describe('OHIF Download Snapshot File', () => {
// beforeEach(() => {
// cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
// cy.expectMinimumThumbnails(3);
// cy.openDownloadImageModal();
// });
it('checks displayed information for Desktop experience', function () {
// Set Desktop resolution
// cy.viewport(1750, 720);
// Visual comparison
// cy.screenshot('Download Image Modal - Desktop experience');
//Check if all elements are displayed
// it('checks displayed information for Desktop experience', function () {
// // Set Desktop resolution
// // cy.viewport(1750, 720);
// // Visual comparison
// // cy.screenshot('Download Image Modal - Desktop experience');
// //Check if all elements are displayed
// TODO: need to add this attribute to the modal
cy.get('[data-cy=modal-header]')
.as('downloadImageModal')
.should('contain.text', 'Download High Quality Image');
// // Check image preview
// cy.get('[data-cy="image-preview"]').should('contain.text', 'Image preview');
// Check input fields
// TODO: select2
// cy.get('[data-cy="file-type"]')
// .select('png')
// .should('have.value', 'png')
// .select('jpg')
// .should('have.value', 'jpg');
// //TODO: This is a canvas now, not an img with src
// // cy.get('[data-cy="viewport-preview-img"]')
// // .should('have.attr', 'src')
// // .and('include', 'data:image');
// Check image preview
cy.get('[data-cy="image-preview"]').should('contain.text', 'Image preview');
// // Check buttons
// cy.get('[data-cy="cancel-btn"]').scrollIntoView().should('be.visible');
// cy.get('[data-cy="download-btn"]').scrollIntoView().should('be.visible');
//TODO: This is a canvas now, not an img with src
// cy.get('[data-cy="viewport-preview-img"]')
// .should('have.attr', 'src')
// .and('include', 'data:image');
// cy.get('[data-cy="cancel-btn"]').click();
// });
// Check buttons
cy.get('[data-cy="cancel-btn"]').scrollIntoView().should('be.visible');
cy.get('[data-cy="download-btn"]').scrollIntoView().should('be.visible');
// /*it('cancel changes on download modal', function() {
// //Change Image Width, Filename and File Type
// cy.get('[data-cy="image-width"]')
// .clear()
// .type('300');
// cy.get('[data-cy="image-height"]') //Image Height should be the same as width
// .should('have.value', '300');
// cy.get('[data-cy="file-name"]')
// .clear()
// .type('new-filename');
// cy.get('[data-cy="file-type"]').select('png');
// //Click on Cancel button
// cy.get('[data-cy="cancel-btn"]')
// .scrollIntoView()
// .click();
// //Check modal is closed
// cy.get('[data-cy="modal"]').should('not.exist');
// //Open Modal
// cy.openDownloadImageModal();
// //Verify default values was restored
// cy.get('[data-cy="image-width"]').should('have.value', '512');
// cy.get('[data-cy="file-name"]').should('have.value', 'image');
// cy.get('[data-cy=file-type]').should('have.value', 'jpg');
// });*/
cy.get('[data-cy="cancel-btn"]').click();
});
// // TO-DO once issue is fixed: https://github.com/OHIF/Viewers/issues/1217
// // it('checks error messages for empty fields', function() {
// // //Clear fields Image Width and Filename
// // cy.get('[data-cy="image-width"]').clear();
// // cy.get('[data-cy="file-name"]').clear();
/*it('cancel changes on download modal', function() {
//Change Image Width, Filename and File Type
cy.get('[data-cy="image-width"]')
.clear()
.type('300');
cy.get('[data-cy="image-height"]') //Image Height should be the same as width
.should('have.value', '300');
cy.get('[data-cy="file-name"]')
.clear()
.type('new-filename');
cy.get('[data-cy="file-type"]').select('png');
//Click on Cancel button
cy.get('[data-cy="cancel-btn"]')
.scrollIntoView()
.click();
//Check modal is closed
cy.get('[data-cy="modal"]').should('not.exist');
//Open Modal
cy.openDownloadImageModal();
//Verify default values was restored
cy.get('[data-cy="image-width"]').should('have.value', '512');
cy.get('[data-cy="file-name"]').should('have.value', 'image');
cy.get('[data-cy=file-type]').should('have.value', 'jpg');
});*/
// // //Click on Download button
// // cy.get('[data-cy="download-btn"]')
// // .scrollIntoView()
// // .click();
// // //Check error message
// // });
// TO-DO once issue is fixed: https://github.com/OHIF/Viewers/issues/1217
// it('checks error messages for empty fields', function() {
// //Clear fields Image Width and Filename
// cy.get('[data-cy="image-width"]').clear();
// cy.get('[data-cy="file-name"]').clear();
// /*it('checks if "Show Annotations" checkbox will display annotations', function() {
// // Close modal that is initially opened
// cy.get('[data-cy="close-button"]').click();
// //Click on Download button
// cy.get('[data-cy="download-btn"]')
// .scrollIntoView()
// .click();
// //Check error message
// });
// // Add measurements in the viewport
// cy.addLengthMeasurement();
// cy.addAngleMeasurement();
/*it('checks if "Show Annotations" checkbox will display annotations', function() {
// Close modal that is initially opened
cy.get('[data-cy="close-button"]').click();
// Add measurements in the viewport
cy.addLengthMeasurement();
cy.addAngleMeasurement();
// Open Modal
cy.openDownloadImageModal();
// Select "Show Annotations" option
cy.get('[data-cy="show-annotations"]').check();
// Check image preview
cy.get('[data-cy="image-preview"]').scrollIntoView();
//Compare classes that exists on Image Preview with Annotations and Without Annotation
cy.get('[data-cy="modal-content"]')
.find('canvas')
.should('have.class', 'magnifyTool'); //Class "MagnifyTool" exists with annotations displayed on Image preview
// Uncheck "Show Annotations" option
cy.get('[data-cy="show-annotations"]')
.uncheck()
.wait(300);
// Check that class "MagnifyTool" should not exist
cy.get('[data-cy="modal-content"]')
.find('canvas')
.should('not.have.class', 'magnifyTool');
});*/
});
// // Open Modal
// cy.openDownloadImageModal();
// // Select "Show Annotations" option
// cy.get('[data-cy="show-annotations"]').check();
// // Check image preview
// cy.get('[data-cy="image-preview"]').scrollIntoView();
// //Compare classes that exists on Image Preview with Annotations and Without Annotation
// cy.get('[data-cy="modal-content"]')
// .find('canvas')
// .should('have.class', 'magnifyTool'); //Class "MagnifyTool" exists with annotations displayed on Image preview
// // Uncheck "Show Annotations" option
// cy.get('[data-cy="show-annotations"]')
// .uncheck()
// .wait(300);
// // Check that class "MagnifyTool" should not exist
// cy.get('[data-cy="modal-content"]')
// .find('canvas')
// .should('not.have.class', 'magnifyTool');
// });*/
// });
+2 -2
View File
@@ -4,8 +4,8 @@ export function initCornerstoneToolsAliases() {
// cy.get('[data-cy="StackScroll"]').as('stackScrollBtn');
cy.get('[data-cy="Zoom"]').as('zoomBtn');
cy.get('[data-cy="WindowLevel-split-button-primary"]').as('wwwcBtnPrimary');
cy.get('[data-cy="WindowLevel-split-button-secondary"]').as('wwwcBtnSecondary');
cy.get('[data-cy="WindowLevelGroup-split-button-primary"]').as('wwwcBtnPrimary');
cy.get('[data-cy="WindowLevelGroup-split-button-secondary"]').as('wwwcBtnSecondary');
cy.get('[data-cy="Pan"]').as('panBtn');
cy.get('[data-cy="MeasurementTools-split-button-primary"]').as('measurementToolsBtnPrimary');
cy.get('[data-cy="MeasurementTools-split-button-secondary"]').as('measurementToolsBtnSecondary');
+1 -1
View File
@@ -54,7 +54,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.4",
"@cornerstonejs/codec-openjph": "^2.4.5",
"@cornerstonejs/dicom-image-loader": "^3.0.1",
"@cornerstonejs/dicom-image-loader": "^3.0.4",
"@emotion/serialize": "^1.1.3",
"@ohif/core": "3.10.0-beta.116",
"@ohif/extension-cornerstone": "3.10.0-beta.116",
+1 -7
View File
@@ -6,13 +6,7 @@ window.config = {
// whiteLabeling: {},
extensions: [],
modes: [],
customizationService: {
'viewportActionMenu.windowLevelActionMenu': {
$merge: {
location: 0,
},
},
},
customizationService: {},
showStudyList: true,
// some windows systems have issues with more than 3 web workers
maxNumberOfWebWorkers: 3,
-2
View File
@@ -26,7 +26,6 @@ import {
ViewportGridProvider,
DialogProvider,
TooltipProvider,
ToolboxProvider,
Modal as ModalNext,
ManagedDialog,
ModalProvider,
@@ -117,7 +116,6 @@ function App({
[ThemeWrapperNext],
[ThemeWrapper],
[SystemContextProvider, { commandsManager, extensionManager, hotkeysManager, servicesManager }],
[ToolboxProvider],
[ViewportGridProvider, { service: viewportGridService }],
[ViewportDialogProvider, { service: uiViewportDialogService }],
[CineProvider, { service: cineService }],