Merge branch '80-fix-editname-device' into 'dev'

fixed edit name on devices

Closes #80

See merge request sa4-2020/the-sanmarinoes/frontend!90
This commit is contained in:
Claudio Maggioni 2020-04-21 16:35:20 +02:00
commit df1f753785

View file

@ -1,5 +1,5 @@
import React, { Component, useState } from "react";
import { Button, Form, Icon, Header, Modal } from "semantic-ui-react";
import { Button, Form, Icon, Header, Modal, Input } from "semantic-ui-react";
import { connect } from "react-redux";
import { RemoteService } from "../../../remote";
@ -37,12 +37,11 @@ const SettingsForm = (props) => {
<Form>
<Form.Field>
<label>Edit Name: </label>
<input
<Input
autoComplete="off"
name="name"
onChange={handleInputChange}
value={props.name}
placeholder="Device name"
placeholder={props.name}
// {this.props.device.name}
/>
</Form.Field>
@ -85,7 +84,7 @@ class DeviceSettingsModal extends Component {
if (values.name.length === 0) return;
this.props
.saveDevice({ ...this.props.device, name: values.name })
.then(() => this.setState({ open: false }))
.then(() => this.setState({ openModal: false }))
.catch((err) =>
console.error(
`settings modal for device ${this.props.id} deletion error`,