@finsemble/finsemble-ui 7.0.0 → 7.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (787) hide show
  1. package/package.json +13 -11
  2. package/react/actions/favoriteActions.d.ts +1 -0
  3. package/react/actions/favoriteActions.js +1 -0
  4. package/react/actions/favoriteActions.js.map +1 -1
  5. package/react/actions/menuActions.d.ts +1 -0
  6. package/react/actions/menuActions.js +1 -0
  7. package/react/actions/menuActions.js.map +1 -1
  8. package/react/actions/rootActions.d.ts +1 -0
  9. package/react/actions/rootActions.js +1 -0
  10. package/react/actions/rootActions.js.map +1 -1
  11. package/react/actions/searchActions.d.ts +1 -0
  12. package/react/actions/searchActions.js +1 -0
  13. package/react/actions/searchActions.js.map +1 -1
  14. package/react/actions/toolbarActions.d.ts +34 -0
  15. package/react/actions/toolbarActions.js +17 -0
  16. package/react/actions/toolbarActions.js.map +1 -1
  17. package/react/actions/workspaceActions.d.ts +1 -0
  18. package/react/actions/workspaceActions.js +1 -0
  19. package/react/actions/workspaceActions.js.map +1 -1
  20. package/react/assets/css/advancedAppLauncher.css +22 -19
  21. package/react/assets/css/appCatalog.css +67 -72
  22. package/react/assets/css/authentication.css +4 -3
  23. package/react/assets/css/button.css +3 -10
  24. package/react/assets/css/core/formElements.css +1 -1
  25. package/react/assets/css/core/icons.css +3 -2
  26. package/react/assets/css/core/notifications.css +2 -2
  27. package/react/assets/css/core/windowFrame.css +9 -9
  28. package/react/assets/css/dashbar.css +1 -1
  29. package/react/assets/css/defaultTheme.css +9 -53
  30. package/react/assets/css/dialogs.css +13 -11
  31. package/react/assets/css/favorites.css +3 -1
  32. package/react/assets/css/finsemble.css +3 -2
  33. package/react/assets/css/font-finance.css +233 -120
  34. package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +10 -10
  35. package/react/assets/css/linkerWindow.css +2 -2
  36. package/react/assets/css/menus.css +10 -10
  37. package/react/assets/css/notificationsCenter.css +16 -31
  38. package/react/assets/css/processMonitor.css +7 -4
  39. package/react/assets/css/search.css +1 -1
  40. package/react/assets/css/shared/animations.css +10 -4
  41. package/react/assets/css/shared/common.css +2 -2
  42. package/react/assets/css/tags.css +10 -10
  43. package/react/assets/css/toolbar.css +22 -19
  44. package/react/assets/css/userPreferences.css +12 -14
  45. package/react/assets/css/windowTitleBar.css +75 -36
  46. package/react/componentTemplateGenerator.js +3 -2
  47. package/react/componentTemplateGenerator.js.map +1 -1
  48. package/react/components/FinsembleProvider.d.ts +7 -0
  49. package/react/components/FinsembleProvider.js +2 -0
  50. package/react/components/FinsembleProvider.js.map +1 -1
  51. package/react/components/appCatalog/AppCatalog.d.ts +4 -0
  52. package/react/components/appCatalog/AppCatalog.js +4 -0
  53. package/react/components/appCatalog/AppCatalog.js.map +1 -1
  54. package/react/components/appCatalog/AppCatalogComponent.d.ts +58 -0
  55. package/react/components/appCatalog/AppCatalogComponent.js +70 -1
  56. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  57. package/react/components/appCatalog/components/AppCard.d.ts +35 -0
  58. package/react/components/appCatalog/components/AppCard.js +42 -0
  59. package/react/components/appCatalog/components/AppCard.js.map +1 -1
  60. package/react/components/appCatalog/components/AppResults.d.ts +10 -0
  61. package/react/components/appCatalog/components/AppResults.js +24 -0
  62. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  63. package/react/components/appCatalog/components/Carousel.d.ts +26 -0
  64. package/react/components/appCatalog/components/Carousel.js +34 -0
  65. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  66. package/react/components/appCatalog/components/EmptyResults.d.ts +4 -0
  67. package/react/components/appCatalog/components/EmptyResults.js +8 -0
  68. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  69. package/react/components/appCatalog/components/Hero.d.ts +15 -0
  70. package/react/components/appCatalog/components/Hero.js +15 -0
  71. package/react/components/appCatalog/components/Hero.js.map +1 -1
  72. package/react/components/appCatalog/components/Home.d.ts +6 -4
  73. package/react/components/appCatalog/components/Home.js +10 -0
  74. package/react/components/appCatalog/components/Home.js.map +1 -1
  75. package/react/components/appCatalog/components/SearchBar.d.ts +31 -0
  76. package/react/components/appCatalog/components/SearchBar.js +33 -0
  77. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  78. package/react/components/appCatalog/components/Showcase/AppDescription.d.ts +5 -0
  79. package/react/components/appCatalog/components/Showcase/AppDescription.js +9 -0
  80. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  81. package/react/components/appCatalog/components/Showcase/AppDevNotes.d.ts +7 -0
  82. package/react/components/appCatalog/components/Showcase/AppDevNotes.js +15 -0
  83. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  84. package/react/components/appCatalog/components/Showcase/AppShowcase.d.ts +17 -0
  85. package/react/components/appCatalog/components/Showcase/AppShowcase.js +25 -0
  86. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  87. package/react/components/appCatalog/components/Showcase/Header.d.ts +7 -0
  88. package/react/components/appCatalog/components/Showcase/Header.js +12 -0
  89. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  90. package/react/components/appCatalog/components/Showcase/ImageCarousel.d.ts +7 -0
  91. package/react/components/appCatalog/components/Showcase/ImageCarousel.js +11 -0
  92. package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
  93. package/react/components/appCatalog/components/Showcase/Modal.d.ts +10 -0
  94. package/react/components/appCatalog/components/Showcase/Modal.js +10 -0
  95. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  96. package/react/components/appCatalog/components/Showcase/ReleaseNotes.d.ts +5 -0
  97. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js +9 -0
  98. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
  99. package/react/components/appCatalog/components/Showcase/SupportNotes.d.ts +6 -0
  100. package/react/components/appCatalog/components/Showcase/SupportNotes.js +11 -0
  101. package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
  102. package/react/components/appCatalog/components/Showcase/VersionNotes.d.ts +5 -0
  103. package/react/components/appCatalog/components/Showcase/VersionNotes.js +9 -0
  104. package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
  105. package/react/components/appCatalog/components/Tag.d.ts +6 -0
  106. package/react/components/appCatalog/components/Tag.js +10 -0
  107. package/react/components/appCatalog/components/Tag.js.map +1 -1
  108. package/react/components/appCatalog/components/Toast.d.ts +5 -0
  109. package/react/components/appCatalog/components/Toast.js +9 -0
  110. package/react/components/appCatalog/components/Toast.js.map +1 -1
  111. package/react/components/appCatalog/components/helpers.js +1 -0
  112. package/react/components/appCatalog/components/helpers.js.map +1 -1
  113. package/react/components/appCatalog/modules/AppDirectory.d.ts +5 -0
  114. package/react/components/appCatalog/modules/AppDirectory.js +5 -0
  115. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  116. package/react/components/appCatalog/modules/FDC3.d.ts +37 -0
  117. package/react/components/appCatalog/modules/FDC3.js +40 -0
  118. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  119. package/react/components/appCatalog/stores/appStore.js +1 -0
  120. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  121. package/react/components/appCatalog/stores/storeActions.d.ts +91 -0
  122. package/react/components/appCatalog/stores/storeActions.js +116 -1
  123. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  124. package/react/components/common/Checkbox.d.ts +1 -0
  125. package/react/components/common/Checkbox.js +2 -2
  126. package/react/components/common/Checkbox.js.map +1 -1
  127. package/react/components/common/ColorPicker.d.ts +5 -0
  128. package/react/components/common/ColorPicker.js +40 -0
  129. package/react/components/common/ColorPicker.js.map +1 -1
  130. package/react/components/common/DropZone.d.ts +11 -0
  131. package/react/components/common/DropZone.js +21 -1
  132. package/react/components/common/DropZone.js.map +1 -1
  133. package/react/components/common/DropdownButton.d.ts +4 -0
  134. package/react/components/common/DropdownButton.js +4 -0
  135. package/react/components/common/DropdownButton.js.map +1 -1
  136. package/react/components/common/ErrorBoundary.d.ts +18 -0
  137. package/react/components/common/ErrorBoundary.js +21 -0
  138. package/react/components/common/ErrorBoundary.js.map +1 -1
  139. package/react/components/common/FileInput.d.ts +8 -1
  140. package/react/components/common/FileInput.js +19 -4
  141. package/react/components/common/FileInput.js.map +1 -1
  142. package/react/components/common/FinsembleIcon.d.ts +10 -0
  143. package/react/components/common/FinsembleIcon.js +51 -2
  144. package/react/components/common/FinsembleIcon.js.map +1 -1
  145. package/react/components/common/FinsembleSelect.js +5 -1
  146. package/react/components/common/FinsembleSelect.js.map +1 -1
  147. package/react/components/common/FinsembleToggleButtonBar.js +1 -1
  148. package/react/components/common/FinsembleToggleButtonBar.js.map +1 -1
  149. package/react/components/common/InputTable.d.ts +7 -0
  150. package/react/components/common/InputTable.js +7 -0
  151. package/react/components/common/InputTable.js.map +1 -1
  152. package/react/components/common/Tab.js +3 -0
  153. package/react/components/common/Tab.js.map +1 -1
  154. package/react/components/common/TimeSelect.js +24 -0
  155. package/react/components/common/TimeSelect.js.map +1 -1
  156. package/react/components/common/Tooltip.js +2 -0
  157. package/react/components/common/Tooltip.js.map +1 -1
  158. package/react/components/common/css/accordion.css +9 -6
  159. package/react/components/common/css/application-edit-page.css +39 -44
  160. package/react/components/common/css/button.css +10 -5
  161. package/react/components/common/css/color-picker.css +3 -3
  162. package/react/components/common/css/drop-zone.css +2 -6
  163. package/react/components/common/css/file-input.css +5 -5
  164. package/react/components/common/css/header.css +3 -2
  165. package/react/components/common/css/icon.css +1 -1
  166. package/react/components/common/css/loading-spinner.css +7 -12
  167. package/react/components/common/css/selector.css +4 -4
  168. package/react/components/common/css/styles.css +22 -16
  169. package/react/components/common/css/tab.css +8 -8
  170. package/react/components/common/css/time-select.css +1 -0
  171. package/react/components/common/css/toggle.css +4 -4
  172. package/react/components/common/css/tooltip.css +2 -3
  173. package/react/components/common/file_helpers.js +2 -0
  174. package/react/components/common/file_helpers.js.map +1 -1
  175. package/react/components/common/helpers.js +1 -0
  176. package/react/components/common/helpers.js.map +1 -1
  177. package/react/components/common/stories/ColorPicker.stories.js +3 -0
  178. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  179. package/react/components/common/stories/FileInput.stories.d.ts +3 -1
  180. package/react/components/common/stories/FileInput.stories.js +12 -0
  181. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  182. package/react/components/common/tests/Accordion.spec.js +6 -0
  183. package/react/components/common/tests/Accordion.spec.js.map +1 -1
  184. package/react/components/common/tests/Checkbox.spec.js +1 -0
  185. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  186. package/react/components/common/tests/ColorPicker.spec.js +6 -0
  187. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  188. package/react/components/common/tests/DropZone.spec.js +1 -0
  189. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  190. package/react/components/common/tests/FileInput.spec.js +22 -0
  191. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  192. package/react/components/common/tests/FinsembleSelect.spec.js +1 -0
  193. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  194. package/react/components/common/tests/FinsembleToggle.spec.js +1 -0
  195. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  196. package/react/components/common/tests/FinsembleToggleButtonBar.spec.js +1 -0
  197. package/react/components/common/tests/FinsembleToggleButtonBar.spec.js.map +1 -1
  198. package/react/components/common/tests/TimeSelect.spec.js +4 -0
  199. package/react/components/common/tests/TimeSelect.spec.js.map +1 -1
  200. package/react/components/common/tests/Tooltip.spec.js +16 -0
  201. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  202. package/react/components/favorites/FavoriteMaker.d.ts +8 -0
  203. package/react/components/favorites/FavoriteMaker.js +9 -0
  204. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  205. package/react/components/favorites/FavoritesShell.d.ts +4 -0
  206. package/react/components/favorites/FavoritesShell.js +13 -1
  207. package/react/components/favorites/FavoritesShell.js.map +1 -1
  208. package/react/components/favorites/FavoritesShell.spec.js +3 -0
  209. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  210. package/react/components/fdc3Resolver/ResolverContainer.js +8 -0
  211. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  212. package/react/components/fdc3Resolver/ResolverDialog.css +16 -3
  213. package/react/components/fdc3Resolver/ResolverDialog.js +7 -2
  214. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  215. package/react/components/fdc3Resolver/ResolverDialog.spec.js +3 -2
  216. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  217. package/react/components/fdc3Resolver/ResolverDialog.stories.js +2 -0
  218. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  219. package/react/components/icon/Icon.d.ts +13 -0
  220. package/react/components/icon/Icon.js +34 -0
  221. package/react/components/icon/Icon.js.map +1 -1
  222. package/react/components/legacyControls/FinsembleDialog.d.ts +4 -0
  223. package/react/components/legacyControls/FinsembleDialog.js +15 -0
  224. package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
  225. package/react/components/legacyControls/FinsembleDialogButton.d.ts +3 -0
  226. package/react/components/legacyControls/FinsembleDialogButton.js +6 -1
  227. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  228. package/react/components/legacyControls/FinsembleDialogQuestion.d.ts +7 -0
  229. package/react/components/legacyControls/FinsembleDialogQuestion.js +7 -0
  230. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  231. package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +3 -0
  232. package/react/components/legacyControls/FinsembleDialogTextInput.js +14 -0
  233. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  234. package/react/components/legacyControls/FinsembleDnDContext.d.ts +19 -0
  235. package/react/components/legacyControls/FinsembleDnDContext.js +126 -1
  236. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  237. package/react/components/legacyControls/FinsembleDraggable.d.ts +3 -0
  238. package/react/components/legacyControls/FinsembleDraggable.js +3 -0
  239. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  240. package/react/components/legacyControls/FinsembleHoverDetector.d.ts +15 -0
  241. package/react/components/legacyControls/FinsembleHoverDetector.js +26 -1
  242. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  243. package/react/components/legacyControls/FinsembleMenuSection.d.ts +4 -0
  244. package/react/components/legacyControls/FinsembleMenuSection.js +38 -0
  245. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  246. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js +1 -0
  247. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  248. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +1 -0
  249. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  250. package/react/components/linker/LinkerMenu.d.ts +3 -0
  251. package/react/components/linker/LinkerMenu.js +21 -0
  252. package/react/components/linker/LinkerMenu.js.map +1 -1
  253. package/react/components/linker/LinkerMenuDeprecated.d.ts +3 -0
  254. package/react/components/linker/LinkerMenuDeprecated.js +9 -0
  255. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  256. package/react/components/menu/Menu.d.ts +15 -0
  257. package/react/components/menu/Menu.js +15 -0
  258. package/react/components/menu/Menu.js.map +1 -1
  259. package/react/components/menu/MenuAutoResizer.d.ts +7 -0
  260. package/react/components/menu/MenuAutoResizer.js +27 -0
  261. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  262. package/react/components/menu/MenuContent.d.ts +4 -0
  263. package/react/components/menu/MenuContent.js +4 -0
  264. package/react/components/menu/MenuContent.js.map +1 -1
  265. package/react/components/menu/MenuHotKey.d.ts +14 -0
  266. package/react/components/menu/MenuHotKey.js +15 -0
  267. package/react/components/menu/MenuHotKey.js.map +1 -1
  268. package/react/components/menu/MenuItem.d.ts +8 -0
  269. package/react/components/menu/MenuItem.js +13 -2
  270. package/react/components/menu/MenuItem.js.map +1 -1
  271. package/react/components/menu/MenuPortal.js +112 -2
  272. package/react/components/menu/MenuPortal.js.map +1 -1
  273. package/react/components/menu/MenuShell.d.ts +16 -0
  274. package/react/components/menu/MenuShell.js +26 -0
  275. package/react/components/menu/MenuShell.js.map +1 -1
  276. package/react/components/menu/MenuToggle.d.ts +3 -0
  277. package/react/components/menu/MenuToggle.js +3 -0
  278. package/react/components/menu/MenuToggle.js.map +1 -1
  279. package/react/components/menu/keyboardNavigation.d.ts +12 -0
  280. package/react/components/menu/keyboardNavigation.js +55 -0
  281. package/react/components/menu/keyboardNavigation.js.map +1 -1
  282. package/react/components/menu/menuContext.d.ts +6 -0
  283. package/react/components/menu/menuContext.js +6 -0
  284. package/react/components/menu/menuContext.js.map +1 -1
  285. package/react/components/menu/menuHelpers.d.ts +22 -0
  286. package/react/components/menu/menuHelpers.js +58 -1
  287. package/react/components/menu/menuHelpers.js.map +1 -1
  288. package/react/components/notifications/components/drawer/DrawerControls.js +8 -0
  289. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  290. package/react/components/notifications/components/drawer/DrawerHeader.js +5 -0
  291. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  292. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +18 -0
  293. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  294. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +3 -0
  295. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  296. package/react/components/notifications/components/shared/CheckButton.js +1 -1
  297. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  298. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +9 -0
  299. package/react/components/notifications/components/shared/NotificationCardShell.js +13 -6
  300. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  301. package/react/components/notifications/components/shared/OverflowMenu.d.ts +4 -0
  302. package/react/components/notifications/components/shared/OverflowMenu.js +16 -2
  303. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  304. package/react/components/notifications/components/views/CardView.js +3 -0
  305. package/react/components/notifications/components/views/CardView.js.map +1 -1
  306. package/react/components/notifications/components/views/ListView.js +8 -0
  307. package/react/components/notifications/components/views/ListView.js.map +1 -1
  308. package/react/components/notifications/notificationsContext.d.ts +4 -0
  309. package/react/components/notifications/notificationsContext.js +4 -0
  310. package/react/components/notifications/notificationsContext.js.map +1 -1
  311. package/react/components/notifications/types.d.ts +3 -0
  312. package/react/components/notifications/utils.d.ts +4 -0
  313. package/react/components/notifications/utils.js +4 -0
  314. package/react/components/notifications/utils.js.map +1 -1
  315. package/react/components/processMonitor/ProcessMonitor.d.ts +3 -0
  316. package/react/components/processMonitor/ProcessMonitor.js +17 -2
  317. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  318. package/react/components/processMonitor/components/ChildWindow.d.ts +3 -0
  319. package/react/components/processMonitor/components/ChildWindow.js +5 -0
  320. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  321. package/react/components/processMonitor/components/ListHeader.d.ts +5 -0
  322. package/react/components/processMonitor/components/ListHeader.js +7 -0
  323. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  324. package/react/components/processMonitor/components/ProcessStatistics.js +12 -1
  325. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  326. package/react/components/processMonitor/constants.js +6 -0
  327. package/react/components/processMonitor/constants.js.map +1 -1
  328. package/react/components/processMonitor/helpers.d.ts +13 -0
  329. package/react/components/processMonitor/helpers.js +23 -3
  330. package/react/components/processMonitor/helpers.js.map +1 -1
  331. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +39 -0
  332. package/react/components/processMonitor/stores/ProcessMonitorStore.js +50 -0
  333. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  334. package/react/components/quickComponentForm/QuickComponentForm.d.ts +3 -0
  335. package/react/components/quickComponentForm/QuickComponentForm.js +20 -0
  336. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  337. package/react/components/quickComponentForm/quickComponent.css +1 -1
  338. package/react/components/sdd/AddApp.d.ts +4 -2
  339. package/react/components/sdd/AddApp.js +57 -49
  340. package/react/components/sdd/AddApp.js.map +1 -1
  341. package/react/components/sdd/AppEditAccess.js +8 -0
  342. package/react/components/sdd/AppEditAccess.js.map +1 -1
  343. package/react/components/sdd/AppEditPage.d.ts +2 -1
  344. package/react/components/sdd/AppEditPage.js +148 -361
  345. package/react/components/sdd/AppEditPage.js.map +1 -1
  346. package/react/components/sdd/Appearance.css +1 -1
  347. package/react/components/sdd/Appearance.js +3 -0
  348. package/react/components/sdd/Appearance.js.map +1 -1
  349. package/react/components/sdd/Application.js +39 -7
  350. package/react/components/sdd/Application.js.map +1 -1
  351. package/react/components/sdd/Applications.js +89 -13
  352. package/react/components/sdd/Applications.js.map +1 -1
  353. package/react/components/sdd/AssetsPage.css +3 -3
  354. package/react/components/sdd/EditPreload.js +10 -0
  355. package/react/components/sdd/EditPreload.js.map +1 -1
  356. package/react/components/sdd/ExportCloud.js +4 -0
  357. package/react/components/sdd/ExportCloud.js.map +1 -1
  358. package/react/components/sdd/Publish.js +2 -0
  359. package/react/components/sdd/Publish.js.map +1 -1
  360. package/react/components/sdd/PublishProgress.js +11 -1
  361. package/react/components/sdd/PublishProgress.js.map +1 -1
  362. package/react/components/sdd/SmartDesktopDesigner.js +17 -0
  363. package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
  364. package/react/components/sdd/ThemePage.css +6 -23
  365. package/react/components/sdd/ThemePage.js +1 -1
  366. package/react/components/sdd/ThemePage.js.map +1 -1
  367. package/react/components/sdd/Themes.js +2 -0
  368. package/react/components/sdd/Themes.js.map +1 -1
  369. package/react/components/sdd/Toolbar.js +7 -0
  370. package/react/components/sdd/Toolbar.js.map +1 -1
  371. package/react/components/sdd/appEditPage/Behavior.d.ts +34 -0
  372. package/react/components/sdd/appEditPage/Behavior.js +134 -0
  373. package/react/components/sdd/appEditPage/Behavior.js.map +1 -0
  374. package/react/components/sdd/appEditPage/Component.d.ts +22 -0
  375. package/react/components/sdd/appEditPage/Component.js +76 -0
  376. package/react/components/sdd/appEditPage/Component.js.map +1 -0
  377. package/react/components/sdd/appEditPage/DebugToolkit.d.ts +9 -0
  378. package/react/components/sdd/appEditPage/DebugToolkit.js +20 -0
  379. package/react/components/sdd/appEditPage/DebugToolkit.js.map +1 -0
  380. package/react/components/sdd/appEditPage/Interop.d.ts +10 -0
  381. package/react/components/sdd/appEditPage/Interop.js +40 -0
  382. package/react/components/sdd/appEditPage/Interop.js.map +1 -0
  383. package/react/components/sdd/appEditPage/Position.d.ts +18 -0
  384. package/react/components/sdd/appEditPage/Position.js +72 -0
  385. package/react/components/sdd/appEditPage/Position.js.map +1 -0
  386. package/react/components/sdd/appEditPage/Preloads.d.ts +9 -0
  387. package/react/components/sdd/appEditPage/Preloads.js +16 -0
  388. package/react/components/sdd/appEditPage/Preloads.js.map +1 -0
  389. package/react/components/sdd/appEditPage/SelectConnect.d.ts +15 -0
  390. package/react/components/sdd/appEditPage/SelectConnect.js +28 -0
  391. package/react/components/sdd/appEditPage/SelectConnect.js.map +1 -0
  392. package/react/components/sdd/appEditPage/Workspace.d.ts +12 -0
  393. package/react/components/sdd/appEditPage/Workspace.js +30 -0
  394. package/react/components/sdd/appEditPage/Workspace.js.map +1 -0
  395. package/react/components/sdd/common/getCSSVars.js +7 -2
  396. package/react/components/sdd/common/getCSSVars.js.map +1 -1
  397. package/react/components/sdd/common/setPreloadDefaults.js +4 -0
  398. package/react/components/sdd/common/setPreloadDefaults.js.map +1 -1
  399. package/react/components/sdd/css/addApp.css +18 -5
  400. package/react/components/sdd/css/appearance.css +6 -0
  401. package/react/components/sdd/css/applications.css +27 -14
  402. package/react/components/sdd/css/authentication.css +7 -6
  403. package/react/components/sdd/css/buttons.css +1 -1
  404. package/react/components/sdd/css/export.css +5 -3
  405. package/react/components/sdd/css/getting-started.css +2 -2
  406. package/react/components/sdd/css/nav.css +8 -11
  407. package/react/components/sdd/css/project-header.css +5 -7
  408. package/react/components/sdd/css/styles.css +29 -23
  409. package/react/components/sdd/css/views.css +4 -3
  410. package/react/components/sdd/fixtures/apps.js +12 -0
  411. package/react/components/sdd/fixtures/apps.js.map +1 -1
  412. package/react/components/sdd/fixtures/configTemplate.js +1 -0
  413. package/react/components/sdd/fixtures/configTemplate.js.map +1 -1
  414. package/react/components/sdd/fixtures/publishProgress.js +40 -0
  415. package/react/components/sdd/fixtures/publishProgress.js.map +1 -1
  416. package/react/components/sdd/sdd_helpers.d.ts +6 -0
  417. package/react/components/sdd/sdd_helpers.js +6 -0
  418. package/react/components/sdd/sdd_helpers.js.map +1 -1
  419. package/react/components/sdd/smartDesktopClient.d.ts +303 -0
  420. package/react/components/sdd/smartDesktopClient.js +334 -1
  421. package/react/components/sdd/smartDesktopClient.js.map +1 -1
  422. package/react/components/sdd/smartDesktopClient.spec.js +5 -2
  423. package/react/components/sdd/smartDesktopClient.spec.js.map +1 -1
  424. package/react/components/sdd/stories/AddApp.stories.d.ts +2 -1
  425. package/react/components/sdd/stories/AddApp.stories.js +8 -0
  426. package/react/components/sdd/stories/AddApp.stories.js.map +1 -1
  427. package/react/components/sdd/stories/AppEditPage.stories.d.ts +3 -1
  428. package/react/components/sdd/stories/AppEditPage.stories.js +3 -0
  429. package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -1
  430. package/react/components/sdd/stories/Appearance.stories.js +1 -0
  431. package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
  432. package/react/components/sdd/tests/AddApp.spec.js +40 -3
  433. package/react/components/sdd/tests/AddApp.spec.js.map +1 -1
  434. package/react/components/sdd/tests/AppEditPage.spec.js +16 -0
  435. package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
  436. package/react/components/sdd/tests/Application.spec.js +33 -438
  437. package/react/components/sdd/tests/Application.spec.js.map +1 -1
  438. package/react/components/sdd/tests/Applications.spec.d.ts +1 -1
  439. package/react/components/sdd/tests/Applications.spec.js +29 -5
  440. package/react/components/sdd/tests/Applications.spec.js.map +1 -1
  441. package/react/components/sdd/tests/Authentication.spec.js +7 -0
  442. package/react/components/sdd/tests/Authentication.spec.js.map +1 -1
  443. package/react/components/sdd/tests/ContentHeader.spec.js +2 -0
  444. package/react/components/sdd/tests/ContentHeader.spec.js.map +1 -1
  445. package/react/components/sdd/tests/EditPreload.spec.js +13 -0
  446. package/react/components/sdd/tests/EditPreload.spec.js.map +1 -1
  447. package/react/components/sdd/tests/Export.spec.js +2 -1
  448. package/react/components/sdd/tests/Export.spec.js.map +1 -1
  449. package/react/components/sdd/tests/ItemList.spec.js +4 -0
  450. package/react/components/sdd/tests/ItemList.spec.js.map +1 -1
  451. package/react/components/sdd/tests/OptionalSettingsView.spec.js +29 -0
  452. package/react/components/sdd/tests/OptionalSettingsView.spec.js.map +1 -1
  453. package/react/components/sdd/tests/ProjectErrors.spec.js +2 -0
  454. package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -1
  455. package/react/components/sdd/tests/Themes.spec.js +1 -1
  456. package/react/components/sdd/tests/Themes.spec.js.map +1 -1
  457. package/react/components/sdd/tests/Toolbar.spec.js +53 -0
  458. package/react/components/sdd/tests/Toolbar.spec.js.map +1 -1
  459. package/react/components/sdd/tests/a11y_helper.js +8 -0
  460. package/react/components/sdd/tests/a11y_helper.js.map +1 -1
  461. package/react/components/search/Highlight.d.ts +6 -0
  462. package/react/components/search/Highlight.js +19 -0
  463. package/react/components/search/Highlight.js.map +1 -1
  464. package/react/components/search/SearchBestMatch.d.ts +4 -0
  465. package/react/components/search/SearchBestMatch.js +11 -0
  466. package/react/components/search/SearchBestMatch.js.map +1 -1
  467. package/react/components/search/SearchInput.d.ts +5 -0
  468. package/react/components/search/SearchInput.js +6 -0
  469. package/react/components/search/SearchInput.js.map +1 -1
  470. package/react/components/search/SearchProviderResults.js +2 -0
  471. package/react/components/search/SearchProviderResults.js.map +1 -1
  472. package/react/components/search/SearchResult.js +6 -0
  473. package/react/components/search/SearchResult.js.map +1 -1
  474. package/react/components/search/SearchResult.spec.js +7 -0
  475. package/react/components/search/SearchResult.spec.js.map +1 -1
  476. package/react/components/search/SearchResult.stories.js +4 -0
  477. package/react/components/search/SearchResult.stories.js.map +1 -1
  478. package/react/components/search/SearchResults.js +5 -1
  479. package/react/components/search/SearchResults.js.map +1 -1
  480. package/react/components/search/SearchResults.spec.js +7 -0
  481. package/react/components/search/SearchResults.spec.js.map +1 -1
  482. package/react/components/shared/Animate.d.ts +5 -0
  483. package/react/components/shared/Animate.js +12 -1
  484. package/react/components/shared/Animate.js.map +1 -1
  485. package/react/components/shared/DefaultDropdownButton.js +9 -0
  486. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  487. package/react/components/shared/Tag.d.ts +0 -4
  488. package/react/components/shared/Tag.js +4 -0
  489. package/react/components/shared/Tag.js.map +1 -1
  490. package/react/components/shared/TagsMenu.d.ts +6 -0
  491. package/react/components/shared/TagsMenu.js +7 -0
  492. package/react/components/shared/TagsMenu.js.map +1 -1
  493. package/react/components/shared/addProtocolToValidURL.d.ts +6 -0
  494. package/react/components/shared/addProtocolToValidURL.js +6 -0
  495. package/react/components/shared/addProtocolToValidURL.js.map +1 -1
  496. package/react/components/shared/openQuitConfirmationDialog.d.ts +1 -1
  497. package/react/components/shared/openQuitConfirmationDialog.js +4 -4
  498. package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
  499. package/react/components/shared/tests/addProtocolToValidURL.spec.js +1 -0
  500. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
  501. package/react/components/shared/validateURL.d.ts +18 -0
  502. package/react/components/shared/validateURL.js +24 -5
  503. package/react/components/shared/validateURL.js.map +1 -1
  504. package/react/components/singleInputDialog/SingleInputDialog.css +1 -1
  505. package/react/components/singleInputDialog/SingleInputDialog.d.ts +3 -0
  506. package/react/components/singleInputDialog/SingleInputDialog.js +44 -0
  507. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  508. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +6 -0
  509. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  510. package/react/components/system/System.d.ts +22 -0
  511. package/react/components/system/System.js +23 -1
  512. package/react/components/system/System.js.map +1 -1
  513. package/react/components/system/System.stories.js +1 -0
  514. package/react/components/system/System.stories.js.map +1 -1
  515. package/react/components/system/SystemTrayComponentShell.d.ts +6 -0
  516. package/react/components/system/SystemTrayComponentShell.js +9 -0
  517. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  518. package/react/components/toolbar/AutoArrange.d.ts +5 -0
  519. package/react/components/toolbar/AutoArrange.js +8 -1
  520. package/react/components/toolbar/AutoArrange.js.map +1 -1
  521. package/react/components/toolbar/AutoArrange.spec.js +1 -0
  522. package/react/components/toolbar/AutoArrange.spec.js.map +1 -1
  523. package/react/components/toolbar/AutoArrange.stories.js +1 -0
  524. package/react/components/toolbar/AutoArrange.stories.js.map +1 -1
  525. package/react/components/toolbar/DragHandle.d.ts +4 -0
  526. package/react/components/toolbar/DragHandle.js +11 -0
  527. package/react/components/toolbar/DragHandle.js.map +1 -1
  528. package/react/components/toolbar/DragHandle.spec.js +1 -0
  529. package/react/components/toolbar/DragHandle.spec.js.map +1 -1
  530. package/react/components/toolbar/DragHandle.stories.js +1 -0
  531. package/react/components/toolbar/DragHandle.stories.js.map +1 -1
  532. package/react/components/toolbar/MinimizeAll.d.ts +4 -0
  533. package/react/components/toolbar/MinimizeAll.js +7 -1
  534. package/react/components/toolbar/MinimizeAll.js.map +1 -1
  535. package/react/components/toolbar/MinimizeAll.spec.js +1 -0
  536. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  537. package/react/components/toolbar/MinimizeAll.stories.js +1 -0
  538. package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
  539. package/react/components/toolbar/NotificationControl.d.ts +5 -0
  540. package/react/components/toolbar/NotificationControl.js +8 -1
  541. package/react/components/toolbar/NotificationControl.js.map +1 -1
  542. package/react/components/toolbar/RevealAll.d.ts +4 -0
  543. package/react/components/toolbar/RevealAll.js +7 -1
  544. package/react/components/toolbar/RevealAll.js.map +1 -1
  545. package/react/components/toolbar/RevealAll.spec.js +1 -0
  546. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  547. package/react/components/toolbar/RevealAll.stories.js +1 -0
  548. package/react/components/toolbar/RevealAll.stories.js.map +1 -1
  549. package/react/components/toolbar/SddButton.d.ts +4 -0
  550. package/react/components/toolbar/SddButton.js +4 -0
  551. package/react/components/toolbar/SddButton.js.map +1 -1
  552. package/react/components/toolbar/ToolbarIcon.d.ts +4 -0
  553. package/react/components/toolbar/ToolbarIcon.js +4 -0
  554. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  555. package/react/components/toolbar/ToolbarSection.d.ts +7 -0
  556. package/react/components/toolbar/ToolbarSection.js +19 -1
  557. package/react/components/toolbar/ToolbarSection.js.map +1 -1
  558. package/react/components/toolbar/ToolbarShell.d.ts +5 -0
  559. package/react/components/toolbar/ToolbarShell.js +7 -0
  560. package/react/components/toolbar/ToolbarShell.js.map +1 -1
  561. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +16 -0
  562. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js +20 -0
  563. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  564. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.d.ts +52 -0
  565. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js +58 -0
  566. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  567. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.d.ts +5 -0
  568. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js +5 -0
  569. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  570. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.d.ts +27 -0
  571. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js +49 -0
  572. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  573. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +13 -0
  574. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js +14 -0
  575. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  576. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +5 -0
  577. package/react/components/toolbar/advancedAppLauncher/components/Content.js +19 -0
  578. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  579. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.d.ts +4 -0
  580. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js +4 -0
  581. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  582. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +16 -0
  583. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +39 -0
  584. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  585. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.d.ts +4 -0
  586. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js +9 -0
  587. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  588. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js +3 -0
  589. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  590. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.d.ts +6 -0
  591. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js +7 -0
  592. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  593. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.d.ts +5 -0
  594. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js +5 -0
  595. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
  596. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.d.ts +5 -0
  597. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js +5 -0
  598. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  599. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.d.ts +37 -0
  600. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js +40 -0
  601. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  602. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.d.ts +3 -0
  603. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +82 -0
  604. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  605. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.d.ts +10 -0
  606. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js +11 -0
  607. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  608. package/react/components/toolbar/appLauncher/AppLauncherMenu.d.ts +18 -0
  609. package/react/components/toolbar/appLauncher/AppLauncherMenu.js +20 -0
  610. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  611. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +9 -0
  612. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js +12 -0
  613. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  614. package/react/components/toolbar/appLauncher/appLauncher.css +1 -1
  615. package/react/components/toolbar/appLauncher/components/componentList.d.ts +3 -0
  616. package/react/components/toolbar/appLauncher/components/componentList.js +17 -3
  617. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  618. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +6 -0
  619. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +26 -0
  620. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  621. package/react/components/toolbar/dashbar/Dashbar.js +70 -3
  622. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  623. package/react/components/toolbar/dashbar/DashbarItem.js +5 -0
  624. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  625. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +7 -0
  626. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js +7 -0
  627. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  628. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +16 -0
  629. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +20 -0
  630. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  631. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.d.ts +26 -0
  632. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js +29 -0
  633. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  634. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +5 -0
  635. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js +6 -0
  636. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  637. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +76 -0
  638. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +140 -1
  639. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  640. package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +8 -18
  641. package/react/components/userPreferences/NotificationsPreferencesContext.d.ts +4 -0
  642. package/react/components/userPreferences/NotificationsPreferencesContext.js +4 -0
  643. package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
  644. package/react/components/userPreferences/UserPreferenceTypes.d.ts +3 -0
  645. package/react/components/userPreferences/UserPreferences.d.ts +8 -0
  646. package/react/components/userPreferences/UserPreferences.js +8 -0
  647. package/react/components/userPreferences/UserPreferences.js.map +1 -1
  648. package/react/components/userPreferences/UserPreferencesBase.js +4 -0
  649. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  650. package/react/components/userPreferences/components/ContentSection.d.ts +5 -0
  651. package/react/components/userPreferences/components/LeftNav.d.ts +4 -0
  652. package/react/components/userPreferences/components/content/DashbarEditor.js +3 -0
  653. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  654. package/react/components/userPreferences/components/content/Notifications.js +3 -0
  655. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  656. package/react/components/userPreferences/components/content/Workspaces.d.ts +12 -0
  657. package/react/components/userPreferences/components/content/Workspaces.js +33 -1
  658. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  659. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +3 -0
  660. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  661. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +3 -0
  662. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  663. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +3 -0
  664. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  665. package/react/components/userPreferences/components/general/ScheduledClose.js +11 -0
  666. package/react/components/userPreferences/components/general/ScheduledClose.js.map +1 -1
  667. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +3 -0
  668. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  669. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +17 -0
  670. package/react/components/userPreferences/stores/UserPreferencesStore.js +27 -0
  671. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  672. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +1 -0
  673. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  674. package/react/components/userPreferences/tests/Workspace.spec.js +20 -0
  675. package/react/components/userPreferences/tests/Workspace.spec.js.map +1 -1
  676. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +124 -0
  677. package/react/components/windowTitleBar/WindowTitleBarShell.js +284 -35
  678. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  679. package/react/components/windowTitleBar/components/center/Tab.d.ts +3 -0
  680. package/react/components/windowTitleBar/components/center/Tab.js +3 -0
  681. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  682. package/react/components/windowTitleBar/components/center/TabList.d.ts +90 -0
  683. package/react/components/windowTitleBar/components/center/TabList.js +170 -4
  684. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  685. package/react/components/windowTitleBar/components/left/LinkerButton.d.ts +9 -1
  686. package/react/components/windowTitleBar/components/left/LinkerButton.js +25 -9
  687. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  688. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +47 -0
  689. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js +76 -1
  690. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
  691. package/react/components/windowTitleBar/components/left/LinkerGroups.d.ts +4 -0
  692. package/react/components/windowTitleBar/components/left/LinkerGroups.js +5 -0
  693. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  694. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts +18 -0
  695. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js +49 -0
  696. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
  697. package/react/components/windowTitleBar/components/left/ShareButton.d.ts +17 -0
  698. package/react/components/windowTitleBar/components/left/ShareButton.js +39 -0
  699. package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
  700. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js +4 -0
  701. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
  702. package/react/components/windowTitleBar/components/right/CloseButton.d.ts +27 -0
  703. package/react/components/windowTitleBar/components/right/CloseButton.js +27 -0
  704. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  705. package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +37 -0
  706. package/react/components/windowTitleBar/components/right/GroupingButton.js +40 -0
  707. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  708. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +46 -0
  709. package/react/components/windowTitleBar/components/right/MaximizeButton.js +54 -0
  710. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  711. package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +26 -0
  712. package/react/components/windowTitleBar/components/right/MinimizeButton.js +26 -0
  713. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  714. package/react/components/windowTitleBar/components/windowTitle.d.ts +40 -0
  715. package/react/components/windowTitleBar/components/windowTitle.js +172 -10
  716. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  717. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +5 -0
  718. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +72 -1
  719. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  720. package/react/components/yesNoDialog/YesNoDialog.css +1 -1
  721. package/react/components/yesNoDialog/YesNoDialog.d.ts +3 -0
  722. package/react/components/yesNoDialog/YesNoDialog.js +63 -0
  723. package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
  724. package/react/components/yesNoDialog/YesNoDialog.spec.js +4 -0
  725. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  726. package/react/components/yesNoDialog/timer.js +2 -0
  727. package/react/components/yesNoDialog/timer.js.map +1 -1
  728. package/react/enzymeSetup.js +5 -0
  729. package/react/enzymeSetup.js.map +1 -1
  730. package/react/hooks/useDashbar.js +10 -0
  731. package/react/hooks/useDashbar.js.map +1 -1
  732. package/react/hooks/useDeepEffect.d.ts +4 -0
  733. package/react/hooks/useDeepEffect.js +21 -0
  734. package/react/hooks/useDeepEffect.js.map +1 -1
  735. package/react/hooks/useFavorites.d.ts +15 -0
  736. package/react/hooks/useFavorites.js +3 -0
  737. package/react/hooks/useFavorites.js.map +1 -1
  738. package/react/hooks/useFavoritesShell.d.ts +4 -0
  739. package/react/hooks/useFavoritesShell.js +23 -0
  740. package/react/hooks/useFavoritesShell.js.map +1 -1
  741. package/react/hooks/useHotkey.d.ts +6 -0
  742. package/react/hooks/useHotkey.js +9 -0
  743. package/react/hooks/useHotkey.js.map +1 -1
  744. package/react/hooks/useLinker.js +14 -0
  745. package/react/hooks/useLinker.js.map +1 -1
  746. package/react/hooks/useMenu.d.ts +29 -0
  747. package/react/hooks/useMenu.js +12 -1
  748. package/react/hooks/useMenu.js.map +1 -1
  749. package/react/hooks/useNotifications.d.ts +44 -0
  750. package/react/hooks/useNotifications.js +90 -0
  751. package/react/hooks/useNotifications.js.map +1 -1
  752. package/react/hooks/useOutsideClickDetector.d.ts +3 -0
  753. package/react/hooks/useOutsideClickDetector.js +3 -0
  754. package/react/hooks/useOutsideClickDetector.js.map +1 -1
  755. package/react/hooks/usePubSub.d.ts +17 -0
  756. package/react/hooks/usePubSub.js +18 -0
  757. package/react/hooks/usePubSub.js.map +1 -1
  758. package/react/hooks/useSearch.d.ts +5 -0
  759. package/react/hooks/useSearch.js +30 -0
  760. package/react/hooks/useSearch.js.map +1 -1
  761. package/react/hooks/useToolbar.js +52 -0
  762. package/react/hooks/useToolbar.js.map +1 -1
  763. package/react/reducers/favoriteReducer.d.ts +3 -0
  764. package/react/reducers/linkerReducer.d.ts +3 -0
  765. package/react/reducers/linkerReducer.js +4 -0
  766. package/react/reducers/linkerReducer.js.map +1 -1
  767. package/react/reducers/menuReducer.d.ts +28 -0
  768. package/react/reducers/menuReducer.js +34 -0
  769. package/react/reducers/menuReducer.js.map +1 -1
  770. package/react/reducers/rootReducer.js +3 -0
  771. package/react/reducers/rootReducer.js.map +1 -1
  772. package/react/reducers/searchReducer.d.ts +7 -0
  773. package/react/reducers/searchReducer.js +6 -0
  774. package/react/reducers/searchReducer.js.map +1 -1
  775. package/react/reducers/workspaceReducer.js +1 -0
  776. package/react/reducers/workspaceReducer.js.map +1 -1
  777. package/react/store.d.ts +4 -0
  778. package/react/store.js +11 -0
  779. package/react/store.js.map +1 -1
  780. package/react/tsconfig.tsbuildinfo +1 -1
  781. package/react/types/fdc3.d.ts +2 -0
  782. package/react/types/linkerTypes.d.ts +13 -0
  783. package/react/types/linkerTypes.js +1 -0
  784. package/react/types/linkerTypes.js.map +1 -1
  785. package/react/types/smartDesktopDesignerTypes.d.ts +5 -0
  786. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  787. package/react/types/workspaceTypes.d.ts +8 -0
