From 4564ab9d0b2312a12f63d0ac24927c18fb3f4775 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 18 Mar 2019 01:06:41 -0400 Subject: [PATCH] add unsupported messages --- .eslintrc.json | 3 +- src/ui/component/common/file-selector.jsx | 47 +- .../component/common/unsupported-on-web.jsx | 12 + .../component/fileViewer/internal/player.jsx | 12 +- src/ui/component/publishForm/view.jsx | 542 +++++++++--------- src/ui/modal/modalRouter/view.jsx | 3 + src/ui/page/report/view.jsx | 5 +- src/ui/page/settings/view.jsx | 7 +- webpack.web.config.js | 4 + 9 files changed, 335 insertions(+), 300 deletions(-) create mode 100644 src/ui/component/common/unsupported-on-web.jsx diff --git a/.eslintrc.json b/.eslintrc.json index 9f92a9627..8b289560f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,7 +18,8 @@ "i18n": true, "__": true, "__n": true, - "app": true + "app": true, + "IS_WEB": true }, "rules": { "no-multi-spaces": 0, diff --git a/src/ui/component/common/file-selector.jsx b/src/ui/component/common/file-selector.jsx index e542dd153..659e9597f 100644 --- a/src/ui/component/common/file-selector.jsx +++ b/src/ui/component/common/file-selector.jsx @@ -35,7 +35,6 @@ class FileSelector extends React.PureComponent { constructor() { super(); - this.input = null; // @if TARGET='web' this.fileInput = React.createRef(); // @endif @@ -67,19 +66,20 @@ class FileSelector extends React.PureComponent { ); } - handleFileInputSelection() { - const { files } = this.fileInput.current; - if (!files) { - return; - } + // TODO: Add this back for web publishing + // handleFileInputSelection() { + // const { files } = this.fileInput.current; + // if (!files) { + // return; + // } - const filePath = files[0]; - const fileName = filePath.name; + // const filePath = files[0]; + // const fileName = filePath.name; - if (this.props.onFileChosen) { - this.props.onFileChosen(filePath, fileName); - } - } + // if (this.props.onFileChosen) { + // this.props.onFileChosen(filePath, fileName); + // } + // } input: ?HTMLInputElement; @@ -91,27 +91,18 @@ class FileSelector extends React.PureComponent { return ( - {/* @if TARGET='app' */} { - if (this.input) this.input = input; - }} + webkitdirectory="true" + className="form-field--copyable" + type="text" + ref={this.fileInput} onFocus={() => { - if (this.input) this.input.select(); + if (this.fileInput) this.fileInput.current.select(); }} - readOnly='readonly' + readOnly="readonly" value={currentPath || __('No File Chosen')} - inputButton={ -