@finsemble/finsemble-ui 6.4.0 → 6.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +31 -28
- package/react/actions/smartDesktopDesignerActions.d.ts +6 -2
- package/react/actions/smartDesktopDesignerActions.js +2 -0
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/assets/css/finsemble.css +0 -1
- package/react/assets/css/userPreferences.css +6 -0
- package/react/assets/icons/code-block.svg +15 -0
- package/react/componentTemplateGenerator.js +1 -1
- package/react/componentTemplateGenerator.js.map +1 -1
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/AppCatalogComponent.d.ts +1 -1
- package/react/components/appCatalog/components/Showcase/ImageCarousel.d.ts +3 -3
- package/react/components/appCatalog/components/Showcase/SupportNotes.d.ts +1 -1
- package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.d.ts +2 -2
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/appCatalog/stores/storeActions.d.ts +1 -1
- package/react/components/common/Checkbox.js +1 -1
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/DropZone.js +3 -1
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/FileInput.d.ts +2 -1
- package/react/components/common/FileInput.js +2 -2
- package/react/components/common/FileInput.js.map +1 -1
- package/react/components/common/FinsembleIcon.d.ts +1 -1
- package/react/components/common/FinsembleIcon.js +2 -0
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js +1 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/ImagePreview.js +1 -1
- package/react/components/common/ImagePreview.js.map +1 -1
- package/react/components/common/Tooltip.js +3 -1
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/application-edit-page.css +4 -1
- package/react/components/common/css/application-list.css +4 -0
- package/react/components/common/css/preload-edit-page.css +37 -0
- package/react/components/common/helpers.js +1 -0
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/FileInput.stories.d.ts +2 -1
- package/react/components/common/stories/FileInput.stories.js +6 -0
- package/react/components/common/stories/FileInput.stories.js.map +1 -1
- package/react/components/common/tests/Accordion.spec.js +1 -1
- package/react/components/common/tests/Accordion.spec.js.map +1 -1
- package/react/components/common/tests/FileInput.spec.js +8 -1
- package/react/components/common/tests/FileInput.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggle.spec.js +2 -2
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/favorites/FavoriteMaker.js.map +1 -1
- package/react/components/favorites/FavoritesShell.spec.js +1 -1
- package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
- package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
- package/react/components/icon/Icon.d.ts +4 -3
- package/react/components/icon/Icon.js +22 -12
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
- package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
- package/react/components/linker/LinkerMenu.js.map +1 -1
- package/react/components/linker/remoteRedux.d.ts +1 -1
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuPortal.js +20 -1
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.d.ts +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/types.d.ts +1 -1
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.d.ts +1 -1
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitorTypes.d.ts +4 -11
- package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindow.js +5 -10
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/components/ProcessStatistics.js +8 -10
- package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
- package/react/components/processMonitor/constants.d.ts +0 -2
- package/react/components/processMonitor/constants.js +0 -2
- package/react/components/processMonitor/constants.js.map +1 -1
- package/react/components/processMonitor/helpers.d.ts +0 -11
- package/react/components/processMonitor/helpers.js +1 -9
- package/react/components/processMonitor/helpers.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +6 -14
- package/react/components/processMonitor/stores/ProcessMonitorStore.js +22 -62
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/AddApp.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AddApp.js +0 -0
- package/react/components/sdd/AddApp.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AppEditAccess.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AppEditAccess.js +0 -0
- package/react/components/sdd/AppEditAccess.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AppEditPage.d.ts +2 -1
- package/react/components/{smartDesktopDesigner → sdd}/AppEditPage.js +77 -73
- package/react/components/sdd/AppEditPage.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.css +8 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.helpers.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.helpers.js +0 -0
- package/react/components/sdd/Appearance.helpers.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.js +0 -0
- package/react/components/sdd/Appearance.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Application.d.ts +10 -3
- package/react/components/sdd/Application.js +220 -0
- package/react/components/sdd/Application.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Applications.d.ts +2 -0
- package/react/components/{smartDesktopDesigner → sdd}/Applications.js +17 -7
- package/react/components/sdd/Applications.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AssetsPage.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AssetsPage.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AssetsPage.js +0 -0
- package/react/components/sdd/AssetsPage.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Authentication.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Authentication.js +1 -1
- package/react/components/sdd/Authentication.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AuthenticationProviderConfig.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AuthenticationProviderConfig.js +0 -0
- package/react/components/sdd/AuthenticationProviderConfig.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Content.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Content.js +0 -0
- package/react/components/sdd/Content.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ContentHeader.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ContentHeader.js +0 -0
- package/react/components/sdd/ContentHeader.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/CurrentView.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/CurrentView.js +0 -0
- package/react/components/sdd/CurrentView.js.map +1 -0
- package/react/components/sdd/EditPreload.d.ts +14 -0
- package/react/components/sdd/EditPreload.js +169 -0
- package/react/components/sdd/EditPreload.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Export.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Export.js +0 -0
- package/react/components/sdd/Export.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportCloud.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportCloud.js +0 -0
- package/react/components/sdd/ExportCloud.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportDeployInfo.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportDeployInfo.js +0 -0
- package/react/components/sdd/ExportDeployInfo.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportZip.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportZip.js +0 -0
- package/react/components/sdd/ExportZip.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/GettingStarted.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/GettingStarted.js +0 -0
- package/react/components/sdd/GettingStarted.js.map +1 -0
- package/react/components/sdd/ItemList.d.ts +17 -0
- package/react/components/sdd/ItemList.js +58 -0
- package/react/components/sdd/ItemList.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Navigation.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Navigation.js +0 -0
- package/react/components/sdd/Navigation.js.map +1 -0
- package/react/components/sdd/OptionalSettingsView.d.ts +11 -0
- package/react/components/sdd/OptionalSettingsView.js +71 -0
- package/react/components/sdd/OptionalSettingsView.js.map +1 -0
- package/react/components/sdd/Preloads.d.ts +8 -0
- package/react/components/sdd/Preloads.js +26 -0
- package/react/components/sdd/Preloads.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ProjectErrors.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ProjectErrors.js +0 -0
- package/react/components/sdd/ProjectErrors.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Publish.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Publish.js +0 -0
- package/react/components/sdd/Publish.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/PublishProgress.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/PublishProgress.js +0 -0
- package/react/components/sdd/PublishProgress.js.map +1 -0
- package/react/components/sdd/SmartDesktopDesigner.d.ts +28 -0
- package/react/components/sdd/SmartDesktopDesigner.js +121 -0
- package/react/components/sdd/SmartDesktopDesigner.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ThemePage.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ThemePage.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ThemePage.js +0 -0
- package/react/components/sdd/ThemePage.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Themes.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Themes.js +0 -0
- package/react/components/sdd/Themes.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Toolbar.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Toolbar.js +13 -11
- package/react/components/sdd/Toolbar.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/View.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/View.js +0 -0
- package/react/components/sdd/View.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/fsbl_functions.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/fsbl_functions.js +0 -0
- package/react/components/sdd/common/fsbl_functions.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/getCSSVars.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/getCSSVars.js +0 -0
- package/react/components/sdd/common/getCSSVars.js.map +1 -0
- package/react/components/{smartDesktopDesigner/fixtures → sdd/common}/views.d.ts +0 -0
- package/react/components/sdd/common/views.js +204 -0
- package/react/components/sdd/common/views.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/appearance.css +3 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/applications.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/authentication.css +5 -1
- package/react/components/{smartDesktopDesigner → sdd}/css/buttons.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/export.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/getting-started.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/nav.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/project-errors.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/project-header.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/styles.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/views.css +0 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/apps.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/apps.js +27 -5
- package/react/components/sdd/fixtures/apps.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/authenticationProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/authenticationProps.js +0 -0
- package/react/components/sdd/fixtures/authenticationProps.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/configTemplate.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/configTemplate.js +1 -1
- package/react/components/sdd/fixtures/configTemplate.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/exportProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/exportProps.js +0 -0
- package/react/components/sdd/fixtures/exportProps.js.map +1 -0
- package/react/components/sdd/fixtures/preloads.d.ts +22 -0
- package/react/components/sdd/fixtures/preloads.js +40 -0
- package/react/components/sdd/fixtures/preloads.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/projectErrorsProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/projectErrorsProps.js +0 -0
- package/react/components/sdd/fixtures/projectErrorsProps.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/publishProgress.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/publishProgress.js +0 -0
- package/react/components/sdd/fixtures/publishProgress.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/themeProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/themeProps.js +0 -0
- package/react/components/sdd/fixtures/themeProps.js.map +1 -0
- package/react/components/sdd/fixtures/views.d.ts +3 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/views.js +9 -0
- package/react/components/sdd/fixtures/views.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/sdd_helpers.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/sdd_helpers.js +0 -0
- package/react/components/sdd/sdd_helpers.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/AppEditPage.stories.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/stories/AppEditPage.stories.js +1 -0
- package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Appearance.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Appearance.stories.js +0 -0
- package/react/components/sdd/stories/Appearance.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Applications.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Applications.stories.js +0 -0
- package/react/components/sdd/stories/Applications.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/AssetsPage.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/AssetsPage.stories.js +0 -0
- package/react/components/sdd/stories/AssetsPage.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Authentication.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Authentication.stories.js +0 -0
- package/react/components/sdd/stories/Authentication.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ContentHeader.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ContentHeader.stories.js +0 -0
- package/react/components/sdd/stories/ContentHeader.stories.js.map +1 -0
- package/react/components/sdd/stories/EditPreload.stories.d.ts +11 -0
- package/react/components/sdd/stories/EditPreload.stories.js +35 -0
- package/react/components/sdd/stories/EditPreload.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Export.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Export.stories.js +0 -0
- package/react/components/sdd/stories/Export.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportCloud.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportCloud.stories.js +0 -0
- package/react/components/sdd/stories/ExportCloud.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportZip.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportZip.stories.js +0 -0
- package/react/components/sdd/stories/ExportZip.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/GettingStarted.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/GettingStarted.stories.js +0 -0
- package/react/components/sdd/stories/GettingStarted.stories.js.map +1 -0
- package/react/components/sdd/stories/ItemList.stories.d.ts +16 -0
- package/react/components/{smartDesktopDesigner/stories/ApplicationList.stories.js → sdd/stories/ItemList.stories.js} +26 -26
- package/react/components/sdd/stories/ItemList.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Navigation.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Navigation.stories.js +0 -0
- package/react/components/sdd/stories/Navigation.stories.js.map +1 -0
- package/react/components/sdd/stories/OptionalSettingsView.stories.d.ts +11 -0
- package/react/components/sdd/stories/OptionalSettingsView.stories.js +28 -0
- package/react/components/sdd/stories/OptionalSettingsView.stories.js.map +1 -0
- package/react/components/sdd/stories/Preloads.stories.d.ts +11 -0
- package/react/components/sdd/stories/Preloads.stories.js +31 -0
- package/react/components/sdd/stories/Preloads.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ProjectErrors.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ProjectErrors.stories.js +0 -0
- package/react/components/sdd/stories/ProjectErrors.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Publish.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Publish.stories.js +0 -0
- package/react/components/sdd/stories/Publish.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/PublishProgress.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/PublishProgress.stories.js +0 -0
- package/react/components/sdd/stories/PublishProgress.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/SmartDesktopDesigner.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/SmartDesktopDesigner.stories.js +0 -0
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ThemePage.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ThemePage.stories.js +0 -0
- package/react/components/sdd/stories/ThemePage.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Themes.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Themes.stories.js +0 -0
- package/react/components/sdd/stories/Themes.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Toolbar.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Toolbar.stories.js +0 -0
- package/react/components/sdd/stories/Toolbar.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/AppEditPage.spec.d.ts +0 -0
- package/react/components/sdd/tests/AppEditPage.spec.js +1151 -0
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/ApplicationList.spec.d.ts → sdd/tests/Application.spec.d.ts} +0 -0
- package/react/components/sdd/tests/Application.spec.js +1478 -0
- package/react/components/sdd/tests/Application.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Applications.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Applications.spec.js +3 -3
- package/react/components/sdd/tests/Applications.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Authentication.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Authentication.spec.js +0 -0
- package/react/components/sdd/tests/Authentication.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ContentHeader.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ContentHeader.spec.js +0 -0
- package/react/components/sdd/tests/ContentHeader.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Export.spec.d.ts → sdd/tests/EditPreload.spec.d.ts} +0 -0
- package/react/components/sdd/tests/EditPreload.spec.js +61 -0
- package/react/components/sdd/tests/EditPreload.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/ExportZip.spec.d.ts → sdd/tests/Export.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Export.spec.js +0 -0
- package/react/components/sdd/tests/Export.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Navigation.spec.d.ts → sdd/tests/ExportZip.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ExportZip.spec.js +0 -0
- package/react/components/sdd/tests/ExportZip.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/ProjectErrors.spec.d.ts → sdd/tests/ItemList.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner/tests/ApplicationList.spec.js → sdd/tests/ItemList.spec.js} +8 -8
- package/react/components/sdd/tests/ItemList.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Publish.spec.d.ts → sdd/tests/Navigation.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Navigation.spec.js +0 -0
- package/react/components/sdd/tests/Navigation.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/PublishProgess.spec.d.ts → sdd/tests/Preloads.spec.d.ts} +0 -0
- package/react/components/sdd/tests/Preloads.spec.js +47 -0
- package/react/components/sdd/tests/Preloads.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/SmartDesktopDesigner.spec.d.ts → sdd/tests/ProjectErrors.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ProjectErrors.spec.js +0 -0
- package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Themes.spec.d.ts → sdd/tests/Publish.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Publish.spec.js +0 -0
- package/react/components/sdd/tests/Publish.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/sdd_helpers.spec.d.ts → sdd/tests/PublishProgess.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/PublishProgess.spec.js +0 -0
- package/react/components/sdd/tests/PublishProgess.spec.js.map +1 -0
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.d.ts +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/SmartDesktopDesigner.spec.js +6 -0
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -0
- package/react/components/sdd/tests/Themes.spec.d.ts +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Themes.spec.js +0 -0
- package/react/components/sdd/tests/Themes.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Toolbar.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Toolbar.spec.js +0 -0
- package/react/components/sdd/tests/Toolbar.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/a11y_helper.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/a11y_helper.js +0 -0
- package/react/components/sdd/tests/a11y_helper.js.map +1 -0
- package/react/components/sdd/tests/sdd_helpers.spec.d.ts +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/sdd_helpers.spec.js +0 -0
- package/react/components/sdd/tests/sdd_helpers.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/themeDefinitions.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/themeDefinitions.js +0 -0
- package/react/components/sdd/themeDefinitions.js.map +1 -0
- package/react/components/search/SearchBestMatch.js.map +1 -1
- package/react/components/search/SearchProviderResults.d.ts +3 -1
- package/react/components/search/SearchProviderResults.js.map +1 -1
- package/react/components/search/SearchResult.d.ts +3 -1
- package/react/components/search/SearchResult.js +11 -8
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.spec.js +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +0 -11
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +2 -116
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +1 -185
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/toolbar/AutoArrange.js +1 -1
- package/react/components/toolbar/AutoArrange.js.map +1 -1
- package/react/components/toolbar/AutoArrange.spec.d.ts +1 -0
- package/react/components/toolbar/AutoArrange.spec.js +48 -0
- package/react/components/toolbar/AutoArrange.spec.js.map +1 -0
- package/react/components/toolbar/AutoArrange.stories.d.ts +11 -0
- package/react/components/toolbar/AutoArrange.stories.js +21 -0
- package/react/components/toolbar/AutoArrange.stories.js.map +1 -0
- package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
- package/react/components/toolbar/DragHandle.spec.js +31 -0
- package/react/components/toolbar/DragHandle.spec.js.map +1 -0
- package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
- package/react/components/toolbar/DragHandle.stories.js +39 -0
- package/react/components/toolbar/DragHandle.stories.js.map +1 -0
- package/react/components/toolbar/SddButton.d.ts +2 -0
- package/react/components/toolbar/SddButton.js +23 -0
- package/react/components/toolbar/SddButton.js.map +1 -0
- package/react/components/toolbar/ToolbarShell.js +4 -1
- package/react/components/toolbar/ToolbarShell.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +3 -2
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js +15 -4
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
- package/react/components/toolbar/appLauncher/components/componentList.js +3 -4
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +11 -12
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +72 -13
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +6 -1
- package/react/components/userPreferences/components/content/Workspaces.js +59 -18
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledRestart.d.ts +2 -0
- package/react/components/userPreferences/components/general/ScheduledRestart.js +10 -2
- package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +2 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js +10 -0
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js +6 -6
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +5 -2
- package/react/components/windowTitleBar/WindowTitleBarShell.js +70 -59
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -2
- package/react/components/windowTitleBar/components/center/TabList.js +5 -2
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.d.ts +5 -2
- package/react/components/windowTitleBar/components/windowTitle.js +99 -94
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +218 -219
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/components/yesNoDialog/Timer.spec.js +1 -1
- package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
- package/react/hooks/useDashbar.js.map +1 -1
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +1 -1
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/useSearch.d.ts +2 -1
- package/react/hooks/useSearch.js.map +1 -1
- package/react/hooks/useToolbar.js +6 -0
- package/react/hooks/useToolbar.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +11 -3
- package/react/reducers/smartDesktopDesignerReducer.js +8 -0
- package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
- package/react/store.d.ts +22 -6
- package/react/types/advancedAppLauncherTypes.d.ts +5 -3
- package/react/types/advancedAppLauncherTypes.js.map +1 -1
- package/react/types/favoriteTypes.d.ts +4 -2
- package/react/types/favoriteTypes.js.map +1 -1
- package/react/types/fdc3.d.ts +2 -2
- package/react/types/fdc3.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +8 -2
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/windowTitleBar.d.ts +1 -1
- package/react/types/windowTitleBar.js.map +1 -1
- package/react/components/smartDesktopDesigner/AddApp.js.map +0 -1
- package/react/components/smartDesktopDesigner/AppEditAccess.js.map +0 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +0 -1
- package/react/components/smartDesktopDesigner/Appearance.helpers.js.map +0 -1
- package/react/components/smartDesktopDesigner/Appearance.js.map +0 -1
- package/react/components/smartDesktopDesigner/Application.js +0 -228
- package/react/components/smartDesktopDesigner/Application.js.map +0 -1
- package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -16
- package/react/components/smartDesktopDesigner/ApplicationList.js +0 -60
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
- package/react/components/smartDesktopDesigner/Applications.js.map +0 -1
- package/react/components/smartDesktopDesigner/AssetsPage.js.map +0 -1
- package/react/components/smartDesktopDesigner/Authentication.js.map +0 -1
- package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +0 -1
- package/react/components/smartDesktopDesigner/Content.js.map +0 -1
- package/react/components/smartDesktopDesigner/ContentHeader.js.map +0 -1
- package/react/components/smartDesktopDesigner/CurrentView.js.map +0 -1
- package/react/components/smartDesktopDesigner/Export.js.map +0 -1
- package/react/components/smartDesktopDesigner/ExportCloud.js.map +0 -1
- package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +0 -1
- package/react/components/smartDesktopDesigner/ExportZip.js.map +0 -1
- package/react/components/smartDesktopDesigner/GettingStarted.js.map +0 -1
- package/react/components/smartDesktopDesigner/Navigation.js.map +0 -1
- package/react/components/smartDesktopDesigner/ProjectErrors.js.map +0 -1
- package/react/components/smartDesktopDesigner/Publish.js.map +0 -1
- package/react/components/smartDesktopDesigner/PublishProgress.js.map +0 -1
- package/react/components/smartDesktopDesigner/ThemePage.js.map +0 -1
- package/react/components/smartDesktopDesigner/Themes.js.map +0 -1
- package/react/components/smartDesktopDesigner/Toolbar.js.map +0 -1
- package/react/components/smartDesktopDesigner/View.js.map +0 -1
- package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +0 -1
- package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/configTemplate.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/projectErrorsProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/views.js.map +0 -1
- package/react/components/smartDesktopDesigner/sdd_helpers.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -16
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/AssetsPage.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ThemePage.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +0 -310
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/themeDefinitions.js.map +0 -1
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.d.ts +0 -6
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.js +0 -23
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +0 -1
- package/react/hooks/useWorkspace.d.ts +0 -5
- package/react/hooks/useWorkspace.js +0 -26
- package/react/hooks/useWorkspace.js.map +0 -1
- package/react/types/iconTypes.d.ts +0 -11
- package/react/types/iconTypes.js +0 -2
- package/react/types/iconTypes.js.map +0 -1
- package/react/types/searchTypes.d.ts +0 -29
- package/react/types/searchTypes.js +0 -2
- package/react/types/searchTypes.js.map +0 -1
package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import async from "async";
|
|
2
|
-
import { Util } from "@finsemble/finsemble-
|
|
2
|
+
import { Util } from "@finsemble/finsemble-api";
|
|
3
3
|
const SAVE_DIALOG_CANCEL_ERROR = "Cancel";
|
|
4
4
|
const NEGATIVE = "Negative";
|
|
5
|
-
let
|
|
5
|
+
let PROMPT_ON_DIRTY_WORKSPACE = false;
|
|
6
|
+
let DISCARD_UNSAVED_CHANGES = false;
|
|
7
|
+
const WORKSPACE_CONFIGS = {
|
|
8
|
+
PROMPT_USER_ON_DIRTY_WORKSPACE: "finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace",
|
|
9
|
+
DISCARD_UNSAVED_CHANGES: "finsemble.servicesConfig.workspace.discardUnsavedChanges",
|
|
10
|
+
DEPRECATED_PROMPT_ON_DIRTY: "finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace",
|
|
11
|
+
};
|
|
6
12
|
let WorkspaceManagementStore;
|
|
7
13
|
let StoreClient;
|
|
8
14
|
let Logger;
|
|
@@ -15,11 +21,18 @@ const defaultData = {
|
|
|
15
21
|
isSwitchingWorkspaces: false,
|
|
16
22
|
isPromptingUser: false,
|
|
17
23
|
};
|
|
24
|
+
function addListeners(done) {
|
|
25
|
+
FSBL.Clients.RouterClient.addListener("Application.restart", (err, response) => {
|
|
26
|
+
if (response.data && response.data.forceRestart === true)
|
|
27
|
+
PROMPT_ON_DIRTY_WORKSPACE = false;
|
|
28
|
+
});
|
|
29
|
+
done();
|
|
30
|
+
}
|
|
18
31
|
const Actions = {
|
|
19
32
|
autoSave: (callback) => {
|
|
20
33
|
var _a;
|
|
21
34
|
const activeName = (_a = FSBL.Clients.WorkspaceClient.activeWorkspace) === null || _a === void 0 ? void 0 : _a.name;
|
|
22
|
-
if (!
|
|
35
|
+
if (!PROMPT_ON_DIRTY_WORKSPACE) {
|
|
23
36
|
FSBL.Clients.WorkspaceClient.saveAs({
|
|
24
37
|
name: activeName,
|
|
25
38
|
force: true,
|
|
@@ -32,6 +45,28 @@ const Actions = {
|
|
|
32
45
|
}
|
|
33
46
|
},
|
|
34
47
|
initialize: () => {
|
|
48
|
+
FSBL.Clients.ConfigClient.getPreferences((err, preferences) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
Logger.system.log("WorkspaceManagementStore init getPreferences", preferences);
|
|
51
|
+
if (preferences) {
|
|
52
|
+
PROMPT_ON_DIRTY_WORKSPACE = (_a = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE]) !== null && _a !== void 0 ? _a : false;
|
|
53
|
+
DISCARD_UNSAVED_CHANGES = (_b = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES]) !== null && _b !== void 0 ? _b : false;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
FSBL.Clients.ConfigClient.getValue({ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE }, (err, data) => {
|
|
57
|
+
Logger.system.log("WorkspaceManagementStore init getValue promptUserOnDirtyWorkspace", data);
|
|
58
|
+
PROMPT_ON_DIRTY_WORKSPACE = data !== null && data !== void 0 ? data : true;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
FSBL.Clients.ConfigClient.addListener({ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE }, (err, config) => {
|
|
63
|
+
Logger.system.log("WorkspaceManagementStore new promptUserOnDirtyWorkspace config", config);
|
|
64
|
+
PROMPT_ON_DIRTY_WORKSPACE = !!config.value;
|
|
65
|
+
});
|
|
66
|
+
FSBL.Clients.ConfigClient.addListener({ field: WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES }, (err, config) => {
|
|
67
|
+
Logger.system.log("WorkspaceManagementStore new discardUnsavedChanges config", config);
|
|
68
|
+
DISCARD_UNSAVED_CHANGES = !!config.value;
|
|
69
|
+
});
|
|
35
70
|
FSBL.Clients.WorkspaceClient.getWorkspaces((err, workspaces) => {
|
|
36
71
|
Logger.system.debug("WorkspaceManagementStore init getWorkspaces", workspaces);
|
|
37
72
|
WorkspaceManagementStore.setValue({
|
|
@@ -129,7 +164,7 @@ const Actions = {
|
|
|
129
164
|
Actions.askIfUserWantsNewWorkspace,
|
|
130
165
|
createIt,
|
|
131
166
|
];
|
|
132
|
-
if (
|
|
167
|
+
if (PROMPT_ON_DIRTY_WORKSPACE) {
|
|
133
168
|
tasks = [Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse].concat(tasks);
|
|
134
169
|
}
|
|
135
170
|
async.waterfall(tasks, Actions.onAsyncComplete);
|
|
@@ -251,14 +286,16 @@ const Actions = {
|
|
|
251
286
|
let tasks = [];
|
|
252
287
|
Actions.setIsPromptingUser(true);
|
|
253
288
|
let firstMethod = Actions.autoSave, secondMethod = null;
|
|
254
|
-
if (
|
|
289
|
+
if (PROMPT_ON_DIRTY_WORKSPACE === true) {
|
|
255
290
|
firstMethod = Actions.askIfUserWantsToSave;
|
|
256
291
|
if (name === ((_a = FSBL.Clients.WorkspaceClient.activeWorkspace) === null || _a === void 0 ? void 0 : _a.name)) {
|
|
257
292
|
firstMethod = askAboutReload;
|
|
258
293
|
}
|
|
259
294
|
secondMethod = Actions.handleSaveDialogResponse;
|
|
260
295
|
}
|
|
261
|
-
|
|
296
|
+
if (!DISCARD_UNSAVED_CHANGES) {
|
|
297
|
+
tasks = [firstMethod];
|
|
298
|
+
}
|
|
262
299
|
if (secondMethod) {
|
|
263
300
|
tasks.push(secondMethod);
|
|
264
301
|
}
|
|
@@ -464,18 +501,40 @@ function createGlobalStore(done) {
|
|
|
464
501
|
});
|
|
465
502
|
}
|
|
466
503
|
function getPreferences(done) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
504
|
+
(async () => {
|
|
505
|
+
var _a, _b;
|
|
506
|
+
const { err: errPreferences, data: preferences } = await FSBL.Clients.ConfigClient.getPreferences();
|
|
507
|
+
if (errPreferences) {
|
|
508
|
+
Logger.system.error("workspaceManagementMenuStore.getPreferences - getPreferences", errPreferences);
|
|
509
|
+
}
|
|
510
|
+
if (preferences && Object.keys(preferences).includes(WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE)) {
|
|
511
|
+
PROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE];
|
|
512
|
+
Object.keys(preferences).includes(WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES)
|
|
513
|
+
? (DISCARD_UNSAVED_CHANGES = (_a = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES]) !== null && _a !== void 0 ? _a : false)
|
|
514
|
+
: false;
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
const { err: errValues, data: configValues } = await FSBL.Clients.ConfigClient.getValues([
|
|
518
|
+
WORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY,
|
|
519
|
+
]);
|
|
520
|
+
if (errValues) {
|
|
521
|
+
Logger.system.error("workspaceManagementMenuStore.getPreferences - getValues", errValues);
|
|
522
|
+
}
|
|
523
|
+
PROMPT_ON_DIRTY_WORKSPACE = configValues
|
|
524
|
+
? (_b = configValues[WORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY]) !== null && _b !== void 0 ? _b : true
|
|
525
|
+
: true;
|
|
526
|
+
FSBL.Clients.ConfigClient.setPreference({
|
|
527
|
+
field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE,
|
|
528
|
+
value: PROMPT_ON_DIRTY_WORKSPACE,
|
|
529
|
+
});
|
|
530
|
+
}
|
|
472
531
|
done();
|
|
473
|
-
});
|
|
532
|
+
})();
|
|
474
533
|
}
|
|
475
534
|
function initialize(cb) {
|
|
476
535
|
StoreClient = FSBL.Clients.DistributedStoreClient;
|
|
477
536
|
Logger = FSBL.Clients.Logger;
|
|
478
|
-
async.parallel([createGlobalStore, createLocalStore, getPreferences], () => {
|
|
537
|
+
async.parallel([createGlobalStore, createLocalStore, getPreferences, addListeners], () => {
|
|
479
538
|
Actions.initialize();
|
|
480
539
|
cb(WorkspaceManagementStore);
|
|
481
540
|
});
|
package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceManagementMenuStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAmBjD,MAAM,wBAAwB,GAAG,QAAQ,CAAC;AAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,IAAI,wBAAoC,CAAC;AACzC,IAAI,WAAgB,CAAC;AACrB,IAAI,MAAW,CAAC;AAChB,IAAI,8BAA0C,CAAC;AAG/C,MAAM,WAAW,GAAG;IACnB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,EAAE;IACjB,0BAA0B,EAAE,KAAK;IASjC,qBAAqB,EAAE,KAAK;IAC5B,eAAe,EAAE,KAAK;CACtB,CAAC;AAEF,MAAM,OAAO,GAAG;IACf,QAAQ,EAAE,CAAC,QAA0B,EAAE,EAAE;;QACxC,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,OAAO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AI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU;QACT,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,UAAU,CAAC,CAAC,KAAiB,EAAE,EAAE;YAChC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,EAA+B;QACrD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EACN,YAAY,EACZ,8BAA8B,IAAI,WAAW,EAC7C,UAAU,EACV,wBAAwB,IAAI,KAAK,EACjC,OAAO,EACP,QAAQ,GACR,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html\n */\nimport async from \"async\";\nimport { Util } from \"@finsemble/finsemble-core\";\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\nimport { StandardCallback, StandardError } from \"@finsemble/finsemble-core/types/types\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/types/common/workspace\";\nimport { types } from \"@finsemble/finsemble-core\";\n\ntype StandardErrorCallback = types.StandardErrorCallback;\n\ntype UserInputResponseType = {\n\tchoice: string;\n\tvalue?: string;\n};\ntype SaveWorkspaceWaterfallParams = {\n\tworkspaceExists: boolean;\n\tworkspaceName: string;\n\ttemplate: any;\n};\n\n// When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.\nconst SAVE_DIALOG_CANCEL_ERROR = \"Cancel\";\nconst NEGATIVE = \"Negative\";\nlet PROMPT_ON_SAVE = false;\nlet WorkspaceManagementStore: StoreModel;\nlet StoreClient: any;\nlet Logger: any;\nlet WorkspaceManagementGlobalStore: StoreModel;\n\n// Initial data for the store.\nconst defaultData = {\n\tactiveWorkspace: {},\n\tmenuWidth: 285,\n\tWorkspaceList: [],\n\tnewWorkspaceDialogIsActive: false,\n\t/**\n\t * State around whether the workspace is currently in the process of switching.\n\t *\n\t * For simplicity, we're storing this in the local store for now, but this precludes\n\t * other components from signaling that the workspace is changing. A consequence,\n\t * for example, is that if you switch workspaces uses a pin on the toolbar instead\n\t * of the workspace management menu, the spinner doesn't show up.\n\t */\n\tisSwitchingWorkspaces: false,\n\tisPromptingUser: false,\n};\n\nconst Actions = {\n\tautoSave: (callback: StandardCallback) => {\n\t\tconst activeName = FSBL.Clients.WorkspaceClient.activeWorkspace?.name;\n\t\tif (!PROMPT_ON_SAVE) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: activeName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError) => {\n\t\t\t\t\tcallback(err);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tcallback(null);\n\t\t}\n\t},\n\tinitialize: () => {\n\t\t// Gets the workspace list and sets the value in the store.\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaces((err: StandardError, workspaces: WorkspaceType[]) => {\n\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getWorkspaces\", workspaces);\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\tvalue: workspaces,\n\t\t\t});\n\t\t});\n\n\t\t// Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.\n\t\tFSBL.Clients.WorkspaceClient.getActiveWorkspace(\n\t\t\t(err: StandardError, activeWorkspace: { data: WorkspaceType } | undefined) => {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getActiveWorkspace\", activeWorkspace);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: activeWorkspace,\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t/**\n\t\t * We listen here for any workspace updates, and pass them to the store.\n\t\t * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,\n\t\t * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for\n\t\t * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.\n\t\t */\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.update\", (err, response) => {\n\t\t\tif (response.data && response.data.activeWorkspace) {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init update\", response.data);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: response.data.activeWorkspace,\n\t\t\t\t});\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\t\tvalue: response.data.workspacesConfig,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tWorkspaceManagementGlobalStore.getValue({ field: \"owner\" }, (err: StandardError, data?: string) => {\n\t\t\tif (data !== finsembleWindow.name) return;\n\t\t\tWorkspaceManagementGlobalStore.Dispatcher.register((action) => {\n\t\t\t\tswitch (action.actionType) {\n\t\t\t\t\tcase \"switchToWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore switchToWorkspace\", action.data);\n\t\t\t\t\t\tActions.switchToWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reorderWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore reorderWorkspace\", action.data);\n\t\t\t\t\t\tActions.reorderWorkspaceList(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"removeWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore removeWorkspace\", action.data);\n\t\t\t\t\t\tActions.removeWorkspace(\n\t\t\t\t\t\t\taction.data as {\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\thideModalOnClose: boolean;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"renameWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore renameWorkspace\", action.data);\n\t\t\t\t\t\tActions.renameWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Nothing to do here\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tGETTERS/SETTERS\n\t *\n\t *********************************************************************************************/\n\tgetActiveWorkspace: () => WorkspaceManagementStore.getValue(\"activeWorkspace\") as WorkspaceType,\n\n\t// Get the name of the workspace that is currently being edited\n\tgetWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue(\"workspaceBeingEdited\") as string,\n\n\tgetWorkspaceList: () => WorkspaceManagementStore.getValue(\"WorkspaceList\") as WorkspaceType[],\n\n\tgetIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue(\"isSwitchingWorkspaces\") as boolean,\n\n\tsetIsSwitchingWorkspaces: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isSwitchingWorkspaces\",\n\t\t\tvalue: val,\n\t\t}),\n\n\tgetIsPromptingUser: () => WorkspaceManagementStore.getValue(\"isPromptingUser\") as boolean,\n\n\tsetIsPromptingUser: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isPromptingUser\",\n\t\t\tvalue: val,\n\t\t}),\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMain Workspace Actions\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * Handles the complete workflow for creating a new workspace.\n\t * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.\n\t */\n\tnewWorkspace: function () {\n\t\tlet newWorkspaceName: string;\n\t\tLogger.system.log(\"New workspace - start.\");\n\t\tconst newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue(\"newWorkspaceDialogIsActive\");\n\n\t\ttype createItParams = {\n\t\t\tworkspaceName: string;\n\t\t};\n\t\t// Creates the new workspace.\n\t\tconst createIt = (params: createItParams, cb?: StandardCallback) => {\n\t\t\tLogger.system.log(\"createIt\", params);\n\t\t\tconst { workspaceName } = params;\n\t\t\tFSBL.Clients.WorkspaceClient.createNewWorkspace(workspaceName, {}, (err, response) => {\n\t\t\t\tLogger.system.log(\"createIt createNewWorkspace response\", workspaceName, response);\n\t\t\t\tnewWorkspaceName = response.workspaceName;\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(null, newWorkspaceName);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (!newWorkspaceDialogIsActive) {\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\t\tvalue: true,\n\t\t\t});\n\t\t}\n\n\t\tActions.blurWindow();\n\t\tlet tasks: Function[] = [\n\t\t\tActions.autoSave,\n\t\t\tActions.spawnWorkspaceInputField,\n\t\t\tActions.validateWorkspaceInput,\n\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\tActions.askIfUserWantsNewWorkspace,\n\t\t\tcreateIt,\n\t\t];\n\t\tif (PROMPT_ON_SAVE) {\n\t\t\ttasks = ([Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse] as Function[]).concat(tasks);\n\t\t}\n\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t},\n\n\t/**\n\t * Handles the workflow for removing a workspace.\n\t * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,\n\t * and if the user says \"yes\", it will delete the workspace.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tremoveWorkspace: (data: { name: string; hideModalOnClose?: boolean }, cb = (val: any) => {}) => {\n\t\tconst workspaceName = data.name;\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Delete this workspace?\",\n\t\t\tquestion: `Are you sure you want to delete the workspace \"${workspaceName}\"?`,\n\t\t\tshowNegativeButton: false,\n\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\thideModalOnClose: data.hideModalOnClose,\n\t\t};\n\n\t\t/**\n\t\t * Invoked when the user interacts with the dialog.\n\t\t */\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcb(true);\n\t\t\t\tFSBL.Clients.WorkspaceClient.remove({\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcb(false);\n\t\t\t}\n\t\t}\n\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t},\n\t/**\n\t * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.\n\t */\n\tsaveWorkspace: (cb?: StandardErrorCallback) => {\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t{\n\t\t\t\tforce: true,\n\t\t\t\tname: activeWorkspace.name,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcb?.(null);\n\t\t\t}\n\t\t);\n\t},\n\treorderWorkspaceList: ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tlet workspaces: WorkspaceType[] = WorkspaceManagementStore.getValue<WorkspaceType[]>({\n\t\t\tfield: \"WorkspaceList\",\n\t\t});\n\t\tconst workspaceToMove = workspaces[oldIndex];\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tconst workspacesWithExpectedStructure = workspaces.map((WSName) => {\n\t\t\treturn {\n\t\t\t\tname: WSName,\n\t\t\t};\n\t\t});\n\t\tFSBL.Clients.WorkspaceClient.setWorkspaces(\n\t\t\t{\n\t\t\t\tworkspaces: workspacesWithExpectedStructure,\n\t\t\t},\n\t\t\t() => {}\n\t\t);\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"WorkspaceList\",\n\t\t\tvalue: workspaces,\n\t\t});\n\t},\n\trenameWorkspace: ({ oldName, newName }: { oldName: string; newName: string }) => {\n\t\t// Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing\n\t\t// workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.\n\t\tFSBL.Clients.WorkspaceClient.rename({\n\t\t\toldName: oldName,\n\t\t\tnewName: newName,\n\t\t\tremoveOldWorkspace: true,\n\t\t\toverwriteExisting: true,\n\t\t});\n\t},\n\n\tshowPreferences: () => {\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Ask the user for a name, make sure it doesn't already exist, then save.\n\t */\n\tsaveWorkspaceAs: () => {\n\t\tfunction saveIt(workspaceName: string, callback: StandardErrorCallback) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError, response: any) => {\n\t\t\t\t\tcallback(err, response);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tLogger.system.log(\"SaveWorkspaceAs clicked.\");\n\n\t\tasync.waterfall(\n\t\t\t[\n\t\t\t\tActions.autoSave,\n\t\t\t\tActions.spawnSaveAsDialog,\n\t\t\t\tActions.validateWorkspaceInput,\n\t\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\t\tActions.askAboutOverwrite,\n\t\t\t\tsaveIt,\n\t\t\t],\n\t\t\tActions.onAsyncComplete\n\t\t);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their data, then loads the requested workspace.\n\t */\n\tswitchToWorkspace: async function ({ name }: { name: string }) {\n\t\t// if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);\n\t\t// note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)\n\t\tconst prompting = Actions.getIsPromptingUser();\n\t\tLogger.system.log(\"workspaceManagementMenuStore: switchToWorkspace\", prompting ? \"prompting\" : \"not-prompting\");\n\t\tif (prompting) return;\n\n\t\tActions.setIsSwitchingWorkspaces(true);\n\t\tActions.blurWindow();\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\t/**\n\t\t * Actually perform the switch. Happens after we ask the user what they want.\n\t\t *\n\t\t */\n\t\tconst switchWorkspace = (callback = () => {}) => {\n\t\t\tFSBL.Clients.WorkspaceClient.switchTo(\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tActions.setIsSwitchingWorkspaces(false);\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * Make sure the user is sure\n\t\t */\n\t\tconst askAboutReload = (callback: () => void) => {\n\t\t\tActions.spawnDialog(\n\t\t\t\t\"yesNo\",\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"primary\",\n\t\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t\t},\n\t\t\t\tcallback\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * If the workspace is dirty, we need to do more than if it's clean.\n\t\t * We don't want users to lose unsaved work.\n\t\t */\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tlet tasks: Function[] = [];\n\n\t\t\tActions.setIsPromptingUser(true);\n\t\t\tlet firstMethod: Function = Actions.autoSave,\n\t\t\t\tsecondMethod = null;\n\n\t\t\tif (PROMPT_ON_SAVE === true) {\n\t\t\t\t// We want to ask the user to save. But if they're trying to reload the workspace,\n\t\t\t\t// the message needs to be different. The first if block just switches that method.\n\t\t\t\tfirstMethod = Actions.askIfUserWantsToSave;\n\t\t\t\tif (name === FSBL.Clients.WorkspaceClient.activeWorkspace?.name) {\n\t\t\t\t\tfirstMethod = askAboutReload;\n\t\t\t\t}\n\n\t\t\t\t// If we are not autosaving, we need to process the dialog input.\n\t\t\t\tsecondMethod = Actions.handleSaveDialogResponse;\n\t\t\t}\n\n\t\t\t// Build the task list.\n\t\t\ttasks = [firstMethod];\n\n\t\t\tif (secondMethod) {\n\t\t\t\ttasks.push(secondMethod);\n\t\t\t}\n\n\t\t\t// Switch is the last thing we do.\n\t\t\ttasks.push(switchWorkspace);\n\n\t\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t\t} else {\n\t\t\tswitchWorkspace();\n\t\t}\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tWorkspace Management Helpers\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * General handler for `async.series` and `async.waterfall`\n\t */\n\tonAsyncComplete(err?: Error | null) {\n\t\tLogger.system.debug(\"workspaceManagementMenuStore: onAsyncComplete\");\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\tvalue: false,\n\t\t});\n\t\tconst errMessage = err?.message;\n\t\tif (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {\n\t\t\t// handle error.\n\t\t\tLogger.system.error(err);\n\t\t}\n\n\t\t// Unlock the UI.\n\t\tActions.setIsSwitchingWorkspaces(false);\n\t\tActions.setIsPromptingUser(false);\n\t},\n\n\t/**\n\t * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.\n\t *\n\t * @param {string} type \"yesNo\" or \"singleInput\"\n\t * @param {object} data Optional params for the dialog call.\n\t * @param {function} responseCallback invoked when the user interacts with the dialog.\n\t */\n\tspawnDialog(type: \"yesNo\" | \"singleInput\", data: any, responseCallback: StandardErrorCallback) {\n\t\tLogger.system.debug(\"spawnDialog\", type, data);\n\t\tif (type === \"singleInput\") {\n\t\t\tdata.showCancelButton = true;\n\t\t}\n\t\tFSBL.Clients.DialogManager.open(type, data, responseCallback);\n\t},\n\n\tspawnSaveAsDialog: (cb: StandardCallback) => {\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnSaveAsDialog onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Spawns an input field asking what the user would like to name their new workspace.\n\t */\n\tspawnWorkspaceInputField: (cb: StandardCallback) => {\n\t\t// Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.\n\t\tLogger.system.log(\"SpawnWorkspaceInput - start\");\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnWorkspaceInput onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.\n\t */\n\taskIfUserWantsToSave: async function (callback: StandardCallback) {\n\t\tconst activeWorkspace: WorkspaceType = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tLogger.system.log(\"NewWorkspace.spawnDialog start.\");\n\t\t\tconst dialogParams = {\n\t\t\t\tmonitor: \"primary\",\n\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t};\n\t\t\tconst waitForUserInput = () =>\n\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\t\t\t\tLogger.system.log(\"Spawn Dialog callback.\");\n\t\t\t\t\t\tif (callback) callback(null, response);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t};\n\t\t\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t\t\t});\n\t\t\treturn await waitForUserInput();\n\t\t} else {\n\t\t\t// In this case the workspace is not dirty, so we don't need to save.\n\t\t\tif (callback) callback(null, { choice: \"negative\" });\n\t\t\treturn { choice: \"negative\" };\n\t\t}\n\t},\n\n\t/**\n\t * Handles the response from the dialog asking if the user wants to save their workspace.\n\t *\n\t * @param {any} response\n\t * @param {any} callback\n\t */\n\thandleSaveDialogResponse(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tif (response.choice === \"affirmative\") {\n\t\t\t// User wants to save, so call the client API.\n\t\t\tActions.saveWorkspace(callback);\n\t\t} else if (response.choice === \"negative\") {\n\t\t\t// Doesn't want to save.\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\t// choice === cancel\n\t\t\tcallback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t},\n\t/**\n\t * Makes sure the user has input a valid workspace name.\n\t */\n\tvalidateWorkspaceInput(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tLogger.system.log(\"spawnWorkspaceInput\", response);\n\t\t// If user wants to proceed but gave an invalid name, tell them that they messed up, then die.\n\t\tif (response.choice !== \"cancel\" && (!response.value || response.value === \"\")) {\n\t\t\tlet dialogParams = {\n\t\t\t\ttitle: \"Invalid Workspace Name\",\n\t\t\t\tquestion: \"Workspace names must contain letters or numbers. Please try again.\",\n\t\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t\tshowCancelButton: false,\n\t\t\t};\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, () => {});\n\t\t\treturn callback(new Error(\"Invalid workspace name.\"));\n\t\t} else if (response.choice === \"cancel\") {\n\t\t\treturn callback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t\tcallback(null, response);\n\t},\n\n\taskAboutOverwrite(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tconst { workspaceExists, workspaceName } = params;\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Overwrite Workspace?\",\n\t\t\tquestion: `This will overwrite the saved data for \"${workspaceName}\". Would you like to proceed?`,\n\t\t\taffirmativeResponseLabel: \"Overwrite\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, workspaceName);\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t};\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, workspaceName);\n\t\t}\n\t},\n\taskIfUserWantsNewWorkspace(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tlet { workspaceExists, workspaceName, template } = params;\n\n\t\tlet dialogParams = {\n\t\t\ttitle: \"New workspace\",\n\t\t\tquestion: `The workspace \"${workspaceName}\" already exists. A new workspace with a modified name will be created.`,\n\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, { workspaceName, template });\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t}\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, { workspaceName, template });\n\t\t}\n\t},\n\n\t/**\n\t * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.\n\t */\n\tcheckIfWorkspaceAlreadyExists(response: any, callback: StandardErrorCallback) {\n\t\tconst workspaceName = response.value;\n\t\tconst camelCaseWorkspaceName = Util.camelCase(workspaceName);\n\t\t// Do any of the workspaces have the same name that the user is trying to input.\n\t\tconst workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some(\n\t\t\t(workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName\n\t\t);\n\t\tcallback(null, {\n\t\t\tworkspaceExists,\n\t\t\tworkspaceName,\n\t\t\ttemplate: response.template,\n\t\t});\n\t},\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMisc functionality\n\t *\n\t *********************************************************************************************/\n\t/**\n\t * Un-focuses from the menu.\n\t */\n\tblurWindow: function () {\n\t\tfinsembleWindow.blur();\n\t},\n};\n\nfunction createLocalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{ store: \"Finsemble-WorkspaceMenu-Local-Store\", values: defaultData },\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction createGlobalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{\n\t\t\tstore: \"Finsemble-WorkspaceMenu-Global-Store\",\n\t\t\tglobal: true,\n\t\t\tvalues: { owner: finsembleWindow.name },\n\t\t},\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementGlobalStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getPreferences(done: () => void) {\n\tFSBL.Clients.ConfigClient.getValue(\n\t\t{\n\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\n\t\t},\n\t\t(err: StandardError, data?: boolean | null) => {\n\t\t\tlet prompt = data;\n\t\t\t// default to false.\n\t\t\tPROMPT_ON_SAVE = prompt === null || prompt === undefined ? PROMPT_ON_SAVE : prompt;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\n/**\n * Initializes the store for the Workspace Management Menu.\n */\nfunction initialize(cb: any) {\n\tStoreClient = FSBL.Clients.DistributedStoreClient;\n\t// eslint-disable-next-line prefer-destructuring\n\tLogger = FSBL.Clients.Logger;\n\tasync.parallel([createGlobalStore, createLocalStore, getPreferences], () => {\n\t\tActions.initialize();\n\t\tcb(WorkspaceManagementStore);\n\t});\n}\n\nlet getStore = () => WorkspaceManagementStore;\n\n/**\n * This is a quick little initialization manager that Terry hacked up.\n * Ultimately everything in this file should be rewritten in hooks/redux pattern.\n */\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store !== null) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport {\n\tstoreManager,\n\tWorkspaceManagementGlobalStore as GlobalStore,\n\tinitialize,\n\tWorkspaceManagementStore as Store,\n\tActions,\n\tgetStore,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"workspaceManagementMenuStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAmBhD,MAAM,wBAAwB,GAAG,QAAQ,CAAC;AAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,IAAI,uBAAuB,GAAG,KAAK,CAAC;AACpC,MAAM,iBAAiB,GAAG;IACzB,8BAA8B,EAAE,+DAA+D;IAC/F,uBAAuB,EAAE,0DAA0D;IACnF,0BAA0B,EAAE,mEAAmE;CAC/F,CAAC;AAEF,IAAI,wBAAoC,CAAC;AACzC,IAAI,WAAgB,CAAC;AACrB,IAAI,MAAW,CAAC;AAChB,IAAI,8BAA0C,CAAC;AAG/C,MAAM,WAAW,GAAG;IACnB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,EAAE;IACjB,0BAA0B,EAAE,KAAK;IASjC,qBAAqB,EAAE,KAAK;IAC5B,eAAe,EAAE,KAAK;CACtB,CAAC;AAEF,SAAS,YAAY,CAAC,IAAgB;IACrC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAE9E,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,YAAY,KAAK,IAAI;YAAE,yBAAyB,GAAG,KAAK,CAAC;IAC7F,CAAC,CAAC,CAAC;IACH,IAAI,EAAE,CAAC;AACR,CAAC;AAED,MAAM,OAAO,GAAG;IACf,QAAQ,EAAE,CAAC,QAA0B,EAAE,EAAE;;QACxC,M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AG,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU;QACT,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,UAAU,CAAC,CAAC,KAAiB,EAAE,EAAE;YAChC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,EAA+B;QACrD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EACN,YAAY,EACZ,8BAA8B,IAAI,WAAW,EAC7C,UAAU,EACV,wBAAwB,IAAI,KAAK,EACjC,OAAO,EACP,QAAQ,GACR,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html\n */\nimport async from \"async\";\nimport { Util } from \"@finsemble/finsemble-api\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardCallback, StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-api/types/common/workspace\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StandardErrorCallback = types.StandardErrorCallback;\n\ntype UserInputResponseType = {\n\tchoice: string;\n\tvalue?: string;\n};\ntype SaveWorkspaceWaterfallParams = {\n\tworkspaceExists: boolean;\n\tworkspaceName: string;\n\ttemplate: any;\n};\n\n// When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.\nconst SAVE_DIALOG_CANCEL_ERROR = \"Cancel\";\nconst NEGATIVE = \"Negative\";\nlet PROMPT_ON_DIRTY_WORKSPACE = false;\nlet DISCARD_UNSAVED_CHANGES = false;\nconst WORKSPACE_CONFIGS = {\n\tPROMPT_USER_ON_DIRTY_WORKSPACE: \"finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace\",\n\tDISCARD_UNSAVED_CHANGES: \"finsemble.servicesConfig.workspace.discardUnsavedChanges\",\n\tDEPRECATED_PROMPT_ON_DIRTY: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\", // DEPRECATED - retrieving it for backwards compatibility\n};\n\nlet WorkspaceManagementStore: StoreModel;\nlet StoreClient: any;\nlet Logger: any;\nlet WorkspaceManagementGlobalStore: StoreModel;\n\n// Initial data for the store.\nconst defaultData = {\n\tactiveWorkspace: {},\n\tmenuWidth: 285,\n\tWorkspaceList: [],\n\tnewWorkspaceDialogIsActive: false,\n\t/**\n\t * State around whether the workspace is currently in the process of switching.\n\t *\n\t * For simplicity, we're storing this in the local store for now, but this precludes\n\t * other components from signaling that the workspace is changing. A consequence,\n\t * for example, is that if you switch workspaces uses a pin on the toolbar instead\n\t * of the workspace management menu, the spinner doesn't show up.\n\t */\n\tisSwitchingWorkspaces: false,\n\tisPromptingUser: false,\n};\n\nfunction addListeners(done: () => void) {\n\tFSBL.Clients.RouterClient.addListener(\"Application.restart\", (err, response) => {\n\t\t// when the user calls a \"Reset\" function, Finsemble shouldn't show a save workspace dialog.\n\t\tif (response.data && response.data.forceRestart === true) PROMPT_ON_DIRTY_WORKSPACE = false;\n\t});\n\tdone();\n}\n\nconst Actions = {\n\tautoSave: (callback: StandardCallback) => {\n\t\tconst activeName = FSBL.Clients.WorkspaceClient.activeWorkspace?.name;\n\t\tif (!PROMPT_ON_DIRTY_WORKSPACE) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: activeName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError) => {\n\t\t\t\t\tcallback(err);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tcallback(null);\n\t\t}\n\t},\n\tinitialize: () => {\n\t\tFSBL.Clients.ConfigClient.getPreferences((err, preferences) => {\n\t\t\tLogger.system.log(\"WorkspaceManagementStore init getPreferences\", preferences);\n\t\t\tif (preferences) {\n\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE] ?? false;\n\t\t\t\tDISCARD_UNSAVED_CHANGES = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES] ?? false;\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.ConfigClient.getValue({ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE }, (err, data) => {\n\t\t\t\t\tLogger.system.log(\"WorkspaceManagementStore init getValue promptUserOnDirtyWorkspace\", data);\n\t\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = data ?? true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tFSBL.Clients.ConfigClient.addListener(\n\t\t\t{ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE },\n\t\t\t(err, config) => {\n\t\t\t\tLogger.system.log(\"WorkspaceManagementStore new promptUserOnDirtyWorkspace config\", config);\n\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = !!config.value;\n\t\t\t}\n\t\t);\n\n\t\tFSBL.Clients.ConfigClient.addListener({ field: WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES }, (err, config) => {\n\t\t\tLogger.system.log(\"WorkspaceManagementStore new discardUnsavedChanges config\", config);\n\t\t\tDISCARD_UNSAVED_CHANGES = !!config.value;\n\t\t});\n\n\t\t// Gets the workspace list and sets the value in the store.\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaces((err: StandardError, workspaces: WorkspaceType[]) => {\n\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getWorkspaces\", workspaces);\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\tvalue: workspaces,\n\t\t\t});\n\t\t});\n\n\t\t// Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.\n\t\tFSBL.Clients.WorkspaceClient.getActiveWorkspace(\n\t\t\t(err: StandardError, activeWorkspace: { data: WorkspaceType } | undefined) => {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getActiveWorkspace\", activeWorkspace);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: activeWorkspace,\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t/**\n\t\t * We listen here for any workspace updates, and pass them to the store.\n\t\t * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,\n\t\t * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for\n\t\t * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.\n\t\t */\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.update\", (err, response) => {\n\t\t\tif (response.data && response.data.activeWorkspace) {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init update\", response.data);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: response.data.activeWorkspace,\n\t\t\t\t});\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\t\tvalue: response.data.workspacesConfig,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tWorkspaceManagementGlobalStore.getValue({ field: \"owner\" }, (err: StandardError, data?: string) => {\n\t\t\tif (data !== finsembleWindow.name) return;\n\t\t\tWorkspaceManagementGlobalStore.Dispatcher.register((action) => {\n\t\t\t\tswitch (action.actionType) {\n\t\t\t\t\tcase \"switchToWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore switchToWorkspace\", action.data);\n\t\t\t\t\t\tActions.switchToWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reorderWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore reorderWorkspace\", action.data);\n\t\t\t\t\t\tActions.reorderWorkspaceList(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"removeWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore removeWorkspace\", action.data);\n\t\t\t\t\t\tActions.removeWorkspace(\n\t\t\t\t\t\t\taction.data as {\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\thideModalOnClose: boolean;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"renameWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore renameWorkspace\", action.data);\n\t\t\t\t\t\tActions.renameWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Nothing to do here\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tGETTERS/SETTERS\n\t *\n\t *********************************************************************************************/\n\tgetActiveWorkspace: () => WorkspaceManagementStore.getValue(\"activeWorkspace\") as WorkspaceType,\n\n\t// Get the name of the workspace that is currently being edited\n\tgetWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue(\"workspaceBeingEdited\") as string,\n\n\tgetWorkspaceList: () => WorkspaceManagementStore.getValue(\"WorkspaceList\") as WorkspaceType[],\n\n\tgetIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue(\"isSwitchingWorkspaces\") as boolean,\n\n\tsetIsSwitchingWorkspaces: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isSwitchingWorkspaces\",\n\t\t\tvalue: val,\n\t\t}),\n\n\tgetIsPromptingUser: () => WorkspaceManagementStore.getValue(\"isPromptingUser\") as boolean,\n\n\tsetIsPromptingUser: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isPromptingUser\",\n\t\t\tvalue: val,\n\t\t}),\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMain Workspace Actions\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * Handles the complete workflow for creating a new workspace.\n\t * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.\n\t */\n\tnewWorkspace: function () {\n\t\tlet newWorkspaceName: string;\n\t\tLogger.system.log(\"New workspace - start.\");\n\t\tconst newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue(\"newWorkspaceDialogIsActive\");\n\n\t\ttype createItParams = {\n\t\t\tworkspaceName: string;\n\t\t};\n\t\t// Creates the new workspace.\n\t\tconst createIt = (params: createItParams, cb?: StandardCallback) => {\n\t\t\tLogger.system.log(\"createIt\", params);\n\t\t\tconst { workspaceName } = params;\n\t\t\tFSBL.Clients.WorkspaceClient.createNewWorkspace(workspaceName, {}, (err, response) => {\n\t\t\t\tLogger.system.log(\"createIt createNewWorkspace response\", workspaceName, response);\n\t\t\t\tnewWorkspaceName = response.workspaceName;\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(null, newWorkspaceName);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (!newWorkspaceDialogIsActive) {\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\t\tvalue: true,\n\t\t\t});\n\t\t}\n\n\t\tActions.blurWindow();\n\t\tlet tasks: Function[] = [\n\t\t\tActions.autoSave,\n\t\t\tActions.spawnWorkspaceInputField,\n\t\t\tActions.validateWorkspaceInput,\n\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\tActions.askIfUserWantsNewWorkspace,\n\t\t\tcreateIt,\n\t\t];\n\t\tif (PROMPT_ON_DIRTY_WORKSPACE) {\n\t\t\ttasks = ([Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse] as Function[]).concat(tasks);\n\t\t}\n\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t},\n\n\t/**\n\t * Handles the workflow for removing a workspace.\n\t * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,\n\t * and if the user says \"yes\", it will delete the workspace.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tremoveWorkspace: (data: { name: string; hideModalOnClose?: boolean }, cb = (val: any) => {}) => {\n\t\tconst workspaceName = data.name;\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Delete this workspace?\",\n\t\t\tquestion: `Are you sure you want to delete the workspace \"${workspaceName}\"?`,\n\t\t\tshowNegativeButton: false,\n\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\thideModalOnClose: data.hideModalOnClose,\n\t\t};\n\n\t\t/**\n\t\t * Invoked when the user interacts with the dialog.\n\t\t */\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcb(true);\n\t\t\t\tFSBL.Clients.WorkspaceClient.remove({\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcb(false);\n\t\t\t}\n\t\t}\n\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t},\n\t/**\n\t * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.\n\t */\n\tsaveWorkspace: (cb?: StandardErrorCallback) => {\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t{\n\t\t\t\tforce: true,\n\t\t\t\tname: activeWorkspace.name,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcb?.(null);\n\t\t\t}\n\t\t);\n\t},\n\treorderWorkspaceList: ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tlet workspaces: WorkspaceType[] = WorkspaceManagementStore.getValue<WorkspaceType[]>({\n\t\t\tfield: \"WorkspaceList\",\n\t\t});\n\t\tconst workspaceToMove = workspaces[oldIndex];\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tconst workspacesWithExpectedStructure = workspaces.map((WSName) => {\n\t\t\treturn {\n\t\t\t\tname: WSName,\n\t\t\t};\n\t\t});\n\t\tFSBL.Clients.WorkspaceClient.setWorkspaces(\n\t\t\t{\n\t\t\t\tworkspaces: workspacesWithExpectedStructure,\n\t\t\t},\n\t\t\t() => {}\n\t\t);\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"WorkspaceList\",\n\t\t\tvalue: workspaces,\n\t\t});\n\t},\n\trenameWorkspace: ({ oldName, newName }: { oldName: string; newName: string }) => {\n\t\t// Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing\n\t\t// workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.\n\t\tFSBL.Clients.WorkspaceClient.rename({\n\t\t\toldName: oldName,\n\t\t\tnewName: newName,\n\t\t\tremoveOldWorkspace: true,\n\t\t\toverwriteExisting: true,\n\t\t});\n\t},\n\n\tshowPreferences: () => {\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Ask the user for a name, make sure it doesn't already exist, then save.\n\t */\n\tsaveWorkspaceAs: () => {\n\t\tfunction saveIt(workspaceName: string, callback: StandardErrorCallback) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError, response: any) => {\n\t\t\t\t\tcallback(err, response);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tLogger.system.log(\"SaveWorkspaceAs clicked.\");\n\n\t\tasync.waterfall(\n\t\t\t[\n\t\t\t\tActions.autoSave,\n\t\t\t\tActions.spawnSaveAsDialog,\n\t\t\t\tActions.validateWorkspaceInput,\n\t\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\t\tActions.askAboutOverwrite,\n\t\t\t\tsaveIt,\n\t\t\t],\n\t\t\tActions.onAsyncComplete\n\t\t);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their data, then loads the requested workspace.\n\t */\n\tswitchToWorkspace: async function ({ name }: { name: string }) {\n\t\t// if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);\n\t\t// note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)\n\t\tconst prompting = Actions.getIsPromptingUser();\n\t\tLogger.system.log(\"workspaceManagementMenuStore: switchToWorkspace\", prompting ? \"prompting\" : \"not-prompting\");\n\t\tif (prompting) return;\n\n\t\tActions.setIsSwitchingWorkspaces(true);\n\t\tActions.blurWindow();\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\t/**\n\t\t * Actually perform the switch. Happens after we ask the user what they want.\n\t\t *\n\t\t */\n\t\tconst switchWorkspace = (callback = () => {}) => {\n\t\t\tFSBL.Clients.WorkspaceClient.switchTo(\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tActions.setIsSwitchingWorkspaces(false);\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * Make sure the user is sure\n\t\t */\n\t\tconst askAboutReload = (callback: () => void) => {\n\t\t\tActions.spawnDialog(\n\t\t\t\t\"yesNo\",\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"primary\",\n\t\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t\t},\n\t\t\t\tcallback\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * If the workspace is dirty, we need to do more than if it's clean.\n\t\t */\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tlet tasks: Function[] = [];\n\n\t\t\tActions.setIsPromptingUser(true);\n\t\t\tlet firstMethod: Function = Actions.autoSave,\n\t\t\t\tsecondMethod = null;\n\n\t\t\tif (PROMPT_ON_DIRTY_WORKSPACE === true) {\n\t\t\t\t// We want to ask the user to save. But if they're trying to reload the workspace,\n\t\t\t\t// the message needs to be different. The first if block just switches that method.\n\t\t\t\tfirstMethod = Actions.askIfUserWantsToSave;\n\t\t\t\tif (name === FSBL.Clients.WorkspaceClient.activeWorkspace?.name) {\n\t\t\t\t\tfirstMethod = askAboutReload;\n\t\t\t\t}\n\n\t\t\t\t// If we are not autosaving, we need to process the dialog input.\n\t\t\t\tsecondMethod = Actions.handleSaveDialogResponse;\n\t\t\t}\n\n\t\t\tif (!DISCARD_UNSAVED_CHANGES) {\n\t\t\t\ttasks = [firstMethod];\n\t\t\t}\n\n\t\t\tif (secondMethod) {\n\t\t\t\ttasks.push(secondMethod);\n\t\t\t}\n\n\t\t\t// Switch is the last thing we do.\n\t\t\ttasks.push(switchWorkspace);\n\n\t\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t\t} else {\n\t\t\tswitchWorkspace();\n\t\t}\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tWorkspace Management Helpers\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * General handler for `async.series` and `async.waterfall`\n\t */\n\tonAsyncComplete(err?: Error | null) {\n\t\tLogger.system.debug(\"workspaceManagementMenuStore: onAsyncComplete\");\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\tvalue: false,\n\t\t});\n\t\tconst errMessage = err?.message;\n\t\tif (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {\n\t\t\t// handle error.\n\t\t\tLogger.system.error(err);\n\t\t}\n\n\t\t// Unlock the UI.\n\t\tActions.setIsSwitchingWorkspaces(false);\n\t\tActions.setIsPromptingUser(false);\n\t},\n\n\t/**\n\t * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.\n\t *\n\t * @param {string} type \"yesNo\" or \"singleInput\"\n\t * @param {object} data Optional params for the dialog call.\n\t * @param {function} responseCallback invoked when the user interacts with the dialog.\n\t */\n\tspawnDialog(type: \"yesNo\" | \"singleInput\", data: any, responseCallback: StandardErrorCallback) {\n\t\tLogger.system.debug(\"spawnDialog\", type, data);\n\t\tif (type === \"singleInput\") {\n\t\t\tdata.showCancelButton = true;\n\t\t}\n\t\tFSBL.Clients.DialogManager.open(type, data, responseCallback);\n\t},\n\n\tspawnSaveAsDialog: (cb: StandardCallback) => {\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnSaveAsDialog onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Spawns an input field asking what the user would like to name their new workspace.\n\t */\n\tspawnWorkspaceInputField: (cb: StandardCallback) => {\n\t\t// Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.\n\t\tLogger.system.log(\"SpawnWorkspaceInput - start\");\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnWorkspaceInput onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.\n\t */\n\taskIfUserWantsToSave: async function (callback: StandardCallback) {\n\t\tconst activeWorkspace: WorkspaceType = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tLogger.system.log(\"NewWorkspace.spawnDialog start.\");\n\t\t\tconst dialogParams = {\n\t\t\t\tmonitor: \"primary\",\n\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t};\n\t\t\tconst waitForUserInput = () =>\n\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\t\t\t\tLogger.system.log(\"Spawn Dialog callback.\");\n\t\t\t\t\t\tif (callback) callback(null, response);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t};\n\t\t\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t\t\t});\n\t\t\treturn await waitForUserInput();\n\t\t} else {\n\t\t\t// In this case the workspace is not dirty, so we don't need to save.\n\t\t\tif (callback) callback(null, { choice: \"negative\" });\n\t\t\treturn { choice: \"negative\" };\n\t\t}\n\t},\n\n\t/**\n\t * Handles the response from the dialog asking if the user wants to save their workspace.\n\t *\n\t * @param {any} response\n\t * @param {any} callback\n\t */\n\thandleSaveDialogResponse(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tif (response.choice === \"affirmative\") {\n\t\t\t// User wants to save, so call the client API.\n\t\t\tActions.saveWorkspace(callback);\n\t\t} else if (response.choice === \"negative\") {\n\t\t\t// Doesn't want to save.\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\t// choice === cancel\n\t\t\tcallback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t},\n\t/**\n\t * Makes sure the user has input a valid workspace name.\n\t */\n\tvalidateWorkspaceInput(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tLogger.system.log(\"spawnWorkspaceInput\", response);\n\t\t// If user wants to proceed but gave an invalid name, tell them that they messed up, then die.\n\t\tif (response.choice !== \"cancel\" && (!response.value || response.value === \"\")) {\n\t\t\tlet dialogParams = {\n\t\t\t\ttitle: \"Invalid Workspace Name\",\n\t\t\t\tquestion: \"Workspace names must contain letters or numbers. Please try again.\",\n\t\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t\tshowCancelButton: false,\n\t\t\t};\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, () => {});\n\t\t\treturn callback(new Error(\"Invalid workspace name.\"));\n\t\t} else if (response.choice === \"cancel\") {\n\t\t\treturn callback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t\tcallback(null, response);\n\t},\n\n\taskAboutOverwrite(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tconst { workspaceExists, workspaceName } = params;\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Overwrite Workspace?\",\n\t\t\tquestion: `This will overwrite the saved data for \"${workspaceName}\". Would you like to proceed?`,\n\t\t\taffirmativeResponseLabel: \"Overwrite\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, workspaceName);\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t};\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, workspaceName);\n\t\t}\n\t},\n\taskIfUserWantsNewWorkspace(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tlet { workspaceExists, workspaceName, template } = params;\n\n\t\tlet dialogParams = {\n\t\t\ttitle: \"New workspace\",\n\t\t\tquestion: `The workspace \"${workspaceName}\" already exists. A new workspace with a modified name will be created.`,\n\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, { workspaceName, template });\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t}\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, { workspaceName, template });\n\t\t}\n\t},\n\n\t/**\n\t * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.\n\t */\n\tcheckIfWorkspaceAlreadyExists(response: any, callback: StandardErrorCallback) {\n\t\tconst workspaceName = response.value;\n\t\tconst camelCaseWorkspaceName = Util.camelCase(workspaceName);\n\t\t// Do any of the workspaces have the same name that the user is trying to input.\n\t\tconst workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some(\n\t\t\t(workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName\n\t\t);\n\t\tcallback(null, {\n\t\t\tworkspaceExists,\n\t\t\tworkspaceName,\n\t\t\ttemplate: response.template,\n\t\t});\n\t},\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMisc functionality\n\t *\n\t *********************************************************************************************/\n\t/**\n\t * Un-focuses from the menu.\n\t */\n\tblurWindow: function () {\n\t\tfinsembleWindow.blur();\n\t},\n};\n\nfunction createLocalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{ store: \"Finsemble-WorkspaceMenu-Local-Store\", values: defaultData },\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction createGlobalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{\n\t\t\tstore: \"Finsemble-WorkspaceMenu-Global-Store\",\n\t\t\tglobal: true,\n\t\t\tvalues: { owner: finsembleWindow.name },\n\t\t},\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementGlobalStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getPreferences(done: () => void) {\n\t(async () => {\n\t\tconst { err: errPreferences, data: preferences } = await FSBL.Clients.ConfigClient.getPreferences();\n\t\tif (errPreferences) {\n\t\t\tLogger.system.error(\"workspaceManagementMenuStore.getPreferences - getPreferences\", errPreferences);\n\t\t}\n\t\t// if we have preference value set then use it, since the user as explicitly set this preference\n\t\tif (preferences && Object.keys(preferences).includes(WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE)) {\n\t\t\tPROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE];\n\n\t\t\tObject.keys(preferences).includes(WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES)\n\t\t\t\t? (DISCARD_UNSAVED_CHANGES = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES] ?? false)\n\t\t\t\t: false;\n\t\t} else {\n\t\t\t// otherwise get the deprecated config\n\t\t\tconst { err: errValues, data: configValues } = await FSBL.Clients.ConfigClient.getValues([\n\t\t\t\tWORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY,\n\t\t\t]);\n\t\t\tif (errValues) {\n\t\t\t\tLogger.system.error(\"workspaceManagementMenuStore.getPreferences - getValues\", errValues);\n\t\t\t}\n\t\t\tPROMPT_ON_DIRTY_WORKSPACE = configValues\n\t\t\t\t? configValues[WORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY] ?? true\n\t\t\t\t: true;\n\t\t\tFSBL.Clients.ConfigClient.setPreference({\n\t\t\t\tfield: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE,\n\t\t\t\tvalue: PROMPT_ON_DIRTY_WORKSPACE,\n\t\t\t});\n\t\t}\n\n\t\tdone();\n\t})();\n}\n\n/**\n * Initializes the store for the Workspace Management Menu.\n */\nfunction initialize(cb: any) {\n\tStoreClient = FSBL.Clients.DistributedStoreClient;\n\t// eslint-disable-next-line prefer-destructuring\n\tLogger = FSBL.Clients.Logger;\n\tasync.parallel([createGlobalStore, createLocalStore, getPreferences, addListeners], () => {\n\t\tActions.initialize();\n\t\tcb(WorkspaceManagementStore);\n\t});\n}\n\nlet getStore = () => WorkspaceManagementStore;\n\n/**\n * This is a quick little initialization manager that Terry hacked up.\n * Ultimately everything in this file should be rewritten in hooks/redux pattern.\n */\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store !== null) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport {\n\tstoreManager,\n\tWorkspaceManagementGlobalStore as GlobalStore,\n\tinitialize,\n\tWorkspaceManagementStore as Store,\n\tActions,\n\tgetStore,\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StandardError } from "@finsemble/finsemble-
|
|
2
|
+
import { StandardError } from "@finsemble/finsemble-api/types/types";
|
|
3
3
|
import { Workspace, WorkspaceTemplate } from "../../../../types/workspaceTypes";
|
|
4
4
|
interface IProps {
|
|
5
5
|
addListener: (fieldListener: {
|
|
@@ -23,6 +23,8 @@ interface IState {
|
|
|
23
23
|
adding: boolean;
|
|
24
24
|
workspaceToLoadOnStart: string | null;
|
|
25
25
|
focusedWorkspaceComponentList: string[];
|
|
26
|
+
promptUserOnDirtyWorkspace: boolean;
|
|
27
|
+
discardUnsavedChanges: boolean;
|
|
26
28
|
}
|
|
27
29
|
export default class Workspaces extends React.Component<IProps, IState> {
|
|
28
30
|
addWorkspace?: () => void;
|
|
@@ -49,6 +51,7 @@ export default class Workspaces extends React.Component<IProps, IState> {
|
|
|
49
51
|
setPreferences(err: StandardError, data: any): void;
|
|
50
52
|
componentDidMount(): void;
|
|
51
53
|
componentWillUnmount(): void;
|
|
54
|
+
setPreference(field: string, value: any, cb?: Function): void;
|
|
52
55
|
setWorkspaceToLoadOnStart(eventOrCb: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | (() => void)): void;
|
|
53
56
|
openFileDialog(): void;
|
|
54
57
|
preferencesFocused(): void;
|
|
@@ -61,6 +64,8 @@ export default class Workspaces extends React.Component<IProps, IState> {
|
|
|
61
64
|
exportWorkspace(): void;
|
|
62
65
|
handleButtonClicks(e: React.MouseEvent<HTMLDivElement>): void;
|
|
63
66
|
getFocusedWorkspaceComponentList(): never[] | undefined;
|
|
67
|
+
toggleDiscardUnsavedChanges(): void;
|
|
68
|
+
togglePromptUserOnDirtyWorkspace(): void;
|
|
64
69
|
render(): JSX.Element;
|
|
65
70
|
}
|
|
66
71
|
export {};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import async from "async";
|
|
3
|
-
import { Util } from "@finsemble/finsemble-
|
|
3
|
+
import { Util } from "@finsemble/finsemble-api";
|
|
4
4
|
import { Actions as WorkspaceManagementMenuActions } from "../../../toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore";
|
|
5
5
|
import { WorkspaceManagementMenuStore } from "../../stores/UserPreferencesStore";
|
|
6
6
|
import { Checkbox } from "../../../common/Checkbox";
|
|
7
7
|
import { WorkspaceButton } from "../workspaces/WorkspaceButton";
|
|
8
8
|
import WorkspaceComponents from "../workspaces/WorkspaceComponents";
|
|
9
9
|
import WorkspaceItemList from "../workspaces/WorkspaceItemList";
|
|
10
|
+
const WORKSPACE_PREFERENCES = {
|
|
11
|
+
PROMPT_USER_ON_DIRTY_WORKSPACE: "finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace",
|
|
12
|
+
DISCARD_UNSAVED_CHANGES: "finsemble.servicesConfig.workspace.discardUnsavedChanges",
|
|
13
|
+
};
|
|
10
14
|
export default class Workspaces extends React.Component {
|
|
11
15
|
constructor(props) {
|
|
12
16
|
var _a, _b;
|
|
@@ -22,6 +26,8 @@ export default class Workspaces extends React.Component {
|
|
|
22
26
|
focusedWorkspaceComponentList: [],
|
|
23
27
|
initialAlwaysOnTop: (_a = finsembleWindow.windowOptions) === null || _a === void 0 ? void 0 : _a.alwaysOnTop,
|
|
24
28
|
alwaysOnTop: (_b = finsembleWindow.windowOptions) === null || _b === void 0 ? void 0 : _b.alwaysOnTop,
|
|
29
|
+
promptUserOnDirtyWorkspace: true,
|
|
30
|
+
discardUnsavedChanges: false,
|
|
25
31
|
};
|
|
26
32
|
this.bindCorrectContext();
|
|
27
33
|
this.addListeners();
|
|
@@ -52,6 +58,8 @@ export default class Workspaces extends React.Component {
|
|
|
52
58
|
this.openFileDialog = this.openFileDialog.bind(this);
|
|
53
59
|
this.preferencesFocused = this.preferencesFocused.bind(this);
|
|
54
60
|
this.setFocusedWorkspace = this.setFocusedWorkspace.bind(this);
|
|
61
|
+
this.toggleDiscardUnsavedChanges = this.toggleDiscardUnsavedChanges.bind(this);
|
|
62
|
+
this.togglePromptUserOnDirtyWorkspace = this.togglePromptUserOnDirtyWorkspace.bind(this);
|
|
55
63
|
}
|
|
56
64
|
setWorkspaceList(err, data) {
|
|
57
65
|
console.log("Set workspacelist", data);
|
|
@@ -65,7 +73,7 @@ export default class Workspaces extends React.Component {
|
|
|
65
73
|
this.props.addListener({ field: "WorkspaceList" }, this.setWorkspaceList);
|
|
66
74
|
}
|
|
67
75
|
changePreferencesAlwaysOnTop(alwaysOnTop) {
|
|
68
|
-
if (this.state.initialAlwaysOnTop
|
|
76
|
+
if (this.state.initialAlwaysOnTop) {
|
|
69
77
|
FSBL.Clients.WindowClient.setAlwaysOnTop(alwaysOnTop, () => {
|
|
70
78
|
this.setState({
|
|
71
79
|
alwaysOnTop,
|
|
@@ -240,6 +248,17 @@ export default class Workspaces extends React.Component {
|
|
|
240
248
|
FSBL.Clients.ConfigClient.getPreferences((err, data) => {
|
|
241
249
|
this.setPreferences(err, { value: data });
|
|
242
250
|
});
|
|
251
|
+
FSBL.Clients.ConfigClient.getValues([WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE, WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES], (err, values) => {
|
|
252
|
+
if (err) {
|
|
253
|
+
FSBL.Clients.Logger.system.info("componentDidMount.getValues error", err);
|
|
254
|
+
}
|
|
255
|
+
if (values) {
|
|
256
|
+
this.setState({
|
|
257
|
+
promptUserOnDirtyWorkspace: values[WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE],
|
|
258
|
+
discardUnsavedChanges: values[WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES],
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
});
|
|
243
262
|
this.props.getValue({ field: "WorkspaceList" }, (err, data) => {
|
|
244
263
|
if (data && data.length) {
|
|
245
264
|
this.setState({
|
|
@@ -251,29 +270,29 @@ export default class Workspaces extends React.Component {
|
|
|
251
270
|
componentWillUnmount() {
|
|
252
271
|
this.props.removeListener({ field: "preferences" }, this.setPreferences);
|
|
253
272
|
}
|
|
273
|
+
setPreference(field, value, cb) {
|
|
274
|
+
FSBL.Clients.ConfigClient.setPreference({
|
|
275
|
+
field,
|
|
276
|
+
value,
|
|
277
|
+
}, (err) => {
|
|
278
|
+
if (err) {
|
|
279
|
+
console.error(err);
|
|
280
|
+
}
|
|
281
|
+
if (cb) {
|
|
282
|
+
cb();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
254
286
|
setWorkspaceToLoadOnStart(eventOrCb) {
|
|
255
287
|
if (!this.state.focusedWorkspace)
|
|
256
288
|
return;
|
|
257
|
-
const setPreference = () => {
|
|
258
|
-
FSBL.Clients.ConfigClient.setPreference({
|
|
259
|
-
field: "finsemble.initialWorkspace",
|
|
260
|
-
value: this.state.workspaceToLoadOnStart,
|
|
261
|
-
}, (err) => {
|
|
262
|
-
if (err) {
|
|
263
|
-
console.error(err);
|
|
264
|
-
}
|
|
265
|
-
if (typeof eventOrCb === "function") {
|
|
266
|
-
eventOrCb();
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
};
|
|
270
289
|
if (this.state.focusedWorkspace === this.state.workspaceToLoadOnStart) {
|
|
271
|
-
this.setState({ workspaceToLoadOnStart: null }, setPreference);
|
|
290
|
+
this.setState({ workspaceToLoadOnStart: null }, () => this.setPreference("finsemble.initialWorkspace", null));
|
|
272
291
|
}
|
|
273
292
|
else {
|
|
274
293
|
this.setState({
|
|
275
294
|
workspaceToLoadOnStart: this.state.focusedWorkspace,
|
|
276
|
-
}, setPreference);
|
|
295
|
+
}, () => this.setPreference("finsemble.initialWorkspace", this.state.focusedWorkspace));
|
|
277
296
|
}
|
|
278
297
|
}
|
|
279
298
|
openFileDialog() {
|
|
@@ -385,6 +404,24 @@ export default class Workspaces extends React.Component {
|
|
|
385
404
|
}
|
|
386
405
|
});
|
|
387
406
|
}
|
|
407
|
+
toggleDiscardUnsavedChanges() {
|
|
408
|
+
const newValue = !this.state.discardUnsavedChanges;
|
|
409
|
+
this.setState({
|
|
410
|
+
discardUnsavedChanges: newValue,
|
|
411
|
+
}, () => this.setPreference(WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES, newValue));
|
|
412
|
+
}
|
|
413
|
+
togglePromptUserOnDirtyWorkspace() {
|
|
414
|
+
const newValue = !this.state.promptUserOnDirtyWorkspace;
|
|
415
|
+
this.setState({
|
|
416
|
+
promptUserOnDirtyWorkspace: newValue,
|
|
417
|
+
discardUnsavedChanges: newValue ? false : this.state.discardUnsavedChanges,
|
|
418
|
+
}, () => {
|
|
419
|
+
this.setPreference(WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE, newValue);
|
|
420
|
+
if (newValue) {
|
|
421
|
+
this.setPreference(WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES, false);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}
|
|
388
425
|
render() {
|
|
389
426
|
var _a, _b, _c;
|
|
390
427
|
let deleteButtonClasses = "individual-workspace-action delete-workspace", renameButtonClasses = "individual-workspace-action", allowDelete = true, allowExport = true, allowRename = true, allowImport = true, deleteTooltip = "Delete";
|
|
@@ -420,7 +457,11 @@ export default class Workspaces extends React.Component {
|
|
|
420
457
|
React.createElement("div", { className: "workspace-action-buttons" },
|
|
421
458
|
React.createElement(WorkspaceButton, { title: importTooltip, onMouseDown: this.handleButtonClicks, onClick: allowImport ? this.openFileDialog : () => { }, type: "import" }),
|
|
422
459
|
React.createElement(WorkspaceButton, { title: exportTooltip, onMouseDown: this.handleButtonClicks, onClick: allowExport ? this.exportWorkspace : () => { }, type: "export" })))),
|
|
423
|
-
React.createElement(Checkbox, { disabled: !this.state.focusedWorkspace, onClick: this.setWorkspaceToLoadOnStart, checked: this.state.focusedWorkspace === this.state.workspaceToLoadOnStart, label: "Load this workspace on startup" })
|
|
460
|
+
React.createElement(Checkbox, { disabled: !this.state.focusedWorkspace, onClick: this.setWorkspaceToLoadOnStart, checked: this.state.focusedWorkspace === this.state.workspaceToLoadOnStart, label: "Load this workspace on startup" }),
|
|
461
|
+
React.createElement(React.Fragment, null, "\u00A0"),
|
|
462
|
+
React.createElement(Checkbox, { onClick: this.togglePromptUserOnDirtyWorkspace, checked: this.state.promptUserOnDirtyWorkspace, label: "Prompt user on dirty workspace" }),
|
|
463
|
+
React.createElement("span", { className: "indent-15px" },
|
|
464
|
+
React.createElement(Checkbox, { disabled: this.state.promptUserOnDirtyWorkspace, onClick: this.toggleDiscardUnsavedChanges, checked: this.state.discardUnsavedChanges, label: "Discard unsaved changes" })))));
|
|
424
465
|
}
|
|
425
466
|
}
|
|
426
467
|
//# sourceMappingURL=Workspaces.js.map
|