diff --git a/.gitignore b/.gitignore index 233924d55..dc61fadfe 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ /app/node_modules /build/venv /lbry-app-venv +/lbry-app /lbry-venv /daemon/build /daemon/venv diff --git a/CHANGELOG.md b/CHANGELOG.md index b292a3b65..62b54dca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,15 +8,16 @@ Web UI version numbers should always match the corresponding version of LBRY App ## [Unreleased] ### Added - * Added a new component, "PriceForm" which is now used in Publish and Settings + * Added a new component, `FormFieldPrice` which is now used in Publish and Settings * ### Changed - * + * Some form field refactoring as we progress towards form sanity. * ### Fixed * Tiles will no longer be blurry on hover (Windows only bug) + * Removed placeholder values from price selection form fields, which was causing confusion that these were real values (#426) * ### Deprecated @@ -24,7 +25,7 @@ Web UI version numbers should always match the corresponding version of LBRY App * ### Removed - * Removed one instance of string "Max Purchase Price" from settings page, it's redudant. + * Removed the label "Max Purchase Price" from settings page. It was redundant. * ## [0.14.3] - 2017-08-03 diff --git a/package.json b/package.json index e0f83e824..50eae487d 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,8 @@ }, "devDependencies": { "devtron": "^1.4.0", - "electron": "^1.4.15", + "electron": "^1.7.5", "electron-builder": "^11.7.0", - "electron-debug": "^1.1.0" + "electron-debug": "^1.4.0" } } diff --git a/ui/js/component/fileList/view.jsx b/ui/js/component/fileList/view.jsx index f910e9500..cc397ddbe 100644 --- a/ui/js/component/fileList/view.jsx +++ b/ui/js/component/fileList/view.jsx @@ -2,7 +2,7 @@ import React from "react"; import lbry from "lbry.js"; import lbryuri from "lbryuri.js"; import Link from "component/link"; -import { FormField } from "component/form.js"; +import FormField from "component/formField"; import FileTile from "component/fileTile"; import rewards from "rewards.js"; import lbryio from "lbryio.js"; diff --git a/ui/js/component/form.js b/ui/js/component/form.js index 59b9bce50..d47d7445a 100644 --- a/ui/js/component/form.js +++ b/ui/js/component/form.js @@ -1,183 +1,14 @@ import React from "react"; -import FileSelector from "./file-selector.js"; -import SimpleMDE from "react-simplemde-editor"; -import style from "react-simplemde-editor/dist/simplemde.min.css"; +import FormField from "component/formField"; -let formFieldCounter = 0, - formFieldFileSelectorTypes = ["file", "directory"], - formFieldNestedLabelTypes = ["radio", "checkbox"]; +let formFieldCounter = 0; -function formFieldId() { +export const formFieldNestedLabelTypes = ["radio", "checkbox"]; + +export function formFieldId() { return "form-field-" + ++formFieldCounter; } -export class FormField extends React.PureComponent { - static propTypes = { - type: React.PropTypes.string.isRequired, - prefix: React.PropTypes.string, - postfix: React.PropTypes.string, - hasError: React.PropTypes.bool, - }; - - constructor(props) { - super(props); - - this._fieldRequiredText = __("This field is required"); - this._type = null; - this._element = null; - this._extraElementProps = {}; - - this.state = { - isError: null, - errorMessage: null, - }; - } - - componentWillMount() { - if (["text", "number", "radio", "checkbox"].includes(this.props.type)) { - this._element = "input"; - this._type = this.props.type; - } else if (this.props.type == "text-number") { - this._element = "input"; - this._type = "text"; - } else if (this.props.type == "SimpleMDE") { - this._element = SimpleMDE; - this._type = "textarea"; - this._extraElementProps.options = { - hideIcons: ["guide", "heading", "image", "fullscreen", "side-by-side"], - }; - } else if (formFieldFileSelectorTypes.includes(this.props.type)) { - this._element = "input"; - this._type = "hidden"; - } else { - // Non field, e.g.