From 895ae9e38976a7a8a2225e6e303180ac9993ccc8 Mon Sep 17 00:00:00 2001 From: winnie Date: Wed, 23 Aug 2023 15:36:58 +0200 Subject: [PATCH 01/26] select box styling, table categories button added, functionality tba --- .../components/processes.module.scss | 5 +- .../components/processes.tsx | 62 ++++++++++++++++++- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/src/management-system-v2/components/processes.module.scss b/src/management-system-v2/components/processes.module.scss index 5267d5620..3c45828ce 100644 --- a/src/management-system-v2/components/processes.module.scss +++ b/src/management-system-v2/components/processes.module.scss @@ -27,9 +27,12 @@ padding: 10px 0; .SelectedRow { + display: flex; background-color: #ececec; border-radius: 4px; padding: 4px; + align-items: center; + justify-content: center; } .Headercol { @@ -39,7 +42,7 @@ .Icons { display: inline-flex; - width: 40%; + width: 50%; justify-content: space-around; align-items: center; diff --git a/src/management-system-v2/components/processes.tsx b/src/management-system-v2/components/processes.tsx index 756a99c34..e8bb66eba 100644 --- a/src/management-system-v2/components/processes.tsx +++ b/src/management-system-v2/components/processes.tsx @@ -14,6 +14,7 @@ import { TableColumnsType, Tooltip, Drawer, + Checkbox, } from 'antd'; import { useQuery } from '@tanstack/react-query'; import { Process, fetchProcesses } from '@/lib/fetch-data'; @@ -28,11 +29,13 @@ import { EyeOutlined, UnorderedListOutlined, AppstoreOutlined, + MoreOutlined, } from '@ant-design/icons'; import { Processes } from '@/lib/fetch-data'; import { TableRowSelection } from 'antd/es/table/interface'; import cn from 'classnames'; import Preview from './previewProcess'; +import { CheckboxChangeEvent } from 'antd/es/checkbox'; const { Search } = Input; @@ -131,6 +134,43 @@ const Processes: FC = () => { // }, // ]; + const onCheckboxChange = (e: CheckboxChangeEvent) => { + console.log(`checked = ${e.target.checked}`); + }; + + const items: MenuProps['items'] = [ + { + label: 'Process Name', + key: '0', + icon: , + }, + { + label: 'Description', + key: '1', + icon: , + }, + { + label: 'Last Edited', + key: '2', + icon: , + }, + { + label: 'Creator', + key: '3', + icon: , + }, + { + label: 'File Size', + key: '4', + icon: , + }, + { + label: 'Departments', + key: '5', + icon: , + }, + ]; + const columns: TableColumnsType = [ { dataIndex: 'definitionId', @@ -219,6 +259,15 @@ const Processes: FC = () => { fixed: 'right', // add title but only if at least one row is selected dataIndex: 'definitionId', + title: ( +
+ + + +
+ ), /* title: selection.length ? ( <> {selection.length} selected @@ -236,6 +285,15 @@ const Processes: FC = () => { }, ]; + // + // e.preventDefault()}> + // + // Click me + // + // + // + // + if (isError) { return
Error
; } @@ -259,7 +317,7 @@ const Processes: FC = () => { <> <> - + {/* Select action: {actionBar} */} {selection.length ? ( <> @@ -270,7 +328,7 @@ const Processes: FC = () => {
)} - + (this.searchText = ele)} From 400e3dd6ef1d555a037d556b12f20291c8e4c88f Mon Sep 17 00:00:00 2001 From: winnie Date: Wed, 23 Aug 2023 19:24:11 +0200 Subject: [PATCH 02/26] select bar layout wip --- .../components/processes.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/management-system-v2/components/processes.tsx b/src/management-system-v2/components/processes.tsx index e8bb66eba..ad919c513 100644 --- a/src/management-system-v2/components/processes.tsx +++ b/src/management-system-v2/components/processes.tsx @@ -135,7 +135,7 @@ const Processes: FC = () => { // ]; const onCheckboxChange = (e: CheckboxChangeEvent) => { - console.log(`checked = ${e.target.checked}`); + console.log(e.target); }; const items: MenuProps['items'] = [ @@ -317,7 +317,14 @@ const Processes: FC = () => { <> <> - + {/* Select action: {actionBar} */} {selection.length ? ( <> @@ -328,7 +335,8 @@ const Processes: FC = () => {
)} - + + (this.searchText = ele)} @@ -339,7 +347,7 @@ const Processes: FC = () => { // value={this.state.searchText} /> - + diff --git a/src/management-system-v2/components/content-based-header.tsx b/src/management-system-v2/components/content-based-header.tsx new file mode 100644 index 000000000..5109fbf06 --- /dev/null +++ b/src/management-system-v2/components/content-based-header.tsx @@ -0,0 +1,67 @@ +'use client'; + +import { Breadcrumb, Select, Space, Tooltip, theme } from 'antd'; +import { usePathname } from 'next/navigation'; +import React, { FC } from 'react'; +// TODO: +// Fix working import of types +// import type { RouteItemType, SeparatorType } from 'antd/lib/breadcrumb/Breadcrumb' + +// type ItemType = RouteItemType | SeparatorType; + +const HeaderMenu: FC = () => { + const pathname = usePathname(); + const isProcessPage = /^\/processes\/[^/]+$/.test(pathname); + const [process, processId] = pathname.split('/').slice(1); + + const { + token: { fontSizeHeading1 }, + } = theme.useToken(); + + const menuItems = [ + { + key: '1', + label: 'Test', + }, + ]; + const itemGenerator = (item: { info: string; type: string }) => { + return { + title: ( + <> + {`${item.info}`} + + ), + menu: { items: menuItems }, + }; + // <>{ + // + // - // - // } }; - const items = [process, processId].map((item) => - itemGenerator({ info: item, type: item === process ? 'process' : 'version' }) - ); + const [items, setItems] = useState([]); + + useEffect(() => { + setItems([ + /* Processes: */ + { + title: ( + <> + + {selectedProcess?.definitionName} + + + ), + menu: { + items: processes + .map(({ definitionId, definitionName }) => ({ + key: definitionId, + label: <>{definitionName}, + })) + .filter(({ key }) => key !== processId), + onClick: ({ key }) => { + setSelectedProcess(processes.find(({ definitionId }) => definitionId === key)); + router.refresh(); + router.push( + `/processes/${ + processes.find(({ definitionId }) => definitionId === key)?.definitionId + }` + ); + }, + }, + }, + /* Versions: */ + { + title: ( + <> + + {versions.find(({ version }) => version == selectedVersion)?.name || 'Latest Version'} + + + ), + menu: { + items: selectedVersion + ? [ + { key: -1, label: <>Latest Version }, + ...versions.map(({ version, name }) => ({ + key: version, + label: <>{name}, + })), + ] + : versions.map(({ version, name }) => ({ + key: version, + label: <>{name}, + })), + onClick: ({ key }) => { + setSelectedVersion(key); + }, + }, + }, + ]); + }, [processes, versions, selectedProcess, selectedVersion]); return ( <> diff --git a/src/management-system-v2/components/modeler-toolbar.tsx b/src/management-system-v2/components/modeler-toolbar.tsx index 7aa02bc6f..9dc3d07c4 100644 --- a/src/management-system-v2/components/modeler-toolbar.tsx +++ b/src/management-system-v2/components/modeler-toolbar.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import type ElementRegistry from 'diagram-js/lib/core/ElementRegistry'; @@ -50,6 +50,8 @@ const ModelerToolbar: React.FC = () => { const modeler = useModelerStateStore((state) => state.modeler); const selectedElementId = useModelerStateStore((state) => state.selectedElementId); const setSelectedVersion = useModelerStateStore((state) => state.setSelectedVersion); + const versions = useModelerStateStore((state) => state.versions); + const setVersions = useModelerStateStore((state) => state.setVersions); const [index, setIndex] = useState(0); const { processId } = useParams(); @@ -71,7 +73,9 @@ const ModelerToolbar: React.FC = () => { }; let versionSelection: MenuProps['items'] = []; + if (isSuccess) { + setVersions(processData.versions); versionSelection = processData.versions.map(({ version, name, description }) => ({ key: version, label: name, diff --git a/src/management-system-v2/components/processes.tsx b/src/management-system-v2/components/processes.tsx index fce60001e..87ed4d1bb 100644 --- a/src/management-system-v2/components/processes.tsx +++ b/src/management-system-v2/components/processes.tsx @@ -30,13 +30,14 @@ import { UnorderedListOutlined, AppstoreOutlined, MoreOutlined, - CloseOutlined + CloseOutlined, } from '@ant-design/icons'; import { Processes } from '@/lib/fetch-data'; import { TableRowSelection } from 'antd/es/table/interface'; import cn from 'classnames'; import Preview from './previewProcess'; import { CheckboxChangeEvent } from 'antd/es/checkbox'; +import { useProcessesStore } from '@/lib/use-local-process-store'; const { Search } = Input; @@ -49,6 +50,9 @@ const Processes: FC = () => { queryFn: () => fetchProcesses(), }); + const setProcesses = useProcessesStore((state) => state.setProcesses); + const setSelectedProcess = useProcessesStore((state) => state.setSelectedProcess); + const [open, setOpen] = useState(false); const [selection, setSelection] = useState([]); @@ -196,6 +200,7 @@ const Processes: FC = () => { onClick: (event) => { // TODO: This is a hack to clear the parallel route when selecting // another process. (needs upstream fix) + setSelectedProcess(record); router.refresh(); router.push(`/processes/${record.definitionId}`); }, @@ -220,16 +225,40 @@ const Processes: FC = () => { dataIndex: 'lastEdited', render: (date: Date) => date.toLocaleString(), sorter: (a, b) => b.lastEdited.getTime() - a.lastEdited.getTime(), + onCell: (record, rowIndex) => ({ + onClick: (event) => { + // TODO: This is a hack to clear the parallel route when selecting + // another process. (needs upstream fix) + router.refresh(); + router.push(`/processes/${record.definitionId}`); + }, + }), }, { title: 'Created', dataIndex: 'createdOn', render: (date: Date) => date.toLocaleString(), sorter: (a, b) => b.createdOn.getTime() - a.createdOn.getTime(), + onCell: (record, rowIndex) => ({ + onClick: (event) => { + // TODO: This is a hack to clear the parallel route when selecting + // another process. (needs upstream fix) + router.refresh(); + router.push(`/processes/${record.definitionId}`); + }, + }), }, { title: 'File Size', sorter: (a, b) => (a < b ? -1 : 1), + onCell: (record, rowIndex) => ({ + onClick: (event) => { + // TODO: This is a hack to clear the parallel route when selecting + // another process. (needs upstream fix) + router.refresh(); + router.push(`/processes/${record.definitionId}`); + }, + }), }, // { // title: 'Departments', @@ -240,7 +269,30 @@ const Processes: FC = () => { { title: 'Owner', dataIndex: 'owner', + sorter: (a, b) => a.owner!.localeCompare(b.owner || ''), + onCell: (record, rowIndex) => ({ + onClick: (event) => { + // TODO: This is a hack to clear the parallel route when selecting + // another process. (needs upstream fix) + router.refresh(); + router.push(`/processes/${record.definitionId}`); + }, + }), }, + // { + // title: 'Departments', + // dataIndex: 'departments', + // render: (dep) => dep.join(', '), + // sorter: (a, b) => a.definitionName.localeCompare(b.definitionName), + // onCell: (record, rowIndex) => ({ + // onClick: (event) => { + // // TODO: This is a hack to clear the parallel route when selecting + // // another process. (needs upstream fix) + // router.refresh(); + // router.push(`/processes/${record.definitionId}`); + // }, + // }), + // }, /*{ title: 'Actions', fixed: 'right', @@ -297,6 +349,12 @@ const Processes: FC = () => { return
Error
; } + useEffect(() => { + if (data) { + setProcesses(data); + } + }, [data]); + const [filteredData, setFilteredData] = useState([]); const [searchTerm, setSearchTerm] = useState(''); @@ -313,9 +371,9 @@ const Processes: FC = () => { }, [data, searchTerm]); const deselectAll = () => { - setSelection([]) - rowSelection.onSelectNone() - } + setSelection([]); + rowSelection.onSelectNone(); + }; return ( <> @@ -332,7 +390,9 @@ const Processes: FC = () => { {/* Select action: {actionBar} */} {selection.length ? ( <> - + Select action for {selection.length}:{' '} {actionBar} @@ -352,7 +412,7 @@ const Processes: FC = () => { // value={this.state.searchText} /> - + @@ -336,6 +390,8 @@ const Processes: FC = () => { }, ]; + const columnsFiltered = columns.filter((c) => selectedColumns.includes(c?.key)); + // // e.preventDefault()}> // @@ -360,11 +416,13 @@ const Processes: FC = () => { useEffect(() => { if (data && searchTerm !== '') { - setFilteredData( - data.filter((item) => { - return item.definitionName.toLowerCase().includes(searchTerm.toLowerCase()); - }) - ); + const fuse = new Fuse(data, fuseOptions); + setFilteredData(fuse.search(searchTerm).map((item) => item.item)); + // setFilteredData( + // data.filter((item) => { + // return item.definitionName.toLowerCase().includes(searchTerm.toLowerCase()); + // }) + //); } else { setFilteredData(data); } @@ -372,7 +430,7 @@ const Processes: FC = () => { const deselectAll = () => { setSelection([]); - rowSelection.onSelectNone(); + setSelectedRowKeys([]); }; return ( @@ -450,7 +508,7 @@ const Processes: FC = () => { scroll={{ x: 1300 }} rowClassName={styles.Row} rowKey="definitionId" - columns={columns} + columns={columnsFiltered} dataSource={filteredData as any} loading={isLoading} className={styles.Table} diff --git a/src/management-system-v2/package.json b/src/management-system-v2/package.json index 18a8b8cb5..cf966ad46 100644 --- a/src/management-system-v2/package.json +++ b/src/management-system-v2/package.json @@ -22,7 +22,8 @@ "react": "18.2.0", "react-dom": "18.2.0", "zustand": "4.3.8", - "immer": "10.0.2" + "immer": "10.0.2", + "fuse.js": "6.6.2" }, "devDependencies": { "@tanstack/eslint-plugin-query": "4.29.9", @@ -39,4 +40,4 @@ "typescript": "5.1.3", "sass": "1.63.4" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 5bfa8977f..4b12680b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9918,6 +9918,11 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +fuse.js@6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-6.6.2.tgz#fe463fed4b98c0226ac3da2856a415576dc9a111" + integrity sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA== + gaxios@^4.0.0: version "4.3.3" resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-4.3.3.tgz#d44bdefe52d34b6435cc41214fdb160b64abfc22" From c383cb7114228e12d0cb80d1c9438efe8f5ac55f Mon Sep 17 00:00:00 2001 From: LaMaLein <76120220+LaMaLein@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:53:31 +0200 Subject: [PATCH 07/26] add comment for fuzzy search --- src/management-system-v2/components/processes.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/management-system-v2/components/processes.tsx b/src/management-system-v2/components/processes.tsx index 480b0ac5b..075746d5e 100644 --- a/src/management-system-v2/components/processes.tsx +++ b/src/management-system-v2/components/processes.tsx @@ -41,6 +41,7 @@ import { useProcessesStore } from '@/lib/use-local-process-store'; import Fuse from 'fuse.js'; const fuseOptions = { + /* Option for Fuzzy-Search for Processlistfilter */ /* https://www.fusejs.io/api/options.html#useextendedsearch */ // isCaseSensitive: false, // includeScore: false, From 9e005060955d4e4cbd1a8e853945fbfe33868fad Mon Sep 17 00:00:00 2001 From: LaMaLein <76120220+LaMaLein@users.noreply.github.com> Date: Mon, 28 Aug 2023 19:22:32 +0200 Subject: [PATCH 08/26] changed colour breadcrumb, added latest changes to modeler (jj), Menu (sider) updated --- .../app/(dashboard)/layout.tsx | 280 +++++++++++------- src/management-system-v2/app/globals.css | 22 +- .../components/content-based-header.tsx | 4 +- .../components/modeler.tsx | 5 +- .../components/previewProcess.tsx | 3 + 5 files changed, 195 insertions(+), 119 deletions(-) diff --git a/src/management-system-v2/app/(dashboard)/layout.tsx b/src/management-system-v2/app/(dashboard)/layout.tsx index 0469cb85f..1dc916d59 100644 --- a/src/management-system-v2/app/(dashboard)/layout.tsx +++ b/src/management-system-v2/app/(dashboard)/layout.tsx @@ -14,6 +14,7 @@ import { Space, Tooltip, } from 'antd'; +const { SubMenu, Item, Divider, ItemGroup } = Menu; import { DeploymentUnitOutlined, FundProjectionScreenOutlined, @@ -38,114 +39,130 @@ type AuthLayoutProps = PropsWithChildren<{ headerContent: React.ReactNode | undefined; }>; -const items: MenuProps['items'] = [ - { - key: 'processes', - label: 'Processes', - type: 'group', - }, - { - key: 'processes', - icon: , - label: 'Process List', - children: [ - { - key: 'processes', - icon: , - label: 'My Processes', - }, - { - key: 'newProcess', - icon: , - label: 'New Process', - disabled: true, - }, - { - key: 'processFavorites', - icon: , - label: 'Favorites', - disabled: true, - }, - ], - }, - // { - // key: 'newProcess', - // icon: , - // label: 'New Process', - // disabled: true, - // }, - { - key: 'templates', - icon: , - label: 'Templates', - disabled: false, - children: [ - { - key: 'newTemplate', - icon: , - label: 'New Template', - disabled: true, - }, - { - key: 'templateFavorites', - icon: , - label: 'Favorites', - disabled: true, - }, - ], - }, - // { - // key: 'execution', - // icon: , - // label: 'Execution', - // disabled: true, - // }, +const AuthLayout: FC = ({ children }) => { + const router = useRouter(); + const activeSegment = usePathname().split('/')[1] || 'processes'; + const [collapsed, setCollapsed] = useState(false); - // { type: 'divider' }, + const items: MenuProps['items'] = [ + { + key: 'processes', + label: 'Processes', + type: 'group', + }, + { + key: 'processes', + className: + 'SelectedSegment' /* `${activeSegment === 'processes' ? 'SelectedSegment' : ''}` */, + icon: ( + { + router.push(`/processes`); + }} + /> + ), + label: ( + { + router.push(`/processes`); + }} + > + Process List + + ), + children: [ + // { + // key: 'processes', + // icon: , + // label: 'My Processes', + // }, + { + key: 'newProcess', + icon: , + label: 'New Process', + disabled: true, + }, + { + key: 'processFavorites', + icon: , + label: 'Favorites', + disabled: true, + }, + ], + }, + // { + // key: 'newProcess', + // icon: , + // label: 'New Process', + // disabled: true, + // }, + { + key: 'templates', + icon: , + label: 'Templates', + disabled: false, + children: [ + { + key: 'newTemplate', + icon: , + label: 'New Template', + disabled: true, + }, + { + key: 'templateFavorites', + icon: , + label: 'Favorites', + disabled: true, + }, + ], + }, + // { + // key: 'execution', + // icon: , + // label: 'Execution', + // disabled: true, + // }, - // { - // key: 'projects', - // icon: , - // label: 'Projects', - // }, - // { - // key: 'tasklist', - // icon: , - // label: 'Tasklist', - // disabled: true, - // }, + // { type: 'divider' }, - { type: 'divider' }, + // { + // key: 'projects', + // icon: , + // label: 'Projects', + // }, + // { + // key: 'tasklist', + // icon: , + // label: 'Tasklist', + // disabled: true, + // }, - { - key: 'settings', - label: 'Settings', - type: 'group', - }, - { - key: 'generalSettings', - icon: , - label: 'General Settings', - disabled: true, - }, - { - key: 'plugins', - icon: , - label: 'Plugins', - disabled: true, - }, - // { - // key: 'environments', - // icon: , - // label: 'Environments', - // disabled: true, - // }, -]; + { type: 'divider' }, -const AuthLayout: FC = ({ children }) => { - const router = useRouter(); - const activeSegment = usePathname().split('/')[1] || 'processes'; - const [collapsed, setCollapsed] = useState(false); + { + key: 'settings', + label: 'Settings', + type: 'group', + }, + { + key: 'generalSettings', + icon: , + label: 'General Settings', + disabled: true, + }, + { + key: 'plugins', + icon: , + label: 'Plugins', + disabled: true, + }, + // { + // key: 'environments', + // icon: , + // label: 'Environments', + // disabled: true, + // }, + ]; return ( @@ -206,6 +223,61 @@ const AuthLayout: FC = ({ children }) => { breakpoint="md" > { + router.push(`/${key}`); + }} + > + + { + router.push(`/processes`); + }} + > + Process List + + } + className={activeSegment === 'processes' ? 'SelectedSegment' : ''} + icon={ + { + router.push(`/processes`); + }} + /> + } + > + }> + New Process + + }> + Favorites + + + }> + }> + New Template + + }> + Favorites + + + + + + }> + General Settings + + }> + Plugins + + + + {/* = ({ children }) => { onClick={({ key }) => { router.push(`/${key}`); }} - /> + /> */} diff --git a/src/management-system-v2/app/globals.css b/src/management-system-v2/app/globals.css index 1c949edfc..52dba7a7d 100644 --- a/src/management-system-v2/app/globals.css +++ b/src/management-system-v2/app/globals.css @@ -2,19 +2,15 @@ top: 80px; } -.ant-menu-vertical .ant-menu-item::after, -.ant-menu-vertical-left .ant-menu-item::after, -.ant-menu-vertical-right .ant-menu-item::after, -.ant-menu-inline .ant-menu-item::after { - border-right: 0px; +/* TODO: Move to module */ +.ant-menu-light.ant-menu-root.ant-menu-inline, +.ant-menu-light > .ant-menu.ant-menu-root.ant-menu-inline, +.ant-menu-light.ant-menu-root.ant-menu-vertical, +.ant-menu-light > .ant-menu.ant-menu-root.ant-menu-vertical { + border-inline-end: 0px !important; } -/* Dev-Mode CSS Override */ -:where(.css-dev-only-do-not-override-1afvvrg).ant-menu-light.ant-menu-root.ant-menu-inline, -:where(.css-dev-only-do-not-override-1afvvrg).ant-menu-light - > .ant-menu.ant-menu-root.ant-menu-inline, -:where(.css-dev-only-do-not-override-1afvvrg).ant-menu-light.ant-menu-root.ant-menu-vertical, -:where(.css-dev-only-do-not-override-1afvvrg).ant-menu-light - > .ant-menu.ant-menu-root.ant-menu-vertical { - border-inline-end: 0px !important; +.SelectedSegment > .ant-menu-submenu-title { + background-color: #ebf8ff; + color: #1976d2; } diff --git a/src/management-system-v2/components/content-based-header.tsx b/src/management-system-v2/components/content-based-header.tsx index fbbca7fef..6b418db69 100644 --- a/src/management-system-v2/components/content-based-header.tsx +++ b/src/management-system-v2/components/content-based-header.tsx @@ -106,7 +106,9 @@ const HeaderMenu: FC = () => { return ( <> - {isProcessPage && } + {isProcessPage && ( + + )} ); diff --git a/src/management-system-v2/components/modeler.tsx b/src/management-system-v2/components/modeler.tsx index 0eaa73d2b..c24b92afc 100644 --- a/src/management-system-v2/components/modeler.tsx +++ b/src/management-system-v2/components/modeler.tsx @@ -96,7 +96,8 @@ const Modeler: FC = ({ minimized, ...props }) => { const { data: processBpmn } = useProcessBpmn(processId, selectedVersion); useEffect(() => { - if (modeler.current?.importXML && processBpmn) { + // only import the bpmn once (the effect will be retriggered when initialized is set to false at its end) + if (!initialized && modeler.current?.importXML && processBpmn) { // import the diagram that was returned by the request modeler.current.importXML(processBpmn); @@ -120,6 +121,8 @@ const Modeler: FC = ({ minimized, ...props }) => { }, 2000); }); } + // set the initialized flag (back) to false so this effect can be retriggered every time the modeler is swapped with a viewer or the viewer with a modeler + setInitialized(false); }, [initialized, setSelectedElementId, processBpmn, processId]); return ( diff --git a/src/management-system-v2/components/previewProcess.tsx b/src/management-system-v2/components/previewProcess.tsx index 8188c935d..d2b5701b6 100644 --- a/src/management-system-v2/components/previewProcess.tsx +++ b/src/management-system-v2/components/previewProcess.tsx @@ -13,6 +13,9 @@ import { Card, Input, ColorPicker, Drawer, Space, Image } from 'antd'; import { EuroCircleOutlined, ClockCircleOutlined } from '@ant-design/icons'; import { Process } from '@/lib/fetch-data'; +const BPMNViewer = + typeof window !== 'undefined' ? import('bpmn-js/lib/Viewer').then((mod) => mod.default) : null; + type PropertiesPanelProperties = { selectedElement?: Process | undefined; setOpen: (open: boolean) => void; From 4051761a90464cfdac7de8b17ab63a047fb7ca08 Mon Sep 17 00:00:00 2001 From: LaMaLein <76120220+LaMaLein@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:22:22 +0200 Subject: [PATCH 09/26] Adjusted Modeler height, added Preview-Viewer Co-authored-by: winniel24 Co-authored-by: jjoderis Co-authored-by: Lucas --- .../app/(dashboard)/layout.tsx | 8 +++- .../processes/[processId]/_page.tsx | 2 +- .../app/(dashboard)/processes/page.tsx | 2 +- src/management-system-v2/app/globals.css | 12 ++++++ .../components/content-based-header.tsx | 6 +-- .../components/modeler-toolbar.tsx | 23 ++++++---- .../components/modeler.tsx | 4 +- .../components/previewProcess.tsx | 42 +++++++++++++++++-- .../components/processes.tsx | 8 ++-- 9 files changed, 84 insertions(+), 23 deletions(-) diff --git a/src/management-system-v2/app/(dashboard)/layout.tsx b/src/management-system-v2/app/(dashboard)/layout.tsx index 1dc916d59..8e7305e81 100644 --- a/src/management-system-v2/app/(dashboard)/layout.tsx +++ b/src/management-system-v2/app/(dashboard)/layout.tsx @@ -289,7 +289,13 @@ const AuthLayout: FC = ({ children }) => { - +
{children}
diff --git a/src/management-system-v2/app/(dashboard)/processes/[processId]/_page.tsx b/src/management-system-v2/app/(dashboard)/processes/[processId]/_page.tsx index 61c813441..05e5876f1 100644 --- a/src/management-system-v2/app/(dashboard)/processes/[processId]/_page.tsx +++ b/src/management-system-v2/app/(dashboard)/processes/[processId]/_page.tsx @@ -43,7 +43,7 @@ const Processes: FC = () => { diff --git a/src/management-system-v2/app/(dashboard)/processes/page.tsx b/src/management-system-v2/app/(dashboard)/processes/page.tsx index 47c02e36a..c7d94f2c3 100644 --- a/src/management-system-v2/app/(dashboard)/processes/page.tsx +++ b/src/management-system-v2/app/(dashboard)/processes/page.tsx @@ -7,7 +7,7 @@ import HeaderActions from './header-actions'; const ProcessesPage: FC = () => { return ( }> - + diff --git a/src/management-system-v2/app/globals.css b/src/management-system-v2/app/globals.css index 52dba7a7d..1709b5710 100644 --- a/src/management-system-v2/app/globals.css +++ b/src/management-system-v2/app/globals.css @@ -14,3 +14,15 @@ background-color: #ebf8ff; color: #1976d2; } + +.Content, +.Content > .ant-space-item, +.Content > .ant-space-item > div { + height: 100%; +} + +.modeler-page-content, +.modeler-page-content .ant-layout-content, +.modeler-page-content .ant-layout-content div[class^='page_Modeler_'] { + height: 100%; +} diff --git a/src/management-system-v2/components/content-based-header.tsx b/src/management-system-v2/components/content-based-header.tsx index 6b418db69..b341f001e 100644 --- a/src/management-system-v2/components/content-based-header.tsx +++ b/src/management-system-v2/components/content-based-header.tsx @@ -85,14 +85,14 @@ const HeaderMenu: FC = () => { menu: { items: selectedVersion ? [ - { key: -1, label: <>Latest Version }, + { key: '-1', label: <>Latest Version }, ...versions.map(({ version, name }) => ({ - key: version, + key: `${version}`, label: <>{name}, })), ] : versions.map(({ version, name }) => ({ - key: version, + key: `${version}`, label: <>{name}, })), onClick: ({ key }) => { diff --git a/src/management-system-v2/components/modeler-toolbar.tsx b/src/management-system-v2/components/modeler-toolbar.tsx index 9dc3d07c4..1f75bf28c 100644 --- a/src/management-system-v2/components/modeler-toolbar.tsx +++ b/src/management-system-v2/components/modeler-toolbar.tsx @@ -42,6 +42,7 @@ import { useProcess } from '@/lib/process-queries'; type ModelerToolbarProps = {}; const ModelerToolbar: React.FC = () => { + /* ICONS: */ const svgXML = ; const svgShare = ; @@ -53,7 +54,7 @@ const ModelerToolbar: React.FC = () => { const versions = useModelerStateStore((state) => state.versions); const setVersions = useModelerStateStore((state) => state.setVersions); - const [index, setIndex] = useState(0); + // const [index, setIndex] = useState(0); const { processId } = useParams(); const { isSuccess, data: processData } = useProcess(processId); @@ -74,13 +75,19 @@ const ModelerToolbar: React.FC = () => { let versionSelection: MenuProps['items'] = []; - if (isSuccess) { - setVersions(processData.versions); - versionSelection = processData.versions.map(({ version, name, description }) => ({ - key: version, - label: name, - })); - } + useEffect(() => { + if (isSuccess) { + setVersions(processData.versions); + } + }, [isSuccess, processData, setVersions]); + + versionSelection = ( + versions as { version: number | string; name: string; description: string }[] + ).map(({ version, name, description }) => ({ + key: version, + label: name, + })); + versionSelection.unshift({ key: -1, label: 'Latest Version' }); const handleVersionSelectionChange: MenuProps['onClick'] = (e) => { setSelectedVersion(+e.key < 0 ? null : +e.key); diff --git a/src/management-system-v2/components/modeler.tsx b/src/management-system-v2/components/modeler.tsx index c24b92afc..8e906ccc6 100644 --- a/src/management-system-v2/components/modeler.tsx +++ b/src/management-system-v2/components/modeler.tsx @@ -99,7 +99,9 @@ const Modeler: FC = ({ minimized, ...props }) => { // only import the bpmn once (the effect will be retriggered when initialized is set to false at its end) if (!initialized && modeler.current?.importXML && processBpmn) { // import the diagram that was returned by the request - modeler.current.importXML(processBpmn); + modeler.current.importXML(processBpmn).then(() => { + modeler.current!.get('canvas').zoom('fit-viewport', 'auto'); + }); modeler.current.on('selection.changed', (event) => { const { newSelection } = event as unknown as { newSelection: any[] }; diff --git a/src/management-system-v2/components/previewProcess.tsx b/src/management-system-v2/components/previewProcess.tsx index d2b5701b6..fe99016a7 100644 --- a/src/management-system-v2/components/previewProcess.tsx +++ b/src/management-system-v2/components/previewProcess.tsx @@ -6,12 +6,15 @@ import type { ElementLike } from 'diagram-js/lib/core/Types'; import useModelerStateStore from '@/lib/use-modeler-state-store'; -import React, { FocusEvent, useEffect, useState } from 'react'; +import React, { FocusEvent, useEffect, useRef, useState } from 'react'; import { Card, Input, ColorPicker, Drawer, Space, Image } from 'antd'; import { EuroCircleOutlined, ClockCircleOutlined } from '@ant-design/icons'; import { Process } from '@/lib/fetch-data'; +import { useProcessBpmn } from '@/lib/process-queries'; + +import type ViewerType from 'bpmn-js/lib/Viewer'; const BPMNViewer = typeof window !== 'undefined' ? import('bpmn-js/lib/Viewer').then((mod) => mod.default) : null; @@ -23,12 +26,41 @@ type PropertiesPanelProperties = { const Preview: React.FC = ({ selectedElement, setOpen }) => { const [name, setName] = useState(''); + const [initialized, setInitialized] = useState(false); + const { data: bpmn, isSuccess } = useProcessBpmn( + selectedElement ? selectedElement.definitionId : '' + ); + + const canvas = useRef(null); + const previewer = useRef(null); useEffect(() => { - if (selectedElement) { + console.log('A'); + if (!canvas.current) return; + console.log('B'); + BPMNViewer!.then((Viewer) => { + if (!previewer.current) { + const viewer = new Viewer!({ + container: canvas.current!, + }); + + previewer.current = viewer; + setInitialized(true); + } + }); + }, [bpmn]); + + useEffect(() => { + if (initialized && bpmn && selectedElement) { setName(selectedElement.definitionName); + + // console.log('Viewer importXML: ', previewer.current!.importXML); + // console.log('BPMN: ', bpmn); + previewer.current!.importXML(bpmn).then(() => { + previewer.current!.get('canvas').zoom('fit-viewport', 'auto'); + }); } - }, [selectedElement]); + }, [initialized, bpmn, selectedElement]); const Panel = ( = ({ selectedElement, setOpen }} open={true} mask={false} - > + > +
+ ); return <>{Panel}; diff --git a/src/management-system-v2/components/processes.tsx b/src/management-system-v2/components/processes.tsx index 075746d5e..bf18a2640 100644 --- a/src/management-system-v2/components/processes.tsx +++ b/src/management-system-v2/components/processes.tsx @@ -402,10 +402,6 @@ const Processes: FC = () => { //
// - if (isError) { - return
Error
; - } - useEffect(() => { if (data) { setProcesses(data); @@ -434,6 +430,10 @@ const Processes: FC = () => { setSelectedRowKeys([]); }; + if (isError) { + return
Error
; + } + return ( <> <> From b940034100d276ab60b8bd0207c4627b2853289f Mon Sep 17 00:00:00 2001 From: LaMaLein <76120220+LaMaLein@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:44:11 +0200 Subject: [PATCH 10/26] Made previewer height adjustable --- .../components/previewProcess.tsx | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/management-system-v2/components/previewProcess.tsx b/src/management-system-v2/components/previewProcess.tsx index fe99016a7..d4db72fcf 100644 --- a/src/management-system-v2/components/previewProcess.tsx +++ b/src/management-system-v2/components/previewProcess.tsx @@ -6,7 +6,7 @@ import type { ElementLike } from 'diagram-js/lib/core/Types'; import useModelerStateStore from '@/lib/use-modeler-state-store'; -import React, { FocusEvent, useEffect, useRef, useState } from 'react'; +import React, { FocusEvent, useCallback, useEffect, useRef, useState } from 'react'; import { Card, Input, ColorPicker, Drawer, Space, Image } from 'antd'; @@ -30,9 +30,40 @@ const Preview: React.FC = ({ selectedElement, setOpen const { data: bpmn, isSuccess } = useProcessBpmn( selectedElement ? selectedElement.definitionId : '' ); - const canvas = useRef(null); const previewer = useRef(null); + const [drawerHeight, setDrawerHeight] = useState(200); + + let resizingDrawer = useRef(false); + + const handleMouseMove = useCallback((e) => { + const newHeight = document.body.clientHeight - e.clientY; + const [minHeight, maxHeight] = [150, 850]; + if (newHeight > minHeight && newHeight < maxHeight) { + setDrawerHeight(newHeight); + } + }, []); + const handleMouseUp = useCallback( + (e) => { + if (!resizingDrawer.current) return; + + resizingDrawer.current = false; + document.removeEventListener('mousemove', handleMouseMove); + document.removeEventListener('mouseup', handleMouseUp); + setTimeout(() => { + previewer.current!.get('canvas').zoom('fit-viewport', 'auto'); + }, 1_000); + }, + [handleMouseMove] + ); + + const handleMouseDown = (e: React.MouseEvent) => { + e.preventDefault(); + e.stopPropagation(); + document.addEventListener('mousemove', handleMouseMove); + document.addEventListener('mouseup', handleMouseUp); + resizingDrawer.current = true; + }; useEffect(() => { console.log('A'); @@ -64,6 +95,7 @@ const Preview: React.FC = ({ selectedElement, setOpen const Panel = ( { @@ -72,6 +104,20 @@ const Preview: React.FC = ({ selectedElement, setOpen open={true} mask={false} > +
); From 0a3f6a77fe5422ed5d24fa45f1a03d42647a2ec9 Mon Sep 17 00:00:00 2001 From: jjoderis Date: Thu, 7 Sep 2023 16:38:58 +0200 Subject: [PATCH 11/26] Added export of a single process as bpmn, svg or pdf from the process modeler --- .../components/modeler-toolbar.tsx | 29 +++--- .../components/process-export.tsx | 81 +++++++++++++++ .../lib/process-export.ts | 99 +++++++++++++++++++ src/management-system-v2/package.json | 15 +-- 4 files changed, 202 insertions(+), 22 deletions(-) create mode 100644 src/management-system-v2/components/process-export.tsx create mode 100644 src/management-system-v2/lib/process-export.ts diff --git a/src/management-system-v2/components/modeler-toolbar.tsx b/src/management-system-v2/components/modeler-toolbar.tsx index 1f75bf28c..69f2890b3 100644 --- a/src/management-system-v2/components/modeler-toolbar.tsx +++ b/src/management-system-v2/components/modeler-toolbar.tsx @@ -4,31 +4,17 @@ import React, { useEffect, useState } from 'react'; import type ElementRegistry from 'diagram-js/lib/core/ElementRegistry'; -import { - Select, - FloatButton, - Row, - Col, - Space, - Tooltip, - Button, - Dropdown, - message, - Badge, -} from 'antd'; +import { Row, Col, Tooltip, Button, Dropdown, message } from 'antd'; import { Toolbar, ToolbarGroup } from './toolbar'; import type { MenuProps } from 'antd'; import Icon, { - QuestionCircleOutlined, DownOutlined, FormOutlined, ExportOutlined, EyeOutlined, - EyeInvisibleOutlined, SettingOutlined, PlusOutlined, - WarningOutlined, } from '@ant-design/icons'; import { SvgXML, SvgShare } from '@/components/svg'; @@ -39,6 +25,8 @@ import useModelerStateStore from '@/lib/use-modeler-state-store'; import { useParams } from 'next/navigation'; import { useProcess } from '@/lib/process-queries'; +import ProcessExportModal from './process-export'; + type ModelerToolbarProps = {}; const ModelerToolbar: React.FC = () => { @@ -47,6 +35,7 @@ const ModelerToolbar: React.FC = () => { const svgShare = ; const [showPropertiesPanel, setShowPropertiesPanel] = useState(false); + const [showProcessExportModal, setShowProcessExportModal] = useState(false); const modeler = useModelerStateStore((state) => state.modeler); const selectedElementId = useModelerStateStore((state) => state.selectedElementId); @@ -115,6 +104,10 @@ const ModelerToolbar: React.FC = () => { const selectedVersion = useModelerStateStore((state) => state.selectedVersion); + const handleProcessExportModalToggle = async () => { + setShowProcessExportModal(!showProcessExportModal); + }; + return ( <> @@ -153,7 +146,7 @@ const ModelerToolbar: React.FC = () => { - + @@ -183,6 +176,10 @@ const ModelerToolbar: React.FC = () => { {/* {showPropertiesPanel && selectedElement && ( )} */} + setShowProcessExportModal(false)} + /> ); }; diff --git a/src/management-system-v2/components/process-export.tsx b/src/management-system-v2/components/process-export.tsx new file mode 100644 index 000000000..fada21854 --- /dev/null +++ b/src/management-system-v2/components/process-export.tsx @@ -0,0 +1,81 @@ +import React, { useState } from 'react'; +import { useParams } from 'next/navigation'; + +import { Modal, Checkbox } from 'antd'; +import type { CheckboxValueType } from 'antd/es/checkbox/Group'; + +import useModelerStateStore from '@/lib/use-modeler-state-store'; + +import { exportBpmn, exportPDF, exportSVG } from '@/lib/process-export'; + +type ProcessExportModalProps = { + isOpen: boolean; + onClose: () => void; +}; + +const exportTypeOptions = [ + { label: 'BPMN', value: 'bpmn' }, + { label: 'PDF', value: 'pdf' }, + { label: 'SVG', value: 'svg' }, +]; + +const ProcessExportModal: React.FC = ({ isOpen, onClose }) => { + const [selectedTypes, setSelectedTypes] = useState([]); + + const handleTypeSelectionChange = (checkedValues: CheckboxValueType[]) => { + // allow selection of exactly one element + if (!checkedValues.length) return; + setSelectedTypes(checkedValues.filter((el) => !selectedTypes.includes(el))); + }; + + const { processId } = useParams(); + const modeler = useModelerStateStore((state) => state.modeler); + + const handleProcessExport = async () => { + if (modeler) { + const { xml } = await modeler.saveXML({ format: true }); + + if (!xml) throw 'Failed to export the bpmn from the modeler'; + + switch (selectedTypes[0]) { + case 'bpmn': + exportBpmn(processId, xml); + break; + case 'pdf': + await exportPDF(processId, xml); + break; + case 'svg': + await exportSVG(processId, xml); + break; + default: + throw 'Unexpected value for process export!'; + } + } else { + throw 'Could not get the modeler to export the bpmn!'; + } + + onClose(); + }; + + return ( + <> + + + + + ); +}; + +export default ProcessExportModal; diff --git a/src/management-system-v2/lib/process-export.ts b/src/management-system-v2/lib/process-export.ts new file mode 100644 index 000000000..a6026b14e --- /dev/null +++ b/src/management-system-v2/lib/process-export.ts @@ -0,0 +1,99 @@ +import { v4 } from 'uuid'; +import { jsPDF } from 'jspdf'; +import 'svg2pdf.js'; + +export function exportBpmn(processName: string, bpmn: string) { + const bpmnBlob = new Blob([bpmn], { type: 'application/xml' }); + + exportFile(`${processName}.bpmn`, bpmnBlob); +} + +async function getSVGFromBPMN(bpmn: string) { + const Viewer = (await import('bpmn-js/lib/Viewer')).default; + + //Creating temporary element for BPMN Viewer + const viewerElement = document.createElement('div'); + + //Assiging process id to temp element and append to DOM + viewerElement.id = 'canvas_' + v4(); + document.body.appendChild(viewerElement); + + //Create a viewer to transform the bpmn into an svg + const viewer = new Viewer({ container: '#' + viewerElement.id }); + await viewer.importXML(bpmn); + const { svg } = await viewer.saveSVG(); + + return svg; +} + +export async function exportSVG(processName: string, bpmn: string) { + const svg = await getSVGFromBPMN(bpmn); + + const svgBlob = new Blob([svg], { + type: 'image/svg+xml', + }); + + exportFile(`${processName}.svg`, svgBlob); +} + +export async function exportPDF(processName: string, bpmn: string) { + const svg = await getSVGFromBPMN(bpmn); + + const parser = new DOMParser(); + const svgDOM = parser.parseFromString(svg, 'image/svg+xml'); + + const doc = new jsPDF({ + unit: 'pt', // needed due to a bug in jsPDF: https://github.com/yWorks/svg2pdf.js/issues/245#issuecomment-1671624250 + format: 'a4', + orientation: 'landscape', + }); + + doc.deletePage(1); + + // get image dimensions + let svgWidth = parseFloat(svg.split('width="')[1].split('"')[0]); + let svgHeight = 20 + parseFloat(svg.split('height="')[1].split('"')[0]); + + // adding a new page, second parameter orientation: p - portrait, l - landscape + doc.addPage([svgWidth, svgHeight], svgHeight > svgWidth ? 'p' : 'l'); + + //Getting PDF Documents width and height + const pageWidth = doc.internal.pageSize.getWidth() - 10; + const pageHeight = doc.internal.pageSize.getHeight() - 10; + + //Setting pdf font size + doc.setFontSize(15); + + //Adding Header to the Pdf + // TODO: make sure that the text fits both in landscape as well as in portrait mode + doc.text(`Process: ${processName} \n`, 10, 15); + + await doc.svg(svgDOM.children[0], { + x: 0, + y: 10, + width: pageWidth, + height: pageHeight, + }); + + await doc.save(`${processName}.pdf`); +} + +function exportFile(processName: string, data: Blob) { + const objectURL = URL.createObjectURL(data); + + // Creating Anchor Element to trigger download feature + const aLink = document.createElement('a'); + + // Setting anchor tag properties + aLink.style.display = 'none'; + aLink.download = processName; + aLink.href = objectURL; + + // Setting anchor tag to DOM + document.body.appendChild(aLink); + aLink.click(); + document.body.removeChild(aLink); + + // Release Object URL, so browser dont keep reference + URL.revokeObjectURL(objectURL); +} diff --git a/src/management-system-v2/package.json b/src/management-system-v2/package.json index cf966ad46..9ea3956df 100644 --- a/src/management-system-v2/package.json +++ b/src/management-system-v2/package.json @@ -18,12 +18,15 @@ "antd": "5.6.1", "bpmn-js": "13.2.0", "classnames": "2.3.2", + "fuse.js": "6.6.2", + "immer": "10.0.2", + "jspdf": "^2.5.1", "next": "13.4.6", "react": "18.2.0", "react-dom": "18.2.0", - "zustand": "4.3.8", - "immer": "10.0.2", - "fuse.js": "6.6.2" + "svg2pdf.js": "^2.2.2", + "uuid": "^9.0.0", + "zustand": "4.3.8" }, "devDependencies": { "@tanstack/eslint-plugin-query": "4.29.9", @@ -36,8 +39,8 @@ "eslint-config-next": "13.4.6", "eslint-config-prettier": "8.8.0", "prettier": "2.8.8", + "sass": "1.63.4", "ts-node": "10.9.1", - "typescript": "5.1.3", - "sass": "1.63.4" + "typescript": "5.1.3" } -} \ No newline at end of file +} From 698f1d30c048ae0ecafc9017673cc872849834be Mon Sep 17 00:00:00 2001 From: jjoderis Date: Thu, 7 Sep 2023 17:49:32 +0200 Subject: [PATCH 12/26] Added the process export modal to the processes view in addition to the process editor view --- .../components/modeler-toolbar.tsx | 3 +- .../components/process-export.tsx | 57 ++++++++----------- .../components/processes.tsx | 24 +++++--- .../lib/process-export.ts | 39 +++++++++---- yarn.lock | 27 ++++++++- 5 files changed, 98 insertions(+), 52 deletions(-) diff --git a/src/management-system-v2/components/modeler-toolbar.tsx b/src/management-system-v2/components/modeler-toolbar.tsx index 69f2890b3..9afa09983 100644 --- a/src/management-system-v2/components/modeler-toolbar.tsx +++ b/src/management-system-v2/components/modeler-toolbar.tsx @@ -177,8 +177,9 @@ const ModelerToolbar: React.FC = () => { )} */} setShowProcessExportModal(false)} + processVersion={selectedVersion || undefined} /> ); diff --git a/src/management-system-v2/components/process-export.tsx b/src/management-system-v2/components/process-export.tsx index fada21854..58435af5b 100644 --- a/src/management-system-v2/components/process-export.tsx +++ b/src/management-system-v2/components/process-export.tsx @@ -1,25 +1,27 @@ import React, { useState } from 'react'; -import { useParams } from 'next/navigation'; import { Modal, Checkbox } from 'antd'; import type { CheckboxValueType } from 'antd/es/checkbox/Group'; -import useModelerStateStore from '@/lib/use-modeler-state-store'; - import { exportBpmn, exportPDF, exportSVG } from '@/lib/process-export'; -type ProcessExportModalProps = { - isOpen: boolean; - onClose: () => void; -}; - const exportTypeOptions = [ { label: 'BPMN', value: 'bpmn' }, { label: 'PDF', value: 'pdf' }, { label: 'SVG', value: 'svg' }, ]; -const ProcessExportModal: React.FC = ({ isOpen, onClose }) => { +type ProcessExportModalProps = { + processId?: string; // the id of the process to export; also used to decide if the modal should be opened + onClose: () => void; + processVersion?: number | string; +}; + +const ProcessExportModal: React.FC = ({ + processId, + onClose, + processVersion, +}) => { const [selectedTypes, setSelectedTypes] = useState([]); const handleTypeSelectionChange = (checkedValues: CheckboxValueType[]) => { @@ -28,30 +30,19 @@ const ProcessExportModal: React.FC = ({ isOpen, onClose setSelectedTypes(checkedValues.filter((el) => !selectedTypes.includes(el))); }; - const { processId } = useParams(); - const modeler = useModelerStateStore((state) => state.modeler); - const handleProcessExport = async () => { - if (modeler) { - const { xml } = await modeler.saveXML({ format: true }); - - if (!xml) throw 'Failed to export the bpmn from the modeler'; - - switch (selectedTypes[0]) { - case 'bpmn': - exportBpmn(processId, xml); - break; - case 'pdf': - await exportPDF(processId, xml); - break; - case 'svg': - await exportSVG(processId, xml); - break; - default: - throw 'Unexpected value for process export!'; - } - } else { - throw 'Could not get the modeler to export the bpmn!'; + switch (selectedTypes[0]) { + case 'bpmn': + await exportBpmn(processId!, processVersion); + break; + case 'pdf': + await exportPDF(processId!, processVersion); + break; + case 'svg': + await exportSVG(processId!, processVersion); + break; + default: + throw 'Unexpected value for process export!'; } onClose(); @@ -61,7 +52,7 @@ const ProcessExportModal: React.FC = ({ isOpen, onClose <> { const setSelectedProcess = useProcessesStore((state) => state.setSelectedProcess); const [open, setOpen] = useState(false); + const [showProcessExportModal, setShowProcessExportModal] = useState(false); const [selection, setSelection] = useState([]); const [hovered, setHovered] = useState(undefined); @@ -84,6 +81,10 @@ const Processes: FC = () => { setDropdownOpen(open); }; + const handleProcessExportModalToggle = async () => { + setShowProcessExportModal(!showProcessExportModal); + }; + const favourites = [0]; const actionBar = ( @@ -103,7 +104,7 @@ const Processes: FC = () => { ); - const [selectedColumn, setSelectedColumn] = useState({}); + const [selectedColumn, setSelectedColumn] = useState(); const actionBarGenerator = (record: Process) => { return ( @@ -120,7 +121,12 @@ const Processes: FC = () => { - + { + setSelectedColumn(record); + handleProcessExportModalToggle(); + }} + /> @@ -517,6 +523,10 @@ const Processes: FC = () => { size="middle" /> {open && } + setShowProcessExportModal(false)} + /> ); }; diff --git a/src/management-system-v2/lib/process-export.ts b/src/management-system-v2/lib/process-export.ts index a6026b14e..599aaabc8 100644 --- a/src/management-system-v2/lib/process-export.ts +++ b/src/management-system-v2/lib/process-export.ts @@ -2,10 +2,25 @@ import { v4 } from 'uuid'; import { jsPDF } from 'jspdf'; import 'svg2pdf.js'; -export function exportBpmn(processName: string, bpmn: string) { - const bpmnBlob = new Blob([bpmn], { type: 'application/xml' }); +import { fetchProcessVersionBpmn, fetchProcess } from './fetch-data'; - exportFile(`${processName}.bpmn`, bpmnBlob); +async function getProcessData(processId: string, processVersion?: string | number) { + // TODO: we use the data for the name but it is maybe better to get the name from the bpmn since it might be different in versioned bpmn + const data = await fetchProcess(processId); + + if (processVersion) { + data.bpmn = await fetchProcessVersionBpmn(processId, processVersion); + } + + return data; +} + +export async function exportBpmn(processId: string, processVersion?: string | number) { + const process = await getProcessData(processId, processVersion); + + const bpmnBlob = new Blob([process.bpmn!], { type: 'application/xml' }); + + exportFile(`${process.definitionName}.bpmn`, bpmnBlob); } async function getSVGFromBPMN(bpmn: string) { @@ -26,18 +41,22 @@ async function getSVGFromBPMN(bpmn: string) { return svg; } -export async function exportSVG(processName: string, bpmn: string) { - const svg = await getSVGFromBPMN(bpmn); +export async function exportSVG(processId: string, processVersion?: string | number) { + const process = await getProcessData(processId, processVersion); + + const svg = await getSVGFromBPMN(process.bpmn!); const svgBlob = new Blob([svg], { type: 'image/svg+xml', }); - exportFile(`${processName}.svg`, svgBlob); + exportFile(`${process.definitionName}.svg`, svgBlob); } -export async function exportPDF(processName: string, bpmn: string) { - const svg = await getSVGFromBPMN(bpmn); +export async function exportPDF(processId: string, processVersion?: string | number) { + const process = await getProcessData(processId, processVersion); + + const svg = await getSVGFromBPMN(process.bpmn!); const parser = new DOMParser(); const svgDOM = parser.parseFromString(svg, 'image/svg+xml'); @@ -66,7 +85,7 @@ export async function exportPDF(processName: string, bpmn: string) { //Adding Header to the Pdf // TODO: make sure that the text fits both in landscape as well as in portrait mode - doc.text(`Process: ${processName} \n`, 10, 15); + doc.text(`Process: ${process.definitionName} \n`, 10, 15); await doc.svg(svgDOM.children[0], { x: 0, @@ -75,7 +94,7 @@ export async function exportPDF(processName: string, bpmn: string) { height: pageHeight, }); - await doc.save(`${processName}.pdf`); + await doc.save(`${process.definitionName}.pdf`); } function exportFile(processName: string, data: Blob) { diff --git a/yarn.lock b/yarn.lock index fc06247bf..ad3192883 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9774,6 +9774,11 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +font-family-papandreou@^0.2.0-patch1: + version "0.2.0-patch2" + resolved "https://registry.yarnpkg.com/font-family-papandreou/-/font-family-papandreou-0.2.0-patch2.tgz#c75b659e96ffbc7ab2af651cf7b4910b334e8dd2" + integrity sha512-l/YiRdBSH/eWv6OF3sLGkwErL+n0MqCICi9mppTZBOCL5vixWGDqCYvRcuxB2h7RGCTzaTKOHT2caHvCXQPRlw== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -13234,7 +13239,7 @@ jspdf-yworks@^2.1.1: omggif "1.0.9" stackblur-canvas "2.2.0" -jspdf@^2.3.0: +jspdf@^2.3.0, jspdf@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jspdf/-/jspdf-2.5.1.tgz#00c85250abf5447a05f3b32ab9935ab4a56592cc" integrity sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA== @@ -18418,6 +18423,11 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +specificity@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/specificity/-/specificity-0.4.1.tgz#aab5e645012db08ba182e151165738d00887b019" + integrity sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg== + spectrum-colorpicker@^1.8.0: version "1.8.1" resolved "https://registry.yarnpkg.com/spectrum-colorpicker/-/spectrum-colorpicker-1.8.1.tgz#34d3038dcfd0accb89597335b50a663160b170af" @@ -18948,6 +18958,16 @@ svg2pdf.js@^1.5.0: dependencies: jspdf-yworks "^2.1.1" +svg2pdf.js@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/svg2pdf.js/-/svg2pdf.js-2.2.2.tgz#08bef6fb17fadbd96d4eed34e05a9d41740a9735" + integrity sha512-uhnLyeOCLzgvkjmck08kRaMxA3qdXxHcTVcrk9aZiVwzpnJeixdFWqTAtGgKhCpCF5jSsoBOuC4CY4KgdrB7WA== + dependencies: + cssesc "^3.0.0" + font-family-papandreou "^0.2.0-patch1" + specificity "^0.4.1" + svgpath "^2.3.0" + svgo@^1.0.0: version "1.3.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.2.tgz#b6dc511c063346c9e415b81e43401145b96d4167" @@ -18967,6 +18987,11 @@ svgo@^1.0.0: unquote "~1.1.1" util.promisify "~1.0.0" +svgpath@^2.3.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/svgpath/-/svgpath-2.6.0.tgz#5b160ef3d742b7dfd2d721bf90588d3450d7a90d" + integrity sha512-OIWR6bKzXvdXYyO4DK/UWa1VA1JeKq8E+0ug2DG98Y/vOmMpfZNj+TIG988HjfYSqtcy/hFOtZq/n/j5GSESNg== + swap-case@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-1.1.2.tgz#c39203a4587385fad3c850a0bd1bcafa081974e3" From 3bc78654dfbd2717f826ea6161e2234d3cc3eb43 Mon Sep 17 00:00:00 2001 From: jjoderis Date: Fri, 8 Sep 2023 16:04:43 +0200 Subject: [PATCH 13/26] Ran prettier --- jsdoc/template/publish.js | 8 +- .../get-coordinates.js | 2 +- .../go-to-target.js | 2 +- .../init-drone.js | 2 +- .../test-drone.js | 4 +- src/engine/e2e_tests/globalSetup.js | 6 +- .../process/deployment/deployment.e2e.test.js | 158 +++++++++--------- .../process/deployment/mockNativeMachine.js | 2 +- .../process/deployment/startEngines.js | 8 +- .../adaptiveProcess/User_Task_09g3sdq.html | 10 +- .../adaptiveProcess/User_Task_0dqts41.html | 10 +- .../migrationExtended/User_Task_09g3sdq.html | 10 +- .../migrationExtended/User_Task_0dqts41.html | 10 +- .../migrationInitial/User_Task_09g3sdq.html | 10 +- .../process/processEndpoint.e2e.test.js | 4 +- .../android/app/src/main/assets/index.html | 4 +- .../native/espruino/modules/engine-lib.js | 74 ++++---- src/engine/native/espruino/modules/engine.js | 74 ++++---- src/engine/native/index.html | 2 +- src/engine/native/node/build-injector.js | 2 +- .../native-config/src/__tests__/index.test.js | 6 +- .../native-fs/src/__tests__/index.test.js | 32 ++-- .../native/node/native-machine/src/index.js | 2 +- .../native/node/native-mdns/src/index.js | 10 +- .../native/node/native-module/src/index.js | 2 +- .../native-mqtt/src/__tests__/index.test.js | 42 ++--- .../native/node/native-mqtt/src/index.js | 2 +- src/engine/native/node/native/src/index.js | 2 +- .../Proceed-App/Proceed-Universal/index.html | 2 +- .../native/web/server/src/template.html | 2 +- .../capabilities/__tests__/module.test.js | 4 +- .../parser/parameterAndOutputParser.test.js | 24 +-- .../__tests__/parser/urlParser.test.js | 4 +- src/engine/universal/capabilities/module.js | 4 +- .../listParser/createConsolidatedList.js | 2 +- .../parser/listParser/listParser.js | 2 +- .../parser/parameterAndOutputParser.js | 40 ++--- .../parser/potentialActionParser.js | 10 +- .../validateExpectedParametersNode.js | 6 +- .../parser/validator/validateOutputMapping.js | 8 +- .../validateParameterDescriptions.js | 4 +- .../validator/validateParameterMapping.js | 14 +- .../core/src/__tests__/engine.test.js | 2 +- .../core/src/__tests__/management.test.js | 6 +- .../src/__tests__/processRecovery.test.js | 14 +- .../universal/core/src/engine/5thIndustry.js | 22 +-- .../engine/__tests__/hookCallbacks.test.js | 2 +- .../__tests__/processForwarding.test.js | 30 ++-- .../__tests__/shouldActivateFlowNode.test.js | 4 +- .../engine/__tests__/shouldPassToken.test.js | 34 ++-- .../universal/core/src/engine/engine.js | 38 ++--- .../core/src/engine/hookCallbacks.js | 8 +- .../core/src/engine/neoEngineSetup.js | 4 +- .../core/src/engine/processForwarding.js | 10 +- .../core/src/engine/publishStateUtils.ts | 16 +- .../core/src/engine/shouldActivateFlowNode.js | 10 +- .../core/src/engine/shouldPassToken.js | 28 ++-- src/engine/universal/core/src/management.js | 27 ++- .../universal/core/src/messaging-setup.js | 9 +- src/engine/universal/core/src/module.js | 4 +- src/engine/universal/core/src/separator.js | 2 +- .../universal/core/src/separator.webpack.js | 2 +- .../__tests__/constraintHelper.test.js | 54 +++--- .../__tests__/constraintManager.test.js | 78 ++++----- .../decider/__tests__/hceval.test.js | 70 ++++---- .../decider/__tests__/module.test.js | 8 +- .../universal/decider/constraintHelper.js | 4 +- .../universal/decider/constraintManager.js | 20 +-- src/engine/universal/decider/deciderRoutes.js | 5 +- .../hard_constraint_evaluation/hc-eval.js | 23 ++- src/engine/universal/decider/module.js | 43 +++-- .../src/communication/src/communication.js | 8 +- .../src/database/__tests__/db.test.js | 56 +++---- .../universal/distribution/src/database/db.js | 10 +- .../src/database/processFragmentCheck.js | 10 +- .../src/database/publishDeploymentUtils.ts | 8 +- .../src/routes/ProcessInstanceRoutes.js | 46 ++--- .../distribution/test/testProcessRoutes.js | 2 +- .../machine/information/machineInformation.js | 4 +- .../machine/logging/__tests__/logging.test.js | 8 +- .../universal/machine/logging/logging.js | 4 +- .../logging/src/loggerHelpers/writers.js | 2 +- .../machine/logging/src/routes/logRoutes.js | 12 +- src/engine/universal/monitoring/src/module.js | 4 +- .../system/src/__tests__/messaging.test.js | 54 +++--- .../system/src/__tests__/middleware.test.js | 22 +-- .../system/src/__tests__/network.test.js | 2 +- src/engine/universal/system/src/capability.ts | 4 +- src/engine/universal/system/src/http.js | 2 +- src/engine/universal/system/src/messaging.js | 4 +- src/engine/universal/system/src/middleware.js | 4 +- .../display-items/configuration/index.html | 2 +- .../src/display-items/configuration/index.js | 2 +- .../ui/src/display-items/logging/index.html | 2 +- .../ui/src/display-items/style-buttons.css | 12 +- .../tasklist/TaskList-DisplayItem.js | 8 +- .../ui/src/display-items/tasklist/index.html | 2 +- .../ui/src/display-items/tasklist/index.js | 10 +- .../ui/src/display-items/tasklist/style.css | 12 +- src/engine/universal/ui/src/ui.js | 12 +- .../bpmn-helper/__tests__/getters.test.js | 6 +- .../bpmn-helper/src/PROCEED-CONSTANTS.js | 2 +- src/helper-modules/bpmn-helper/src/getters.js | 42 ++--- .../bpmn-helper/src/proceedExtensions.js | 4 +- src/helper-modules/bpmn-helper/src/setters.js | 24 +-- .../bpmn-helper/src/validators.js | 4 +- .../finalToIntermediateJsParser.test.js | 4 +- .../__tests__/parser.test.js | 64 +++---- .../finalToIntermediateJsParser.js | 2 +- .../constraint-parser-xml-json/parser.js | 22 +-- .../components/content-based-header.tsx | 5 +- .../components/modeler-toolbar.tsx | 2 +- .../components/previewProcess.tsx | 4 +- .../components/processes.tsx | 2 +- .../components/register.tsx | 2 +- src/management-system-v2/lib/fetch-data.ts | 10 +- src/management-system-v2/lib/update-data.ts | 2 +- .../lib/use-local-process-store.ts | 4 +- .../lib/use-modeler-state-store.ts | 2 +- .../scripts/genAntdCss.tsx | 2 +- src/management-system/dev-server.ts | 6 +- .../public/frontendTemplate.html | 2 +- .../src/backend/server/5thIndustry.js | 4 +- .../src/backend/server/deployment.js | 6 +- .../https-certificate-service/acme-service.js | 18 +- .../https-certificate-service/certificate.js | 10 +- .../backend/server/iam/authentication/auth.js | 10 +- .../authentication/handlers/loginHandler.js | 6 +- .../authentication/handlers/logoutHandler.js | 2 +- .../handlers/userinfoHandler.js | 2 +- .../server/iam/middleware/authorization.js | 4 +- .../backend/server/iam/rest-api/auth0/user.js | 24 +-- .../src/backend/server/iam/rest-api/index.js | 4 +- .../server/iam/rest-api/keycloak/user.js | 10 +- .../server/iam/rest-api/role-mappings.js | 6 +- .../src/backend/server/iam/rest-api/roles.js | 6 +- .../src/backend/server/iam/rest-api/shares.js | 16 +- .../src/backend/server/iam/utils/config.js | 14 +- .../backend/server/iam/utils/permissions.js | 6 +- .../backend/server/iam/utils/roleMappings.js | 2 +- .../src/backend/server/iam/utils/utils.js | 4 +- .../src/backend/server/index.js | 8 +- .../src/backend/server/machineInfo.js | 6 +- .../src/backend/server/network.js | 38 ++--- .../src/backend/server/process.js | 34 ++-- .../puppeteerStartWebviewWithBpmnModeller.js | 2 +- ...ppeteerWebsiteForServerWithBpmnModeller.js | 2 +- .../src/backend/server/rest-api/machine.js | 6 +- .../src/backend/server/rest-api/process.js | 18 +- .../src/backend/server/socket.js | 2 +- .../server/webpack.server.backend.config.cjs | 6 +- .../data/capabilities.js | 2 +- .../shared-electron-server/data/deployment.js | 7 +- .../data/fileHandling.js | 4 +- .../data/iam/role-mappings.js | 4 +- .../shared-electron-server/data/iam/roles.js | 2 +- .../shared-electron-server/data/machines.js | 2 +- .../shared-electron-server/data/process.js | 2 +- .../network/5thIndustry/5thIndustry.js | 22 +-- .../network/capabilities/capability-helper.js | 6 +- .../network/capabilities/discovery.js | 6 +- .../network/machines/machineInfo.js | 4 +- .../network/ms-engine-communication/module.js | 10 +- .../ms-engine-communication/process.js | 42 ++--- .../network/process/deployment.js | 41 +++-- .../network/process/helpers.js | 10 +- .../network/process/instance.js | 40 ++--- .../network/process/polling.js | 58 +++---- .../backend-api/EngineNetworkInterface.js | 2 +- .../backend-api/ms-api-electron/network.js | 2 +- .../backend-api/ms-api-server/5thIndustry.js | 2 +- .../backend-api/ms-api-server/deployment.js | 2 +- .../backend-api/ms-api-server/iam/shares.js | 2 +- .../backend-api/ms-api-server/iam/users.js | 6 +- .../backend-api/ms-api-server/network.js | 4 +- .../backend-api/ms-api-server/process.js | 22 +-- .../backend-api/ms-api-server/rest.js | 2 +- .../5thIndustry/5thIndustryHelper.js | 2 +- .../5thIndustry/inspectionOrderSelection.vue | 2 +- .../5thIndustry/inspectionPlanSelection.vue | 2 +- .../frontend/components/bpmn/BpmnPreview.vue | 2 +- .../capabilities/CapabilityForm.vue | 2 +- .../capabilities/CapabilityInfo.vue | 2 +- .../constraints/HardConstraints.vue | 10 +- .../constraints/ProcessConstraintsModal.vue | 4 +- .../departments/DepartmentsList.vue | 2 +- .../components/deployments/Instance.vue | 12 +- .../deployments/InstanceControl.vue | 6 +- .../deployments/InstanceMigrationModal.vue | 8 +- .../deployments/MachineMappingModeler.vue | 4 +- .../components/deployments/Tokens.vue | 10 +- .../components/deployments/VersionToolbar.vue | 6 +- .../ActivityAdvancedInformation.vue | 8 +- .../deployments/activityInfo/ActivityCard.vue | 4 +- .../ActivityStatusInformation.vue | 28 ++-- .../activityInfo/ActivityTimeCalculation.vue | 10 +- .../ActivityTimingInformation.vue | 2 +- .../EnvironmentConfigDataTable.vue | 4 +- .../components/form-builder/FormBuilder.vue | 2 +- .../frontend/components/iam/CheckSession.vue | 2 +- .../iam/dialogs/AddMemberDialog.vue | 4 +- .../components/iam/dialogs/EditUserDialog.vue | 2 +- .../components/iam/dialogs/PendingChanges.vue | 2 +- .../iam/dialogs/RemoveMemberDialog.vue | 4 +- .../iam/roles/DefaultPermissions.vue | 2 +- .../components/iam/roles/DeleteRoleButton.vue | 2 +- .../components/iam/roles/Permissions.vue | 4 +- .../frontend/components/iam/roles/Roles.vue | 4 +- .../components/iam/roles/RolesTabs.vue | 6 +- .../components/machines/LoggingInfo.vue | 2 +- .../components/machines/MachineInfo.vue | 2 +- .../processes/ShareProcessPanel.vue | 4 +- .../processes/datatable/ProcessDatatable.vue | 14 +- .../processes/editor/CallActivityHandling.vue | 8 +- .../editor/ConditionalFlowOptions.vue | 4 +- .../processes/editor/ConstraintHandling.vue | 6 +- .../processes/editor/DurationForm.vue | 2 +- .../processes/editor/HtmlEditor.vue | 10 +- .../processes/editor/InstanceEditing.vue | 8 +- .../processes/editor/Modeler/Modeler.vue | 6 +- .../editor/Modeler/proceed-user-task.js | 8 +- .../BooleanBpmnPropertyForm.vue | 2 +- .../PropertiesPanel/CustomPropertyForm.vue | 2 +- .../PropertiesPanel/FlowElementColor.vue | 2 +- .../editor/PropertiesPanel/PerformerForm.vue | 8 +- .../resources/ProcessStepResourceForm.vue | 6 +- .../resources/ResourceForm.vue | 4 +- .../resources/WorkingPlaceSelection.vue | 8 +- .../components/processes/editor/TabBar.vue | 12 +- .../processes/editor/TimerHandling.vue | 4 +- .../processes/editor/VariableToolbar.vue | 2 +- .../processes/editor/VersionHandling.vue | 4 +- .../processForm/5thIndustryProperties.vue | 2 +- .../processForm/ImportProcessForm.vue | 4 +- .../processes/processForm/ProcessForm.vue | 2 +- .../processForm/ProcessFormWarnings.vue | 26 +-- .../processForm/ProjectProperties.vue | 2 +- .../processes/processForm/process-import.js | 6 +- .../processes/processForm/userTasks.vue | 8 +- .../processes/shareProcess/SearchBar.vue | 2 +- .../shareProcess/sharesList/SingleSharing.vue | 2 +- .../components/profiles/ProfileEditor.vue | 4 +- .../components/profiles/ProfilesCard.vue | 4 +- .../ViewportRelativeResizableWindow.vue | 10 +- .../components/scripting-ide/MonacoEditor.vue | 2 +- .../components/scripting-ide/ScriptEditor.vue | 6 +- .../components/scripting-ide/ScriptingIde.vue | 4 +- .../scripting-ide/tabs/MachinesTab.vue | 6 +- .../ProcessVersioning/ProcessVersionModal.vue | 2 +- .../universal/ProcessVersioning/helpers.js | 4 +- .../universal/toolbar/HoveringToolbar.vue | 2 +- .../components/userTasks/userTaskCard.vue | 2 +- .../command-handlers/add-script-handler.js | 2 +- .../command-handlers/update-called-process.js | 12 +- .../update-definitions-command-handler.js | 2 +- .../update-event-definition.js | 18 +- .../command-handlers/update-proceed-data.js | 4 +- .../bpmn-modeler-events/custom-behaviour.js | 2 +- .../bpmn-modeler-events/custom-modeling.js | 6 +- .../bpmn-modeler-events/event-distribution.js | 4 +- .../event-serialization.js | 2 +- .../helpers/bpmn-modeler-events/getters.js | 2 +- .../src/frontend/helpers/constraint-helper.js | 8 +- .../src/frontend/helpers/helpers.js | 4 +- .../helpers/iam/permissions/casl-abilities.js | 2 +- .../frontend/helpers/instance-information.js | 2 +- .../helpers/override-modules/custom-rules.js | 2 +- .../process-export/export-preparation.js | 6 +- .../helpers/process-export/process-export.js | 4 +- .../frontend/helpers/script-editor-helper.js | 4 +- .../src/frontend/helpers/usertask-helper.js | 4 +- .../src/frontend/icons/ProceedLogo.vue | 2 +- src/management-system/src/frontend/router.js | 2 +- .../src/frontend/stores/auth.js | 2 +- .../src/frontend/stores/deployment.js | 2 +- .../src/frontend/stores/environment.js | 2 +- .../src/frontend/stores/plugins/abilities.js | 2 +- .../src/frontend/stores/process-editor.js | 14 +- .../src/frontend/stores/process.js | 8 +- .../src/frontend/views/Capabilities.vue | 4 +- .../frontend/views/DeploymentMonitoring.vue | 21 ++- .../src/frontend/views/Deployments.vue | 16 +- .../src/frontend/views/EnvironmentProfile.vue | 4 +- .../src/frontend/views/InstanceViewer.vue | 2 +- .../src/frontend/views/ProjectOverview.vue | 16 +- .../src/frontend/views/Tasklist.vue | 8 +- .../helpers/javascriptHelpers.js | 4 +- .../helpers/process-hierarchy.js | 4 +- .../helpers/processHelpers.js | 2 +- .../backend/shared/data/machines.spec.js | 12 +- .../specs/backend/shared/data/process.spec.js | 16 +- .../backend/shared/network/process.spec.js | 34 ++-- .../shared/network/process/polling.spec.js | 104 ++++++------ .../specs/helpers/capability-helper.spec.js | 10 +- .../specs/helpers/javascriptHelpers.spec.js | 18 +- .../ms-engine-communication/process.spec.js | 22 +-- .../unit/specs/helpers/processHelpers.spec.js | 22 +-- .../unit/specs/store/MachineStore.spec.js | 2 +- .../unit/specs/store/ProcessStore.spec.js | 4 +- .../specs/views/Deployments/Tests.spec.js | 4 +- src/management-system/vue.config.js | 10 +- tests/tasklist/tasklist.page.ts | 14 +- tests/tasklist/tasklist.spec.ts | 26 +-- 303 files changed, 1633 insertions(+), 1592 deletions(-) diff --git a/jsdoc/template/publish.js b/jsdoc/template/publish.js index 4b4eef7f2..6da337456 100644 --- a/jsdoc/template/publish.js +++ b/jsdoc/template/publish.js @@ -114,7 +114,7 @@ function updateItemName(item) { itemName = util.format( '%s%s', itemName, - attributes.join(', ') + attributes.join(', '), ); } @@ -377,7 +377,7 @@ function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) { // end my changes itemsNav += `
  • ${linktoFn( item.longname, - displayName.replace(/\b(module|event):/g, '') + displayName.replace(/\b(module|event):/g, ''), )}
  • `; itemsSeen[item.longname] = true; } @@ -571,7 +571,7 @@ exports.publish = function (taffyData, opts, tutorials) { view.layout = conf.default.layoutFile ? path.getResourcePath( path.dirname(conf.default.layoutFile), - path.basename(conf.default.layoutFile) + path.basename(conf.default.layoutFile), ) : 'layout.tmpl'; @@ -774,7 +774,7 @@ exports.publish = function (taffyData, opts, tutorials) { }, ]) .concat(files), - indexUrl + indexUrl, ); // set up the lists that we'll use to generate pages diff --git a/src/capabilities/raspberry3-drone-ardupilot-master/get-coordinates.js b/src/capabilities/raspberry3-drone-ardupilot-master/get-coordinates.js index ee6e6b304..c91c10c3b 100755 --- a/src/capabilities/raspberry3-drone-ardupilot-master/get-coordinates.js +++ b/src/capabilities/raspberry3-drone-ardupilot-master/get-coordinates.js @@ -36,7 +36,7 @@ function getCoordinates(callback) { ipc.server.on('command', function (data) { this.stop(); }); - } + }, ); ipc.server.on('start', async function () { diff --git a/src/capabilities/raspberry3-drone-ardupilot-master/go-to-target.js b/src/capabilities/raspberry3-drone-ardupilot-master/go-to-target.js index 86d2b1177..a84db8b0f 100755 --- a/src/capabilities/raspberry3-drone-ardupilot-master/go-to-target.js +++ b/src/capabilities/raspberry3-drone-ardupilot-master/go-to-target.js @@ -47,7 +47,7 @@ function goToTarget([lat, long, alt = 10, timeout = 180], callback) { handleResponse(data, callback); } }); - } + }, ); ipc.server.on('start', async function () { diff --git a/src/capabilities/raspberry3-drone-ardupilot-master/init-drone.js b/src/capabilities/raspberry3-drone-ardupilot-master/init-drone.js index c41371ec8..4841807f9 100755 --- a/src/capabilities/raspberry3-drone-ardupilot-master/init-drone.js +++ b/src/capabilities/raspberry3-drone-ardupilot-master/init-drone.js @@ -40,7 +40,7 @@ function initDrone([timeout = 15], callback) { callback([null, data]); } }); - } + }, ); ipc.server.on('start', async function () { diff --git a/src/capabilities/raspberry3-drone-ardupilot-master/test-drone.js b/src/capabilities/raspberry3-drone-ardupilot-master/test-drone.js index df8b2a2d0..882b1e632 100755 --- a/src/capabilities/raspberry3-drone-ardupilot-master/test-drone.js +++ b/src/capabilities/raspberry3-drone-ardupilot-master/test-drone.js @@ -28,7 +28,7 @@ ipc.serveNet( [latLongAlt], groundspeed + 'm/s', bat[bat.length - 1] + '%', - data.mode.split(':')[1] + data.mode.split(':')[1], ); }); @@ -39,7 +39,7 @@ ipc.serveNet( handleResponse(data); } }); - } + }, ); async function handleResponse(data) { diff --git a/src/engine/e2e_tests/globalSetup.js b/src/engine/e2e_tests/globalSetup.js index 49b8897f4..04c8a2783 100644 --- a/src/engine/e2e_tests/globalSetup.js +++ b/src/engine/e2e_tests/globalSetup.js @@ -22,7 +22,7 @@ module.exports = () => { engine: { networkRequestTimeout: 10, }, - }) + }), ); let out = ''; @@ -33,7 +33,7 @@ module.exports = () => { { cwd: __dirname, detached: false, - } + }, ); engineProcess.stdout.on('data', (data) => { // eslint-disable-next-line no-console @@ -47,7 +47,7 @@ module.exports = () => { resolve(); }, // this 10s timeout value is set in the configuration and can even be higher! adapt it to the default! - 10000 + 10000, ); ready = true; // avoid setting multiple timeouts } diff --git a/src/engine/e2e_tests/process/deployment/deployment.e2e.test.js b/src/engine/e2e_tests/process/deployment/deployment.e2e.test.js index 8d2542971..115d80f29 100644 --- a/src/engine/e2e_tests/process/deployment/deployment.e2e.test.js +++ b/src/engine/e2e_tests/process/deployment/deployment.e2e.test.js @@ -33,7 +33,7 @@ async function deployProcess(processName, engines) { const bpmn = fs.readFileSync( path.resolve(__dirname, 'testProcesses', processName, `${processName}.xml`), - 'utf-8' + 'utf-8', ); const correctNameSpaceBpmn = ensureCorrectProceedNamespace(bpmn); @@ -75,7 +75,7 @@ describe('Test deploying a process', () => { afterAll(async () => { // kills all processes and their subprocesses const killCommands = engineProcesses.map((engineProcess) => - killEngineProcess(engineProcess.process) + killEngineProcess(engineProcess.process), ); await Promise.all(killCommands); @@ -121,8 +121,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); // check for instance information @@ -404,8 +404,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); // check for instance information @@ -691,7 +691,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['ERROR-CONSTRAINT-UNFULFILLED']); @@ -808,8 +808,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); engineResponses.forEach((engine) => { @@ -940,7 +940,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['DEPLOYMENT-WAITING']); @@ -1018,7 +1018,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['DEPLOYMENT-WAITING']); @@ -1109,8 +1109,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); engineResponses.forEach((engine) => { @@ -1308,7 +1308,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['READY', 'ERROR-CONSTRAINT-UNFULFILLED']); @@ -1437,7 +1437,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['ERROR-CONSTRAINT-UNFULFILLED']); @@ -1579,7 +1579,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['ERROR-CONSTRAINT-UNFULFILLED']); @@ -1744,7 +1744,7 @@ describe('Test deploying a process', () => { test('wrong tokenId will return error', async () => { const engineResponse = await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}wrong/currentFlowNodeState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}wrong/currentFlowNodeState`, ) .send({ currentFlowNodeState: 'ACTIVE' }); @@ -1754,7 +1754,7 @@ describe('Test deploying a process', () => { test('invalid state will return error', async () => { const engineResponse = await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState`, ) .send({ currentFlowNodeState: 'INVALID STATE' }); @@ -1764,7 +1764,7 @@ describe('Test deploying a process', () => { test('will set the state to EXTERNAL', async () => { let engineResponse = await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState`, ) .send({ currentFlowNodeState: 'EXTERNAL' }); @@ -1798,7 +1798,7 @@ describe('Test deploying a process', () => { test('will complete the flow node and set variables', async () => { let engineResponse = await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState`, ) .send({ currentFlowNodeState: 'EXTERNAL-COMPLETED', variables: { test: 42 } }); @@ -1858,7 +1858,7 @@ describe('Test deploying a process', () => { test('will terminate the activity and the token that activated it', async () => { let engineResponse = await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState`, ) .send({ currentFlowNodeState: 'EXTERNAL-TERMINATED' }); @@ -1906,7 +1906,7 @@ describe('Test deploying a process', () => { test('will fail the activity and the token that activated it', async () => { let engineResponse = await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}/currentFlowNodeState`, ) .send({ currentFlowNodeState: 'EXTERNAL-FAILED' }); @@ -1971,9 +1971,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'adaptiveProcess', - `${userTask1FileName}.html` + `${userTask1FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask1FileName}`) @@ -1987,9 +1987,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'adaptiveProcess', - `${userTask2FileName}.html` + `${userTask2FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask2FileName}`) @@ -2008,7 +2008,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineName + engineName, ); expect(instanceInfo.tokens).toEqual([ @@ -2055,7 +2055,7 @@ describe('Test deploying a process', () => { // stop the instance and remove the deployment await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/instanceState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/instanceState`, ) .send({ instanceState: 'stopped' }); @@ -2069,7 +2069,7 @@ describe('Test deploying a process', () => { // check the state after the move to be correct await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}`, ) .send({ currentFlowElementId: 'Flow_0n4onyv' }); @@ -2078,7 +2078,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineName + engineName, ); expect(instanceInfo.tokens).toEqual([ @@ -2144,7 +2144,7 @@ describe('Test deploying a process', () => { it('will allow removing a token from an instance', async () => { // check the state after the removal to be correct await request.delete( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/tokens/${tokenId}`, ); await new Promise((resolve) => setTimeout(() => resolve(), 1000)); @@ -2152,7 +2152,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineName + engineName, ); // TODO: check non ended state @@ -2217,9 +2217,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'adaptiveProcess', - `${userTask1FileName}.html` + `${userTask1FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask1FileName}`) @@ -2233,9 +2233,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'adaptiveProcess', - `${userTask2FileName}.html` + `${userTask2FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask2FileName}`) @@ -2254,7 +2254,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineName + engineName, ); expect(instanceInfo.variables).toEqual({}); @@ -2282,7 +2282,7 @@ describe('Test deploying a process', () => { // stop the instance and remove the deployment await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/instanceState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/instanceState`, ) .send({ instanceState: 'stopped' }); @@ -2296,19 +2296,19 @@ describe('Test deploying a process', () => { // set an intermediate value for the variable (will be commited to the instance state when the user task is completed) await request .put( - `:${usedEngine.port}/tasklist/api/variable?instanceID=${instanceId}&userTaskID=Activity_1xguu75` + `:${usedEngine.port}/tasklist/api/variable?instanceID=${instanceId}&userTaskID=Activity_1xguu75`, ) .send({ var1: 'some-value' }); // complete the user task await request .post( - `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1xguu75` + `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1xguu75`, ) .send(); await request .post( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/variables` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/variables`, ) .send({ var1: 'some-other-value', @@ -2320,7 +2320,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineName + engineName, ); expect(instanceInfo.variables).toEqual({ @@ -2381,7 +2381,7 @@ describe('Test deploying a process', () => { // stop the instance and remove the deployment await request .put( - `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/instanceState` + `:${usedEngine.port}/process/${definitionId}/instance/${instanceId}/instanceState`, ) .send({ instanceState: 'stopped' }); @@ -2406,9 +2406,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'migrationExtended', - `${userTask1FileName}.html` + `${userTask1FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask1FileName}`) @@ -2422,9 +2422,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'migrationExtended', - `${userTask2FileName}.html` + `${userTask2FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask2FileName}`) @@ -2458,7 +2458,7 @@ describe('Test deploying a process', () => { await request .post( - `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1xguu75` + `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1xguu75`, ) .send({}); @@ -2543,9 +2543,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'migrationExtended', - `${userTask1FileName}.html` + `${userTask1FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask1FileName}`) @@ -2559,9 +2559,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'migrationExtended', - `${userTask2FileName}.html` + `${userTask2FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask2FileName}`) @@ -2603,7 +2603,7 @@ describe('Test deploying a process', () => { await request .post( - `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1pgsbor` + `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1pgsbor`, ) .send({}); @@ -2721,9 +2721,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'migrationExtended', - `${userTask1FileName}.html` + `${userTask1FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask1FileName}`) @@ -2737,9 +2737,9 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'migrationExtended', - `${userTask2FileName}.html` + `${userTask2FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put(`:${usedEngine.port}/process/${definitionId}/user-tasks/${userTask2FileName}`) @@ -2776,7 +2776,7 @@ describe('Test deploying a process', () => { await request .post( - `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1pgsbor` + `:${usedEngine.port}/tasklist/api/userTask?instanceID=${instanceId}&userTaskID=Activity_1pgsbor`, ) .send({}); @@ -2980,8 +2980,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); // check for instance information @@ -3169,8 +3169,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); // check for instance information @@ -3501,8 +3501,8 @@ describe('Test deploying a process', () => { getInstanceInformation(definitionId, instanceId, engine).then((response) => ({ ...engine, response, - })) - ) + })), + ), ); // check for instance information @@ -3732,7 +3732,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['PAUSED']); @@ -3821,7 +3821,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['ENDED']); @@ -3930,7 +3930,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['PAUSED']); @@ -4007,7 +4007,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['ENDED']); @@ -4114,7 +4114,7 @@ describe('Test deploying a process', () => { const instanceInfo = await getInstanceInformation( definitionId, instanceId, - engineNames[0] + engineNames[0], ); expect(instanceInfo.instanceState).toEqual(['STOPPED']); @@ -4184,13 +4184,13 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'adaptiveProcess', - `${userTask1FileName}.html` + `${userTask1FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put( - `:${usedEngine.port}/process/${calledProcessDefinitionId}/user-tasks/${userTask1FileName}` + `:${usedEngine.port}/process/${calledProcessDefinitionId}/user-tasks/${userTask1FileName}`, ) .send({ html: userTask1, @@ -4202,13 +4202,13 @@ describe('Test deploying a process', () => { __dirname, 'testProcesses', 'adaptiveProcess', - `${userTask2FileName}.html` + `${userTask2FileName}.html`, ), - 'utf-8' + 'utf-8', ); await request .put( - `:${usedEngine.port}/process/${calledProcessDefinitionId}/user-tasks/${userTask2FileName}` + `:${usedEngine.port}/process/${calledProcessDefinitionId}/user-tasks/${userTask2FileName}`, ) .send({ html: userTask2, @@ -4220,11 +4220,11 @@ describe('Test deploying a process', () => { await new Promise((resolve) => setTimeout(() => resolve(), 4000)); let { body: userTasksInformation } = await request.get( - `:${usedEngine.port}/tasklist/api` + `:${usedEngine.port}/tasklist/api`, ); const userTaskInformation = userTasksInformation.find( - (userTask) => userTask.id === 'Activity_1xguu75' + (userTask) => userTask.id === 'Activity_1xguu75', ); // the token in the original instance should hold a reference to the called instance @@ -4235,14 +4235,14 @@ describe('Test deploying a process', () => { const calledInstanceInfo = await getInstanceInformation( calledProcessDefinitionId, userTaskInformation.instanceID, - engineNames[0] + engineNames[0], ); expect(calledInstanceInfo.callingInstance).toBe(instanceId); await request .post( - `:${usedEngine.port}/tasklist/api/userTask?instanceID=${userTaskInformation.instanceID}&userTaskID=${userTaskInformation.id}` + `:${usedEngine.port}/tasklist/api/userTask?instanceID=${userTaskInformation.instanceID}&userTaskID=${userTaskInformation.id}`, ) .send({}); diff --git a/src/engine/e2e_tests/process/deployment/mockNativeMachine.js b/src/engine/e2e_tests/process/deployment/mockNativeMachine.js index 0766a5bb1..8d2e7ee9a 100644 --- a/src/engine/e2e_tests/process/deployment/mockNativeMachine.js +++ b/src/engine/e2e_tests/process/deployment/mockNativeMachine.js @@ -6,7 +6,7 @@ class MockMachine extends Machine { constructor(mockFolderPath) { super(); this.mockMachineInfo = JSON.parse( - fs.readFileSync(path.resolve(mockFolderPath, 'machine.json'), 'utf8') + fs.readFileSync(path.resolve(mockFolderPath, 'machine.json'), 'utf8'), ); } diff --git a/src/engine/e2e_tests/process/deployment/startEngines.js b/src/engine/e2e_tests/process/deployment/startEngines.js index 11bc4c4c8..a7650d134 100644 --- a/src/engine/e2e_tests/process/deployment/startEngines.js +++ b/src/engine/e2e_tests/process/deployment/startEngines.js @@ -31,11 +31,11 @@ function startMockEngineProcess(mockFilesPath) { { cwd: __dirname, detached: false, - } + }, ); const { name, machine } = JSON.parse( - fs.readFileSync(path.resolve(mockFilesPath, 'config.json'), 'utf8') + fs.readFileSync(path.resolve(mockFilesPath, 'config.json'), 'utf8'), ); const { port } = machine; const { id } = JSON.parse(fs.readFileSync(path.resolve(mockFilesPath, 'machine.json'), 'utf8')); @@ -50,7 +50,7 @@ function startMockEngineProcess(mockFilesPath) { checkPromises.push( new Promise((checkResolve) => { externalResolve = checkResolve; - }) + }), ); outputHandlers.push({ regex, resolver: externalResolve }); @@ -134,7 +134,7 @@ async function startMockEngineProcesses(numProcesses) { // see if command line args contain a number and use it as number of requested processes const processCount = parseInt( process.argv.find((arg) => parseInt(arg, 10)), - 10 + 10, ); if (processCount) { startMockEngineProcesses(processCount).catch((err) => console.log(err)); diff --git a/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_09g3sdq.html b/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_09g3sdq.html index 29cb140dc..a1737f2c9 100644 --- a/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_09g3sdq.html +++ b/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_09g3sdq.html @@ -21,7 +21,10 @@ font-weight: 400; font-size: 0.85em; color: rgb(0, 0, 0); - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; } #inmmd { color: black; @@ -39,7 +42,10 @@ padding-left: 10px; } #i4m1 { - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; font-size: 18px; text-shadow: 1px 0 1px #1976d2; } diff --git a/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_0dqts41.html b/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_0dqts41.html index 29cb140dc..a1737f2c9 100644 --- a/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_0dqts41.html +++ b/src/engine/e2e_tests/process/deployment/testProcesses/adaptiveProcess/User_Task_0dqts41.html @@ -21,7 +21,10 @@ font-weight: 400; font-size: 0.85em; color: rgb(0, 0, 0); - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; } #inmmd { color: black; @@ -39,7 +42,10 @@ padding-left: 10px; } #i4m1 { - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; font-size: 18px; text-shadow: 1px 0 1px #1976d2; } diff --git a/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_09g3sdq.html b/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_09g3sdq.html index 29cb140dc..a1737f2c9 100644 --- a/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_09g3sdq.html +++ b/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_09g3sdq.html @@ -21,7 +21,10 @@ font-weight: 400; font-size: 0.85em; color: rgb(0, 0, 0); - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; } #inmmd { color: black; @@ -39,7 +42,10 @@ padding-left: 10px; } #i4m1 { - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; font-size: 18px; text-shadow: 1px 0 1px #1976d2; } diff --git a/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_0dqts41.html b/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_0dqts41.html index 29cb140dc..a1737f2c9 100644 --- a/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_0dqts41.html +++ b/src/engine/e2e_tests/process/deployment/testProcesses/migrationExtended/User_Task_0dqts41.html @@ -21,7 +21,10 @@ font-weight: 400; font-size: 0.85em; color: rgb(0, 0, 0); - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; } #inmmd { color: black; @@ -39,7 +42,10 @@ padding-left: 10px; } #i4m1 { - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; font-size: 18px; text-shadow: 1px 0 1px #1976d2; } diff --git a/src/engine/e2e_tests/process/deployment/testProcesses/migrationInitial/User_Task_09g3sdq.html b/src/engine/e2e_tests/process/deployment/testProcesses/migrationInitial/User_Task_09g3sdq.html index 29cb140dc..a1737f2c9 100644 --- a/src/engine/e2e_tests/process/deployment/testProcesses/migrationInitial/User_Task_09g3sdq.html +++ b/src/engine/e2e_tests/process/deployment/testProcesses/migrationInitial/User_Task_09g3sdq.html @@ -21,7 +21,10 @@ font-weight: 400; font-size: 0.85em; color: rgb(0, 0, 0); - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; } #inmmd { color: black; @@ -39,7 +42,10 @@ padding-left: 10px; } #i4m1 { - font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; + font-family: + Lucida Sans Unicode, + Lucida Grande, + sans-serif; font-size: 18px; text-shadow: 1px 0 1px #1976d2; } diff --git a/src/engine/e2e_tests/process/processEndpoint.e2e.test.js b/src/engine/e2e_tests/process/processEndpoint.e2e.test.js index 35329d1f4..f8ef49843 100644 --- a/src/engine/e2e_tests/process/processEndpoint.e2e.test.js +++ b/src/engine/e2e_tests/process/processEndpoint.e2e.test.js @@ -4,12 +4,12 @@ const request = require('supertest')('localhost:33019'); const bpmn = fs.readFileSync( path.resolve(__dirname, './data/processBPMN/basicUserTaskProcess.xml'), - 'utf8' + 'utf8', ); const bpmnWithImage = fs.readFileSync( path.resolve(__dirname, './data/processBPMN/withImage.xml'), - 'utf8' + 'utf8', ); jest.setTimeout(15000); diff --git a/src/engine/native/android/app/src/main/assets/index.html b/src/engine/native/android/app/src/main/assets/index.html index 93fad9264..1736e2875 100644 --- a/src/engine/native/android/app/src/main/assets/index.html +++ b/src/engine/native/android/app/src/main/assets/index.html @@ -1,4 +1,4 @@ - + @@ -8,7 +8,7 @@ document.addEventListener('visibilitychange', (event) => { if (document.visibilityState === 'hidden') console.log( - '!!! WebView entered state >hidden<, this may casue issues: https://developers.google.com/web/updates/2018/07/page-lifecycle-api' + '!!! WebView entered state >hidden<, this may casue issues: https://developers.google.com/web/updates/2018/07/page-lifecycle-api', ); }); diff --git a/src/engine/native/espruino/modules/engine-lib.js b/src/engine/native/espruino/modules/engine-lib.js index 45e1ae9be..fb7696a3c 100644 --- a/src/engine/native/espruino/modules/engine-lib.js +++ b/src/engine/native/espruino/modules/engine-lib.js @@ -207,7 +207,7 @@ var engine = (function (e) { }, }; f.detectEnvironment(), (e.exports = f); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { var r = n(1), @@ -543,7 +543,7 @@ var engine = (function (e) { } }), t.enable(o()); - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t) { var n = {}.hasOwnProperty; @@ -2356,7 +2356,7 @@ var engine = (function (e) { for (var i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i]; return i; } - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t) { 'function' == typeof Object.create @@ -3363,7 +3363,7 @@ var engine = (function (e) { e ); }); - }.call(this, n(99).setImmediate)); + }).call(this, n(99).setImmediate); }, function (e, t, n) { 'use strict'; @@ -3649,7 +3649,7 @@ var engine = (function (e) { ); }), (t.isBuffer = e.isBuffer); - }.call(this, n(38).Buffer)); + }).call(this, n(38).Buffer); }, function (e, t, n) { var r = n(40), @@ -4405,7 +4405,7 @@ var engine = (function (e) { }, }) : (e.exports = t); - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { var r = n(38), @@ -4483,7 +4483,7 @@ var engine = (function (e) { ('undefined' != typeof self && self.clearImmediate) || (void 0 !== e && e.clearImmediate) || (this && this.clearImmediate)); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { function r(e, t, n, r, i, o, a) { @@ -6204,7 +6204,7 @@ var engine = (function (e) { (g.prototype._destroy = function (e, t) { this.end(), t(e); }); - }.call(this, n(16), n(99).setImmediate, n(11))); + }).call(this, n(16), n(99).setImmediate, n(11)); }, function (e, t, n) { 'use strict'; @@ -7616,7 +7616,7 @@ var engine = (function (e) { (t.overrideMimeType = t.fetch || (!!r() && s(r().overrideMimeType))), (t.vbArray = s(e.VBArray)), (n = null); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { (function (e, r, i) { @@ -7775,7 +7775,7 @@ var engine = (function (e) { } e._xhr.readyState === u.DONE && 'ms-stream' !== e._mode && e.push(null); }); - }.call(this, n(16), n(11), n(38).Buffer)); + }).call(this, n(16), n(11), n(38).Buffer); }, function (e, t, n) { 'use strict'; @@ -8322,7 +8322,7 @@ var engine = (function (e) { }, }), (b._fromList = k); - }.call(this, n(11), n(16))); + }).call(this, n(11), n(16)); }, function (e, t, n) { e.exports = n(55).EventEmitter; @@ -8809,7 +8809,7 @@ var engine = (function (e) { function (e, t) { (function (t) { e.exports = t; - }.call(this, {})); + }).call(this, {}); }, function (e, t, n) { function r(e, t, n, r, i, o, a) { @@ -10785,7 +10785,7 @@ var engine = (function (e) { ? u(t) : ((a = [t]), void 0 === (s = 'function' == typeof (o = u) ? o.apply(t, a) : o) || (i.exports = s)); - }.call(this, n(99).setImmediate, n(16), n(11), n(96)(e))); + }).call(this, n(99).setImmediate, n(16), n(11), n(96)(e)); }, function (e, t, n) { 'use strict'; @@ -10969,7 +10969,7 @@ var engine = (function (e) { (function (e) { (this.variables = this.variables || {}), (this.variables = Object.assign(this.variables, e.context.variables)); - }.call(this, e), + }).call(this, e), this.processes.every(function (e) { return e.isEnded; }) && @@ -10977,7 +10977,7 @@ var engine = (function (e) { l.call(this), (this.started = !1), (this.isEnded = !0), - this.emit('end', this))); + this.emit('end', this)); }), (c.Definition.prototype.onError = function () { var e = Array.prototype.slice.call(arguments); @@ -11084,8 +11084,8 @@ var engine = (function (e) { e.on('end', this._onChildEnd), e.on('leave', this._onChildLeave), this.context.hasAttachedErrorEvent(e.id) || e.on('error', this._onChildError); - }.call(t, n), - n.activate()); + }).call(t, n), + n.activate(); }), t.context.messageFlows.forEach(function (t) { t.on('message', e._onMessage); @@ -11093,7 +11093,7 @@ var engine = (function (e) { t.context.sequenceFlows.forEach(function (e) { (function (e) { e.on('taken', this._onFlowTaken), e.on('discarded', this._onFlowDiscarded); - }.call(t, e)); + }).call(t, e); }); } function s() { @@ -11110,15 +11110,15 @@ var engine = (function (e) { e.removeListener('end', this._onChildEnd), e.removeListener('leave', this._onChildLeave), e.removeListener('error', this._onChildError); - }.call(e, n), - n.deactivate()); + }).call(e, n), + n.deactivate(); }), this.context.sequenceFlows.forEach(function (t) { (function (e) { e.removeListener('taken', this._onFlowTaken), e.removeListener('discarded', this._onFlowDiscarded), e.removeListener('message', this._onMessage); - }.call(e, t)); + }).call(e, t); })); } function u(e, t, n) { @@ -11329,7 +11329,7 @@ var engine = (function (e) { a.call(this, 'discarded', e || this); }), (e.exports = o); - }.call(this, n(99).setImmediate)); + }).call(this, n(99).setImmediate); }, function (e, t, n) { 'use strict'; @@ -11741,7 +11741,7 @@ var engine = (function (e) { .forEach(function (e) { [][e] && r(Array, e, Function.call.bind([][e])); }); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { n(238), @@ -15625,7 +15625,7 @@ var engine = (function (e) { ? self : this, ); - }.call(this, n(11), n(96)(e))); + }).call(this, n(11), n(96)(e)); }, function (e, t, n) { n(436), (e.exports = n(22).RegExp.escape); @@ -15673,7 +15673,7 @@ var engine = (function (e) { IPC: i, }), 'node' === r.environment && void 0 !== t.send && e.exports.init(); - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { function r(e, t) { @@ -16058,7 +16058,7 @@ var engine = (function (e) { ); })(); e.exports = f; - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { function r(e) { @@ -16599,7 +16599,7 @@ var engine = (function (e) { 'UNLOCK', 'UNSUBSCRIBE', ]); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { (function (t, r, i) { @@ -16829,7 +16829,7 @@ var engine = (function (e) { 'upgrade', 'via', ]; - }.call(this, n(38).Buffer, n(11), n(16))); + }).call(this, n(38).Buffer, n(11), n(16)); }, function (e, t, n) { 'use strict'; @@ -17142,7 +17142,7 @@ var engine = (function (e) { } } })('undefined' == typeof self ? (void 0 === e ? this : e) : self); - }.call(this, n(11), n(16))); + }).call(this, n(11), n(16)); }, function (e, t, n) { (function (t) { @@ -17166,7 +17166,7 @@ var engine = (function (e) { return e.apply(this, arguments); }; }; - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { 'use strict'; @@ -17470,7 +17470,7 @@ var engine = (function (e) { else for (f in p) p.hasOwnProperty(f) && (s[f] = p[f]); else a.punycode = p; })(this); - }.call(this, n(96)(e), n(11))); + }).call(this, n(96)(e), n(11)); }, function (e, t, n) { 'use strict'; @@ -20946,7 +20946,7 @@ var engine = (function (e) { } catch (e) {} })()); })('object' == t(e) ? e.exports : (window.whiskers = {})); - }.call(this, n(96)(e))); + }).call(this, n(96)(e)); }, function (e, t, n) { function r(e, t, n, r, i, o, a) { @@ -21612,7 +21612,7 @@ var engine = (function (e) { }, }; e.exports = d; - }.call(this, n(38).Buffer)); + }).call(this, n(38).Buffer); }, function (e, t, n) { function r(e) { @@ -22237,7 +22237,7 @@ var engine = (function (e) { return e.stop(); }); }); - }.call(this, n(16), n(38).Buffer)); + }).call(this, n(16), n(38).Buffer); }, function (e, t, n) { var r; @@ -22606,7 +22606,7 @@ var engine = (function (e) { return o.getActivityErrorEventDefinition(e); }), (e.exports = c); - }.call(this, n(11), '/', n(16))); + }).call(this, n(11), '/', n(16)); }, function (e, t, n) { (function (e) { @@ -22752,7 +22752,7 @@ var engine = (function (e) { : function (e, t, n) { return t < 0 && (t = e.length + t), e.substr(t, n); }; - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { 'use strict'; @@ -26688,7 +26688,7 @@ var engine = (function (e) { }) : (String.fromCodePoint = _)); })(t); - }.call(this, n(38).Buffer)); + }).call(this, n(38).Buffer); }, function (e, t, n) { e.exports = i; diff --git a/src/engine/native/espruino/modules/engine.js b/src/engine/native/espruino/modules/engine.js index 94fa9431f..412f66842 100644 --- a/src/engine/native/espruino/modules/engine.js +++ b/src/engine/native/espruino/modules/engine.js @@ -207,7 +207,7 @@ module.exports = (function (e) { }, }; f.detectEnvironment(), (e.exports = f); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { var r = n(1), @@ -543,7 +543,7 @@ module.exports = (function (e) { } }), t.enable(o()); - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t) { var n = {}.hasOwnProperty; @@ -2356,7 +2356,7 @@ module.exports = (function (e) { for (var i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i]; return i; } - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t) { 'function' == typeof Object.create @@ -3363,7 +3363,7 @@ module.exports = (function (e) { e ); }); - }.call(this, n(99).setImmediate)); + }).call(this, n(99).setImmediate); }, function (e, t, n) { 'use strict'; @@ -3649,7 +3649,7 @@ module.exports = (function (e) { ); }), (t.isBuffer = e.isBuffer); - }.call(this, n(38).Buffer)); + }).call(this, n(38).Buffer); }, function (e, t, n) { var r = n(40), @@ -4405,7 +4405,7 @@ module.exports = (function (e) { }, }) : (e.exports = t); - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { var r = n(38), @@ -4483,7 +4483,7 @@ module.exports = (function (e) { ('undefined' != typeof self && self.clearImmediate) || (void 0 !== e && e.clearImmediate) || (this && this.clearImmediate)); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { function r(e, t, n, r, i, o, a) { @@ -6204,7 +6204,7 @@ module.exports = (function (e) { (g.prototype._destroy = function (e, t) { this.end(), t(e); }); - }.call(this, n(16), n(99).setImmediate, n(11))); + }).call(this, n(16), n(99).setImmediate, n(11)); }, function (e, t, n) { 'use strict'; @@ -7616,7 +7616,7 @@ module.exports = (function (e) { (t.overrideMimeType = t.fetch || (!!r() && s(r().overrideMimeType))), (t.vbArray = s(e.VBArray)), (n = null); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { (function (e, r, i) { @@ -7775,7 +7775,7 @@ module.exports = (function (e) { } e._xhr.readyState === u.DONE && 'ms-stream' !== e._mode && e.push(null); }); - }.call(this, n(16), n(11), n(38).Buffer)); + }).call(this, n(16), n(11), n(38).Buffer); }, function (e, t, n) { 'use strict'; @@ -8322,7 +8322,7 @@ module.exports = (function (e) { }, }), (b._fromList = k); - }.call(this, n(11), n(16))); + }).call(this, n(11), n(16)); }, function (e, t, n) { e.exports = n(55).EventEmitter; @@ -8809,7 +8809,7 @@ module.exports = (function (e) { function (e, t) { (function (t) { e.exports = t; - }.call(this, {})); + }).call(this, {}); }, function (e, t, n) { function r(e, t, n, r, i, o, a) { @@ -10785,7 +10785,7 @@ module.exports = (function (e) { ? u(t) : ((a = [t]), void 0 === (s = 'function' == typeof (o = u) ? o.apply(t, a) : o) || (i.exports = s)); - }.call(this, n(99).setImmediate, n(16), n(11), n(96)(e))); + }).call(this, n(99).setImmediate, n(16), n(11), n(96)(e)); }, function (e, t, n) { 'use strict'; @@ -10969,7 +10969,7 @@ module.exports = (function (e) { (function (e) { (this.variables = this.variables || {}), (this.variables = Object.assign(this.variables, e.context.variables)); - }.call(this, e), + }).call(this, e), this.processes.every(function (e) { return e.isEnded; }) && @@ -10977,7 +10977,7 @@ module.exports = (function (e) { l.call(this), (this.started = !1), (this.isEnded = !0), - this.emit('end', this))); + this.emit('end', this)); }), (c.Definition.prototype.onError = function () { var e = Array.prototype.slice.call(arguments); @@ -11084,8 +11084,8 @@ module.exports = (function (e) { e.on('end', this._onChildEnd), e.on('leave', this._onChildLeave), this.context.hasAttachedErrorEvent(e.id) || e.on('error', this._onChildError); - }.call(t, n), - n.activate()); + }).call(t, n), + n.activate(); }), t.context.messageFlows.forEach(function (t) { t.on('message', e._onMessage); @@ -11093,7 +11093,7 @@ module.exports = (function (e) { t.context.sequenceFlows.forEach(function (e) { (function (e) { e.on('taken', this._onFlowTaken), e.on('discarded', this._onFlowDiscarded); - }.call(t, e)); + }).call(t, e); }); } function s() { @@ -11110,15 +11110,15 @@ module.exports = (function (e) { e.removeListener('end', this._onChildEnd), e.removeListener('leave', this._onChildLeave), e.removeListener('error', this._onChildError); - }.call(e, n), - n.deactivate()); + }).call(e, n), + n.deactivate(); }), this.context.sequenceFlows.forEach(function (t) { (function (e) { e.removeListener('taken', this._onFlowTaken), e.removeListener('discarded', this._onFlowDiscarded), e.removeListener('message', this._onMessage); - }.call(e, t)); + }).call(e, t); })); } function u(e, t, n) { @@ -11329,7 +11329,7 @@ module.exports = (function (e) { a.call(this, 'discarded', e || this); }), (e.exports = o); - }.call(this, n(99).setImmediate)); + }).call(this, n(99).setImmediate); }, function (e, t, n) { 'use strict'; @@ -11741,7 +11741,7 @@ module.exports = (function (e) { .forEach(function (e) { [][e] && r(Array, e, Function.call.bind([][e])); }); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { n(238), @@ -15625,7 +15625,7 @@ module.exports = (function (e) { ? self : this, ); - }.call(this, n(11), n(96)(e))); + }).call(this, n(11), n(96)(e)); }, function (e, t, n) { n(436), (e.exports = n(22).RegExp.escape); @@ -15673,7 +15673,7 @@ module.exports = (function (e) { IPC: i, }), 'node' === r.environment && void 0 !== t.send && e.exports.init(); - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { function r(e, t) { @@ -16058,7 +16058,7 @@ module.exports = (function (e) { ); })(); e.exports = f; - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { function r(e) { @@ -16599,7 +16599,7 @@ module.exports = (function (e) { 'UNLOCK', 'UNSUBSCRIBE', ]); - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { (function (t, r, i) { @@ -16829,7 +16829,7 @@ module.exports = (function (e) { 'upgrade', 'via', ]; - }.call(this, n(38).Buffer, n(11), n(16))); + }).call(this, n(38).Buffer, n(11), n(16)); }, function (e, t, n) { 'use strict'; @@ -17142,7 +17142,7 @@ module.exports = (function (e) { } } })('undefined' == typeof self ? (void 0 === e ? this : e) : self); - }.call(this, n(11), n(16))); + }).call(this, n(11), n(16)); }, function (e, t, n) { (function (t) { @@ -17166,7 +17166,7 @@ module.exports = (function (e) { return e.apply(this, arguments); }; }; - }.call(this, n(11))); + }).call(this, n(11)); }, function (e, t, n) { 'use strict'; @@ -17470,7 +17470,7 @@ module.exports = (function (e) { else for (f in p) p.hasOwnProperty(f) && (s[f] = p[f]); else a.punycode = p; })(this); - }.call(this, n(96)(e), n(11))); + }).call(this, n(96)(e), n(11)); }, function (e, t, n) { 'use strict'; @@ -20946,7 +20946,7 @@ module.exports = (function (e) { } catch (e) {} })()); })('object' == t(e) ? e.exports : (window.whiskers = {})); - }.call(this, n(96)(e))); + }).call(this, n(96)(e)); }, function (e, t, n) { function r(e, t, n, r, i, o, a) { @@ -21612,7 +21612,7 @@ module.exports = (function (e) { }, }; e.exports = d; - }.call(this, n(38).Buffer)); + }).call(this, n(38).Buffer); }, function (e, t, n) { function r(e) { @@ -22237,7 +22237,7 @@ module.exports = (function (e) { return e.stop(); }); }); - }.call(this, n(16), n(38).Buffer)); + }).call(this, n(16), n(38).Buffer); }, function (e, t, n) { var r; @@ -22606,7 +22606,7 @@ module.exports = (function (e) { return o.getActivityErrorEventDefinition(e); }), (e.exports = c); - }.call(this, n(11), '/', n(16))); + }).call(this, n(11), '/', n(16)); }, function (e, t, n) { (function (e) { @@ -22752,7 +22752,7 @@ module.exports = (function (e) { : function (e, t, n) { return t < 0 && (t = e.length + t), e.substr(t, n); }; - }.call(this, n(16))); + }).call(this, n(16)); }, function (e, t, n) { 'use strict'; @@ -26688,7 +26688,7 @@ module.exports = (function (e) { }) : (String.fromCodePoint = _)); })(t); - }.call(this, n(38).Buffer)); + }).call(this, n(38).Buffer); }, function (e, t, n) { e.exports = i; diff --git a/src/engine/native/index.html b/src/engine/native/index.html index 95ac884b3..ff80513cf 100644 --- a/src/engine/native/index.html +++ b/src/engine/native/index.html @@ -1,4 +1,4 @@ - +