mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-11 14:52:54 +01:00
Compare commits
1 Commits
feature/sa
...
fix/base-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0668d0e928 |
14
.github/workflows/build-noodl-editor.yml
vendored
14
.github/workflows/build-noodl-editor.yml
vendored
@@ -1,15 +1,15 @@
|
||||
name: Build fluxscape-editor
|
||||
name: Build noodl-editor
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
# Allows you to run this workflow from another workflow
|
||||
workflow_call:
|
||||
|
||||
# release:
|
||||
# types: [created]
|
||||
|
||||
|
||||
jobs:
|
||||
build_noodl_editor:
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -32,11 +32,11 @@ jobs:
|
||||
platform: linux-x64
|
||||
|
||||
steps:
|
||||
- if: ${{ matrix.platform == 'darwin-arm64' }}
|
||||
- if: ${{ matrix.platform == 'darwin-arm64' }}
|
||||
name: Setup
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -72,6 +72,6 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: fluxscape-editor-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
|
||||
name: noodl-editor-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
|
||||
path: publish
|
||||
retention-days: '12'
|
||||
retention-days: "12"
|
||||
|
||||
2
.github/workflows/test-noodl-editor.yml
vendored
2
.github/workflows/test-noodl-editor.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Test fluxscape-editor
|
||||
name: Test noodl-editor
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
|
||||
301
package-lock.json
generated
301
package-lock.json
generated
@@ -25220,9 +25220,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/electron": {
|
||||
"version": "31.3.1",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-31.3.1.tgz",
|
||||
"integrity": "sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==",
|
||||
"version": "31.1.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-31.1.0.tgz",
|
||||
"integrity": "sha512-TBOwqLxSxnx6+pH6GMri7R3JPH2AkuGJHfWZS0p1HsmN+Qr1T9b0IRJnnehSd/3NZAmAre4ft9Ljec7zjyKFJA==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@electron/get": "^2.0.0",
|
||||
@@ -27211,10 +27211,6 @@
|
||||
"react": "^15.0.2 || ^16.0.0 || ^17.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fluxscape-editor": {
|
||||
"resolved": "packages/noodl-editor",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/focus-lock": {
|
||||
"version": "0.8.1",
|
||||
"dev": true,
|
||||
@@ -35455,6 +35451,10 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/noodl-editor": {
|
||||
"resolved": "packages/noodl-editor",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/nopt": {
|
||||
"version": "1.0.10",
|
||||
"license": "MIT",
|
||||
@@ -48980,8 +48980,7 @@
|
||||
"dev": true
|
||||
},
|
||||
"packages/noodl-editor": {
|
||||
"name": "fluxscape-editor",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
@@ -49039,7 +49038,7 @@
|
||||
"babel-loader": "^8.2.4",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"electron": "31.3.1",
|
||||
"electron": "^31.1.0",
|
||||
"electron-builder": "^24.9.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^3.1.0",
|
||||
@@ -74071,9 +74070,9 @@
|
||||
}
|
||||
},
|
||||
"electron": {
|
||||
"version": "31.3.1",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-31.3.1.tgz",
|
||||
"integrity": "sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==",
|
||||
"version": "31.1.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-31.1.0.tgz",
|
||||
"integrity": "sha512-TBOwqLxSxnx6+pH6GMri7R3JPH2AkuGJHfWZS0p1HsmN+Qr1T9b0IRJnnehSd/3NZAmAre4ft9Ljec7zjyKFJA==",
|
||||
"requires": {
|
||||
"@electron/get": "^2.0.0",
|
||||
"@types/node": "^20.9.0",
|
||||
@@ -75432,144 +75431,6 @@
|
||||
"fbjs": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"fluxscape-editor": {
|
||||
"version": "file:packages/noodl-editor",
|
||||
"requires": {
|
||||
"@babel/core": "^7.19.1",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@noodl/git": "file:../noodl-git",
|
||||
"@noodl/noodl-parse-dashboard": "file:../noodl-parse-dashboard",
|
||||
"@noodl/platform": "file:../noodl-platform",
|
||||
"@noodl/platform-electron": "file:../noodl-platform-electron",
|
||||
"@svgr/webpack": "^6.4.0",
|
||||
"@types/checksum": "^0.1.33",
|
||||
"@types/jasmine": "^4.3.0",
|
||||
"@types/jquery": "^3.5.14",
|
||||
"@types/react": "^17.0.50",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@types/remarkable": "^2.0.3",
|
||||
"@types/rimraf": "^3.0.2",
|
||||
"@types/split2": "^3.2.1",
|
||||
"@types/string.prototype.matchall": "^4.0.1",
|
||||
"@types/underscore": "^1.11.4",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"about-window": "^1.15.2",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"archiver": "^5.3.0",
|
||||
"async": "^3.2.4",
|
||||
"babel-loader": "^8.2.4",
|
||||
"classnames": "^2.3.2",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"diff3": "0.0.4",
|
||||
"dmg-license": "^1.0.11",
|
||||
"electron": "31.3.1",
|
||||
"electron-builder": "^24.9.1",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^6.1.7",
|
||||
"express": "^4.17.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"highlight.js": "^11.5.1",
|
||||
"html-loader": "^3.1.0",
|
||||
"isbinaryfile": "^5.0.0",
|
||||
"md5": "^2.3.0",
|
||||
"md5-file": "^5.0.0",
|
||||
"mixpanel-browser": "^2.45.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"mkdirp-sync": "0.0.2",
|
||||
"monaco-editor": "^0.34.0",
|
||||
"monaco-editor-webpack-plugin": "^7.0.1",
|
||||
"ncp": "^2.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-instantsearch-hooks-web": "^6.38.0",
|
||||
"react-json-view": "^1.21.3",
|
||||
"react-rnd": "^10.3.7",
|
||||
"remarkable": "^2.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"s3": "git+https://github.com/noodlapp/node-s3-client.git",
|
||||
"sass": "^1.55.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"string.prototype.matchall": "^4.0.7",
|
||||
"stringify": "^5.2.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"ts-loader": "^9.4.1",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.8.3",
|
||||
"underscore": "^1.13.6",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1",
|
||||
"webpack-merge": "^5.8.0",
|
||||
"websocket-stream": "^5.5.2",
|
||||
"ws": "^8.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@webpack-cli/configtest": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
|
||||
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"@webpack-cli/info": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz",
|
||||
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"envinfo": "^7.7.3"
|
||||
}
|
||||
},
|
||||
"@webpack-cli/serve": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
|
||||
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true
|
||||
},
|
||||
"rechoir": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
|
||||
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"resolve": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
"version": "4.10.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz",
|
||||
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@discoveryjs/json-ext": "^0.5.0",
|
||||
"@webpack-cli/configtest": "^1.2.0",
|
||||
"@webpack-cli/info": "^1.5.0",
|
||||
"@webpack-cli/serve": "^1.7.0",
|
||||
"colorette": "^2.0.14",
|
||||
"commander": "^7.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fastest-levenshtein": "^1.0.12",
|
||||
"import-local": "^3.0.2",
|
||||
"interpret": "^2.2.0",
|
||||
"rechoir": "^0.7.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"focus-lock": {
|
||||
"version": "0.8.1",
|
||||
"dev": true,
|
||||
@@ -81145,6 +81006,144 @@
|
||||
"version": "2.0.10",
|
||||
"dev": true
|
||||
},
|
||||
"noodl-editor": {
|
||||
"version": "file:packages/noodl-editor",
|
||||
"requires": {
|
||||
"@babel/core": "^7.19.1",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@noodl/git": "file:../noodl-git",
|
||||
"@noodl/noodl-parse-dashboard": "file:../noodl-parse-dashboard",
|
||||
"@noodl/platform": "file:../noodl-platform",
|
||||
"@noodl/platform-electron": "file:../noodl-platform-electron",
|
||||
"@svgr/webpack": "^6.4.0",
|
||||
"@types/checksum": "^0.1.33",
|
||||
"@types/jasmine": "^4.3.0",
|
||||
"@types/jquery": "^3.5.14",
|
||||
"@types/react": "^17.0.50",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@types/remarkable": "^2.0.3",
|
||||
"@types/rimraf": "^3.0.2",
|
||||
"@types/split2": "^3.2.1",
|
||||
"@types/string.prototype.matchall": "^4.0.1",
|
||||
"@types/underscore": "^1.11.4",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"about-window": "^1.15.2",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"archiver": "^5.3.0",
|
||||
"async": "^3.2.4",
|
||||
"babel-loader": "^8.2.4",
|
||||
"classnames": "^2.3.2",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"diff3": "0.0.4",
|
||||
"dmg-license": "^1.0.11",
|
||||
"electron": "^31.1.0",
|
||||
"electron-builder": "^24.9.1",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^6.1.7",
|
||||
"express": "^4.17.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"highlight.js": "^11.5.1",
|
||||
"html-loader": "^3.1.0",
|
||||
"isbinaryfile": "^5.0.0",
|
||||
"md5": "^2.3.0",
|
||||
"md5-file": "^5.0.0",
|
||||
"mixpanel-browser": "^2.45.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"mkdirp-sync": "0.0.2",
|
||||
"monaco-editor": "^0.34.0",
|
||||
"monaco-editor-webpack-plugin": "^7.0.1",
|
||||
"ncp": "^2.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-instantsearch-hooks-web": "^6.38.0",
|
||||
"react-json-view": "^1.21.3",
|
||||
"react-rnd": "^10.3.7",
|
||||
"remarkable": "^2.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"s3": "git+https://github.com/noodlapp/node-s3-client.git",
|
||||
"sass": "^1.55.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"string.prototype.matchall": "^4.0.7",
|
||||
"stringify": "^5.2.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"ts-loader": "^9.4.1",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.8.3",
|
||||
"underscore": "^1.13.6",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1",
|
||||
"webpack-merge": "^5.8.0",
|
||||
"websocket-stream": "^5.5.2",
|
||||
"ws": "^8.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@webpack-cli/configtest": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
|
||||
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"@webpack-cli/info": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz",
|
||||
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"envinfo": "^7.7.3"
|
||||
}
|
||||
},
|
||||
"@webpack-cli/serve": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
|
||||
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true
|
||||
},
|
||||
"rechoir": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
|
||||
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"resolve": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
"version": "4.10.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz",
|
||||
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@discoveryjs/json-ext": "^0.5.0",
|
||||
"@webpack-cli/configtest": "^1.2.0",
|
||||
"@webpack-cli/info": "^1.5.0",
|
||||
"@webpack-cli/serve": "^1.7.0",
|
||||
"colorette": "^2.0.14",
|
||||
"commander": "^7.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fastest-levenshtein": "^1.0.12",
|
||||
"import-local": "^3.0.2",
|
||||
"interpret": "^2.2.0",
|
||||
"rechoir": "^0.7.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "1.0.10",
|
||||
"requires": {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"graph": "npx nx graph",
|
||||
"ci:prepare:editor": "ts-node ./scripts/ci-editor-prepare.ts",
|
||||
"ci:build:viewer": "lerna exec --scope @noodl/noodl-viewer-react -- npm run build",
|
||||
"ci:build:editor": "lerna exec --scope fluxscape-editor -- npm run ci:build",
|
||||
"ci:build:editor": "lerna exec --scope noodl-editor -- npm run ci:build",
|
||||
"build:editor": "ts-node ./scripts/build-editor.ts",
|
||||
"build:editor:_viewer": "ts-node ./scripts/noodl-editor/build-viewer.ts",
|
||||
"build:editor:_editor": "ts-node ./scripts/noodl-editor/build-editor.ts",
|
||||
@@ -20,7 +20,7 @@
|
||||
"build:cloud-runtime": "lerna run build --scope @noodl/cloud-runtime --stream && lerna run build:pack --scope @noodl/cloud-runtime --stream",
|
||||
"start:storybook": "lerna exec --scope @noodl/noodl-core-ui -- npm run start",
|
||||
"start:viewer": "lerna run start --scope @noodl/noodl-viewer-react --stream",
|
||||
"start:editor": "lerna run start --scope fluxscape-editor --stream",
|
||||
"start:editor": "lerna run start --scope noodl-editor --stream",
|
||||
"dev": "ts-node ./scripts/start.ts",
|
||||
"start": "ts-node ./scripts/start.ts -- --build-viewer",
|
||||
"test:editor": "ts-node ./scripts/test-editor.ts",
|
||||
@@ -47,4 +47,4 @@
|
||||
"npm": ">=6.0.0",
|
||||
"node": ">=16.0.0 <=18"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "fluxscape-editor",
|
||||
"name": "noodl-editor",
|
||||
"productName": "Fluxscape",
|
||||
"description": "Node-Based App Builder for Scalability & Rapid Development, a fork of Noodl",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.0",
|
||||
"main": "src/main/main.js",
|
||||
"scripts": {
|
||||
"build": "npx ts-node -P ./tsconfig.build.json ./scripts/build.ts",
|
||||
@@ -114,7 +114,7 @@
|
||||
"babel-loader": "^8.2.4",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"electron": "31.3.1",
|
||||
"electron": "^31.1.0",
|
||||
"electron-builder": "^24.9.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^3.1.0",
|
||||
@@ -141,4 +141,4 @@
|
||||
"optionalDependencies": {
|
||||
"dmg-license": "^1.0.11"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
import React, { createContext, useContext, useState, useEffect } from 'react';
|
||||
|
||||
import { type ComponentModel } from '@noodl-models/componentmodel';
|
||||
import { type NodeGraphNode } from '@noodl-models/nodegraphmodel';
|
||||
import { type NodeLibraryNodeType } from '@noodl-models/nodelibrary';
|
||||
import { type Slot } from '@noodl-core-ui/types/global';
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
import { EventDispatcher } from '../../../../shared/utils/EventDispatcher';
|
||||
|
||||
export type NodeReference = {
|
||||
type: NodeLibraryNodeType | undefined;
|
||||
displayName: string;
|
||||
referenaces: {
|
||||
displayName: string;
|
||||
node?: NodeGraphNode;
|
||||
component: ComponentModel;
|
||||
}[];
|
||||
};
|
||||
|
||||
export interface NodeReferencesContext {
|
||||
nodeReferences: NodeReference[];
|
||||
}
|
||||
|
||||
const NodeReferencesContext = createContext<NodeReferencesContext>({
|
||||
nodeReferences: [],
|
||||
});
|
||||
|
||||
// Since all the editor code is not written in React we need a way to be able to
|
||||
// access this information outside of React too.
|
||||
let HACK_nodeReferences: NodeReference[] = [];
|
||||
export function HACK_findNodeReference(componentName: string): NodeReference | undefined {
|
||||
return HACK_nodeReferences.find(x => x.type?.fullName === componentName);
|
||||
}
|
||||
|
||||
|
||||
export interface NodeReferencesContextProps {
|
||||
children: Slot;
|
||||
}
|
||||
|
||||
export function NodeReferencesContextProvider({ children }: NodeReferencesContextProps) {
|
||||
const [group] = useState({});
|
||||
const [nodeReferences, setNodeReferences] = useState<NodeReference[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
function updateIndex() {
|
||||
const types: { [key: string]: NodeReference['type'] } = {};
|
||||
const references = new Map<string, NodeReference['referenaces']>();
|
||||
|
||||
function handleComponent(component: ComponentModel) {
|
||||
component.forEachNode((node: NodeGraphNode) => {
|
||||
const name = node.type.name;
|
||||
|
||||
// Add the reference
|
||||
references.set(name, [
|
||||
...(references.get(name) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
// Repeater
|
||||
if (name === 'For Each' && node.parameters.template) {
|
||||
const templateComponent = ProjectModel.instance.getComponentWithName(node.parameters.template);
|
||||
|
||||
if (templateComponent) {
|
||||
references.set(templateComponent.fullName, [
|
||||
...(references.get(templateComponent.fullName) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
handleComponent(templateComponent);
|
||||
}
|
||||
}
|
||||
|
||||
// Add some metadata for this node if we dont have it yet.
|
||||
if (!types[name]) {
|
||||
types[name] = node.type;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Loop all the nodes in the project
|
||||
ProjectModel.instance.forEachComponent(handleComponent);
|
||||
|
||||
// Combine the result to look a little better.
|
||||
const results: NodeReference[] = Array.from(references.keys())
|
||||
.map((key) => ({
|
||||
type: types[key],
|
||||
displayName: types[key]?.displayName || key,
|
||||
referenaces: references.get(key)
|
||||
}))
|
||||
.sort((a, b) => b.referenaces.length - a.referenaces.length);
|
||||
|
||||
HACK_nodeReferences = results;
|
||||
setNodeReferences(results);
|
||||
}
|
||||
|
||||
updateIndex();
|
||||
|
||||
EventDispatcher.instance.on(
|
||||
[
|
||||
'Model.nodeAdded',
|
||||
'Model.nodeRemoved',
|
||||
'Model.componentAdded',
|
||||
'Model.componentRemoved',
|
||||
'Model.componentRenamed'
|
||||
],
|
||||
updateIndex,
|
||||
group
|
||||
);
|
||||
|
||||
return function () {
|
||||
EventDispatcher.instance.off(group);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<NodeReferencesContext.Provider
|
||||
value={{
|
||||
nodeReferences,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</NodeReferencesContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useNodeReferencesContext() {
|
||||
const context = useContext(NodeReferencesContext);
|
||||
|
||||
if (context === undefined) {
|
||||
throw new Error('useNodeReferencesContext must be a child of NodeReferencesContextProvider');
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export * from './NodeReferencesContext';
|
||||
@@ -57,13 +57,10 @@ export class CloudFunctionAdapter extends NodeTypeAdapter {
|
||||
|
||||
// Collect all cloud function components
|
||||
const functionRequestNodes = ProjectModel.instance.getNodesWithType('noodl.cloud.request');
|
||||
const functions = functionRequestNodes
|
||||
.map((r) => {
|
||||
const component = r.owner.owner;
|
||||
return component.fullName;
|
||||
})
|
||||
// Remove all the Cloud Trigger functions
|
||||
.filter((x) => !x.startsWith('/#__cloud__/__noodl_cloud_triggers__'));
|
||||
const functions = functionRequestNodes.map((r) => {
|
||||
const component = r.owner.owner;
|
||||
return component.fullName;
|
||||
});
|
||||
|
||||
ports.push({
|
||||
plug: 'input',
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { NodeGraphContextProvider } from '@noodl-contexts/NodeGraphContext/NodeGraphContext';
|
||||
import { NodeReferencesContextProvider } from '@noodl-contexts/NodeReferencesContext';
|
||||
import { PluginContextProvider } from '@noodl-contexts/PluginContext';
|
||||
import { ProjectDesignTokenContextProvider } from '@noodl-contexts/ProjectDesignTokenContext';
|
||||
import { useKeyboardCommands } from '@noodl-hooks/useKeyboardCommands';
|
||||
import { useModel } from '@noodl-hooks/useModel';
|
||||
@@ -45,6 +43,7 @@ import { BaseWindow } from '../../views/windows/BaseWindow';
|
||||
import { whatsnewRender } from '../../whats-new';
|
||||
import { IRouteProps } from '../AppRoute';
|
||||
import { useSetupSettings } from './useSetupSettings';
|
||||
import { PluginContextProvider } from '@noodl-contexts/PluginContext';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const ImportOverwritePopupTemplate = require('../../templates/importoverwritepopup.html');
|
||||
@@ -224,30 +223,28 @@ export function EditorPage({ route }: EditorPageProps) {
|
||||
|
||||
return (
|
||||
<NodeGraphContextProvider>
|
||||
<NodeReferencesContextProvider>
|
||||
<ProjectDesignTokenContextProvider>
|
||||
<PluginContextProvider>
|
||||
<BaseWindow>
|
||||
{isLoading ? (
|
||||
<ActivityIndicator />
|
||||
) : (
|
||||
<>
|
||||
<FrameDivider
|
||||
first={<SidePanel />}
|
||||
second={<ErrorBoundary>{Boolean(Document) && <Document />}</ErrorBoundary>}
|
||||
sizeMin={200}
|
||||
size={frameDividerSize}
|
||||
horizontal
|
||||
onSizeChanged={setFrameDividerSize}
|
||||
/>
|
||||
<ProjectDesignTokenContextProvider>
|
||||
<PluginContextProvider>
|
||||
<BaseWindow>
|
||||
{isLoading ? (
|
||||
<ActivityIndicator />
|
||||
) : (
|
||||
<>
|
||||
<FrameDivider
|
||||
first={<SidePanel />}
|
||||
second={<ErrorBoundary>{Boolean(Document) && <Document />}</ErrorBoundary>}
|
||||
sizeMin={200}
|
||||
size={frameDividerSize}
|
||||
horizontal
|
||||
onSizeChanged={setFrameDividerSize}
|
||||
/>
|
||||
|
||||
{Boolean(lesson) && <Frame instance={lesson} isContentSize isFitWidth />}
|
||||
</>
|
||||
)}
|
||||
</BaseWindow>
|
||||
</PluginContextProvider>
|
||||
</ProjectDesignTokenContextProvider>
|
||||
</NodeReferencesContextProvider>
|
||||
{Boolean(lesson) && <Frame instance={lesson} isContentSize isFitWidth />}
|
||||
</>
|
||||
)}
|
||||
</BaseWindow>
|
||||
</PluginContextProvider>
|
||||
</ProjectDesignTokenContextProvider>
|
||||
</NodeGraphContextProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,14 +67,6 @@ async function _writeFileToFolder({
|
||||
runtimeType
|
||||
}: WriteFileToFolderArgs) {
|
||||
const fullPath = filesystem.join(getExternalFolderPath(), runtimeType, url);
|
||||
|
||||
if (!filesystem.exists(fullPath)) {
|
||||
// TODO: Save this warning somewhere, usually, this is not an issue though.
|
||||
// This occurred because building in dev mode does not create the source map
|
||||
// files which it expects to copy over.
|
||||
return;
|
||||
}
|
||||
|
||||
let content = await filesystem.readFile(fullPath);
|
||||
let filename = url;
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { NodeGraphContextTmp } from '@noodl-contexts/NodeGraphContext/NodeGraphContext';
|
||||
import { type NodeReference, useNodeReferencesContext } from '@noodl-contexts/NodeReferencesContext';
|
||||
import { useFocusRefOnPanelActive } from '@noodl-hooks/useFocusRefOnPanelActive';
|
||||
import { useNodeLibraryLoaded } from '@noodl-hooks/useNodeLibraryLoaded';
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { INodeColorScheme } from '@noodl-types/nodeTypes';
|
||||
import { NodeLibrary } from '@noodl-models/nodelibrary';
|
||||
import { ComponentModel } from '@noodl-models/componentmodel';
|
||||
import { NodeGraphNode } from '@noodl-models/nodegraphmodel';
|
||||
import { NodeLibrary, NodeLibraryNodeType } from '@noodl-models/nodelibrary';
|
||||
import { BasicNodeType } from '@noodl-models/nodelibrary/BasicNodeType';
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
|
||||
import { EditorNode } from '@noodl-core-ui/components/common/EditorNode';
|
||||
import { IconName, IconSize } from '@noodl-core-ui/components/common/Icon';
|
||||
@@ -24,17 +26,113 @@ import { Section, SectionVariant } from '@noodl-core-ui/components/sidebar/Secti
|
||||
import { Label } from '@noodl-core-ui/components/typography/Label';
|
||||
|
||||
import { NodeReferencesPanel_ID } from '.';
|
||||
import { EventDispatcher } from '../../../../../shared/utils/EventDispatcher';
|
||||
|
||||
type ResultItem = {
|
||||
type: NodeLibraryNodeType;
|
||||
displayName: string;
|
||||
referenaces: {
|
||||
displayName: string;
|
||||
node?: NodeGraphNode;
|
||||
component: ComponentModel;
|
||||
}[];
|
||||
};
|
||||
|
||||
function useNodeReferences() {
|
||||
const [group] = useState({});
|
||||
const [result, setResult] = useState<ResultItem[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
function updateIndex() {
|
||||
const types: { [key: string]: ResultItem['type'] } = {};
|
||||
const references = new Map<string, ResultItem['referenaces']>();
|
||||
|
||||
function handleComponent(component: ComponentModel) {
|
||||
component.forEachNode((node: NodeGraphNode) => {
|
||||
const name = node.type.name;
|
||||
|
||||
// Add the reference
|
||||
references.set(name, [
|
||||
...(references.get(name) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
// Repeater
|
||||
if (name === 'For Each' && node.parameters.template) {
|
||||
const templateComponent = ProjectModel.instance.getComponentWithName(node.parameters.template);
|
||||
|
||||
if (templateComponent) {
|
||||
references.set(templateComponent.fullName, [
|
||||
...(references.get(templateComponent.fullName) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
handleComponent(templateComponent);
|
||||
}
|
||||
}
|
||||
|
||||
// Add some metadata for this node if we dont have it yet.
|
||||
if (!types[name]) {
|
||||
types[name] = node.type;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Loop all the nodes in the project
|
||||
ProjectModel.instance.forEachComponent(handleComponent);
|
||||
|
||||
// Combine the result to look a little better.
|
||||
const results: ResultItem[] = Array.from(references.keys())
|
||||
.map((key) => ({
|
||||
type: types[key],
|
||||
displayName: types[key]?.displayName || key,
|
||||
referenaces: references.get(key)
|
||||
}))
|
||||
.sort((a, b) => b.referenaces.length - a.referenaces.length);
|
||||
|
||||
setResult(results);
|
||||
}
|
||||
|
||||
updateIndex();
|
||||
|
||||
EventDispatcher.instance.on(
|
||||
[
|
||||
'Model.nodeAdded',
|
||||
'Model.nodeRemoved',
|
||||
'Model.componentAdded',
|
||||
'Model.componentRemoved',
|
||||
'Model.componentRenamed'
|
||||
],
|
||||
updateIndex,
|
||||
group
|
||||
);
|
||||
|
||||
return function () {
|
||||
EventDispatcher.instance.off(group);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return [result];
|
||||
}
|
||||
|
||||
export function NodeReferencesPanel() {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
const [includeCoreNodes, setIncludeCoreNodes] = useState(false);
|
||||
const inputRef = useRef(null);
|
||||
const { nodeReferences } = useNodeReferencesContext();
|
||||
const [result] = useNodeReferences();
|
||||
const nodeLibraryLoaded = useNodeLibraryLoaded();
|
||||
|
||||
useFocusRefOnPanelActive(inputRef, NodeReferencesPanel_ID);
|
||||
|
||||
function searchFilter(x: NodeReference) {
|
||||
function searchFilter(x: ResultItem) {
|
||||
if (x.displayName.toLowerCase().includes(searchTerm)) {
|
||||
return true;
|
||||
}
|
||||
@@ -46,7 +144,7 @@ export function NodeReferencesPanel() {
|
||||
return false;
|
||||
}
|
||||
|
||||
let filteredResult = nodeReferences.filter(searchFilter);
|
||||
let filteredResult = result.filter(searchFilter);
|
||||
if (!includeCoreNodes) {
|
||||
filteredResult = filteredResult.filter((x) => x.displayName.startsWith('/'));
|
||||
}
|
||||
@@ -87,7 +185,7 @@ export function NodeReferencesPanel() {
|
||||
}
|
||||
|
||||
interface ItemProps {
|
||||
entry: NodeReference;
|
||||
entry: ResultItem;
|
||||
}
|
||||
|
||||
function Item({ entry }: ItemProps) {
|
||||
@@ -147,8 +245,8 @@ function Item({ entry }: ItemProps) {
|
||||
}
|
||||
|
||||
interface ItemReferenceProps {
|
||||
entry: NodeReference;
|
||||
referenace: NodeReference['referenaces'][0];
|
||||
entry: ResultItem;
|
||||
referenace: ResultItem['referenaces'][0];
|
||||
colors: INodeColorScheme;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,11 +17,9 @@ import { EventDispatcher } from '../../../../../shared/utils/EventDispatcher';
|
||||
import View from '../../../../../shared/view';
|
||||
import { NodeGraphEditor } from '../../nodegrapheditor';
|
||||
import * as NewPopupLayer from '../../PopupLayer/index';
|
||||
import { type PopupMenuItem } from '../../PopupLayer/index';
|
||||
import { ToastLayer } from '../../ToastLayer/ToastLayer';
|
||||
import { ComponentsPanelFolder } from './ComponentsPanelFolder';
|
||||
import { ComponentTemplates } from './ComponentTemplates';
|
||||
import { HACK_findNodeReference } from '@noodl-contexts/NodeReferencesContext';
|
||||
|
||||
const PopupLayer = require('@noodl-views/popuplayer');
|
||||
const ComponentsPanelTemplate = require('../../../templates/componentspanel.html');
|
||||
@@ -963,7 +961,7 @@ export class ComponentsPanelView extends View {
|
||||
forRuntimeType: this.getRuntimeType()
|
||||
});
|
||||
|
||||
let items: PopupMenuItem[] = templates.map((t) => ({
|
||||
let items: TSFixme[] = templates.map((t) => ({
|
||||
icon: IconName.Plus,
|
||||
label: t.label,
|
||||
onClick: () => {
|
||||
@@ -989,10 +987,6 @@ export class ComponentsPanelView extends View {
|
||||
});
|
||||
}
|
||||
|
||||
// Find references
|
||||
const nodeReference = HACK_findNodeReference(scope.comp.name);
|
||||
const nodeReferencesText = `Used in ${nodeReference?.referenaces?.length || 0} places`;
|
||||
|
||||
items = items.concat([
|
||||
{
|
||||
icon: IconName.Pencil,
|
||||
@@ -1017,9 +1011,6 @@ export class ComponentsPanelView extends View {
|
||||
_this.onDeleteClicked(scope, el);
|
||||
evt.stopPropagation();
|
||||
}
|
||||
},
|
||||
{
|
||||
label: nodeReferencesText
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -1119,16 +1110,6 @@ export class ComponentsPanelView extends View {
|
||||
}
|
||||
]);
|
||||
|
||||
if (scope.canBecomeRoot) {
|
||||
// Find references
|
||||
const nodeReference = HACK_findNodeReference(scope.folder.component.name);
|
||||
const nodeReferencesText = `Used in ${nodeReference?.referenaces?.length || 0} places`;
|
||||
|
||||
items = items.concat([{
|
||||
label: nodeReferencesText
|
||||
}]);
|
||||
}
|
||||
|
||||
const menu = new NewPopupLayer.PopupMenu({
|
||||
items: items
|
||||
});
|
||||
|
||||
@@ -73,9 +73,8 @@ class CloudStore {
|
||||
xhr.open(options.method || 'GET', this.endpoint + path, true);
|
||||
|
||||
xhr.setRequestHeader('X-Parse-Application-Id', this.appId);
|
||||
if (typeof _noodl_cloudservices !== 'undefined') {
|
||||
if (typeof _noodl_cloudservices !== 'undefined')
|
||||
xhr.setRequestHeader('X-Parse-Master-Key', _noodl_cloudservices.masterKey);
|
||||
}
|
||||
|
||||
// Check for current users
|
||||
var _cu = localStorage['Parse/' + this.appId + '/currentUser'];
|
||||
@@ -192,13 +191,13 @@ class CloudStore {
|
||||
// I don't know which version the API was changed, lets just say above 4 for now.
|
||||
if (this.dbVersionMajor && this.dbVersionMajor > 4) {
|
||||
grouping._id = null;
|
||||
|
||||
|
||||
if (options.where) args.push('$match=' + encodeURIComponent(JSON.stringify(options.where)));
|
||||
|
||||
args.push('$group=' + JSON.stringify(grouping));
|
||||
} else {
|
||||
grouping.objectId = null;
|
||||
|
||||
|
||||
if (options.where) args.push('match=' + encodeURIComponent(JSON.stringify(options.where)));
|
||||
|
||||
args.push('group=' + JSON.stringify(grouping));
|
||||
@@ -258,22 +257,11 @@ class CloudStore {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {{
|
||||
* objectId: string;
|
||||
* collection: string;
|
||||
* include?: string[] | string;
|
||||
* success: (data: unknown) => void;
|
||||
* error: (error: unknown) => void;
|
||||
* }} options
|
||||
*/
|
||||
fetch(options) {
|
||||
const args = [];
|
||||
|
||||
if (options.include) {
|
||||
if (options.include)
|
||||
args.push('include=' + (Array.isArray(options.include) ? options.include.join(',') : options.include));
|
||||
}
|
||||
|
||||
this._makeRequest(
|
||||
'/classes/' + options.collection + '/' + options.objectId + (args.length > 0 ? '?' + args.join('&') : ''),
|
||||
@@ -445,8 +433,6 @@ class CloudStore {
|
||||
* file: {
|
||||
* name: string;
|
||||
* }
|
||||
* success: (data: unknown) => void;
|
||||
* error: (error: unknown) => void;
|
||||
* }} options
|
||||
*/
|
||||
deleteFile(options) {
|
||||
@@ -577,32 +563,21 @@ function _deserializeJSON(data, type, modelScope) {
|
||||
}
|
||||
|
||||
function _fromJSON(item, collectionName, modelScope) {
|
||||
const modelStore = modelScope || Model;
|
||||
const m = (modelScope || Model).get(item.objectId);
|
||||
m._class = collectionName;
|
||||
|
||||
const model = modelStore.get(item.objectId);
|
||||
model._class = collectionName;
|
||||
if (collectionName !== undefined && CloudStore._collections[collectionName] !== undefined)
|
||||
var schema = CloudStore._collections[collectionName].schema;
|
||||
|
||||
let schema = undefined;
|
||||
if (collectionName !== undefined && CloudStore._collections[collectionName] !== undefined) {
|
||||
schema = CloudStore._collections[collectionName].schema;
|
||||
for (var key in item) {
|
||||
if (key === 'objectId' || key === 'ACL') continue;
|
||||
|
||||
var _type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
|
||||
m.set(key, _deserializeJSON(item[key], _type, modelScope));
|
||||
}
|
||||
|
||||
for (const key in item) {
|
||||
if (key === 'objectId' || key === 'ACL') {
|
||||
continue;
|
||||
}
|
||||
|
||||
const _type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
model.set(key, _deserializeJSON(item[key], _type, modelScope));
|
||||
}
|
||||
|
||||
// Add the ACL roles to a global object
|
||||
if (item.objectId && item.ACL) {
|
||||
const aclModel = modelStore.get('--ndl--acl');
|
||||
aclModel.set(item.objectId, item.ACL);
|
||||
}
|
||||
|
||||
return model;
|
||||
return m;
|
||||
}
|
||||
|
||||
CloudStore._fromJSON = _fromJSON;
|
||||
|
||||
@@ -36,15 +36,16 @@ function convertVisualFilter(query, options) {
|
||||
const _res = {};
|
||||
var cond;
|
||||
var value = query.input !== undefined ? inputs[query.input] : query.value;
|
||||
|
||||
|
||||
if (query.operator === 'exist') {
|
||||
_res[query.property] = { $exists: true };
|
||||
return _res;
|
||||
} else if (query.operator === 'not exist') {
|
||||
_res[query.property] = { $exists: false };
|
||||
return _res;
|
||||
_res[query.property] = { $exists: true };
|
||||
return _res;
|
||||
}
|
||||
|
||||
else if (query.operator === 'not exist') {
|
||||
_res[query.property] = { $exists: false };
|
||||
return _res;
|
||||
}
|
||||
|
||||
if (value === undefined) return;
|
||||
|
||||
if (CloudStore._collections[options.collectionName])
|
||||
@@ -79,6 +80,7 @@ function convertVisualFilter(query, options) {
|
||||
cond = { $regex: value, $options: 'i' };
|
||||
}
|
||||
|
||||
|
||||
_res[query.property] = cond;
|
||||
|
||||
return _res;
|
||||
@@ -161,22 +163,10 @@ function _value(v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Record<string, unknown>} filter
|
||||
* @param {{
|
||||
* collectionName?: string;
|
||||
* modelScope?: unknown;
|
||||
* error: (error: string) => void;
|
||||
* }} options
|
||||
* @returns
|
||||
*/
|
||||
function convertFilterOp(filter, options) {
|
||||
const keys = Object.keys(filter);
|
||||
if (keys.length === 0) return {};
|
||||
if (keys.length !== 1) {
|
||||
return options.error('Filter must only have one key found ' + keys.join(','));
|
||||
}
|
||||
if (keys.length !== 1) return options.error('Filter must only have one key found ' + keys.join(','));
|
||||
|
||||
const res = {};
|
||||
const key = keys[0];
|
||||
@@ -189,27 +179,18 @@ function convertFilterOp(filter, options) {
|
||||
} else if (filter['idContainedIn'] !== undefined) {
|
||||
res['objectId'] = { $in: filter['idContainedIn'] };
|
||||
} else if (filter['relatedTo'] !== undefined) {
|
||||
const modelId = filter['relatedTo']['id'];
|
||||
if (modelId === undefined) {
|
||||
return options.error('Must provide id in relatedTo filter');
|
||||
}
|
||||
var modelId = filter['relatedTo']['id'];
|
||||
if (modelId === undefined) return options.error('Must provide id in relatedTo filter');
|
||||
|
||||
const relationKey = filter['relatedTo']['key'];
|
||||
if (relationKey === undefined) {
|
||||
return options.error('Must provide key in relatedTo filter');
|
||||
}
|
||||
|
||||
const className = filter['relatedTo']['className'] || (options.modelScope || Model).get(modelId)?._class;
|
||||
if (typeof className === 'undefined') {
|
||||
// Either the pointer is loaded as an object or we allow passing in the className.
|
||||
return options.error('Must preload the Pointer or include className');
|
||||
}
|
||||
var relationKey = filter['relatedTo']['key'];
|
||||
if (relationKey === undefined) return options.error('Must provide key in relatedTo filter');
|
||||
|
||||
var m = (options.modelScope || Model).get(modelId);
|
||||
res['$relatedTo'] = {
|
||||
object: {
|
||||
__type: 'Pointer',
|
||||
objectId: modelId,
|
||||
className
|
||||
className: m._class
|
||||
},
|
||||
key: relationKey
|
||||
};
|
||||
@@ -227,14 +208,13 @@ function convertFilterOp(filter, options) {
|
||||
else if (opAndValue['containedIn'] !== undefined) res[key] = { $in: opAndValue['containedIn'] };
|
||||
else if (opAndValue['notContainedIn'] !== undefined) res[key] = { $nin: opAndValue['notContainedIn'] };
|
||||
else if (opAndValue['pointsTo'] !== undefined) {
|
||||
let schema = null;
|
||||
if (CloudStore._collections[options.collectionName]) {
|
||||
schema = CloudStore._collections[options.collectionName].schema;
|
||||
}
|
||||
var m = (options.modelScope || Model).get(opAndValue['pointsTo']);
|
||||
if (CloudStore._collections[options.collectionName])
|
||||
var schema = CloudStore._collections[options.collectionName].schema;
|
||||
|
||||
const targetClass =
|
||||
var targetClass =
|
||||
schema && schema.properties && schema.properties[key] ? schema.properties[key].targetClass : undefined;
|
||||
const type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
var type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
|
||||
if (type === 'Relation') {
|
||||
res[key] = {
|
||||
@@ -243,13 +223,13 @@ function convertFilterOp(filter, options) {
|
||||
className: targetClass
|
||||
};
|
||||
} else {
|
||||
if (Array.isArray(opAndValue['pointsTo'])) {
|
||||
if (Array.isArray(opAndValue['pointsTo']))
|
||||
res[key] = {
|
||||
$in: opAndValue['pointsTo'].map((v) => {
|
||||
return { __type: 'Pointer', objectId: v, className: targetClass };
|
||||
})
|
||||
};
|
||||
} else {
|
||||
else
|
||||
res[key] = {
|
||||
$eq: {
|
||||
__type: 'Pointer',
|
||||
@@ -257,7 +237,6 @@ function convertFilterOp(filter, options) {
|
||||
className: targetClass
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
} else if (opAndValue['matchesRegex'] !== undefined) {
|
||||
res[key] = {
|
||||
@@ -278,42 +257,43 @@ function convertFilterOp(filter, options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
// Geo points
|
||||
// Geo points
|
||||
} else if (opAndValue['nearSphere'] !== undefined) {
|
||||
var _v = opAndValue['nearSphere'];
|
||||
res[key] = {
|
||||
$nearSphere: {
|
||||
__type: 'GeoPoint',
|
||||
__type: "GeoPoint",
|
||||
latitude: _v.latitude,
|
||||
longitude: _v.longitude
|
||||
longitude: _v.longitude,
|
||||
},
|
||||
$maxDistanceInMiles: _v.$maxDistanceInMiles,
|
||||
$maxDistanceInKilometers: _v.maxDistanceInKilometers,
|
||||
$maxDistanceInRadians: _v.maxDistanceInRadians
|
||||
$maxDistanceInMiles:_v.$maxDistanceInMiles,
|
||||
$maxDistanceInKilometers:_v.maxDistanceInKilometers,
|
||||
$maxDistanceInRadians:_v.maxDistanceInRadians
|
||||
};
|
||||
} else if (opAndValue['withinBox'] !== undefined) {
|
||||
var _v = opAndValue['withinBox'];
|
||||
res[key] = {
|
||||
$within: {
|
||||
$box: _v.map((gp) => ({
|
||||
__type: 'GeoPoint',
|
||||
latitude: gp.latitude,
|
||||
longitude: gp.longitude
|
||||
$within:{
|
||||
$box: _v.map(gp => ({
|
||||
__type:"GeoPoint",
|
||||
latitude:gp.latitude,
|
||||
longitude:gp.longitude
|
||||
}))
|
||||
}
|
||||
};
|
||||
} else if (opAndValue['withinPolygon'] !== undefined) {
|
||||
var _v = opAndValue['withinPolygon'];
|
||||
res[key] = {
|
||||
$geoWithin: {
|
||||
$polygon: _v.map((gp) => ({
|
||||
__type: 'GeoPoint',
|
||||
latitude: gp.latitude,
|
||||
longitude: gp.longitude
|
||||
$geoWithin:{
|
||||
$polygon: _v.map(gp => ({
|
||||
__type:"GeoPoint",
|
||||
latitude:gp.latitude,
|
||||
longitude:gp.longitude
|
||||
}))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} else {
|
||||
options.error('Unrecognized filter keys ' + keys.join(','));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ function createRecordsAPI(modelScope) {
|
||||
|
||||
return {
|
||||
async query(className, query, options) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
if (typeof className === "undefined") throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().query({
|
||||
collection: className,
|
||||
@@ -27,9 +27,9 @@ function createRecordsAPI(modelScope) {
|
||||
include: options ? options.include : undefined,
|
||||
select: options ? options.select : undefined,
|
||||
count: options ? options.count : undefined,
|
||||
success: (results, count) => {
|
||||
success: (results,count) => {
|
||||
const _results = results.map((r) => cloudstore()._fromJSON(r, className));
|
||||
if (count !== undefined) resolve({ results: _results, count });
|
||||
if(count !== undefined) resolve({results:_results,count});
|
||||
else resolve(_results);
|
||||
},
|
||||
error: (err) => {
|
||||
@@ -40,7 +40,7 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async count(className, query) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
if (typeof className === "undefined") throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().count({
|
||||
collection: className,
|
||||
@@ -62,7 +62,7 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async distinct(className, property, query) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
if (typeof className === "undefined") throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().distinct({
|
||||
collection: className,
|
||||
@@ -85,7 +85,7 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async aggregate(className, group, query) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
if (typeof className === "undefined") throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().aggregate({
|
||||
collection: className,
|
||||
@@ -107,31 +107,20 @@ function createRecordsAPI(modelScope) {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string | { getId(): string; }} objectOrId
|
||||
* @param {{
|
||||
* className: string;
|
||||
* include?: string[] | string;
|
||||
* }} options
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
async fetch(objectOrId, options) {
|
||||
if (typeof objectOrId === 'undefined') return Promise.reject(new Error("'objectOrId' is undefined."));
|
||||
if (typeof objectOrId !== 'string') objectOrId = objectOrId.getId();
|
||||
const className = (options ? options.className : undefined) || (modelScope || Model).get(objectOrId)._class;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!className) {
|
||||
return reject('No class name specified');
|
||||
}
|
||||
if (!className) return reject('No class name specified');
|
||||
|
||||
cloudstore().fetch({
|
||||
collection: className,
|
||||
objectId: objectOrId,
|
||||
include: options ? options.include : undefined,
|
||||
success: function (response) {
|
||||
const record = cloudstore()._fromJSON(response, className);
|
||||
var record = cloudstore()._fromJSON(response, className);
|
||||
resolve(record);
|
||||
},
|
||||
error: function (err) {
|
||||
@@ -197,7 +186,7 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async create(className, properties, options) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
if (typeof className === "undefined") throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().create({
|
||||
collection: className,
|
||||
|
||||
@@ -28,7 +28,6 @@ var DbCollectionNode = {
|
||||
_this.scheduleAfterInputsHaveUpdated(function () {
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
collectionChangedScheduled = false;
|
||||
});
|
||||
};
|
||||
@@ -67,7 +66,6 @@ var DbCollectionNode = {
|
||||
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
}
|
||||
|
||||
if (args.type === 'create') {
|
||||
@@ -93,7 +91,6 @@ var DbCollectionNode = {
|
||||
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
} else if (matchesQuery && !_this._internal.collection.contains(m)) {
|
||||
// It's not part of the result collection but now matches they query, add it and resort
|
||||
_addModelAtCorrectIndex(m);
|
||||
@@ -109,7 +106,6 @@ var DbCollectionNode = {
|
||||
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -157,17 +153,6 @@ var DbCollectionNode = {
|
||||
}
|
||||
}
|
||||
},
|
||||
isEmpty: {
|
||||
type: 'boolean',
|
||||
displayName: 'Is Empty',
|
||||
group: 'General',
|
||||
getter: function () {
|
||||
if (this._internal.collection) {
|
||||
return this._internal.collection.size() === 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
count: {
|
||||
type: 'number',
|
||||
displayName: 'Count',
|
||||
@@ -204,7 +189,6 @@ var DbCollectionNode = {
|
||||
setCollection: function (collection) {
|
||||
this.bindCollection(collection);
|
||||
this.flagOutputDirty('firstItemId');
|
||||
this.flagOutputDirty('isEmpty');
|
||||
this.flagOutputDirty('items');
|
||||
this.flagOutputDirty('count');
|
||||
},
|
||||
@@ -273,7 +257,7 @@ var DbCollectionNode = {
|
||||
limit: limit,
|
||||
skip: skip,
|
||||
count: count,
|
||||
success: (results, count) => {
|
||||
success: (results,count) => {
|
||||
if (results !== undefined) {
|
||||
_c.set(
|
||||
results.map((i) => {
|
||||
@@ -283,9 +267,10 @@ var DbCollectionNode = {
|
||||
})
|
||||
);
|
||||
}
|
||||
if (count !== undefined) {
|
||||
if(count !== undefined) {
|
||||
this._internal.storageSettings.storageTotalCount = count;
|
||||
if (this.hasOutput('storageTotalCount')) this.flagOutputDirty('storageTotalCount');
|
||||
if(this.hasOutput('storageTotalCount'))
|
||||
this.flagOutputDirty('storageTotalCount');
|
||||
}
|
||||
this.setCollection(_c);
|
||||
this.sendSignalOnOutput('fetched');
|
||||
@@ -398,7 +383,7 @@ var DbCollectionNode = {
|
||||
if (!storageSettings['storageEnableLimit']) return;
|
||||
else return storageSettings['storageSkip'] || 0;
|
||||
},
|
||||
getStorageFetchTotalCount: function () {
|
||||
getStorageFetchTotalCount: function() {
|
||||
const storageSettings = this._internal.storageSettings;
|
||||
|
||||
return !!storageSettings['storageEnableCount'];
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('../../../../noodl-runtime');
|
||||
|
||||
const Model = require('../../../model');
|
||||
var Model = require('../../../model');
|
||||
const CloudStore = require('../../../api/cloudstore');
|
||||
|
||||
const ModelNodeDefinition = {
|
||||
var ModelNodeDefinition = {
|
||||
name: 'DbModel2',
|
||||
docs: 'https://docs.noodl.net/nodes/data/cloud-data/record',
|
||||
displayNodeName: 'Record',
|
||||
@@ -21,11 +21,11 @@ const ModelNodeDefinition = {
|
||||
}
|
||||
],
|
||||
initialize: function () {
|
||||
const internal = this._internal;
|
||||
var internal = this._internal;
|
||||
internal.inputValues = {};
|
||||
internal.relationModelIds = {};
|
||||
|
||||
const _this = this;
|
||||
var _this = this;
|
||||
this._internal.onModelChangedCallback = function (args) {
|
||||
if (_this.isInputConnected('fetch')) return;
|
||||
|
||||
@@ -109,18 +109,13 @@ const ModelNodeDefinition = {
|
||||
displayName: 'Id',
|
||||
group: 'General',
|
||||
set: function (value) {
|
||||
if (value instanceof Model) {
|
||||
// Can be passed as model as well
|
||||
value = value.getId();
|
||||
} else if (typeof value === 'object') {
|
||||
// If this is an js object, dereference it
|
||||
value = Model.create(value).getId();
|
||||
}
|
||||
if (value instanceof Model) value = value.getId();
|
||||
// Can be passed as model as well
|
||||
else if (typeof value === 'object') value = Model.create(value).getId(); // If this is an js object, dereference it
|
||||
|
||||
this._internal.modelId = value; // Wait to fetch data
|
||||
if (this.isInputConnected('fetch') === false) {
|
||||
this.setModelID(value);
|
||||
} else {
|
||||
if (this.isInputConnected('fetch') === false) this.setModelID(value);
|
||||
else {
|
||||
this.flagOutputDirty('id');
|
||||
}
|
||||
}
|
||||
@@ -143,10 +138,9 @@ const ModelNodeDefinition = {
|
||||
this.setModel(model);
|
||||
},
|
||||
setModel: function (model) {
|
||||
if (this._internal.model) {
|
||||
if (this._internal.model)
|
||||
// Remove old listener if existing
|
||||
this._internal.model.off('change', this._internal.onModelChangedCallback);
|
||||
}
|
||||
|
||||
this._internal.model = model;
|
||||
this.flagOutputDirty('id');
|
||||
@@ -154,9 +148,7 @@ const ModelNodeDefinition = {
|
||||
|
||||
// We have a new model, mark all outputs as dirty
|
||||
for (var key in model.data) {
|
||||
if (this.hasOutput('prop-' + key)) {
|
||||
this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
if (this.hasOutput('prop-' + key)) this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
this.sendSignalOnOutput('fetched');
|
||||
},
|
||||
@@ -192,7 +184,7 @@ const ModelNodeDefinition = {
|
||||
}
|
||||
},
|
||||
scheduleFetch: function () {
|
||||
const _this = this;
|
||||
var _this = this;
|
||||
const internal = this._internal;
|
||||
|
||||
this.scheduleOnce('Fetch', function () {
|
||||
@@ -207,13 +199,12 @@ const ModelNodeDefinition = {
|
||||
collection: internal.collectionId,
|
||||
objectId: internal.modelId, // Get the objectId part of the model id
|
||||
success: function (response) {
|
||||
const model = cloudstore._fromJSON(response, internal.collectionId);
|
||||
var model = cloudstore._fromJSON(response, internal.collectionId);
|
||||
if (internal.model !== model) {
|
||||
// Check if we need to change model
|
||||
if (internal.model) {
|
||||
if (internal.model)
|
||||
// Remove old listener if existing
|
||||
internal.model.off('change', internal.onModelChangedCallback);
|
||||
}
|
||||
|
||||
internal.model = model;
|
||||
model.on('change', internal.onModelChangedCallback);
|
||||
@@ -222,10 +213,8 @@ const ModelNodeDefinition = {
|
||||
|
||||
delete response.objectId;
|
||||
|
||||
for (const key in response) {
|
||||
if (_this.hasOutput('prop-' + key)) {
|
||||
_this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
for (var key in response) {
|
||||
if (_this.hasOutput('prop-' + key)) _this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
|
||||
_this.sendSignalOnOutput('fetched');
|
||||
@@ -237,6 +226,7 @@ const ModelNodeDefinition = {
|
||||
});
|
||||
},
|
||||
scheduleStore: function () {
|
||||
var _this = this;
|
||||
var internal = this._internal;
|
||||
if (!internal.model) return;
|
||||
|
||||
@@ -257,6 +247,8 @@ const ModelNodeDefinition = {
|
||||
});
|
||||
},
|
||||
registerInputIfNeeded: function (name) {
|
||||
var _this = this;
|
||||
|
||||
if (this.hasInput(name)) {
|
||||
return;
|
||||
}
|
||||
@@ -336,7 +328,8 @@ function updatePorts(nodeId, parameters, editorConnection, graphModel) {
|
||||
var p = props[key];
|
||||
if (ports.find((_p) => _p.name === key)) continue;
|
||||
|
||||
if (p.type !== 'Relation') {
|
||||
if (p.type === 'Relation') {
|
||||
} else {
|
||||
// Other schema type ports
|
||||
const _typeMap = {
|
||||
String: 'string',
|
||||
@@ -380,16 +373,16 @@ module.exports = {
|
||||
function _managePortsForNode(node) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
|
||||
node.on('parameterUpdated', function () {
|
||||
node.on('parameterUpdated', function (event) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
});
|
||||
|
||||
graphModel.on('metadataChanged.dbCollections', function () {
|
||||
graphModel.on('metadataChanged.dbCollections', function (data) {
|
||||
CloudStore.invalidateCollections();
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
});
|
||||
|
||||
graphModel.on('metadataChanged.systemCollections', function () {
|
||||
graphModel.on('metadataChanged.systemCollections', function (data) {
|
||||
CloudStore.invalidateCollections();
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
});
|
||||
|
||||
@@ -31,6 +31,8 @@ const DateToStringNode = {
|
||||
|
||||
this._internal.currentInput = _value;
|
||||
this._format();
|
||||
this.flagOutputDirty('currentValue');
|
||||
this.sendSignalOnOutput('inputChanged');
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -47,45 +49,30 @@ const DateToStringNode = {
|
||||
type: 'signal',
|
||||
displayName: 'Date Changed',
|
||||
group: 'Signals'
|
||||
},
|
||||
onError: {
|
||||
type: 'signal',
|
||||
displayName: 'Invalid Date',
|
||||
group: 'Signals'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_format() {
|
||||
try {
|
||||
const t = this._internal.currentInput;
|
||||
const format = this._internal.formatString;
|
||||
const date = ('0' + t.getDate()).slice(-2);
|
||||
const month = ('0' + (t.getMonth() + 1)).slice(-2);
|
||||
const monthShort = new Intl.DateTimeFormat('en-US', { month: 'short' }).format(t);
|
||||
const year = t.getFullYear();
|
||||
const yearShort = year.toString().substring(2);
|
||||
const hours = ('0' + t.getHours()).slice(-2);
|
||||
const minutes = ('0' + t.getMinutes()).slice(-2);
|
||||
const seconds = ('0' + t.getSeconds()).slice(-2);
|
||||
const t = this._internal.currentInput;
|
||||
const format = this._internal.formatString;
|
||||
const date = ('0' + t.getDate()).slice(-2);
|
||||
const month = ('0' + (t.getMonth() + 1)).slice(-2);
|
||||
const monthShort = new Intl.DateTimeFormat('en-US', { month: 'short' }).format(t);
|
||||
const year = t.getFullYear();
|
||||
const yearShort = year.toString().substring(2);
|
||||
const hours = ('0' + t.getHours()).slice(-2);
|
||||
const minutes = ('0' + t.getMinutes()).slice(-2);
|
||||
const seconds = ('0' + t.getSeconds()).slice(-2);
|
||||
|
||||
this._internal.dateString = format
|
||||
.replace(/\{date\}/g, date)
|
||||
.replace(/\{month\}/g, month)
|
||||
.replace(/\{monthShort\}/g, monthShort)
|
||||
.replace(/\{year\}/g, year)
|
||||
.replace(/\{yearShort\}/g, yearShort)
|
||||
.replace(/\{hours\}/g, hours)
|
||||
.replace(/\{minutes\}/g, minutes)
|
||||
.replace(/\{seconds\}/g, seconds);
|
||||
} catch (error) {
|
||||
// Set the output to be blank, makes it easier to handle.
|
||||
this._internal.dateString = '';
|
||||
this.flagOutputDirty('onError');
|
||||
}
|
||||
|
||||
// Flag that the value have changed
|
||||
this.flagOutputDirty('currentValue');
|
||||
this.sendSignalOnOutput('inputChanged');
|
||||
this._internal.dateString = format
|
||||
.replace(/\{date\}/g, date)
|
||||
.replace(/\{month\}/g, month)
|
||||
.replace(/\{monthShort\}/g, monthShort)
|
||||
.replace(/\{year\}/g, year)
|
||||
.replace(/\{yearShort\}/g, yearShort)
|
||||
.replace(/\{hours\}/g, hours)
|
||||
.replace(/\{minutes\}/g, minutes)
|
||||
.replace(/\{seconds\}/g, seconds);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
//this just assumes the base url is '/' always
|
||||
function getAbsoluteUrl(_url) {
|
||||
|
||||
//convert to string in case the _url is a Cloud File (which is an object with a custom toString())
|
||||
const url = String(_url);
|
||||
|
||||
//only add a the base url if this is a local URL (e.g. not a https url or base64 string)
|
||||
if (!url || url[0] === "/" || url.includes("://") || url.startsWith('data:')) {
|
||||
if (!url || url[0] === '/' || url.includes('://') || url.startsWith('data:')) {
|
||||
return url;
|
||||
}
|
||||
|
||||
return (Noodl.baseUrl || '/') + url;
|
||||
return (Noodl.Env['BaseUrl'] || '/') + url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an error thrown by the JavaScript nodes.
|
||||
*
|
||||
* @param {any} error
|
||||
* @param {any} error
|
||||
*/
|
||||
function logJavaScriptNodeError(error) {
|
||||
if (typeof error === 'string') {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
// Allows to define the output path of the files built by the viewer.
|
||||
//
|
||||
// For example in the CLI, we will also build this, just with a different output path.
|
||||
outPath: process.env.OUT_PATH || path.resolve(__dirname, '../../noodl-editor/src/external'),
|
||||
runtimeVersion: 'cloud-runtime-' + require('../package.json').version.replaceAll('.', '-')
|
||||
};
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
// Allows to define the output path of the files built by the viewer.
|
||||
//
|
||||
// For example in the CLI, we will also build this, just with a different output path.
|
||||
outPath: process.env.OUT_PATH || path.resolve(__dirname, '../../noodl-editor/src/external'),
|
||||
runtimeVersion: 'cloud-runtime-' + require('../package.json').version.replaceAll('.', '-')
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.viewer.common.js');
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.viewer.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'development',
|
||||
devtool: 'inline-source-map',
|
||||
watch: true
|
||||
mode: "development",
|
||||
devtool: "inline-source-map",
|
||||
watch: true,
|
||||
});
|
||||
|
||||
@@ -2,6 +2,5 @@ const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.viewer.common.js');
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map'
|
||||
mode: 'production'
|
||||
});
|
||||
|
||||
@@ -132,7 +132,6 @@ export function Columns(props: ColumnsProps) {
|
||||
className={['columns-container', props.className].join(' ')}
|
||||
ref={containerRef}
|
||||
style={{
|
||||
visibility: containerWidth === null ? "hidden" : "visible",
|
||||
marginTop: parseFloat(props.marginY) * -1,
|
||||
marginLeft: parseFloat(props.marginX) * -1,
|
||||
display: 'flex',
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const { Node } = require('@noodl/runtime');
|
||||
const Model = require('@noodl/runtime/src/model');
|
||||
|
||||
const VariableNodeDefinition = {
|
||||
var Model = require('@noodl/runtime/src/model');
|
||||
|
||||
var VariableNodeDefinition = {
|
||||
name: 'Variable',
|
||||
docs: 'https://docs.noodl.net/nodes/data/variable',
|
||||
category: 'Data',
|
||||
|
||||
@@ -192,7 +192,8 @@ function setup(context, graphModel) {
|
||||
enums: pages.map((p) => ({
|
||||
label: p.label,
|
||||
value: p.id
|
||||
}))
|
||||
})),
|
||||
allowEditOnly: true
|
||||
},
|
||||
group: 'General',
|
||||
displayName: 'Target Page',
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import React from 'react';
|
||||
|
||||
import ASyncQueue from '../../async-queue';
|
||||
import { createNodeFromReactComponent } from '../../react-component-node';
|
||||
|
||||
@@ -77,13 +75,10 @@ const PageStack = {
|
||||
const info = [{ type: 'text', value: 'Active Components:' }];
|
||||
|
||||
return info.concat(
|
||||
this._internal.stack.map((p) => {
|
||||
const pageInfo = this._findPage(p.pageId);
|
||||
return {
|
||||
type: 'text',
|
||||
value: '- ' + pageInfo.label
|
||||
};
|
||||
})
|
||||
this._internal.stack.map((p, i) => ({
|
||||
type: 'text',
|
||||
value: '- ' + this._internal.pages.find((pi) => pi.id === p.pageId).label
|
||||
}))
|
||||
);
|
||||
},
|
||||
defaultCss: {
|
||||
@@ -175,7 +170,6 @@ const PageStack = {
|
||||
topPageName: {
|
||||
type: 'string',
|
||||
displayName: 'Top Component Name',
|
||||
group: 'General',
|
||||
get() {
|
||||
return this._internal.topPageName;
|
||||
}
|
||||
@@ -183,7 +177,6 @@ const PageStack = {
|
||||
stackDepth: {
|
||||
type: 'number',
|
||||
displayName: 'Stack Depth',
|
||||
group: 'General',
|
||||
get() {
|
||||
return this._internal.stackDepth;
|
||||
}
|
||||
@@ -196,31 +189,12 @@ const PageStack = {
|
||||
_deregisterPageStack() {
|
||||
NavigationHandler.instance.deregisterPageStack(this._internal.name, this);
|
||||
},
|
||||
/**
|
||||
* @param {String} pageIdOrLabel
|
||||
*/
|
||||
_findPage(pageIdOrLabel) {
|
||||
if (this._internal.pageInfo[pageIdOrLabel]) {
|
||||
const pageInfo = this._internal.pageInfo[pageIdOrLabel];
|
||||
const pageRef = this._internal.pages.find((x) => x.id === pageIdOrLabel);
|
||||
return {
|
||||
component: String(pageInfo.component),
|
||||
label: String(pageRef.label),
|
||||
id: String(pageIdOrLabel)
|
||||
};
|
||||
}
|
||||
_pageNameForId(id) {
|
||||
if (this._internal.pages === undefined) return;
|
||||
const page = this._internal.pages.find((p) => p.id === id);
|
||||
if (page === undefined) return;
|
||||
|
||||
const pageRef = this._internal.pages.find((x) => x.label === pageIdOrLabel);
|
||||
if (pageRef) {
|
||||
const pageInfo = this._internal.pageInfo[pageRef.id];
|
||||
return {
|
||||
component: String(pageInfo.component),
|
||||
label: String(pageRef.label),
|
||||
id: String(pageRef.id)
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return page.label;
|
||||
},
|
||||
setPageOutputs(outputs) {
|
||||
for (const prop in outputs) {
|
||||
@@ -256,9 +230,8 @@ const PageStack = {
|
||||
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
|
||||
|
||||
let startPageId;
|
||||
let params = {};
|
||||
|
||||
var startPageId,
|
||||
params = {};
|
||||
var pageFromUrl = this.matchPageFromUrl();
|
||||
if (pageFromUrl !== undefined) {
|
||||
// We have an url matching a page, use that page as start page
|
||||
@@ -266,16 +239,13 @@ const PageStack = {
|
||||
|
||||
params = Object.assign({}, pageFromUrl.query, pageFromUrl.params);
|
||||
} else {
|
||||
startPageId = this._internal.startPageId;
|
||||
var startPageId = this._internal.startPageId;
|
||||
if (startPageId === undefined) startPageId = this._internal.pages[0].id;
|
||||
}
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(startPageId);
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) {
|
||||
// No page was found
|
||||
return;
|
||||
}
|
||||
var pageInfo = this._internal.pageInfo[startPageId];
|
||||
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
|
||||
|
||||
var content = await this.nodeScope.createNode(pageInfo.component, guid());
|
||||
|
||||
@@ -299,7 +269,7 @@ const PageStack = {
|
||||
];
|
||||
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(startPageId),
|
||||
stackDepth: this._internal.stack.length
|
||||
});
|
||||
},
|
||||
@@ -488,22 +458,13 @@ const PageStack = {
|
||||
this._internal.asyncQueue.enqueue(this.replaceAsync.bind(this, args));
|
||||
},
|
||||
async replaceAsync(args) {
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
|
||||
|
||||
if (this._internal.isTransitioning) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.isTransitioning) return;
|
||||
|
||||
const pageId = args.target || this._internal.pages[0].id;
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(pageId);
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) {
|
||||
// No page was found
|
||||
return;
|
||||
}
|
||||
var pageId = args.target || this._internal.pages[0].id;
|
||||
var pageInfo = this._internal.pageInfo[pageId];
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
|
||||
|
||||
// Remove all current pages in the stack
|
||||
var children = this.getChildren();
|
||||
@@ -537,7 +498,7 @@ const PageStack = {
|
||||
];
|
||||
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(pageId),
|
||||
stackDepth: this._internal.stack.length
|
||||
});
|
||||
|
||||
@@ -549,22 +510,13 @@ const PageStack = {
|
||||
this._internal.asyncQueue.enqueue(this.navigateAsync.bind(this, args));
|
||||
},
|
||||
async navigateAsync(args) {
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
|
||||
|
||||
if (this._internal.isTransitioning) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.isTransitioning) return;
|
||||
|
||||
const pageId = args.target || this._internal.pages[0].id;
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(pageId);
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) {
|
||||
// No page was found
|
||||
return;
|
||||
}
|
||||
var pageId = args.target || this._internal.pages[0].id;
|
||||
var pageInfo = this._internal.pageInfo[pageId];
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
|
||||
|
||||
// Create the container group
|
||||
const group = this.createPageContainer();
|
||||
@@ -578,7 +530,7 @@ const PageStack = {
|
||||
group.addChild(content);
|
||||
|
||||
// Connect navigate back nodes
|
||||
const navigateBackNodes = content.nodeScope.getNodesWithType('PageStackNavigateBack');
|
||||
var navigateBackNodes = content.nodeScope.getNodesWithType('PageStackNavigateBack');
|
||||
if (navigateBackNodes && navigateBackNodes.length > 0) {
|
||||
for (var j = 0; j < navigateBackNodes.length; j++) {
|
||||
navigateBackNodes[j]._setBackCallback(this.back.bind(this));
|
||||
@@ -586,8 +538,8 @@ const PageStack = {
|
||||
}
|
||||
|
||||
// Push the new top
|
||||
const top = this._internal.stack[this._internal.stack.length - 1];
|
||||
const newTop = {
|
||||
var top = this._internal.stack[this._internal.stack.length - 1];
|
||||
var newTop = {
|
||||
from: top.page,
|
||||
page: group,
|
||||
pageInfo: pageInfo,
|
||||
@@ -599,7 +551,7 @@ const PageStack = {
|
||||
};
|
||||
this._internal.stack.push(newTop);
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(args.target),
|
||||
stackDepth: this._internal.stack.length
|
||||
});
|
||||
this._updateUrlWithTopPage();
|
||||
@@ -632,11 +584,8 @@ const PageStack = {
|
||||
this.addChild(top.from, 0);
|
||||
top.backCallback && top.backCallback(args.backAction, args.results);
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(this._internal.stack[this._internal.stack.length - 2].pageId);
|
||||
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(this._internal.stack[this._internal.stack.length - 2].pageId),
|
||||
stackDepth: this._internal.stack.length - 1
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
const { Node } = require('@noodl/runtime');
|
||||
|
||||
const Collection = require('@noodl/runtime/src/collection');
|
||||
var Model = require('@noodl/runtime/src/model'),
|
||||
Collection = require('@noodl/runtime/src/collection');
|
||||
|
||||
var CollectionNode = {
|
||||
name: 'Collection2',
|
||||
@@ -26,7 +27,6 @@ var CollectionNode = {
|
||||
|
||||
_this.scheduleAfterInputsHaveUpdated(function () {
|
||||
_this.sendSignalOnOutput('changed');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('count');
|
||||
collectionChangedScheduled = false;
|
||||
});
|
||||
@@ -117,17 +117,6 @@ var CollectionNode = {
|
||||
return this._internal.collection;
|
||||
}
|
||||
},
|
||||
firstItemId: {
|
||||
type: 'string',
|
||||
displayName: 'First Item Id',
|
||||
group: 'General',
|
||||
getter: function () {
|
||||
if (this._internal.collection) {
|
||||
var firstItem = this._internal.collection.get(0);
|
||||
if (firstItem !== undefined) return firstItem.getId();
|
||||
}
|
||||
}
|
||||
},
|
||||
count: {
|
||||
type: 'number',
|
||||
displayName: 'Count',
|
||||
@@ -161,7 +150,6 @@ var CollectionNode = {
|
||||
collection.on('change', this._internal.collectionChangedCallback);
|
||||
|
||||
this.flagOutputDirty('items');
|
||||
this.flagOutputDirty('firstItemId');
|
||||
this.flagOutputDirty('count');
|
||||
},
|
||||
setSourceCollection: function (collection) {
|
||||
|
||||
@@ -43,10 +43,6 @@ const OpenFilePicker = {
|
||||
|
||||
input.accept = this._internal.acceptedFileTypes;
|
||||
|
||||
if (this._internal.capture) {
|
||||
input.capture = this._internal.capture;
|
||||
}
|
||||
|
||||
input.onchange = onChange;
|
||||
input.click();
|
||||
}
|
||||
@@ -58,14 +54,6 @@ const OpenFilePicker = {
|
||||
set(value) {
|
||||
this._internal.acceptedFileTypes = value;
|
||||
}
|
||||
},
|
||||
capture: {
|
||||
group: 'General',
|
||||
type: 'string',
|
||||
displayName: 'Capture',
|
||||
set(value) {
|
||||
this._internal.capture = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
outputs: {
|
||||
|
||||
@@ -4,7 +4,7 @@ const Switch = {
|
||||
name: 'Switch',
|
||||
docs: 'https://docs.noodl.net/nodes/logic/switch',
|
||||
category: 'Logic',
|
||||
initialize() {
|
||||
initialize: function () {
|
||||
this._internal.state = false;
|
||||
this._internal.initialized = false;
|
||||
},
|
||||
@@ -15,7 +15,7 @@ const Switch = {
|
||||
on: {
|
||||
displayName: 'On',
|
||||
group: 'Change State',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
if (this._internal.state === true) {
|
||||
return;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ const Switch = {
|
||||
off: {
|
||||
displayName: 'Off',
|
||||
group: 'Change State',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
if (this._internal.state === false) {
|
||||
return;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ const Switch = {
|
||||
flip: {
|
||||
displayName: 'Flip',
|
||||
group: 'Change State',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this._internal.state = !this._internal.state;
|
||||
this.flagOutputDirty('state');
|
||||
this.emitSignals();
|
||||
@@ -50,7 +50,7 @@ const Switch = {
|
||||
displayName: 'State',
|
||||
group: 'General',
|
||||
default: false,
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.state = !!value;
|
||||
this.flagOutputDirty('state');
|
||||
this.emitSignals();
|
||||
@@ -61,15 +61,10 @@ const Switch = {
|
||||
state: {
|
||||
type: 'boolean',
|
||||
displayName: 'Current State',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.state;
|
||||
}
|
||||
},
|
||||
switched: {
|
||||
displayName: 'Switched',
|
||||
type: 'signal',
|
||||
group: 'Signals'
|
||||
},
|
||||
switchedToOn: {
|
||||
displayName: 'Switched To On',
|
||||
type: 'signal',
|
||||
@@ -82,13 +77,12 @@ const Switch = {
|
||||
}
|
||||
},
|
||||
prototypeExtensions: {
|
||||
emitSignals() {
|
||||
emitSignals: function () {
|
||||
if (this._internal.state === true) {
|
||||
this.sendSignalOnOutput('switchedToOn');
|
||||
} else {
|
||||
this.sendSignalOnOutput('switchedToOff');
|
||||
}
|
||||
this.sendSignalOnOutput('switched');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
|
||||
const UserService = require('./userservice');
|
||||
|
||||
const LoginNodeDefinition = {
|
||||
var LoginNodeDefinition = {
|
||||
name: 'net.noodl.user.LogIn',
|
||||
docs: 'https://docs.noodl.net/nodes/data/user/log-in',
|
||||
displayNodeName: 'Log In',
|
||||
category: 'Cloud Services',
|
||||
color: 'data',
|
||||
initialize: function () {
|
||||
var internal = this._internal;
|
||||
},
|
||||
getInspectInfo() {},
|
||||
outputs: {
|
||||
success: {
|
||||
type: 'signal',
|
||||
@@ -23,7 +28,7 @@ const LoginNodeDefinition = {
|
||||
type: 'string',
|
||||
displayName: 'Error',
|
||||
group: 'Error',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.error;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +37,7 @@ const LoginNodeDefinition = {
|
||||
login: {
|
||||
displayName: 'Do',
|
||||
group: 'Actions',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this.scheduleLogIn();
|
||||
}
|
||||
},
|
||||
@@ -40,7 +45,7 @@ const LoginNodeDefinition = {
|
||||
displayName: 'Username',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.username = value;
|
||||
}
|
||||
},
|
||||
@@ -48,13 +53,13 @@ const LoginNodeDefinition = {
|
||||
displayName: 'Password',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.password = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setError(err) {
|
||||
setError: function (err) {
|
||||
this._internal.error = err;
|
||||
this.flagOutputDirty('error');
|
||||
this.sendSignalOnOutput('failure');
|
||||
@@ -71,7 +76,9 @@ const LoginNodeDefinition = {
|
||||
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
|
||||
}
|
||||
},
|
||||
scheduleLogIn() {
|
||||
scheduleLogIn: function () {
|
||||
const internal = this._internal;
|
||||
|
||||
if (this.logInScheduled === true) return;
|
||||
this.logInScheduled = true;
|
||||
|
||||
@@ -93,7 +100,89 @@ const LoginNodeDefinition = {
|
||||
}
|
||||
};
|
||||
|
||||
/*function updatePorts(nodeId, parameters, editorConnection, dbCollections) {
|
||||
var ports = [];
|
||||
|
||||
ports.push({
|
||||
name: 'collectionName',
|
||||
displayName: "Class",
|
||||
group: "General",
|
||||
type: { name: 'enum', enums: (dbCollections !== undefined) ? dbCollections.map((c) => { return { value: c.name, label: c.name } }) : [], allowEditOnly: true },
|
||||
plug: 'input'
|
||||
})
|
||||
|
||||
if (parameters.collectionName && dbCollections) {
|
||||
// Fetch ports from collection keys
|
||||
var c = dbCollections.find((c) => c.name === parameters.collectionName);
|
||||
if (c && c.schema && c.schema.properties) {
|
||||
var props = c.schema.properties;
|
||||
for (var key in props) {
|
||||
var p = props[key];
|
||||
if (ports.find((_p) => _p.name === key)) continue;
|
||||
|
||||
if(p.type === 'Relation') {
|
||||
|
||||
}
|
||||
else { // Other schema type ports
|
||||
const _typeMap = {
|
||||
"String":"string",
|
||||
"Boolean":"boolean",
|
||||
"Number":"number",
|
||||
"Date":"date"
|
||||
}
|
||||
|
||||
ports.push({
|
||||
type: {
|
||||
name: _typeMap[p.type]?_typeMap[p.type]:'*',
|
||||
},
|
||||
plug: 'output',
|
||||
group: 'Properties',
|
||||
name: 'prop-' + key,
|
||||
displayName: key,
|
||||
})
|
||||
|
||||
ports.push({
|
||||
type: 'signal',
|
||||
plug: 'output',
|
||||
group: 'Changed Events',
|
||||
displayName: key+ ' Changed',
|
||||
name: 'changed-' + key,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editorConnection.sendDynamicPorts(nodeId, ports);
|
||||
}*/
|
||||
|
||||
module.exports = {
|
||||
node: LoginNodeDefinition,
|
||||
setup(_context, _graphModel) {}
|
||||
setup: function (context, graphModel) {
|
||||
/* if (!context.editorConnection || !context.editorConnection.isRunningLocally()) {
|
||||
return;
|
||||
}
|
||||
|
||||
function _managePortsForNode(node) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('dbCollections'));
|
||||
|
||||
node.on("parameterUpdated", function (event) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('dbCollections'));
|
||||
});
|
||||
|
||||
graphModel.on('metadataChanged.dbCollections', function (data) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, data);
|
||||
})
|
||||
}
|
||||
|
||||
graphModel.on("editorImportComplete", ()=> {
|
||||
graphModel.on("nodeAdded.DbModel2", function (node) {
|
||||
_managePortsForNode(node)
|
||||
})
|
||||
|
||||
for(const node of graphModel.getNodesWithType('DbModel2')) {
|
||||
_managePortsForNode(node)
|
||||
}
|
||||
})*/
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
|
||||
const UserService = require('./userservice');
|
||||
|
||||
const LogOutNodeDefinition = {
|
||||
var LogOutNodeDefinition = {
|
||||
name: 'net.noodl.user.LogOut',
|
||||
docs: 'https://docs.noodl.net/nodes/data/user/log-out',
|
||||
displayNodeName: 'Log Out',
|
||||
category: 'Cloud Services',
|
||||
color: 'data',
|
||||
initialize: function () {
|
||||
var internal = this._internal;
|
||||
},
|
||||
getInspectInfo() {},
|
||||
outputs: {
|
||||
success: {
|
||||
type: 'signal',
|
||||
@@ -23,7 +28,7 @@ const LogOutNodeDefinition = {
|
||||
type: 'string',
|
||||
displayName: 'Error',
|
||||
group: 'Error',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.error;
|
||||
}
|
||||
}
|
||||
@@ -32,13 +37,13 @@ const LogOutNodeDefinition = {
|
||||
login: {
|
||||
displayName: 'Do',
|
||||
group: 'Actions',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this.scheduleLogOut();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setError(err) {
|
||||
setError: function (err) {
|
||||
this._internal.error = err;
|
||||
this.flagOutputDirty('error');
|
||||
this.sendSignalOnOutput('failure');
|
||||
@@ -55,7 +60,9 @@ const LogOutNodeDefinition = {
|
||||
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
|
||||
}
|
||||
},
|
||||
scheduleLogOut() {
|
||||
scheduleLogOut: function () {
|
||||
const internal = this._internal;
|
||||
|
||||
if (this.logOutScheduled === true) return;
|
||||
this.logOutScheduled = true;
|
||||
|
||||
@@ -77,5 +84,5 @@ const LogOutNodeDefinition = {
|
||||
|
||||
module.exports = {
|
||||
node: LogOutNodeDefinition,
|
||||
setup(_context, _graphModel) {}
|
||||
setup: function (context, graphModel) {}
|
||||
};
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
|
||||
const UserService = require('./userservice');
|
||||
|
||||
const SignUpNodeDefinition = {
|
||||
var SignUpNodeDefinition = {
|
||||
name: 'net.noodl.user.SignUp',
|
||||
docs: 'https://docs.noodl.net/nodes/data/user/sign-up',
|
||||
displayNodeName: 'Sign Up',
|
||||
category: 'Cloud Services',
|
||||
color: 'data',
|
||||
initialize() {
|
||||
const internal = this._internal;
|
||||
initialize: function () {
|
||||
var internal = this._internal;
|
||||
|
||||
internal.userProperties = {};
|
||||
},
|
||||
getInspectInfo() {},
|
||||
outputs: {
|
||||
success: {
|
||||
type: 'signal',
|
||||
@@ -27,7 +30,7 @@ const SignUpNodeDefinition = {
|
||||
type: 'string',
|
||||
displayName: 'Error',
|
||||
group: 'Error',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.error;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +39,7 @@ const SignUpNodeDefinition = {
|
||||
signup: {
|
||||
displayName: 'Do',
|
||||
group: 'Actions',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this.scheduleSignUp();
|
||||
}
|
||||
},
|
||||
@@ -44,7 +47,7 @@ const SignUpNodeDefinition = {
|
||||
displayName: 'Username',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.username = value;
|
||||
}
|
||||
},
|
||||
@@ -52,7 +55,7 @@ const SignUpNodeDefinition = {
|
||||
displayName: 'Password',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.password = value;
|
||||
}
|
||||
},
|
||||
@@ -60,13 +63,13 @@ const SignUpNodeDefinition = {
|
||||
displayName: 'Email',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.email = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setError(err) {
|
||||
setError: function (err) {
|
||||
this._internal.error = err;
|
||||
this.flagOutputDirty('error');
|
||||
this.sendSignalOnOutput('failure');
|
||||
@@ -83,7 +86,7 @@ const SignUpNodeDefinition = {
|
||||
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
|
||||
}
|
||||
},
|
||||
scheduleSignUp() {
|
||||
scheduleSignUp: function () {
|
||||
const internal = this._internal;
|
||||
|
||||
if (this.signUpScheduled === true) return;
|
||||
@@ -106,24 +109,23 @@ const SignUpNodeDefinition = {
|
||||
});
|
||||
});
|
||||
},
|
||||
setUserProperty(name, value) {
|
||||
setUserProperty: function (name, value) {
|
||||
this._internal.userProperties[name] = value;
|
||||
},
|
||||
registerInputIfNeeded(name) {
|
||||
registerInputIfNeeded: function (name) {
|
||||
if (this.hasInput(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.startsWith('prop-')) {
|
||||
if (name.startsWith('prop-'))
|
||||
return this.registerInput(name, {
|
||||
set: this.setUserProperty.bind(this, name.substring('prop-'.length))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function updatePorts(nodeId, _parameters, editorConnection, systemCollections) {
|
||||
function updatePorts(nodeId, parameters, editorConnection, systemCollections) {
|
||||
var ports = [];
|
||||
|
||||
if (systemCollections) {
|
||||
@@ -167,7 +169,7 @@ function updatePorts(nodeId, _parameters, editorConnection, systemCollections) {
|
||||
|
||||
module.exports = {
|
||||
node: SignUpNodeDefinition,
|
||||
setup(context, graphModel) {
|
||||
setup: function (context, graphModel) {
|
||||
if (!context.editorConnection || !context.editorConnection.isRunningLocally()) {
|
||||
return;
|
||||
}
|
||||
@@ -175,7 +177,7 @@ module.exports = {
|
||||
function _managePortsForNode(node) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections'));
|
||||
|
||||
node.on('parameterUpdated', function (_event) {
|
||||
node.on('parameterUpdated', function (event) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections'));
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
{"url":"noodl-app.png"},
|
||||
{"url":"load_terminator.js"},
|
||||
{"url":"noodl.deploy.js"},
|
||||
{"url":"noodl.deploy.js.map"},
|
||||
{"url":"react.production.min.js"},
|
||||
{"url":"react-dom.production.min.js"}
|
||||
]
|
||||
]
|
||||
@@ -482,12 +482,7 @@ declare namespace Noodl {
|
||||
const Records: RecordsApi;
|
||||
|
||||
interface CurrentUserObject {
|
||||
id: string;
|
||||
email: string;
|
||||
emailVerified: boolean;
|
||||
username: string;
|
||||
|
||||
Properties: unknown;
|
||||
UserId: string;
|
||||
|
||||
/**
|
||||
* Log out the current user and terminate the session.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
// Allows to define the output path of the files built by the viewer.
|
||||
//
|
||||
// For example in the CLI, we will also build this, just with a different output path.
|
||||
outPath: process.env.OUT_PATH || path.resolve(__dirname, '../../noodl-editor/src/external')
|
||||
};
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
// Allows to define the output path of the files built by the viewer.
|
||||
//
|
||||
// For example in the CLI, we will also build this, just with a different output path.
|
||||
outPath:
|
||||
process.env.OUT_PATH ||
|
||||
path.resolve(__dirname, "../../noodl-editor/src/external"),
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = {
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.jsx', '.js'],
|
||||
fallback: {
|
||||
events: require.resolve('events/')
|
||||
events: require.resolve('events/'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.deploy.common.js');
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.deploy.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'development',
|
||||
devtool: 'inline-source-map',
|
||||
watch: true
|
||||
mode: "development",
|
||||
devtool: "inline-source-map",
|
||||
watch: true,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.deploy.common.js');
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.deploy.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map'
|
||||
mode: "production",
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ module.exports = {
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.jsx', '.js'],
|
||||
fallback: {
|
||||
events: require.resolve('events/')
|
||||
events: require.resolve('events/'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
|
||||
@@ -2,6 +2,5 @@ const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.ssr.common.js');
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map'
|
||||
mode: 'production'
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.viewer.common.js');
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.viewer.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'development',
|
||||
devtool: 'inline-source-map',
|
||||
watch: true
|
||||
mode: "development",
|
||||
devtool: "inline-source-map",
|
||||
watch: true,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.viewer.common.js');
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.viewer.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map'
|
||||
mode: "production",
|
||||
});
|
||||
|
||||
@@ -72,18 +72,18 @@ import { getCurrentPlatform } from '../helper';
|
||||
// NOTE: Getting error "Cannot set properties of null (setting 'dev')" here,
|
||||
// It basically means that some package is not relative to this path.
|
||||
console.log("--- Run 'npm install' ...");
|
||||
|
||||
if (platform === 'darwin') {
|
||||
|
||||
if (platform === "darwin") {
|
||||
execSync(`npm install electron-notarize`, {
|
||||
stdio: 'inherit',
|
||||
env: process.env
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
execSync(`npm install --arch=${arch} --scope fluxscape-editor`, {
|
||||
execSync(`npm install --arch=${arch} --scope noodl-editor`, {
|
||||
stdio: 'inherit',
|
||||
env: process.env
|
||||
});
|
||||
})
|
||||
console.log("--- 'npm install' done!");
|
||||
|
||||
// NOTE: npm install --arch= does this too
|
||||
@@ -99,13 +99,13 @@ import { getCurrentPlatform } from '../helper';
|
||||
// Build: Replace "dugite"
|
||||
// Build: Replace "desktop-trampoline"
|
||||
console.log("--- Run 'npm run build' ...");
|
||||
execSync('npx lerna exec --scope fluxscape-editor -- npm run build', {
|
||||
execSync('npx lerna exec --scope noodl-editor -- npm run build', {
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
...process.env,
|
||||
TARGET_PLATFORM,
|
||||
DISABLE_SIGNING,
|
||||
CSC_NAME
|
||||
CSC_NAME,
|
||||
}
|
||||
});
|
||||
console.log("--- 'npm run build' done!");
|
||||
|
||||
@@ -74,7 +74,7 @@ const cloudRuntimeProcess = attachStdio(
|
||||
}
|
||||
);
|
||||
|
||||
const editorProcess = attachStdio(exec('npx lerna exec --scope fluxscape-editor -- npm run start', processOptions), {
|
||||
const editorProcess = attachStdio(exec('npx lerna exec --scope noodl-editor -- npm run start', processOptions), {
|
||||
prefix: 'Editor',
|
||||
color: ConsoleColor.FgCyan
|
||||
});
|
||||
|
||||
@@ -1,27 +1,36 @@
|
||||
import { execSync } from 'child_process';
|
||||
import path from 'path';
|
||||
import path from "path";
|
||||
import { execSync } from "child_process";
|
||||
|
||||
const CWD = path.join(__dirname, '..');
|
||||
const LOCAL_GIT_DIRECTORY = path.join(__dirname, '..', 'node_modules', 'dugite', 'git');
|
||||
const CWD = path.join(__dirname, "..");
|
||||
const LOCAL_GIT_DIRECTORY = path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
"node_modules",
|
||||
"dugite",
|
||||
"git"
|
||||
);
|
||||
const LOCAL_GIT_TRAMPOLINE_DIRECTORY = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'node_modules',
|
||||
'desktop-trampoline/build/Release/desktop-trampoline'
|
||||
"..",
|
||||
"node_modules",
|
||||
"desktop-trampoline/build/Release/desktop-trampoline"
|
||||
);
|
||||
|
||||
console.log('---');
|
||||
console.log("---");
|
||||
console.log(`> CWD: `, CWD);
|
||||
console.log(`> LOCAL_GIT_DIRECTORY: `, LOCAL_GIT_DIRECTORY);
|
||||
console.log(`> LOCAL_GIT_TRAMPOLINE_DIRECTORY: `, LOCAL_GIT_TRAMPOLINE_DIRECTORY);
|
||||
console.log('---');
|
||||
console.log(
|
||||
`> LOCAL_GIT_TRAMPOLINE_DIRECTORY: `,
|
||||
LOCAL_GIT_TRAMPOLINE_DIRECTORY
|
||||
);
|
||||
console.log("---");
|
||||
|
||||
execSync('npx lerna exec --scope fluxscape-editor -- npm run test', {
|
||||
execSync("npx lerna exec --scope noodl-editor -- npm run test", {
|
||||
cwd: CWD,
|
||||
stdio: 'inherit',
|
||||
stdio: "inherit",
|
||||
env: {
|
||||
...process.env,
|
||||
LOCAL_GIT_DIRECTORY,
|
||||
LOCAL_GIT_TRAMPOLINE_DIRECTORY
|
||||
}
|
||||
LOCAL_GIT_TRAMPOLINE_DIRECTORY,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user