@finsemble/finsemble-ui 6.4.0 → 6.5.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +19 -18
- package/react/actions/smartDesktopDesignerActions.d.ts +6 -2
- package/react/actions/smartDesktopDesignerActions.js +2 -0
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/assets/icons/code-block.svg +15 -0
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.d.ts +2 -2
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/common/Checkbox.js +1 -1
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/DropZone.js +3 -1
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/FinsembleIcon.d.ts +1 -1
- package/react/components/common/FinsembleIcon.js +2 -0
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js +1 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/Tooltip.js +3 -1
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/application-list.css +4 -0
- package/react/components/common/css/preload-edit-page.css +37 -0
- package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
- package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/linker/remoteRedux.d.ts +1 -1
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuPortal.js +19 -0
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.d.ts +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/types.d.ts +1 -1
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.d.ts +1 -1
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/search/SearchResult.js +4 -3
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditPage.d.ts +2 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js +77 -73
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Appearance.css +8 -0
- package/react/components/smartDesktopDesigner/Application.d.ts +10 -3
- package/react/components/smartDesktopDesigner/Application.js +35 -42
- package/react/components/smartDesktopDesigner/Application.js.map +1 -1
- package/react/components/smartDesktopDesigner/Applications.d.ts +2 -0
- package/react/components/smartDesktopDesigner/Applications.js +17 -7
- package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
- package/react/components/smartDesktopDesigner/EditPreload.d.ts +14 -0
- package/react/components/smartDesktopDesigner/EditPreload.js +169 -0
- package/react/components/smartDesktopDesigner/EditPreload.js.map +1 -0
- package/react/components/smartDesktopDesigner/ItemList.d.ts +17 -0
- package/react/components/smartDesktopDesigner/ItemList.js +58 -0
- package/react/components/smartDesktopDesigner/ItemList.js.map +1 -0
- package/react/components/smartDesktopDesigner/OptionalSettingsView.d.ts +11 -0
- package/react/components/smartDesktopDesigner/OptionalSettingsView.js +71 -0
- package/react/components/smartDesktopDesigner/OptionalSettingsView.js.map +1 -0
- package/react/components/smartDesktopDesigner/Preloads.d.ts +8 -0
- package/react/components/smartDesktopDesigner/Preloads.js +26 -0
- package/react/components/smartDesktopDesigner/Preloads.js.map +1 -0
- package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/smartDesktopDesigner/Toolbar.js +5 -5
- package/react/components/smartDesktopDesigner/Toolbar.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +18 -0
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/css/appearance.css +3 -0
- package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +1 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js +23 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/preloads.d.ts +22 -0
- package/react/components/smartDesktopDesigner/fixtures/preloads.js +40 -0
- package/react/components/smartDesktopDesigner/fixtures/preloads.js.map +1 -0
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +1 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/views.js +9 -0
- package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +1 -0
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/EditPreload.stories.d.ts +11 -0
- package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js +35 -0
- package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/ItemList.stories.d.ts +16 -0
- package/react/components/smartDesktopDesigner/stories/{ApplicationList.stories.js → ItemList.stories.js} +26 -26
- package/react/components/smartDesktopDesigner/stories/ItemList.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.d.ts +11 -0
- package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js +28 -0
- package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/Preloads.stories.d.ts +11 -0
- package/react/components/smartDesktopDesigner/stories/Preloads.stories.js +31 -0
- package/react/components/smartDesktopDesigner/stories/Preloads.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1099 -258
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.d.ts → Application.spec.d.ts} +0 -0
- package/react/components/smartDesktopDesigner/tests/Application.spec.js +1496 -0
- package/react/components/smartDesktopDesigner/tests/Application.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js +3 -3
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/EditPreload.spec.d.ts +1 -0
- package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js +61 -0
- package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/ItemList.spec.d.ts +1 -0
- package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.js → ItemList.spec.js} +8 -8
- package/react/components/smartDesktopDesigner/tests/ItemList.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/Preloads.spec.d.ts +1 -0
- package/react/components/smartDesktopDesigner/tests/Preloads.spec.js +47 -0
- package/react/components/smartDesktopDesigner/tests/Preloads.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +6 -0
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
- package/react/components/toolbar/DragHandle.spec.js +31 -0
- package/react/components/toolbar/DragHandle.spec.js.map +1 -0
- package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
- package/react/components/toolbar/DragHandle.stories.js +39 -0
- package/react/components/toolbar/DragHandle.stories.js.map +1 -0
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +9 -12
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +1 -1
- package/react/components/userPreferences/components/content/Workspaces.js +1 -1
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +4 -2
- package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -59
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -2
- package/react/components/windowTitleBar/components/center/TabList.js +3 -0
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.d.ts +5 -2
- package/react/components/windowTitleBar/components/windowTitle.js +93 -89
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +213 -217
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/hooks/useDashbar.js.map +1 -1
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +1 -1
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +11 -3
- package/react/reducers/smartDesktopDesignerReducer.js +8 -0
- package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
- package/react/store.d.ts +22 -6
- package/react/types/fdc3.d.ts +2 -2
- package/react/types/fdc3.js.map +1 -1
- package/react/types/searchTypes.d.ts +1 -8
- package/react/types/searchTypes.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +8 -2
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/windowTitleBar.d.ts +1 -1
- package/react/types/windowTitleBar.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -16
- package/react/components/smartDesktopDesigner/ApplicationList.js +0 -60
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -16
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/Application.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAIxF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAQ7D,MAAM,sBAAsB,GAAG;IAE9B,EAAE;IACF,yBAAyB;IACzB,8BAA8B;IAC9B,yBAAyB;IACzB,8BAA8B;IAC9B,mCAAmC;IACnC,8BAA8B;IAC9B,yBAAyB;IACzB,8BAA8B;IAC9B,yBAAyB;CACzB,CAAC;AAEF,MAAM,gCAAgC,GAAG,CAAC,SAAwB,EAAU,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AC9B,OAAO;QACP,WAAW;QACX,mBAAmB;QACnB,QAAQ,EAAE,GAAG,EAAE;YACd,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,QAAQ,EAAE,CAAC,IAA+B,EAAE,EAAE;YAC7C,UAAU,aAAV,UAAU,uBAAV,UAAU,iCACN,IAAI,KACP,IAAI,EAAE,OAAO,CAAC,IAAI,IACjB,CAAC;QACJ,CAAC;QACD,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,0BAA0B,EAAE,KAAK,CAAC,0BAA0B;QAC5D,2BAA2B,EAAE,KAAK,CAAC,2BAA2B;KAC9D,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,UAAU;QACxB,oBAAC,IAAI;YACJ;gBACC,8BAAM,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE;oBACxC,kCAAU,SAAS,EAAC,mBAAmB;wBACtC;4BACC,oBAAC,MAAM,IAAC,YAAY,EAAE,YAAY,eAAmB,CAC7C;wBAET,oBAAC,OAAO;4BACP,oBAAC,WAAW,oBAAK,gBAAgB,EAAI,CAC5B,CACA,CACL,CACF,CACA,CACF,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 - 2020 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport React from \"react\";\nimport { useSelector, useDispatch } from \"../../store\";\nimport { CircularLoadingSpinner } from \"../common/LoadingSpinner\";\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\nimport { RootState } from \"../../reducers/rootReducer\";\nimport * as Types from \"../../types/smartDesktopDesignerTypes\";\nimport { services } from \"@finsemble/finsemble-core\";\nimport { View } from \"./View\";\nimport { Header } from \"../common/Header\";\nimport { Content } from \"./Content\";\nimport { AppEditPage } from \"./AppEditPage\";\nimport { generateDefaultConfig } from \"./sdd_helpers\";\nimport { launchTutorialLink } from \"./common/fsbl_functions\";\nimport { AppEditPageProps } from \"./AppEditPage\";\nimport { PositionTypes } from \"@finsemble/finsemble-core/types/services/window/types\";\n\ntype AppDefinition = services.Interop.types.AppDefinition;\n// Get the type of the window object within an AppD manifest. Use Required<> to resolve the ?:\ntype ManifestWindow = Required<AppDefinition>[\"manifest\"][\"window\"];\n\nconst abstractPositionLookup = [\n\t// `${top}-${left}-${bottom}-${right}`\n\t\"\",\n\t\"0-0-undefined-undefined\",\n\t\"0-center-undefined-undefined\",\n\t\"0-undefined-undefined-0\",\n\t\"center-0-undefined-undefined\",\n\t\"center-center-undefined-undefined\",\n\t\"center-undefined-undefined-0\",\n\t\"undefined-0-0-undefined\",\n\t\"undefined-center-0-undefined\",\n\t\"undefined-undefined-0-0\",\n];\n\nconst genAbstractPositionFromAppConfig = (appConfig: AppDefinition): number => {\n\tconst position = appConfig.manifest?.window?.position;\n\tconst left = appConfig.manifest?.window?.left;\n\tconst right = appConfig.manifest?.window?.right;\n\tconst top = appConfig.manifest?.window?.top;\n\tconst bottom = appConfig.manifest?.window?.bottom;\n\n\t// No position is defined\n\tif (position === undefined) {\n\t\treturn 0;\n\t}\n\n\treturn abstractPositionLookup.indexOf(`${top}-${left}-${bottom}-${right}`);\n};\nconst genWindowParamsFromAbstractPosition = (abstractPosition: number): ManifestWindow => {\n\tif (abstractPosition <= 0) {\n\t\treturn {};\n\t}\n\tconst [top, left, bottom, right] = abstractPositionLookup[abstractPosition].split(\"-\");\n\tconst params = {\n\t\tposition: \"monitor\" as PositionTypes,\n\t\ttop,\n\t\tleft,\n\t\tbottom,\n\t\tright,\n\t};\n\n\tfor (let key in params) {\n\t\tif (params[key as keyof typeof params] === \"undefined\") {\n\t\t\tdelete params[key as keyof typeof params];\n\t\t}\n\t}\n\n\treturn params;\n};\n\nexport function appConfigToAppData(appConfig: AppDefinition): Types.ApplicationSaveData {\n\treturn {\n\t\tname: appConfig.name || appConfig.manifest?.component?.displayName,\n\t\tdescription: appConfig.description || \"\",\n\t\turl: appConfig.manifest?.window?.url,\n\t\tpath: appConfig.manifest?.window?.path,\n\t\tappArguments: appConfig.manifest?.window?.arguments,\n\t\tappType: appConfig.manifest?.window?.windowType,\n\t\twidth: appConfig.manifest?.window?.width,\n\t\theight: appConfig.manifest?.window?.height,\n\t\ticonURL: appConfig.manifest?.foreign?.components?.Toolbar?.iconURL,\n\t\trules: appConfig.manifest?.interop?.selectConnect,\n\t\tintents: appConfig.intents ?? [],\n\t\tpersistPath: appConfig.manifest?.foreign?.services?.workspace?.persistPath,\n\t\tpersistURL: appConfig.manifest?.foreign?.services?.workspace?.persistURL,\n\t\taddToWorkspace: appConfig.manifest?.window?.addToWorkspace ?? true,\n\t\tallowAutoArrange: appConfig.manifest?.foreign?.services?.windowService?.allowAutoArrange ?? true,\n\t\tallowGrouping: appConfig.manifest?.foreign?.services?.windowService?.allowGrouping ?? true,\n\t\tallowMaximize: appConfig.manifest?.foreign?.services?.windowService?.allowMaximize ?? true,\n\t\tallowMinimize: appConfig.manifest?.foreign?.services?.windowService?.allowMinimize ?? true,\n\t\tallowSnapping: appConfig.manifest?.foreign?.services?.windowService?.allowSnapping ?? true,\n\t\tallowTabbing: appConfig.manifest?.foreign?.services?.windowService?.allowTabbing ?? true,\n\t\tallowTiling: appConfig.manifest?.foreign?.services?.windowService?.allowTiling ?? true,\n\t\tenableAOT: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.alwaysOnTopIcon ?? false,\n\t\tenableTitleBar: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader !== false,\n\t\thideClose: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader?.hideClose ?? false,\n\t\thideMaximize: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader?.hideMaximize ?? false,\n\t\thideMinimize: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader?.hideMinimize ?? false,\n\t\tautoConnect: appConfig.manifest?.interop?.autoConnect ?? true,\n\t\tabstractPosition: genAbstractPositionFromAppConfig(appConfig),\n\t\talwaysOnTop: appConfig.manifest?.window?.options?.alwaysOnTop ?? false,\n\t\topacity: appConfig.manifest?.window?.options?.opacity ?? 1,\n\t\tresizable: appConfig.manifest?.window?.options?.resizable ?? true,\n\t\tsingleton: appConfig.manifest?.component?.singleton ?? false,\n\t\tspawnOnStartup: appConfig.manifest?.component?.spawnOnStartup ?? false,\n\t\tlaunchableByUser: appConfig.manifest?.foreign?.components?.[\"App Launcher\"]?.launchableByUser ?? true,\n\t\tgrpc: appConfig.manifest?.component?.enableGrpc ?? false,\n\t\tsecurity: appConfig.manifest?.window?.options?.securityPolicy ?? \"trusted\",\n\t\tisEvergreen: appConfig.manifest?.window?.options?.isEvergreen ?? false,\n\t\tnative_windowSpawnTimeout: appConfig.manifest?.window?.options?.windowSpawnTimeout ?? 30,\n\t};\n}\n\nexport function appDataToAppConfig(\n\tcurrentAppConfig: AppDefinition,\n\tdata: Types.ApplicationSaveData,\n\tappId: string\n): AppDefinition {\n\tlet windowParams: ManifestWindow = currentAppConfig.manifest\n\t\t? {\n\t\t\t\t...currentAppConfig.manifest.window,\n\t\t\t\toptions: {\n\t\t\t\t\t...currentAppConfig.manifest.window?.options,\n\t\t\t\t\tsecurityPolicy: data.security,\n\t\t\t\t\tisEvergreen: data.isEvergreen,\n\t\t\t\t\twindowSpawnTimeout: data.native_windowSpawnTimeout,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n\n\tif (data.appType != \"web\") {\n\t\twindowParams.windowType = data.appType == \"native\" ? data.appType : \"assimilation\";\n\t\twindowParams.path = data.path;\n\t\twindowParams.arguments = data.appArguments?.trim();\n\t\tdelete windowParams.url;\n\t} else {\n\t\tdelete windowParams.windowType;\n\t\tdelete windowParams.path;\n\t\tdelete windowParams.arguments;\n\t\twindowParams.url = data.url;\n\t}\n\n\twindowParams.width = data.width;\n\twindowParams.height = data.height;\n\twindowParams.addToWorkspace = data.addToWorkspace;\n\n\tdelete windowParams.position;\n\tdelete windowParams.left;\n\tdelete windowParams.right;\n\tdelete windowParams.top;\n\tdelete windowParams.bottom;\n\n\tlet appConfig: AppDefinition = {\n\t\t...currentAppConfig,\n\t\tappId,\n\t\tname: data.name,\n\t\tdescription: data.description,\n\t\tmanifest: {\n\t\t\t...currentAppConfig.manifest,\n\t\t\twindow: {\n\t\t\t\t...windowParams,\n\t\t\t\t...genWindowParamsFromAbstractPosition(data.abstractPosition),\n\t\t\t\toptions: {\n\t\t\t\t\t...windowParams?.options,\n\t\t\t\t\talwaysOnTop: data.alwaysOnTop,\n\t\t\t\t\topacity: data.opacity,\n\t\t\t\t\tresizable: data.resizable,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcomponent: {\n\t\t\t\t...currentAppConfig.manifest?.component,\n\t\t\t\tsingleton: data.singleton,\n\t\t\t\tspawnOnStartup: data.spawnOnStartup,\n\t\t\t\tenableGrpc: data.grpc,\n\t\t\t},\n\t\t\tinterop: {\n\t\t\t\t...currentAppConfig.manifest?.interop,\n\t\t\t\tselectConnect: data.rules,\n\t\t\t\tautoConnect: data.autoConnect,\n\t\t\t},\n\t\t\tforeign: {\n\t\t\t\t...currentAppConfig.manifest?.foreign,\n\t\t\t\tcomponents: {\n\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components,\n\t\t\t\t\t\"App Launcher\": {\n\t\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components?.[\"App Launcher\"],\n\t\t\t\t\t\tlaunchableByUser: data.launchableByUser,\n\t\t\t\t\t},\n\t\t\t\t\tToolbar: {\n\t\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components?.Toolbar,\n\t\t\t\t\t\ticonURL: data.iconURL,\n\t\t\t\t\t},\n\t\t\t\t\t\"Window Manager\": {\n\t\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components?.[\"Window Manager\"],\n\t\t\t\t\t\talwaysOnTopIcon: data.enableAOT || !data.alwaysOnTop,\n\t\t\t\t\t\tFSBLHeader: data.enableTitleBar\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\thideClose: data.hideClose,\n\t\t\t\t\t\t\t\t\thideMaximize: data.hideMaximize || !data.allowMaximize,\n\t\t\t\t\t\t\t\t\thideMinimize: data.hideMinimize || !data.allowMinimize,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tservices: {\n\t\t\t\t\t...currentAppConfig.manifest?.foreign?.services,\n\t\t\t\t\tworkspace: {\n\t\t\t\t\t\t...currentAppConfig.manifest?.foreign?.services?.workspace,\n\t\t\t\t\t\tpersistPath: data.persistPath,\n\t\t\t\t\t\tpersistURL: data.persistURL,\n\t\t\t\t\t},\n\t\t\t\t\twindowService: {\n\t\t\t\t\t\t...currentAppConfig.manifest?.foreign?.services?.windowService,\n\t\t\t\t\t\tallowAutoArrange: data.allowAutoArrange,\n\t\t\t\t\t\tallowGrouping: data.allowGrouping,\n\t\t\t\t\t\tallowMinimize: data.allowMinimize,\n\t\t\t\t\t\tallowMaximize: data.allowMaximize,\n\t\t\t\t\t\tallowSnapping: data.allowSnapping,\n\t\t\t\t\t\tallowTabbing: data.allowTabbing,\n\t\t\t\t\t\tallowTiling: data.allowTiling,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tintents: data.intents,\n\t};\n\n\tdelete appConfig.manifest?.temporary;\n\tif (data.iconURL === \"\") {\n\t\tdelete appConfig.manifest?.foreign?.components.Toolbar.iconURL;\n\t}\n\treturn appConfig;\n}\n\nexport enum ApplicationCloseReason {\n\tSUCCESS,\n\tCANCEL,\n\tNEW,\n}\n\nexport type ApplicationProps = {\n\tid: string;\n\tapps: AppDefinition[];\n\taddApp: (appId: string, config: AppDefinition) => Promise<{ err: null }>;\n\tdeleteApp: typeof FSBL.Clients.SmartDesktopClient.prototype.deleteApp;\n\tgetAppConfigTemplate: typeof FSBL.Clients.SmartDesktopClient.prototype.getAppConfigTemplate;\n\tonClose: (reason: ApplicationCloseReason) => void;\n\tsetCurrentAppID: (id: string | null) => void;\n\tisInboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isInboundInteropAuthorized;\n\tisOutboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isOutboundInteropAuthorized;\n};\n\nconst validateURL = (url: string) => FSBL.Clients.SmartDesktopClient.checkValidURL(url);\n\nconst helpFunction = () => {\n\tlaunchTutorialLink(\"SDD-02-ManageApps\");\n};\n\nexport const Application = (props: ApplicationProps) => {\n\tconst dispatch = useDispatch();\n\n\tconst currentAppID = props.id;\n\n\tconst currentAppConfig = useSelector((state: RootState) =>\n\t\tstate.smartDesktopDesigner.apps.find((app: AppDefinition) => app.appId === currentAppID)\n\t);\n\n\tif (!currentAppConfig) {\n\t\tprops.getAppConfigTemplate().then((response: any) => {\n\t\t\tprops.deleteApp(currentAppID).then(() => {\n\t\t\t\tconst config: AppDefinition = {\n\t\t\t\t\t...response.config,\n\t\t\t\t\tappId: currentAppID,\n\t\t\t\t\tmanifest: {\n\t\t\t\t\t\t...response.config.manifest,\n\t\t\t\t\t\t// Apps that are flagged temporary will be removed if the user cancels out of adding an app\n\t\t\t\t\t\ttemporary: true,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tprops.addApp(currentAppID, config).then(() => {\n\t\t\t\t\tdispatch(SmartDesktopDesignerActions.update_app(config));\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div style={{ overflow: \"hidden\" }}>\n\t\t\t\t\t<div style={{ marginTop: \"43vh\" }}>\n\t\t\t\t\t\t<CircularLoadingSpinner />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst onSaveData = (data: Types.ApplicationSaveData) =>\n\t\tnew Promise<any>((resolve, reject) => {\n\t\t\tif (!currentAppID) {\n\t\t\t\treturn reject(new Error(\"no app ID specified\"));\n\t\t\t}\n\n\t\t\tconst appConfig = appDataToAppConfig(currentAppConfig, data, currentAppID);\n\n\t\t\t// Always remove and replace component\n\t\t\tprops.deleteApp(currentAppID).then(({ err }: { err: string }) => {\n\t\t\t\tif (err) {\n\t\t\t\t\talert(err);\n\t\t\t\t}\n\n\t\t\t\tprops\n\t\t\t\t\t.addApp(currentAppID, appConfig)\n\t\t\t\t\t.then((response: any) => {\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t\tprops.onClose(ApplicationCloseReason.SUCCESS);\n\t\t\t\t\t})\n\t\t\t\t\t.catch((e: any) => {\n\t\t\t\t\t\treject(e);\n\t\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\tconst setCurrentComponentID = (id: string | null) => {\n\t\tif (id === \"new\") {\n\t\t\tprops.onClose(ApplicationCloseReason.NEW);\n\t\t} else {\n\t\t\tprops.onClose(ApplicationCloseReason.SUCCESS);\n\t\t}\n\t};\n\n\tconst removeApplicationFn = () => {\n\t\tprops.deleteApp(currentAppID);\n\t\tsetCurrentComponentID(\"\");\n\t};\n\n\tconst appData = appConfigToAppData(currentAppConfig) as Types.ApplicationSaveData;\n\tconst { displayName, windowURL, nativePath, currentAppType } = generateDefaultConfig(appData);\n\n\tconst appEditPageProps: AppEditPageProps = {\n\t\tstartingDisplayName: displayName,\n\t\tstartingAppType: currentAppType,\n\t\tstartingWindowURL: windowURL,\n\t\tstartingNativePath: nativePath,\n\t\tappData,\n\t\tvalidateURL,\n\t\tremoveApplicationFn,\n\t\tcancelFn: () => {\n\t\t\tsetCurrentComponentID(null);\n\t\t},\n\t\tsubmitFn: (data: Types.ApplicationSaveData) => {\n\t\t\tonSaveData?.({\n\t\t\t\t...data,\n\t\t\t\ttags: appData.tags,\n\t\t\t});\n\t\t},\n\t\taddApp: props.addApp,\n\t\tisInboundInteropAuthorized: props.isInboundInteropAuthorized,\n\t\tisOutboundInteropAuthorized: props.isOutboundInteropAuthorized,\n\t};\n\n\treturn (\n\t\t<div className=\"app-edit\">\n\t\t\t<View>\n\t\t\t\t<div>\n\t\t\t\t\t<form onSubmit={(e) => e.preventDefault()}>\n\t\t\t\t\t\t<fieldset className=\"app-edit-fieldset\">\n\t\t\t\t\t\t\t<legend>\n\t\t\t\t\t\t\t\t<Header helpFunction={helpFunction}>Edit app</Header>\n\t\t\t\t\t\t\t</legend>\n\n\t\t\t\t\t\t\t<Content>\n\t\t\t\t\t\t\t\t<AppEditPage {...appEditPageProps} />\n\t\t\t\t\t\t\t</Content>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</View>\n\t\t</div>\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/Application.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAIxF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAS7D,MAAM,sBAAsB,GAAG;IAE9B,EAAE;IACF,yBAAyB;IACzB,8BAA8B;IAC9B,yBAAyB;IACzB,8BAA8B;IAC9B,mCAAmC;IACnC,8BAA8B;IAC9B,yBAAyB;IACzB,8BAA8B;IAC9B,yBAAyB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,SAAwB,EAAU,EAAE;;IACpF,M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AU,uBAAV,UAAU,iCACN,IAAI,KACP,IAAI,EAAE,OAAO,CAAC,IAAI,IACjB,CAAC;QACJ,CAAC;QACD,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,0BAA0B,EAAE,KAAK,CAAC,0BAA0B;QAC5D,2BAA2B,EAAE,KAAK,CAAC,2BAA2B;QAC9D,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KAChE,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,UAAU;QACxB,oBAAC,IAAI;YACJ;gBACC,8BAAM,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE;oBACxC,kCAAU,SAAS,EAAC,mBAAmB;wBACtC;4BACC,oBAAC,MAAM,IAAC,YAAY,EAAE,YAAY,eAAmB,CAC7C;wBAET,oBAAC,OAAO;4BACP,oBAAC,WAAW,oBAAK,gBAAgB,EAAI,CAC5B,CACA,CACL,CACF,CACA,CACF,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 - 2020 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport React from \"react\";\nimport { useSelector, useDispatch } from \"../../store\";\nimport { CircularLoadingSpinner } from \"../common/LoadingSpinner\";\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\nimport { RootState } from \"../../reducers/rootReducer\";\nimport * as Types from \"../../types/smartDesktopDesignerTypes\";\nimport { services } from \"@finsemble/finsemble-api\";\nimport { View } from \"./View\";\nimport { Header } from \"../common/Header\";\nimport { Content } from \"./Content\";\nimport { AppEditPage } from \"./AppEditPage\";\nimport { generateDefaultConfig } from \"./sdd_helpers\";\nimport { launchTutorialLink } from \"./common/fsbl_functions\";\nimport { AppEditPageProps } from \"./AppEditPage\";\nimport { PositionTypes } from \"@finsemble/finsemble-api/types/services/window/types\";\nimport { PreloadType } from \"../../types/smartDesktopDesignerTypes\";\n\nexport type AppDefinition = services.Interop.types.AppDefinition;\n// Get the type of the window object within an AppD manifest. Use Required<> to resolve the ?:\nexport type ManifestWindow = Required<AppDefinition>[\"manifest\"][\"window\"];\n\nconst abstractPositionLookup = [\n\t// `${top}-${left}-${bottom}-${right}`\n\t\"\",\n\t\"0-0-undefined-undefined\",\n\t\"0-center-undefined-undefined\",\n\t\"0-undefined-undefined-0\",\n\t\"center-0-undefined-undefined\",\n\t\"center-center-undefined-undefined\",\n\t\"center-undefined-undefined-0\",\n\t\"undefined-0-0-undefined\",\n\t\"undefined-center-0-undefined\",\n\t\"undefined-undefined-0-0\",\n];\n\nexport const genAbstractPositionFromAppConfig = (appConfig: AppDefinition): number => {\n\tconst position = appConfig.manifest?.window?.position;\n\tconst left = appConfig.manifest?.window?.left;\n\tconst right = appConfig.manifest?.window?.right;\n\tconst top = appConfig.manifest?.window?.top;\n\tconst bottom = appConfig.manifest?.window?.bottom;\n\n\t// No position is defined\n\tif (position === undefined) {\n\t\treturn 0;\n\t}\n\n\treturn abstractPositionLookup.indexOf(`${top}-${left}-${bottom}-${right}`);\n};\nexport const genWindowParamsFromAbstractPosition = (abstractPosition: number): ManifestWindow => {\n\tif (abstractPosition <= 0) {\n\t\treturn {};\n\t}\n\tconst [top, left, bottom, right] = abstractPositionLookup[abstractPosition].split(\"-\");\n\tconst params = {\n\t\tposition: \"monitor\" as PositionTypes,\n\t\ttop,\n\t\tleft,\n\t\tbottom,\n\t\tright,\n\t};\n\n\tfor (let key in params) {\n\t\tif (params[key as keyof typeof params] === \"undefined\") {\n\t\t\tdelete params[key as keyof typeof params];\n\t\t}\n\t}\n\n\treturn params;\n};\n\n/* eslint-disable sonarjs/cognitive-complexity */\nexport function appConfigToAppData(appConfig: AppDefinition): Types.ApplicationSaveData {\n\treturn {\n\t\tname: appConfig.name || appConfig.manifest?.component?.displayName,\n\t\tdescription: appConfig.description || \"\",\n\t\turl: appConfig.manifest?.window?.url,\n\t\tpath: appConfig.manifest?.window?.path,\n\t\tappArguments: appConfig.manifest?.window?.arguments,\n\t\tappType: appConfig.manifest?.window?.windowType,\n\t\twidth: appConfig.manifest?.window?.width,\n\t\theight: appConfig.manifest?.window?.height,\n\t\ticonURL: appConfig.manifest?.foreign?.components?.Toolbar?.iconURL,\n\t\trules: appConfig.manifest?.interop?.selectConnect,\n\t\tintents: appConfig.intents ?? [],\n\t\tpersistPath: appConfig.manifest?.foreign?.services?.workspace?.persistPath ?? false,\n\t\tpersistURL: appConfig.manifest?.foreign?.services?.workspace?.persistURL ?? false,\n\t\taddToWorkspace: appConfig.manifest?.window?.addToWorkspace ?? true,\n\t\tallowAutoArrange: appConfig.manifest?.foreign?.services?.windowService?.allowAutoArrange ?? true,\n\t\tallowGrouping: appConfig.manifest?.foreign?.services?.windowService?.allowGrouping ?? true,\n\t\tallowMaximize: appConfig.manifest?.foreign?.services?.windowService?.allowMaximize ?? true,\n\t\tallowMinimize: appConfig.manifest?.foreign?.services?.windowService?.allowMinimize ?? true,\n\t\tallowSnapping: appConfig.manifest?.foreign?.services?.windowService?.allowSnapping ?? true,\n\t\tallowTabbing: appConfig.manifest?.foreign?.services?.windowService?.allowTabbing ?? true,\n\t\tallowTiling: appConfig.manifest?.foreign?.services?.windowService?.allowTiling ?? true,\n\t\tenableAOT: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.alwaysOnTopIcon ?? false,\n\t\tenableTitleBar: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader !== false,\n\t\thideClose: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader?.hideClose ?? false,\n\t\thideMaximize: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader?.hideMaximize ?? false,\n\t\thideMinimize: appConfig.manifest?.foreign?.components?.[\"Window Manager\"]?.FSBLHeader?.hideMinimize ?? false,\n\t\tautoConnect: appConfig.manifest?.interop?.autoConnect ?? true,\n\t\tabstractPosition: genAbstractPositionFromAppConfig(appConfig),\n\t\talwaysOnTop: appConfig.manifest?.window?.options?.alwaysOnTop ?? false,\n\t\topacity: appConfig.manifest?.window?.options?.opacity ?? 1,\n\t\tresizable: appConfig.manifest?.window?.options?.resizable ?? true,\n\t\tsingleton: appConfig.manifest?.component?.singleton ?? false,\n\t\tspawnOnStartup: appConfig.manifest?.component?.spawnOnStartup ?? false,\n\t\tlaunchableByUser: appConfig.manifest?.foreign?.components?.[\"App Launcher\"]?.launchableByUser ?? true,\n\t\tsecurity: appConfig.manifest?.window?.options?.securityPolicy ?? \"trusted\",\n\t\tisEvergreen: appConfig.manifest?.window?.options?.isEvergreen ?? false,\n\t\tnative_windowSpawnTimeout: appConfig.manifest?.window?.options?.windowSpawnTimeout ?? 30,\n\t\tpreloads: appConfig.manifest?.component?.preload ?? [],\n\t};\n}\n\nexport function appDataToAppConfig(\n\tcurrentAppConfig: AppDefinition,\n\tdata: Types.ApplicationSaveData,\n\tappId: string\n): AppDefinition {\n\tlet windowParams: ManifestWindow = currentAppConfig.manifest\n\t\t? {\n\t\t\t\t...currentAppConfig.manifest.window,\n\t\t\t\toptions: {\n\t\t\t\t\t...currentAppConfig.manifest.window?.options,\n\t\t\t\t\tsecurityPolicy: data.security,\n\t\t\t\t\tisEvergreen: data.isEvergreen,\n\t\t\t\t\twindowSpawnTimeout: data.native_windowSpawnTimeout,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n\n\tif (data.appType != \"web\") {\n\t\twindowParams.windowType = data.appType == \"native\" ? data.appType : \"assimilation\";\n\t\twindowParams.path = data.path;\n\t\twindowParams.arguments = data.appArguments?.trim();\n\t\tdelete windowParams.url;\n\t} else {\n\t\tdelete windowParams.windowType;\n\t\tdelete windowParams.path;\n\t\tdelete windowParams.arguments;\n\t\twindowParams.url = data.url;\n\t}\n\n\twindowParams.width = data.width;\n\twindowParams.height = data.height;\n\twindowParams.addToWorkspace = data.addToWorkspace;\n\n\tdelete windowParams.position;\n\tdelete windowParams.left;\n\tdelete windowParams.right;\n\tdelete windowParams.top;\n\tdelete windowParams.bottom;\n\n\tlet appConfig: AppDefinition = {\n\t\t...currentAppConfig,\n\t\tappId,\n\t\tname: data.name,\n\t\tdescription: data.description,\n\t\tmanifest: {\n\t\t\t...currentAppConfig.manifest,\n\t\t\twindow: {\n\t\t\t\t...windowParams,\n\t\t\t\t...genWindowParamsFromAbstractPosition(data.abstractPosition),\n\t\t\t\toptions: {\n\t\t\t\t\t...windowParams?.options,\n\t\t\t\t\talwaysOnTop: data.alwaysOnTop,\n\t\t\t\t\topacity: data.opacity,\n\t\t\t\t\tresizable: data.resizable,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcomponent: {\n\t\t\t\t...currentAppConfig.manifest?.component,\n\t\t\t\tsingleton: data.singleton,\n\t\t\t\tspawnOnStartup: data.spawnOnStartup,\n\t\t\t\tpreload: data.preloads,\n\t\t\t},\n\t\t\tinterop: {\n\t\t\t\t...currentAppConfig.manifest?.interop,\n\t\t\t\tselectConnect: data.rules,\n\t\t\t\tautoConnect: data.autoConnect,\n\t\t\t},\n\t\t\tforeign: {\n\t\t\t\t...currentAppConfig.manifest?.foreign,\n\t\t\t\tcomponents: {\n\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components,\n\t\t\t\t\t\"App Launcher\": {\n\t\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components?.[\"App Launcher\"],\n\t\t\t\t\t\tlaunchableByUser: data.launchableByUser,\n\t\t\t\t\t},\n\t\t\t\t\tToolbar: {\n\t\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components?.Toolbar,\n\t\t\t\t\t\ticonURL: data.iconURL,\n\t\t\t\t\t},\n\t\t\t\t\t\"Window Manager\": {\n\t\t\t\t\t\t...currentAppConfig?.manifest?.foreign?.components?.[\"Window Manager\"],\n\t\t\t\t\t\talwaysOnTopIcon: data.enableAOT || !data.alwaysOnTop,\n\t\t\t\t\t\tFSBLHeader: data.enableTitleBar\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\thideClose: data.hideClose,\n\t\t\t\t\t\t\t\t\thideMaximize: data.hideMaximize || !data.allowMaximize,\n\t\t\t\t\t\t\t\t\thideMinimize: data.hideMinimize || !data.allowMinimize,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tservices: {\n\t\t\t\t\t...currentAppConfig.manifest?.foreign?.services,\n\t\t\t\t\tworkspace: {\n\t\t\t\t\t\t...currentAppConfig.manifest?.foreign?.services?.workspace,\n\t\t\t\t\t\tpersistPath: data.persistPath,\n\t\t\t\t\t\tpersistURL: data.persistURL,\n\t\t\t\t\t},\n\t\t\t\t\twindowService: {\n\t\t\t\t\t\t...currentAppConfig.manifest?.foreign?.services?.windowService,\n\t\t\t\t\t\tallowAutoArrange: data.allowAutoArrange,\n\t\t\t\t\t\tallowGrouping: data.allowGrouping,\n\t\t\t\t\t\tallowMinimize: data.allowMinimize,\n\t\t\t\t\t\tallowMaximize: data.allowMaximize,\n\t\t\t\t\t\tallowSnapping: data.allowSnapping,\n\t\t\t\t\t\tallowTabbing: data.allowTabbing,\n\t\t\t\t\t\tallowTiling: data.allowTiling,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tintents: data.intents,\n\t};\n\n\tdelete appConfig.manifest?.temporary;\n\tif (data.iconURL === \"\") {\n\t\tdelete appConfig.manifest?.foreign?.components.Toolbar.iconURL;\n\t}\n\treturn appConfig;\n}\n\nexport enum ApplicationCloseReason {\n\tSUCCESS,\n\tCANCEL,\n\tNEW,\n}\n\nexport type ApplicationProps = {\n\tid: string;\n\tapps: AppDefinition[];\n\taddApp: (appId: string, config: AppDefinition) => Promise<{ err: null }>;\n\tupdateApp: (appId: string, config: AppDefinition) => Promise<{ err: null }>;\n\tdeleteApp: typeof FSBL.Clients.SmartDesktopClient.prototype.deleteApp;\n\tgetAppConfigTemplate: typeof FSBL.Clients.SmartDesktopClient.prototype.getAppConfigTemplate;\n\tonClose: (reason: ApplicationCloseReason) => void;\n\tsetCurrentAppID: (id: string | null) => void;\n\tisInboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isInboundInteropAuthorized;\n\tisOutboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isOutboundInteropAuthorized;\n\tpreloads: PreloadType[];\n};\n\nconst validateURL = (url: string) => FSBL.Clients.SmartDesktopClient.checkValidURL(url);\n\nconst helpFunction = () => {\n\tlaunchTutorialLink(\"SDD-02-ManageApps\");\n};\n\nexport const Application = (props: ApplicationProps) => {\n\tconst dispatch = useDispatch();\n\n\tconst currentAppID = props.id;\n\n\tconst currentAppConfig = useSelector((state: RootState) =>\n\t\tstate.smartDesktopDesigner.apps.find((app: AppDefinition) => app.appId === currentAppID)\n\t);\n\n\tif (!currentAppConfig) {\n\t\tprops.getAppConfigTemplate().then((response: any) => {\n\t\t\tprops.deleteApp(currentAppID).then(() => {\n\t\t\t\tconst config: AppDefinition = {\n\t\t\t\t\t...response.config,\n\t\t\t\t\tappId: currentAppID,\n\t\t\t\t\tmanifest: {\n\t\t\t\t\t\t...response.config.manifest,\n\t\t\t\t\t\t// Apps that are flagged temporary will be removed if the user cancels out of adding an app\n\t\t\t\t\t\ttemporary: true,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tprops.addApp(currentAppID, config).then(() => {\n\t\t\t\t\tdispatch(SmartDesktopDesignerActions.update_app(config));\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div style={{ overflow: \"hidden\" }}>\n\t\t\t\t\t<div style={{ marginTop: \"43vh\" }}>\n\t\t\t\t\t\t<CircularLoadingSpinner />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst onSaveData = (data: Types.ApplicationSaveData) =>\n\t\tnew Promise<any>((resolve, reject) => {\n\t\t\tif (!currentAppID) {\n\t\t\t\treturn reject(new Error(\"no app ID specified\"));\n\t\t\t}\n\n\t\t\tconst appConfig = appDataToAppConfig(currentAppConfig, data, currentAppID);\n\t\t\tprops.updateApp(currentAppID, appConfig).then(({ err }) => {\n\t\t\t\tconsole.log(err);\n\t\t\t\tif (err === null) {\n\t\t\t\t\tprops.onClose(ApplicationCloseReason.SUCCESS);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\tconst setCurrentComponentID = (id: string | null) => {\n\t\tif (id === \"new\") {\n\t\t\tprops.onClose(ApplicationCloseReason.NEW);\n\t\t} else {\n\t\t\tprops.onClose(ApplicationCloseReason.SUCCESS);\n\t\t}\n\t};\n\n\tconst removeApplicationFn = () => {\n\t\tprops.deleteApp(currentAppID);\n\t\tsetCurrentComponentID(\"\");\n\t};\n\n\tconst appData = appConfigToAppData(currentAppConfig) as Types.ApplicationSaveData;\n\tconst { displayName, windowURL, nativePath, currentAppType } = generateDefaultConfig(appData);\n\n\tconst appEditPageProps: AppEditPageProps = {\n\t\tstartingDisplayName: displayName,\n\t\tstartingAppType: currentAppType,\n\t\tstartingWindowURL: windowURL,\n\t\tstartingNativePath: nativePath,\n\t\tappData,\n\t\tvalidateURL,\n\t\tremoveApplicationFn,\n\t\tcancelFn: () => {\n\t\t\tsetCurrentComponentID(null);\n\t\t},\n\t\tsubmitFn: (data: Types.ApplicationSaveData) => {\n\t\t\tonSaveData?.({\n\t\t\t\t...data,\n\t\t\t\ttags: appData.tags,\n\t\t\t});\n\t\t},\n\t\taddApp: props.addApp,\n\t\tisInboundInteropAuthorized: props.isInboundInteropAuthorized,\n\t\tisOutboundInteropAuthorized: props.isOutboundInteropAuthorized,\n\t\tpreloadAliasList: props.preloads.map((preload) => preload.alias),\n\t};\n\n\treturn (\n\t\t<div className=\"app-edit\">\n\t\t\t<View>\n\t\t\t\t<div>\n\t\t\t\t\t<form onSubmit={(e) => e.preventDefault()}>\n\t\t\t\t\t\t<fieldset className=\"app-edit-fieldset\">\n\t\t\t\t\t\t\t<legend>\n\t\t\t\t\t\t\t\t<Header helpFunction={helpFunction}>Edit app</Header>\n\t\t\t\t\t\t\t</legend>\n\n\t\t\t\t\t\t\t<Content>\n\t\t\t\t\t\t\t\t<AppEditPage {...appEditPageProps} />\n\t\t\t\t\t\t\t</Content>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</View>\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -7,10 +7,12 @@ export declare type ApplicationsProps = {
|
|
|
7
7
|
getApps: typeof FSBL.Clients.SmartDesktopClient.prototype.getApps;
|
|
8
8
|
addApp: typeof FSBL.Clients.SmartDesktopClient.prototype.addApp;
|
|
9
9
|
deleteApp: typeof FSBL.Clients.SmartDesktopClient.prototype.deleteApp;
|
|
10
|
+
updateApp: typeof FSBL.Clients.SmartDesktopClient.prototype.updateApp;
|
|
10
11
|
getAppConfigTemplate: typeof FSBL.Clients.SmartDesktopClient.prototype.getAppConfigTemplate;
|
|
11
12
|
getMenus: typeof FSBL.Clients.SmartDesktopClient.prototype.getMenus;
|
|
12
13
|
addMenu: typeof FSBL.Clients.SmartDesktopClient.prototype.addMenu;
|
|
13
14
|
updateMenu: typeof FSBL.Clients.SmartDesktopClient.prototype.updateMenu;
|
|
15
|
+
getPreloads: typeof FSBL.Clients.SmartDesktopClient.prototype.getPreloads;
|
|
14
16
|
isInboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isInboundInteropAuthorized;
|
|
15
17
|
isOutboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isOutboundInteropAuthorized;
|
|
16
18
|
};
|
|
@@ -9,7 +9,7 @@ import { Header } from "../common/Header";
|
|
|
9
9
|
import { Button } from "../common/Button";
|
|
10
10
|
import { Content } from "./Content";
|
|
11
11
|
import { Application, ApplicationCloseReason } from "./Application";
|
|
12
|
-
import {
|
|
12
|
+
import { ItemList } from "./ItemList";
|
|
13
13
|
import { SmartDesktopDesignerActions } from "../../actions/smartDesktopDesignerActions";
|
|
14
14
|
import { DropZone } from "../common/DropZone";
|
|
15
15
|
import { generateDefaultConfig } from "./sdd_helpers";
|
|
@@ -25,6 +25,7 @@ export const Applications = (props) => {
|
|
|
25
25
|
const [editMode, setEditMode] = useState(false);
|
|
26
26
|
const apps = useSelector((state) => state.smartDesktopDesigner.apps);
|
|
27
27
|
const menus = useSelector((state) => state.smartDesktopDesigner.menus);
|
|
28
|
+
const preloads = useSelector((state) => state.smartDesktopDesigner.preloads);
|
|
28
29
|
const newAppID = useSelector((state) => state.smartDesktopDesigner.newAppId);
|
|
29
30
|
const currentAppID = useSelector((state) => state.smartDesktopDesigner.currentAppId);
|
|
30
31
|
if (Object.values(menus).every((menu) => menu.applications.length > 0)) {
|
|
@@ -38,6 +39,10 @@ export const Applications = (props) => {
|
|
|
38
39
|
dispatch(SmartDesktopDesignerActions.update_apps(response.apps));
|
|
39
40
|
});
|
|
40
41
|
}
|
|
42
|
+
const updatePreloadList = async () => {
|
|
43
|
+
const { preloads } = await props.getPreloads();
|
|
44
|
+
dispatch(SmartDesktopDesignerActions.update_preloads(preloads));
|
|
45
|
+
};
|
|
41
46
|
function setCurrentAppID(id) {
|
|
42
47
|
if (id === null) {
|
|
43
48
|
dispatch(SmartDesktopDesignerActions.new_app(null));
|
|
@@ -64,7 +69,10 @@ export const Applications = (props) => {
|
|
|
64
69
|
});
|
|
65
70
|
});
|
|
66
71
|
};
|
|
67
|
-
useEffect(
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
updateAppList();
|
|
74
|
+
updatePreloadList();
|
|
75
|
+
}, []);
|
|
68
76
|
const addDroppedApp = (file, index) => {
|
|
69
77
|
const appId = String(new Date().getTime() + index);
|
|
70
78
|
const { path } = file;
|
|
@@ -141,21 +149,23 @@ export const Applications = (props) => {
|
|
|
141
149
|
apps,
|
|
142
150
|
addApp: props.addApp,
|
|
143
151
|
deleteApp: props.deleteApp,
|
|
152
|
+
updateApp: props.updateApp,
|
|
144
153
|
getAppConfigTemplate: props.getAppConfigTemplate,
|
|
145
154
|
setCurrentAppID,
|
|
146
155
|
onClose,
|
|
147
156
|
isInboundInteropAuthorized: props.isInboundInteropAuthorized,
|
|
148
157
|
isOutboundInteropAuthorized: props.isOutboundInteropAuthorized,
|
|
158
|
+
preloads,
|
|
149
159
|
};
|
|
150
160
|
const dropZoneProps = {
|
|
151
|
-
|
|
152
|
-
|
|
161
|
+
items: apps.filter((app) => { var _a; return !((_a = app === null || app === void 0 ? void 0 : app.manifest) === null || _a === void 0 ? void 0 : _a.temporary); }),
|
|
162
|
+
clickItem: (appID) => {
|
|
153
163
|
FSBL.Clients.LauncherClient.showWindow({ componentType: appID }, { spawnIfNotFound: true }, (err, data) => { });
|
|
154
164
|
},
|
|
155
|
-
|
|
165
|
+
editItem: (appID) => {
|
|
156
166
|
setCurrentAppID(appID);
|
|
157
167
|
},
|
|
158
|
-
|
|
168
|
+
deleteItem: removeAppID,
|
|
159
169
|
};
|
|
160
170
|
const helpFunction = () => {
|
|
161
171
|
launchTutorialLink("SDD-02-ManageApps");
|
|
@@ -171,6 +181,6 @@ export const Applications = (props) => {
|
|
|
171
181
|
React.createElement(Button, { className: "icon-before-add", fashion: "primary", iconBefore: "plus", text: "Add", onClick: addApp }),
|
|
172
182
|
React.createElement(AddApp, { show: editMode, checkValidURL: FSBL.Clients.SmartDesktopClient.checkValidURL, addAppByUrl: addAppByUrl, addAppByPath: addAppByPath, close: addApp }),
|
|
173
183
|
React.createElement(DropZone, { processFile: addDroppedApp },
|
|
174
|
-
React.createElement(
|
|
184
|
+
React.createElement(ItemList, Object.assign({}, dropZoneProps)))))))));
|
|
175
185
|
};
|
|
176
186
|
//# sourceMappingURL=Applications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Applications.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/Applications.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE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ights reserved.\n */\n\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"../../store\";\nimport { View } from \"./View\";\n// import { Tab } from \"../common/Tab\";\nimport { Header } from \"../common/Header\";\nimport { Button } from \"../common/Button\";\nimport { Content } from \"./Content\";\nimport { Application, ApplicationCloseReason } from \"./Application\";\nimport { ApplicationList } from \"./ApplicationList\";\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\nimport { RootState } from \"../../reducers/rootReducer\";\nimport { DropZone, FileWithPath } from \"../common/DropZone\";\nimport { generateDefaultConfig } from \"./sdd_helpers\";\nimport { MenuType, ProjectError } from \"../../types/smartDesktopDesignerTypes\";\nimport { launchTutorialLink } from \"./common/fsbl_functions\";\nimport { validateFilename, VALID_APP_EXTENSIONS } from \"../common/file_helpers\";\nimport { ApplicationProps } from \"./Application\";\nimport { ApplicationListProps } from \"./ApplicationList\";\nimport { services } from \"@finsemble/finsemble-core/\";\nimport { AddApp } from \"./AddApp\";\n\ntype AppDefinition = services.Interop.types.AppDefinition;\n\nexport type ApplicationsProps = {\n\tgetApps: typeof FSBL.Clients.SmartDesktopClient.prototype.getApps;\n\taddApp: typeof FSBL.Clients.SmartDesktopClient.prototype.addApp;\n\tdeleteApp: typeof FSBL.Clients.SmartDesktopClient.prototype.deleteApp;\n\tgetAppConfigTemplate: typeof FSBL.Clients.SmartDesktopClient.prototype.getAppConfigTemplate;\n\tgetMenus: typeof FSBL.Clients.SmartDesktopClient.prototype.getMenus;\n\taddMenu: typeof FSBL.Clients.SmartDesktopClient.prototype.addMenu;\n\tupdateMenu: typeof FSBL.Clients.SmartDesktopClient.prototype.updateMenu;\n\tisInboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isInboundInteropAuthorized;\n\tisOutboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isOutboundInteropAuthorized;\n};\n\nconst EMPTY_MENU_ERROR: ProjectError = {\n\tviewId: \"applications\",\n\tmessage: \"One or more of your app menus is empty\",\n};\n\nexport const Applications = (props: ApplicationsProps) => {\n\tconst dispatch = useDispatch();\n\tconst [editMode, setEditMode] = useState(false);\n\n\tconst apps = useSelector((state: RootState) => state.smartDesktopDesigner.apps);\n\tconst menus = useSelector<MenuType>((state: RootState) => state.smartDesktopDesigner.menus);\n\n\tconst newAppID = useSelector((state: RootState) => state.smartDesktopDesigner.newAppId);\n\n\tconst currentAppID = useSelector((state: RootState) => state.smartDesktopDesigner.currentAppId);\n\n\tif (Object.values(menus).every((menu) => menu.applications.length > 0)) {\n\t\tdispatch(SmartDesktopDesignerActions.delete_project_error(EMPTY_MENU_ERROR));\n\t} else {\n\t\tdispatch(SmartDesktopDesignerActions.set_project_error(EMPTY_MENU_ERROR));\n\t}\n\n\tfunction updateAppList() {\n\t\tprops.getApps().then((response: any) => {\n\t\t\tdispatch(SmartDesktopDesignerActions.update_apps(response.apps));\n\t\t});\n\t}\n\n\tfunction setCurrentAppID(id: string | null) {\n\t\tif (id === null) {\n\t\t\tdispatch(SmartDesktopDesignerActions.new_app(null));\n\t\t}\n\n\t\tdispatch(SmartDesktopDesignerActions.set_current_app_id(id));\n\t\tupdateAppList();\n\t}\n\n\tconst removeAppID = (id: string) => {\n\t\t// Delete app from list of apps\n\t\tprops.deleteApp(id).then(({ err }: { err: string }) => {\n\t\t\tif (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t\tupdateAppList();\n\n\t\t\t// Remove reference to app from all menus\n\t\t\tprops.getMenus().then(({ menus: grabbedMenus }: { menus: MenuType }) => {\n\t\t\t\tObject.keys(grabbedMenus).forEach((menuId) => {\n\t\t\t\t\tif (!grabbedMenus[menuId].applications.includes(id)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tgrabbedMenus[menuId].applications.splice(grabbedMenus[menuId].applications.indexOf(id), 1);\n\t\t\t\t\tprops.updateMenu(menuId, grabbedMenus[menuId]).then(() => {\n\t\t\t\t\t\tupdateAppList();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n\n\t/********* Lifecycle effects *********/\n\n\t// Call updateAppList once the component has mounted\n\t// Can't call out of an effect, or it will cause an endless loop\n\tuseEffect(updateAppList, []);\n\n\tconst addDroppedApp = (file: FileWithPath, index: number) => {\n\t\tconst appId = String(new Date().getTime() + index);\n\t\tconst { path } = file;\n\n\t\t// Confirm that the file is an executable\n\t\tif (path !== undefined && validateFilename(VALID_APP_EXTENSIONS, path)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Generate defaults and then add app with those defaults\n\t\tprops.getAppConfigTemplate().then((response: any) => {\n\t\t\tconst { config }: { config: AppDefinition } = response;\n\t\t\t// Get generated displayName\n\t\t\tconst { displayName } = generateDefaultConfig({\n\t\t\t\t...config,\n\t\t\t\tpath,\n\t\t\t});\n\t\t\tconfig.name = displayName;\n\n\t\t\t// We generated appId above\n\t\t\tconfig.appId = appId;\n\n\t\t\t// A file was dropped, so we know this was a file, not a URL\n\t\t\tconfig.manifest = config.manifest ?? {};\n\t\t\tconfig.manifest.window = config.manifest.window ?? {};\n\t\t\tconfig.manifest.window.windowType = \"assimilation\";\n\t\t\tconfig.manifest.window.path = path;\n\t\t\tdelete config.manifest.window.url;\n\n\t\t\t// Add app with defaults\n\t\t\tprops.addApp(appId, config).then(() => {\n\t\t\t\tupdateAppList();\n\t\t\t});\n\t\t});\n\t};\n\n\tconst addAppByUrl = (url: string, displayName: string) => {\n\t\tconst appId = String(new Date().getTime());\n\t\tsetEditMode(false);\n\t\t// @todo: show loading spinner\n\n\t\tprops.getAppConfigTemplate().then((response: { config: AppDefinition }) => {\n\t\t\tconst { config } = response;\n\t\t\tconfig.name = displayName;\n\t\t\tconfig.appId = appId;\n\n\t\t\t// A file was dropped, so we know this was a file, not a URL\n\t\t\tconfig.manifest = config.manifest ?? {};\n\t\t\tconfig.manifest.window = config.manifest.window ?? {};\n\t\t\tdelete config.manifest.window.windowType;\n\t\t\tdelete config.manifest.window.path;\n\t\t\tconfig.manifest.window.url = url;\n\n\t\t\t// Add app with defaults\n\t\t\tprops.addApp(appId, config).then(() => {\n\t\t\t\tupdateAppList();\n\t\t\t});\n\t\t});\n\t};\n\tconst addAppByPath = (path: string, displayName: string) => {\n\t\tconst appId = String(new Date().getTime());\n\t\tsetEditMode(false);\n\t\t// @todo: show loading spinner\n\n\t\tprops.getAppConfigTemplate().then((response: { config: AppDefinition }) => {\n\t\t\tconst { config } = response;\n\t\t\tconfig.name = displayName;\n\t\t\tconfig.appId = appId;\n\n\t\t\t// A file was dropped, so we know this was a file, not a URL\n\t\t\tconfig.manifest = config.manifest ?? {};\n\t\t\tconfig.manifest.window = config.manifest.window ?? {};\n\t\t\tconfig.manifest.window.windowType = \"assimilation\";\n\t\t\tconfig.manifest.window.path = path;\n\t\t\tdelete config.manifest.window.url;\n\n\t\t\t// Add app with defaults\n\t\t\tprops.addApp(appId, config).then(() => {\n\t\t\t\tupdateAppList();\n\t\t\t});\n\t\t});\n\t};\n\n\tconst onClose = (reason: ApplicationCloseReason) => {\n\t\tif (reason === ApplicationCloseReason.NEW) {\n\t\t\tdispatch(SmartDesktopDesignerActions.new_app(new Date().getTime().toString()));\n\t\t} else if (reason === ApplicationCloseReason.CANCEL && currentAppID === newAppID) {\n\t\t\tif (currentAppID) props.deleteApp(currentAppID);\n\t\t\tsetCurrentAppID(null);\n\t\t} else {\n\t\t\tsetCurrentAppID(null);\n\t\t}\n\t};\n\n\tconst applicationProps: ApplicationProps = {\n\t\tid: currentAppID ?? \"\",\n\t\tapps,\n\t\taddApp: props.addApp,\n\t\tdeleteApp: props.deleteApp,\n\t\tgetAppConfigTemplate: props.getAppConfigTemplate,\n\t\tsetCurrentAppID,\n\t\tonClose,\n\t\tisInboundInteropAuthorized: props.isInboundInteropAuthorized,\n\t\tisOutboundInteropAuthorized: props.isOutboundInteropAuthorized,\n\t};\n\n\tconst dropZoneProps: ApplicationListProps = {\n\t\tapps: apps.filter((app) => !app?.manifest?.temporary),\n\t\tclickApp: (appID: string) => {\n\t\t\tFSBL.Clients.LauncherClient.showWindow({ componentType: appID }, { spawnIfNotFound: true }, (err, data) => {});\n\t\t},\n\t\teditApp: (appID: string) => {\n\t\t\tsetCurrentAppID(appID);\n\t\t},\n\t\tdeleteApp: removeAppID,\n\t};\n\n\tconst helpFunction = () => {\n\t\tlaunchTutorialLink(\"SDD-02-ManageApps\");\n\t};\n\n\tconst addApp = () => {\n\t\tsetEditMode(!editMode);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{currentAppID ? (\n\t\t\t\t<Application {...applicationProps} />\n\t\t\t) : (\n\t\t\t\t<View>\n\t\t\t\t\t<Header helpFunction={helpFunction}>Manage apps</Header>\n\t\t\t\t\t<Content>\n\t\t\t\t\t\t{/* <Tab> */}\n\t\t\t\t\t\t<div data-label=\"Apps\">\n\t\t\t\t\t\t\t<div className=\"frontmatter\">Click Add or drag your apps into the list.</div>\n\t\t\t\t\t\t\t<Button className=\"icon-before-add\" fashion=\"primary\" iconBefore=\"plus\" text=\"Add\" onClick={addApp} />\n\n\t\t\t\t\t\t\t<AddApp\n\t\t\t\t\t\t\t\tshow={editMode}\n\t\t\t\t\t\t\t\tcheckValidURL={FSBL.Clients.SmartDesktopClient.checkValidURL}\n\t\t\t\t\t\t\t\taddAppByUrl={addAppByUrl}\n\t\t\t\t\t\t\t\taddAppByPath={addAppByPath}\n\t\t\t\t\t\t\t\tclose={addApp}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<DropZone processFile={addDroppedApp}>\n\t\t\t\t\t\t\t\t<ApplicationList {...dropZoneProps} />\n\t\t\t\t\t\t\t</DropZone>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/* </Tab> */}\n\t\t\t\t\t</Content>\n\t\t\t\t</View>\n\t\t\t)}\n\t\t</>\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Applications.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/Applications.tsx"],"names":[],"mappings":"AAA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EAAC,iBAAiB,EAAC,OAAO,EAAC,SAAS,EAAC,UAAU,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,EAAE,MAAM,GAAI;gBAEtG,oBAAC,MAAM,IACN,IAAI,EAAE,QAAQ,EACd,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,aAAa,EAC5D,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,GACZ;gBAEF,oBAAC,QAAQ,IAAC,WAAW,EAAE,aAAa;oBACnC,oBAAC,QAAQ,oBAAK,aAAa,EAAI,CACrB,CACN,CAEG,CACJ,CACP,CACC,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 - 2020 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"../../store\";\nimport { View } from \"./View\";\n// import { Tab } from \"../common/Tab\";\nimport { Header } from \"../common/Header\";\nimport { Button } from \"../common/Button\";\nimport { Content } from \"./Content\";\nimport { Application, ApplicationCloseReason } from \"./Application\";\nimport { ItemList, ItemListProps } from \"./ItemList\";\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\nimport { RootState } from \"../../reducers/rootReducer\";\nimport { DropZone, FileWithPath } from \"../common/DropZone\";\nimport { generateDefaultConfig } from \"./sdd_helpers\";\nimport { MenuType, PreloadType, ProjectError } from \"../../types/smartDesktopDesignerTypes\";\nimport { launchTutorialLink } from \"./common/fsbl_functions\";\nimport { validateFilename, VALID_APP_EXTENSIONS } from \"../common/file_helpers\";\nimport { ApplicationProps } from \"./Application\";\nimport { services } from \"@finsemble/finsemble-api/\";\nimport { AddApp } from \"./AddApp\";\n\ntype AppDefinition = services.Interop.types.AppDefinition;\n\nexport type ApplicationsProps = {\n\tgetApps: typeof FSBL.Clients.SmartDesktopClient.prototype.getApps;\n\taddApp: typeof FSBL.Clients.SmartDesktopClient.prototype.addApp;\n\tdeleteApp: typeof FSBL.Clients.SmartDesktopClient.prototype.deleteApp;\n\tupdateApp: typeof FSBL.Clients.SmartDesktopClient.prototype.updateApp;\n\tgetAppConfigTemplate: typeof FSBL.Clients.SmartDesktopClient.prototype.getAppConfigTemplate;\n\tgetMenus: typeof FSBL.Clients.SmartDesktopClient.prototype.getMenus;\n\taddMenu: typeof FSBL.Clients.SmartDesktopClient.prototype.addMenu;\n\tupdateMenu: typeof FSBL.Clients.SmartDesktopClient.prototype.updateMenu;\n\tgetPreloads: typeof FSBL.Clients.SmartDesktopClient.prototype.getPreloads;\n\tisInboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isInboundInteropAuthorized;\n\tisOutboundInteropAuthorized: typeof FSBL.Clients.SmartDesktopClient.isOutboundInteropAuthorized;\n};\n\nconst EMPTY_MENU_ERROR: ProjectError = {\n\tviewId: \"applications\",\n\tmessage: \"One or more of your app menus is empty\",\n};\n\nexport const Applications = (props: ApplicationsProps) => {\n\tconst dispatch = useDispatch();\n\tconst [editMode, setEditMode] = useState(false);\n\n\tconst apps = useSelector((state: RootState) => state.smartDesktopDesigner.apps);\n\tconst menus = useSelector<MenuType>((state: RootState) => state.smartDesktopDesigner.menus);\n\tconst preloads = useSelector<PreloadType[]>((state: RootState) => state.smartDesktopDesigner.preloads);\n\n\tconst newAppID = useSelector((state: RootState) => state.smartDesktopDesigner.newAppId);\n\n\tconst currentAppID = useSelector((state: RootState) => state.smartDesktopDesigner.currentAppId);\n\n\tif (Object.values(menus).every((menu) => menu.applications.length > 0)) {\n\t\tdispatch(SmartDesktopDesignerActions.delete_project_error(EMPTY_MENU_ERROR));\n\t} else {\n\t\tdispatch(SmartDesktopDesignerActions.set_project_error(EMPTY_MENU_ERROR));\n\t}\n\n\tfunction updateAppList() {\n\t\tprops.getApps().then((response: any) => {\n\t\t\tdispatch(SmartDesktopDesignerActions.update_apps(response.apps));\n\t\t});\n\t}\n\n\tconst updatePreloadList = async () => {\n\t\tconst { preloads } = await props.getPreloads();\n\t\tdispatch(SmartDesktopDesignerActions.update_preloads(preloads));\n\t};\n\n\tfunction setCurrentAppID(id: string | null) {\n\t\tif (id === null) {\n\t\t\tdispatch(SmartDesktopDesignerActions.new_app(null));\n\t\t}\n\n\t\tdispatch(SmartDesktopDesignerActions.set_current_app_id(id));\n\t\tupdateAppList();\n\t}\n\n\tconst removeAppID = (id: string) => {\n\t\t// Delete app from list of apps\n\t\tprops.deleteApp(id).then(({ err }: { err: string }) => {\n\t\t\tif (err) {\n\t\t\t\talert(err);\n\t\t\t}\n\t\t\tupdateAppList();\n\n\t\t\t// Remove reference to app from all menus\n\t\t\tprops.getMenus().then(({ menus: grabbedMenus }: { menus: MenuType }) => {\n\t\t\t\tObject.keys(grabbedMenus).forEach((menuId) => {\n\t\t\t\t\tif (!grabbedMenus[menuId].applications.includes(id)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tgrabbedMenus[menuId].applications.splice(grabbedMenus[menuId].applications.indexOf(id), 1);\n\t\t\t\t\tprops.updateMenu(menuId, grabbedMenus[menuId]).then(() => {\n\t\t\t\t\t\tupdateAppList();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n\n\t/********* Lifecycle effects *********/\n\n\t// Call updateAppList once the component has mounted\n\t// Can't call out of an effect, or it will cause an endless loop\n\tuseEffect(() => {\n\t\tupdateAppList();\n\t\tupdatePreloadList();\n\t}, []);\n\n\tconst addDroppedApp = (file: FileWithPath, index: number) => {\n\t\tconst appId = String(new Date().getTime() + index);\n\t\tconst { path } = file;\n\n\t\t// Confirm that the file is an executable\n\t\tif (path !== undefined && validateFilename(VALID_APP_EXTENSIONS, path)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Generate defaults and then add app with those defaults\n\t\tprops.getAppConfigTemplate().then((response: any) => {\n\t\t\tconst { config }: { config: AppDefinition } = response;\n\t\t\t// Get generated displayName\n\t\t\tconst { displayName } = generateDefaultConfig({\n\t\t\t\t...config,\n\t\t\t\tpath,\n\t\t\t});\n\t\t\tconfig.name = displayName;\n\n\t\t\t// We generated appId above\n\t\t\tconfig.appId = appId;\n\n\t\t\t// A file was dropped, so we know this was a file, not a URL\n\t\t\tconfig.manifest = config.manifest ?? {};\n\t\t\tconfig.manifest.window = config.manifest.window ?? {};\n\t\t\tconfig.manifest.window.windowType = \"assimilation\";\n\t\t\tconfig.manifest.window.path = path;\n\t\t\tdelete config.manifest.window.url;\n\n\t\t\t// Add app with defaults\n\t\t\tprops.addApp(appId, config).then(() => {\n\t\t\t\tupdateAppList();\n\t\t\t});\n\t\t});\n\t};\n\n\tconst addAppByUrl = (url: string, displayName: string) => {\n\t\tconst appId = String(new Date().getTime());\n\t\tsetEditMode(false);\n\t\t// @todo: show loading spinner\n\n\t\tprops.getAppConfigTemplate().then((response: { config: AppDefinition }) => {\n\t\t\tconst { config } = response;\n\t\t\tconfig.name = displayName;\n\t\t\tconfig.appId = appId;\n\n\t\t\t// A file was dropped, so we know this was a file, not a URL\n\t\t\tconfig.manifest = config.manifest ?? {};\n\t\t\tconfig.manifest.window = config.manifest.window ?? {};\n\t\t\tdelete config.manifest.window.windowType;\n\t\t\tdelete config.manifest.window.path;\n\t\t\tconfig.manifest.window.url = url;\n\n\t\t\t// Add app with defaults\n\t\t\tprops.addApp(appId, config).then(() => {\n\t\t\t\tupdateAppList();\n\t\t\t});\n\t\t});\n\t};\n\tconst addAppByPath = (path: string, displayName: string) => {\n\t\tconst appId = String(new Date().getTime());\n\t\tsetEditMode(false);\n\t\t// @todo: show loading spinner\n\n\t\tprops.getAppConfigTemplate().then((response: { config: AppDefinition }) => {\n\t\t\tconst { config } = response;\n\t\t\tconfig.name = displayName;\n\t\t\tconfig.appId = appId;\n\n\t\t\t// A file was dropped, so we know this was a file, not a URL\n\t\t\tconfig.manifest = config.manifest ?? {};\n\t\t\tconfig.manifest.window = config.manifest.window ?? {};\n\t\t\tconfig.manifest.window.windowType = \"assimilation\";\n\t\t\tconfig.manifest.window.path = path;\n\t\t\tdelete config.manifest.window.url;\n\n\t\t\t// Add app with defaults\n\t\t\tprops.addApp(appId, config).then(() => {\n\t\t\t\tupdateAppList();\n\t\t\t});\n\t\t});\n\t};\n\n\tconst onClose = (reason: ApplicationCloseReason) => {\n\t\tif (reason === ApplicationCloseReason.NEW) {\n\t\t\tdispatch(SmartDesktopDesignerActions.new_app(new Date().getTime().toString()));\n\t\t} else if (reason === ApplicationCloseReason.CANCEL && currentAppID === newAppID) {\n\t\t\tif (currentAppID) props.deleteApp(currentAppID);\n\t\t\tsetCurrentAppID(null);\n\t\t} else {\n\t\t\tsetCurrentAppID(null);\n\t\t}\n\t};\n\n\tconst applicationProps: ApplicationProps = {\n\t\tid: currentAppID ?? \"\",\n\t\tapps,\n\t\taddApp: props.addApp,\n\t\tdeleteApp: props.deleteApp,\n\t\tupdateApp: props.updateApp,\n\t\tgetAppConfigTemplate: props.getAppConfigTemplate,\n\t\tsetCurrentAppID,\n\t\tonClose,\n\t\tisInboundInteropAuthorized: props.isInboundInteropAuthorized,\n\t\tisOutboundInteropAuthorized: props.isOutboundInteropAuthorized,\n\t\tpreloads,\n\t};\n\n\tconst dropZoneProps: ItemListProps = {\n\t\titems: apps.filter((app) => !app?.manifest?.temporary),\n\t\tclickItem: (appID: string) => {\n\t\t\tFSBL.Clients.LauncherClient.showWindow({ componentType: appID }, { spawnIfNotFound: true }, (err, data) => {});\n\t\t},\n\t\teditItem: (appID: string) => {\n\t\t\tsetCurrentAppID(appID);\n\t\t},\n\t\tdeleteItem: removeAppID,\n\t};\n\n\tconst helpFunction = () => {\n\t\tlaunchTutorialLink(\"SDD-02-ManageApps\");\n\t};\n\n\tconst addApp = () => {\n\t\tsetEditMode(!editMode);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{currentAppID ? (\n\t\t\t\t<Application {...applicationProps} />\n\t\t\t) : (\n\t\t\t\t<View>\n\t\t\t\t\t<Header helpFunction={helpFunction}>Manage apps</Header>\n\t\t\t\t\t<Content>\n\t\t\t\t\t\t{/* <Tab> */}\n\t\t\t\t\t\t<div data-label=\"Apps\">\n\t\t\t\t\t\t\t<div className=\"frontmatter\">Click Add or drag your apps into the list.</div>\n\t\t\t\t\t\t\t<Button className=\"icon-before-add\" fashion=\"primary\" iconBefore=\"plus\" text=\"Add\" onClick={addApp} />\n\n\t\t\t\t\t\t\t<AddApp\n\t\t\t\t\t\t\t\tshow={editMode}\n\t\t\t\t\t\t\t\tcheckValidURL={FSBL.Clients.SmartDesktopClient.checkValidURL}\n\t\t\t\t\t\t\t\taddAppByUrl={addAppByUrl}\n\t\t\t\t\t\t\t\taddAppByPath={addAppByPath}\n\t\t\t\t\t\t\t\tclose={addApp}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<DropZone processFile={addDroppedApp}>\n\t\t\t\t\t\t\t\t<ItemList {...dropZoneProps} />\n\t\t\t\t\t\t\t</DropZone>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/* </Tab> */}\n\t\t\t\t\t</Content>\n\t\t\t\t</View>\n\t\t\t)}\n\t\t</>\n\t);\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../common/css/preload-edit-page.css";
|
|
3
|
+
import { PreloadType } from "../../types/smartDesktopDesignerTypes";
|
|
4
|
+
export interface EditPreloadProps {
|
|
5
|
+
getConfig: typeof FSBL.Clients.ConfigClient.getValue;
|
|
6
|
+
preload: PreloadType;
|
|
7
|
+
getApps: typeof FSBL.Clients.SmartDesktopClient.prototype.getApps;
|
|
8
|
+
updateApp: typeof FSBL.Clients.SmartDesktopClient.prototype.updateApp;
|
|
9
|
+
cancelFunction: Function;
|
|
10
|
+
addPreload: Function;
|
|
11
|
+
updatePreload: Function;
|
|
12
|
+
deletePreload: (alias: string) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const EditPreload: React.FunctionComponent<EditPreloadProps>;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import "../common/css/preload-edit-page.css";
|
|
3
|
+
import { FinsembleSelect } from "../common/FinsembleSelect";
|
|
4
|
+
import { Button } from "../common/Button";
|
|
5
|
+
export const EditPreload = ({ preload, getConfig, getApps, updateApp, cancelFunction, addPreload, updatePreload, deletePreload, }) => {
|
|
6
|
+
const [appList, setAppList] = useState([]);
|
|
7
|
+
const [appNameList, setAppNameList] = useState([]);
|
|
8
|
+
const [appNameValues, setAppNameValues] = useState([]);
|
|
9
|
+
const [selectedApps, setSelectedApps] = useState([]);
|
|
10
|
+
const [usageType, setUsageType] = useState("selection");
|
|
11
|
+
const [livePreload, setLivePreload] = useState(Object.assign({}, preload));
|
|
12
|
+
const [disableSubmit, setDisableSubmit] = useState(true);
|
|
13
|
+
const [key, setKey] = useState(`${Date.now()}.${Math.random()}`);
|
|
14
|
+
const validatePreload = (edited) => {
|
|
15
|
+
let urlValid = true;
|
|
16
|
+
try {
|
|
17
|
+
new URL(edited.url);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
urlValid = false;
|
|
21
|
+
}
|
|
22
|
+
return !!edited.alias && urlValid;
|
|
23
|
+
};
|
|
24
|
+
const removePreload = async (alias) => {
|
|
25
|
+
await deletePreload(alias);
|
|
26
|
+
cancelFunction();
|
|
27
|
+
};
|
|
28
|
+
const getUsageType = () => {
|
|
29
|
+
getConfig("finsemble.servicesConfig.launcher.defaultPreloads").then(({ data }) => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
let type = "selection";
|
|
32
|
+
const globalConfig = data !== null && data !== void 0 ? data : {};
|
|
33
|
+
if ((_a = globalConfig.allComponents) === null || _a === void 0 ? void 0 : _a.includes(preload.alias)) {
|
|
34
|
+
type = "all";
|
|
35
|
+
}
|
|
36
|
+
else if ((_b = globalConfig.launchableComponents) === null || _b === void 0 ? void 0 : _b.includes(preload.alias)) {
|
|
37
|
+
type = "launchable";
|
|
38
|
+
}
|
|
39
|
+
setUsageType(type);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const setAlias = (alias) => {
|
|
43
|
+
setLivePreload(Object.assign(Object.assign({}, livePreload), { alias }));
|
|
44
|
+
};
|
|
45
|
+
const setUrl = (url) => {
|
|
46
|
+
setLivePreload(Object.assign(Object.assign({}, livePreload), { url }));
|
|
47
|
+
};
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
setDisableSubmit(!validatePreload(livePreload));
|
|
50
|
+
}, [livePreload]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setKey(`${Date.now()}.${Math.random()}`);
|
|
53
|
+
}, [appList, appNameList, selectedApps]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
getUsageType();
|
|
56
|
+
getApps().then(({ apps }) => {
|
|
57
|
+
const appNames = [];
|
|
58
|
+
const appValues = [];
|
|
59
|
+
const selectedNames = [];
|
|
60
|
+
apps.forEach((app) => {
|
|
61
|
+
var _a, _b, _c;
|
|
62
|
+
appNames.push(app.name);
|
|
63
|
+
appValues.push(app.appId);
|
|
64
|
+
if ((_c = (_b = (_a = app.manifest) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.preload) === null || _c === void 0 ? void 0 : _c.includes(preload === null || preload === void 0 ? void 0 : preload.alias)) {
|
|
65
|
+
selectedNames.push(app.name);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
setAppNameValues(appValues);
|
|
69
|
+
setAppNameList(appNames);
|
|
70
|
+
setSelectedApps(selectedNames);
|
|
71
|
+
setAppList(apps);
|
|
72
|
+
});
|
|
73
|
+
validatePreload(livePreload);
|
|
74
|
+
}, []);
|
|
75
|
+
const onRadioChange = (e) => {
|
|
76
|
+
setUsageType(e.target.value);
|
|
77
|
+
};
|
|
78
|
+
const selectChange = (selectedValues) => {
|
|
79
|
+
setSelectedApps(selectedValues);
|
|
80
|
+
};
|
|
81
|
+
const updateAppConfigs = async () => {
|
|
82
|
+
const promises = appList.map((app) => {
|
|
83
|
+
var _a, _b, _c, _d, _e;
|
|
84
|
+
let appPreloads = (_c = (_b = (_a = app.manifest) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.preload) !== null && _c !== void 0 ? _c : [];
|
|
85
|
+
appPreloads = Array.isArray(appPreloads) ? appPreloads : [appPreloads];
|
|
86
|
+
const isRenaming = livePreload.alias != preload.alias;
|
|
87
|
+
const wasPreviouslySelected = appPreloads.includes(preload.alias);
|
|
88
|
+
const inNewList = selectedApps.includes(app.appId);
|
|
89
|
+
app.manifest = (_d = app.manifest) !== null && _d !== void 0 ? _d : {};
|
|
90
|
+
app.manifest.component = (_e = app.manifest.component) !== null && _e !== void 0 ? _e : {};
|
|
91
|
+
if ((!isRenaming && wasPreviouslySelected == inNewList) || (!wasPreviouslySelected && !inNewList)) {
|
|
92
|
+
return Promise.resolve();
|
|
93
|
+
}
|
|
94
|
+
if (wasPreviouslySelected) {
|
|
95
|
+
appPreloads = appPreloads.filter((preloadAlias) => preloadAlias != preload.alias);
|
|
96
|
+
}
|
|
97
|
+
if (inNewList) {
|
|
98
|
+
appPreloads.push(livePreload.alias);
|
|
99
|
+
}
|
|
100
|
+
app.manifest.component.preload = appPreloads;
|
|
101
|
+
return updateApp(app.appId, app);
|
|
102
|
+
});
|
|
103
|
+
return Promise.all(promises);
|
|
104
|
+
};
|
|
105
|
+
const clickSubmit = async () => {
|
|
106
|
+
const usage = {
|
|
107
|
+
all: usageType == "all",
|
|
108
|
+
launchable: usageType == "launchable",
|
|
109
|
+
apps: selectedApps,
|
|
110
|
+
};
|
|
111
|
+
if (preload.alias === "") {
|
|
112
|
+
await addPreload(livePreload, usage);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
await updatePreload(preload.alias, livePreload, usage);
|
|
116
|
+
}
|
|
117
|
+
await updateAppConfigs();
|
|
118
|
+
cancelFunction();
|
|
119
|
+
};
|
|
120
|
+
return (React.createElement("div", { className: "preload-edit-container" },
|
|
121
|
+
React.createElement("h2", null, (livePreload === null || livePreload === void 0 ? void 0 : livePreload.alias) ? livePreload.alias : "Untitled preload"),
|
|
122
|
+
React.createElement("div", { className: "app-edit-field" },
|
|
123
|
+
React.createElement("table", { role: "presentation", className: "preload-edit-table" },
|
|
124
|
+
React.createElement("tbody", null,
|
|
125
|
+
React.createElement("tr", null,
|
|
126
|
+
React.createElement("th", null,
|
|
127
|
+
React.createElement("label", { htmlFor: "preload-alias" }, "Name")),
|
|
128
|
+
React.createElement("td", { className: "edit-field" },
|
|
129
|
+
React.createElement("input", { type: "text", id: "preload-alias", value: livePreload === null || livePreload === void 0 ? void 0 : livePreload.alias, placeholder: "UntitledPreload", onChange: (e) => {
|
|
130
|
+
setAlias(e.target.value);
|
|
131
|
+
} }))),
|
|
132
|
+
React.createElement("tr", null,
|
|
133
|
+
React.createElement("th", null,
|
|
134
|
+
React.createElement("label", { htmlFor: "preload-url" }, "Web URL")),
|
|
135
|
+
React.createElement("td", { className: "edit-field" },
|
|
136
|
+
React.createElement("input", { type: "text", id: "preload-url", value: livePreload === null || livePreload === void 0 ? void 0 : livePreload.url, onChange: (e) => {
|
|
137
|
+
setUrl(e.target.value);
|
|
138
|
+
} }))),
|
|
139
|
+
React.createElement("tr", null,
|
|
140
|
+
React.createElement("th", { className: "table-header__top-label" }, "Load for"),
|
|
141
|
+
React.createElement("td", null,
|
|
142
|
+
React.createElement("div", { className: "load-option" },
|
|
143
|
+
React.createElement("label", null,
|
|
144
|
+
React.createElement("input", { type: "radio", name: "preload-usage", value: "launchable", checked: usageType == "launchable", onChange: onRadioChange }),
|
|
145
|
+
" ",
|
|
146
|
+
"Apps launched by users")),
|
|
147
|
+
React.createElement("div", { className: "load-option" },
|
|
148
|
+
React.createElement("label", null,
|
|
149
|
+
React.createElement("input", { type: "radio", name: "preload-usage", value: "all", checked: usageType == "all", onChange: onRadioChange }),
|
|
150
|
+
" ",
|
|
151
|
+
"All apps")),
|
|
152
|
+
React.createElement("div", { className: "load-option" },
|
|
153
|
+
React.createElement("label", null,
|
|
154
|
+
React.createElement("input", { type: "radio", name: "preload-usage", value: "selection", checked: usageType == "selection", onChange: onRadioChange }),
|
|
155
|
+
" ",
|
|
156
|
+
"Select apps")),
|
|
157
|
+
usageType == "selection" && (React.createElement(FinsembleSelect, { key: key, options: appNameList, values: appNameValues, selected: selectedApps, updateCallback: selectChange, showSearch: true }))))))),
|
|
158
|
+
React.createElement("div", { className: "preload-edit-actions" },
|
|
159
|
+
React.createElement("div", null, preload.alias && (React.createElement(Button, { fashion: "danger", text: "Remove preload", onClick: (e) => {
|
|
160
|
+
removePreload(preload.alias);
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
} }))),
|
|
163
|
+
React.createElement("div", { className: "app-actions-right-wrapper" },
|
|
164
|
+
React.createElement(Button, { fashion: "ghost", text: "Cancel", onClick: () => {
|
|
165
|
+
cancelFunction();
|
|
166
|
+
} }),
|
|
167
|
+
React.createElement(Button, { fashion: "secondary", text: "Save", disabled: disableSubmit, onClick: clickSubmit })))));
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=EditPreload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditPreload.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/EditPreload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAe,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAkB1C,MAAM,CAAC,MAAM,WAAW,GAA8C,CAAC,EACtE,OAAO,EACP,SAAS,EACT,OAAO,EACP,SAAS,EACT,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,GACb,EAAE,EAAE;IACJ,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG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CAAC,GACA,CACF,CACI;YAEN,6BAAK,SAAS,EAAC,2BAA2B;gBACzC,oBAAC,MAAM,IACN,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;wBACb,cAAc,EAAE,CAAC;oBAClB,CAAC,GACA;gBACF,oBAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAI,CACpF,CACD,CACD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { ChangeEvent, useEffect, useState } from \"react\";\nimport \"../common/css/preload-edit-page.css\";\nimport { FinsembleSelect } from \"../common/FinsembleSelect\";\nimport { Button } from \"../common/Button\";\nimport { PreloadType } from \"../../types/smartDesktopDesignerTypes\";\nimport { AppDefinition } from \"./Application\";\n\nexport interface EditPreloadProps {\n\tgetConfig: typeof FSBL.Clients.ConfigClient.getValue;\n\tpreload: PreloadType;\n\t// Perhaps use the root state to get this value\n\tgetApps: typeof FSBL.Clients.SmartDesktopClient.prototype.getApps;\n\tupdateApp: typeof FSBL.Clients.SmartDesktopClient.prototype.updateApp;\n\tcancelFunction: Function;\n\taddPreload: Function;\n\tupdatePreload: Function;\n\tdeletePreload: (alias: string) => Promise<void>;\n}\n\ntype preloadUsageType = \"launchable\" | \"all\" | \"selection\";\n\nexport const EditPreload: React.FunctionComponent<EditPreloadProps> = ({\n\tpreload,\n\tgetConfig,\n\tgetApps,\n\tupdateApp,\n\tcancelFunction,\n\taddPreload,\n\tupdatePreload,\n\tdeletePreload,\n}) => {\n\tconst [appList, setAppList] = useState<AppDefinition[]>([]);\n\tconst [appNameList, setAppNameList] = useState<string[]>([]);\n\tconst [appNameValues, setAppNameValues] = useState<string[]>([]);\n\tconst [selectedApps, setSelectedApps] = useState<string[]>([]);\n\tconst [usageType, setUsageType] = useState<preloadUsageType>(\"selection\");\n\tconst [livePreload, setLivePreload] = useState({ ...preload });\n\tconst [disableSubmit, setDisableSubmit] = useState<boolean>(true);\n\tconst [key, setKey] = useState(`${Date.now()}.${Math.random()}`);\n\n\tconst validatePreload = (edited: PreloadType): boolean => {\n\t\tlet urlValid = true;\n\t\ttry {\n\t\t\tnew URL(edited.url);\n\t\t} catch (e) {\n\t\t\turlValid = false;\n\t\t}\n\n\t\treturn !!edited.alias && urlValid;\n\t};\n\n\tconst removePreload = async (alias: string) => {\n\t\tawait deletePreload(alias);\n\t\tcancelFunction();\n\t};\n\n\tconst getUsageType = () => {\n\t\tgetConfig(\"finsemble.servicesConfig.launcher.defaultPreloads\").then(({ data }) => {\n\t\t\tlet type: preloadUsageType = \"selection\";\n\t\t\tconst globalConfig = data ?? {};\n\t\t\tif (globalConfig.allComponents?.includes(preload.alias)) {\n\t\t\t\ttype = \"all\";\n\t\t\t} else if (globalConfig.launchableComponents?.includes(preload.alias)) {\n\t\t\t\ttype = \"launchable\";\n\t\t\t}\n\t\t\tsetUsageType(type);\n\t\t});\n\t};\n\n\tconst setAlias = (alias: string) => {\n\t\tsetLivePreload({ ...livePreload, alias });\n\t};\n\n\tconst setUrl = (url: string) => {\n\t\tsetLivePreload({ ...livePreload, url });\n\t};\n\n\tuseEffect(() => {\n\t\tsetDisableSubmit(!validatePreload(livePreload));\n\t}, [livePreload]);\n\n\tuseEffect(() => {\n\t\tsetKey(`${Date.now()}.${Math.random()}`);\n\t}, [appList, appNameList, selectedApps]);\n\n\tuseEffect(() => {\n\t\tgetUsageType();\n\t\tgetApps().then(({ apps }) => {\n\t\t\tconst appNames: string[] = [];\n\t\t\tconst appValues: string[] = [];\n\t\t\tconst selectedNames: string[] = [];\n\n\t\t\tapps.forEach((app: AppDefinition) => {\n\t\t\t\tappNames.push(app.name);\n\t\t\t\tappValues.push(app.appId);\n\t\t\t\tif (app.manifest?.component?.preload?.includes(preload?.alias)) {\n\t\t\t\t\tselectedNames.push(app.name);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tsetAppNameValues(appValues);\n\t\t\tsetAppNameList(appNames);\n\t\t\tsetSelectedApps(selectedNames);\n\t\t\tsetAppList(apps);\n\t\t});\n\t\tvalidatePreload(livePreload);\n\t}, []);\n\n\tconst onRadioChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tsetUsageType(e.target.value as preloadUsageType);\n\t};\n\n\tconst selectChange = (selectedValues: string[]) => {\n\t\tsetSelectedApps(selectedValues);\n\t};\n\n\tconst updateAppConfigs = async () => {\n\t\tconst promises: Promise<any>[] = appList.map((app) => {\n\t\t\tlet appPreloads = app.manifest?.component?.preload ?? [];\n\t\t\tappPreloads = Array.isArray(appPreloads) ? appPreloads : [appPreloads];\n\t\t\tconst isRenaming = livePreload.alias != preload.alias;\n\t\t\tconst wasPreviouslySelected = appPreloads.includes(preload.alias);\n\t\t\tconst inNewList = selectedApps.includes(app.appId);\n\t\t\tapp.manifest = app.manifest ?? {};\n\t\t\tapp.manifest.component = app.manifest.component ?? {};\n\n\t\t\tif ((!isRenaming && wasPreviouslySelected == inNewList) || (!wasPreviouslySelected && !inNewList)) {\n\t\t\t\t// No change for this app\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\n\t\t\tif (wasPreviouslySelected) {\n\t\t\t\t// Remove it from the list\n\t\t\t\tappPreloads = appPreloads.filter((preloadAlias: string) => preloadAlias != preload.alias);\n\t\t\t}\n\n\t\t\tif (inNewList) {\n\t\t\t\tappPreloads.push(livePreload.alias);\n\t\t\t}\n\n\t\t\tapp.manifest.component.preload = appPreloads;\n\t\t\treturn updateApp(app.appId, app);\n\t\t});\n\n\t\treturn Promise.all(promises);\n\t};\n\n\tconst clickSubmit = async () => {\n\t\tconst usage: any = {\n\t\t\tall: usageType == \"all\",\n\t\t\tlaunchable: usageType == \"launchable\",\n\t\t\tapps: selectedApps,\n\t\t};\n\n\t\tif (preload.alias === \"\") {\n\t\t\tawait addPreload(livePreload, usage);\n\t\t} else {\n\t\t\tawait updatePreload(preload.alias, livePreload, usage);\n\t\t}\n\t\tawait updateAppConfigs();\n\t\tcancelFunction();\n\t};\n\n\treturn (\n\t\t<div className=\"preload-edit-container\">\n\t\t\t<h2>{livePreload?.alias ? livePreload.alias : \"Untitled preload\"}</h2>\n\t\t\t<div className=\"app-edit-field\">\n\t\t\t\t<table role=\"presentation\" className=\"preload-edit-table\">\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t<label htmlFor=\"preload-alias\">Name</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<td className=\"edit-field\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tid=\"preload-alias\"\n\t\t\t\t\t\t\t\t\tvalue={livePreload?.alias}\n\t\t\t\t\t\t\t\t\tplaceholder=\"UntitledPreload\"\n\t\t\t\t\t\t\t\t\t// onKeyDown=\"\"\n\t\t\t\t\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\t\t\t\t\tsetAlias(e.target.value);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t<label htmlFor=\"preload-url\">Web URL</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<td className=\"edit-field\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tid=\"preload-url\"\n\t\t\t\t\t\t\t\t\tvalue={livePreload?.url}\n\t\t\t\t\t\t\t\t\t// onKeyDown={submitOnEnter}\n\t\t\t\t\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\t\t\t\t\tsetUrl(e.target.value);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th className=\"table-header__top-label\">Load for</th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<div className=\"load-option\">\n\t\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"preload-usage\"\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"launchable\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={usageType == \"launchable\"}\n\t\t\t\t\t\t\t\t\t\t\tonChange={onRadioChange}\n\t\t\t\t\t\t\t\t\t\t/>{\" \"}\n\t\t\t\t\t\t\t\t\t\tApps launched by users\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className=\"load-option\">\n\t\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"preload-usage\"\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"all\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={usageType == \"all\"}\n\t\t\t\t\t\t\t\t\t\t\tonChange={onRadioChange}\n\t\t\t\t\t\t\t\t\t\t/>{\" \"}\n\t\t\t\t\t\t\t\t\t\tAll apps\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className=\"load-option\">\n\t\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"preload-usage\"\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"selection\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={usageType == \"selection\"}\n\t\t\t\t\t\t\t\t\t\t\tonChange={onRadioChange}\n\t\t\t\t\t\t\t\t\t\t/>{\" \"}\n\t\t\t\t\t\t\t\t\t\tSelect apps\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{usageType == \"selection\" && (\n\t\t\t\t\t\t\t\t\t<FinsembleSelect\n\t\t\t\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\t\t\t\toptions={appNameList}\n\t\t\t\t\t\t\t\t\t\tvalues={appNameValues}\n\t\t\t\t\t\t\t\t\t\tselected={selectedApps}\n\t\t\t\t\t\t\t\t\t\tupdateCallback={selectChange}\n\t\t\t\t\t\t\t\t\t\tshowSearch={true}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div className=\"preload-edit-actions\">\n\t\t\t\t<div>\n\t\t\t\t\t{preload.alias && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tfashion=\"danger\"\n\t\t\t\t\t\t\ttext=\"Remove preload\"\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\tremovePreload(preload.alias);\n\t\t\t\t\t\t\t\te.preventDefault();\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</div>\n\n\t\t\t\t<div className=\"app-actions-right-wrapper\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tfashion=\"ghost\"\n\t\t\t\t\t\ttext=\"Cancel\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tcancelFunction();\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<Button fashion=\"secondary\" text=\"Save\" disabled={disableSubmit} onClick={clickSubmit} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2017 - 2020 by ChartIQ, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import "../common/css/application-list.css";
|
|
7
|
+
export declare type ItemListProps = {
|
|
8
|
+
items: any[];
|
|
9
|
+
getItemId?: (item: any) => string;
|
|
10
|
+
getItemDisplayName?: (item: any) => string;
|
|
11
|
+
clickItem: (s: string) => void;
|
|
12
|
+
deleteItem: (s: string) => void;
|
|
13
|
+
editItem?: (s: string) => void;
|
|
14
|
+
emptyListMessage?: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const ItemList: ({ items, clickItem, deleteItem, editItem, getItemId, getItemDisplayName, emptyListMessage, className, }: ItemListProps) => JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2017 - 2020 by ChartIQ, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ButtonIcon } from "../common/ButtonIcon";
|
|
7
|
+
import "../common/css/application-list.css";
|
|
8
|
+
export const ItemList = ({ items, clickItem, deleteItem, editItem, getItemId = (item) => item.appId, getItemDisplayName = (item) => { var _a, _b; return ((_b = (_a = item.manifest) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.displayName) || item.name || item.appId; }, emptyListMessage = (React.createElement(React.Fragment, null,
|
|
9
|
+
"There\u2019s nothing here!",
|
|
10
|
+
React.createElement("br", null),
|
|
11
|
+
"Click the Add button to add apps.")), className = "", }) => (React.createElement(React.Fragment, null, items.length < 1 ? (React.createElement("div", { className: `app-list-empty ${className}` }, emptyListMessage)) : (React.createElement("div", { className: `app-list-table ${className}`, role: "list" }, items
|
|
12
|
+
.sort((a, b) => {
|
|
13
|
+
if (getItemDisplayName(a) > getItemDisplayName(b)) {
|
|
14
|
+
return 1;
|
|
15
|
+
}
|
|
16
|
+
else if (getItemDisplayName(b) > getItemDisplayName(a)) {
|
|
17
|
+
return -1;
|
|
18
|
+
}
|
|
19
|
+
return 0;
|
|
20
|
+
})
|
|
21
|
+
.map((item) => {
|
|
22
|
+
const appID = getItemId(item);
|
|
23
|
+
const openItemEventHandler = (e) => {
|
|
24
|
+
clickItem(appID);
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
};
|
|
27
|
+
const editItemEventHandler = (e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
editItem === null || editItem === void 0 ? void 0 : editItem(appID);
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
};
|
|
32
|
+
const deleteItemEventHandler = (e) => {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
deleteItem(appID);
|
|
35
|
+
};
|
|
36
|
+
const keyDownHandler = (e) => {
|
|
37
|
+
switch (e.key) {
|
|
38
|
+
case "Enter":
|
|
39
|
+
case " ": {
|
|
40
|
+
openItemEventHandler(e);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case "Delete": {
|
|
44
|
+
deleteItemEventHandler(e);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
default: {
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const displayName = getItemDisplayName(item);
|
|
52
|
+
return (React.createElement("div", { key: appID, id: `app-list-row-${appID}`, className: "app-list-row", role: "listitem", tabIndex: 0, onClick: openItemEventHandler, onKeyDown: keyDownHandler },
|
|
53
|
+
React.createElement("span", { className: "app-name" }, displayName),
|
|
54
|
+
React.createElement("div", { className: "icon-bar" },
|
|
55
|
+
editItem && (React.createElement(ButtonIcon, { className: "icon-edit", icon: "pencil", text: "Edit", onClick: editItemEventHandler })),
|
|
56
|
+
React.createElement(ButtonIcon, { tabIndex: -1, className: "icon-delete", icon: "trash", text: "Delete", onClick: deleteItemEventHandler }))));
|
|
57
|
+
})))));
|
|
58
|
+
//# sourceMappingURL=ItemList.js.map
|