@@ -1,5 +1,11 @@
1
+ /*!
2
+ * Copyright 2017 by ChartIQ, Inc.
3
+ * All rights reserved.
4
+ * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html
5
+ */
1
6
  import async from "async";
2
7
  import { Util } from "@finsemble/finsemble-api";
8
+ // When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.
3
9
  const SAVE_DIALOG_CANCEL_ERROR = "Cancel";
4
10
  const NEGATIVE = "Negative";
5
11
  let PROMPT_ON_DIRTY_WORKSPACE = false;
@@ -7,22 +13,32 @@ let DISCARD_UNSAVED_CHANGES = false;
7
13
  const WORKSPACE_CONFIGS = {
8
14
  PROMPT_USER_ON_DIRTY_WORKSPACE: "finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace",
9
15
  DISCARD_UNSAVED_CHANGES: "finsemble.servicesConfig.workspace.discardUnsavedChanges",
10
- DEPRECATED_PROMPT_ON_DIRTY: "finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace",
16
+ DEPRECATED_PROMPT_ON_DIRTY: "finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace", // DEPRECATED - retrieving it for backwards compatibility
11
17
  };
12
18
  let WorkspaceManagementStore;
13
19
  let StoreClient;
14
20
  let Logger;
15
21
  let WorkspaceManagementGlobalStore;
