@finsemble/finsemble-ui 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -14
- package/react/assets/css/button.css +34 -6
- package/react/assets/css/contextMenu.css +118 -0
- package/react/assets/css/notificationsCenter.css +3 -214
- package/react/assets/css/userPreferences.css +2 -2
- package/react/components/common/Checkbox.d.ts +3 -2
- package/react/components/common/Checkbox.js +5 -21
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/ContextMenu.d.ts +13 -0
- package/react/components/common/ContextMenu.js +69 -0
- package/react/components/common/ContextMenu.js.map +1 -0
- package/react/components/common/DropdownButton.d.ts +0 -4
- package/react/components/common/DropdownButton.js +39 -10
- package/react/components/common/DropdownButton.js.map +1 -1
- package/react/components/common/css/FinsembleToggle.css +0 -1
- package/react/components/common/css/application-edit-page.css +3 -4
- package/react/components/common/css/checkbox.css +60 -21
- package/react/components/common/css/icon.css +2 -2
- package/react/components/common/css/toggle.css +4 -1
- package/react/components/common/helpers.js +9 -0
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/ContextMenu.stories.d.ts +38 -0
- package/react/components/common/stories/ContextMenu.stories.js +70 -0
- package/react/components/common/stories/ContextMenu.stories.js.map +1 -0
- package/react/components/common/stories/DropdownButton.stories.d.ts +3 -3
- package/react/components/common/stories/DropdownButton.stories.js +11 -10
- package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
- package/react/components/common/tests/Checkbox.spec.js +10 -12
- package/react/components/common/tests/Checkbox.spec.js.map +1 -1
- package/react/components/common/tests/ContextMenu.spec.d.ts +1 -0
- package/react/components/common/tests/ContextMenu.spec.js +108 -0
- package/react/components/common/tests/ContextMenu.spec.js.map +1 -0
- package/react/components/common/tests/DropdownButton.spec.d.ts +1 -0
- package/react/components/common/tests/DropdownButton.spec.js +32 -0
- package/react/components/common/tests/DropdownButton.spec.js.map +1 -0
- package/react/components/fdc3Resolver/ResolverDialog.js +5 -1
- package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerHeader.js +3 -3
- package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +1 -0
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +2 -0
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/IconButton.js +2 -1
- package/react/components/notifications/components/shared/IconButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +2 -0
- package/react/components/notifications/components/shared/NotificationCardShell.js +55 -49
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js +2 -3
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +4 -0
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js +92 -13
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js +5 -9
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/css/notification-card.css +165 -0
- package/react/components/notifications/stories/NotificationCardShell.stories.d.ts +14 -0
- package/react/components/notifications/stories/NotificationCardShell.stories.js +108 -0
- package/react/components/notifications/stories/NotificationCardShell.stories.js.map +1 -0
- package/react/components/notifications/tests/NotificationCardShell.spec.d.ts +1 -0
- package/react/components/notifications/tests/NotificationCardShell.spec.js +91 -0
- package/react/components/notifications/tests/NotificationCardShell.spec.js.map +1 -0
- package/react/components/notifications/types.d.ts +4 -2
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/sdd/AddApp.d.ts +3 -3
- package/react/components/sdd/AddApp.js +29 -21
- package/react/components/sdd/AddApp.js.map +1 -1
- package/react/components/sdd/AppEditPage.js +1 -8
- package/react/components/sdd/AppEditPage.js.map +1 -1
- package/react/components/sdd/Appearance.css +2 -1
- package/react/components/sdd/Applications.js +7 -7
- package/react/components/sdd/Applications.js.map +1 -1
- package/react/components/sdd/Navigation.js +2 -4
- package/react/components/sdd/Navigation.js.map +1 -1
- package/react/components/sdd/common/views.js +1 -14
- package/react/components/sdd/common/views.js.map +1 -1
- package/react/components/sdd/css/addApp.css +64 -1
- package/react/components/sdd/css/nav.css +50 -29
- package/react/components/sdd/fixtures/views.js +1 -14
- package/react/components/sdd/fixtures/views.js.map +1 -1
- package/react/components/sdd/tests/AddApp.spec.js +2 -2
- package/react/components/sdd/tests/AddApp.spec.js.map +1 -1
- package/react/components/sdd/tests/AppEditPage.spec.js +5 -8
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/sdd/tests/Export.spec.js +11 -11
- package/react/components/sdd/tests/Export.spec.js.map +1 -1
- package/react/components/sdd/tests/ExportZip.spec.js +3 -3
- package/react/components/sdd/tests/ExportZip.spec.js.map +1 -1
- package/react/components/sdd/tests/Navigation.spec.js +3 -2
- package/react/components/sdd/tests/Navigation.spec.js.map +1 -1
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js +1 -2
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +18 -14
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +9 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +35 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +3 -1
- package/react/components/userPreferences/components/content/Workspaces.js +20 -3
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +1 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +3 -2
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +12 -9
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.js +2 -0
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +99 -26
- package/react/components/windowTitleBar/WindowTitleBarShell.js +206 -138
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js +30 -21
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/hooks/useNotifications.js +8 -7
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/tsconfig.tsbuildinfo +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +0 -16
- package/react/components/notifications/components/shared/OverflowMenu.js +0 -114
- package/react/components/notifications/components/shared/OverflowMenu.js.map +0 -1
- package/react/components/sdd/GettingStarted.d.ts +0 -8
- package/react/components/sdd/GettingStarted.js +0 -25
- package/react/components/sdd/GettingStarted.js.map +0 -1
- package/react/components/sdd/stories/GettingStarted.stories.d.ts +0 -11
- package/react/components/sdd/stories/GettingStarted.stories.js +0 -18
- package/react/components/sdd/stories/GettingStarted.stories.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspaces.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/content/Workspaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MA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{ Util } from \"@finsemble/finsemble-api\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport { Actions as WorkspaceManagementMenuActions } from \"../../../toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore\";\nimport { WorkspaceManagementMenuStore } from \"../../stores/UserPreferencesStore\";\nimport { Checkbox } from \"../../../common/Checkbox\";\nimport { WorkspaceButton } from \"../workspaces/WorkspaceButton\";\nimport WorkspaceComponents from \"../workspaces/WorkspaceComponents\";\nimport WorkspaceItemList from \"../workspaces/WorkspaceItemList\";\nimport { Workspace, ImportWorkspace, WorkspaceTemplate } from \"../../../../types/workspaceTypes\";\n\ninterface IProps {\n\taddListener: (fieldListener: { field: string }, cb: (err: StandardError, data: any) => void) => void;\n\tgetValue: (fieldName: { field: string }, cb: (err: StandardError, data: Workspace[]) => void) => void;\n\tremoveListener: (fieldName: { field: string }, cb: (err: StandardError, data: any) => void) => void;\n}\n\ninterface IState {\n\tinitialAlwaysOnTop: boolean;\n\talwaysOnTop: boolean;\n\tworkspaceList: Workspace[];\n\tfocusedWorkspace: string;\n\tediting: boolean;\n\tworkspaceBeingEdited: string;\n\ttemplateName: string;\n\tadding: boolean;\n\tworkspaceToLoadOnStart: string | null;\n\tfocusedWorkspaceComponentList: string[];\n\n\tpromptUserOnDirtyWorkspace: boolean;\n\tdiscardUnsavedChanges: boolean;\n}\n\nconst WORKSPACE_PREFERENCES = {\n\tPROMPT_USER_ON_DIRTY_WORKSPACE: \"finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace\",\n\tDISCARD_UNSAVED_CHANGES: \"finsemble.servicesConfig.workspace.discardUnsavedChanges\",\n\tINITIAL_WORKSPACE_PREFERENCE: \"finsemble.initialWorkspace\",\n};\n\nexport default class Workspaces extends React.Component<IProps, IState> {\n\taddWorkspace?: () => void;\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tadding: false,\n\t\t\tediting: false,\n\t\t\tworkspaceList: [],\n\t\t\tfocusedWorkspace: \"\",\n\t\t\tworkspaceToLoadOnStart: null,\n\t\t\ttemplateName: \"\",\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t\tfocusedWorkspaceComponentList: [],\n\t\t\tinitialAlwaysOnTop: finsembleWindow.windowOptions?.alwaysOnTop,\n\t\t\talwaysOnTop: finsembleWindow.windowOptions?.alwaysOnTop,\n\t\t\tpromptUserOnDirtyWorkspace: true,\n\t\t\tdiscardUnsavedChanges: false,\n\t\t};\n\t\tthis.bindCorrectContext();\n\t\tthis.addListeners();\n\t}\n\n\tresetState() {\n\t\tthis.setState({\n\t\t\tadding: false,\n\t\t\tediting: false,\n\t\t\tfocusedWorkspace: \"\",\n\t\t\ttemplateName: \"\",\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t});\n\t}\n\n\tbindCorrectContext() {\n\t\tthis.deleteWorkspace = this.deleteWorkspace.bind(this);\n\t\tthis.addListeners = this.addListeners.bind(this);\n\t\tthis.setWorkspaceList = this.setWorkspaceList.bind(this);\n\t\tthis.onDragEnd = this.onDragEnd.bind(this);\n\t\tthis.startEditingWorkspace = this.startEditingWorkspace.bind(this);\n\t\tthis.renameWorkspace = this.renameWorkspace.bind(this);\n\t\tthis.cancelEdit = this.cancelEdit.bind(this);\n\t\tthis.setWorkspaceToLoadOnStart = this.setWorkspaceToLoadOnStart.bind(this);\n\t\tthis.setUIPreferencesState = this.setUIPreferencesState.bind(this);\n\t\tthis.exportWorkspace = this.exportWorkspace.bind(this);\n\t\tthis.handleButtonClicks = this.handleButtonClicks.bind(this);\n\t\tthis.getFocusedWorkspaceComponentList = this.getFocusedWorkspaceComponentList.bind(this);\n\t\tthis.changePreferencesAlwaysOnTop = this.changePreferencesAlwaysOnTop.bind(this);\n\t\tthis.openFileDialog = this.openFileDialog.bind(this);\n\t\tthis.preferencesFocused = this.preferencesFocused.bind(this);\n\t\tthis.setFocusedWorkspace = this.setFocusedWorkspace.bind(this);\n\n\t\tthis.toggleDiscardUnsavedChanges = this.toggleDiscardUnsavedChanges.bind(this);\n\t\tthis.togglePromptUserOnDirtyWorkspace = this.togglePromptUserOnDirtyWorkspace.bind(this);\n\t}\n\n\tsetWorkspaceList(err: StandardError, data: { value: Workspace[] }) {\n\t\tif (!data) return;\n\t\tthis.setState({\n\t\t\tworkspaceList: data.value,\n\t\t});\n\t}\n\n\taddListeners() {\n\t\tthis.props.addListener({ field: \"WorkspaceList\" }, this.setWorkspaceList);\n\t\tthis.props.addListener({ field: \"preferences\" }, this.setUIPreferencesState);\n\t\tFSBL.Clients.WorkspaceClient.addEventListener(\"save-complete\", this.getFocusedWorkspaceComponentList);\n\t}\n\n\t/**\n\t * Sets the windowOptions.alwaysOnTop to the value supplied. The preferences component should\n\t * not be always on top when a file dialog is open.\n\t * @param {boolean} alwaysOnTop The value to set finsembleWindow.options.alwaysOnTop\n\t */\n\tchangePreferencesAlwaysOnTop(alwaysOnTop: boolean) {\n\t\t// The initialAlwaysOnTop check is to prevent making a component be alwaysOnTop when the\n\t\t// client may have set it to alwaysOnTop:false in the config. If that's the case, it should\n\t\t// never set its alwaysOnTop to true and should always remain unchanged\n\t\tif (this.state.initialAlwaysOnTop) {\n\t\t\tFSBL.Clients.WindowClient.setAlwaysOnTop(alwaysOnTop, () => {\n\t\t\t\tthis.setState({\n\t\t\t\t\talwaysOnTop,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\tonDragEnd({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) {\n\t\tlet workspaces = JSON.parse(JSON.stringify(this.state.workspaceList));\n\t\tlet workspaceToMove = JSON.parse(JSON.stringify(workspaces[oldIndex]));\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tthis.setState({\n\t\t\tworkspaceList: workspaces,\n\t\t});\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"reorderWorkspace\",\n\t\t\tdata: { oldIndex, newIndex },\n\t\t});\n\t}\n\n\t// returns all the component types of a template definition to display to user for additional info. If multiple components with same type, then instead of listing each\n\t// individually, only one entry will be returned with the count in parentheses.\n\tgetComponentTypes(templateObject: WorkspaceTemplate) {\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes templateObject\", templateObject);\n\t\tlet componentType: string;\n\t\tlet componentMap: { [key: string]: number } = {};\n\t\tlet annotatedComponentList = [];\n\t\tfor (let i = 0; i < templateObject.windows.length; i++) {\n\t\t\tconst windowData = templateObject.windowData[i];\n\t\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes loop\", windowData);\n\t\t\tcomponentType = \"Unknown Component\";\n\t\t\tif (windowData) {\n\t\t\t\t// current assimilation doesn't fill in windowData, so in this case use \"Unknown Component\" for component type\n\t\t\t\tcomponentType = windowData.componentType || windowData.customData.component.type;\n\t\t\t} else {\n\t\t\t\tcomponentType = \"Unknown Component\";\n\t\t\t}\n\t\t\tif (!componentMap[componentType]) {\n\t\t\t\tcomponentMap[componentType] = 1;\n\t\t\t} else {\n\t\t\t\tcomponentMap[componentType]++;\n\t\t\t}\n\t\t}\n\n\t\tconst componentTypes = Object.keys(componentMap);\n\t\tfor (let i = 0; i < componentTypes.length; i++) {\n\t\t\tlet annotatedName = componentTypes[i];\n\t\t\tlet identicalCount = componentMap[componentTypes[i]];\n\t\t\tif (identicalCount > 1) {\n\t\t\t\tannotatedName = `${annotatedName} (${identicalCount})`;\n\t\t\t}\n\t\t\tannotatedComponentList.push(annotatedName);\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes\", annotatedComponentList);\n\t\treturn annotatedComponentList;\n\t}\n\n\tsetFocusedWorkspace(workspace: string) {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tfocusedWorkspace: workspace,\n\t\t\t},\n\t\t\t() => this.getFocusedWorkspaceComponentList()\n\t\t);\n\t}\n\n\tcancelEdit() {\n\t\tif (this.state.adding) {\n\t\t\tlet { workspaceList } = this.state;\n\t\t\tworkspaceList.pop();\n\t\t\tthis.setFocusedWorkspace(\"\");\n\t\t\tthis.setState({\n\t\t\t\tworkspaceList: workspaceList,\n\t\t\t});\n\t\t}\n\t\tthis.setState({\n\t\t\tediting: false,\n\t\t\tadding: false,\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t});\n\t}\n\n\trenameWorkspace(newName: string) {\n\t\tlet oldName = this.state.workspaceBeingEdited;\n\t\tif (oldName === \"\") {\n\t\t\treturn this.cancelEdit();\n\t\t}\n\n\t\tif (newName === oldName || newName.trim() === \"\") return this.cancelEdit();\n\n\t\tlet newNameCamelCase = Util.camelCase(newName);\n\t\tif (this.state.workspaceList.some((workspace) => Util.camelCase(workspace.name) === newNameCamelCase)) {\n\t\t\tlet notification = new FSBL.Clients.NotificationClient.Notification();\n\t\t\tnotification.source = \"Finsemble\";\n\t\t\tnotification.title = \"Workspace renaming\";\n\t\t\tnotification.details = `Sorry, unable to rename workspace to \"${newName}\". Please use another name.`;\n\t\t\tFSBL.Clients.NotificationClient.notify(notification);\n\t\t\treturn this.cancelEdit();\n\t\t}\n\n\t\tlet updatedWorkspaceList = this.state.workspaceList;\n\t\tlet index = updatedWorkspaceList.findIndex((el) => el.name === oldName);\n\t\t// Set state locally so that the text doesn't change when the input field unmounts.\n\t\tif (index !== -1) {\n\t\t\tupdatedWorkspaceList[index].name = newName;\n\t\t\tthis.setState({\n\t\t\t\tworkspaceList: updatedWorkspaceList,\n\t\t\t});\n\t\t}\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"renameWorkspace\",\n\t\t\tdata: {\n\t\t\t\toldName: oldName,\n\t\t\t\tnewName: newName,\n\t\t\t},\n\t\t});\n\t\tif (this.state.workspaceToLoadOnStart === oldName) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tfocusedWorkspace: newName,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tthis.setWorkspaceToLoadOnStart(() => {\n\t\t\t\t\t\tthis.cancelEdit();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tthis.cancelEdit();\n\t\t}\n\t}\n\n\tstartEditingWorkspace(e: React.SyntheticEvent, workspaceName = this.state.focusedWorkspace) {\n\t\t// without preventing this event from reaching the finsemble draggable,\n\t\t// the editor will lose focus and you won't be able to rename your workspaces\n\t\te.stopPropagation();\n\t\tthis.setState({\n\t\t\tediting: true,\n\t\t\tfocusedWorkspace: workspaceName,\n\t\t\tworkspaceBeingEdited: workspaceName,\n\t\t});\n\t}\n\n\tstartExportingTemplate() {\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"exportWorkspace\",\n\t\t\tdata: {\n\t\t\t\tname: this.state.focusedWorkspace,\n\t\t\t},\n\t\t});\n\t}\n\n\tstartImportingTemplate() {\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"importTemplate\",\n\t\t\tdata: {\n\t\t\t\tname: this.state.templateName,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeleteWorkspace(workspaceName = this.state.focusedWorkspace) {\n\t\tthis.resetState();\n\n\t\tconst removeWorkspaceFromList = (wasDeleted: boolean) => {\n\t\t\tif (wasDeleted) {\n\t\t\t\tlet workspaceListCopy = [...this.state.workspaceList];\n\t\t\t\tworkspaceListCopy = workspaceListCopy.filter((workspace) => workspace.name !== workspaceName);\n\t\t\t\t// If we just removed the workspace configured to be loaded at startup\n\t\t\t\t// we need to unset initial workspace preference\n\t\t\t\tif (workspaceName === this.state.workspaceToLoadOnStart) {\n\t\t\t\t\tthis.setState({ workspaceToLoadOnStart: null }, () =>\n\t\t\t\t\t\tFSBL.Clients.ConfigClient.unsetPreference({ field: WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE })\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthis.setState({ workspaceList: workspaceListCopy });\n\t\t\t}\n\t\t};\n\t\tconst data = {\n\t\t\tname: workspaceName,\n\t\t\thideModalOnClose: false,\n\t\t};\n\n\t\tWorkspaceManagementMenuActions.removeWorkspace(data, removeWorkspaceFromList);\n\t}\n\n\tsetUIPreferencesState(err: StandardError, data: any) {\n\t\tconst { value } = data || {};\n\t\tif (!value) return;\n\t\tthis.setState({\n\t\t\tworkspaceToLoadOnStart: data.value[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE],\n\t\t\tfocusedWorkspace:\n\t\t\t\tdata.value[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE] || this.state.workspaceList[0].name,\n\t\t\tpromptUserOnDirtyWorkspace: data.value[WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE],\n\t\t\tdiscardUnsavedChanges: data.value[WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES],\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\t// load preferences values from config and set component state on mount\n\t\tFSBL.Clients.ConfigClient.getValues(\n\t\t\t[\n\t\t\t\tWORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE,\n\t\t\t\tWORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES,\n\t\t\t\tWORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE,\n\t\t\t],\n\t\t\t(err, values) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tFSBL.Clients.Logger.system.info(\"componentDidMount.getValues error\", err);\n\t\t\t\t}\n\n\t\t\t\tif (values) {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tworkspaceToLoadOnStart: values[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE],\n\t\t\t\t\t\tfocusedWorkspace:\n\t\t\t\t\t\t\tvalues[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE] ??\n\t\t\t\t\t\t\tFSBL.Clients.WorkspaceClient.activeWorkspace?.name,\n\t\t\t\t\t\tpromptUserOnDirtyWorkspace: values[WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE],\n\t\t\t\t\t\tdiscardUnsavedChanges: values[WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.props.getValue({ field: \"WorkspaceList\" }, (err: StandardError, data: Workspace[]) => {\n\t\t\tif (data && data.length) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tworkspaceList: data,\n\t\t\t\t\t// set the first workspace from list as focused\n\t\t\t\t\tfocusedWorkspace: data[0].name,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.props.removeListener({ field: \"preferences\" }, this.setUIPreferencesState);\n\t}\n\n\tsetPreference(field: string, value: any, cb?: Function) {\n\t\tFSBL.Clients.ConfigClient.setPreference(\n\t\t\t{\n\t\t\t\tfield,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t}\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tsetWorkspaceToLoadOnStart(\n\t\teventOrCb: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | (() => void)\n\t) {\n\t\tif (!this.state.focusedWorkspace) return;\n\t\tif (this.state.focusedWorkspace === this.state.workspaceToLoadOnStart) {\n\t\t\tthis.setState({ workspaceToLoadOnStart: null }, () =>\n\t\t\t\tthis.setPreference(WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE, null)\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tworkspaceToLoadOnStart: this.state.focusedWorkspace,\n\t\t\t\t},\n\t\t\t\t() => this.setPreference(WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE, this.state.focusedWorkspace)\n\t\t\t);\n\t\t}\n\n\t\tif (typeof eventOrCb === \"function\") {\n\t\t\teventOrCb();\n\t\t}\n\t}\n\n\topenFileDialog() {\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\n\t\t// then reset always on top\n\t\tthis.changePreferencesAlwaysOnTop(false);\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\n\t\tlet inputElement = document.getElementById(\"file-input\");\n\t\tinputElement?.addEventListener(\"change\", this.importWorkspace as ImportWorkspace, false);\n\t\tinputElement?.click();\n\t}\n\n\t/**\n\t * If the event is being listened to, when the preferences component is focused\n\t * it will set always on top to true, and remove the event listener\n\t *\n\t * This is to handle bringing alwaysOnTop back to true when file dialogs are closed\n\t * without changes (also handles bringing back to front after exporting)\n\t */\n\tpreferencesFocused() {\n\t\tfinsembleWindow.removeEventListener(\"focused\", this.preferencesFocused);\n\t\tthis.changePreferencesAlwaysOnTop(true);\n\t}\n\n\timportWorkspace(\n\t\tevt: Event & {\n\t\t\ttarget: {\n\t\t\t\tfiles: File[];\n\t\t\t\tvalue?: string | string[];\n\t\t\t};\n\t\t}\n\t): void {\n\t\tlet inputElement = document.getElementById(\"file-input\") as HTMLInputElement;\n\t\tinputElement?.removeEventListener(\"change\", this.importWorkspace as ImportWorkspace);\n\t\tconst { files } = evt.target; // FileList object\n\n\t\tfunction loadFile(file: File, done: () => void) {\n\t\t\tconst reader = new FileReader();\n\t\t\tlet fileName = evt.target.value;\n\t\t\t// When the file info is loaded, we get into here..\n\t\t\treader.onload = function (e) {\n\t\t\t\ttry {\n\t\t\t\t\tfileName = (fileName as string).split(\"\\\\\");\n\t\t\t\t\tfileName = fileName[fileName.length - 1].replace(\".json\", \"\");\n\t\t\t\t\tlet workspaceTemplateDefinition = JSON.parse(e?.target?.result as string);\n\t\t\t\t\tlet templateName = Object.keys(workspaceTemplateDefinition.workspaceTemplates)[0];\n\t\t\t\t\tif (fileName !== templateName) {\n\t\t\t\t\t\t// We want the file name to overwrite the name of the workspace that was saved as the template..\n\t\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName] =\n\t\t\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[templateName];\n\t\t\t\t\t\tdelete workspaceTemplateDefinition.workspaceTemplates[templateName];\n\t\t\t\t\t}\n\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName].name = fileName;\n\t\t\t\t\tFSBL.Clients.WorkspaceClient.import(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tworkspaceJSONDefinition: workspaceTemplateDefinition.workspaceTemplates,\n\t\t\t\t\t\t\tforce: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err: StandardError) => {\n\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\tFSBL.Clients.Logger.system.info(\"addWorkspaceTemplateDefinition error\", err);\n\t\t\t\t\t\t\t\tFSBL.UserNotification.alert(\n\t\t\t\t\t\t\t\t\t\"system\",\n\t\t\t\t\t\t\t\t\t\"ALWAYS\",\n\t\t\t\t\t\t\t\t\t\"FSBL-Workspace-Import-Error\",\n\t\t\t\t\t\t\t\t\t\"The workspace can't be imported and it could be corrupt. Check the Central Logger for any errors.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} catch (error: any) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(error);\n\t\t\t\t\tFSBL.UserNotification.alert(\n\t\t\t\t\t\t\"system\",\n\t\t\t\t\t\t\"ALWAYS\",\n\t\t\t\t\t\t\"FSBL-Workspace-Import-Error\",\n\t\t\t\t\t\t\"The workspace can't be imported and it could be corrupt. Check the Central Logger for any errors.\"\n\t\t\t\t\t);\n\t\t\t\t\tdone();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Read in the image file as a data URL.\n\t\t\treader.readAsText(file);\n\t\t}\n\n\t\tasync.each(files, loadFile, () => {\n\t\t\t// Clear out files. so if the user imports the same file back-to-back, the event will fire.\n\t\t\tif (inputElement?.value) {\n\t\t\t\tinputElement.value = \"\";\n\t\t\t}\n\t\t\tFSBL.Clients.Logger.system.info(\"Workspaces imported\");\n\t\t});\n\t}\n\n\texportWorkspace() {\n\t\tif (this.state.focusedWorkspace === \"\") return;\n\t\tconst doExport = () => {\n\t\t\tFSBL.Clients.WorkspaceClient.export(\n\t\t\t\t{ workspaceName: this.state.focusedWorkspace },\n\t\t\t\t(err: StandardError, workspaceDefinition: string) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tFSBL.Clients.Logger.system.error(\"export error\", err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We're saving using a routine initially created for templates. The outcome is the same and it probably should have just been \"Save to file\". This bool is to allow it to save.\n\t\t\t\t\t\tFSBL.ConfigUtils.promptAndSaveJSONToLocalFile(this.state.focusedWorkspace, {\n\t\t\t\t\t\t\tworkspaceTemplates: workspaceDefinition,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\n\t\t// then reset always on top\n\t\tthis.changePreferencesAlwaysOnTop(false);\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\n\t\t// If we're autosaving, autosave, then export.\n\t\tFSBL.Clients.ConfigClient.getValue(\n\t\t\t{\n\t\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\n\t\t\t},\n\t\t\t(err, data) => {\n\t\t\t\t// default to false.\n\t\t\t\tlet PROMPT_ON_SAVE = data === null ? false : data;\n\t\t\t\tif (!PROMPT_ON_SAVE) {\n\t\t\t\t\tlet activeName = FSBL?.Clients?.WorkspaceClient?.activeWorkspace?.name;\n\t\t\t\t\treturn FSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: activeName,\n\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tdoExport();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdoExport();\n\t\t\t}\n\t\t);\n\t}\n\n\thandleButtonClicks(e: React.MouseEvent<HTMLDivElement>) {\n\t\tif (this.state.adding || this.state.editing) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\tasync getFocusedWorkspaceComponentList() {\n\t\tlet { focusedWorkspace } = this.state;\n\t\tif (focusedWorkspace === \"\") return [];\n\n\t\tconst workspaceDefinition: {\n\t\t\t[key: string]: WorkspaceTemplate;\n\t\t} = (await FSBL.Clients.WorkspaceClient.export({ workspaceName: focusedWorkspace }, () => {})) as {\n\t\t\t[key: string]: WorkspaceTemplate;\n\t\t};\n\t\tif (workspaceDefinition) {\n\t\t\tconst workspaceComponents = this.getComponentTypes(workspaceDefinition[focusedWorkspace]);\n\t\t\tif (workspaceComponents) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tfocusedWorkspaceComponentList: workspaceComponents,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleDiscardUnsavedChanges() {\n\t\tconst newValue = !this.state.discardUnsavedChanges;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tdiscardUnsavedChanges: newValue,\n\t\t\t},\n\t\t\t() => this.setPreference(WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES, newValue)\n\t\t);\n\t}\n\n\ttogglePromptUserOnDirtyWorkspace() {\n\t\tconst newValue = !this.state.promptUserOnDirtyWorkspace;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tpromptUserOnDirtyWorkspace: newValue,\n\t\t\t\tdiscardUnsavedChanges: newValue ? false : this.state.discardUnsavedChanges,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.setPreference(WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE, newValue);\n\t\t\t\tif (newValue) {\n\t\t\t\t\tthis.setPreference(WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES, false);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\trender() {\n\t\tlet deleteButtonClasses = \"individual-workspace-action delete-workspace\",\n\t\t\trenameButtonClasses = \"individual-workspace-action\",\n\t\t\tallowDelete = true,\n\t\t\tallowExport = true,\n\t\t\tallowRename = true,\n\t\t\tallowImport = true,\n\t\t\tdeleteTooltip = \"Delete\";\n\n\t\tif (this.state.focusedWorkspace === FSBL?.Clients?.WorkspaceClient?.activeWorkspace?.name) {\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\n\t\t}\n\n\t\tif (this.state.focusedWorkspace === \"\") {\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-individual-workspace-action`;\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\n\t\t\tdeleteTooltip = \"No workspace selected\";\n\t\t\tallowRename = false;\n\t\t\tallowExport = false;\n\t\t\tallowDelete = false;\n\t\t}\n\n\t\tif (this.state.adding || this.state.editing) {\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-button`;\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-button`;\n\t\t\tallowDelete = false;\n\t\t\tallowExport = false;\n\t\t\tallowRename = false;\n\t\t\tallowImport = false;\n\t\t}\n\n\t\tlet importTooltip = \"Import workspace from file\",\n\t\t\texportTooltip = allowExport ? \"Export selected workspace\" : \"No workspace selected\",\n\t\t\trenameTooltip = allowRename ? \"Rename\" : \"Cannot Edit\";\n\n\t\treturn (\n\t\t\t<div style={{ paddingLeft: 10 }}>\n\t\t\t\t<input style={{ display: \"none\" }} type=\"file\" id=\"file-input\" />\n\t\t\t\t<div className=\"complex-menu-content-row\">\n\t\t\t\t\t<div className=\"workspace-list-header-row\">\n\t\t\t\t\t\t<div className=\"content-section-header workspace-list-header\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"content-section-wrapper\">\n\t\t\t\t\t\t<WorkspaceItemList\n\t\t\t\t\t\t\tonDragEnd={this.onDragEnd}\n\t\t\t\t\t\t\tworkspaceList={this.state.workspaceList}\n\t\t\t\t\t\t\tallowDelete={allowDelete}\n\t\t\t\t\t\t\tdeleteButtonClasses={deleteButtonClasses}\n\t\t\t\t\t\t\tdeleteTooltip={deleteTooltip}\n\t\t\t\t\t\t\tworkspaceToLoadOnStart={this.state.workspaceToLoadOnStart}\n\t\t\t\t\t\t\tfocusedWorkspace={this.state.focusedWorkspace}\n\t\t\t\t\t\t\tediting={this.state.editing}\n\t\t\t\t\t\t\tadding={this.state.adding}\n\t\t\t\t\t\t\trenameWorkspace={this.renameWorkspace}\n\t\t\t\t\t\t\taddWorkspace={this.addWorkspace}\n\t\t\t\t\t\t\tcancelEdit={this.cancelEdit}\n\t\t\t\t\t\t\tsetFocusedWorkspace={this.setFocusedWorkspace}\n\t\t\t\t\t\t\trenameTooltip={renameTooltip}\n\t\t\t\t\t\t\trenameButtonClasses={renameButtonClasses}\n\t\t\t\t\t\t\tallowRename={allowRename}\n\t\t\t\t\t\t\thandleButtonClicks={this.handleButtonClicks}\n\t\t\t\t\t\t\tstartEditingWorkspace={this.startEditingWorkspace}\n\t\t\t\t\t\t\tdeleteWorkspace={this.deleteWorkspace}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"workspace-extras\">\n\t\t\t\t\t\t\t<WorkspaceComponents focusedWorkspaceComponentList={this.state.focusedWorkspaceComponentList} />\n\t\t\t\t\t\t\t<div className=\"workspace-action-buttons\">\n\t\t\t\t\t\t\t\t<WorkspaceButton\n\t\t\t\t\t\t\t\t\ttitle={importTooltip}\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\tonClick={allowImport ? this.openFileDialog : () => {}}\n\t\t\t\t\t\t\t\t\ttype=\"import\"\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t<WorkspaceButton\n\t\t\t\t\t\t\t\t\ttitle={exportTooltip}\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\tonClick={allowExport ? this.exportWorkspace : () => {}}\n\t\t\t\t\t\t\t\t\ttype=\"export\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tdisabled={!this.state.focusedWorkspace}\n\t\t\t\t\t\tonClick={this.setWorkspaceToLoadOnStart}\n\t\t\t\t\t\tchecked={!!this.state.focusedWorkspace && this.state.focusedWorkspace === this.state.workspaceToLoadOnStart}\n\t\t\t\t\t\tlabel=\"Load this workspace on startup\"\n\t\t\t\t\t/>\n\t\t\t\t\t<> </>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tonClick={this.togglePromptUserOnDirtyWorkspace}\n\t\t\t\t\t\tchecked={this.state.promptUserOnDirtyWorkspace}\n\t\t\t\t\t\tlabel=\"Prompt user on dirty workspace\"\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"indent-15px\">\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tdisabled={this.state.promptUserOnDirtyWorkspace}\n\t\t\t\t\t\t\tonClick={this.toggleDiscardUnsavedChanges}\n\t\t\t\t\t\t\tchecked={this.state.discardUnsavedChanges}\n\t\t\t\t\t\t\tlabel=\"Discard unsaved changes\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Workspaces.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/content/Workspaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,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W,EAAE,IAAI,CAAC,kBAAkB,EACpC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,EACtD,IAAI,EAAC,QAAQ,GACZ,CACG,CACD,CACD;gBACN,oBAAC,QAAQ,IACR,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACtC,OAAO,EAAE,IAAI,CAAC,yBAAyB,EACvC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAC3G,KAAK,EAAC,gCAAgC,GACrC;gBACF,mDAAW;gBACX,oBAAC,QAAQ,IACR,OAAO,EAAE,IAAI,CAAC,gCAAgC,EAC9C,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAC9C,KAAK,EAAC,gCAAgC,GACrC;gBACF,8BAAM,SAAS,EAAC,YAAY;oBAC3B,oBAAC,QAAQ,IACR,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAC/C,OAAO,EAAE,IAAI,CAAC,2BAA2B,EACzC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACzC,KAAK,EAAC,yBAAyB,GAC9B,CACI,CACF,CACD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport async from \"async\";\nimport { Util } from \"@finsemble/finsemble-api\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport { Actions as WorkspaceManagementMenuActions } from \"../../../toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore\";\nimport { WorkspaceManagementMenuStore } from \"../../stores/UserPreferencesStore\";\nimport { Checkbox } from \"../../../common/Checkbox\";\nimport { WorkspaceButton } from \"../workspaces/WorkspaceButton\";\nimport WorkspaceComponents from \"../workspaces/WorkspaceComponents\";\nimport WorkspaceItemList from \"../workspaces/WorkspaceItemList\";\nimport { Workspace, ImportWorkspace, WorkspaceTemplate } from \"../../../../types/workspaceTypes\";\n\ninterface IProps {\n\taddListener: (fieldListener: { field: string }, cb: (err: StandardError, data: any) => void) => void;\n\tgetValue: (fieldName: { field: string }, cb: (err: StandardError, data: Workspace[]) => void) => void;\n\tremoveListener: (fieldName: { field: string }, cb: (err: StandardError, data: any) => void) => void;\n}\n\ninterface IState {\n\tinitialAlwaysOnTop: boolean;\n\talwaysOnTop: boolean;\n\tworkspaceList: Workspace[];\n\tfocusedWorkspace: string;\n\tediting: boolean;\n\tworkspaceBeingEdited: string;\n\ttemplateName: string;\n\tadding: boolean;\n\tworkspaceToLoadOnStart: string | null;\n\tfocusedWorkspaceComponentList: string[];\n\n\tpromptUserOnDirtyWorkspace: boolean;\n\tdiscardUnsavedChanges: boolean;\n\tpermanentWorkspaces: string[];\n}\n\nconst WORKSPACE_PREFERENCES = {\n\tPERMANENT_WORKSPACES: \"finsemble.servicesConfig.workspace.permanentWorkspaces\",\n\tPROMPT_USER_ON_DIRTY_WORKSPACE: \"finsemble.servicesConfig.workspace.promptUserOnDirtyWorkspace\",\n\tDISCARD_UNSAVED_CHANGES: \"finsemble.servicesConfig.workspace.discardUnsavedChanges\",\n\tINITIAL_WORKSPACE_PREFERENCE: \"finsemble.initialWorkspace\",\n};\n\nexport default class Workspaces extends React.Component<IProps, IState> {\n\taddWorkspace?: () => void;\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tadding: false,\n\t\t\tediting: false,\n\t\t\tworkspaceList: [],\n\t\t\tfocusedWorkspace: \"\",\n\t\t\tworkspaceToLoadOnStart: null,\n\t\t\ttemplateName: \"\",\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t\tfocusedWorkspaceComponentList: [],\n\t\t\tinitialAlwaysOnTop: finsembleWindow.windowOptions?.alwaysOnTop,\n\t\t\talwaysOnTop: finsembleWindow.windowOptions?.alwaysOnTop,\n\t\t\tpromptUserOnDirtyWorkspace: true,\n\t\t\tdiscardUnsavedChanges: false,\n\t\t\tpermanentWorkspaces: [],\n\t\t};\n\t\tthis.bindCorrectContext();\n\t\tthis.addListeners();\n\t}\n\n\tresetState() {\n\t\tthis.setState({\n\t\t\tadding: false,\n\t\t\tediting: false,\n\t\t\tfocusedWorkspace: \"\",\n\t\t\ttemplateName: \"\",\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t});\n\t}\n\n\tbindCorrectContext() {\n\t\tthis.deleteWorkspace = this.deleteWorkspace.bind(this);\n\t\tthis.addListeners = this.addListeners.bind(this);\n\t\tthis.setWorkspaceList = this.setWorkspaceList.bind(this);\n\t\tthis.onDragEnd = this.onDragEnd.bind(this);\n\t\tthis.startEditingWorkspace = this.startEditingWorkspace.bind(this);\n\t\tthis.renameWorkspace = this.renameWorkspace.bind(this);\n\t\tthis.cancelEdit = this.cancelEdit.bind(this);\n\t\tthis.setWorkspaceToLoadOnStart = this.setWorkspaceToLoadOnStart.bind(this);\n\t\tthis.setUIPreferencesState = this.setUIPreferencesState.bind(this);\n\t\tthis.exportWorkspace = this.exportWorkspace.bind(this);\n\t\tthis.handleButtonClicks = this.handleButtonClicks.bind(this);\n\t\tthis.getFocusedWorkspaceComponentList = this.getFocusedWorkspaceComponentList.bind(this);\n\t\tthis.changePreferencesAlwaysOnTop = this.changePreferencesAlwaysOnTop.bind(this);\n\t\tthis.openFileDialog = this.openFileDialog.bind(this);\n\t\tthis.preferencesFocused = this.preferencesFocused.bind(this);\n\t\tthis.setFocusedWorkspace = this.setFocusedWorkspace.bind(this);\n\n\t\tthis.toggleDiscardUnsavedChanges = this.toggleDiscardUnsavedChanges.bind(this);\n\t\tthis.togglePromptUserOnDirtyWorkspace = this.togglePromptUserOnDirtyWorkspace.bind(this);\n\t\tthis.setPermanentWorkspaces = this.setPermanentWorkspaces.bind(this);\n\t}\n\n\tsetWorkspaceList(err: StandardError, data: { value: Workspace[] }) {\n\t\tif (!data) return;\n\t\tthis.setState({\n\t\t\tworkspaceList: data.value,\n\t\t});\n\t}\n\n\tsetPermanentWorkspaces(err: StandardError, config: any) {\n\t\tFSBL.Clients.Logger.system.log(\"Workspaces new permanentWorkspaces config\", config);\n\t\tconst { permanentWorkspaces } = config.value.workspace;\n\t\tif (permanentWorkspaces && Array.isArray(permanentWorkspaces)) {\n\t\t\tthis.setState({\n\t\t\t\tpermanentWorkspaces: permanentWorkspaces,\n\t\t\t});\n\t\t}\n\t}\n\n\taddListeners() {\n\t\tthis.props.addListener({ field: \"WorkspaceList\" }, this.setWorkspaceList);\n\t\tthis.props.addListener({ field: \"preferences\" }, this.setUIPreferencesState);\n\t\tFSBL.Clients.WorkspaceClient.addEventListener(\"save-complete\", this.getFocusedWorkspaceComponentList);\n\t\t// Configuration listeners to update the WSM\n\t\tFSBL.Clients.ConfigClient.addListener({ field: \"finsemble.servicesConfig\" }, this.setPermanentWorkspaces);\n\t}\n\n\t/**\n\t * Sets the windowOptions.alwaysOnTop to the value supplied. The preferences component should\n\t * not be always on top when a file dialog is open.\n\t * @param {boolean} alwaysOnTop The value to set finsembleWindow.options.alwaysOnTop\n\t */\n\tchangePreferencesAlwaysOnTop(alwaysOnTop: boolean) {\n\t\t// The initialAlwaysOnTop check is to prevent making a component be alwaysOnTop when the\n\t\t// client may have set it to alwaysOnTop:false in the config. If that's the case, it should\n\t\t// never set its alwaysOnTop to true and should always remain unchanged\n\t\tif (this.state.initialAlwaysOnTop) {\n\t\t\tFSBL.Clients.WindowClient.setAlwaysOnTop(alwaysOnTop, () => {\n\t\t\t\tthis.setState({\n\t\t\t\t\talwaysOnTop,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\tonDragEnd({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) {\n\t\tlet workspaces = JSON.parse(JSON.stringify(this.state.workspaceList));\n\t\tlet workspaceToMove = JSON.parse(JSON.stringify(workspaces[oldIndex]));\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tthis.setState({\n\t\t\tworkspaceList: workspaces,\n\t\t});\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"reorderWorkspace\",\n\t\t\tdata: { oldIndex, newIndex },\n\t\t});\n\t}\n\n\t// returns all the component types of a template definition to display to user for additional info. If multiple components with same type, then instead of listing each\n\t// individually, only one entry will be returned with the count in parentheses.\n\tgetComponentTypes(templateObject: WorkspaceTemplate) {\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes templateObject\", templateObject);\n\t\tlet componentType: string;\n\t\tlet componentMap: { [key: string]: number } = {};\n\t\tlet annotatedComponentList = [];\n\t\tfor (let i = 0; i < templateObject.windows.length; i++) {\n\t\t\tconst windowData = templateObject.windowData[i];\n\t\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes loop\", windowData);\n\t\t\tcomponentType = \"Unknown Component\";\n\t\t\tif (windowData) {\n\t\t\t\t// current assimilation doesn't fill in windowData, so in this case use \"Unknown Component\" for component type\n\t\t\t\tcomponentType = windowData.componentType || windowData.customData.component.type;\n\t\t\t} else {\n\t\t\t\tcomponentType = \"Unknown Component\";\n\t\t\t}\n\t\t\tif (!componentMap[componentType]) {\n\t\t\t\tcomponentMap[componentType] = 1;\n\t\t\t} else {\n\t\t\t\tcomponentMap[componentType]++;\n\t\t\t}\n\t\t}\n\n\t\tconst componentTypes = Object.keys(componentMap);\n\t\tfor (let i = 0; i < componentTypes.length; i++) {\n\t\t\tlet annotatedName = componentTypes[i];\n\t\t\tlet identicalCount = componentMap[componentTypes[i]];\n\t\t\tif (identicalCount > 1) {\n\t\t\t\tannotatedName = `${annotatedName} (${identicalCount})`;\n\t\t\t}\n\t\t\tannotatedComponentList.push(annotatedName);\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"getComponentTypes\", annotatedComponentList);\n\t\treturn annotatedComponentList;\n\t}\n\n\tsetFocusedWorkspace(workspace: string) {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tfocusedWorkspace: workspace,\n\t\t\t},\n\t\t\t() => this.getFocusedWorkspaceComponentList()\n\t\t);\n\t}\n\n\tcancelEdit() {\n\t\tif (this.state.adding) {\n\t\t\tlet { workspaceList } = this.state;\n\t\t\tworkspaceList.pop();\n\t\t\tthis.setFocusedWorkspace(\"\");\n\t\t\tthis.setState({\n\t\t\t\tworkspaceList: workspaceList,\n\t\t\t});\n\t\t}\n\t\tthis.setState({\n\t\t\tediting: false,\n\t\t\tadding: false,\n\t\t\tworkspaceBeingEdited: \"\",\n\t\t});\n\t}\n\n\trenameWorkspace(newName: string) {\n\t\tlet oldName = this.state.workspaceBeingEdited;\n\t\tif (oldName === \"\") {\n\t\t\treturn this.cancelEdit();\n\t\t}\n\n\t\tif (newName === oldName || newName.trim() === \"\") return this.cancelEdit();\n\n\t\tlet newNameCamelCase = Util.camelCase(newName);\n\t\tif (this.state.workspaceList.some((workspace) => Util.camelCase(workspace.name) === newNameCamelCase)) {\n\t\t\tlet notification = new FSBL.Clients.NotificationClient.Notification();\n\t\t\tnotification.source = \"Finsemble\";\n\t\t\tnotification.title = \"Workspace renaming\";\n\t\t\tnotification.details = `Sorry, unable to rename workspace to \"${newName}\". Please use another name.`;\n\t\t\tFSBL.Clients.NotificationClient.notify(notification);\n\t\t\treturn this.cancelEdit();\n\t\t}\n\n\t\tlet updatedWorkspaceList = this.state.workspaceList;\n\t\tlet index = updatedWorkspaceList.findIndex((el) => el.name === oldName);\n\t\t// Set state locally so that the text doesn't change when the input field unmounts.\n\t\tif (index !== -1) {\n\t\t\tupdatedWorkspaceList[index].name = newName;\n\t\t\tthis.setState({\n\t\t\t\tworkspaceList: updatedWorkspaceList,\n\t\t\t});\n\t\t}\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"renameWorkspace\",\n\t\t\tdata: {\n\t\t\t\toldName: oldName,\n\t\t\t\tnewName: newName,\n\t\t\t},\n\t\t});\n\t\tif (this.state.workspaceToLoadOnStart === oldName) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tfocusedWorkspace: newName,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tthis.setWorkspaceToLoadOnStart(() => {\n\t\t\t\t\t\tthis.cancelEdit();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tthis.cancelEdit();\n\t\t}\n\t}\n\n\tstartEditingWorkspace(e: React.SyntheticEvent, workspaceName = this.state.focusedWorkspace) {\n\t\t// without preventing this event from reaching the finsemble draggable,\n\t\t// the editor will lose focus and you won't be able to rename your workspaces\n\t\te.stopPropagation();\n\t\tthis.setState({\n\t\t\tediting: true,\n\t\t\tfocusedWorkspace: workspaceName,\n\t\t\tworkspaceBeingEdited: workspaceName,\n\t\t});\n\t}\n\n\tstartExportingTemplate() {\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"exportWorkspace\",\n\t\t\tdata: {\n\t\t\t\tname: this.state.focusedWorkspace,\n\t\t\t},\n\t\t});\n\t}\n\n\tstartImportingTemplate() {\n\t\tWorkspaceManagementMenuStore?.Dispatcher.dispatch({\n\t\t\tactionType: \"importTemplate\",\n\t\t\tdata: {\n\t\t\t\tname: this.state.templateName,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeleteWorkspace(workspaceName = this.state.focusedWorkspace) {\n\t\tthis.resetState();\n\n\t\tconst removeWorkspaceFromList = (wasDeleted: boolean) => {\n\t\t\tif (wasDeleted) {\n\t\t\t\tlet workspaceListCopy = [...this.state.workspaceList];\n\t\t\t\tworkspaceListCopy = workspaceListCopy.filter((workspace) => workspace.name !== workspaceName);\n\t\t\t\t// If we just removed the workspace configured to be loaded at startup\n\t\t\t\t// we need to unset initial workspace preference\n\t\t\t\tif (workspaceName === this.state.workspaceToLoadOnStart) {\n\t\t\t\t\tthis.setState({ workspaceToLoadOnStart: null }, () =>\n\t\t\t\t\t\tFSBL.Clients.ConfigClient.unsetPreference({ field: WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE })\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthis.setState({ workspaceList: workspaceListCopy });\n\t\t\t}\n\t\t};\n\t\tconst data = {\n\t\t\tname: workspaceName,\n\t\t\thideModalOnClose: false,\n\t\t};\n\n\t\tWorkspaceManagementMenuActions.removeWorkspace(data, removeWorkspaceFromList);\n\t}\n\n\tsetUIPreferencesState(err: StandardError, data: any) {\n\t\tconst { value } = data || {};\n\t\tif (!value) return;\n\t\tthis.setState({\n\t\t\tworkspaceToLoadOnStart: data.value[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE],\n\t\t\tfocusedWorkspace:\n\t\t\t\tdata.value[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE] || this.state.workspaceList[0].name,\n\t\t\tpromptUserOnDirtyWorkspace: data.value[WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE],\n\t\t\tdiscardUnsavedChanges: data.value[WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES],\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\t// load preferences values from config and set component state on mount\n\t\tFSBL.Clients.ConfigClient.getValues(\n\t\t\t[\n\t\t\t\tWORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE,\n\t\t\t\tWORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES,\n\t\t\t\tWORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE,\n\t\t\t\tWORKSPACE_PREFERENCES.PERMANENT_WORKSPACES,\n\t\t\t],\n\t\t\t(err, values) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tFSBL.Clients.Logger.system.info(\"componentDidMount.getValues error\", err);\n\t\t\t\t}\n\n\t\t\t\tif (values) {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tworkspaceToLoadOnStart: values[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE],\n\t\t\t\t\t\tfocusedWorkspace:\n\t\t\t\t\t\t\tvalues[WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE] ??\n\t\t\t\t\t\t\tFSBL.Clients.WorkspaceClient.activeWorkspace?.name,\n\t\t\t\t\t\tpromptUserOnDirtyWorkspace: values[WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE],\n\t\t\t\t\t\tdiscardUnsavedChanges: values[WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES],\n\t\t\t\t\t\tpermanentWorkspaces: values[WORKSPACE_PREFERENCES.PERMANENT_WORKSPACES],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.props.getValue({ field: \"WorkspaceList\" }, (err: StandardError, data: Workspace[]) => {\n\t\t\tif (data && data.length) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tworkspaceList: data,\n\t\t\t\t\t// set the first workspace from list as focused\n\t\t\t\t\tfocusedWorkspace: data[0].name,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.props.removeListener({ field: \"preferences\" }, this.setUIPreferencesState);\n\t\tFSBL.Clients.ConfigClient.removeListener({ field: \"finsemble.servicesConfig\" }, this.setPermanentWorkspaces);\n\t}\n\n\tsetPreference(field: string, value: any, cb?: Function) {\n\t\tFSBL.Clients.ConfigClient.setPreference(\n\t\t\t{\n\t\t\t\tfield,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t}\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tsetWorkspaceToLoadOnStart(eventOrCb: React.ChangeEvent<HTMLInputElement> | (() => void)) {\n\t\tif (!this.state.focusedWorkspace) return;\n\t\tif (this.state.focusedWorkspace === this.state.workspaceToLoadOnStart) {\n\t\t\tthis.setState({ workspaceToLoadOnStart: null }, () =>\n\t\t\t\tthis.setPreference(WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE, null)\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tworkspaceToLoadOnStart: this.state.focusedWorkspace,\n\t\t\t\t},\n\t\t\t\t() => this.setPreference(WORKSPACE_PREFERENCES.INITIAL_WORKSPACE_PREFERENCE, this.state.focusedWorkspace)\n\t\t\t);\n\t\t}\n\n\t\tif (typeof eventOrCb === \"function\") {\n\t\t\teventOrCb();\n\t\t}\n\t}\n\n\topenFileDialog() {\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\n\t\t// then reset always on top\n\t\tthis.changePreferencesAlwaysOnTop(false);\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\n\t\tlet inputElement = document.getElementById(\"file-input\");\n\t\tinputElement?.addEventListener(\"change\", this.importWorkspace as ImportWorkspace, false);\n\t\tinputElement?.click();\n\t}\n\n\t/**\n\t * If the event is being listened to, when the preferences component is focused\n\t * it will set always on top to true, and remove the event listener\n\t *\n\t * This is to handle bringing alwaysOnTop back to true when file dialogs are closed\n\t * without changes (also handles bringing back to front after exporting)\n\t */\n\tpreferencesFocused() {\n\t\tfinsembleWindow.removeEventListener(\"focused\", this.preferencesFocused);\n\t\tthis.changePreferencesAlwaysOnTop(true);\n\t}\n\n\timportWorkspace(\n\t\tevt: Event & {\n\t\t\ttarget: {\n\t\t\t\tfiles: File[];\n\t\t\t\tvalue?: string | string[];\n\t\t\t};\n\t\t}\n\t): void {\n\t\tlet inputElement = document.getElementById(\"file-input\") as HTMLInputElement;\n\t\tinputElement?.removeEventListener(\"change\", this.importWorkspace as ImportWorkspace);\n\t\tconst { files } = evt.target; // FileList object\n\n\t\tfunction loadFile(file: File, done: () => void) {\n\t\t\tconst reader = new FileReader();\n\t\t\tlet fileName = evt.target.value;\n\t\t\t// When the file info is loaded, we get into here..\n\t\t\treader.onload = function (e) {\n\t\t\t\ttry {\n\t\t\t\t\tfileName = (fileName as string).split(\"\\\\\");\n\t\t\t\t\tfileName = fileName[fileName.length - 1].replace(\".json\", \"\");\n\t\t\t\t\tlet workspaceTemplateDefinition = JSON.parse(e?.target?.result as string);\n\t\t\t\t\tlet templateName = Object.keys(workspaceTemplateDefinition.workspaceTemplates)[0];\n\t\t\t\t\tif (fileName !== templateName) {\n\t\t\t\t\t\t// We want the file name to overwrite the name of the workspace that was saved as the template..\n\t\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName] =\n\t\t\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[templateName];\n\t\t\t\t\t\tdelete workspaceTemplateDefinition.workspaceTemplates[templateName];\n\t\t\t\t\t}\n\t\t\t\t\tworkspaceTemplateDefinition.workspaceTemplates[fileName].name = fileName;\n\t\t\t\t\tFSBL.Clients.WorkspaceClient.import(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tworkspaceJSONDefinition: workspaceTemplateDefinition.workspaceTemplates,\n\t\t\t\t\t\t\tforce: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err: StandardError) => {\n\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\tFSBL.Clients.Logger.system.info(\"addWorkspaceTemplateDefinition error\", err);\n\t\t\t\t\t\t\t\tFSBL.UserNotification.alert(\n\t\t\t\t\t\t\t\t\t\"system\",\n\t\t\t\t\t\t\t\t\t\"ALWAYS\",\n\t\t\t\t\t\t\t\t\t\"FSBL-Workspace-Import-Error\",\n\t\t\t\t\t\t\t\t\t\"The workspace can't be imported and it could be corrupt. Check the Central Logger for any errors.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} catch (error: any) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(error);\n\t\t\t\t\tFSBL.UserNotification.alert(\n\t\t\t\t\t\t\"system\",\n\t\t\t\t\t\t\"ALWAYS\",\n\t\t\t\t\t\t\"FSBL-Workspace-Import-Error\",\n\t\t\t\t\t\t\"The workspace can't be imported and it could be corrupt. Check the Central Logger for any errors.\"\n\t\t\t\t\t);\n\t\t\t\t\tdone();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Read in the image file as a data URL.\n\t\t\treader.readAsText(file);\n\t\t}\n\n\t\tasync.each(files, loadFile, () => {\n\t\t\t// Clear out files. so if the user imports the same file back-to-back, the event will fire.\n\t\t\tif (inputElement?.value) {\n\t\t\t\tinputElement.value = \"\";\n\t\t\t}\n\t\t\tFSBL.Clients.Logger.system.info(\"Workspaces imported\");\n\t\t});\n\t}\n\n\texportWorkspace() {\n\t\tif (this.state.focusedWorkspace === \"\") return;\n\t\tconst doExport = () => {\n\t\t\tFSBL.Clients.WorkspaceClient.export(\n\t\t\t\t{ workspaceName: this.state.focusedWorkspace },\n\t\t\t\t(err: StandardError, workspaceDefinition: string) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tFSBL.Clients.Logger.system.error(\"export error\", err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We're saving using a routine initially created for templates. The outcome is the same and it probably should have just been \"Save to file\". This bool is to allow it to save.\n\t\t\t\t\t\tFSBL.ConfigUtils.promptAndSaveJSONToLocalFile(this.state.focusedWorkspace, {\n\t\t\t\t\t\t\tworkspaceTemplates: workspaceDefinition,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t// Set alwaysOnTop to false and add an event listener on the window. When focus is regained\n\t\t// then reset always on top\n\t\tthis.changePreferencesAlwaysOnTop(false);\n\t\tfinsembleWindow.addEventListener(\"focused\", this.preferencesFocused);\n\t\t// If we're autosaving, autosave, then export.\n\t\tFSBL.Clients.ConfigClient.getValue(\n\t\t\t{\n\t\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\n\t\t\t},\n\t\t\t(err, data) => {\n\t\t\t\t// default to false.\n\t\t\t\tlet PROMPT_ON_SAVE = data === null ? false : data;\n\t\t\t\tif (!PROMPT_ON_SAVE) {\n\t\t\t\t\tlet activeName = FSBL?.Clients?.WorkspaceClient?.activeWorkspace?.name || \"\";\n\t\t\t\t\treturn FSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: activeName,\n\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tdoExport();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdoExport();\n\t\t\t}\n\t\t);\n\t}\n\n\thandleButtonClicks(e: React.MouseEvent<HTMLDivElement>) {\n\t\tif (this.state.adding || this.state.editing) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\tasync getFocusedWorkspaceComponentList() {\n\t\tlet { focusedWorkspace } = this.state;\n\t\tif (focusedWorkspace === \"\") return [];\n\n\t\tconst workspaceDefinition: {\n\t\t\t[key: string]: WorkspaceTemplate;\n\t\t} = (await FSBL.Clients.WorkspaceClient.export({ workspaceName: focusedWorkspace }, () => {})) as {\n\t\t\t[key: string]: WorkspaceTemplate;\n\t\t};\n\t\tif (workspaceDefinition) {\n\t\t\tconst workspaceComponents = this.getComponentTypes(workspaceDefinition[focusedWorkspace]);\n\t\t\tif (workspaceComponents) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tfocusedWorkspaceComponentList: workspaceComponents,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleDiscardUnsavedChanges() {\n\t\tconst newValue = !this.state.discardUnsavedChanges;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tdiscardUnsavedChanges: newValue,\n\t\t\t},\n\t\t\t() => this.setPreference(WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES, newValue)\n\t\t);\n\t}\n\n\ttogglePromptUserOnDirtyWorkspace() {\n\t\tconst newValue = !this.state.promptUserOnDirtyWorkspace;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tpromptUserOnDirtyWorkspace: newValue,\n\t\t\t\tdiscardUnsavedChanges: newValue ? false : this.state.discardUnsavedChanges,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.setPreference(WORKSPACE_PREFERENCES.PROMPT_USER_ON_DIRTY_WORKSPACE, newValue);\n\t\t\t\tif (newValue) {\n\t\t\t\t\tthis.setPreference(WORKSPACE_PREFERENCES.DISCARD_UNSAVED_CHANGES, false);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\trender() {\n\t\tlet deleteButtonClasses = \"individual-workspace-action delete-workspace\",\n\t\t\trenameButtonClasses = \"individual-workspace-action\",\n\t\t\tallowDelete = true,\n\t\t\tallowExport = true,\n\t\t\tallowRename = true,\n\t\t\tallowImport = true,\n\t\t\tdeleteTooltip = \"Delete\";\n\n\t\tif (this.state.focusedWorkspace === FSBL?.Clients?.WorkspaceClient?.activeWorkspace?.name) {\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\n\t\t}\n\n\t\tif (this.state.focusedWorkspace === \"\") {\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-individual-workspace-action`;\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-individual-workspace-action`;\n\t\t\tdeleteTooltip = \"No workspace selected\";\n\t\t\tallowRename = false;\n\t\t\tallowExport = false;\n\t\t\tallowDelete = false;\n\t\t}\n\n\t\tif (this.state.adding || this.state.editing) {\n\t\t\trenameButtonClasses = `${renameButtonClasses} disabled-button`;\n\t\t\tdeleteButtonClasses = `${deleteButtonClasses} disabled-button`;\n\t\t\tallowDelete = false;\n\t\t\tallowExport = false;\n\t\t\tallowRename = false;\n\t\t\tallowImport = false;\n\t\t}\n\n\t\tlet importTooltip = \"Import workspace from file\",\n\t\t\texportTooltip = allowExport ? \"Export selected workspace\" : \"No workspace selected\",\n\t\t\trenameTooltip = allowRename ? \"Rename\" : \"Cannot Edit\";\n\n\t\treturn (\n\t\t\t<div style={{ paddingLeft: 10 }}>\n\t\t\t\t<input style={{ display: \"none\" }} type=\"file\" id=\"file-input\" />\n\t\t\t\t<div className=\"complex-menu-content-row\">\n\t\t\t\t\t<div className=\"workspace-list-header-row\">\n\t\t\t\t\t\t<div className=\"content-section-header workspace-list-header\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"content-section-wrapper\">\n\t\t\t\t\t\t<WorkspaceItemList\n\t\t\t\t\t\t\tonDragEnd={this.onDragEnd}\n\t\t\t\t\t\t\tworkspaceList={this.state.workspaceList}\n\t\t\t\t\t\t\tallowDelete={allowDelete}\n\t\t\t\t\t\t\tdeleteButtonClasses={deleteButtonClasses}\n\t\t\t\t\t\t\tdeleteTooltip={deleteTooltip}\n\t\t\t\t\t\t\tworkspaceToLoadOnStart={this.state.workspaceToLoadOnStart}\n\t\t\t\t\t\t\tfocusedWorkspace={this.state.focusedWorkspace}\n\t\t\t\t\t\t\tediting={this.state.editing}\n\t\t\t\t\t\t\tadding={this.state.adding}\n\t\t\t\t\t\t\trenameWorkspace={this.renameWorkspace}\n\t\t\t\t\t\t\taddWorkspace={this.addWorkspace}\n\t\t\t\t\t\t\tcancelEdit={this.cancelEdit}\n\t\t\t\t\t\t\tsetFocusedWorkspace={this.setFocusedWorkspace}\n\t\t\t\t\t\t\trenameTooltip={renameTooltip}\n\t\t\t\t\t\t\trenameButtonClasses={renameButtonClasses}\n\t\t\t\t\t\t\tallowRename={allowRename}\n\t\t\t\t\t\t\thandleButtonClicks={this.handleButtonClicks}\n\t\t\t\t\t\t\tstartEditingWorkspace={this.startEditingWorkspace}\n\t\t\t\t\t\t\tdeleteWorkspace={this.deleteWorkspace}\n\t\t\t\t\t\t\tpermanentWorkspaces={this.state.permanentWorkspaces}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"workspace-extras\">\n\t\t\t\t\t\t\t<WorkspaceComponents focusedWorkspaceComponentList={this.state.focusedWorkspaceComponentList} />\n\t\t\t\t\t\t\t<div className=\"workspace-action-buttons\">\n\t\t\t\t\t\t\t\t<WorkspaceButton\n\t\t\t\t\t\t\t\t\ttitle={importTooltip}\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\tonClick={allowImport ? this.openFileDialog : () => {}}\n\t\t\t\t\t\t\t\t\ttype=\"import\"\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t<WorkspaceButton\n\t\t\t\t\t\t\t\t\ttitle={exportTooltip}\n\t\t\t\t\t\t\t\t\tonMouseDown={this.handleButtonClicks}\n\t\t\t\t\t\t\t\t\tonClick={allowExport ? this.exportWorkspace : () => {}}\n\t\t\t\t\t\t\t\t\ttype=\"export\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tdisabled={!this.state.focusedWorkspace}\n\t\t\t\t\t\tonClick={this.setWorkspaceToLoadOnStart}\n\t\t\t\t\t\tchecked={!!this.state.focusedWorkspace && this.state.focusedWorkspace === this.state.workspaceToLoadOnStart}\n\t\t\t\t\t\tlabel=\"Load this workspace on startup\"\n\t\t\t\t\t/>\n\t\t\t\t\t<> </>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tonClick={this.togglePromptUserOnDirtyWorkspace}\n\t\t\t\t\t\tchecked={this.state.promptUserOnDirtyWorkspace}\n\t\t\t\t\t\tlabel=\"Prompt user on dirty workspace\"\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"indent-5px\">\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tdisabled={this.state.promptUserOnDirtyWorkspace}\n\t\t\t\t\t\t\tonClick={this.toggleDiscardUnsavedChanges}\n\t\t\t\t\t\t\tchecked={this.state.discardUnsavedChanges}\n\t\t\t\t\t\t\tlabel=\"Discard unsaved changes\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -40,6 +40,7 @@ export declare type WorkspaceItemProps = {
|
|
|
40
40
|
deleteButtonClasses?: string;
|
|
41
41
|
allowDelete?: boolean;
|
|
42
42
|
deleteWorkspace?: (name: string) => void;
|
|
43
|
+
permanentWorkspaces?: string[];
|
|
43
44
|
};
|
|
44
45
|
declare const WorkspaceItem: (props: WorkspaceItemProps) => JSX.Element;
|
|
45
46
|
export default WorkspaceItem;
|
|
@@ -57,7 +57,7 @@ export class WorkspaceEditor extends React.Component {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
const WorkspaceItem = (props) => {
|
|
60
|
-
var _a, _b;
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
61
|
let baseClass = "workspace-item";
|
|
62
62
|
let classNames = baseClass;
|
|
63
63
|
if (((_a = FSBL.Clients.WorkspaceClient.activeWorkspace) === null || _a === void 0 ? void 0 : _a.name) === props.workspace.name) {
|
|
@@ -91,7 +91,8 @@ const WorkspaceItem = (props) => {
|
|
|
91
91
|
} },
|
|
92
92
|
React.createElement("div", { className: "ff-adp-hamburger" }),
|
|
93
93
|
React.createElement("div", { className: "workspace-name", title: props.workspace.name }, props.workspace.name),
|
|
94
|
-
React.createElement("div", { className: "individual-workspace-actions" }, props.workspace.name !== ((_b = FSBL.Clients.WorkspaceClient.activeWorkspace) === null || _b === void 0 ? void 0 : _b.name) &&
|
|
94
|
+
React.createElement("div", { className: "individual-workspace-actions" }, props.workspace.name !== ((_b = FSBL.Clients.WorkspaceClient.activeWorkspace) === null || _b === void 0 ? void 0 : _b.name) &&
|
|
95
|
+
!((_c = props.permanentWorkspaces) === null || _c === void 0 ? void 0 : _c.includes((_d = props.workspace.name) !== null && _d !== void 0 ? _d : "")) && (React.createElement(React.Fragment, null,
|
|
95
96
|
React.createElement("div", { title: props.renameTooltip, className: props.renameButtonClasses, onMouseDown: props.handleButtonClicks, onClick: (e) => {
|
|
96
97
|
var _a;
|
|
97
98
|
props.allowRename && ((_a = props.startEditingWorkspace) === null || _a === void 0 ? void 0 : _a.call(props, e, props.workspace.name || ""));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceItem.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/workspaces/WorkspaceItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAahF,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAAqD;IAI/F,YAAY,KAA2B;QACtC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;YACxB,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,CAAM;QACf,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE;YACvB,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE;;gBACxE,MAAA,MAAA,IAAI,CAAC,KAAK,EAA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MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,0CAAE,IAAI,CAAA,IAAI,CAC/E;YACC,6BACC,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,SAAS,EAAE,KAAK,CAAC,mBAAmB,EACpC,WAAW,EAAE,KAAK,CAAC,kBAAkB,EACrC,OAAO,EAAE,CAAC,CAAM,EAAE,EAAE;;oBACnB,KAAK,CAAC,WAAW,KAAI,MAAA,KAAK,CAAC,qBAAqB,sDAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA,CAAC;gBACnF,CAAC;gBAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CAC1B;YACN,6BACC,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,SAAS,EAAE,KAAK,CAAC,mBAAmB,EACpC,WAAW,EAAE,KAAK,CAAC,kBAAkB,EACrC,OAAO,EAAE,GAAG,EAAE;;oBACb,KAAK,CAAC,WAAW,KAAI,MAAA,KAAK,CAAC,eAAe,sDAAG,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA,CAAC;gBAC1E,CAAC;gBAED,2BAAG,SAAS,EAAC,sBAAsB,GAAK,CACnC,CACJ,CACH,CACI,CACc,CACrB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { MouseEventHandler } from \"react\";\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\n\ntype WorkspaceEditorProps = {\n\tcancelHandler?: Function;\n\tsaveHandler?: Function;\n\tvalue?: string;\n};\n\ntype WorkspaceEditorState = {\n\tvalue: string;\n\tfinished: boolean;\n};\n\nexport class WorkspaceEditor extends React.Component<WorkspaceEditorProps, WorkspaceEditorState> {\n\t// variable to save the initial workspace name\n\tinitialWorkspaceName: string;\n\n\tconstructor(props: WorkspaceEditorProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tvalue: props.value || \"\",\n\t\t\tfinished: false,\n\t\t};\n\t\tthis.initialWorkspaceName = props.value || \"\";\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.onChange = this.onChange.bind(this);\n\t\tthis.onFocus = this.onFocus.bind(this);\n\t}\n\n\tonKeyDown(e: any) {\n\t\tif (e.key === \"Escape\") {\n\t\t\tthis.setState({ finished: true, value: this.initialWorkspaceName }, () => {\n\t\t\t\tthis.props.cancelHandler?.();\n\t\t\t});\n\t\t} else if (e.key === \"Enter\") {\n\t\t\tconst finish = (val: string) => {\n\t\t\t\tthis.props.saveHandler?.(val);\n\t\t\t};\n\t\t\t// binding so we don't lose the event inside of react's crazy callback structure\n\t\t\tthis.setState({ finished: true }, finish.bind(this, e.target.value));\n\t\t}\n\t}\n\n\tonChange(e: any) {\n\t\tthis.setState({\n\t\t\tvalue: e.target.value,\n\t\t});\n\t}\n\n\tonFocus(e: any) {\n\t\te.target.select();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<input\n\t\t\t\t\tonFocus={this.onFocus}\n\t\t\t\t\tautoFocus={true}\n\t\t\t\t\tvalue={this.state.value}\n\t\t\t\t\tclassName=\"workspace-editor\"\n\t\t\t\t\tonChange={this.onChange}\n\t\t\t\t\tonKeyDown={this.onKeyDown}\n\t\t\t\t/>\n\t\t\t\t<div className=\"individual-workspace-actions\">\n\t\t\t\t\t<div\n\t\t\t\t\t\ttitle=\"Save\"\n\t\t\t\t\t\tclassName=\"individual-workspace-action\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tthis.setState({ finished: true }, () => {\n\t\t\t\t\t\t\t\tthis.props.saveHandler?.(this.state.value);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<i className=\"ff-check-mark\"></i>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\ttitle=\"Cancel\"\n\t\t\t\t\t\tclassName=\"individual-workspace-action\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tthis.setState({ finished: true, value: this.initialWorkspaceName }, () => {\n\t\t\t\t\t\t\t\tthis.props.cancelHandler?.();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<i className=\"ff-close\"></i>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport type WorkspaceItemProps = {\n\tworkspace: { name?: string; components?: Array<String> };\n\tworkspaceToLoadOnStart?: any;\n\tfocusedWorkspace?: string;\n\ti?: number;\n\tediting?: boolean;\n\tadding?: boolean;\n\tkey?: number;\n\trenameWorkspace?: Function;\n\taddWorkspace?: Function;\n\tcancelEdit?: Function;\n\tsetFocusedWorkspace?: Function;\n\trenameTooltip?: string;\n\trenameButtonClasses?: string;\n\thandleButtonClicks?: MouseEventHandler<HTMLDivElement>;\n\tallowRename?: boolean;\n\tstartEditingWorkspace?: (e: React.SyntheticEvent, name: string) => void;\n\tdeleteTooltip?: string;\n\tdeleteButtonClasses?: string;\n\tallowDelete?: boolean;\n\tdeleteWorkspace?: (name: string) => void;\n};\nconst WorkspaceItem = (props: WorkspaceItemProps) => {\n\tlet baseClass = \"workspace-item\";\n\tlet classNames = baseClass;\n\tif (FSBL.Clients.WorkspaceClient.activeWorkspace?.name === props.workspace.name) {\n\t\tclassNames = `${classNames} active-workspace`;\n\t}\n\n\tif (props.workspaceToLoadOnStart === props.workspace.name) {\n\t\tclassNames = `${classNames} auto-start-workspace-item`;\n\t}\n\n\tif (props.focusedWorkspace === props.workspace.name) {\n\t\tclassNames = `${classNames} focused-workspace-item`;\n\t\tif (props.i === 0) {\n\t\t\tclassNames = `${classNames} no-top-border`;\n\t\t}\n\t\tif (props.editing || props.adding) {\n\t\t\tclassNames = `${classNames} workspace-item-editing`;\n\t\t\treturn (\n\t\t\t\t<div key={props.i} className={classNames}>\n\t\t\t\t\t<WorkspaceEditor\n\t\t\t\t\t\tvalue={props.workspace.name || \"\"}\n\t\t\t\t\t\tsaveHandler={props.editing ? props.renameWorkspace : props.addWorkspace}\n\t\t\t\t\t\tcancelHandler={props.cancelEdit}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<FinsembleDraggable\n\t\t\tonClick={() => {\n\t\t\t\tprops.setFocusedWorkspace?.(props.workspace.name);\n\t\t\t}}\n\t\t\twrapperClass={classNames}\n\t\t\tdraggableId={props.workspace.name || \"\"}\n\t\t\tindex={props.i || 0}\n\t\t\tonKeydown={(e) => {\n\t\t\t\tif (e.code === \"F2\") {\n\t\t\t\t\tprops.allowRename && props.startEditingWorkspace?.(e, props.workspace.name || \"\");\n\t\t\t\t} else if (e.code === \"Delete\") {\n\t\t\t\t\tprops.allowDelete && props.deleteWorkspace?.(props.workspace.name || \"\");\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div className=\"ff-adp-hamburger\"></div>\n\t\t\t<div className=\"workspace-name\" title={props.workspace.name}>\n\t\t\t\t{props.workspace.name}\n\t\t\t</div>\n\t\t\t<div className=\"individual-workspace-actions\">\n\t\t\t\t{props.workspace.name !== FSBL.Clients.WorkspaceClient.activeWorkspace?.name && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\ttitle={props.renameTooltip}\n\t\t\t\t\t\t\tclassName={props.renameButtonClasses}\n\t\t\t\t\t\t\tonMouseDown={props.handleButtonClicks}\n\t\t\t\t\t\t\tonClick={(e: any) => {\n\t\t\t\t\t\t\t\tprops.allowRename && props.startEditingWorkspace?.(e, props.workspace.name || \"\");\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<i className=\"ff-adp-edit\"></i>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\ttitle={props.deleteTooltip}\n\t\t\t\t\t\t\tclassName={props.deleteButtonClasses}\n\t\t\t\t\t\t\tonMouseDown={props.handleButtonClicks}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tprops.allowDelete && props.deleteWorkspace?.(props.workspace.name || \"\");\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<i className=\"ff-adp-trash-outline\"></i>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</FinsembleDraggable>\n\t);\n};\n\nexport default WorkspaceItem;\n"]}
|
|
1
|
+
{"version":3,"file":"WorkspaceItem.js","sourceRoot":"","sources":["../../../../../src/components/userPreferences/components/workspaces/WorkspaceItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAahF,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAAqD;IAI/F,YAAY,KAA2B;QACtC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;YACxB,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,CAAM;QACf,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE;YACvB,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK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CAAC,IAAI,CAChB;QACN,6BAAK,SAAS,EAAC,8BAA8B,IAC3C,KAAK,CAAC,SAAS,CAAC,IAAI,MAAK,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,0CAAE,IAAI,CAAA;YAC3E,CAAC,CAAA,MAAA,KAAK,CAAC,mBAAmB,0CAAE,QAAQ,CAAC,MAAA,KAAK,CAAC,SAAS,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAA,IAAI,CACnE;YACC,6BACC,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,SAAS,EAAE,KAAK,CAAC,mBAAmB,EACpC,WAAW,EAAE,KAAK,CAAC,kBAAkB,EACrC,OAAO,EAAE,CAAC,CAAM,EAAE,EAAE;;oBACnB,KAAK,CAAC,WAAW,KAAI,MAAA,KAAK,CAAC,qBAAqB,sDAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA,CAAC;gBACnF,CAAC;gBAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CAC1B;YACN,6BACC,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,SAAS,EAAE,KAAK,CAAC,mBAAmB,EACpC,WAAW,EAAE,KAAK,CAAC,kBAAkB,EACrC,OAAO,EAAE,GAAG,EAAE;;oBACb,KAAK,CAAC,WAAW,KAAI,MAAA,KAAK,CAAC,eAAe,sDAAG,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA,CAAC;gBAC1E,CAAC;gBAED,2BAAG,SAAS,EAAC,sBAAsB,GAAK,CACnC,CACJ,CACH,CACG,CACc,CACrB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { MouseEventHandler } from \"react\";\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\n\ntype WorkspaceEditorProps = {\n\tcancelHandler?: Function;\n\tsaveHandler?: Function;\n\tvalue?: string;\n};\n\ntype WorkspaceEditorState = {\n\tvalue: string;\n\tfinished: boolean;\n};\n\nexport class WorkspaceEditor extends React.Component<WorkspaceEditorProps, WorkspaceEditorState> {\n\t// variable to save the initial workspace name\n\tinitialWorkspaceName: string;\n\n\tconstructor(props: WorkspaceEditorProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tvalue: props.value || \"\",\n\t\t\tfinished: false,\n\t\t};\n\t\tthis.initialWorkspaceName = props.value || \"\";\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.onChange = this.onChange.bind(this);\n\t\tthis.onFocus = this.onFocus.bind(this);\n\t}\n\n\tonKeyDown(e: any) {\n\t\tif (e.key === \"Escape\") {\n\t\t\tthis.setState({ finished: true, value: this.initialWorkspaceName }, () => {\n\t\t\t\tthis.props.cancelHandler?.();\n\t\t\t});\n\t\t} else if (e.key === \"Enter\") {\n\t\t\tconst finish = (val: string) => {\n\t\t\t\tthis.props.saveHandler?.(val);\n\t\t\t};\n\t\t\t// binding so we don't lose the event inside of react's crazy callback structure\n\t\t\tthis.setState({ finished: true }, finish.bind(this, e.target.value));\n\t\t}\n\t}\n\n\tonChange(e: any) {\n\t\tthis.setState({\n\t\t\tvalue: e.target.value,\n\t\t});\n\t}\n\n\tonFocus(e: any) {\n\t\te.target.select();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<input\n\t\t\t\t\tonFocus={this.onFocus}\n\t\t\t\t\tautoFocus={true}\n\t\t\t\t\tvalue={this.state.value}\n\t\t\t\t\tclassName=\"workspace-editor\"\n\t\t\t\t\tonChange={this.onChange}\n\t\t\t\t\tonKeyDown={this.onKeyDown}\n\t\t\t\t/>\n\t\t\t\t<div className=\"individual-workspace-actions\">\n\t\t\t\t\t<div\n\t\t\t\t\t\ttitle=\"Save\"\n\t\t\t\t\t\tclassName=\"individual-workspace-action\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tthis.setState({ finished: true }, () => {\n\t\t\t\t\t\t\t\tthis.props.saveHandler?.(this.state.value);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<i className=\"ff-check-mark\"></i>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\ttitle=\"Cancel\"\n\t\t\t\t\t\tclassName=\"individual-workspace-action\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tthis.setState({ finished: true, value: this.initialWorkspaceName }, () => {\n\t\t\t\t\t\t\t\tthis.props.cancelHandler?.();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<i className=\"ff-close\"></i>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport type WorkspaceItemProps = {\n\tworkspace: { name?: string; components?: Array<String> };\n\tworkspaceToLoadOnStart?: any;\n\tfocusedWorkspace?: string;\n\ti?: number;\n\tediting?: boolean;\n\tadding?: boolean;\n\tkey?: number;\n\trenameWorkspace?: Function;\n\taddWorkspace?: Function;\n\tcancelEdit?: Function;\n\tsetFocusedWorkspace?: Function;\n\trenameTooltip?: string;\n\trenameButtonClasses?: string;\n\thandleButtonClicks?: MouseEventHandler<HTMLDivElement>;\n\tallowRename?: boolean;\n\tstartEditingWorkspace?: (e: React.SyntheticEvent, name: string) => void;\n\tdeleteTooltip?: string;\n\tdeleteButtonClasses?: string;\n\tallowDelete?: boolean;\n\tdeleteWorkspace?: (name: string) => void;\n\tpermanentWorkspaces?: string[];\n};\nconst WorkspaceItem = (props: WorkspaceItemProps) => {\n\tlet baseClass = \"workspace-item\";\n\tlet classNames = baseClass;\n\tif (FSBL.Clients.WorkspaceClient.activeWorkspace?.name === props.workspace.name) {\n\t\tclassNames = `${classNames} active-workspace`;\n\t}\n\n\tif (props.workspaceToLoadOnStart === props.workspace.name) {\n\t\tclassNames = `${classNames} auto-start-workspace-item`;\n\t}\n\n\tif (props.focusedWorkspace === props.workspace.name) {\n\t\tclassNames = `${classNames} focused-workspace-item`;\n\t\tif (props.i === 0) {\n\t\t\tclassNames = `${classNames} no-top-border`;\n\t\t}\n\t\tif (props.editing || props.adding) {\n\t\t\tclassNames = `${classNames} workspace-item-editing`;\n\t\t\treturn (\n\t\t\t\t<div key={props.i} className={classNames}>\n\t\t\t\t\t<WorkspaceEditor\n\t\t\t\t\t\tvalue={props.workspace.name || \"\"}\n\t\t\t\t\t\tsaveHandler={props.editing ? props.renameWorkspace : props.addWorkspace}\n\t\t\t\t\t\tcancelHandler={props.cancelEdit}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<FinsembleDraggable\n\t\t\tonClick={() => {\n\t\t\t\tprops.setFocusedWorkspace?.(props.workspace.name);\n\t\t\t}}\n\t\t\twrapperClass={classNames}\n\t\t\tdraggableId={props.workspace.name || \"\"}\n\t\t\tindex={props.i || 0}\n\t\t\tonKeydown={(e) => {\n\t\t\t\tif (e.code === \"F2\") {\n\t\t\t\t\tprops.allowRename && props.startEditingWorkspace?.(e, props.workspace.name || \"\");\n\t\t\t\t} else if (e.code === \"Delete\") {\n\t\t\t\t\tprops.allowDelete && props.deleteWorkspace?.(props.workspace.name || \"\");\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div className=\"ff-adp-hamburger\"></div>\n\t\t\t<div className=\"workspace-name\" title={props.workspace.name}>\n\t\t\t\t{props.workspace.name}\n\t\t\t</div>\n\t\t\t<div className=\"individual-workspace-actions\">\n\t\t\t\t{props.workspace.name !== FSBL.Clients.WorkspaceClient.activeWorkspace?.name &&\n\t\t\t\t\t!props.permanentWorkspaces?.includes(props.workspace.name ?? \"\") && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\ttitle={props.renameTooltip}\n\t\t\t\t\t\t\t\tclassName={props.renameButtonClasses}\n\t\t\t\t\t\t\t\tonMouseDown={props.handleButtonClicks}\n\t\t\t\t\t\t\t\tonClick={(e: any) => {\n\t\t\t\t\t\t\t\t\tprops.allowRename && props.startEditingWorkspace?.(e, props.workspace.name || \"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<i className=\"ff-adp-edit\"></i>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\ttitle={props.deleteTooltip}\n\t\t\t\t\t\t\t\tclassName={props.deleteButtonClasses}\n\t\t\t\t\t\t\t\tonMouseDown={props.handleButtonClicks}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tprops.allowDelete && props.deleteWorkspace?.(props.workspace.name || \"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<i className=\"ff-adp-trash-outline\"></i>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t</div>\n\t\t</FinsembleDraggable>\n\t);\n};\n\nexport default WorkspaceItem;\n"]}
|
|
@@ -4,19 +4,22 @@ import { describe, it } from "mocha";
|
|
|
4
4
|
import { expect } from "chai";
|
|
5
5
|
import NotificationsPreferencesHome from "./../components/content/notificationViews/NotificationsPreferencesHome";
|
|
6
6
|
import { initFSBL } from "../../common/helpers";
|
|
7
|
+
const LOCATORS = {
|
|
8
|
+
checkbox: "input[type='checkbox']",
|
|
9
|
+
};
|
|
7
10
|
describe("<NotificationPreferencesHome/>", () => {
|
|
8
11
|
initFSBL(window);
|
|
9
12
|
beforeEach(() => {
|
|
10
13
|
// Ensures Checkboxes are resetted to default check status
|
|
11
14
|
const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
|
|
12
|
-
if (!wrapper.find(
|
|
13
|
-
wrapper.find(
|
|
15
|
+
if (!wrapper.find(LOCATORS.checkbox).at(0).props().checked) {
|
|
16
|
+
wrapper.find(LOCATORS.checkbox).at(0).simulate("click");
|
|
14
17
|
}
|
|
15
|
-
if (wrapper.find(
|
|
16
|
-
wrapper.find(
|
|
18
|
+
if (wrapper.find(LOCATORS.checkbox).at(1).props().checked) {
|
|
19
|
+
wrapper.find(LOCATORS.checkbox).at(1).simulate("click");
|
|
17
20
|
}
|
|
18
|
-
if (wrapper.find(
|
|
19
|
-
wrapper.find(
|
|
21
|
+
if (wrapper.find(LOCATORS.checkbox).at(2).props().checked) {
|
|
22
|
+
wrapper.find(LOCATORS.checkbox).at(1).simulate("click");
|
|
20
23
|
}
|
|
21
24
|
});
|
|
22
25
|
it("should render 1 ButtonRow for Notification Sources", () => {
|
|
@@ -25,7 +28,7 @@ describe("<NotificationPreferencesHome/>", () => {
|
|
|
25
28
|
});
|
|
26
29
|
it("should render 3 Checkboxes", () => {
|
|
27
30
|
const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
|
|
28
|
-
expect(wrapper.find(
|
|
31
|
+
expect(wrapper.find(LOCATORS.checkbox)).to.have.lengthOf(3);
|
|
29
32
|
});
|
|
30
33
|
it("should render 3 DefualtDropdownButtons", () => {
|
|
31
34
|
const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
|
|
@@ -33,8 +36,8 @@ describe("<NotificationPreferencesHome/>", () => {
|
|
|
33
36
|
});
|
|
34
37
|
it("should disable the second Checkbox if the first one is unchecked", () => {
|
|
35
38
|
const wrapper = mount(React.createElement(NotificationsPreferencesHome, null));
|
|
36
|
-
wrapper.find(
|
|
37
|
-
expect(wrapper.find(
|
|
39
|
+
wrapper.find(LOCATORS.checkbox).at(0).simulate("change");
|
|
40
|
+
expect(wrapper.find(LOCATORS.checkbox).at(1).props().disabled).to.be.true;
|
|
38
41
|
});
|
|
39
42
|
});
|
|
40
43
|
//# sourceMappingURL=NotificationsPreferencesHome.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsPreferencesHome.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/NotificationsPreferencesHome.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,4BAA4B,MAAM,wEAAwE,CAAC;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC/C,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,UAAU,CAAC,GAAG,EAAE;QACf,0DAA0D;QAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,4BAA4B,OAAG,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"NotificationsPreferencesHome.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/NotificationsPreferencesHome.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,4BAA4B,MAAM,wEAAwE,CAAC;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,QAAQ,GAAG;IAChB,QAAQ,EAAE,wBAAwB;CAClC,CAAC;AAEF,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC/C,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,UAAU,CAAC,GAAG,EAAE;QACf,0DAA0D;QAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,4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AC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,4BAA4B,OAAG,CAAC,CAAC;QACxD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,4BAA4B,OAAG,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC3E,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport NotificationsPreferencesHome from \"./../components/content/notificationViews/NotificationsPreferencesHome\";\nimport { initFSBL } from \"../../common/helpers\";\n\nconst LOCATORS = {\n\tcheckbox: \"input[type='checkbox']\",\n};\n\ndescribe(\"<NotificationPreferencesHome/>\", () => {\n\tinitFSBL(window);\n\tbeforeEach(() => {\n\t\t// Ensures Checkboxes are resetted to default check status\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\n\t\tif (!wrapper.find(LOCATORS.checkbox).at(0).props().checked) {\n\t\t\twrapper.find(LOCATORS.checkbox).at(0).simulate(\"click\");\n\t\t}\n\t\tif (wrapper.find(LOCATORS.checkbox).at(1).props().checked) {\n\t\t\twrapper.find(LOCATORS.checkbox).at(1).simulate(\"click\");\n\t\t}\n\t\tif (wrapper.find(LOCATORS.checkbox).at(2).props().checked) {\n\t\t\twrapper.find(LOCATORS.checkbox).at(1).simulate(\"click\");\n\t\t}\n\t});\n\tit(\"should render 1 ButtonRow for Notification Sources\", () => {\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\n\t\texpect(wrapper.find(\"ButtonRow\")).to.have.lengthOf(1);\n\t});\n\n\tit(\"should render 3 Checkboxes\", () => {\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\n\t\texpect(wrapper.find(LOCATORS.checkbox)).to.have.lengthOf(3);\n\t});\n\n\tit(\"should render 3 DefualtDropdownButtons\", () => {\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\n\t\texpect(wrapper.find(\"DefaultDropdownButton\")).to.have.lengthOf(3);\n\t});\n\n\tit(\"should disable the second Checkbox if the first one is unchecked\", () => {\n\t\tconst wrapper = mount(<NotificationsPreferencesHome />);\n\t\twrapper.find(LOCATORS.checkbox).at(0).simulate(\"change\");\n\t\texpect(wrapper.find(LOCATORS.checkbox).at(1).props().disabled).to.be.true;\n\t});\n});\n"]}
|
|
@@ -3,12 +3,14 @@ import { mount, shallow } from "enzyme";
|
|
|
3
3
|
import { describe, it } from "mocha";
|
|
4
4
|
import { expect } from "chai";
|
|
5
5
|
import { UserPreferencesBase } from "../UserPreferencesBase";
|
|
6
|
+
import { initFSBL } from "../../common/helpers";
|
|
6
7
|
import General from "./../components/content/General";
|
|
7
8
|
import DashbarEditor from "./../components/content/DashbarEditor";
|
|
8
9
|
import Workspaces from "./../components/content/Workspaces";
|
|
9
10
|
import Notifications from "./../components/content/Notifications";
|
|
10
11
|
import { waitTick } from "../../sdd/sdd_helpers";
|
|
11
12
|
describe("<UserPreferencesBase/>", () => {
|
|
13
|
+
initFSBL(window);
|
|
12
14
|
let sections = {};
|
|
13
15
|
before(() => {
|
|
14
16
|
sections = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserPreferencesBase.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/UserPreferencesBase.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserPreferencesBase.spec.js","sourceRoot":"","sources":["../../../../src/components/userPreferences/tests/UserPreferencesBase.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,OAAO,MAAM,iCAAiC,CAAC;AACtD,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC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OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAErF,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,QAAQ,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACjF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAExF,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,QAAQ,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC9E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { mount, shallow } from \"enzyme\";\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport { UserPreferencesBase } from \"../UserPreferencesBase\";\nimport { initFSBL } from \"../../common/helpers\";\n\nimport General from \"./../components/content/General\";\nimport DashbarEditor from \"./../components/content/DashbarEditor\";\nimport Workspaces from \"./../components/content/Workspaces\";\nimport Notifications from \"./../components/content/Notifications\";\nimport { waitTick } from \"../../sdd/sdd_helpers\";\n\ndescribe(\"<UserPreferencesBase/>\", () => {\n\tinitFSBL(window);\n\tlet sections = {};\n\tbefore(() => {\n\t\tsections = {\n\t\t\tGeneral: General,\n\t\t\tWorkspaces: Workspaces,\n\t\t\tDashbar: DashbarEditor,\n\t\t\tNotifications: Notifications,\n\t\t};\n\t});\n\n\tit(\"should render UserPreferencesBase component\", () => {\n\t\tconst wrapper = shallow(<UserPreferencesBase sections={sections} />);\n\t\texpect(wrapper.find(\"LeftNav\")).to.exist;\n\t\texpect(wrapper.find(\"ContentSection\")).to.exist;\n\t});\n\n\tit(\"Should update LeftNav and ContentSection when new section is clicked\", async () => {\n\t\tconst wrapper = mount(\n\t\t\t<UserPreferencesBase\n\t\t\t\tsections={sections}\n\t\t\t\taddListener={() => {}}\n\t\t\t\tremoveListener={() => {}}\n\t\t\t\tgetValue={() => {}}\n\t\t\t\tsetValue={() => {}}\n\t\t\t/>\n\t\t);\n\n\t\texpect(wrapper.find(\"LeftNav\")).to.exist;\n\t\texpect(wrapper.find(\"ContentSection\")).to.exist;\n\n\t\texpect(wrapper.find(\"LeftNav\").prop(\"activeSection\")).to.be.string(\"General\");\n\t\texpect(wrapper.find(\"ContentSection\").prop(\"activeSection\")).to.be.string(\"General\");\n\n\t\twrapper.find(\"ButtonRow\").at(1).simulate(\"click\");\n\t\tawait waitTick();\n\t\texpect(wrapper.find(\"LeftNav\").prop(\"activeSection\")).to.be.string(\"Workspaces\");\n\t\texpect(wrapper.find(\"ContentSection\").prop(\"activeSection\")).to.be.string(\"Workspaces\");\n\n\t\twrapper.find(\"ButtonRow\").at(2).simulate(\"click\");\n\t\tawait waitTick();\n\t\texpect(wrapper.find(\"LeftNav\").prop(\"activeSection\")).to.be.string(\"Dashbar\");\n\t\texpect(wrapper.find(\"ContentSection\").prop(\"activeSection\")).to.be.string(\"Dashbar\");\n\t});\n});\n"]}
|
|
@@ -127,45 +127,112 @@ export declare class WindowTitleBarShell extends React.Component<WindowTitleBarS
|
|
|
127
127
|
onTabsChanged(err: StandardError, response: any): void;
|
|
128
128
|
onShowTabsChanged(err: StandardError, response: any): void;
|
|
129
129
|
hackScrollbar(): void;
|
|
130
|
-
beginAdjustment(): void;
|
|
131
130
|
/**
|
|
132
131
|
* Once document is ready and header is injected into DOM, begin adjusting the height of elements and bump fixed/absolute elements
|
|
133
132
|
*/
|
|
134
133
|
maybeAdjustWindow(): Promise<void>;
|
|
135
134
|
/**
|
|
136
|
-
*
|
|
137
|
-
* @param headerHeight the height of the header
|
|
135
|
+
* Begin adjusting the body and top level elements and their direct descendants by the header height.
|
|
138
136
|
*/
|
|
139
|
-
|
|
137
|
+
beginAdjustment(): void;
|
|
140
138
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
139
|
+
* Togglable setting found in `foreign.components.["Window Manager"].FSBLHeader.adjustContentHeights`
|
|
140
|
+
* Called from beginAdjustment()
|
|
141
|
+
*
|
|
142
|
+
* Adjusts the top level content maxHeight to be 100vh subtracted by the total height of the previous elements.
|
|
143
|
+
* The height of the previous elements are added to this calculation if they are not fixed or absolute.
|
|
144
|
+
* These top level elements will be passed into adjustContentHeight where their descendants
|
|
145
|
+
* will also have their heights adjusted.
|
|
146
|
+
* Example:
|
|
147
|
+
* In this below situation, the B element extends passed the view because the header is injected. B doesn't have a
|
|
148
|
+
* set height so it'll extend as far as it needs.
|
|
149
|
+
* --------------------
|
|
150
|
+
* |******************|
|
|
151
|
+
* |* Titlebar *|
|
|
152
|
+
* |******************|
|
|
153
|
+
* |******************|
|
|
154
|
+
* |* A *|
|
|
155
|
+
* |* *|
|
|
156
|
+
* |******************|
|
|
157
|
+
* |******************|
|
|
158
|
+
* |* *|
|
|
159
|
+
* |* *|
|
|
160
|
+
* |* B *|
|
|
161
|
+
* |* *|
|
|
162
|
+
* |* *|
|
|
163
|
+
* |* *|
|
|
164
|
+
* --------------------
|
|
165
|
+
* The chain of adjust functions will set the maxHeight of A and B to ensure they both occupy space that the above element doesn't
|
|
166
|
+
* and keep it within the bounds of the view.
|
|
167
|
+
* --------------------
|
|
168
|
+
* |******************|
|
|
169
|
+
* |* Titlebar *|
|
|
170
|
+
* |******************|
|
|
171
|
+
* |******************|
|
|
172
|
+
* |* A *|
|
|
173
|
+
* |* *|
|
|
174
|
+
* |******************|
|
|
175
|
+
* |******************|
|
|
176
|
+
* |* *|
|
|
177
|
+
* |* *|
|
|
178
|
+
* |* B *|
|
|
179
|
+
* |* *|
|
|
180
|
+
* |* *|
|
|
181
|
+
* |******************|
|
|
182
|
+
* --------------------
|
|
183
|
+
* @param {number} headerHeight the height of the header
|
|
143
184
|
*/
|
|
144
|
-
|
|
185
|
+
private adjustTopLevelHeight;
|
|
145
186
|
/**
|
|
187
|
+
* Adjusts the content view height to be maximum of the parent container (passed in by adjustTopLevelHeight()) height
|
|
188
|
+
* subtracted by the total height of elements above it. The height of the previous elements are added to this calculation
|
|
189
|
+
* if they are not fixed or absolute.
|
|
190
|
+
* @param {object} parentElem parent element
|
|
191
|
+
*/
|
|
192
|
+
private adjustContentHeight;
|
|
193
|
+
/**
|
|
194
|
+
* This is used in adjustTopLevelHeight() and adjustContentHeight()
|
|
195
|
+
*
|
|
146
196
|
* Set the max height of each element to be the height of the parent container
|
|
147
197
|
* subtracted by the height of the previous element. This forces the element to either obey its
|
|
148
198
|
* predefined height or stay within the bounds of the max height.
|
|
199
|
+
*
|
|
149
200
|
* @param {object} elem HTML element
|
|
150
201
|
* @param {number} prev height of previous sibling
|
|
151
|
-
* @param maxHeight
|
|
202
|
+
* @param {string} maxHeight maximum height of the element
|
|
152
203
|
*/
|
|
153
204
|
private adjust;
|
|
154
205
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
206
|
+
* Togglable setting found in `foreign.components.["Window Manager"].FSBLHeader.bumpElements.[bumpBy|fixed|absolute]`
|
|
207
|
+
* Called from beginAdjustment()
|
|
208
|
+
*
|
|
209
|
+
* Calls bumpFixedElements and bumpAbsoluteElements to bump fixed and/or absolute elements by the value of bumpBy if configured to do so.
|
|
210
|
+
* Since absolute and fixed positioned elements are removed from the document flow their positions will not be adjusted when the titlebar
|
|
211
|
+
* is injected and they have a set top style. However, if the element is an absolute positioned element and it's
|
|
212
|
+
* parent container has a position that is not set to static, then it'll adjust relative to the parent. Fixed positioned elements, on the otherhand,
|
|
213
|
+
* won't adjust unless their top stlyes are changed.
|
|
214
|
+
* @param {object} config bumpElements object
|
|
159
215
|
*/
|
|
160
|
-
|
|
216
|
+
bumpElements(config: BumpElements): void;
|
|
161
217
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
218
|
+
* Called from bumpElements
|
|
219
|
+
*
|
|
220
|
+
* Bumps all elements with fixed positioning, that are not in the header, down by the configured amount.
|
|
221
|
+
* @private
|
|
222
|
+
* @param {object} params bumpElements object
|
|
165
223
|
*/
|
|
166
|
-
private
|
|
224
|
+
private bumpFixedElements;
|
|
167
225
|
/**
|
|
168
|
-
*
|
|
226
|
+
* Called from bumpElements
|
|
227
|
+
*
|
|
228
|
+
* Bumps all absolute positioned elements with static parents, that are not in the header, down by the configured amount.
|
|
229
|
+
* @private
|
|
230
|
+
* @param {object} params bumpElements object
|
|
231
|
+
*/
|
|
232
|
+
private bumpAbsoluteElements;
|
|
233
|
+
/**
|
|
234
|
+
* Used in bumpFixedElements and bumpAbsoluteElements
|
|
235
|
+
* Calculates value to bump element by. If 'all' return top style plus the header height, if '0Positioned' return just header height
|
|
169
236
|
* @param type Whether all elements are being bumped by the header height and their top style or just header height
|
|
170
237
|
* @param topStyle Element top value
|
|
171
238
|
* @param bumpBy Value to bump element by
|
|
@@ -173,6 +240,8 @@ export declare class WindowTitleBarShell extends React.Component<WindowTitleBarS
|
|
|
173
240
|
*/
|
|
174
241
|
private calculateBumpValue;
|
|
175
242
|
/**
|
|
243
|
+
* Used in bumpAbsoluteElements
|
|
244
|
+
*
|
|
176
245
|
* Recursively traverse through the HTML document and return an array of the top level elements
|
|
177
246
|
* and elements with static parents
|
|
178
247
|
* @param {object} element The HTML element
|
|
@@ -182,15 +251,19 @@ export declare class WindowTitleBarShell extends React.Component<WindowTitleBarS
|
|
|
182
251
|
*/
|
|
183
252
|
private traverseHtml;
|
|
184
253
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
*
|
|
191
|
-
*
|
|
254
|
+
* Togglable setting found in `foreign.components.["Window Manager"].FSBLHeader.bumpElements.[monitorFixedAdditions]`
|
|
255
|
+
* Called from beginAdjustment()
|
|
256
|
+
*
|
|
257
|
+
* Monitors the DOM for mutations, if the added node has a fixed position with a top style of 0px, it will be bumped by the title bar height.
|
|
258
|
+
* This ensures that if a fixed positioned element is dynamically added to the DOM, for example a pop-up modal, it'll have it's height adjusted
|
|
259
|
+
* by the header height since the initial bumping of elements can happen before this element exists.
|
|
260
|
+
*
|
|
261
|
+
* Element heights are not monitored and adjusted since this would require that all pre-existing elements have ther height recalculated each time
|
|
262
|
+
* a new element is dynamically added onto the page. Absolute postioned elements, however, could be monitored and adjusted since all we would
|
|
263
|
+
* need to check for is that it's parent has a static position or not, if it does then it can be adjusted.
|
|
264
|
+
* @param headerHeight the height of the header
|
|
192
265
|
*/
|
|
193
|
-
|
|
266
|
+
monitorFixedPositionedElements(headerHeight: string): void;
|
|
194
267
|
render(): JSX.Element;
|
|
195
268
|
}
|
|
196
269
|
export {};
|