@finsemble/finsemble-ui 6.1.1 → 6.1.5
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/README.md +28 -28
- package/package.json +1 -1
- package/react/actions/favoriteActions.js.map +1 -1
- package/react/actions/linkerActions.js.map +1 -1
- package/react/actions/menuActions.js.map +1 -1
- package/react/actions/rootActions.js.map +1 -1
- package/react/actions/searchActions.js.map +1 -1
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/actions/toolbarActions.js.map +1 -1
- package/react/actions/workspaceActions.js.map +1 -1
- package/react/assets/css/advancedAppLauncher.css +636 -636
- package/react/assets/css/appCatalog.css +1069 -1069
- package/react/assets/css/authentication.css +78 -78
- package/react/assets/css/button.css +219 -219
- package/react/assets/css/core/formElements.css +23 -23
- package/react/assets/css/core/icons.css +69 -69
- package/react/assets/css/core/notifications.css +75 -75
- package/react/assets/css/core/windowFrame.css +36 -36
- package/react/assets/css/dashbar.css +78 -78
- package/react/assets/css/defaultTheme.css +356 -356
- package/react/assets/css/dialogs.css +158 -158
- package/react/assets/css/favorites.css +101 -101
- package/react/assets/css/finsemble.css +38 -38
- package/react/assets/css/focus.css +4 -4
- package/react/assets/css/font-finance.css +385 -385
- package/react/assets/css/fonts/Open_Sans/LICENSE.txt +202 -202
- package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +118 -118
- package/react/assets/css/fonts/font-finance.svg +124 -124
- package/react/assets/css/fonts/icons-reference.html +1174 -1174
- package/react/assets/css/linkerWindow.css +124 -124
- package/react/assets/css/menus.css +195 -195
- package/react/assets/css/notificationsCenter.css +594 -594
- package/react/assets/css/processMonitor.css +213 -213
- package/react/assets/css/search.css +128 -128
- package/react/assets/css/shared/animations.css +99 -99
- package/react/assets/css/tags.css +136 -136
- package/react/assets/css/toolbar.css +413 -413
- package/react/assets/css/userPreferences.css +565 -565
- package/react/assets/css/windowTitleBar.css +619 -619
- package/react/assets/icons/check.svg +3 -3
- package/react/assets/icons/chevron-left.svg +3 -3
- package/react/assets/icons/chevron-right.svg +3 -3
- package/react/assets/icons/copy.svg +10 -10
- package/react/assets/icons/exclamation-circle.svg +4 -4
- package/react/assets/icons/external-link.svg +12 -12
- package/react/assets/icons/flag.svg +10 -10
- package/react/assets/icons/folder.svg +3 -3
- package/react/assets/icons/font.svg +3 -3
- package/react/assets/icons/globe.svg +3 -3
- package/react/assets/icons/hdd.svg +9 -9
- package/react/assets/icons/key.svg +10 -10
- package/react/assets/icons/life-ring.svg +3 -3
- package/react/assets/icons/magic.svg +15 -15
- package/react/assets/icons/moon.svg +10 -10
- package/react/assets/icons/paint-roller.svg +3 -3
- package/react/assets/icons/pencil.svg +10 -10
- package/react/assets/icons/plus.svg +3 -3
- package/react/assets/icons/question-circle.svg +5 -5
- package/react/assets/icons/search.svg +3 -3
- package/react/assets/icons/sun.svg +9 -9
- package/react/assets/icons/times.svg +3 -3
- package/react/assets/icons/toggle-off.svg +6 -6
- package/react/assets/icons/toggle-on.svg +6 -6
- package/react/assets/icons/tools.svg +3 -3
- package/react/assets/icons/trash.svg +12 -12
- package/react/assets/icons/upload.svg +10 -10
- package/react/assets/icons/window.svg +3 -3
- package/react/componentTemplateGenerator.js +85 -85
- package/react/componentTemplateGenerator.js.map +1 -1
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/AppCatalog.js.map +1 -1
- package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
- package/react/components/appCatalog/components/AppCard.js.map +1 -1
- package/react/components/appCatalog/components/AppList.js.map +1 -1
- package/react/components/appCatalog/components/AppResults.js.map +1 -1
- package/react/components/appCatalog/components/Carousel.js.map +1 -1
- package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
- package/react/components/appCatalog/components/Hero.js.map +1 -1
- package/react/components/appCatalog/components/Home.js.map +1 -1
- package/react/components/appCatalog/components/SearchBar.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
- package/react/components/appCatalog/components/Tag.js.map +1 -1
- package/react/components/appCatalog/components/Toast.js.map +1 -1
- package/react/components/appCatalog/components/helpers.js.map +1 -1
- package/react/components/appCatalog/index.js.map +1 -1
- package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/appCatalog/stores/storeActions.js.map +1 -1
- package/react/components/common/Button.js.map +1 -1
- package/react/components/common/ButtonIcon.js.map +1 -1
- package/react/components/common/ButtonTile.js.map +1 -1
- package/react/components/common/ColorPicker.js.map +1 -1
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/DropdownButton.js.map +1 -1
- package/react/components/common/FileInput.js.map +1 -1
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/FinsembleToggle.js.map +1 -1
- package/react/components/common/FontSizeSelector.js.map +1 -1
- package/react/components/common/Header.js.map +1 -1
- package/react/components/common/ImagePreview.js.map +1 -1
- package/react/components/common/LoadingSpinner.js.map +1 -1
- package/react/components/common/Tab.js.map +1 -1
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/application-edit-page.css +117 -117
- package/react/components/common/css/application-list.css +47 -47
- package/react/components/common/css/button.css +164 -164
- package/react/components/common/css/color-picker.css +52 -52
- package/react/components/common/css/drop-zone.css +17 -17
- package/react/components/common/css/file-input.css +49 -49
- package/react/components/common/css/header.css +43 -43
- package/react/components/common/css/icon.css +13 -13
- package/react/components/common/css/image-preview.css +57 -57
- package/react/components/common/css/loading-spinner.css +39 -39
- package/react/components/common/css/selector.css +51 -51
- package/react/components/common/css/styles.css +128 -128
- package/react/components/common/css/tab.css +56 -56
- package/react/components/common/css/toggle.css +32 -32
- package/react/components/common/css/tooltip.css +68 -68
- package/react/components/common/file_helpers.js.map +1 -1
- package/react/components/common/fixtures/FinsembleIcon.css +4 -4
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/Button.stories.js.map +1 -1
- package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
- package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
- package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
- package/react/components/common/stories/DropZone.stories.js.map +1 -1
- package/react/components/common/stories/FileInput.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
- package/react/components/common/stories/FontSizeSelector.stories.js.map +1 -1
- package/react/components/common/stories/Header.stories.js.map +1 -1
- package/react/components/common/stories/ImagePreview.stories.js.map +1 -1
- package/react/components/common/stories/LoadingSpinner.stories.js.map +1 -1
- package/react/components/common/stories/Tab.stories.js.map +1 -1
- package/react/components/common/stories/Tooltip.stories.js.map +1 -1
- package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
- package/react/components/common/tests/DropZone.spec.js.map +1 -1
- package/react/components/common/tests/FileInput.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/common/tests/Header.spec.js.map +1 -1
- package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
- package/react/components/common/tests/Tab.spec.js.map +1 -1
- package/react/components/common/tests/Tooltip.spec.js.map +1 -1
- package/react/components/favorites/FavoriteMaker.js.map +1 -1
- package/react/components/favorites/FavoritesShell.js.map +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/favorites/index.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.css +125 -125
- package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/icon/index.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
- package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
- package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +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/LinkerMenuDeprecated.js.map +1 -1
- package/react/components/linker/index.js.map +1 -1
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/Menu.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuContent.js.map +1 -1
- package/react/components/menu/MenuHotKey.js.map +1 -1
- package/react/components/menu/MenuItem.js.map +1 -1
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/menu/MenuShell.js.map +1 -1
- package/react/components/menu/MenuToggle.js.map +1 -1
- package/react/components/menu/index.js.map +1 -1
- package/react/components/menu/keyboardNavigation.js.map +1 -1
- package/react/components/menu/menuContext.js.map +1 -1
- package/react/components/menu/menuHelpers.js.map +1 -1
- package/react/components/notifications/components/NoNotifications.js.map +1 -1
- package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerHeader.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.js.map +1 -1
- package/react/components/notifications/components/shared/IconButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyContentLogo.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderLogo.js.map +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.js +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/constants.js.map +1 -1
- package/react/components/notifications/icons/Card.js.map +1 -1
- package/react/components/notifications/icons/Chevron.js.map +1 -1
- package/react/components/notifications/icons/CloseIcon.js.map +1 -1
- package/react/components/notifications/icons/EnvelopeClose.js.map +1 -1
- package/react/components/notifications/icons/EnvelopeOpen.js.map +1 -1
- package/react/components/notifications/icons/SnoozeIcon.js.map +1 -1
- package/react/components/notifications/index.js.map +1 -1
- package/react/components/notifications/notificationsContext.js.map +1 -1
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindows.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
- package/react/components/processMonitor/constants.js.map +1 -1
- package/react/components/processMonitor/helpers.js.map +1 -1
- package/react/components/processMonitor/index.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
- package/react/components/quickComponentForm/index.js.map +1 -1
- package/react/components/quickComponentForm/quickComponent.css +3 -3
- package/react/components/search/Highlight.js.map +1 -1
- package/react/components/search/Highlight.spec.js.map +1 -1
- package/react/components/search/Highlight.stories.js.map +1 -1
- package/react/components/search/Search.js.map +1 -1
- package/react/components/search/SearchBestMatch.js.map +1 -1
- package/react/components/search/SearchInput.js.map +1 -1
- package/react/components/search/SearchProviderResults.js.map +1 -1
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/search/SearchResults.js.map +1 -1
- package/react/components/search/index.js.map +1 -1
- package/react/components/shared/Animate.js.map +1 -1
- package/react/components/shared/BellIcon.js.map +1 -1
- package/react/components/shared/BellIconCrossed.js.map +1 -1
- package/react/components/shared/Button.js.map +1 -1
- package/react/components/shared/ConditionalWrapper.js.map +1 -1
- package/react/components/shared/DefaultDropdownButton.js.map +1 -1
- package/react/components/shared/NavigationButton.js.map +1 -1
- package/react/components/shared/Tag.js.map +1 -1
- package/react/components/shared/TagsMenu.js.map +1 -1
- package/react/components/shared/addProtocolToValidURL.js.map +1 -1
- package/react/components/shared/addProtocolToValidURL.spec.js.map +1 -1
- package/react/components/shared/linkerUtil.js.map +1 -1
- package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
- package/react/components/shared/validateURL.js.map +1 -1
- package/react/components/shared/validateURL.spec.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.css +3 -3
- package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
- package/react/components/singleInputDialog/index.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Appearance.css +94 -94
- package/react/components/smartDesktopDesigner/Appearance.helpers.js.map +1 -1
- package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
- package/react/components/smartDesktopDesigner/Application.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
- package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
- package/react/components/smartDesktopDesigner/AssetsPage.css +26 -26
- package/react/components/smartDesktopDesigner/AssetsPage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
- package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
- package/react/components/smartDesktopDesigner/Content.js.map +1 -1
- package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
- package/react/components/smartDesktopDesigner/Export.js.map +1 -1
- package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
- package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
- package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
- package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
- package/react/components/smartDesktopDesigner/Navigation.js.map +1 -1
- package/react/components/smartDesktopDesigner/ProjectErrors.js.map +1 -1
- package/react/components/smartDesktopDesigner/ProjectHeader.js.map +1 -1
- package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
- package/react/components/smartDesktopDesigner/PublishProgress.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/smartDesktopDesigner/ThemePage.css +110 -110
- package/react/components/smartDesktopDesigner/ThemePage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
- package/react/components/smartDesktopDesigner/View.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +2 -2
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/css/appearance.css +10 -10
- package/react/components/smartDesktopDesigner/css/applications.css +89 -89
- package/react/components/smartDesktopDesigner/css/authentication.css +125 -125
- package/react/components/smartDesktopDesigner/css/buttons.css +12 -12
- package/react/components/smartDesktopDesigner/css/export.css +163 -163
- package/react/components/smartDesktopDesigner/css/getting-started.css +6 -6
- package/react/components/smartDesktopDesigner/css/nav.css +93 -93
- package/react/components/smartDesktopDesigner/css/project-errors.css +15 -15
- package/react/components/smartDesktopDesigner/css/project-header.css +121 -121
- package/react/components/smartDesktopDesigner/css/styles.css +179 -179
- package/react/components/smartDesktopDesigner/css/views.css +16 -16
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/configTemplate.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/projectErrorsProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/AssetsPage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ThemePage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/a11y_helper.js +3 -3
- package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
- package/react/components/smartDesktopDesigner/themeDefinitions.js.map +1 -1
- package/react/components/system/System.js.map +1 -1
- package/react/components/system/System.spec.js.map +1 -1
- package/react/components/system/System.stories.js.map +1 -1
- package/react/components/system/SystemTrayComponentShell.js.map +1 -1
- package/react/components/system/index.js.map +1 -1
- package/react/components/toolbar/AutoArrange.js.map +1 -1
- package/react/components/toolbar/DragHandle.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
- package/react/components/toolbar/NotificationControl.js.map +1 -1
- package/react/components/toolbar/RevealAll.js.map +1 -1
- package/react/components/toolbar/RevealAll.spec.js.map +1 -1
- package/react/components/toolbar/RevealAll.stories.js.map +1 -1
- package/react/components/toolbar/ToolbarIcon.js.map +1 -1
- package/react/components/toolbar/ToolbarSection.js.map +1 -1
- package/react/components/toolbar/ToolbarShell.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +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.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
- 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/advancedAppLauncher/utils/sort-functions.js.map +1 -1
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/appLauncher.css +30 -30
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
- package/react/components/toolbar/index.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +94 -94
- package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
- package/react/components/userPreferences/UserPreferences.js.map +1 -1
- package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
- package/react/components/userPreferences/components/Checkbox.js.map +1 -1
- package/react/components/userPreferences/components/ContentSection.js.map +1 -1
- package/react/components/userPreferences/components/LeftNav.js.map +1 -1
- package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
- package/react/components/userPreferences/components/content/General.js.map +1 -1
- package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
- package/react/components/userPreferences/index.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
- package/react/components/utils.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabRegion.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
- package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/CloseButton.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/right/MinimizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/index.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
- package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
- package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
- package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.css +3 -3
- package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
- package/react/components/yesNoDialog/index.js.map +1 -1
- package/react/components/yesNoDialog/timer.js.map +1 -1
- package/react/enzymeSetup.js.map +1 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useAuth.js.map +1 -1
- package/react/hooks/useDeepEffect.js.map +1 -1
- package/react/hooks/useFavorites.js.map +1 -1
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useHotkey.js.map +1 -1
- package/react/hooks/useLinker.js.map +1 -1
- package/react/hooks/useMenu.js.map +1 -1
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/useOutsideClickDetector.js.map +1 -1
- package/react/hooks/usePubSub.js.map +1 -1
- package/react/hooks/useSearch.js.map +1 -1
- package/react/hooks/useToolbar.js.map +1 -1
- package/react/hooks/useWorkspace.js.map +1 -1
- package/react/reducers/favoriteReducer.js.map +1 -1
- package/react/reducers/linkerReducer.js.map +1 -1
- package/react/reducers/menuReducer.js.map +1 -1
- package/react/reducers/rootReducer.js.map +1 -1
- package/react/reducers/searchReducer.js.map +1 -1
- package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
- package/react/reducers/toolbarReducer.js.map +1 -1
- package/react/reducers/workspaceReducer.js.map +1 -1
- package/react/store.js.map +1 -1
- package/react/types/advancedAppLauncherTypes.js.map +1 -1
- package/react/types/dashbarTypes.js.map +1 -1
- package/react/types/favoriteTypes.js.map +1 -1
- package/react/types/fdc3.js.map +1 -1
- package/react/types/hotkeyTypes.js.map +1 -1
- package/react/types/iconTypes.js.map +1 -1
- package/react/types/linkerTypes.js.map +1 -1
- package/react/types/searchTypes.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/workspaceTypes.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/content/Notifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOnD,OAAO,EACN,+BAA+B,GAE/B,MAAM,uCAAuC,CAAC;AAG/C,OAAO,4BAA4B,MAAM,kDAAkD,CAAC;AAC5F,OAAO,+BAA+B,MAAM,qDAAqD,CAAC;AAClG,OAAO,wBAAwB,MAAM,8CAA8C,CAAC;AAYpF,MAAM,UAAU,GAAG,CAAC,QAAwC,EAAE,EAAE;IAC/D,QAAQ,QAAQ,EAAE;QACjB,KAAK,MAAM;YACV,OAAO,oBAAC,4BAA4B,OAAG,CAAC;QAEzC,KAAK,SAAS;YACb,OAAO,oBAAC,+BAA+B,OAAG,CAAC;QAE5C,KAAK,SAAS;YACb,OAAO,oBAAC,wBAAwB,OAAG,CAAC;KACrC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa;IACpC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAiC,MAAM,CAAC,CAAC;IACvF,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,GAAG,QAAQ,CAA8B,IAAI,CAAC,CAAC;IAChH,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;IAE3F,MAAM,qCAAqC,GAAwC;QAClF,mCAAmC,EAAE,WAAW;QAChD,sCAAsC,EAAE,cAAc;QACtD,0BAA0B,EAAE,0BAA0B;QACtD,6BAA6B,EAAE,6BAA6B;QAC5D,mBAAmB,EAAE,mBAAmB;QACxC,sBAAsB,EAAE,sBAAsB;KAC9C,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,2CAA2C;QACzD,oBAAC,+BAA+B,CAAC,QAAQ,IAAC,KAAK,EAAE,qCAAqC,IACpF,UAAU,CAAC,WAAW,CAAC,CACkB,CACtC,CACN,CAAC;AACH,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\
|
|
1
|
+
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/content/Notifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOnD,OAAO,EACN,+BAA+B,GAE/B,MAAM,uCAAuC,CAAC;AAG/C,OAAO,4BAA4B,MAAM,kDAAkD,CAAC;AAC5F,OAAO,+BAA+B,MAAM,qDAAqD,CAAC;AAClG,OAAO,wBAAwB,MAAM,8CAA8C,CAAC;AAYpF,MAAM,UAAU,GAAG,CAAC,QAAwC,EAAE,EAAE;IAC/D,QAAQ,QAAQ,EAAE;QACjB,KAAK,MAAM;YACV,OAAO,oBAAC,4BAA4B,OAAG,CAAC;QAEzC,KAAK,SAAS;YACb,OAAO,oBAAC,+BAA+B,OAAG,CAAC;QAE5C,KAAK,SAAS;YACb,OAAO,oBAAC,wBAAwB,OAAG,CAAC;KACrC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa;IACpC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAiC,MAAM,CAAC,CAAC;IACvF,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,GAAG,QAAQ,CAA8B,IAAI,CAAC,CAAC;IAChH,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;IAE3F,MAAM,qCAAqC,GAAwC;QAClF,mCAAmC,EAAE,WAAW;QAChD,sCAAsC,EAAE,cAAc;QACtD,0BAA0B,EAAE,0BAA0B;QACtD,6BAA6B,EAAE,6BAA6B;QAC5D,mBAAmB,EAAE,mBAAmB;QACxC,sBAAsB,EAAE,sBAAsB;KAC9C,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,2CAA2C;QACzD,oBAAC,+BAA+B,CAAC,QAAQ,IAAC,KAAK,EAAE,qCAAqC,IACpF,UAAU,CAAC,WAAW,CAAC,CACkB,CACtC,CACN,CAAC;AACH,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\n\n// Types\nimport IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\nimport { type } from \"os\";\n\n// Context\nimport {\n\tNotificationsPreferencesContext,\n\tNotificationsPreferencesContextType,\n} from \"../../NotificationsPreferencesContext\";\n\n// Components\nimport NotificationsPreferencesHome from \"./notificationViews/NotificationsPreferencesHome\";\nimport NotificationsSourcesPreferences from \"./notificationViews/NotificationsSourcesPreferences\";\nimport NotificationsSourceTypes from \"./notificationViews/NotificationsSourceTypes\";\n\nexport interface IType {\n\tname: string;\n\tmuted: boolean;\n}\nexport interface INotificationSources {\n\tsource: string;\n\ticon: string;\n\ttypes: IType[];\n}\n\nconst renderView = (viewName: \"Home\" | \"Sources\" | \"Details\") => {\n\tswitch (viewName) {\n\t\tcase \"Home\":\n\t\t\treturn <NotificationsPreferencesHome />;\n\n\t\tcase \"Sources\":\n\t\t\treturn <NotificationsSourcesPreferences />;\n\n\t\tcase \"Details\":\n\t\t\treturn <NotificationsSourceTypes />;\n\t}\n};\n\nexport default function Notifications() {\n\tconst [currentView, setCurrentView] = useState<\"Home\" | \"Sources\" | \"Details\">(\"Home\");\n\tconst [selectedNotificationSource, setSelectedNotificationSource] = useState<INotificationSources | null>(null);\n\tconst [notificationSources, setNotificationSources] = useState<INotificationSources[]>([]);\n\n\tconst notificationsPreferencesContextValues: NotificationsPreferencesContextType = {\n\t\tcurrentNotificationsPreferencesView: currentView,\n\t\tsetCurrentNotificationsPreferencesView: setCurrentView,\n\t\tselectedNotificationSource: selectedNotificationSource,\n\t\tsetSelectedNotificationSource: setSelectedNotificationSource,\n\t\tnotificationSources: notificationSources,\n\t\tsetNotificationSources: setNotificationSources,\n\t};\n\n\treturn (\n\t\t<div className=\"notifications-main-preferences__container\">\n\t\t\t<NotificationsPreferencesContext.Provider value={notificationsPreferencesContextValues}>\n\t\t\t\t{renderView(currentView)}\n\t\t\t</NotificationsPreferencesContext.Provider>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspaces.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/content/Workspaces.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,eAAgB,SAAQ,KAAK,CAAC,SAAS;IAC5C,YAAY,KAAK;QAChB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;YACxB,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,CAAC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,EACvC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAC1E,KAAK,EAAC,iCAAiC,GACtC,CACG,CACD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\r\nimport { WorkspaceManagementMenuStore, UserPreferencesStore } from \"../../stores/UserPreferencesStore\";\r\nimport { FinsembleDnDContext } from \"../../../legacyControls/FinsembleDnDContext\";\r\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\r\nimport Checkbox from \"../Checkbox\";\r\nimport async from \"async\";\r\n\r\nclass WorkspaceEditor extends React.Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tthis.state = {\r\n\t\t\tvalue: props.value || \"\",\r\n\t\t\tfinished: false,\r\n\t\t};\r\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\r\n\t\tthis.onChange = this.onChange.bind(this);\r\n\t\tthis.onBlur = this.onBlur.bind(this);\r\n\t\tthis.onFocus = this.onFocus.bind(this);\r\n\t}\r\n\r\n\tonKeyDown(e) {\r\n\t\tif (e.key === \"Escape\") {\r\n\t\t\tthis.setState({ finished: true }, () => {\r\n\t\t\t\tthis.props.cancelHandler();\r\n\t\t\t});\r\n\t\t} else if (e.key === \"Enter\") {\r\n\t\t\tfunction finish(val) {\r\n\t\t\t\tthis.props.saveHandler(val);\r\n\t\t\t}\r\n\t\t\t// binding so we don't lose the event inside of react's crazy callback structure\r\n\t\t\tthis.setState({ finished: true }, finish.bind(this, e.target.value));\r\n\t\t}\r\n\t}\r\n\r\n\tonChange(e) {\r\n\t\tthis.setState({\r\n\t\t\tvalue: e.target.value,\r\n\t\t});\r\n\t}\r\n\r\n\tonFocus(e) {\r\n\t\te.target.select();\r\n\t}\r\n\r\n\tonBlur() {\r\n\t\t// console.log(\"ON BLUR\", performance.now());\r\n\t\tfunction finish(val) {\r\n\t\t\tthis.props.saveHandler(val);\r\n\t\t}\r\n\t\t// binding so we don't lose the event inside of react's crazy callback structure. Finished is set so that the component doesn't call the saveHandler again on unMount\r\n\t\tthis.setState({ finished: true }, finish.bind(this, this.state.value));\r\n\t}\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t<input\r\n\t\t\t\tonFocus={this.onFocus}\r\n\t\t\t\tonBlur={this.onBlur}\r\n\t\t\t\tautoFocus={true}\r\n\t\t\t\tvalue={this.state.value}\r\n\t\t\t\tclassName=\"workspace-editor\"\r\n\t\t\t\tonChange={this.onChange}\r\n\t\t\t\tonKeyDown={this.onKeyDown}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default class Workspaces extends React.Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tthis.state = {\r\n\t\t\tadding: false,\r\n\t\t\tediting: false,\r\n\t\t\tworkspaceList: [],\r\n\t\t\tfocusedWorkspace: \"\",\r\n\t\t\t// todo, get the workspaceToLoadOnStart from preferences.\r\n\t\t\tworkspaceToLoadOnStart: null,\r\n\t\t\ttemplateName: \"\",\r\n\t\t\tworkspaceBeingEdited: \"\",\r\n\t\t\tfocusedWorkspaceComponentList: [],\r\n\t\t\tinitialAlwaysOnTop: finsembleWindow.windowOptions.alwaysOnTop,\r\n\t\t\talwaysOnTop: finsembleWindow.windowOptions.alwaysOnTop,\r\n\t\t};\r\n\t\tthis.bindCorrectContext();\r\n\t\tthis.addListeners();\r\n\t}\r\n\r\n\tresetState() {\r\n\t\tthis.setState({\r\n\t\t\tadding: false,\r\n\t\t\tediting: false,\r\n\t\t\tfocusedWorkspace: \"\",\r\n\t\t\ttemplateName: \"\",\r\n\t\t\tworkspaceBeingEdited: \"\",\r\n\t\t});\r\n\t}\r\n\r\n\tbindCorrectContext() {\r\n\t\tlet methods = [\r\n\t\t\t\"deleteWorkspace\",\r\n\t\t\t\"addListeners\",\r\n\t\t\t\"setWorkspaceList\",\r\n\t\t\t\"onDragEnd\",\r\n\t\t\t\"startEditingWorkspace\",\r\n\t\t\t\"renameWorkspace\",\r\n\t\t\t\"cancelEdit\",\r\n\t\t\t\"setWorkspaceToLoadOnStart\",\r\n\t\t\t\"setPreferences\",\r\n\t\t\t\"exportWorkspace\",\r\n\t\t\t\"handleButtonClicks\",\r\n\t\t\t\"getFocusedWorkspaceComponentList\",\r\n\t\t\t\"changePreferencesAlwaysOnTop\",\r\n\t\t\t\"openFileDialog\",\r\n\t\t\t\"preferencesFocused\",\r\n\t\t];\r\n\t\tmethods.forEach((method) => {\r\n\t\t\tthis[method] = this[method].bind(this);\r\n\t\t});\r\n\t\twindow.importWorkspace = this.importWorkspace.bind(this);\r\n\t}\r\n\r\n\tsetWorkspaceList(err, data) {\r\n\t\tconsole.log(\"Set workspacelist\", data);\r\n\t\tif (!data) return;\r\n\t\tthis.setState({\r\n\t\t\tworkspaceList: data.value,\r\n\t\t});\r\n\t}\r\n\r\n\taddListeners() {\r\n\t\tUserPreferencesStore.addListener({ field: \"WorkspaceList\" }, this.setWorkspaceList);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the windowOptions.alwaysOnTop to the value supplied. The preferences component should\r\n\t * not be always on top when a file dialog is open.\r\n\t * @param {boolean} alwaysOnTop The value to set finsembleWindow.options.alwaysOnTop\r\n\t */\r\n\tchangePreferencesAlwaysOnTop(alwaysOnTop) {\r\n\t\t// The initialAlwaysOnTop check is to prevent making a component be alwaysOnTop when the\r\n\t\t// client may have set it to alwaysOnTop:false in the config. If that's the case, it should\r\n\t\t// never set its alwaysOnTop to true and should always remain unchanged\r\n\t\tif (this.state.initialAlwaysOnTop && FSBL.System.container === \"Electron\") {\r\n\t\t\tFSBL.Clients.WindowClient.setAlwaysOnTop(alwaysOnTop, () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\talwaysOnTop: alwaysOnTop,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tonDragEnd({ oldIndex, newIndex }) {\r\n\t\tlet workspaces = JSON.parse(JSON.stringify(this.state.workspaceList));\r\n\t\tlet workspaceToMove = JSON.parse(JSON.stringify(workspaces[oldIndex]));\r\n\t\tworkspaces.splice(oldIndex, 1);\r\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\r\n\t\tthis.setState({\r\n\t\t\tworkspaceList: workspaces,\r\n\t\t});\r\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\r\n\t\t\tactionType: \"reorderWorkspace\",\r\n\t\t\tdata: { oldIndex, newIndex },\r\n\t\t});\r\n\t}\r\n\r\n\t// returns all the component types of a template definition to display to user for additional info. If multiple components with same type, then instead of listing each\r\n\t// individually, only one entry will be returned with the count in parentheses.\r\n\tgetComponentTypes(templateObject) {\r\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes templateObject\", templateObject);\r\n\t\tvar componentType;\r\n\t\tvar componentMap = {};\r\n\t\tvar annotatedComponentList = [];\r\n\t\tfor (let i = 0; i < templateObject.windows.length; i++) {\r\n\t\t\tlet windowData = templateObject.windowData[i];\r\n\t\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes loop\", windowData);\r\n\t\t\tcomponentType = \"Unknown Component\";\r\n\t\t\tif (windowData) {\r\n\t\t\t\t// current assimilation doesn't fill in windowData, so in this case use \"Unknown Component\" for component type\r\n\t\t\t\tcomponentType = windowData.componentType || windowData.customData.component.type;\r\n\t\t\t} else {\r\n\t\t\t\tcomponentType = \"Unknown Component\";\r\n\t\t\t}\r\n\t\t\tif (!componentMap[componentType]) {\r\n\t\t\t\tcomponentMap[componentType] = 1;\r\n\t\t\t} else {\r\n\t\t\t\tcomponentMap[componentType]++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar componentTypes = Object.keys(componentMap);\r\n\t\tfor (let i = 0; i < componentTypes.length; i++) {\r\n\t\t\tlet annotatedName = componentTypes[i];\r\n\t\t\tlet identicalCount = componentMap[componentTypes[i]];\r\n\t\t\tif (identicalCount > 1) {\r\n\t\t\t\tannotatedName = `${annotatedName} (${identicalCount})`;\r\n\t\t\t}\r\n\t\t\tannotatedComponentList.push(annotatedName);\r\n\t\t}\r\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes\", annotatedComponentList);\r\n\t\treturn annotatedComponentList;\r\n\t}\r\n\r\n\tsetFocusedWorkspace(workspace) {\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\tfocusedWorkspace: workspace,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tthis.getFocusedWorkspaceComponentList();\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\tcancelEdit() {\r\n\t\tif (this.state.adding) {\r\n\t\t\tlet { workspaceList } = this.state;\r\n\t\t\tworkspaceList.pop();\r\n\t\t\tthis.setFocusedWorkspace(\"\");\r\n\t\t\tthis.setState({\r\n\t\t\t\tworkspaceList: workspaceList,\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.setState({\r\n\t\t\tediting: false,\r\n\t\t\tadding: false,\r\n\t\t\tworkspaceBeingEdited: \"\",\r\n\t\t});\r\n\t}\r\n\r\n\trenameWorkspace(newName) {\r\n\t\tlet oldName = this.state.workspaceBeingEdited;\r\n\t\tif (oldName === \"\") {\r\n\t\t\treturn this.cancelEdit();\r\n\t\t}\r\n\r\n\t\tif (newName === oldName || newName.trim() === \"\") return this.cancelEdit();\r\n\t\tlet updatedWorkspaceList = this.state.workspaceList;\r\n\t\tlet index = updatedWorkspaceList.findIndex((el) => el.name === oldName);\r\n\t\t// Set state locally so that the text doesn't change when the input field unmounts.\r\n\t\tif (index !== -1) {\r\n\t\t\tupdatedWorkspaceList[index].name = newName;\r\n\t\t\tthis.setState({\r\n\t\t\t\tworkspaceList: updatedWorkspaceList,\r\n\t\t\t});\r\n\t\t}\r\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\r\n\t\t\tactionType: \"renameWorkspace\",\r\n\t\t\tdata: {\r\n\t\t\t\toldName: oldName,\r\n\t\t\t\tnewName: newName,\r\n\t\t\t},\r\n\t\t});\r\n\t\tif (this.state.workspaceToLoadOnStart === oldName) {\r\n\t\t\tthis.setState(\r\n\t\t\t\t{\r\n\t\t\t\t\tfocusedWorkspace: newName,\r\n\t\t\t\t},\r\n\t\t\t\t() => {\r\n\t\t\t\t\tthis.setWorkspaceToLoadOnStart(() => {\r\n\t\t\t\t\t\tthis.cancelEdit();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\tstartEditingWorkspace(e, workspaceName = this.state.focusedWorkspace) {\r\n\t\t// without preventing this event from reaching the finsemble draggable,\r\n\t\t// the editor will lose focus and you won't be able to rename your workspaces\r\n\t\te.stopPropagation();\r\n\t\tthis.setState({\r\n\t\t\tediting: true,\r\n\t\t\tfocusedWorkspace: workspaceName,\r\n\t\t\tworkspaceBeingEdited: workspaceName,\r\n\t\t});\r\n\t}\r\n\r\n\tstartExportingTemplate() {\r\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\r\n\t\t\tactionType: \"exportWorkspace\",\r\n\t\t\tdata: {\r\n\t\t\t\tname: this.state.focusedWorkspace,\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tstartImportingTemplate() {\r\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\r\n\t\t\tactionType: \"importTemplate\",\r\n\t\t\tdata: {\r\n\t\t\t\tname: this.state.templateName,\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tdeleteWorkspace(workspaceName = this.state.focusedWorkspace) {\r\n\t\tlet workspaceToRemove = workspaceName;\r\n\t\tthis.resetState();\r\n\r\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\r\n\t\t\tactionType: \"removeWorkspace\",\r\n\t\t\tdata: {\r\n\t\t\t\tname: workspaceToRemove,\r\n\t\t\t\thideModalOnClose: false,\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tsetPreferences(err, data) {\r\n\t\tif (!data && !data.value) return;\r\n\t\tconsole.log(\"Set preferences\", data.value);\r\n\t\tthis.setState({\r\n\t\t\tworkspaceToLoadOnStart: data.value[\"finsemble.initialWorkspace\"],\r\n\t\t\tfocusedWorkspace: data.value[\"finsemble.initialWorkspace\"],\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tUserPreferencesStore.addListener({ field: \"preferences\" }, this.setPreferences);\r\n\t\tFSBL.Clients.ConfigClient.getPreferences((err, data) => {\r\n\t\t\tthis.setPreferences(err, { value: data });\r\n\t\t});\r\n\t\tUserPreferencesStore.getValue({ field: \"WorkspaceList\" }, (err, data) => {\r\n\t\t\tif (data && data.length) {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tworkspaceList: data,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tUserPreferencesStore.removeListener({ field: \"preferences\" }, this.setPreferences);\r\n\t}\r\n\r\n\tsetWorkspaceToLoadOnStart(cb = Function.prototype) {\r\n\t\tlet self = this;\r\n\t\tif (!this.state.focusedWorkspace) return;\r\n\t\tfunction setPreference() {\r\n\t\t\tFSBL.Clients.ConfigClient.setPreference(\r\n\t\t\t\t{\r\n\t\t\t\t\tfield: \"finsemble.initialWorkspace\",\r\n\t\t\t\t\tvalue: self.state.workspaceToLoadOnStart,\r\n\t\t\t\t},\r\n\t\t\t\t(err, data) => {\r\n\t\t\t\t\tif (err) {\r\n\t\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (typeof cb === \"function\") {\r\n\t\t\t\t\t\tcb();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t\tif (this.state.focusedWorkspace === this.state.workspaceToLoadOnStart) {\r\n\t\t\tthis.setState({ workspaceToLoadOnStart: null }, setPreference);\r\n\t\t} else {\r\n\t\t\tself.setState(\r\n\t\t\t\t{\r\n\t\t\t\t\tworkspaceToLoadOnStart: self.state.focusedWorkspace,\r\n\t\t\t\t},\r\n\t\t\t\tsetPreference\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\topenFileDialog() {\r\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\r\n\t\t// then reset always on top\r\n\t\tthis.changePreferencesAlwaysOnTop(false);\r\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\r\n\t\tlet inputElement = document.getElementById(\"file-input\");\r\n\t\tinputElement.addEventListener(\"change\", this.importWorkspace, false);\r\n\t\tinputElement.click();\r\n\t}\r\n\r\n\t/**\r\n\t * If the event is being listened to, when the preferences component is focused\r\n\t * it will set always on top to true, and remove the event listener\r\n\t *\r\n\t * This is to handle bringing alwaysOnTop back to true when file dialogs are closed\r\n\t * without changes (also handles bringing back to front after exporting)\r\n\t */\r\n\tpreferencesFocused() {\r\n\t\tfinsembleWindow.removeEventListener(\"focused\", this.preferencesFocused);\r\n\t\tthis.changePreferencesAlwaysOnTop(true);\r\n\t}\r\n\r\n\timportWorkspace(evt) {\r\n\t\tlet inputElement = document.getElementById(\"file-input\");\r\n\t\tinputElement.removeEventListener(\"change\", this.importWorkspace);\r\n\t\tvar { files } = evt.target; // FileList object\r\n\r\n\t\tfunction loadFile(file, done) {\r\n\t\t\tlet reader = new FileReader();\r\n\t\t\tlet fileName = evt.target.value;\r\n\t\t\t// When the file info is loaded, we get into here..\r\n\t\t\treader.onload = function (e) {\r\n\t\t\t\tfileName = fileName.split(\"\\\\\");\r\n\t\t\t\tfileName = fileName[fileName.length - 1].replace(\".json\", \"\");\r\n\t\t\t\tlet workspaceTemplateDefinition = JSON.parse(e.target.result);\r\n\t\t\t\tlet templateName = Object.keys(workspaceTemplateDefinition.workspaceTemplates)[0];\r\n\t\t\t\tif (fileName !== templateName) {\r\n\t\t\t\t\t// We want the file name to overwrite the name of the workspace that was saved as the template..\r\n\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName] =\r\n\t\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[templateName];\r\n\t\t\t\t\tdelete workspaceTemplateDefinition.workspaceTemplates[templateName];\r\n\t\t\t\t}\r\n\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName].name = fileName;\r\n\t\t\t\tFSBL.Clients.WorkspaceClient.addWorkspaceDefinition(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tworkspaceJSONDefinition: workspaceTemplateDefinition.workspaceTemplates,\r\n\t\t\t\t\t\tforce: false,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\tif (err) {\r\n\t\t\t\t\t\t\tFSBL.Clients.Logger.info(\"addWorkspaceTemplateDefinition error\", err);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdone();\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t};\r\n\r\n\t\t\t// Read in the image file as a data URL.\r\n\t\t\treader.readAsText(file);\r\n\t\t}\r\n\r\n\t\tasync.each(files, loadFile, () => {\r\n\t\t\t// Clear out files. so if the user imports the same file back-to-back, the event will fire.\r\n\t\t\tinputElement.value = \"\";\r\n\t\t\tFSBL.Clients.Logger.info(\"Workspaces imported\");\r\n\t\t});\r\n\t}\r\n\r\n\texportWorkspace() {\r\n\t\tif (this.state.focusedWorkspace === \"\") return;\r\n\t\tvar self = this;\r\n\t\tfunction doExport() {\r\n\t\t\tFSBL.Clients.WorkspaceClient.getWorkspaceDefinition(\r\n\t\t\t\t{ workspaceName: self.state.focusedWorkspace },\r\n\t\t\t\t(err, workspaceDefinition) => {\r\n\t\t\t\t\tif (err) {\r\n\t\t\t\t\t\tFSBL.Clients.Logger.error(\"getWorkspaceDefinition error\", err);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// We're saving using a routine initially created for templates. The outcome is the same and it probably should have just been \"Save to file\". This bool is to allow it to save.\r\n\t\t\t\t\t\tFSBL.ConfigUtils.promptAndSaveJSONToLocalFile(self.state.focusedWorkspace, {\r\n\t\t\t\t\t\t\tworkspaceTemplates: workspaceDefinition,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\r\n\t\t// then reset always on top\r\n\t\tself.changePreferencesAlwaysOnTop(false);\r\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\r\n\t\t// If we're autosaving, autosave, then export.\r\n\t\t// @todo, put into store. consider moving autosave into workspaceClient.\r\n\t\tFSBL.Clients.ConfigClient.getValue(\r\n\t\t\t{\r\n\t\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\r\n\t\t\t},\r\n\t\t\t(err, data) => {\r\n\t\t\t\t// default to false.\r\n\t\t\t\tlet PROMPT_ON_SAVE = data === null ? false : data;\r\n\t\t\t\tif (!PROMPT_ON_SAVE) {\r\n\t\t\t\t\tlet activeName = FSBL.Clients.WorkspaceClient.activeWorkspace.name;\r\n\t\t\t\t\treturn FSBL.Clients.WorkspaceClient.saveAs(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: activeName,\r\n\t\t\t\t\t\t\tforce: true,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err, response) => {\r\n\t\t\t\t\t\t\tdoExport();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tdoExport();\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\thandleButtonClicks(e) {\r\n\t\tif (this.state.adding || this.state.editing) {\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\tgetFocusedWorkspaceComponentList() {\r\n\t\tlet { workspaceList, focusedWorkspace } = this.state;\r\n\t\tif (focusedWorkspace === \"\") return [];\r\n\t\tlet workspace = workspaceList.filter((wSpace) => wSpace.name === focusedWorkspace)[0];\r\n\r\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaceDefinition(\r\n\t\t\t{ workspaceName: focusedWorkspace },\r\n\t\t\t(err, workspaceDefinition) => {\r\n\t\t\t\tlet componentTypes = this.getComponentTypes(workspaceDefinition[focusedWorkspace]);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tfocusedWorkspaceComponentList: componentTypes,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\trender() {\r\n\t\tlet deleteButtonClasses = \"individual-workspace-action delete-workspace\",\r\n\t\t\texportButtonClasses = \"action-button workspace-action-button\",\r\n\t\t\trenameButtonClasses = \"individual-workspace-action\",\r\n\t\t\taddButtonClasses = \"positive-action-button action-button workspace-action-button\",\r\n\t\t\timportButtonClasses = \"action-button workspace-action-button\",\r\n\t\t\tallowAdd = true,\r\n\t\t\tallowDelete = true,\r\n\t\t\tallowExport = true,\r\n\t\t\tallowRename = true,\r\n\t\t\tallowImport = true,\r\n\t\t\tdeleteTooltip = \"Delete\";\r\n\r\n\t\tif (this.state.focusedWorkspace === FSBL.Clients.WorkspaceClient.activeWorkspace.name) {\r\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\r\n\t\t}\r\n\r\n\t\tif (this.state.focusedWorkspace === \"\") {\r\n\t\t\texportButtonClasses = `${exportButtonClasses} disabled-button`;\r\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-individual-workspace-action`;\r\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\r\n\t\t\tdeleteTooltip = \"No workspace selected\";\r\n\t\t\tallowRename = false;\r\n\t\t\tallowExport = false;\r\n\t\t\tallowDelete = false;\r\n\t\t}\r\n\r\n\t\tif (this.state.adding || this.state.editing) {\r\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-button`;\r\n\t\t\taddButtonClasses = `${addButtonClasses} disabled-button`;\r\n\t\t\texportButtonClasses = `${exportButtonClasses} disabled-button`;\r\n\t\t\timportButtonClasses = `${importButtonClasses} disabled-button`;\r\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-button`;\r\n\t\t\tallowAdd = false;\r\n\t\t\tallowDelete = false;\r\n\t\t\tallowExport = false;\r\n\t\t\tallowRename = false;\r\n\t\t\tallowImport = false;\r\n\t\t}\r\n\r\n\t\tlet addTooltip = \"Add a workspace\",\r\n\t\t\timportTooltip = \"Import workspace from file\",\r\n\t\t\texportTooltip = allowExport ? \"Export selected workspace\" : \"No workspace selected\",\r\n\t\t\trenameTooltip = allowRename ? \"Rename\" : \"Cannot Edit\";\r\n\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t<input style={{ display: \"none\" }} type=\"file\" id=\"file-input\" />\r\n\t\t\t\t<div className=\"complex-menu-content-row\">\r\n\t\t\t\t\t<div className=\"workspace-list-header-row\">\r\n\t\t\t\t\t\t<div className=\"content-section-header workspace-list-header\"></div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className=\"content-section-wrapper\">\r\n\t\t\t\t\t\t<div ref=\"WorkspaceList\" className=\"workspace-list\">\r\n\t\t\t\t\t\t\t<FinsembleDnDContext onDragEnd={this.onDragEnd}>\r\n\t\t\t\t\t\t\t\t{this.state.workspaceList.map((workspace, i) => {\r\n\t\t\t\t\t\t\t\t\tlet baseClass = \"workspace-item\";\r\n\t\t\t\t\t\t\t\t\tlet classNames = baseClass;\r\n\t\t\t\t\t\t\t\t\tif (FSBL.Clients.WorkspaceClient.activeWorkspace.name === workspace.name) {\r\n\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} active-workspace`;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif (this.state.workspaceToLoadOnStart === workspace.name) {\r\n\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} auto-start-workspace-item`;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif (this.state.focusedWorkspace === workspace.name) {\r\n\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} focused-workspace-item`;\r\n\t\t\t\t\t\t\t\t\t\tif (i === 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} no-top-border`;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (this.state.editing || this.state.adding) {\r\n\t\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} workspace-item-editing`;\r\n\t\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div key={i} className={classNames}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<WorkspaceEditor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={workspace.name}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsaveHandler={this.state.editing ? this.renameWorkspace : this.addWorkspace}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcancelHandler={this.cancelEdit}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t<FinsembleDraggable\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.setFocusedWorkspace(workspace.name)}\r\n\t\t\t\t\t\t\t\t\t\t\twrapperClass={classNames}\r\n\t\t\t\t\t\t\t\t\t\t\tdraggableId={workspace.name}\r\n\t\t\t\t\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\t\t\t\t\tindex={i}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"ff-adp-hamburger\"></div>\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"workspace-name\" title={workspace.name}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{workspace.name}\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"individual-workspace-actions\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t{workspace.name !== FSBL.Clients.WorkspaceClient.activeWorkspace.name && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={renameTooltip}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={renameButtonClasses}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tallowRename\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? (e) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.startEditingWorkspace(e, workspace.name);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: Function.prototype\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i className=\"ff-adp-edit\"></i>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{workspace.name !== FSBL.Clients.WorkspaceClient.activeWorkspace.name && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={deleteTooltip}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={deleteButtonClasses}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tallowDelete\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? () => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.deleteWorkspace(workspace.name);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: Function.prototype\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i className=\"ff-adp-trash-outline\"></i>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</FinsembleDraggable>\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t</FinsembleDnDContext>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div className=\"workspace-extras\">\r\n\t\t\t\t\t\t\t<div className=\"workspace-component-list\">\r\n\t\t\t\t\t\t\t\t{this.state.focusedWorkspaceComponentList.length > 0 &&\r\n\t\t\t\t\t\t\t\t\tthis.state.focusedWorkspaceComponentList.map((cmp, i) => (\r\n\t\t\t\t\t\t\t\t\t\t<div key={i} className=\"workspace-component\">\r\n\t\t\t\t\t\t\t\t\t\t\t{cmp}\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t{this.state.focusedWorkspaceComponentList.length === 0 && \"No components.\"}\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className=\"workspace-action-buttons\">\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\ttitle={importTooltip}\r\n\t\t\t\t\t\t\t\t\tclassName={importButtonClasses}\r\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\r\n\t\t\t\t\t\t\t\t\tonClick={allowImport ? this.openFileDialog : Function.prototype}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<i className=\"workspace-action-button-icon ff-import\"></i>\r\n\t\t\t\t\t\t\t\t\t<div>Import</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\ttitle={exportTooltip}\r\n\t\t\t\t\t\t\t\t\tclassName={exportButtonClasses}\r\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\r\n\t\t\t\t\t\t\t\t\tonClick={allowExport ? this.exportWorkspace : Function.prototype}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<i className=\"workspace-action-button-icon ff-export\"></i>\r\n\t\t\t\t\t\t\t\t\t<div>Export</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<Checkbox\r\n\t\t\t\t\t\tdisabled={!this.state.focusedWorkspace}\r\n\t\t\t\t\t\tonClick={this.setWorkspaceToLoadOnStart}\r\n\t\t\t\t\t\tchecked={this.state.focusedWorkspace === this.state.workspaceToLoadOnStart}\r\n\t\t\t\t\t\tlabel=\"Load this workspace on startup.\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Workspaces.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/content/Workspaces.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACvG,OAAO,E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,CAAC,KAAK,CAAC,6BAA6B,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CACrE;wBACN,6BAAK,SAAS,EAAC,0BAA0B;4BACxC,6BACC,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,mBAAmB,EAC9B,WAAW,EAAE,IAAI,CAAC,kBAAkB,EACpC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS;gCAE/D,2BAAG,SAAS,EAAC,wCAAwC,GAAK;gCAC1D,0CAAiB,CACZ;4BACN,6BACC,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,mBAAmB,EAC9B,WAAW,EAAE,IAAI,CAAC,kBAAkB,EACpC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS;gCAEhE,2BAAG,SAAS,EAAC,wCAAwC,GAAK;gCAC1D,0CAAiB,CACZ,CACD,CACD,CACD;gBACN,oBAAC,QAAQ,IACR,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACtC,OAAO,EAAE,IAAI,CAAC,yBAAyB,EACvC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAC1E,KAAK,EAAC,iCAAiC,GACtC,CACG,CACD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport { WorkspaceManagementMenuStore, UserPreferencesStore } from \"../../stores/UserPreferencesStore\";\nimport { FinsembleDnDContext } from \"../../../legacyControls/FinsembleDnDContext\";\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\nimport Checkbox from \"../Checkbox\";\nimport async from \"async\";\n\nclass WorkspaceEditor extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tvalue: props.value || \"\",\n\t\t\tfinished: false,\n\t\t};\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.onChange = this.onChange.bind(this);\n\t\tthis.onBlur = this.onBlur.bind(this);\n\t\tthis.onFocus = this.onFocus.bind(this);\n\t}\n\n\tonKeyDown(e) {\n\t\tif (e.key === \"Escape\") {\n\t\t\tthis.setState({ finished: true }, () => {\n\t\t\t\tthis.props.cancelHandler();\n\t\t\t});\n\t\t} else if (e.key === \"Enter\") {\n\t\t\tfunction finish(val) {\n\t\t\t\tthis.props.saveHandler(val);\n\t\t\t}\n\t\t\t// binding so we don't lose the event inside of react's crazy callback structure\n\t\t\tthis.setState({ finished: true }, finish.bind(this, e.target.value));\n\t\t}\n\t}\n\n\tonChange(e) {\n\t\tthis.setState({\n\t\t\tvalue: e.target.value,\n\t\t});\n\t}\n\n\tonFocus(e) {\n\t\te.target.select();\n\t}\n\n\tonBlur() {\n\t\t// console.log(\"ON BLUR\", performance.now());\n\t\tfunction finish(val) {\n\t\t\tthis.props.saveHandler(val);\n\t\t}\n\t\t// binding so we don't lose the event inside of react's crazy callback structure. Finished is set so that the component doesn't call the saveHandler again on unMount\n\t\tthis.setState({ finished: true }, finish.bind(this, this.state.value));\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<input\n\t\t\t\tonFocus={this.onFocus}\n\t\t\t\tonBlur={this.onBlur}\n\t\t\t\tautoFocus={true}\n\t\t\t\tvalue={this.state.value}\n\t\t\t\tclassName=\"workspace-editor\"\n\t\t\t\tonChange={this.onChange}\n\t\t\t\tonKeyDown={this.onKeyDown}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default class Workspaces extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tadding: false,\n\t\t\tediting: false,\n\t\t\tworkspaceList: [],\n\t\t\tfocusedWorkspace: \"\",\n\t\t\t// todo, get the workspaceToLoadOnStart from preferences.\n\t\t\tworkspaceToLoadOnStart: null,\n\t\t\ttemplateName: \"\",\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t\tfocusedWorkspaceComponentList: [],\n\t\t\tinitialAlwaysOnTop: finsembleWindow.windowOptions.alwaysOnTop,\n\t\t\talwaysOnTop: finsembleWindow.windowOptions.alwaysOnTop,\n\t\t};\n\t\tthis.bindCorrectContext();\n\t\tthis.addListeners();\n\t}\n\n\tresetState() {\n\t\tthis.setState({\n\t\t\tadding: false,\n\t\t\tediting: false,\n\t\t\tfocusedWorkspace: \"\",\n\t\t\ttemplateName: \"\",\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t});\n\t}\n\n\tbindCorrectContext() {\n\t\tlet methods = [\n\t\t\t\"deleteWorkspace\",\n\t\t\t\"addListeners\",\n\t\t\t\"setWorkspaceList\",\n\t\t\t\"onDragEnd\",\n\t\t\t\"startEditingWorkspace\",\n\t\t\t\"renameWorkspace\",\n\t\t\t\"cancelEdit\",\n\t\t\t\"setWorkspaceToLoadOnStart\",\n\t\t\t\"setPreferences\",\n\t\t\t\"exportWorkspace\",\n\t\t\t\"handleButtonClicks\",\n\t\t\t\"getFocusedWorkspaceComponentList\",\n\t\t\t\"changePreferencesAlwaysOnTop\",\n\t\t\t\"openFileDialog\",\n\t\t\t\"preferencesFocused\",\n\t\t];\n\t\tmethods.forEach((method) => {\n\t\t\tthis[method] = this[method].bind(this);\n\t\t});\n\t\twindow.importWorkspace = this.importWorkspace.bind(this);\n\t}\n\n\tsetWorkspaceList(err, data) {\n\t\tconsole.log(\"Set workspacelist\", data);\n\t\tif (!data) return;\n\t\tthis.setState({\n\t\t\tworkspaceList: data.value,\n\t\t});\n\t}\n\n\taddListeners() {\n\t\tUserPreferencesStore.addListener({ field: \"WorkspaceList\" }, this.setWorkspaceList);\n\t}\n\n\t/**\n\t * Sets the windowOptions.alwaysOnTop to the value supplied. The preferences component should\n\t * not be always on top when a file dialog is open.\n\t * @param {boolean} alwaysOnTop The value to set finsembleWindow.options.alwaysOnTop\n\t */\n\tchangePreferencesAlwaysOnTop(alwaysOnTop) {\n\t\t// The initialAlwaysOnTop check is to prevent making a component be alwaysOnTop when the\n\t\t// client may have set it to alwaysOnTop:false in the config. If that's the case, it should\n\t\t// never set its alwaysOnTop to true and should always remain unchanged\n\t\tif (this.state.initialAlwaysOnTop && FSBL.System.container === \"Electron\") {\n\t\t\tFSBL.Clients.WindowClient.setAlwaysOnTop(alwaysOnTop, () => {\n\t\t\t\tthis.setState({\n\t\t\t\t\talwaysOnTop: alwaysOnTop,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\tonDragEnd({ oldIndex, newIndex }) {\n\t\tlet workspaces = JSON.parse(JSON.stringify(this.state.workspaceList));\n\t\tlet workspaceToMove = JSON.parse(JSON.stringify(workspaces[oldIndex]));\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tthis.setState({\n\t\t\tworkspaceList: workspaces,\n\t\t});\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\n\t\t\tactionType: \"reorderWorkspace\",\n\t\t\tdata: { oldIndex, newIndex },\n\t\t});\n\t}\n\n\t// returns all the component types of a template definition to display to user for additional info. If multiple components with same type, then instead of listing each\n\t// individually, only one entry will be returned with the count in parentheses.\n\tgetComponentTypes(templateObject) {\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes templateObject\", templateObject);\n\t\tvar componentType;\n\t\tvar componentMap = {};\n\t\tvar annotatedComponentList = [];\n\t\tfor (let i = 0; i < templateObject.windows.length; i++) {\n\t\t\tlet windowData = templateObject.windowData[i];\n\t\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes loop\", windowData);\n\t\t\tcomponentType = \"Unknown Component\";\n\t\t\tif (windowData) {\n\t\t\t\t// current assimilation doesn't fill in windowData, so in this case use \"Unknown Component\" for component type\n\t\t\t\tcomponentType = windowData.componentType || windowData.customData.component.type;\n\t\t\t} else {\n\t\t\t\tcomponentType = \"Unknown Component\";\n\t\t\t}\n\t\t\tif (!componentMap[componentType]) {\n\t\t\t\tcomponentMap[componentType] = 1;\n\t\t\t} else {\n\t\t\t\tcomponentMap[componentType]++;\n\t\t\t}\n\t\t}\n\n\t\tvar componentTypes = Object.keys(componentMap);\n\t\tfor (let i = 0; i < componentTypes.length; i++) {\n\t\t\tlet annotatedName = componentTypes[i];\n\t\t\tlet identicalCount = componentMap[componentTypes[i]];\n\t\t\tif (identicalCount > 1) {\n\t\t\t\tannotatedName = `${annotatedName} (${identicalCount})`;\n\t\t\t}\n\t\t\tannotatedComponentList.push(annotatedName);\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes\", annotatedComponentList);\n\t\treturn annotatedComponentList;\n\t}\n\n\tsetFocusedWorkspace(workspace) {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tfocusedWorkspace: workspace,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.getFocusedWorkspaceComponentList();\n\t\t\t}\n\t\t);\n\t}\n\n\tcancelEdit() {\n\t\tif (this.state.adding) {\n\t\t\tlet { workspaceList } = this.state;\n\t\t\tworkspaceList.pop();\n\t\t\tthis.setFocusedWorkspace(\"\");\n\t\t\tthis.setState({\n\t\t\t\tworkspaceList: workspaceList,\n\t\t\t});\n\t\t}\n\t\tthis.setState({\n\t\t\tediting: false,\n\t\t\tadding: false,\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t});\n\t}\n\n\trenameWorkspace(newName) {\n\t\tlet oldName = this.state.workspaceBeingEdited;\n\t\tif (oldName === \"\") {\n\t\t\treturn this.cancelEdit();\n\t\t}\n\n\t\tif (newName === oldName || newName.trim() === \"\") return this.cancelEdit();\n\t\tlet updatedWorkspaceList = this.state.workspaceList;\n\t\tlet index = updatedWorkspaceList.findIndex((el) => el.name === oldName);\n\t\t// Set state locally so that the text doesn't change when the input field unmounts.\n\t\tif (index !== -1) {\n\t\t\tupdatedWorkspaceList[index].name = newName;\n\t\t\tthis.setState({\n\t\t\t\tworkspaceList: updatedWorkspaceList,\n\t\t\t});\n\t\t}\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\n\t\t\tactionType: \"renameWorkspace\",\n\t\t\tdata: {\n\t\t\t\toldName: oldName,\n\t\t\t\tnewName: newName,\n\t\t\t},\n\t\t});\n\t\tif (this.state.workspaceToLoadOnStart === oldName) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tfocusedWorkspace: newName,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tthis.setWorkspaceToLoadOnStart(() => {\n\t\t\t\t\t\tthis.cancelEdit();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tthis.cancelEdit();\n\t\t}\n\t}\n\n\tstartEditingWorkspace(e, workspaceName = this.state.focusedWorkspace) {\n\t\t// without preventing this event from reaching the finsemble draggable,\n\t\t// the editor will lose focus and you won't be able to rename your workspaces\n\t\te.stopPropagation();\n\t\tthis.setState({\n\t\t\tediting: true,\n\t\t\tfocusedWorkspace: workspaceName,\n\t\t\tworkspaceBeingEdited: workspaceName,\n\t\t});\n\t}\n\n\tstartExportingTemplate() {\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\n\t\t\tactionType: \"exportWorkspace\",\n\t\t\tdata: {\n\t\t\t\tname: this.state.focusedWorkspace,\n\t\t\t},\n\t\t});\n\t}\n\n\tstartImportingTemplate() {\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\n\t\t\tactionType: \"importTemplate\",\n\t\t\tdata: {\n\t\t\t\tname: this.state.templateName,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeleteWorkspace(workspaceName = this.state.focusedWorkspace) {\n\t\tlet workspaceToRemove = workspaceName;\n\t\tthis.resetState();\n\n\t\tWorkspaceManagementMenuStore.Dispatcher.dispatch({\n\t\t\tactionType: \"removeWorkspace\",\n\t\t\tdata: {\n\t\t\t\tname: workspaceToRemove,\n\t\t\t\thideModalOnClose: false,\n\t\t\t},\n\t\t});\n\t}\n\n\tsetPreferences(err, data) {\n\t\tif (!data && !data.value) return;\n\t\tconsole.log(\"Set preferences\", data.value);\n\t\tthis.setState({\n\t\t\tworkspaceToLoadOnStart: data.value[\"finsemble.initialWorkspace\"],\n\t\t\tfocusedWorkspace: data.value[\"finsemble.initialWorkspace\"],\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\tUserPreferencesStore.addListener({ field: \"preferences\" }, this.setPreferences);\n\t\tFSBL.Clients.ConfigClient.getPreferences((err, data) => {\n\t\t\tthis.setPreferences(err, { value: data });\n\t\t});\n\t\tUserPreferencesStore.getValue({ field: \"WorkspaceList\" }, (err, data) => {\n\t\t\tif (data && data.length) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tworkspaceList: data,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tcomponentWillUnmount() {\n\t\tUserPreferencesStore.removeListener({ field: \"preferences\" }, this.setPreferences);\n\t}\n\n\tsetWorkspaceToLoadOnStart(cb = Function.prototype) {\n\t\tlet self = this;\n\t\tif (!this.state.focusedWorkspace) return;\n\t\tfunction setPreference() {\n\t\t\tFSBL.Clients.ConfigClient.setPreference(\n\t\t\t\t{\n\t\t\t\t\tfield: \"finsemble.initialWorkspace\",\n\t\t\t\t\tvalue: self.state.workspaceToLoadOnStart,\n\t\t\t\t},\n\t\t\t\t(err, data) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof cb === \"function\") {\n\t\t\t\t\t\tcb();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\tif (this.state.focusedWorkspace === this.state.workspaceToLoadOnStart) {\n\t\t\tthis.setState({ workspaceToLoadOnStart: null }, setPreference);\n\t\t} else {\n\t\t\tself.setState(\n\t\t\t\t{\n\t\t\t\t\tworkspaceToLoadOnStart: self.state.focusedWorkspace,\n\t\t\t\t},\n\t\t\t\tsetPreference\n\t\t\t);\n\t\t}\n\t}\n\n\topenFileDialog() {\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\n\t\t// then reset always on top\n\t\tthis.changePreferencesAlwaysOnTop(false);\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\n\t\tlet inputElement = document.getElementById(\"file-input\");\n\t\tinputElement.addEventListener(\"change\", this.importWorkspace, false);\n\t\tinputElement.click();\n\t}\n\n\t/**\n\t * If the event is being listened to, when the preferences component is focused\n\t * it will set always on top to true, and remove the event listener\n\t *\n\t * This is to handle bringing alwaysOnTop back to true when file dialogs are closed\n\t * without changes (also handles bringing back to front after exporting)\n\t */\n\tpreferencesFocused() {\n\t\tfinsembleWindow.removeEventListener(\"focused\", this.preferencesFocused);\n\t\tthis.changePreferencesAlwaysOnTop(true);\n\t}\n\n\timportWorkspace(evt) {\n\t\tlet inputElement = document.getElementById(\"file-input\");\n\t\tinputElement.removeEventListener(\"change\", this.importWorkspace);\n\t\tvar { files } = evt.target; // FileList object\n\n\t\tfunction loadFile(file, done) {\n\t\t\tlet reader = new FileReader();\n\t\t\tlet fileName = evt.target.value;\n\t\t\t// When the file info is loaded, we get into here..\n\t\t\treader.onload = function (e) {\n\t\t\t\tfileName = fileName.split(\"\\\\\");\n\t\t\t\tfileName = fileName[fileName.length - 1].replace(\".json\", \"\");\n\t\t\t\tlet workspaceTemplateDefinition = JSON.parse(e.target.result);\n\t\t\t\tlet templateName = Object.keys(workspaceTemplateDefinition.workspaceTemplates)[0];\n\t\t\t\tif (fileName !== templateName) {\n\t\t\t\t\t// We want the file name to overwrite the name of the workspace that was saved as the template..\n\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName] =\n\t\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[templateName];\n\t\t\t\t\tdelete workspaceTemplateDefinition.workspaceTemplates[templateName];\n\t\t\t\t}\n\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName].name = fileName;\n\t\t\t\tFSBL.Clients.WorkspaceClient.addWorkspaceDefinition(\n\t\t\t\t\t{\n\t\t\t\t\t\tworkspaceJSONDefinition: workspaceTemplateDefinition.workspaceTemplates,\n\t\t\t\t\t\tforce: false,\n\t\t\t\t\t},\n\t\t\t\t\t(err) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tFSBL.Clients.Logger.info(\"addWorkspaceTemplateDefinition error\", err);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Read in the image file as a data URL.\n\t\t\treader.readAsText(file);\n\t\t}\n\n\t\tasync.each(files, loadFile, () => {\n\t\t\t// Clear out files. so if the user imports the same file back-to-back, the event will fire.\n\t\t\tinputElement.value = \"\";\n\t\t\tFSBL.Clients.Logger.info(\"Workspaces imported\");\n\t\t});\n\t}\n\n\texportWorkspace() {\n\t\tif (this.state.focusedWorkspace === \"\") return;\n\t\tvar self = this;\n\t\tfunction doExport() {\n\t\t\tFSBL.Clients.WorkspaceClient.getWorkspaceDefinition(\n\t\t\t\t{ workspaceName: self.state.focusedWorkspace },\n\t\t\t\t(err, workspaceDefinition) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tFSBL.Clients.Logger.error(\"getWorkspaceDefinition error\", err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We're saving using a routine initially created for templates. The outcome is the same and it probably should have just been \"Save to file\". This bool is to allow it to save.\n\t\t\t\t\t\tFSBL.ConfigUtils.promptAndSaveJSONToLocalFile(self.state.focusedWorkspace, {\n\t\t\t\t\t\t\tworkspaceTemplates: workspaceDefinition,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\n\t\t// then reset always on top\n\t\tself.changePreferencesAlwaysOnTop(false);\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\n\t\t// If we're autosaving, autosave, then export.\n\t\t// @todo, put into store. consider moving autosave into workspaceClient.\n\t\tFSBL.Clients.ConfigClient.getValue(\n\t\t\t{\n\t\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\n\t\t\t},\n\t\t\t(err, data) => {\n\t\t\t\t// default to false.\n\t\t\t\tlet PROMPT_ON_SAVE = data === null ? false : data;\n\t\t\t\tif (!PROMPT_ON_SAVE) {\n\t\t\t\t\tlet activeName = FSBL.Clients.WorkspaceClient.activeWorkspace.name;\n\t\t\t\t\treturn FSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: activeName,\n\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err, response) => {\n\t\t\t\t\t\t\tdoExport();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdoExport();\n\t\t\t}\n\t\t);\n\t}\n\n\thandleButtonClicks(e) {\n\t\tif (this.state.adding || this.state.editing) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\tgetFocusedWorkspaceComponentList() {\n\t\tlet { workspaceList, focusedWorkspace } = this.state;\n\t\tif (focusedWorkspace === \"\") return [];\n\t\tlet workspace = workspaceList.filter((wSpace) => wSpace.name === focusedWorkspace)[0];\n\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaceDefinition(\n\t\t\t{ workspaceName: focusedWorkspace },\n\t\t\t(err, workspaceDefinition) => {\n\t\t\t\tlet componentTypes = this.getComponentTypes(workspaceDefinition[focusedWorkspace]);\n\t\t\t\tthis.setState({\n\t\t\t\t\tfocusedWorkspaceComponentList: componentTypes,\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\n\trender() {\n\t\tlet deleteButtonClasses = \"individual-workspace-action delete-workspace\",\n\t\t\texportButtonClasses = \"action-button workspace-action-button\",\n\t\t\trenameButtonClasses = \"individual-workspace-action\",\n\t\t\taddButtonClasses = \"positive-action-button action-button workspace-action-button\",\n\t\t\timportButtonClasses = \"action-button workspace-action-button\",\n\t\t\tallowAdd = true,\n\t\t\tallowDelete = true,\n\t\t\tallowExport = true,\n\t\t\tallowRename = true,\n\t\t\tallowImport = true,\n\t\t\tdeleteTooltip = \"Delete\";\n\n\t\tif (this.state.focusedWorkspace === FSBL.Clients.WorkspaceClient.activeWorkspace.name) {\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\n\t\t}\n\n\t\tif (this.state.focusedWorkspace === \"\") {\n\t\t\texportButtonClasses = `${exportButtonClasses} disabled-button`;\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-individual-workspace-action`;\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\n\t\t\tdeleteTooltip = \"No workspace selected\";\n\t\t\tallowRename = false;\n\t\t\tallowExport = false;\n\t\t\tallowDelete = false;\n\t\t}\n\n\t\tif (this.state.adding || this.state.editing) {\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-button`;\n\t\t\taddButtonClasses = `${addButtonClasses} disabled-button`;\n\t\t\texportButtonClasses = `${exportButtonClasses} disabled-button`;\n\t\t\timportButtonClasses = `${importButtonClasses} disabled-button`;\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-button`;\n\t\t\tallowAdd = false;\n\t\t\tallowDelete = false;\n\t\t\tallowExport = false;\n\t\t\tallowRename = false;\n\t\t\tallowImport = false;\n\t\t}\n\n\t\tlet addTooltip = \"Add a workspace\",\n\t\t\timportTooltip = \"Import workspace from file\",\n\t\t\texportTooltip = allowExport ? \"Export selected workspace\" : \"No workspace selected\",\n\t\t\trenameTooltip = allowRename ? \"Rename\" : \"Cannot Edit\";\n\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<input style={{ display: \"none\" }} type=\"file\" id=\"file-input\" />\n\t\t\t\t<div className=\"complex-menu-content-row\">\n\t\t\t\t\t<div className=\"workspace-list-header-row\">\n\t\t\t\t\t\t<div className=\"content-section-header workspace-list-header\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"content-section-wrapper\">\n\t\t\t\t\t\t<div ref=\"WorkspaceList\" className=\"workspace-list\">\n\t\t\t\t\t\t\t<FinsembleDnDContext onDragEnd={this.onDragEnd}>\n\t\t\t\t\t\t\t\t{this.state.workspaceList.map((workspace, i) => {\n\t\t\t\t\t\t\t\t\tlet baseClass = \"workspace-item\";\n\t\t\t\t\t\t\t\t\tlet classNames = baseClass;\n\t\t\t\t\t\t\t\t\tif (FSBL.Clients.WorkspaceClient.activeWorkspace.name === workspace.name) {\n\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} active-workspace`;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (this.state.workspaceToLoadOnStart === workspace.name) {\n\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} auto-start-workspace-item`;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (this.state.focusedWorkspace === workspace.name) {\n\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} focused-workspace-item`;\n\t\t\t\t\t\t\t\t\t\tif (i === 0) {\n\t\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} no-top-border`;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (this.state.editing || this.state.adding) {\n\t\t\t\t\t\t\t\t\t\t\tclassNames = `${classNames} workspace-item-editing`;\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<div key={i} className={classNames}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<WorkspaceEditor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={workspace.name}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsaveHandler={this.state.editing ? this.renameWorkspace : this.addWorkspace}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcancelHandler={this.cancelEdit}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<FinsembleDraggable\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.setFocusedWorkspace(workspace.name)}\n\t\t\t\t\t\t\t\t\t\t\twrapperClass={classNames}\n\t\t\t\t\t\t\t\t\t\t\tdraggableId={workspace.name}\n\t\t\t\t\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"ff-adp-hamburger\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"workspace-name\" title={workspace.name}>\n\t\t\t\t\t\t\t\t\t\t\t\t{workspace.name}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"individual-workspace-actions\">\n\t\t\t\t\t\t\t\t\t\t\t\t{workspace.name !== FSBL.Clients.WorkspaceClient.activeWorkspace.name && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={renameTooltip}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={renameButtonClasses}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tallowRename\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? (e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.startEditingWorkspace(e, workspace.name);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: Function.prototype\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i className=\"ff-adp-edit\"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t{workspace.name !== FSBL.Clients.WorkspaceClient.activeWorkspace.name && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={deleteTooltip}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={deleteButtonClasses}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tallowDelete\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.deleteWorkspace(workspace.name);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: Function.prototype\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i className=\"ff-adp-trash-outline\"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</FinsembleDraggable>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</FinsembleDnDContext>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"workspace-extras\">\n\t\t\t\t\t\t\t<div className=\"workspace-component-list\">\n\t\t\t\t\t\t\t\t{this.state.focusedWorkspaceComponentList.length > 0 &&\n\t\t\t\t\t\t\t\t\tthis.state.focusedWorkspaceComponentList.map((cmp, i) => (\n\t\t\t\t\t\t\t\t\t\t<div key={i} className=\"workspace-component\">\n\t\t\t\t\t\t\t\t\t\t\t{cmp}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{this.state.focusedWorkspaceComponentList.length === 0 && \"No components.\"}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"workspace-action-buttons\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={importTooltip}\n\t\t\t\t\t\t\t\t\tclassName={importButtonClasses}\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\tonClick={allowImport ? this.openFileDialog : Function.prototype}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<i className=\"workspace-action-button-icon ff-import\"></i>\n\t\t\t\t\t\t\t\t\t<div>Import</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={exportTooltip}\n\t\t\t\t\t\t\t\t\tclassName={exportButtonClasses}\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\tonClick={allowExport ? this.exportWorkspace : Function.prototype}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<i className=\"workspace-action-button-icon ff-export\"></i>\n\t\t\t\t\t\t\t\t\t<div>Export</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tdisabled={!this.state.focusedWorkspace}\n\t\t\t\t\t\tonClick={this.setWorkspaceToLoadOnStart}\n\t\t\t\t\t\tchecked={this.state.focusedWorkspace === this.state.workspaceToLoadOnStart}\n\t\t\t\t\t\tlabel=\"Load this workspace on startup.\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsPreferencesHome.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,qBAEN,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,mBAAmB,GAAG,wDAAwD,CAAC;AACrF,MAAM,8BAA8B,GAAG;IACtC,2BAA2B,EAAE,yBAAyB;IACtD,4CAA4C,EAAE,2CAA2C;IACzF,+CAA+C,EAAE,6CAA6C;IAC9F,6BAA6B,EAAE,4BAA4B;IAC3D,oCAAoC,EAAE,kCAAkC;CACxE,CAAC;AAEF,MAAM,0BAA0B,GAAkD;IACjF;QACC,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,GAAG,EAAE;YAClB,8BAA8B,CAC7B,8BAA8B,CAAC,+CAA+C,EAC9E,EAAE,CACF,CAAC;QACH,CAAC;KACD;IACD;QACC,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,GAAG,EAAE;YAClB,8BAA8B,CAC7B,8BAA8B,CAAC,+CAA+C,EAC9E,EAAE,CACF,CAAC;QACH,CAAC;KACD;IACD;QACC,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,GAAG,EAAE;YAClB,8BAA8B,CAC7B,8BAA8B,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AC3B,8BAAM,SAAS,EAAC,UAAU,6BAA8B;YACxD,oBAAC,qBAAqB,IACrB,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,YAAY,EACxB,aAAa,EAAC,OAAO,EACrB,gBAAgB,EAAE,0BAA0B,CAAC,IAAI,CAChD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,uBAAuB,CAAC,2CAA2C,CACxG,EACD,aAAa,EAAE,0BAA0B,GACxC,CACG;QACN,6BAAK,SAAS,EAAC,aAAa;YAC3B,8BAAM,SAAS,EAAC,UAAU,sBAAuB;YACjD,oBAAC,qBAAqB,IACrB,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,YAAY,EACxB,aAAa,EAAC,OAAO,EACrB,gBAAgB,EAAE,cAAc,CAAC,IAAI,CACpC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,uBAAuB,CAAC,0BAA0B,CACvF,EACD,aAAa,EAAE,cAAc,GAC5B,CACG;QACN,6BAAK,SAAS,EAAC,aAAa;YAC3B,8BAAM,SAAS,EAAC,UAAU,qCAAsC;YAChE,oBAAC,qBAAqB,IACrB,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,YAAY,EACxB,aAAa,EAAC,OAAO,EACrB,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,CAC1C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,uBAAuB,CAAC,gCAAgC,CAC7F,EACD,aAAa,EAAE,oBAAoB,GAClC,CACG,CACJ,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\r\n\r\n// Context\r\nimport { NotificationsPreferencesContext } from \"../../../NotificationsPreferencesContext\";\r\n\r\n// Components\r\nimport Checkbox from \"../../Checkbox\";\r\nimport DefaultDropdownButton, {\r\n\tIFinsembleDefaultDropdownButtonOptionsProps,\r\n} from \"../../../../shared/DefaultDropdownButton\";\r\n\r\n// Utils\r\nimport { loadSources } from \"./notificationViewsUtils\";\r\n\r\nconst PREFERENCE_PATH_KEY = \"finsemble.servicesConfig.notifications.userPreferences\";\r\nconst NOTIFICATIONS_PREFERENCES_KEYS = {\r\n\tDISABLE_DOT_ON_TOOLBAR_ICON: \"disableDotOnToolbarIcon\",\r\n\tSHOW_DOT_ON_TOOLBAR_ICON_MUTED_NOTIFICATIONS: \"showDotOnToolbarIconForMutedNotifications\",\r\n\tINFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS: \"informationalNotificationToastPeriodSeconds\",\r\n\tDEFAULT_SNOOZE_PERIOD_SECONDS: \"defaultSnoozePeriodSeconds\",\r\n\tNEW_NOTIFICATION_HALO_PERIOD_SECONDS: \"newNotificationHaloPeriodSeconds\",\r\n};\r\n\r\nconst informationalToastDuration: IFinsembleDefaultDropdownButtonOptionsProps[] = [\r\n\t{\r\n\t\toptionLabel: \"10 Seconds\",\r\n\t\toptionValue: 10,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(\r\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\r\n\t\t\t\t10\r\n\t\t\t);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"30 Seconds\",\r\n\t\toptionValue: 30,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(\r\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\r\n\t\t\t\t30\r\n\t\t\t);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"45 Seconds\",\r\n\t\toptionValue: 45,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(\r\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\r\n\t\t\t\t45\r\n\t\t\t);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"60 Seconds\",\r\n\t\toptionValue: 60,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(\r\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\r\n\t\t\t\t60\r\n\t\t\t);\r\n\t\t},\r\n\t},\r\n];\r\n\r\nconst snoozeDuration: IFinsembleDefaultDropdownButtonOptionsProps[] = [\r\n\t{\r\n\t\toptionLabel: \"5 Minutes\",\r\n\t\toptionValue: 300,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 300);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"10 Minutes\",\r\n\t\toptionValue: 600,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 600);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"20 Minutes\",\r\n\t\toptionValue: 1200,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 1200);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"30 Minutes\",\r\n\t\toptionValue: 1800,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 1800);\r\n\t\t},\r\n\t},\r\n];\r\n\r\nconst newNotificationsHalo: IFinsembleDefaultDropdownButtonOptionsProps[] = [\r\n\t{\r\n\t\toptionLabel: \"30 Seconds\",\r\n\t\toptionValue: 30,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 30);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"1 Minute\",\r\n\t\toptionValue: 60,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 60);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"3 Minutes\",\r\n\t\toptionValue: 180,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 180);\r\n\t\t},\r\n\t},\r\n\t{\r\n\t\toptionLabel: \"5 Minutes\",\r\n\t\toptionValue: 600,\r\n\t\tclickHandler: () => {\r\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 600);\r\n\t\t},\r\n\t},\r\n];\r\n\r\nconst setAndTransmitPreferenceChange = (preferenceKey: string, value: any) => {\r\n\tFSBL.Clients.ConfigClient.setPreference(\r\n\t\t{\r\n\t\t\tfield: `${PREFERENCE_PATH_KEY}.${preferenceKey}`,\r\n\t\t\tvalue,\r\n\t\t},\r\n\t\t(err) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.error(\r\n\t\t\t\t\t`Error setting preference from Notifications Preferences Home Component - preference: ${preferenceKey} - value: ${value} `,\r\n\t\t\t\t\terr\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\r\n\t\t\t\t\tnotificationPreferences: {\r\n\t\t\t\t\t\t[preferenceKey]: value,\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n};\r\n\r\nconst NotificationsMainPreferences: React.FunctionComponent = () => {\r\n\tconst notificationsPreferencesContext = useContext(NotificationsPreferencesContext);\r\n\tconst {\r\n\t\tnotificationSources,\r\n\t\tsetNotificationSources,\r\n\t\tsetSelectedNotificationSource,\r\n\t\tsetCurrentNotificationsPreferencesView,\r\n\t} = notificationsPreferencesContext;\r\n\r\n\tconst [reloadSources, setReloadSources] = useState(false);\r\n\r\n\tconst [notificationPreferences, setNotificationPreferences] = useState<any>({});\r\n\r\n\tuseEffect(() => {\r\n\t\tasync function getNotificationsPreferences() {\r\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\r\n\t\t}\r\n\r\n\t\tgetNotificationsPreferences().then((preferences: any) => {\r\n\t\t\tsetNotificationPreferences(preferences);\r\n\t\t});\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tfunction listenForRefreshEvent(error: any, response: any) {\r\n\t\t\tif (error) {\r\n\t\t\t\tconsole.error(\"FinsembleNotificationsPreferencesChannel: \", error);\r\n\t\t\t} else {\r\n\t\t\t\tconst { data } = response;\r\n\t\t\t\tif (data === \"notificationReceived\") {\r\n\t\t\t\t\tsetReloadSources(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsPreferencesChannel\", listenForRefreshEvent);\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsPreferencesChannel\", listenForRefreshEvent);\r\n\t\t};\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tloadSources(setNotificationSources, setReloadSources);\r\n\t}, [notificationSources.length == 0, reloadSources]);\r\n\r\n\tuseEffect(() => {\r\n\t\tfunction navigateToSourceDetail(err: any, response: any) {\r\n\t\t\tconst { data } = response;\r\n\t\t\tif (data.notification) {\r\n\t\t\t\tconst selectedSource = notificationSources.find((source) => source.source === data.notification.source) || null;\r\n\t\t\t\tsetSelectedNotificationSource(selectedSource);\r\n\t\t\t\tsetCurrentNotificationsPreferencesView(\"Details\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsNavigationChannel\", navigateToSourceDetail);\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsNavigationChannel\", navigateToSourceDetail);\r\n\t\t};\r\n\t}, [notificationSources]);\r\n\r\n\tconst toggleNotificationDot = () => {\r\n\t\tsetNotificationPreferences((prevState: any) => ({\r\n\t\t\t...prevState,\r\n\t\t\tdisableDotOnToolbarIcon: !notificationPreferences.disableDotOnToolbarIcon,\r\n\t\t}));\r\n\t\tsetAndTransmitPreferenceChange(\"disableDotOnToolbarIcon\", !notificationPreferences.disableDotOnToolbarIcon);\r\n\t};\r\n\r\n\tconst toggleActionableNotificationToast = () => {\r\n\t\tsetNotificationPreferences((prevState: any) => ({\r\n\t\t\t...prevState,\r\n\t\t\ttoastTimeoutOnActionableNotifications: !notificationPreferences.toastTimeoutOnActionableNotifications,\r\n\t\t}));\r\n\t\tsetAndTransmitPreferenceChange(\r\n\t\t\t\"toastTimeoutOnActionableNotifications\",\r\n\t\t\t!notificationPreferences.toastTimeoutOnActionableNotifications\r\n\t\t);\r\n\t};\r\n\r\n\tconst toggleNotificationDotForMutedNotifications = () => {\r\n\t\tsetNotificationPreferences((prevState: any) => ({\r\n\t\t\t...prevState,\r\n\t\t\tshowDotOnToolbarIconForMutedNotifications: !notificationPreferences.showDotOnToolbarIconForMutedNotifications,\r\n\t\t}));\r\n\t\tsetAndTransmitPreferenceChange(\r\n\t\t\t\"showDotOnToolbarIconForMutedNotifications\",\r\n\t\t\t!notificationPreferences.showDotOnToolbarIconForMutedNotifications\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName=\"row-btn\"\r\n\t\t\t\t\trole=\"button\"\r\n\t\t\t\t\ttabIndex={0}\r\n\t\t\t\t\tonClick={() => setCurrentNotificationsPreferencesView(\"Sources\")}\r\n\t\t\t\t\tonKeyDown={(e) => {\r\n\t\t\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\r\n\t\t\t\t\t\t\tsetCurrentNotificationsPreferencesView(\"Sources\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t<span className=\"row__lbl\">Notification Sources</span>\r\n\t\t\t\t\t<i className=\"ff-caret-up rotate-90\" />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<Checkbox\r\n\t\t\t\t\tonClick={toggleNotificationDot}\r\n\t\t\t\t\tchecked={!notificationPreferences.disableDotOnToolbarIcon}\r\n\t\t\t\t\tlabel=\"Show Notification Dot for new notifications\"\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<Checkbox\r\n\t\t\t\t\tdisabled={notificationPreferences.disableDotOnToolbarIcon}\r\n\t\t\t\t\tonClick={toggleNotificationDotForMutedNotifications}\r\n\t\t\t\t\tchecked={notificationPreferences.showDotOnToolbarIconForMutedNotifications}\r\n\t\t\t\t\tlabel=\"Show Notification Dot for notifications marked as “Don’t Show”\"\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<Checkbox\r\n\t\t\t\t\tonClick={toggleActionableNotificationToast}\r\n\t\t\t\t\tchecked={notificationPreferences.toastTimeoutOnActionableNotifications}\r\n\t\t\t\t\tlabel=\"Enable Toast Timeouts on Actionable Notifications\"\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<span className=\"row__lbl\">Toast Timeout Duration</span>\r\n\t\t\t\t<DefaultDropdownButton\r\n\t\t\t\t\tallowEmpty={false}\r\n\t\t\t\t\tclassNames={\"push-right\"}\r\n\t\t\t\t\tcaretLocation=\"right\"\r\n\t\t\t\t\tdefaultSelection={informationalToastDuration.find(\r\n\t\t\t\t\t\t(element) => element.optionValue === notificationPreferences.informationalNotificationToastPeriodSeconds\r\n\t\t\t\t\t)}\r\n\t\t\t\t\tbuttonOptions={informationalToastDuration}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<span className=\"row__lbl\">Snooze Duration</span>\r\n\t\t\t\t<DefaultDropdownButton\r\n\t\t\t\t\tallowEmpty={false}\r\n\t\t\t\t\tclassNames={\"push-right\"}\r\n\t\t\t\t\tcaretLocation=\"right\"\r\n\t\t\t\t\tdefaultSelection={snoozeDuration.find(\r\n\t\t\t\t\t\t(element) => element.optionValue === notificationPreferences.defaultSnoozePeriodSeconds\r\n\t\t\t\t\t)}\r\n\t\t\t\t\tbuttonOptions={snoozeDuration}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row-section\">\r\n\t\t\t\t<span className=\"row__lbl\">New Notification Halo Duration</span>\r\n\t\t\t\t<DefaultDropdownButton\r\n\t\t\t\t\tallowEmpty={false}\r\n\t\t\t\t\tclassNames={\"push-right\"}\r\n\t\t\t\t\tcaretLocation=\"right\"\r\n\t\t\t\t\tdefaultSelection={newNotificationsHalo.find(\r\n\t\t\t\t\t\t(element) => element.optionValue === notificationPreferences.newNotificationHaloPeriodSeconds\r\n\t\t\t\t\t)}\r\n\t\t\t\t\tbuttonOptions={newNotificationsHalo}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nexport default NotificationsMainPreferences;\r\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationsPreferencesHome.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/NotificationsPreferencesH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,CAAC,2CAA2C,CACxG,EACD,aAAa,EAAE,0BAA0B,GACxC,CACG;QACN,6BAAK,SAAS,EAAC,aAAa;YAC3B,8BAAM,SAAS,EAAC,UAAU,sBAAuB;YACjD,oBAAC,qBAAqB,IACrB,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,YAAY,EACxB,aAAa,EAAC,OAAO,EACrB,gBAAgB,EAAE,cAAc,CAAC,IAAI,CACpC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,uBAAuB,CAAC,0BAA0B,CACvF,EACD,aAAa,EAAE,cAAc,GAC5B,CACG;QACN,6BAAK,SAAS,EAAC,aAAa;YAC3B,8BAAM,SAAS,EAAC,UAAU,qCAAsC;YAChE,oBAAC,qBAAqB,IACrB,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,YAAY,EACxB,aAAa,EAAC,OAAO,EACrB,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,CAC1C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,uBAAuB,CAAC,gCAAgC,CAC7F,EACD,aAAa,EAAE,oBAAoB,GAClC,CACG,CACJ,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\n\n// Context\nimport { NotificationsPreferencesContext } from \"../../../NotificationsPreferencesContext\";\n\n// Components\nimport Checkbox from \"../../Checkbox\";\nimport DefaultDropdownButton, {\n\tIFinsembleDefaultDropdownButtonOptionsProps,\n} from \"../../../../shared/DefaultDropdownButton\";\n\n// Utils\nimport { loadSources } from \"./notificationViewsUtils\";\n\nconst PREFERENCE_PATH_KEY = \"finsemble.servicesConfig.notifications.userPreferences\";\nconst NOTIFICATIONS_PREFERENCES_KEYS = {\n\tDISABLE_DOT_ON_TOOLBAR_ICON: \"disableDotOnToolbarIcon\",\n\tSHOW_DOT_ON_TOOLBAR_ICON_MUTED_NOTIFICATIONS: \"showDotOnToolbarIconForMutedNotifications\",\n\tINFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS: \"informationalNotificationToastPeriodSeconds\",\n\tDEFAULT_SNOOZE_PERIOD_SECONDS: \"defaultSnoozePeriodSeconds\",\n\tNEW_NOTIFICATION_HALO_PERIOD_SECONDS: \"newNotificationHaloPeriodSeconds\",\n};\n\nconst informationalToastDuration: IFinsembleDefaultDropdownButtonOptionsProps[] = [\n\t{\n\t\toptionLabel: \"10 Seconds\",\n\t\toptionValue: 10,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\n\t\t\t\t10\n\t\t\t);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"30 Seconds\",\n\t\toptionValue: 30,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\n\t\t\t\t30\n\t\t\t);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"45 Seconds\",\n\t\toptionValue: 45,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\n\t\t\t\t45\n\t\t\t);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"60 Seconds\",\n\t\toptionValue: 60,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(\n\t\t\t\tNOTIFICATIONS_PREFERENCES_KEYS.INFORMATIONAL_NOTIFICATION_TOAST_PERIOD_SECONDS,\n\t\t\t\t60\n\t\t\t);\n\t\t},\n\t},\n];\n\nconst snoozeDuration: IFinsembleDefaultDropdownButtonOptionsProps[] = [\n\t{\n\t\toptionLabel: \"5 Minutes\",\n\t\toptionValue: 300,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 300);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"10 Minutes\",\n\t\toptionValue: 600,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 600);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"20 Minutes\",\n\t\toptionValue: 1200,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 1200);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"30 Minutes\",\n\t\toptionValue: 1800,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.DEFAULT_SNOOZE_PERIOD_SECONDS, 1800);\n\t\t},\n\t},\n];\n\nconst newNotificationsHalo: IFinsembleDefaultDropdownButtonOptionsProps[] = [\n\t{\n\t\toptionLabel: \"30 Seconds\",\n\t\toptionValue: 30,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 30);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"1 Minute\",\n\t\toptionValue: 60,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 60);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"3 Minutes\",\n\t\toptionValue: 180,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 180);\n\t\t},\n\t},\n\t{\n\t\toptionLabel: \"5 Minutes\",\n\t\toptionValue: 600,\n\t\tclickHandler: () => {\n\t\t\tsetAndTransmitPreferenceChange(NOTIFICATIONS_PREFERENCES_KEYS.NEW_NOTIFICATION_HALO_PERIOD_SECONDS, 600);\n\t\t},\n\t},\n];\n\nconst setAndTransmitPreferenceChange = (preferenceKey: string, value: any) => {\n\tFSBL.Clients.ConfigClient.setPreference(\n\t\t{\n\t\t\tfield: `${PREFERENCE_PATH_KEY}.${preferenceKey}`,\n\t\t\tvalue,\n\t\t},\n\t\t(err) => {\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.error(\n\t\t\t\t\t`Error setting preference from Notifications Preferences Home Component - preference: ${preferenceKey} - value: ${value} `,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\n\t\t\t\t\tnotificationPreferences: {\n\t\t\t\t\t\t[preferenceKey]: value,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t);\n};\n\nconst NotificationsMainPreferences: React.FunctionComponent = () => {\n\tconst notificationsPreferencesContext = useContext(NotificationsPreferencesContext);\n\tconst {\n\t\tnotificationSources,\n\t\tsetNotificationSources,\n\t\tsetSelectedNotificationSource,\n\t\tsetCurrentNotificationsPreferencesView,\n\t} = notificationsPreferencesContext;\n\n\tconst [reloadSources, setReloadSources] = useState(false);\n\n\tconst [notificationPreferences, setNotificationPreferences] = useState<any>({});\n\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationPreferences(preferences);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tfunction listenForRefreshEvent(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (data === \"notificationReceived\") {\n\t\t\t\t\tsetReloadSources(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsPreferencesChannel\", listenForRefreshEvent);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsPreferencesChannel\", listenForRefreshEvent);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tloadSources(setNotificationSources, setReloadSources);\n\t}, [notificationSources.length == 0, reloadSources]);\n\n\tuseEffect(() => {\n\t\tfunction navigateToSourceDetail(err: any, response: any) {\n\t\t\tconst { data } = response;\n\t\t\tif (data.notification) {\n\t\t\t\tconst selectedSource = notificationSources.find((source) => source.source === data.notification.source) || null;\n\t\t\t\tsetSelectedNotificationSource(selectedSource);\n\t\t\t\tsetCurrentNotificationsPreferencesView(\"Details\");\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsNavigationChannel\", navigateToSourceDetail);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsNavigationChannel\", navigateToSourceDetail);\n\t\t};\n\t}, [notificationSources]);\n\n\tconst toggleNotificationDot = () => {\n\t\tsetNotificationPreferences((prevState: any) => ({\n\t\t\t...prevState,\n\t\t\tdisableDotOnToolbarIcon: !notificationPreferences.disableDotOnToolbarIcon,\n\t\t}));\n\t\tsetAndTransmitPreferenceChange(\"disableDotOnToolbarIcon\", !notificationPreferences.disableDotOnToolbarIcon);\n\t};\n\n\tconst toggleActionableNotificationToast = () => {\n\t\tsetNotificationPreferences((prevState: any) => ({\n\t\t\t...prevState,\n\t\t\ttoastTimeoutOnActionableNotifications: !notificationPreferences.toastTimeoutOnActionableNotifications,\n\t\t}));\n\t\tsetAndTransmitPreferenceChange(\n\t\t\t\"toastTimeoutOnActionableNotifications\",\n\t\t\t!notificationPreferences.toastTimeoutOnActionableNotifications\n\t\t);\n\t};\n\n\tconst toggleNotificationDotForMutedNotifications = () => {\n\t\tsetNotificationPreferences((prevState: any) => ({\n\t\t\t...prevState,\n\t\t\tshowDotOnToolbarIconForMutedNotifications: !notificationPreferences.showDotOnToolbarIconForMutedNotifications,\n\t\t}));\n\t\tsetAndTransmitPreferenceChange(\n\t\t\t\"showDotOnToolbarIconForMutedNotifications\",\n\t\t\t!notificationPreferences.showDotOnToolbarIconForMutedNotifications\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"row-btn\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonClick={() => setCurrentNotificationsPreferencesView(\"Sources\")}\n\t\t\t\t\tonKeyDown={(e) => {\n\t\t\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\t\t\t\t\tsetCurrentNotificationsPreferencesView(\"Sources\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"row__lbl\">Notification Sources</span>\n\t\t\t\t\t<i className=\"ff-caret-up rotate-90\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<Checkbox\n\t\t\t\t\tonClick={toggleNotificationDot}\n\t\t\t\t\tchecked={!notificationPreferences.disableDotOnToolbarIcon}\n\t\t\t\t\tlabel=\"Show Notification Dot for new notifications\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<Checkbox\n\t\t\t\t\tdisabled={notificationPreferences.disableDotOnToolbarIcon}\n\t\t\t\t\tonClick={toggleNotificationDotForMutedNotifications}\n\t\t\t\t\tchecked={notificationPreferences.showDotOnToolbarIconForMutedNotifications}\n\t\t\t\t\tlabel=\"Show Notification Dot for notifications marked as “Don’t Show”\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<Checkbox\n\t\t\t\t\tonClick={toggleActionableNotificationToast}\n\t\t\t\t\tchecked={notificationPreferences.toastTimeoutOnActionableNotifications}\n\t\t\t\t\tlabel=\"Enable Toast Timeouts on Actionable Notifications\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<span className=\"row__lbl\">Toast Timeout Duration</span>\n\t\t\t\t<DefaultDropdownButton\n\t\t\t\t\tallowEmpty={false}\n\t\t\t\t\tclassNames={\"push-right\"}\n\t\t\t\t\tcaretLocation=\"right\"\n\t\t\t\t\tdefaultSelection={informationalToastDuration.find(\n\t\t\t\t\t\t(element) => element.optionValue === notificationPreferences.informationalNotificationToastPeriodSeconds\n\t\t\t\t\t)}\n\t\t\t\t\tbuttonOptions={informationalToastDuration}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<span className=\"row__lbl\">Snooze Duration</span>\n\t\t\t\t<DefaultDropdownButton\n\t\t\t\t\tallowEmpty={false}\n\t\t\t\t\tclassNames={\"push-right\"}\n\t\t\t\t\tcaretLocation=\"right\"\n\t\t\t\t\tdefaultSelection={snoozeDuration.find(\n\t\t\t\t\t\t(element) => element.optionValue === notificationPreferences.defaultSnoozePeriodSeconds\n\t\t\t\t\t)}\n\t\t\t\t\tbuttonOptions={snoozeDuration}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"row-section\">\n\t\t\t\t<span className=\"row__lbl\">New Notification Halo Duration</span>\n\t\t\t\t<DefaultDropdownButton\n\t\t\t\t\tallowEmpty={false}\n\t\t\t\t\tclassNames={\"push-right\"}\n\t\t\t\t\tcaretLocation=\"right\"\n\t\t\t\t\tdefaultSelection={newNotificationsHalo.find(\n\t\t\t\t\t\t(element) => element.optionValue === notificationPreferences.newNotificationHaloPeriodSeconds\n\t\t\t\t\t)}\n\t\t\t\t\tbuttonOptions={newNotificationsHalo}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default NotificationsMainPreferences;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsSourceTypes.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4B,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F,OAAO,QAAQ,MAAM,6BAA6B,CAAC;AACnD,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AAEnE,MAAM,WAAW,GAAG,CACnB,WAA0B,EAC1B,WAAoB,EACpB,kBAAqD,EACpD,EAAE,CACH,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IAC/B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;QACnC,MAAM,QAAQ,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YACtD,IAAI,YAAY,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC/B,MAAM,UAAU,GAA4B,WAAW,CAAC,IAAI,CAC3D,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CACrD,CAAC;gBACF,IAAI,CAAC,UAAU,EAAE;oBAChB,OAAO,CAAC,KAAK,CAAC,8BAA8B,YAAY,CAAC,KAAK,aAAa,CAAC,CAAC;iBAC7E;qBAAM;oBACN,IAAI,OAAO,GAAG,KAAK,CAAC;oBACpB,IAAI,YAAY,CAAC,KAAK,EAAE;wBACvB,IA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CACH;QACN,6BAAK,SAAS,EAAC,6BAA6B,IAC1C,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAChD,WAAW,CAAC,WAAW,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAC7D,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,aAAa,iCAAiC,CAC7D,CACI,CACD,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import React, { Dispatch, SetStateAction, useContext, useEffect, useState } from \"react\";\r\n\r\n// Types\r\nimport { IType } from \"../Notifications\";\r\nimport IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\r\n\r\n// Context\r\nimport { NotificationsPreferencesContext } from \"../../../NotificationsPreferencesContext\";\r\n\r\n// Components\r\nimport BellIcon from \"../../../../shared/BellIcon\";\r\nimport BellIconCrossed from \"../../../../shared/BellIconCrossed\";\r\nimport Button from \"../../../../shared/Button\";\r\nimport NavigationButton from \"../../../../shared/NavigationButton\";\r\n\r\nconst renderTypes = (\r\n\tmuteFilters: IMuteFilter[],\r\n\tsourceTypes: IType[],\r\n\tsetTypesMutedState: Dispatch<SetStateAction<IType[]>>\r\n) =>\r\n\tsourceTypes.map((type, index) => {\r\n\t\tconst toggleMute = (type: string) => {\r\n\t\t\tconst newState = [...sourceTypes].map((typeToUpdate) => {\r\n\t\t\t\tif (typeToUpdate.name === type) {\r\n\t\t\t\t\tconst muteFilter: IMuteFilter | undefined = muteFilters.find(\r\n\t\t\t\t\t\t(muteFilter) => muteFilter.type === typeToUpdate.name\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (!muteFilter) {\r\n\t\t\t\t\t\tconsole.error(`Unable to find mute filter ${typeToUpdate.muted} for source`);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlet isMuted = false;\r\n\t\t\t\t\t\tif (typeToUpdate.muted) {\r\n\t\t\t\t\t\t\tFSBL.Clients.NotificationClient.unmute(muteFilter);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tFSBL.Clients.NotificationClient.mute(muteFilter);\r\n\t\t\t\t\t\t\tisMuted = true;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsMuteStateChannel\", {\r\n\t\t\t\t\t\t\tsource: muteFilter.source,\r\n\t\t\t\t\t\t\ttype: muteFilter.type,\r\n\t\t\t\t\t\t\tisMuted: isMuted,\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\ttypeToUpdate.muted = !typeToUpdate.muted;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn typeToUpdate;\r\n\t\t\t});\r\n\t\t\tsetTypesMutedState(newState);\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<div key={`${type.name}__${index}`} className=\"row-section\">\r\n\t\t\t\t<div className=\"row\">\r\n\t\t\t\t\t<div className=\"row__lbl\">{type.name}</div>\r\n\t\t\t\t\t<div className=\"row_right__icon\" onClick={() => toggleMute(type.name)}>\r\n\t\t\t\t\t\t{type.muted ? <BellIconCrossed /> : <BellIcon />}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t);\r\n\t});\r\n\r\nconst NotificationsSourceTypes = () => {\r\n\tconst notificationsPreferencesContext = useContext(NotificationsPreferencesContext);\r\n\tconst currentNotificationSource = notificationsPreferencesContext.selectedNotificationSource;\r\n\tconst sourceTypes = currentNotificationSource?.types.filter((type) => type.name !== \"default\") || [];\r\n\tconst muteFilters: IMuteFilter[] = sourceTypes.map((sourceType) => {\r\n\t\tconst muteFilter: IMuteFilter = { type: sourceType.name };\r\n\t\tif (currentNotificationSource?.source) {\r\n\t\t\tmuteFilter.source = currentNotificationSource.source;\r\n\t\t}\r\n\t\treturn muteFilter;\r\n\t});\r\n\r\n\tconst goBack = () => {\r\n\t\tnotificationsPreferencesContext.setCurrentNotificationsPreferencesView(\"Sources\");\r\n\t};\r\n\r\n\tconst [typesMutedState, setTypesMutedState] = useState(sourceTypes);\r\n\tconst [allMuted, setAllMuted] = useState(false);\r\n\r\n\tconst toggleMuteAll = () => {\r\n\t\tlet newTypesMutedState: IType[] = [];\r\n\t\tif (allMuted) {\r\n\t\t\tnewTypesMutedState = typesMutedState.map((sourceType) => {\r\n\t\t\t\tsourceType.muted = false;\r\n\t\t\t\treturn sourceType;\r\n\t\t\t});\r\n\t\t\tFSBL.Clients.NotificationClient.unmute(muteFilters);\r\n\t\t} else {\r\n\t\t\tnewTypesMutedState = typesMutedState.map((sourceType) => {\r\n\t\t\t\tsourceType.muted = true;\r\n\t\t\t\treturn sourceType;\r\n\t\t\t});\r\n\t\t\tFSBL.Clients.NotificationClient.mute(muteFilters);\r\n\t\t}\r\n\t\tnewTypesMutedState.forEach((element) => {\r\n\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsMuteStateChannel\", {\r\n\t\t\t\tsource: currentNotificationSource?.source,\r\n\t\t\t\ttype: element.name,\r\n\t\t\t\tisMuted: !allMuted,\r\n\t\t\t});\r\n\t\t});\r\n\t\tsetTypesMutedState(newTypesMutedState);\r\n\t\tsetAllMuted(!allMuted);\r\n\t};\r\n\r\n\t// Navigation Hook\r\n\tuseEffect(() => {\r\n\t\tfunction listenForPreference(error: any, response: any) {\r\n\t\t\tif (error) {\r\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\r\n\t\t\t} else {\r\n\t\t\t\tconst { data } = response;\r\n\t\t\t\tif (!data.notification) {\r\n\t\t\t\t\tnotificationsPreferencesContext.setCurrentNotificationsPreferencesView(\"Home\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreference);\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreference);\r\n\t\t};\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\r\n\t\t\tif (error) {\r\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\r\n\t\t\t} else {\r\n\t\t\t\tconst { data } = response;\r\n\t\t\t\tconst newTypesMutedState = [...typesMutedState].map((muteState) => {\r\n\t\t\t\t\tif (muteState.name !== data.type) return muteState;\r\n\r\n\t\t\t\t\treturn { name: data.type, muted: data.isMuted };\r\n\t\t\t\t});\r\n\t\t\t\tsetTypesMutedState(newTypesMutedState);\r\n\t\t\t\tsetAllMuted(newTypesMutedState.every((sourceType) => sourceType.muted));\r\n\t\t\t}\r\n\t\t}\r\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn (\r\n\t\t<div className=\"notification-sources__container\">\r\n\t\t\t<div className=\"notification-sources__header\">\r\n\t\t\t\t<NavigationButton clickHandler={() => goBack()} buttonLabel=\"Back\" caretLocation=\"left\" direction=\"left\" />\r\n\t\t\t\t<span className=\"heading-larger\">{currentNotificationSource?.source}</span>\r\n\t\t\t\t{muteFilters.length > 0 ? (\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tclassNames=\"accent-negative\"\r\n\t\t\t\t\t\tbuttonLabel={allMuted ? \"Show All\" : \"Don't Show All\"}\r\n\t\t\t\t\t\tclickHandler={toggleMuteAll}\r\n\t\t\t\t\t/>\r\n\t\t\t\t) : null}\r\n\t\t\t</div>\r\n\t\t\t<div className=\"notification-sources__types\">\r\n\t\t\t\t{typesMutedState && typesMutedState.length > 0 ? (\r\n\t\t\t\t\trenderTypes(muteFilters, typesMutedState, setTypesMutedState)\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<div className=\"row-section\">No source types configured</div>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default NotificationsSourceTypes;\r\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationsSourceTypes.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4B,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F,OAAO,QAAQ,MAAM,6BAA6B,CAAC;AACnD,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AAEnE,MAAM,WAAW,GAAG,CACnB,WAA0B,EAC1B,WAAoB,EACpB,kBAAqD,EACpD,EAAE,CACH,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IAC/B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;QACnC,MAAM,QAAQ,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YACtD,IAAI,YAAY,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC/B,MAAM,UAAU,GAA4B,WAAW,CAAC,IAAI,CAC3D,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CACrD,CAAC;gBACF,IAAI,CAAC,UAAU,EAAE;oBAChB,OAAO,CAAC,KAAK,CAAC,8BAA8B,YAAY,CAAC,KAAK,aAAa,CAAC,CAAC;iBAC7E;qBAAM;oBACN,IAAI,OAAO,GAAG,KAAK,CAAC;oBACpB,IAAI,YAAY,CAAC,KAAK,EAAE;wBACvB,IAAI,CAAC,OAAO,CA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AAS,EAAC,6BAA6B,IAC1C,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAChD,WAAW,CAAC,WAAW,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAC7D,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,aAAa,iCAAiC,CAC7D,CACI,CACD,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import React, { Dispatch, SetStateAction, useContext, useEffect, useState } from \"react\";\n\n// Types\nimport { IType } from \"../Notifications\";\nimport IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\n\n// Context\nimport { NotificationsPreferencesContext } from \"../../../NotificationsPreferencesContext\";\n\n// Components\nimport BellIcon from \"../../../../shared/BellIcon\";\nimport BellIconCrossed from \"../../../../shared/BellIconCrossed\";\nimport Button from \"../../../../shared/Button\";\nimport NavigationButton from \"../../../../shared/NavigationButton\";\n\nconst renderTypes = (\n\tmuteFilters: IMuteFilter[],\n\tsourceTypes: IType[],\n\tsetTypesMutedState: Dispatch<SetStateAction<IType[]>>\n) =>\n\tsourceTypes.map((type, index) => {\n\t\tconst toggleMute = (type: string) => {\n\t\t\tconst newState = [...sourceTypes].map((typeToUpdate) => {\n\t\t\t\tif (typeToUpdate.name === type) {\n\t\t\t\t\tconst muteFilter: IMuteFilter | undefined = muteFilters.find(\n\t\t\t\t\t\t(muteFilter) => muteFilter.type === typeToUpdate.name\n\t\t\t\t\t);\n\t\t\t\t\tif (!muteFilter) {\n\t\t\t\t\t\tconsole.error(`Unable to find mute filter ${typeToUpdate.muted} for source`);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet isMuted = false;\n\t\t\t\t\t\tif (typeToUpdate.muted) {\n\t\t\t\t\t\t\tFSBL.Clients.NotificationClient.unmute(muteFilter);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFSBL.Clients.NotificationClient.mute(muteFilter);\n\t\t\t\t\t\t\tisMuted = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsMuteStateChannel\", {\n\t\t\t\t\t\t\tsource: muteFilter.source,\n\t\t\t\t\t\t\ttype: muteFilter.type,\n\t\t\t\t\t\t\tisMuted: isMuted,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\ttypeToUpdate.muted = !typeToUpdate.muted;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn typeToUpdate;\n\t\t\t});\n\t\t\tsetTypesMutedState(newState);\n\t\t};\n\n\t\treturn (\n\t\t\t<div key={`${type.name}__${index}`} className=\"row-section\">\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"row__lbl\">{type.name}</div>\n\t\t\t\t\t<div className=\"row_right__icon\" onClick={() => toggleMute(type.name)}>\n\t\t\t\t\t\t{type.muted ? <BellIconCrossed /> : <BellIcon />}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t});\n\nconst NotificationsSourceTypes = () => {\n\tconst notificationsPreferencesContext = useContext(NotificationsPreferencesContext);\n\tconst currentNotificationSource = notificationsPreferencesContext.selectedNotificationSource;\n\tconst sourceTypes = currentNotificationSource?.types.filter((type) => type.name !== \"default\") || [];\n\tconst muteFilters: IMuteFilter[] = sourceTypes.map((sourceType) => {\n\t\tconst muteFilter: IMuteFilter = { type: sourceType.name };\n\t\tif (currentNotificationSource?.source) {\n\t\t\tmuteFilter.source = currentNotificationSource.source;\n\t\t}\n\t\treturn muteFilter;\n\t});\n\n\tconst goBack = () => {\n\t\tnotificationsPreferencesContext.setCurrentNotificationsPreferencesView(\"Sources\");\n\t};\n\n\tconst [typesMutedState, setTypesMutedState] = useState(sourceTypes);\n\tconst [allMuted, setAllMuted] = useState(false);\n\n\tconst toggleMuteAll = () => {\n\t\tlet newTypesMutedState: IType[] = [];\n\t\tif (allMuted) {\n\t\t\tnewTypesMutedState = typesMutedState.map((sourceType) => {\n\t\t\t\tsourceType.muted = false;\n\t\t\t\treturn sourceType;\n\t\t\t});\n\t\t\tFSBL.Clients.NotificationClient.unmute(muteFilters);\n\t\t} else {\n\t\t\tnewTypesMutedState = typesMutedState.map((sourceType) => {\n\t\t\t\tsourceType.muted = true;\n\t\t\t\treturn sourceType;\n\t\t\t});\n\t\t\tFSBL.Clients.NotificationClient.mute(muteFilters);\n\t\t}\n\t\tnewTypesMutedState.forEach((element) => {\n\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsMuteStateChannel\", {\n\t\t\t\tsource: currentNotificationSource?.source,\n\t\t\t\ttype: element.name,\n\t\t\t\tisMuted: !allMuted,\n\t\t\t});\n\t\t});\n\t\tsetTypesMutedState(newTypesMutedState);\n\t\tsetAllMuted(!allMuted);\n\t};\n\n\t// Navigation Hook\n\tuseEffect(() => {\n\t\tfunction listenForPreference(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (!data.notification) {\n\t\t\t\t\tnotificationsPreferencesContext.setCurrentNotificationsPreferencesView(\"Home\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreference);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreference);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tconst newTypesMutedState = [...typesMutedState].map((muteState) => {\n\t\t\t\t\tif (muteState.name !== data.type) return muteState;\n\n\t\t\t\t\treturn { name: data.type, muted: data.isMuted };\n\t\t\t\t});\n\t\t\t\tsetTypesMutedState(newTypesMutedState);\n\t\t\t\tsetAllMuted(newTypesMutedState.every((sourceType) => sourceType.muted));\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\treturn (\n\t\t<div className=\"notification-sources__container\">\n\t\t\t<div className=\"notification-sources__header\">\n\t\t\t\t<NavigationButton clickHandler={() => goBack()} buttonLabel=\"Back\" caretLocation=\"left\" direction=\"left\" />\n\t\t\t\t<span className=\"heading-larger\">{currentNotificationSource?.source}</span>\n\t\t\t\t{muteFilters.length > 0 ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassNames=\"accent-negative\"\n\t\t\t\t\t\tbuttonLabel={allMuted ? \"Show All\" : \"Don't Show All\"}\n\t\t\t\t\t\tclickHandler={toggleMuteAll}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t\t<div className=\"notification-sources__types\">\n\t\t\t\t{typesMutedState && typesMutedState.length > 0 ? (\n\t\t\t\t\trenderTypes(muteFilters, typesMutedState, setTypesMutedState)\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"row-section\">No source types configured</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default NotificationsSourceTypes;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsSourcesPreferences.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,EACN,+BAA+B,GAE/B,MAAM,0CAA0C,CAAC;AAGlD,OAAO,gBAAgB,MAAM,qCAA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M,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;gBAC1B,IAAI,IAAI,KAAK,sBAAsB,EAAE;oBACpC,gBAAgB,CAAC,IAAI,CAAC,CAAC;iBACvB;aACD;QACF,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,0CAA0C,EAAE,qBAAqB,CAAC,CAAC;QACzG,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,0CAA0C,EAAE,qBAAqB,CAAC,CAAC;QAC7G,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,GAAG,EAAE;QACnB,sCAAsC,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,iCAAiC;QAC/C,6BAAK,SAAS,EAAC,8BAA8B;YAC5C,oBAAC,gBAAgB,IAAC,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAC,MAAM,EAAC,aAAa,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,GAAG;YAC3G,8BAAM,SAAS,EAAC,gBAAgB,2BAA4B,CACvD;QACN,6BAAK,SAAS,EAAC,4BAA4B,IACzC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACjC,mBAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACzC,OAAO,oBAAC,2BAA2B,IAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;QACpE,CAAC,CAAC,CACF,CAAC,CAAC,CAAC,CACH,uEAA+C,CAC/C,CACI,CACD,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["import React, { ReactNode, useContext, useEffect, useState } from \"react\";\
|
|
1
|
+
{"version":3,"file":"NotificationsSourcesPreferences.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,EACN,+BAA+B,GAE/B,MAAM,0CAA0C,CAAC;AAGlD,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AAOnE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,2BAA2B,GAA8D,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IAC7G,MAAM,+BAA+B,GAAG,UAAU,CAAC,+BAA+B,CAAC,CAAC;IACpF,MAAM,EAAE,6BAA6B,EAAE,sCAAsC,EAAE,GAAG,+BAA+B,CAAC;IAElH,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEnF,OAAO,CACN,6BAAK,SAAS,EAAC,aAAa;QAC3B,6BACC,SAAS,EAAC,SAAS,EACnB,OAAO,EAAE,GAAG,EAAE;gBACb,6BAA6B,CAAC,MAAM,CAAC,CAAC;gBACtC,sCAAsC,CAAC,SAAS,CAAC,CAAC;YACnD,CAAC;YAED,6BACC,GAAG,EAAE,MAAM,CAAC,IAAI,EAChB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,GACtC;YACD,eAAe,CAAC,CAAC,CAAC,2BAAG,SAAS,EAAC,0BAA0B,GAAG,CAAC,CAAC,CAAC,IAAI;YACpE,6BAAK,SAAS,EAAC,UAAU,IAAE,MAAM,CAAC,MAAM,CAAO;YAC/C,2BAAG,SAAS,EAAC,uBAAuB,GA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,MAAM,EAAE,MAAM,GAAI,CAAC;QACpE,CAAC,CAAC,CACF,CAAC,CAAC,CAAC,CACH,uEAA+C,CAC/C,CACI,CACD,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["import React, { ReactNode, useContext, useEffect, useState } from \"react\";\n\n// Context\nimport {\n\tNotificationsPreferencesContext,\n\tNotificationsPreferencesContextType,\n} from \"../../../NotificationsPreferencesContext\";\n\n// Components\nimport NavigationButton from \"../../../../shared/NavigationButton\";\n\n// Types\nimport IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\nimport { INotificationSources } from \"../Notifications\";\n\n// Utils\nimport { loadSources } from \"./notificationViewsUtils\";\n\nconst NotificationSourceRowButton: React.FunctionComponent<{ source: INotificationSources }> = ({ source }) => {\n\tconst notificationsPreferencesContext = useContext(NotificationsPreferencesContext);\n\tconst { setSelectedNotificationSource, setCurrentNotificationsPreferencesView } = notificationsPreferencesContext;\n\n\tconst [showDefaultIcon, setShowDefaultIcon] = useState(source.icon ? false : true);\n\n\treturn (\n\t\t<div className=\"row-section\">\n\t\t\t<div\n\t\t\t\tclassName=\"row-btn\"\n\t\t\t\tonClick={() => {\n\t\t\t\t\tsetSelectedNotificationSource(source);\n\t\t\t\t\tsetCurrentNotificationsPreferencesView(\"Details\");\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\tsrc={source.icon}\n\t\t\t\t\tstyle={showDefaultIcon ? { display: \"none\" } : {}}\n\t\t\t\t\tonError={() => setShowDefaultIcon(true)}\n\t\t\t\t/>\n\t\t\t\t{showDefaultIcon ? <i className=\"ff-finsemble default-img\" /> : null}\n\t\t\t\t<div className=\"row__lbl\">{source.source}</div>\n\t\t\t\t<i className=\"ff-caret-up rotate-90\" />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst NotificationsSourcesPreferences: React.FunctionComponent = () => {\n\tconst notificationsPreferencesContext = useContext(NotificationsPreferencesContext);\n\tconst {\n\t\tnotificationSources,\n\t\tsetNotificationSources,\n\t\tsetSelectedNotificationSource,\n\t\tsetCurrentNotificationsPreferencesView,\n\t} = notificationsPreferencesContext;\n\n\tconst [reloadSources, setReloadSources] = useState(false);\n\n\tuseEffect(() => {\n\t\tfunction listenForPreference(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsNavigationChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (!data.notification) {\n\t\t\t\t\tsetCurrentNotificationsPreferencesView(\"Home\");\n\t\t\t\t} else {\n\t\t\t\t\tconst selectedSource =\n\t\t\t\t\t\tnotificationSources.find((source) => source.source === data.notification.source) || null;\n\t\t\t\t\tsetSelectedNotificationSource(selectedSource);\n\t\t\t\t\tsetCurrentNotificationsPreferencesView(\"Details\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsNavigationChannel\", listenForPreference);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsNavigationChannel\", listenForPreference);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tloadSources(setNotificationSources, setReloadSources);\n\t}, [reloadSources]);\n\n\tuseEffect(() => {\n\t\tasync function listenForRefreshEvent(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (data === \"notificationReceived\") {\n\t\t\t\t\tsetReloadSources(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsPreferencesChannel\", listenForRefreshEvent);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsPreferencesChannel\", listenForRefreshEvent);\n\t\t};\n\t}, []);\n\n\tconst goBack = () => {\n\t\tsetCurrentNotificationsPreferencesView(\"Home\");\n\t};\n\n\treturn (\n\t\t<div className=\"notification-sources__container\">\n\t\t\t<div className=\"notification-sources__header\">\n\t\t\t\t<NavigationButton clickHandler={() => goBack()} buttonLabel=\"Back\" caretLocation=\"left\" direction=\"left\" />\n\t\t\t\t<span className=\"heading-larger\">Notification Sources</span>\n\t\t\t</div>\n\t\t\t<div className=\"notification-sources__list\">\n\t\t\t\t{notificationSources.length > 0 ? (\n\t\t\t\t\tnotificationSources.map((source, index) => {\n\t\t\t\t\t\treturn <NotificationSourceRowButton key={index} source={source} />;\n\t\t\t\t\t})\n\t\t\t\t) : (\n\t\t\t\t\t<span>No notification sources to display</span>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default NotificationsSourcesPreferences;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationViewsUtils.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/notificationViewsUtils.ts"],"names":[],"mappings":"AAIA,MAAM,oBAAoB,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,WAA0B,EAAE,EAAE;IACzF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC/B,sBAAoF,EACpF,gBAA+D,EAC9D,EAAE;IACH,MAAM,kBAAkB,GAAa,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,CAAC;IACxF,MAAM,WAAW,GAAkB,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC;IAE1F,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,GAAQ,EAAE,eAAoB,EAAE,EAAE;QAC7F,IAAI,GAAG,EAAE;YACR,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;SAChF;aAAM;YACN,MAAM,gBAAgB,GAAG,eAAe,EAAE,UAAU,CAAC;YACrD,MAAM,0BAA0B,GAAG,eAAe,EAAE,cAAc,EAAE,aAAa,CAAC;YAClF,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;YACtE,IAAI,OAAO,GAAG,IAAI,CAAC;YAEnB,IAAI,kBAAkB,EAAE;gBACvB,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;oBAC/C,MAAM,KAAK,GAAY,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE,CAC7D,MAAM,CAAC;wBACN,IAAI,EAAE,cAAc;wBACpB,KAAK,EAAE,oBAAoB,CAAC,UAAU,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC;qBAC/E,CAAC,CACF,CAAC;oBACF,MAAM,MAAM,GAAyB;wBACpC,MAAM,EAAE,UAAU;wBAClB,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI;wBACjF,KAAK;qBACL,CAAC;oBACF,OAAO,MAAM,CAAC;gBACf,CAAC,CAAC,CAAC;gBACH,sBAAsB,CAAC,OAAO,CAAC,CAAC;gBAChC,gBAAgB,CAAC,KAAK,CAAC,CAAC;aACxB;SACD;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\
|
|
1
|
+
{"version":3,"file":"notificationViewsUtils.js","sourceRoot":"","sources":["../../../../../../src/components/userPreferences/components/content/notificationViews/notificationViewsUtils.ts"],"names":[],"mappings":"AAIA,MAAM,oBAAoB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AAC;qBAC/E,CAAC,CACF,CAAC;oBACF,MAAM,MAAM,GAAyB;wBACpC,MAAM,EAAE,UAAU;wBAClB,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI;wBACjF,KAAK;qBACL,CAAC;oBACF,OAAO,MAAM,CAAC;gBACf,CAAC,CAAC,CAAC;gBACH,sBAAsB,CAAC,OAAO,CAAC,CAAC;gBAChC,gBAAgB,CAAC,KAAK,CAAC,CAAC;aACxB;SACD;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\nimport { object } from \"prop-types\";\nimport { INotificationSources, IType } from \"../Notifications\";\n\nconst isTypeMutedForSource = (source: string, type: string, muteFilters: IMuteFilter[]) => {\n\treturn muteFilters.filter((mFilter) => mFilter.source === source && mFilter.type === type);\n};\n\nexport const loadSources = async (\n\tsetNotificationSources: React.Dispatch<React.SetStateAction<INotificationSources[]>>,\n\tsetReloadSources: React.Dispatch<React.SetStateAction<boolean>>\n) => {\n\tconst notificationSoures: string[] = await FSBL.Clients.NotificationClient.getSources();\n\tconst muteFilters: IMuteFilter[] = await FSBL.Clients.NotificationClient.getMuteFilters();\n\n\tFSBL.Clients.ConfigClient.getValue({ field: \"finsemble\" }, (err: any, finsembleConfig: any) => {\n\t\tif (err) {\n\t\t\tconsole.error(\"Error geting components config to extract notifications config\");\n\t\t} else {\n\t\t\tconst componentsConfig = finsembleConfig?.components;\n\t\t\tconst notificationsServiceConfig = finsembleConfig?.servicesConfig?.notifications;\n\t\t\tconst configuredTypes = Object.keys(notificationsServiceConfig.types);\n\t\t\tlet sources = null;\n\n\t\t\tif (notificationSoures) {\n\t\t\t\tsources = notificationSoures.map((currSource) => {\n\t\t\t\t\tconst types: IType[] = configuredTypes.map((configuredType) =>\n\t\t\t\t\t\tObject({\n\t\t\t\t\t\t\tname: configuredType,\n\t\t\t\t\t\t\tmuted: isTypeMutedForSource(currSource, configuredType, muteFilters).length > 0,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tconst result: INotificationSources = {\n\t\t\t\t\t\tsource: currSource,\n\t\t\t\t\t\ticon: componentsConfig[currSource]?.foreign?.components?.Toolbar?.iconURL || null,\n\t\t\t\t\t\ttypes,\n\t\t\t\t\t};\n\t\t\t\t\treturn result;\n\t\t\t\t});\n\t\t\t\tsetNotificationSources(sources);\n\t\t\t\tsetReloadSources(false);\n\t\t\t}\n\t\t}\n\t});\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduledRestart.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/general/ScheduledRestart.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,eAAe,GAAG;IACvB,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,IAAI;CACd,CAAC;AAGF,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;IAC5B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACd;AAOD,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACnC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAS;IAC5D,YAAY,KAAK;QAChB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,gBAAgB,EAAE,eAAe;YACjC,OAAO,EAAE,KAAK;SACd,CAAC;QACF,IAAI,CAAC,cAAc,GAA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T,gCAAQ,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,IAClF,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,gCAAQ,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,IAC3B,MAAM,CACC,CACT,CAAC,CACM;;gBAGT,gCAAQ,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ;oBACvF,gCAAQ,KAAK,EAAE,IAAI,SAAa;oBAChC,gCAAQ,KAAK,EAAE,IAAI,SAAa,CACxB,CACJ,CACD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\r\nimport { Actions, UserPreferencesStore } from \"../../stores/UserPreferencesStore\";\r\nimport Checkbox from \"../Checkbox\";\r\n\r\nconst DEFAULT_RESTART = {\r\n\thour: 4,\r\n\tminute: 0,\r\n\tmeridiem: \"AM\",\r\n};\r\n\r\n// Create an array 1-12.\r\nlet HOURS = [];\r\nfor (var i = 1; i < 13; i++) {\r\n\tHOURS.push(i);\r\n}\r\n\r\n// FOR TESTING\r\n// let MINUTES = [];\r\n// for (var i = 1; i <= 60; i++){\r\n// MINUTES.push(i);\r\n// }\r\nconst MINUTES = [\"00\", 15, 30, 45];\r\nexport default class ScheduledRestart extends React.Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tthis.state = {\r\n\t\t\tscheduledRestart: DEFAULT_RESTART,\r\n\t\t\tenabled: false,\r\n\t\t};\r\n\t\tthis.setPreferences = this.setPreferences.bind(this);\r\n\t\tthis.toggleEnabled = this.toggleEnabled.bind(this);\r\n\t\tthis.setHour = this.setHour.bind(this);\r\n\t\tthis.setMinute = this.setMinute.bind(this);\r\n\t\tthis.setMeridiem = this.setMeridiem.bind(this);\r\n\t\tthis.getDisplayHour = this.getDisplayHour.bind(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when any preference is changed on the userPreferencesStore.\r\n\t * @param {obj} err\r\n\t * @param {data} data\r\n\t */\r\n\tsetPreferences(err, data) {\r\n\t\tif (!data && !data.value) return;\r\n\t\tlet scheduledRestart = data.value[\"finsemble.scheduledRestart\"];\r\n\t\t// If scheduledRestart is falsy, set \"enabled\" to false. I probably could've done !scheduledRestart. Oh well.\r\n\t\tlet enabled = typeof scheduledRestart === \"object\";\r\n\t\tif (enabled) {\r\n\t\t\t// This is purely for display. I found that military time forced a scroll bar onto the dropdown that looked bad.\r\n\t\t\tscheduledRestart.meridiem = scheduledRestart.hour > 11 ? \"PM\" : \"AM\";\r\n\t\t} else {\r\n\t\t\tscheduledRestart = DEFAULT_RESTART;\r\n\t\t}\r\n\t\tthis.setState({ scheduledRestart, enabled });\r\n\t}\r\n\r\n\t/**\r\n\t * Toggle the enabled state of the select boxes.\r\n\t */\r\n\ttoggleEnabled() {\r\n\t\tlet { enabled, scheduledRestart } = this.state;\r\n\t\tenabled = !enabled;\r\n\t\t// If the select boxes are no longer enabled, reset the scheduled restart time and call a method on the Actions object.\r\n\t\t// That function will set scheduledRestart to null via the preferences API. But we want our display to look nice, hence the bit where we reset it to the default value.\r\n\t\tif (!enabled) {\r\n\t\t\tscheduledRestart = DEFAULT_RESTART;\r\n\t\t\tthis.setState({ enabled, scheduledRestart });\r\n\t\t\tActions.disableScheduledRestart();\r\n\t\t} else {\r\n\t\t\tthis.setState({ enabled });\r\n\t\t\tActions.setScheduledRestart(scheduledRestart);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method will transform 8 PM into 20:00. It also handles when the user changes the meridiem.\r\n\t * e.g., 8PM (20) => 8AM (8).\r\n\t * Set the minute, then set the 'finsemble.scheduledRestart' preference via the method on the Actions object.\r\n\t * @param {event} e\r\n\t */\r\n\tsetHour(e) {\r\n\t\tlet hour = Number(e.target.value);\r\n\t\tlet { scheduledRestart } = this.state;\r\n\t\tif (hour < 12 && scheduledRestart.meridiem === \"PM\") {\r\n\t\t\thour = hour + 12;\r\n\t\t} else if (hour > 12 && scheduledRestart.meridiem === \"AM\") {\r\n\t\t\thour = hour - 12;\r\n\t\t} else if (scheduledRestart.meridiem === \"AM\" && hour === 12) {\r\n\t\t\thour = 0;\r\n\t\t}\r\n\r\n\t\tscheduledRestart.hour = hour;\r\n\t\tthis.setState({ scheduledRestart });\r\n\t\tActions.setScheduledRestart(scheduledRestart);\r\n\t}\r\n\r\n\t/**\r\n\t * Set the minute, then set the 'finsemble.scheduledRestart' preference via the method on the Actions object.\r\n\t * @param {event} e\r\n\t */\r\n\tsetMinute(e) {\r\n\t\tlet minute = Number(e.target.value);\r\n\t\tlet { scheduledRestart } = this.state;\r\n\t\tscheduledRestart.minute = minute;\r\n\r\n\t\tthis.setState({ scheduledRestart });\r\n\t\tActions.setScheduledRestart(scheduledRestart);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the meridiem for the time (AM or PM). Afterwards, this calls setHour to handle any necessary conversions to military time.\r\n\t * @param {event} e\r\n\t */\r\n\tsetMeridiem(e) {\r\n\t\tlet { scheduledRestart } = this.state;\r\n\t\tlet currentMeridiem = scheduledRestart.meridiem;\r\n\r\n\t\tlet meridiem = e.target.value;\r\n\t\tscheduledRestart.meridiem = meridiem;\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\tscheduledRestart,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tthis.setHour({\r\n\t\t\t\t\ttarget: {\r\n\t\t\t\t\t\tvalue: this.state.scheduledRestart.hour,\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\tgetDisplayHour() {\r\n\t\tlet { scheduledRestart } = this.state;\r\n\t\tif (scheduledRestart.meridiem === \"AM\" && scheduledRestart.hour === 0) {\r\n\t\t\treturn 12;\r\n\t\t} else if (scheduledRestart.meridiem === \"PM\" && scheduledRestart.hour > 12) {\r\n\t\t\treturn scheduledRestart.hour - 12;\r\n\t\t} else {\r\n\t\t\treturn scheduledRestart.hour;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Add listener on the store. When the preferences field changes, we change our local state.\r\n\t * Also, get the initial state from the store.\r\n\t */\r\n\tcomponentDidMount() {\r\n\t\tUserPreferencesStore.addListener({ field: \"preferences\" }, this.setPreferences);\r\n\t\tUserPreferencesStore.getValue({ field: \"preferences\" }, (err, data) => {\r\n\t\t\tif (data) {\r\n\t\t\t\tlet scheduledRestart = data[\"finsemble.scheduledRestart\"];\r\n\t\t\t\tlet enabled = typeof scheduledRestart === \"object\";\r\n\t\t\t\tif (enabled) {\r\n\t\t\t\t\tscheduledRestart.meridiem = scheduledRestart.hour > 11 ? \"PM\" : \"AM\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduledRestart = DEFAULT_RESTART;\r\n\t\t\t\t}\r\n\t\t\t\tthis.setState({ scheduledRestart, enabled });\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tUserPreferencesStore.removeListener({ field: \"preferences\" }, this.setPreferences);\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { scheduledRestart, enabled } = this.state;\r\n\t\tlet wrapClasses = \"scheduled-restart\";\r\n\t\tif (!enabled) {\r\n\t\t\twrapClasses = `${wrapClasses} disabled-restart`;\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t<div className=\"complex-menu-content-row\">\r\n\t\t\t\t<Checkbox onClick={this.toggleEnabled} checked={this.state.enabled} label=\"Restart daily\" />\r\n\t\t\t\t<div className={wrapClasses}>\r\n\t\t\t\t\t<span className=\"scheduled-restart-select-label\">Time:</span>\r\n\t\t\t\t\t{/* HOURS */}\r\n\t\t\t\t\t<select disabled={!enabled} onChange={this.setHour} value={this.getDisplayHour()}>\r\n\t\t\t\t\t\t{HOURS.map((hour, i) => (\r\n\t\t\t\t\t\t\t<option key={i} value={hour}>\r\n\t\t\t\t\t\t\t\t{hour}\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</select>\r\n\t\t\t\t\t : \r\n\t\t\t\t\t{/* MINUTES */}\r\n\t\t\t\t\t<select disabled={!enabled} value={scheduledRestart.minute} onChange={this.setMinute}>\r\n\t\t\t\t\t\t{MINUTES.map((minute, i) => (\r\n\t\t\t\t\t\t\t<option key={i} value={minute}>\r\n\t\t\t\t\t\t\t\t{minute}\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</select>\r\n\t\t\t\t\t \r\n\t\t\t\t\t{/* MERIDIEM */}\r\n\t\t\t\t\t<select disabled={!enabled} onChange={this.setMeridiem} value={scheduledRestart.meridiem}>\r\n\t\t\t\t\t\t<option value={\"AM\"}>AM</option>\r\n\t\t\t\t\t\t<option value={\"PM\"}>PM</option>\r\n\t\t\t\t\t</select>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ScheduledRestart.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/general/ScheduledRestart.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,eAAe,GAAG;IACvB,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,IAAI;CACd,CAAC;AAGF,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;IAC5B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACd;AAOD,MAAM,OAAO,GAAG,CA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Aa;gBAE7D,gCAAQ,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,IAC9E,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,gCAAQ,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,IACzB,IAAI,CACG,CACT,CAAC,CACM;;gBAGT,gCAAQ,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,IAClF,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,gCAAQ,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,IAC3B,MAAM,CACC,CACT,CAAC,CACM;;gBAGT,gCAAQ,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ;oBACvF,gCAAQ,KAAK,EAAE,IAAI,SAAa;oBAChC,gCAAQ,KAAK,EAAE,IAAI,SAAa,CACxB,CACJ,CACD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport { Actions, UserPreferencesStore } from \"../../stores/UserPreferencesStore\";\nimport Checkbox from \"../Checkbox\";\n\nconst DEFAULT_RESTART = {\n\thour: 4,\n\tminute: 0,\n\tmeridiem: \"AM\",\n};\n\n// Create an array 1-12.\nlet HOURS = [];\nfor (var i = 1; i < 13; i++) {\n\tHOURS.push(i);\n}\n\n// FOR TESTING\n// let MINUTES = [];\n// for (var i = 1; i <= 60; i++){\n// MINUTES.push(i);\n// }\nconst MINUTES = [\"00\", 15, 30, 45];\nexport default class ScheduledRestart extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tscheduledRestart: DEFAULT_RESTART,\n\t\t\tenabled: false,\n\t\t};\n\t\tthis.setPreferences = this.setPreferences.bind(this);\n\t\tthis.toggleEnabled = this.toggleEnabled.bind(this);\n\t\tthis.setHour = this.setHour.bind(this);\n\t\tthis.setMinute = this.setMinute.bind(this);\n\t\tthis.setMeridiem = this.setMeridiem.bind(this);\n\t\tthis.getDisplayHour = this.getDisplayHour.bind(this);\n\t}\n\n\t/**\n\t * Invoked when any preference is changed on the userPreferencesStore.\n\t * @param {obj} err\n\t * @param {data} data\n\t */\n\tsetPreferences(err, data) {\n\t\tif (!data && !data.value) return;\n\t\tlet scheduledRestart = data.value[\"finsemble.scheduledRestart\"];\n\t\t// If scheduledRestart is falsy, set \"enabled\" to false. I probably could've done !scheduledRestart. Oh well.\n\t\tlet enabled = typeof scheduledRestart === \"object\";\n\t\tif (enabled) {\n\t\t\t// This is purely for display. I found that military time forced a scroll bar onto the dropdown that looked bad.\n\t\t\tscheduledRestart.meridiem = scheduledRestart.hour > 11 ? \"PM\" : \"AM\";\n\t\t} else {\n\t\t\tscheduledRestart = DEFAULT_RESTART;\n\t\t}\n\t\tthis.setState({ scheduledRestart, enabled });\n\t}\n\n\t/**\n\t * Toggle the enabled state of the select boxes.\n\t */\n\ttoggleEnabled() {\n\t\tlet { enabled, scheduledRestart } = this.state;\n\t\tenabled = !enabled;\n\t\t// If the select boxes are no longer enabled, reset the scheduled restart time and call a method on the Actions object.\n\t\t// That function will set scheduledRestart to null via the preferences API. But we want our display to look nice, hence the bit where we reset it to the default value.\n\t\tif (!enabled) {\n\t\t\tscheduledRestart = DEFAULT_RESTART;\n\t\t\tthis.setState({ enabled, scheduledRestart });\n\t\t\tActions.disableScheduledRestart();\n\t\t} else {\n\t\t\tthis.setState({ enabled });\n\t\t\tActions.setScheduledRestart(scheduledRestart);\n\t\t}\n\t}\n\n\t/**\n\t * This method will transform 8 PM into 20:00. It also handles when the user changes the meridiem.\n\t * e.g., 8PM (20) => 8AM (8).\n\t * Set the minute, then set the 'finsemble.scheduledRestart' preference via the method on the Actions object.\n\t * @param {event} e\n\t */\n\tsetHour(e) {\n\t\tlet hour = Number(e.target.value);\n\t\tlet { scheduledRestart } = this.state;\n\t\tif (hour < 12 && scheduledRestart.meridiem === \"PM\") {\n\t\t\thour = hour + 12;\n\t\t} else if (hour > 12 && scheduledRestart.meridiem === \"AM\") {\n\t\t\thour = hour - 12;\n\t\t} else if (scheduledRestart.meridiem === \"AM\" && hour === 12) {\n\t\t\thour = 0;\n\t\t}\n\n\t\tscheduledRestart.hour = hour;\n\t\tthis.setState({ scheduledRestart });\n\t\tActions.setScheduledRestart(scheduledRestart);\n\t}\n\n\t/**\n\t * Set the minute, then set the 'finsemble.scheduledRestart' preference via the method on the Actions object.\n\t * @param {event} e\n\t */\n\tsetMinute(e) {\n\t\tlet minute = Number(e.target.value);\n\t\tlet { scheduledRestart } = this.state;\n\t\tscheduledRestart.minute = minute;\n\n\t\tthis.setState({ scheduledRestart });\n\t\tActions.setScheduledRestart(scheduledRestart);\n\t}\n\n\t/**\n\t * Sets the meridiem for the time (AM or PM). Afterwards, this calls setHour to handle any necessary conversions to military time.\n\t * @param {event} e\n\t */\n\tsetMeridiem(e) {\n\t\tlet { scheduledRestart } = this.state;\n\t\tlet currentMeridiem = scheduledRestart.meridiem;\n\n\t\tlet meridiem = e.target.value;\n\t\tscheduledRestart.meridiem = meridiem;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tscheduledRestart,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.setHour({\n\t\t\t\t\ttarget: {\n\t\t\t\t\t\tvalue: this.state.scheduledRestart.hour,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\n\tgetDisplayHour() {\n\t\tlet { scheduledRestart } = this.state;\n\t\tif (scheduledRestart.meridiem === \"AM\" && scheduledRestart.hour === 0) {\n\t\t\treturn 12;\n\t\t} else if (scheduledRestart.meridiem === \"PM\" && scheduledRestart.hour > 12) {\n\t\t\treturn scheduledRestart.hour - 12;\n\t\t} else {\n\t\t\treturn scheduledRestart.hour;\n\t\t}\n\t}\n\n\t/**\n\t * Add listener on the store. When the preferences field changes, we change our local state.\n\t * Also, get the initial state from the store.\n\t */\n\tcomponentDidMount() {\n\t\tUserPreferencesStore.addListener({ field: \"preferences\" }, this.setPreferences);\n\t\tUserPreferencesStore.getValue({ field: \"preferences\" }, (err, data) => {\n\t\t\tif (data) {\n\t\t\t\tlet scheduledRestart = data[\"finsemble.scheduledRestart\"];\n\t\t\t\tlet enabled = typeof scheduledRestart === \"object\";\n\t\t\t\tif (enabled) {\n\t\t\t\t\tscheduledRestart.meridiem = scheduledRestart.hour > 11 ? \"PM\" : \"AM\";\n\t\t\t\t} else {\n\t\t\t\t\tscheduledRestart = DEFAULT_RESTART;\n\t\t\t\t}\n\t\t\t\tthis.setState({ scheduledRestart, enabled });\n\t\t\t}\n\t\t});\n\t}\n\n\tcomponentWillUnmount() {\n\t\tUserPreferencesStore.removeListener({ field: \"preferences\" }, this.setPreferences);\n\t}\n\n\trender() {\n\t\tconst { scheduledRestart, enabled } = this.state;\n\t\tlet wrapClasses = \"scheduled-restart\";\n\t\tif (!enabled) {\n\t\t\twrapClasses = `${wrapClasses} disabled-restart`;\n\t\t}\n\t\treturn (\n\t\t\t<div className=\"complex-menu-content-row\">\n\t\t\t\t<Checkbox onClick={this.toggleEnabled} checked={this.state.enabled} label=\"Restart daily\" />\n\t\t\t\t<div className={wrapClasses}>\n\t\t\t\t\t<span className=\"scheduled-restart-select-label\">Time:</span>\n\t\t\t\t\t{/* HOURS */}\n\t\t\t\t\t<select disabled={!enabled} onChange={this.setHour} value={this.getDisplayHour()}>\n\t\t\t\t\t\t{HOURS.map((hour, i) => (\n\t\t\t\t\t\t\t<option key={i} value={hour}>\n\t\t\t\t\t\t\t\t{hour}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</select>\n\t\t\t\t\t : \n\t\t\t\t\t{/* MINUTES */}\n\t\t\t\t\t<select disabled={!enabled} value={scheduledRestart.minute} onChange={this.setMinute}>\n\t\t\t\t\t\t{MINUTES.map((minute, i) => (\n\t\t\t\t\t\t\t<option key={i} value={minute}>\n\t\t\t\t\t\t\t\t{minute}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</select>\n\t\t\t\t\t \n\t\t\t\t\t{/* MERIDIEM */}\n\t\t\t\t\t<select disabled={!enabled} onChange={this.setMeridiem} value={scheduledRestart.meridiem}>\n\t\t\t\t\t\t<option value={\"AM\"}>AM</option>\n\t\t\t\t\t\t<option value={\"PM\"}>PM</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/userPreferences/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { UserPreferences } from \"./UserPreferences\";\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/userPreferences/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { UserPreferences } from \"./UserPreferences\";\nexport { General } from \"./UserPreferences\";\nexport { Workspaces } from \"./UserPreferences\";\nexport { DashbarEditor } from \"./UserPreferences\";\nexport { Notifications } from \"./UserPreferences\";\n"]}
|