22
+ // Initial data for the store.
16
23
  const defaultData = {
17
24
  activeWorkspace: {},
18
25
  menuWidth: 285,
19
26
  WorkspaceList: [],
20
27
  newWorkspaceDialogIsActive: false,
28
+ /**
29
+ * State around whether the workspace is currently in the process of switching.
30
+ *
31
+ * For simplicity, we're storing this in the local store for now, but this precludes
32
+ * other components from signaling that the workspace is changing. A consequence,
33
+ * for example, is that if you switch workspaces uses a pin on the toolbar instead
34
+ * of the workspace management menu, the spinner doesn't show up.
35
+ */
21
36
  isSwitchingWorkspaces: false,
22
37
  isPromptingUser: false,
23
38
  };
24
39
  function addListeners(done) {
25
40
  FSBL.Clients.RouterClient.addListener("Application.restart", (err, response) => {
41
+ // when the user calls a "Reset" function, Finsemble shouldn't show a save workspace dialog.
26
42
  if (response.data && response.data.forceRestart === true)
27
43
  PROMPT_ON_DIRTY_WORKSPACE = false;
28
44
  });
@@ -67,6 +83,7 @@ const Actions = {
67
83
  Logger.system.log("WorkspaceManagementStore new discardUnsavedChanges config", config);
68
84
  DISCARD_UNSAVED_CHANGES = !!config.value;
69
85
  });
