From 6c6d56bd146e7ee5232997e7a30d74c56fe12e8d Mon Sep 17 00:00:00 2001 From: bcd00 <47297759+bcd00@users.noreply.github.com> Date: Wed, 26 May 2021 09:44:37 +0100 Subject: [PATCH] Development (#127) * Update dependency redux-persist to v6 * Update dependency github-markdown-css to v4 * Update dependency react-codemirror2 to v6.0.1 * Update dependency remark-preset-lint-recommended to v3.0.4 * Update dependency eslint-plugin-node to v11.1.0 * Update dependency d3 to v5.16.0 * Update dependency jquery to v3.5.0 [SECURITY] * Update dependency react-router-dom to v5.2.0 * Update dependency react-codemirror2 to v7 * Update dependency eslint-plugin-jest to v23.20.0 * Update dependency react-scripts to v3.4.4 * Update react monorepo to v16.14.0 * Update dependency detect-browser to v5 * Update remark monorepo * Update dependency axios to v0.21.1 [SECURITY] * Update dependency bootstrap to v4.6.0 * Update dependency @fortawesome/fontawesome-free to v5.15.3 * Update dependency codemirror to v5.61.0 * Update dependency eslint-plugin-react to v7.23.2 * Update dependency react-redux to v7.2.4 * Fixed for Windows run, updated test scripts for react-scripts 3.0.0 and added Idea files to gitignore * Adding @babel/core v7.13.16 * Changing eslint react/no-string-refs to 0 rather than false * Adding react version to eslintrc.json and indenting launcher.jsx * Minor fixes to move to Node LTS version 14 * Update dependency dotenv to v8.6.0 * Update dependency eslint-plugin-standard to v4.1.0 * Update dependency jquery to v3.6.0 * Update dependency js-beautify to v1.13.13 * Update dependency lerna to v3.22.1 * Update dependency redux to v4.1.0 * Update dependency d3 to v6 * Update dependency eslint-plugin-jest to v24 * Update dependency eslint-plugin-promise to v5 * Update dependency lerna to v4 * Update dependency react-scripts to v4 * Update dependency semantic-ui-react to v2 * Update react monorepo to v17 * Update dependency dotenv to v9 * Update dependency bootstrap to v5 * Update dependency @babel/core to v7.14.3 * Adding geometry checking for both SigmaSample and LesMiserables configurations * Update dependency codemirror to v5.61.1 * Passing event in as function parameter rather than importing directly for d3 v6 * Removing call to experimental Range() constructor Co-authored-by: Renovate Bot --- package.json | 10 +++++----- packages/ove-ui-demo/package.json | 12 ++++++------ packages/ove-ui-launcher/package.json | 18 +++++++++--------- packages/ove-ui-launcher/src/app/launcher.jsx | 2 +- .../ove-ui-launcher/src/app/launcher.test.jsx | 13 +++++++++++++ .../src/steps/StateConfiguration.jsx | 9 +++++++-- packages/ove-ui-preview/package.json | 16 ++++++++-------- .../src/replicator/replicator.js | 4 ++-- packages/ove-ui-status/package.json | 12 ++++++------ 9 files changed, 57 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index ce4a270f..a7e6f18a 100644 --- a/package.json +++ b/package.json @@ -14,14 +14,14 @@ "start:dev": "lerna exec -- npm run start:dev" }, "devDependencies": { - "@babel/core": "7.13.16", + "@babel/core": "7.14.3", "eslint-config-standard": "12.0.0", - "eslint-plugin-jest": "23.20.0", + "eslint-plugin-jest": "24.3.6", "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.2.1", + "eslint-plugin-promise": "5.1.0", "eslint-plugin-react": "7.23.2", - "eslint-plugin-standard": "4.0.1", - "lerna": "3.20.2", + "eslint-plugin-standard": "4.1.0", + "lerna": "4.0.0", "remark": "13.0.0", "remark-preset-lint-recommended": "5.0.0" } diff --git a/packages/ove-ui-demo/package.json b/packages/ove-ui-demo/package.json index ac78a222..92d6edda 100644 --- a/packages/ove-ui-demo/package.json +++ b/packages/ove-ui-demo/package.json @@ -8,18 +8,18 @@ "author": "Senaka Fernando ", "license": "MIT", "dependencies": { - "bootstrap": "4.6.0", + "bootstrap": "5.0.1", "axios": "0.21.1", "cors": "2.8.5", "detect-browser": "5.2.0", - "dotenv": "8.2.0", + "dotenv": "9.0.2", "express": "4.17.1", "github-markdown-css": "4.0.0", - "jquery": "3.5.0", + "jquery": "3.6.0", "little-loader": "0.2.0", - "react": "16.14.0", - "react-dom": "16.14.0", - "react-scripts": "3.4.4", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-scripts": "4.0.3", "react-router-dom": "5.2.0" }, "scripts": { diff --git a/packages/ove-ui-launcher/package.json b/packages/ove-ui-launcher/package.json index a8ec8d3f..3b1545c2 100644 --- a/packages/ove-ui-launcher/package.json +++ b/packages/ove-ui-launcher/package.json @@ -8,22 +8,22 @@ "author": "Senaka Fernando ", "license": "MIT", "dependencies": { - "bootstrap": "4.6.0", - "codemirror": "5.61.0", + "bootstrap": "5.0.1", + "codemirror": "5.61.1", "axios": "0.21.1", "cors": "2.8.5", - "dotenv": "8.2.0", + "dotenv": "9.0.2", "express": "4.17.1", - "jquery": "3.5.0", - "js-beautify": "1.10.3", + "jquery": "3.6.0", + "js-beautify": "1.13.13", "little-loader": "0.2.0", "react-codemirror2": "7.2.1", - "react": "16.14.0", - "react-dom": "16.14.0", + "react": "17.0.2", + "react-dom": "17.0.2", "react-redux": "7.2.4", - "react-scripts": "3.4.4", + "react-scripts": "4.0.3", "semantic-ui-css": "2.4.1", - "semantic-ui-react": "0.88.2" + "semantic-ui-react": "2.0.3" }, "scripts": { "start": "PORT=8281 node -r dotenv/config server.js dotenv_config_path=.env", diff --git a/packages/ove-ui-launcher/src/app/launcher.jsx b/packages/ove-ui-launcher/src/app/launcher.jsx index c6309c46..b5d5f744 100755 --- a/packages/ove-ui-launcher/src/app/launcher.jsx +++ b/packages/ove-ui-launcher/src/app/launcher.jsx @@ -114,7 +114,7 @@ export default class Launcher extends Component { updateMode={d => this.setState({ mode: d, controllerURL: undefined })} updateURL={d => this.setState({ url: d, controllerURL: undefined })} updateErrors={d => this.setState({ stateErrors: d })} - app={this.state.app} mode={this.state.mode} state={this.state.state} url={this.state.url} errors={this.state.stateErrors} /> + app={this.state.app} mode={this.state.mode} state={this.state.state} url={this.state.url} geometry={this.state.geometry} errors={this.state.stateErrors} /> this.setState({ deleteSections })} diff --git a/packages/ove-ui-launcher/src/app/launcher.test.jsx b/packages/ove-ui-launcher/src/app/launcher.test.jsx index 0264b70a..39623508 100755 --- a/packages/ove-ui-launcher/src/app/launcher.test.jsx +++ b/packages/ove-ui-launcher/src/app/launcher.test.jsx @@ -4,6 +4,19 @@ import React from 'react'; import ReactDOM from 'react-dom'; import Launcher from './launcher'; +const range = document.createRange(); + +document.createRange = () => { + range.getBoundingClientRect = jest.fn(); + + range.getClientRects = jest.fn(() => ({ + item: () => null, + length: 0 + })); + + return range; +}; + // Mocking required for codemirror (see https://discuss.codemirror.net/t/working-in-jsdom-or-node-js-natively/138/6) global.document.body.createTextRange = function () { return { diff --git a/packages/ove-ui-launcher/src/steps/StateConfiguration.jsx b/packages/ove-ui-launcher/src/steps/StateConfiguration.jsx index a02881af..f92c39f0 100644 --- a/packages/ove-ui-launcher/src/steps/StateConfiguration.jsx +++ b/packages/ove-ui-launcher/src/steps/StateConfiguration.jsx @@ -25,8 +25,12 @@ export default class StateConfiguration extends Component { let errors = { existingState: null, newState: null }; - if (this.props.mode === Constants.Mode.EXISTING && !this.props.state) { - errors.existingState = 'You must select a state'; + if (this.props.mode === Constants.Mode.EXISTING) { + if (!this.props.state) { + errors.existingState = 'You must select a state'; + } else if ((this.props.state === 'SigmaSample' || this.props.state === 'LesMiserables') && (this.props.geometry.h > 1616 || this.props.geometry.w > 2880)) { + errors.existingState = 'Must display in resolution <= 2880x1616, currently displaying in - ' + this.props.geometry.w.toString() + 'x' + this.props.geometry.h.toString(); + } } else if (this.props.mode === Constants.Mode.NEW) { const url = this.props.url; @@ -145,6 +149,7 @@ StateConfiguration.propTypes = { mode: PropTypes.oneOf([Constants.Mode.EXISTING, Constants.Mode.NEW]), state: PropTypes.string, url: PropTypes.string, + geometry: PropTypes.shape({ x: PropTypes.string, y: PropTypes.string, w: PropTypes.string, h: PropTypes.string }), errors: PropTypes.shape({ newState: PropTypes.string, existingState: PropTypes.string }) diff --git a/packages/ove-ui-preview/package.json b/packages/ove-ui-preview/package.json index 5aa19d29..21797f22 100644 --- a/packages/ove-ui-preview/package.json +++ b/packages/ove-ui-preview/package.json @@ -8,19 +8,19 @@ "author": "Senaka Fernando ", "license": "MIT", "dependencies": { - "bootstrap": "4.6.0", + "bootstrap": "5.0.1", "axios": "0.21.1", "cors": "2.8.5", - "d3": "5.16.0", - "dotenv": "8.2.0", + "d3": "6.7.0", + "dotenv": "9.0.2", "express": "4.17.1", - "jquery": "3.5.0", + "jquery": "3.6.0", "little-loader": "0.2.0", - "react": "16.14.0", - "react-dom": "16.14.0", + "react": "17.0.2", + "react-dom": "17.0.2", "react-redux": "7.2.4", - "react-scripts": "3.4.4", - "redux": "4.0.5", + "react-scripts": "4.0.3", + "redux": "4.1.0", "redux-persist": "6.0.0" }, "scripts": { diff --git a/packages/ove-ui-preview/src/replicator/replicator.js b/packages/ove-ui-preview/src/replicator/replicator.js index c734a57d..f3d16589 100644 --- a/packages/ove-ui-preview/src/replicator/replicator.js +++ b/packages/ove-ui-preview/src/replicator/replicator.js @@ -233,8 +233,8 @@ export default class Replicator { }; log.debug('Translation is limited to a maximum of:', maxTranslate); // We are only interested in translations and not in scaling. - d3.select(Constants.CONTROL_CANVAS).call(d3.zoom().scaleExtent([1, 1.000001]).on('zoom', function () { - const event = d3.event.transform; + d3.select(Constants.CONTROL_CANVAS).call(d3.zoom().scaleExtent([1, 1.000001]).on('zoom', function (e) { + const event = e.transform; log.trace('Got D3 event with, k:', event.k, 'x:', event.x, 'y:', event.y); const x = Math.max(-maxTranslate.x, Math.min(event.x, 0)); const y = Math.max(-maxTranslate.y, Math.min(event.y, 0)); diff --git a/packages/ove-ui-status/package.json b/packages/ove-ui-status/package.json index 06b95821..a5d469ab 100644 --- a/packages/ove-ui-status/package.json +++ b/packages/ove-ui-status/package.json @@ -9,17 +9,17 @@ "license": "MIT", "dependencies": { "@fortawesome/fontawesome-free": "5.15.3", - "bootstrap": "4.6.0", + "bootstrap": "5.0.1", "axios": "0.21.1", "cors": "2.8.5", - "dotenv": "8.2.0", + "dotenv": "9.0.2", "express": "4.17.1", "github-markdown-css": "4.0.0", - "jquery": "3.5.0", + "jquery": "3.6.0", "little-loader": "0.2.0", - "react": "16.14.0", - "react-dom": "16.14.0", - "react-scripts": "3.4.4" + "react": "17.0.2", + "react-dom": "17.0.2", + "react-scripts": "4.0.3" }, "scripts": { "start": "PORT=8283 node -r dotenv/config server.js dotenv_config_path=.env",