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

+11 -6
View File
@@ -38,8 +38,6 @@ const extensionDependencies = {
function modeFactory({ modeConfiguration }) {
return {
// TODO: We're using this as a route segment
// We should not be.
id,
routeName: 'microscopy',
displayName: i18n.t('Modes:Microscopy'),
@@ -47,11 +45,21 @@ function modeFactory({ modeConfiguration }) {
/**
* Lifecycle hooks
*/
onModeEnter: ({ servicesManager, extensionManager, commandsManager }: withAppTypes) => {
onModeEnter: ({ servicesManager }: withAppTypes) => {
const { toolbarService } = servicesManager.services;
toolbarService.addButtons(toolbarButtons);
toolbarService.createButtonSection('primary', ['MeasurementTools', 'dragPan', 'TagBrowser']);
toolbarService.createButtonSection('measurementSection', [
'line',
'point',
'polygon',
'circle',
'box',
'freehandpolygon',
'freehandline',
]);
},
onModeExit: ({ servicesManager }: withAppTypes) => {
@@ -79,9 +87,6 @@ function modeFactory({ modeConfiguration }) {
routes: [
{
path: 'microscopy',
/*init: ({ servicesManager, extensionManager }) => {
//defaultViewerRouteInit
},*/
layoutTemplate: ({ location, servicesManager }) => {
return {
id: ohif.layout,