86
+ // Gets the workspace list and sets the value in the store.
70
87
  FSBL.Clients.WorkspaceClient.getWorkspaces((err, workspaces) => {
71
88
  Logger.system.debug("WorkspaceManagementStore init getWorkspaces", workspaces);
72
89
  WorkspaceManagementStore.setValue({
@@ -74,6 +91,7 @@ const Actions = {
74
91
  value: workspaces,
75
92
  });
76
93
  });
94
+ // Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.
77
95
  FSBL.Clients.WorkspaceClient.getActiveWorkspace((err, activeWorkspace) => {
78
96
  Logger.system.debug("WorkspaceManagementStore init getActiveWorkspace", activeWorkspace);
79
97
  WorkspaceManagementStore.setValue({
@@ -81,6 +99,12 @@ const Actions = {
81
99
  value: activeWorkspace,
82
100
  });
83
101
  });
102
+ /**
103
+ * We listen here for any workspace updates, and pass them to the store.
104
+ * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,
105
+ * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for
106
+ * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.
107
+ */
84
108
  FSBL.Clients.RouterClient.subscribe("Finsemble.WorkspaceService.update", (err, response) => {
85
109
  if (response.data && response.data.activeWorkspace) {
86
110
  Logger.system.debug("WorkspaceManagementStore init update", response.data);
@@ -116,12 +140,19 @@ const Actions = {
116
140
  Actions.renameWorkspace(action.data);
117
141
  break;
118
142
  default:
143
+ // Nothing to do here
119
144
  break;
120
145
  }
121
146
  });
122
147
  });
123
148
  },
149
+ /*********************************************************************************************
150
+ *
151
+ * GETTERS/SETTERS
152
+ *
153
+ *********************************************************************************************/
124
154
  getActiveWorkspace: () => WorkspaceManagementStore.getValue("activeWorkspace"),
155
+ // Get the name of the workspace that is currently being edited
125
156
  getWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue("workspaceBeingEdited"),
126
157
  getWorkspaceList: () => WorkspaceManagementStore.getValue("WorkspaceList"),
127
158
  getIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue("isSwitchingWorkspaces"),
@@ -134,10 +165,20 @@ const Actions = {
134
165
  field: "isPromptingUser",
135
166
  value: val,
136
167
  }),
168
+ /*********************************************************************************************
169
+ *
170
+ * Main Workspace Actions
171
+ *
172
+ *********************************************************************************************/
173
+ /**
174
+ * Handles the complete workflow for creating a new workspace.
175
+ * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.
176
+ */
137
177
  newWorkspace: function () {
138
178
  let newWorkspaceName;
139
179
  Logger.system.log("New workspace - start.");
140
180
  const newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue("newWorkspaceDialogIsActive");
181
+ // Creates the new workspace.
141
182
  const createIt = (params, cb) => {
142
183
  Logger.system.log("createIt", params);
143
184
  const { workspaceName } = params;
@@ -169,6 +210,12 @@ const Actions = {
169
210
  }
170
211
  async.waterfall(tasks, Actions.onAsyncComplete);
171
212
  },
213
+ /**
214
+ * Handles the workflow for removing a workspace.
215
+ * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,
216
+ * and if the user says "yes", it will delete the workspace.
217
+ */
218
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
172
219
  removeWorkspace: (data, cb = (val) => { }) => {
173
220
  const workspaceName = data.name;
174
221
  const dialogParams = {
@@ -178,6 +225,9 @@ const Actions = {
178
225
  affirmativeResponseLabel: "Delete",
179
226
  hideModalOnClose: data.hideModalOnClose,
180
227
  };
228
+ /**
229
+ * Invoked when the user interacts with the dialog.
230
+ */
181
231
  function onUserInput(err, response) {
182
232
  if (response.choice === "affirmative") {
183
233
  cb(true);
@@ -191,6 +241,9 @@ const Actions = {
191
241
  }
192
242
  Actions.spawnDialog("yesNo", dialogParams, onUserInput);
193
243
  },
244
+ /**
245
+ * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.
246
+ */
194
247
  saveWorkspace: (cb) => {
195
248
  const activeWorkspace = WorkspaceManagementStore.getValue("activeWorkspace");
196
249
  FSBL.Clients.WorkspaceClient.saveAs({
@@ -221,6 +274,8 @@ const Actions = {
221
274
  });
222
275
  },
223
276
  renameWorkspace: ({ oldName, newName }) => {
277
+ // Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing
278
+ // workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.
224
279
  FSBL.Clients.WorkspaceClient.rename({
225
280
  oldName: oldName,
226
281
  newName: newName,
@@ -237,6 +292,9 @@ const Actions = {
237
292
  top: "center",
238
293
  });
239
294
  },
295
+ /**
296
+ * Ask the user for a name, make sure it doesn't already exist, then save.
297
+ */
240
298
  saveWorkspaceAs: () => {
241
299
  function saveIt(workspaceName, callback) {
242
300
  FSBL.Clients.WorkspaceClient.saveAs({
@@ -256,8 +314,13 @@ const Actions = {
256
314
  saveIt,
257
315
  ], Actions.onAsyncComplete);
258
316
  },
317
+ /**
318
+ * Asks the user if they'd like to save their data, then loads the requested workspace.
319
+ */
259
320
  switchToWorkspace: async function ({ name }) {
260
321
  var _a;
322
+ // if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);
323
+ // note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)
261
324
  const prompting = Actions.getIsPromptingUser();
262
325
  Logger.system.log("workspaceManagementMenuStore: switchToWorkspace", prompting ? "prompting" : "not-prompting");
263
326
  if (prompting)
@@ -265,6 +328,10 @@ const Actions = {
265
328
  Actions.setIsSwitchingWorkspaces(true);
266
329
  Actions.blurWindow();
267
330
  const activeWorkspace = WorkspaceManagementStore.getValue("activeWorkspace");
331
+ /**
332
+ * Actually perform the switch. Happens after we ask the user what they want.
333
+ *
334
+ */
268
335
  const switchWorkspace = (callback = () => { }) => {
269
336
  FSBL.Clients.WorkspaceClient.switchTo({
270
337
  name: name,
@@ -273,6 +340,9 @@ const Actions = {
273
340
  callback();
274
341
  });
275
342
  };
343
+ /**
344
+ * Make sure the user is sure
345
+ */
276
346
  const askAboutReload = (callback) => {
277
347
  Actions.spawnDialog("yesNo", {
278
348
  monitor: "primary",
@@ -282,15 +352,21 @@ const Actions = {
282
352
  negativeResponseLabel: "Don't Save",
283
353
  }, callback);
284
354
  };
355
+ /**
356
+ * If the workspace is dirty, we need to do more than if it's clean.
357
+ */
285
358
  if (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {
286
359
  let tasks = [];
287
360
  Actions.setIsPromptingUser(true);
288
361
  let firstMethod = Actions.autoSave, secondMethod = null;
289
362
  if (PROMPT_ON_DIRTY_WORKSPACE === true) {
363
+ // We want to ask the user to save. But if they're trying to reload the workspace,
364
+ // the message needs to be different. The first if block just switches that method.
290
365
  firstMethod = Actions.askIfUserWantsToSave;
291
366
  if (name === ((_a = FSBL.Clients.WorkspaceClient.activeWorkspace) === null || _a === void 0 ? void 0 : _a.name)) {
292
367
  firstMethod = askAboutReload;
293
368
  }
369
+ // If we are not autosaving, we need to process the dialog input.
294
370
  secondMethod = Actions.handleSaveDialogResponse;
295
371
  }
296
372
  if (!DISCARD_UNSAVED_CHANGES) {
@@ -299,6 +375,7 @@ const Actions = {
299
375
  if (secondMethod) {
300
376
  tasks.push(secondMethod);
301
377
  }
378
+ // Switch is the last thing we do.
302
379
  tasks.push(switchWorkspace);
303
380
  async.waterfall(tasks, Actions.onAsyncComplete);
304
381
  }
@@ -306,6 +383,14 @@ const Actions = {
306
383
  switchWorkspace();
307
384
  }
308
385
  },
386
+ /*********************************************************************************************
387
+ *
388
+ * Workspace Management Helpers
389
+ *
390
+ *********************************************************************************************/
391
+ /**
392
+ * General handler for `async.series` and `async.waterfall`
393
+ */
309
394
  onAsyncComplete(err) {
310
395
  Logger.system.debug("workspaceManagementMenuStore: onAsyncComplete");
311
396
  WorkspaceManagementStore.setValue({
@@ -314,11 +399,20 @@ const Actions = {
314
399
  });
315
400
  const errMessage = err === null || err === void 0 ? void 0 : err.message;
316
401
  if (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {
402
+ // handle error.
317
403
  Logger.system.error(err);
318
404
  }
405
+ // Unlock the UI.
319
406
  Actions.setIsSwitchingWorkspaces(false);
320
407
  Actions.setIsPromptingUser(false);
321
408
  },
409
+ /**
410
+ * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.
411
+ *
412
+ * @param {string} type "yesNo" or "singleInput"
413
+ * @param {object} data Optional params for the dialog call.
414
+ * @param {function} responseCallback invoked when the user interacts with the dialog.
415
+ */
322
416
  spawnDialog(type, data, responseCallback) {
323
417
  Logger.system.debug("spawnDialog", type, data);
324
418
  if (type === "singleInput") {
@@ -331,6 +425,7 @@ const Actions = {
331
425
  Logger.system.log("SpawnSaveAsDialog onUserInput", response);
332
426
  let callbackError = null;
333
427
  if (typeof err === "string") {
428
+ // Error objects cause async to invoke the final callback in async.waterfall.
334
429
  callbackError = new Error(err);
335
430
  }
336
431
  if (cb) {
@@ -346,12 +441,17 @@ const Actions = {
346
441
  };
347
442
  Actions.spawnDialog("singleInput", dialogParams, onUserInput);
348
443
  },
444
+ /**
445
+ * Spawns an input field asking what the user would like to name their new workspace.
446
+ */
349
447
  spawnWorkspaceInputField: (cb) => {
448
+ // Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.
350
449
  Logger.system.log("SpawnWorkspaceInput - start");
351
450
  const onUserInput = (err, response) => {
352
451
  Logger.system.log("SpawnWorkspaceInput onUserInput", response);
353
452
  let callbackError = null;
354
453
  if (typeof err === "string") {
454
+ // Error objects cause async to invoke the final callback in async.waterfall.
355
455
  callbackError = new Error(err);
356
456
  }
357
457
  if (cb) {
@@ -367,6 +467,9 @@ const Actions = {
367
467
  };
368
468
  Actions.spawnDialog("singleInput", dialogParams, onUserInput);
369
469
  },
470
+ /**
471
+ * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.
472
+ */
370
473
  askIfUserWantsToSave: async function (callback) {
371
474
  const activeWorkspace = WorkspaceManagementStore.getValue("activeWorkspace");
372
475
  if (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {
@@ -390,24 +493,38 @@ const Actions = {
390
493
  return await waitForUserInput();
391
494
  }
392
495
  else {
496
+ // In this case the workspace is not dirty, so we don't need to save.
393
497
  if (callback)
394
498
  callback(null, { choice: "negative" });
395
499
  return { choice: "negative" };
396
500
  }
397
501
  },
502
+ /**
503
+ * Handles the response from the dialog asking if the user wants to save their workspace.
504
+ *
505
+ * @param {any} response
506
+ * @param {any} callback
507
+ */
398
508
  handleSaveDialogResponse(response, callback) {
399
509
  if (response.choice === "affirmative") {
510
+ // User wants to save, so call the client API.
400
511
  Actions.saveWorkspace(callback);
401
512
  }
402
513
  else if (response.choice === "negative") {
514
+ // Doesn't want to save.
403
515
  callback(null);
404
516
  }
405
517
  else {
518
+ // choice === cancel
406
519
  callback(new Error(SAVE_DIALOG_CANCEL_ERROR));
407
520
  }
408
521
  },
522
+ /**
523
+ * Makes sure the user has input a valid workspace name.
524
+ */
409
525
  validateWorkspaceInput(response, callback) {
410
526
  Logger.system.log("spawnWorkspaceInput", response);
527
+ // If user wants to proceed but gave an invalid name, tell them that they messed up, then die.
411
528
  if (response.choice !== "cancel" && (!response.value || response.value === "")) {
412
529
  let dialogParams = {
413
530
  title: "Invalid Workspace Name",
@@ -470,9 +587,13 @@ const Actions = {
470
587
  callback(null, { workspaceName, template });
471
588
  }
472
589
  },
590
+ /**
591
+ * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.
592
+ */
473
593
  checkIfWorkspaceAlreadyExists(response, callback) {
474
594
  const workspaceName = response.value;
475
595
  const camelCaseWorkspaceName = Util.camelCase(workspaceName);
596
+ // Do any of the workspaces have the same name that the user is trying to input.
476
597
  const workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some((workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName);
477
598
  callback(null, {
478
599
  workspaceExists,
@@ -480,6 +601,14 @@ const Actions = {
480
601
  template: response.template,
481
602
  });
482
603
  },
604
+ /*********************************************************************************************
605
+ *
606
+ * Misc functionality
607
+ *
608
+ *********************************************************************************************/
609
+ /**
610
+ * Un-focuses from the menu.
611
+ */
483
612
  blurWindow: function () {
484
613
  finsembleWindow.blur();
485
614
  },
@@ -507,6 +636,7 @@ function getPreferences(done) {
507
636
  if (errPreferences) {
508
637
  Logger.system.error("workspaceManagementMenuStore.getPreferences - getPreferences", errPreferences);
509
638
  }
639
+ // if we have preference value set then use it, since the user as explicitly set this preference
510
640
  if (preferences && Object.keys(preferences).includes(WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE)) {
511
641
  PROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE];
512
642
  Object.keys(preferences).includes(WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES)
@@ -514,6 +644,7 @@ function getPreferences(done) {
514
644
  : false;
515
645
  }
516
646
  else {
647
+ // otherwise get the deprecated config
517
648
  const { err: errValues, data: configValues } = await FSBL.Clients.ConfigClient.getValues([
518
649
  WORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY,
519
650
  ]);
@@ -531,8 +662,12 @@ function getPreferences(done) {
531
662
  done();
532
663
  })();
533
664
  }
665
+ /**
666
+ * Initializes the store for the Workspace Management Menu.
667
+ */
534
668
  function initialize(cb) {
535
669
  StoreClient = FSBL.Clients.DistributedStoreClient;
670
+ // eslint-disable-next-line prefer-destructuring
536
671
  Logger = FSBL.Clients.Logger;
537
672
  async.parallel([createGlobalStore, createLocalStore, getPreferences, addListeners], () => {
538
673
  Actions.initialize();
@@ -540,6 +675,10 @@ function initialize(cb) {
540
675
  });
541
676
  }
542
677
  let getStore = () => WorkspaceManagementStore;
678
+ /**
679
+ * This is a quick little initialization manager that Terry hacked up.
680
+ * Ultimately everything in this file should be rewritten in hooks/redux pattern.
681
+ */
543
682
  class StoreManager {
544
683
  constructor() {
545
684
  this.initialized = false;
@@ -1 +1 @@
1
- {"version":3,"file":"workspaceManagementMenuStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAmBhD,MAAM,wBAAwB,GAAG,QAAQ,CAAC;AAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,IAAI,uBAAuB,GAAG,KAAK,C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J,CAAC;IAED,sBAAsB,CAAC,EAA+B;QACrD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EACN,YAAY,EACZ,8BAA8B,IAAI,WAAW,EAC7C,UAAU,EACV,wBAAwB,IAAI,KAAK,EACjC,OAAO,EACP,QAAQ,GACR,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html\n */\nimport async from \"async\";\nimport { Util } from \"@finsemble/finsemble-api\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardCallback, StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-api/types/services/workspace/types\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StandardErrorCallback = types.StandardErrorCallback;\n\ntype UserInputResponseType = {\n\tchoice: string;\n\tvalue?: string;\n};\ntype SaveWorkspaceWaterfallParams = {\n\tworkspaceExists: boolean;\n\tworkspaceName: string;\n\ttemplate: any;\n};\n\n// When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.\nconst SAVE_DIALOG_CANCEL_ERROR = \"Cancel\";\nconst NEGATIVE = \"Negative\";\nlet PROMPT_ON_DIRTY_WORKSPACE = false;\nlet DISCARD_UNSAVED_CHANGES = false;\nconst WORKSPACE_CONFIGS = {\n\tPROMPT_USER_ON_DIRTY_WORKSPACE: \"finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace\",\n\tDISCARD_UNSAVED_CHANGES: \"finsemble.servicesConfig.workspace.discardUnsavedChanges\",\n\tDEPRECATED_PROMPT_ON_DIRTY: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\", // DEPRECATED - retrieving it for backwards compatibility\n};\n\nlet WorkspaceManagementStore: StoreModel;\nlet StoreClient: any;\nlet Logger: any;\nlet WorkspaceManagementGlobalStore: StoreModel;\n\n// Initial data for the store.\nconst defaultData = {\n\tactiveWorkspace: {},\n\tmenuWidth: 285,\n\tWorkspaceList: [],\n\tnewWorkspaceDialogIsActive: false,\n\t/**\n\t * State around whether the workspace is currently in the process of switching.\n\t *\n\t * For simplicity, we're storing this in the local store for now, but this precludes\n\t * other components from signaling that the workspace is changing. A consequence,\n\t * for example, is that if you switch workspaces uses a pin on the toolbar instead\n\t * of the workspace management menu, the spinner doesn't show up.\n\t */\n\tisSwitchingWorkspaces: false,\n\tisPromptingUser: false,\n};\n\nfunction addListeners(done: () => void) {\n\tFSBL.Clients.RouterClient.addListener(\"Application.restart\", (err, response) => {\n\t\t// when the user calls a \"Reset\" function, Finsemble shouldn't show a save workspace dialog.\n\t\tif (response.data && response.data.forceRestart === true) PROMPT_ON_DIRTY_WORKSPACE = false;\n\t});\n\tdone();\n}\n\nconst Actions = {\n\tautoSave: (callback: StandardCallback) => {\n\t\tconst activeName = FSBL.Clients.WorkspaceClient.activeWorkspace?.name;\n\t\tif (!PROMPT_ON_DIRTY_WORKSPACE) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: activeName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError) => {\n\t\t\t\t\tcallback(err);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tcallback(null);\n\t\t}\n\t},\n\tinitialize: () => {\n\t\tFSBL.Clients.ConfigClient.getPreferences((err, preferences) => {\n\t\t\tLogger.system.log(\"WorkspaceManagementStore init getPreferences\", preferences);\n\t\t\tif (preferences) {\n\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE] ?? false;\n\t\t\t\tDISCARD_UNSAVED_CHANGES = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES] ?? false;\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.ConfigClient.getValue({ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE }, (err, data) => {\n\t\t\t\t\tLogger.system.log(\"WorkspaceManagementStore init getValue promptUserOnDirtyWorkspace\", data);\n\t\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = data ?? true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tFSBL.Clients.ConfigClient.addListener(\n\t\t\t{ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE },\n\t\t\t(err, config) => {\n\t\t\t\tLogger.system.log(\"WorkspaceManagementStore new promptUserOnDirtyWorkspace config\", config);\n\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = !!config.value;\n\t\t\t}\n\t\t);\n\n\t\tFSBL.Clients.ConfigClient.addListener({ field: WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES }, (err, config) => {\n\t\t\tLogger.system.log(\"WorkspaceManagementStore new discardUnsavedChanges config\", config);\n\t\t\tDISCARD_UNSAVED_CHANGES = !!config.value;\n\t\t});\n\n\t\t// Gets the workspace list and sets the value in the store.\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaces((err: StandardError, workspaces: WorkspaceType[]) => {\n\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getWorkspaces\", workspaces);\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\tvalue: workspaces,\n\t\t\t});\n\t\t});\n\n\t\t// Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.\n\t\tFSBL.Clients.WorkspaceClient.getActiveWorkspace(\n\t\t\t(err: StandardError, activeWorkspace: { data: WorkspaceType } | undefined) => {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getActiveWorkspace\", activeWorkspace);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: activeWorkspace,\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t/**\n\t\t * We listen here for any workspace updates, and pass them to the store.\n\t\t * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,\n\t\t * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for\n\t\t * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.\n\t\t */\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.update\", (err, response) => {\n\t\t\tif (response.data && response.data.activeWorkspace) {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init update\", response.data);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: response.data.activeWorkspace,\n\t\t\t\t});\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\t\tvalue: response.data.workspacesConfig,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tWorkspaceManagementGlobalStore.getValue({ field: \"owner\" }, (err: StandardError, data?: string) => {\n\t\t\tif (data !== finsembleWindow.name) return;\n\t\t\tWorkspaceManagementGlobalStore.Dispatcher.register((action) => {\n\t\t\t\tswitch (action.actionType) {\n\t\t\t\t\tcase \"switchToWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore switchToWorkspace\", action.data);\n\t\t\t\t\t\tActions.switchToWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reorderWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore reorderWorkspace\", action.data);\n\t\t\t\t\t\tActions.reorderWorkspaceList(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"removeWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore removeWorkspace\", action.data);\n\t\t\t\t\t\tActions.removeWorkspace(\n\t\t\t\t\t\t\taction.data as {\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\thideModalOnClose: boolean;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"renameWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore renameWorkspace\", action.data);\n\t\t\t\t\t\tActions.renameWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Nothing to do here\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tGETTERS/SETTERS\n\t *\n\t *********************************************************************************************/\n\tgetActiveWorkspace: () => WorkspaceManagementStore.getValue(\"activeWorkspace\") as WorkspaceType,\n\n\t// Get the name of the workspace that is currently being edited\n\tgetWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue(\"workspaceBeingEdited\") as string,\n\n\tgetWorkspaceList: () => WorkspaceManagementStore.getValue(\"WorkspaceList\") as WorkspaceType[],\n\n\tgetIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue(\"isSwitchingWorkspaces\") as boolean,\n\n\tsetIsSwitchingWorkspaces: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isSwitchingWorkspaces\",\n\t\t\tvalue: val,\n\t\t}),\n\n\tgetIsPromptingUser: () => WorkspaceManagementStore.getValue(\"isPromptingUser\") as boolean,\n\n\tsetIsPromptingUser: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isPromptingUser\",\n\t\t\tvalue: val,\n\t\t}),\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMain Workspace Actions\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * Handles the complete workflow for creating a new workspace.\n\t * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.\n\t */\n\tnewWorkspace: function () {\n\t\tlet newWorkspaceName: string;\n\t\tLogger.system.log(\"New workspace - start.\");\n\t\tconst newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue(\"newWorkspaceDialogIsActive\");\n\n\t\ttype createItParams = {\n\t\t\tworkspaceName: string;\n\t\t};\n\t\t// Creates the new workspace.\n\t\tconst createIt = (params: createItParams, cb?: StandardCallback) => {\n\t\t\tLogger.system.log(\"createIt\", params);\n\t\t\tconst { workspaceName } = params;\n\t\t\tFSBL.Clients.WorkspaceClient.createWorkspace(workspaceName, {}, (err, response) => {\n\t\t\t\tLogger.system.log(\"createIt createNewWorkspace response\", workspaceName, response);\n\t\t\t\tnewWorkspaceName = response.workspaceName;\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(null, newWorkspaceName);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (!newWorkspaceDialogIsActive) {\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\t\tvalue: true,\n\t\t\t});\n\t\t}\n\n\t\tActions.blurWindow();\n\t\tlet tasks: Function[] = [\n\t\t\tActions.autoSave,\n\t\t\tActions.spawnWorkspaceInputField,\n\t\t\tActions.validateWorkspaceInput,\n\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\tActions.askIfUserWantsNewWorkspace,\n\t\t\tcreateIt,\n\t\t];\n\t\tif (PROMPT_ON_DIRTY_WORKSPACE) {\n\t\t\ttasks = ([Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse] as Function[]).concat(tasks);\n\t\t}\n\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t},\n\n\t/**\n\t * Handles the workflow for removing a workspace.\n\t * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,\n\t * and if the user says \"yes\", it will delete the workspace.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tremoveWorkspace: (data: { name: string; hideModalOnClose?: boolean }, cb = (val: any) => {}) => {\n\t\tconst workspaceName = data.name;\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Delete this workspace?\",\n\t\t\tquestion: `Are you sure you want to delete the workspace \"${workspaceName}\"?`,\n\t\t\tshowNegativeButton: false,\n\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\thideModalOnClose: data.hideModalOnClose,\n\t\t};\n\n\t\t/**\n\t\t * Invoked when the user interacts with the dialog.\n\t\t */\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcb(true);\n\t\t\t\tFSBL.Clients.WorkspaceClient.remove({\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcb(false);\n\t\t\t}\n\t\t}\n\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t},\n\t/**\n\t * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.\n\t */\n\tsaveWorkspace: (cb?: StandardErrorCallback) => {\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t{\n\t\t\t\tforce: true,\n\t\t\t\tname: activeWorkspace.name,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcb?.(null);\n\t\t\t}\n\t\t);\n\t},\n\treorderWorkspaceList: ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tlet workspaces: WorkspaceType[] = WorkspaceManagementStore.getValue<WorkspaceType[]>({\n\t\t\tfield: \"WorkspaceList\",\n\t\t});\n\t\tconst workspaceToMove = workspaces[oldIndex];\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tconst workspacesWithExpectedStructure = workspaces.map((WSName) => {\n\t\t\treturn {\n\t\t\t\tname: WSName,\n\t\t\t};\n\t\t});\n\t\tFSBL.Clients.WorkspaceClient.setWorkspaces(\n\t\t\t{\n\t\t\t\tworkspaces: workspacesWithExpectedStructure,\n\t\t\t},\n\t\t\t() => {}\n\t\t);\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"WorkspaceList\",\n\t\t\tvalue: workspaces,\n\t\t});\n\t},\n\trenameWorkspace: ({ oldName, newName }: { oldName: string; newName: string }) => {\n\t\t// Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing\n\t\t// workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.\n\t\tFSBL.Clients.WorkspaceClient.rename({\n\t\t\toldName: oldName,\n\t\t\tnewName: newName,\n\t\t\tremoveOldWorkspace: true,\n\t\t\toverwriteExisting: true,\n\t\t});\n\t},\n\n\tshowPreferences: () => {\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Ask the user for a name, make sure it doesn't already exist, then save.\n\t */\n\tsaveWorkspaceAs: () => {\n\t\tfunction saveIt(workspaceName: string, callback: StandardErrorCallback) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError, response: any) => {\n\t\t\t\t\tcallback(err, response);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tLogger.system.log(\"SaveWorkspaceAs clicked.\");\n\n\t\tasync.waterfall(\n\t\t\t[\n\t\t\t\tActions.autoSave,\n\t\t\t\tActions.spawnSaveAsDialog,\n\t\t\t\tActions.validateWorkspaceInput,\n\t\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\t\tActions.askAboutOverwrite,\n\t\t\t\tsaveIt,\n\t\t\t],\n\t\t\tActions.onAsyncComplete\n\t\t);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their data, then loads the requested workspace.\n\t */\n\tswitchToWorkspace: async function ({ name }: { name: string }) {\n\t\t// if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);\n\t\t// note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)\n\t\tconst prompting = Actions.getIsPromptingUser();\n\t\tLogger.system.log(\"workspaceManagementMenuStore: switchToWorkspace\", prompting ? \"prompting\" : \"not-prompting\");\n\t\tif (prompting) return;\n\n\t\tActions.setIsSwitchingWorkspaces(true);\n\t\tActions.blurWindow();\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\t/**\n\t\t * Actually perform the switch. Happens after we ask the user what they want.\n\t\t *\n\t\t */\n\t\tconst switchWorkspace = (callback = () => {}) => {\n\t\t\tFSBL.Clients.WorkspaceClient.switchTo(\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tActions.setIsSwitchingWorkspaces(false);\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * Make sure the user is sure\n\t\t */\n\t\tconst askAboutReload = (callback: () => void) => {\n\t\t\tActions.spawnDialog(\n\t\t\t\t\"yesNo\",\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"primary\",\n\t\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t\t},\n\t\t\t\tcallback\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * If the workspace is dirty, we need to do more than if it's clean.\n\t\t */\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tlet tasks: Function[] = [];\n\n\t\t\tActions.setIsPromptingUser(true);\n\t\t\tlet firstMethod: Function = Actions.autoSave,\n\t\t\t\tsecondMethod = null;\n\n\t\t\tif (PROMPT_ON_DIRTY_WORKSPACE === true) {\n\t\t\t\t// We want to ask the user to save. But if they're trying to reload the workspace,\n\t\t\t\t// the message needs to be different. The first if block just switches that method.\n\t\t\t\tfirstMethod = Actions.askIfUserWantsToSave;\n\t\t\t\tif (name === FSBL.Clients.WorkspaceClient.activeWorkspace?.name) {\n\t\t\t\t\tfirstMethod = askAboutReload;\n\t\t\t\t}\n\n\t\t\t\t// If we are not autosaving, we need to process the dialog input.\n\t\t\t\tsecondMethod = Actions.handleSaveDialogResponse;\n\t\t\t}\n\n\t\t\tif (!DISCARD_UNSAVED_CHANGES) {\n\t\t\t\ttasks = [firstMethod];\n\t\t\t}\n\n\t\t\tif (secondMethod) {\n\t\t\t\ttasks.push(secondMethod);\n\t\t\t}\n\n\t\t\t// Switch is the last thing we do.\n\t\t\ttasks.push(switchWorkspace);\n\n\t\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t\t} else {\n\t\t\tswitchWorkspace();\n\t\t}\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tWorkspace Management Helpers\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * General handler for `async.series` and `async.waterfall`\n\t */\n\tonAsyncComplete(err?: Error | null) {\n\t\tLogger.system.debug(\"workspaceManagementMenuStore: onAsyncComplete\");\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\tvalue: false,\n\t\t});\n\t\tconst errMessage = err?.message;\n\t\tif (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {\n\t\t\t// handle error.\n\t\t\tLogger.system.error(err);\n\t\t}\n\n\t\t// Unlock the UI.\n\t\tActions.setIsSwitchingWorkspaces(false);\n\t\tActions.setIsPromptingUser(false);\n\t},\n\n\t/**\n\t * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.\n\t *\n\t * @param {string} type \"yesNo\" or \"singleInput\"\n\t * @param {object} data Optional params for the dialog call.\n\t * @param {function} responseCallback invoked when the user interacts with the dialog.\n\t */\n\tspawnDialog(type: \"yesNo\" | \"singleInput\", data: any, responseCallback: StandardErrorCallback) {\n\t\tLogger.system.debug(\"spawnDialog\", type, data);\n\t\tif (type === \"singleInput\") {\n\t\t\tdata.showCancelButton = true;\n\t\t}\n\t\tFSBL.Clients.DialogManager.open(type, data, responseCallback);\n\t},\n\n\tspawnSaveAsDialog: (cb: StandardCallback) => {\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnSaveAsDialog onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Spawns an input field asking what the user would like to name their new workspace.\n\t */\n\tspawnWorkspaceInputField: (cb: StandardCallback) => {\n\t\t// Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.\n\t\tLogger.system.log(\"SpawnWorkspaceInput - start\");\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnWorkspaceInput onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.\n\t */\n\taskIfUserWantsToSave: async function (callback: StandardCallback) {\n\t\tconst activeWorkspace: WorkspaceType = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tLogger.system.log(\"NewWorkspace.spawnDialog start.\");\n\t\t\tconst dialogParams = {\n\t\t\t\tmonitor: \"primary\",\n\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t};\n\t\t\tconst waitForUserInput = () =>\n\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\t\t\t\tLogger.system.log(\"Spawn Dialog callback.\");\n\t\t\t\t\t\tif (callback) callback(null, response);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t};\n\t\t\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t\t\t});\n\t\t\treturn await waitForUserInput();\n\t\t} else {\n\t\t\t// In this case the workspace is not dirty, so we don't need to save.\n\t\t\tif (callback) callback(null, { choice: \"negative\" });\n\t\t\treturn { choice: \"negative\" };\n\t\t}\n\t},\n\n\t/**\n\t * Handles the response from the dialog asking if the user wants to save their workspace.\n\t *\n\t * @param {any} response\n\t * @param {any} callback\n\t */\n\thandleSaveDialogResponse(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tif (response.choice === \"affirmative\") {\n\t\t\t// User wants to save, so call the client API.\n\t\t\tActions.saveWorkspace(callback);\n\t\t} else if (response.choice === \"negative\") {\n\t\t\t// Doesn't want to save.\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\t// choice === cancel\n\t\t\tcallback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t},\n\t/**\n\t * Makes sure the user has input a valid workspace name.\n\t */\n\tvalidateWorkspaceInput(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tLogger.system.log(\"spawnWorkspaceInput\", response);\n\t\t// If user wants to proceed but gave an invalid name, tell them that they messed up, then die.\n\t\tif (response.choice !== \"cancel\" && (!response.value || response.value === \"\")) {\n\t\t\tlet dialogParams = {\n\t\t\t\ttitle: \"Invalid Workspace Name\",\n\t\t\t\tquestion: \"Workspace names must contain letters or numbers. Please try again.\",\n\t\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t\tshowCancelButton: false,\n\t\t\t};\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, () => {});\n\t\t\treturn callback(new Error(\"Invalid workspace name.\"));\n\t\t} else if (response.choice === \"cancel\") {\n\t\t\treturn callback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t\tcallback(null, response);\n\t},\n\n\taskAboutOverwrite(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tconst { workspaceExists, workspaceName } = params;\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Overwrite Workspace?\",\n\t\t\tquestion: `This will overwrite the saved data for \"${workspaceName}\". Would you like to proceed?`,\n\t\t\taffirmativeResponseLabel: \"Overwrite\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, workspaceName);\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t};\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, workspaceName);\n\t\t}\n\t},\n\taskIfUserWantsNewWorkspace(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tlet { workspaceExists, workspaceName, template } = params;\n\n\t\tlet dialogParams = {\n\t\t\ttitle: \"New workspace\",\n\t\t\tquestion: `The workspace \"${workspaceName}\" already exists. A new workspace with a modified name will be created.`,\n\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, { workspaceName, template });\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t}\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, { workspaceName, template });\n\t\t}\n\t},\n\n\t/**\n\t * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.\n\t */\n\tcheckIfWorkspaceAlreadyExists(response: any, callback: StandardErrorCallback) {\n\t\tconst workspaceName = response.value;\n\t\tconst camelCaseWorkspaceName = Util.camelCase(workspaceName);\n\t\t// Do any of the workspaces have the same name that the user is trying to input.\n\t\tconst workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some(\n\t\t\t(workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName\n\t\t);\n\t\tcallback(null, {\n\t\t\tworkspaceExists,\n\t\t\tworkspaceName,\n\t\t\ttemplate: response.template,\n\t\t});\n\t},\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMisc functionality\n\t *\n\t *********************************************************************************************/\n\t/**\n\t * Un-focuses from the menu.\n\t */\n\tblurWindow: function () {\n\t\tfinsembleWindow.blur();\n\t},\n};\n\nfunction createLocalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{ store: \"Finsemble-WorkspaceMenu-Local-Store\", values: defaultData },\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction createGlobalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{\n\t\t\tstore: \"Finsemble-WorkspaceMenu-Global-Store\",\n\t\t\tglobal: true,\n\t\t\tvalues: { owner: finsembleWindow.name },\n\t\t},\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementGlobalStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getPreferences(done: () => void) {\n\t(async () => {\n\t\tconst { err: errPreferences, data: preferences } = await FSBL.Clients.ConfigClient.getPreferences();\n\t\tif (errPreferences) {\n\t\t\tLogger.system.error(\"workspaceManagementMenuStore.getPreferences - getPreferences\", errPreferences);\n\t\t}\n\t\t// if we have preference value set then use it, since the user as explicitly set this preference\n\t\tif (preferences && Object.keys(preferences).includes(WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE)) {\n\t\t\tPROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE];\n\n\t\t\tObject.keys(preferences).includes(WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES)\n\t\t\t\t? (DISCARD_UNSAVED_CHANGES = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES] ?? false)\n\t\t\t\t: false;\n\t\t} else {\n\t\t\t// otherwise get the deprecated config\n\t\t\tconst { err: errValues, data: configValues } = await FSBL.Clients.ConfigClient.getValues([\n\t\t\t\tWORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY,\n\t\t\t]);\n\t\t\tif (errValues) {\n\t\t\t\tLogger.system.error(\"workspaceManagementMenuStore.getPreferences - getValues\", errValues);\n\t\t\t}\n\t\t\tPROMPT_ON_DIRTY_WORKSPACE = configValues\n\t\t\t\t? configValues[WORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY] ?? true\n\t\t\t\t: true;\n\t\t\tFSBL.Clients.ConfigClient.setPreference({\n\t\t\t\tfield: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE,\n\t\t\t\tvalue: PROMPT_ON_DIRTY_WORKSPACE,\n\t\t\t});\n\t\t}\n\n\t\tdone();\n\t})();\n}\n\n/**\n * Initializes the store for the Workspace Management Menu.\n */\nfunction initialize(cb: any) {\n\tStoreClient = FSBL.Clients.DistributedStoreClient;\n\t// eslint-disable-next-line prefer-destructuring\n\tLogger = FSBL.Clients.Logger;\n\tasync.parallel([createGlobalStore, createLocalStore, getPreferences, addListeners], () => {\n\t\tActions.initialize();\n\t\tcb(WorkspaceManagementStore);\n\t});\n}\n\nlet getStore = () => WorkspaceManagementStore;\n\n/**\n * This is a quick little initialization manager that Terry hacked up.\n * Ultimately everything in this file should be rewritten in hooks/redux pattern.\n */\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store !== null) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport {\n\tstoreManager,\n\tWorkspaceManagementGlobalStore as GlobalStore,\n\tinitialize,\n\tWorkspaceManagementStore as Store,\n\tActions,\n\tgetStore,\n};\n"]}
1
+ {"version":3,"file":"workspaceManagementMenuStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAkBhD,yGAAyG;AACzG,MAAM,wBAAwB,GAAG,QAAQ,CAAC;AAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,IAAI,uBAAuB,GAAG,KAAK,CAAC;AACpC,MAAM,iBAAiB,GAAG;IACzB,8BAA8B,EAAE,+DAA+D;IAC/F,uBAAuB,EAAE,0DAA0D;IACnF,0BAA0B,EAAE,mEAAmE,EAA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,GACR,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html\n */\nimport async from \"async\";\nimport { Util } from \"@finsemble/finsemble-api\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardCallback, StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-api/types/services/workspace/types\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StandardErrorCallback = types.StandardErrorCallback;\n\ntype UserInputResponseType = {\n\tchoice: string;\n\tvalue?: string;\n};\ntype SaveWorkspaceWaterfallParams = {\n\tworkspaceExists: boolean;\n\tworkspaceName: string;\n\ttemplate: any;\n};\n\n// When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.\nconst SAVE_DIALOG_CANCEL_ERROR = \"Cancel\";\nconst NEGATIVE = \"Negative\";\nlet PROMPT_ON_DIRTY_WORKSPACE = false;\nlet DISCARD_UNSAVED_CHANGES = false;\nconst WORKSPACE_CONFIGS = {\n\tPROMPT_USER_ON_DIRTY_WORKSPACE: \"finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace\",\n\tDISCARD_UNSAVED_CHANGES: \"finsemble.servicesConfig.workspace.discardUnsavedChanges\",\n\tDEPRECATED_PROMPT_ON_DIRTY: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\", // DEPRECATED - retrieving it for backwards compatibility\n};\n\nlet WorkspaceManagementStore: StoreModel;\nlet StoreClient: any;\nlet Logger: any;\nlet WorkspaceManagementGlobalStore: StoreModel;\n\n// Initial data for the store.\nconst defaultData = {\n\tactiveWorkspace: {},\n\tmenuWidth: 285,\n\tWorkspaceList: [],\n\tnewWorkspaceDialogIsActive: false,\n\t/**\n\t * State around whether the workspace is currently in the process of switching.\n\t *\n\t * For simplicity, we're storing this in the local store for now, but this precludes\n\t * other components from signaling that the workspace is changing. A consequence,\n\t * for example, is that if you switch workspaces uses a pin on the toolbar instead\n\t * of the workspace management menu, the spinner doesn't show up.\n\t */\n\tisSwitchingWorkspaces: false,\n\tisPromptingUser: false,\n};\n\nfunction addListeners(done: () => void) {\n\tFSBL.Clients.RouterClient.addListener(\"Application.restart\", (err, response) => {\n\t\t// when the user calls a \"Reset\" function, Finsemble shouldn't show a save workspace dialog.\n\t\tif (response.data && response.data.forceRestart === true) PROMPT_ON_DIRTY_WORKSPACE = false;\n\t});\n\tdone();\n}\n\nconst Actions = {\n\tautoSave: (callback: StandardCallback) => {\n\t\tconst activeName = FSBL.Clients.WorkspaceClient.activeWorkspace?.name;\n\t\tif (!PROMPT_ON_DIRTY_WORKSPACE) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: activeName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError) => {\n\t\t\t\t\tcallback(err);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tcallback(null);\n\t\t}\n\t},\n\tinitialize: () => {\n\t\tFSBL.Clients.ConfigClient.getPreferences((err, preferences) => {\n\t\t\tLogger.system.log(\"WorkspaceManagementStore init getPreferences\", preferences);\n\t\t\tif (preferences) {\n\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE] ?? false;\n\t\t\t\tDISCARD_UNSAVED_CHANGES = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES] ?? false;\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.ConfigClient.getValue({ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE }, (err, data) => {\n\t\t\t\t\tLogger.system.log(\"WorkspaceManagementStore init getValue promptUserOnDirtyWorkspace\", data);\n\t\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = data ?? true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tFSBL.Clients.ConfigClient.addListener(\n\t\t\t{ field: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE },\n\t\t\t(err, config) => {\n\t\t\t\tLogger.system.log(\"WorkspaceManagementStore new promptUserOnDirtyWorkspace config\", config);\n\t\t\t\tPROMPT_ON_DIRTY_WORKSPACE = !!config.value;\n\t\t\t}\n\t\t);\n\n\t\tFSBL.Clients.ConfigClient.addListener({ field: WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES }, (err, config) => {\n\t\t\tLogger.system.log(\"WorkspaceManagementStore new discardUnsavedChanges config\", config);\n\t\t\tDISCARD_UNSAVED_CHANGES = !!config.value;\n\t\t});\n\n\t\t// Gets the workspace list and sets the value in the store.\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaces((err: StandardError, workspaces: WorkspaceType[]) => {\n\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getWorkspaces\", workspaces);\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\tvalue: workspaces,\n\t\t\t});\n\t\t});\n\n\t\t// Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.\n\t\tFSBL.Clients.WorkspaceClient.getActiveWorkspace(\n\t\t\t(err: StandardError, activeWorkspace: { data: WorkspaceType } | undefined) => {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getActiveWorkspace\", activeWorkspace);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: activeWorkspace,\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t/**\n\t\t * We listen here for any workspace updates, and pass them to the store.\n\t\t * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,\n\t\t * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for\n\t\t * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.\n\t\t */\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.update\", (err, response) => {\n\t\t\tif (response.data && response.data.activeWorkspace) {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init update\", response.data);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: response.data.activeWorkspace,\n\t\t\t\t});\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\t\tvalue: response.data.workspacesConfig,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tWorkspaceManagementGlobalStore.getValue({ field: \"owner\" }, (err: StandardError, data?: string) => {\n\t\t\tif (data !== finsembleWindow.name) return;\n\t\t\tWorkspaceManagementGlobalStore.Dispatcher.register((action) => {\n\t\t\t\tswitch (action.actionType) {\n\t\t\t\t\tcase \"switchToWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore switchToWorkspace\", action.data);\n\t\t\t\t\t\tActions.switchToWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reorderWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore reorderWorkspace\", action.data);\n\t\t\t\t\t\tActions.reorderWorkspaceList(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"removeWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore removeWorkspace\", action.data);\n\t\t\t\t\t\tActions.removeWorkspace(\n\t\t\t\t\t\t\taction.data as {\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\thideModalOnClose: boolean;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"renameWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore renameWorkspace\", action.data);\n\t\t\t\t\t\tActions.renameWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Nothing to do here\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tGETTERS/SETTERS\n\t *\n\t *********************************************************************************************/\n\tgetActiveWorkspace: () => WorkspaceManagementStore.getValue(\"activeWorkspace\") as WorkspaceType,\n\n\t// Get the name of the workspace that is currently being edited\n\tgetWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue(\"workspaceBeingEdited\") as string,\n\n\tgetWorkspaceList: () => WorkspaceManagementStore.getValue(\"WorkspaceList\") as WorkspaceType[],\n\n\tgetIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue(\"isSwitchingWorkspaces\") as boolean,\n\n\tsetIsSwitchingWorkspaces: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isSwitchingWorkspaces\",\n\t\t\tvalue: val,\n\t\t}),\n\n\tgetIsPromptingUser: () => WorkspaceManagementStore.getValue(\"isPromptingUser\") as boolean,\n\n\tsetIsPromptingUser: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isPromptingUser\",\n\t\t\tvalue: val,\n\t\t}),\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMain Workspace Actions\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * Handles the complete workflow for creating a new workspace.\n\t * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.\n\t */\n\tnewWorkspace: function () {\n\t\tlet newWorkspaceName: string;\n\t\tLogger.system.log(\"New workspace - start.\");\n\t\tconst newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue(\"newWorkspaceDialogIsActive\");\n\n\t\ttype createItParams = {\n\t\t\tworkspaceName: string;\n\t\t};\n\t\t// Creates the new workspace.\n\t\tconst createIt = (params: createItParams, cb?: StandardCallback) => {\n\t\t\tLogger.system.log(\"createIt\", params);\n\t\t\tconst { workspaceName } = params;\n\t\t\tFSBL.Clients.WorkspaceClient.createWorkspace(workspaceName, {}, (err, response) => {\n\t\t\t\tLogger.system.log(\"createIt createNewWorkspace response\", workspaceName, response);\n\t\t\t\tnewWorkspaceName = response.workspaceName;\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(null, newWorkspaceName);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (!newWorkspaceDialogIsActive) {\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\t\tvalue: true,\n\t\t\t});\n\t\t}\n\n\t\tActions.blurWindow();\n\t\tlet tasks: Function[] = [\n\t\t\tActions.autoSave,\n\t\t\tActions.spawnWorkspaceInputField,\n\t\t\tActions.validateWorkspaceInput,\n\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\tActions.askIfUserWantsNewWorkspace,\n\t\t\tcreateIt,\n\t\t];\n\t\tif (PROMPT_ON_DIRTY_WORKSPACE) {\n\t\t\ttasks = ([Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse] as Function[]).concat(tasks);\n\t\t}\n\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t},\n\n\t/**\n\t * Handles the workflow for removing a workspace.\n\t * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,\n\t * and if the user says \"yes\", it will delete the workspace.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tremoveWorkspace: (data: { name: string; hideModalOnClose?: boolean }, cb = (val: any) => {}) => {\n\t\tconst workspaceName = data.name;\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Delete this workspace?\",\n\t\t\tquestion: `Are you sure you want to delete the workspace \"${workspaceName}\"?`,\n\t\t\tshowNegativeButton: false,\n\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\thideModalOnClose: data.hideModalOnClose,\n\t\t};\n\n\t\t/**\n\t\t * Invoked when the user interacts with the dialog.\n\t\t */\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcb(true);\n\t\t\t\tFSBL.Clients.WorkspaceClient.remove({\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcb(false);\n\t\t\t}\n\t\t}\n\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t},\n\t/**\n\t * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.\n\t */\n\tsaveWorkspace: (cb?: StandardErrorCallback) => {\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t{\n\t\t\t\tforce: true,\n\t\t\t\tname: activeWorkspace.name,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcb?.(null);\n\t\t\t}\n\t\t);\n\t},\n\treorderWorkspaceList: ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tlet workspaces: WorkspaceType[] = WorkspaceManagementStore.getValue<WorkspaceType[]>({\n\t\t\tfield: \"WorkspaceList\",\n\t\t});\n\t\tconst workspaceToMove = workspaces[oldIndex];\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tconst workspacesWithExpectedStructure = workspaces.map((WSName) => {\n\t\t\treturn {\n\t\t\t\tname: WSName,\n\t\t\t};\n\t\t});\n\t\tFSBL.Clients.WorkspaceClient.setWorkspaces(\n\t\t\t{\n\t\t\t\tworkspaces: workspacesWithExpectedStructure,\n\t\t\t},\n\t\t\t() => {}\n\t\t);\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"WorkspaceList\",\n\t\t\tvalue: workspaces,\n\t\t});\n\t},\n\trenameWorkspace: ({ oldName, newName }: { oldName: string; newName: string }) => {\n\t\t// Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing\n\t\t// workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.\n\t\tFSBL.Clients.WorkspaceClient.rename({\n\t\t\toldName: oldName,\n\t\t\tnewName: newName,\n\t\t\tremoveOldWorkspace: true,\n\t\t\toverwriteExisting: true,\n\t\t});\n\t},\n\n\tshowPreferences: () => {\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Ask the user for a name, make sure it doesn't already exist, then save.\n\t */\n\tsaveWorkspaceAs: () => {\n\t\tfunction saveIt(workspaceName: string, callback: StandardErrorCallback) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError, response: any) => {\n\t\t\t\t\tcallback(err, response);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tLogger.system.log(\"SaveWorkspaceAs clicked.\");\n\n\t\tasync.waterfall(\n\t\t\t[\n\t\t\t\tActions.autoSave,\n\t\t\t\tActions.spawnSaveAsDialog,\n\t\t\t\tActions.validateWorkspaceInput,\n\t\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\t\tActions.askAboutOverwrite,\n\t\t\t\tsaveIt,\n\t\t\t],\n\t\t\tActions.onAsyncComplete\n\t\t);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their data, then loads the requested workspace.\n\t */\n\tswitchToWorkspace: async function ({ name }: { name: string }) {\n\t\t// if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);\n\t\t// note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)\n\t\tconst prompting = Actions.getIsPromptingUser();\n\t\tLogger.system.log(\"workspaceManagementMenuStore: switchToWorkspace\", prompting ? \"prompting\" : \"not-prompting\");\n\t\tif (prompting) return;\n\n\t\tActions.setIsSwitchingWorkspaces(true);\n\t\tActions.blurWindow();\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\t/**\n\t\t * Actually perform the switch. Happens after we ask the user what they want.\n\t\t *\n\t\t */\n\t\tconst switchWorkspace = (callback = () => {}) => {\n\t\t\tFSBL.Clients.WorkspaceClient.switchTo(\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tActions.setIsSwitchingWorkspaces(false);\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * Make sure the user is sure\n\t\t */\n\t\tconst askAboutReload = (callback: () => void) => {\n\t\t\tActions.spawnDialog(\n\t\t\t\t\"yesNo\",\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"primary\",\n\t\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t\t},\n\t\t\t\tcallback\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * If the workspace is dirty, we need to do more than if it's clean.\n\t\t */\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tlet tasks: Function[] = [];\n\n\t\t\tActions.setIsPromptingUser(true);\n\t\t\tlet firstMethod: Function = Actions.autoSave,\n\t\t\t\tsecondMethod = null;\n\n\t\t\tif (PROMPT_ON_DIRTY_WORKSPACE === true) {\n\t\t\t\t// We want to ask the user to save. But if they're trying to reload the workspace,\n\t\t\t\t// the message needs to be different. The first if block just switches that method.\n\t\t\t\tfirstMethod = Actions.askIfUserWantsToSave;\n\t\t\t\tif (name === FSBL.Clients.WorkspaceClient.activeWorkspace?.name) {\n\t\t\t\t\tfirstMethod = askAboutReload;\n\t\t\t\t}\n\n\t\t\t\t// If we are not autosaving, we need to process the dialog input.\n\t\t\t\tsecondMethod = Actions.handleSaveDialogResponse;\n\t\t\t}\n\n\t\t\tif (!DISCARD_UNSAVED_CHANGES) {\n\t\t\t\ttasks = [firstMethod];\n\t\t\t}\n\n\t\t\tif (secondMethod) {\n\t\t\t\ttasks.push(secondMethod);\n\t\t\t}\n\n\t\t\t// Switch is the last thing we do.\n\t\t\ttasks.push(switchWorkspace);\n\n\t\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t\t} else {\n\t\t\tswitchWorkspace();\n\t\t}\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tWorkspace Management Helpers\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * General handler for `async.series` and `async.waterfall`\n\t */\n\tonAsyncComplete(err?: Error | null) {\n\t\tLogger.system.debug(\"workspaceManagementMenuStore: onAsyncComplete\");\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\tvalue: false,\n\t\t});\n\t\tconst errMessage = err?.message;\n\t\tif (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {\n\t\t\t// handle error.\n\t\t\tLogger.system.error(err);\n\t\t}\n\n\t\t// Unlock the UI.\n\t\tActions.setIsSwitchingWorkspaces(false);\n\t\tActions.setIsPromptingUser(false);\n\t},\n\n\t/**\n\t * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.\n\t *\n\t * @param {string} type \"yesNo\" or \"singleInput\"\n\t * @param {object} data Optional params for the dialog call.\n\t * @param {function} responseCallback invoked when the user interacts with the dialog.\n\t */\n\tspawnDialog(type: \"yesNo\" | \"singleInput\", data: any, responseCallback: StandardErrorCallback) {\n\t\tLogger.system.debug(\"spawnDialog\", type, data);\n\t\tif (type === \"singleInput\") {\n\t\t\tdata.showCancelButton = true;\n\t\t}\n\t\tFSBL.Clients.DialogManager.open(type, data, responseCallback);\n\t},\n\n\tspawnSaveAsDialog: (cb: StandardCallback) => {\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnSaveAsDialog onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Spawns an input field asking what the user would like to name their new workspace.\n\t */\n\tspawnWorkspaceInputField: (cb: StandardCallback) => {\n\t\t// Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.\n\t\tLogger.system.log(\"SpawnWorkspaceInput - start\");\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnWorkspaceInput onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.\n\t */\n\taskIfUserWantsToSave: async function (callback: StandardCallback) {\n\t\tconst activeWorkspace: WorkspaceType = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tLogger.system.log(\"NewWorkspace.spawnDialog start.\");\n\t\t\tconst dialogParams = {\n\t\t\t\tmonitor: \"primary\",\n\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t};\n\t\t\tconst waitForUserInput = () =>\n\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\t\t\t\tLogger.system.log(\"Spawn Dialog callback.\");\n\t\t\t\t\t\tif (callback) callback(null, response);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t};\n\t\t\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t\t\t});\n\t\t\treturn await waitForUserInput();\n\t\t} else {\n\t\t\t// In this case the workspace is not dirty, so we don't need to save.\n\t\t\tif (callback) callback(null, { choice: \"negative\" });\n\t\t\treturn { choice: \"negative\" };\n\t\t}\n\t},\n\n\t/**\n\t * Handles the response from the dialog asking if the user wants to save their workspace.\n\t *\n\t * @param {any} response\n\t * @param {any} callback\n\t */\n\thandleSaveDialogResponse(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tif (response.choice === \"affirmative\") {\n\t\t\t// User wants to save, so call the client API.\n\t\t\tActions.saveWorkspace(callback);\n\t\t} else if (response.choice === \"negative\") {\n\t\t\t// Doesn't want to save.\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\t// choice === cancel\n\t\t\tcallback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t},\n\t/**\n\t * Makes sure the user has input a valid workspace name.\n\t */\n\tvalidateWorkspaceInput(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tLogger.system.log(\"spawnWorkspaceInput\", response);\n\t\t// If user wants to proceed but gave an invalid name, tell them that they messed up, then die.\n\t\tif (response.choice !== \"cancel\" && (!response.value || response.value === \"\")) {\n\t\t\tlet dialogParams = {\n\t\t\t\ttitle: \"Invalid Workspace Name\",\n\t\t\t\tquestion: \"Workspace names must contain letters or numbers. Please try again.\",\n\t\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t\tshowCancelButton: false,\n\t\t\t};\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, () => {});\n\t\t\treturn callback(new Error(\"Invalid workspace name.\"));\n\t\t} else if (response.choice === \"cancel\") {\n\t\t\treturn callback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t\tcallback(null, response);\n\t},\n\n\taskAboutOverwrite(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tconst { workspaceExists, workspaceName } = params;\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Overwrite Workspace?\",\n\t\t\tquestion: `This will overwrite the saved data for \"${workspaceName}\". Would you like to proceed?`,\n\t\t\taffirmativeResponseLabel: \"Overwrite\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, workspaceName);\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t};\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, workspaceName);\n\t\t}\n\t},\n\taskIfUserWantsNewWorkspace(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tlet { workspaceExists, workspaceName, template } = params;\n\n\t\tlet dialogParams = {\n\t\t\ttitle: \"New workspace\",\n\t\t\tquestion: `The workspace \"${workspaceName}\" already exists. A new workspace with a modified name will be created.`,\n\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, { workspaceName, template });\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t}\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, { workspaceName, template });\n\t\t}\n\t},\n\n\t/**\n\t * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.\n\t */\n\tcheckIfWorkspaceAlreadyExists(response: any, callback: StandardErrorCallback) {\n\t\tconst workspaceName = response.value;\n\t\tconst camelCaseWorkspaceName = Util.camelCase(workspaceName);\n\t\t// Do any of the workspaces have the same name that the user is trying to input.\n\t\tconst workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some(\n\t\t\t(workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName\n\t\t);\n\t\tcallback(null, {\n\t\t\tworkspaceExists,\n\t\t\tworkspaceName,\n\t\t\ttemplate: response.template,\n\t\t});\n\t},\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMisc functionality\n\t *\n\t *********************************************************************************************/\n\t/**\n\t * Un-focuses from the menu.\n\t */\n\tblurWindow: function () {\n\t\tfinsembleWindow.blur();\n\t},\n};\n\nfunction createLocalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{ store: \"Finsemble-WorkspaceMenu-Local-Store\", values: defaultData },\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction createGlobalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{\n\t\t\tstore: \"Finsemble-WorkspaceMenu-Global-Store\",\n\t\t\tglobal: true,\n\t\t\tvalues: { owner: finsembleWindow.name },\n\t\t},\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementGlobalStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getPreferences(done: () => void) {\n\t(async () => {\n\t\tconst { err: errPreferences, data: preferences } = await FSBL.Clients.ConfigClient.getPreferences();\n\t\tif (errPreferences) {\n\t\t\tLogger.system.error(\"workspaceManagementMenuStore.getPreferences - getPreferences\", errPreferences);\n\t\t}\n\t\t// if we have preference value set then use it, since the user as explicitly set this preference\n\t\tif (preferences && Object.keys(preferences).includes(WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE)) {\n\t\t\tPROMPT_ON_DIRTY_WORKSPACE = preferences[WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE];\n\n\t\t\tObject.keys(preferences).includes(WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES)\n\t\t\t\t? (DISCARD_UNSAVED_CHANGES = preferences[WORKSPACE_CONFIGS.DISCARD_UNSAVED_CHANGES] ?? false)\n\t\t\t\t: false;\n\t\t} else {\n\t\t\t// otherwise get the deprecated config\n\t\t\tconst { err: errValues, data: configValues } = await FSBL.Clients.ConfigClient.getValues([\n\t\t\t\tWORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY,\n\t\t\t]);\n\t\t\tif (errValues) {\n\t\t\t\tLogger.system.error(\"workspaceManagementMenuStore.getPreferences - getValues\", errValues);\n\t\t\t}\n\t\t\tPROMPT_ON_DIRTY_WORKSPACE = configValues\n\t\t\t\t? configValues[WORKSPACE_CONFIGS.DEPRECATED_PROMPT_ON_DIRTY] ?? true\n\t\t\t\t: true;\n\t\t\tFSBL.Clients.ConfigClient.setPreference({\n\t\t\t\tfield: WORKSPACE_CONFIGS.PROMPT_USER_ON_DIRTY_WORKSPACE,\n\t\t\t\tvalue: PROMPT_ON_DIRTY_WORKSPACE,\n\t\t\t});\n\t\t}\n\n\t\tdone();\n\t})();\n}\n\n/**\n * Initializes the store for the Workspace Management Menu.\n */\nfunction initialize(cb: any) {\n\tStoreClient = FSBL.Clients.DistributedStoreClient;\n\t// eslint-disable-next-line prefer-destructuring\n\tLogger = FSBL.Clients.Logger;\n\tasync.parallel([createGlobalStore, createLocalStore, getPreferences, addListeners], () => {\n\t\tActions.initialize();\n\t\tcb(WorkspaceManagementStore);\n\t});\n}\n\nlet getStore = () => WorkspaceManagementStore;\n\n/**\n * This is a quick little initialization manager that Terry hacked up.\n * Ultimately everything in this file should be rewritten in hooks/redux pattern.\n */\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store !== null) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport {\n\tstoreManager,\n\tWorkspaceManagementGlobalStore as GlobalStore,\n\tinitialize,\n\tWorkspaceManagementStore as Store,\n\tActions,\n\tgetStore,\n};\n"]}