forked from GladysAssistant/Gladys
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple UI fixes + implement umzug so that DB is migrated in Gladys …
…directly (GladysAssistant#711) * fix GladysAssistant#664 remove reboot button * fix GladysAssistant#657 - no page on get device * Fix GladysAssistant#669: edit room name * Fix GladysAssistant#661: no value for motion on dashboard * Fix GladysAssistant#679: execute DB migrations on startup * fix GladysAssistant#656: dashboard rooms by houses * Map - Fit zoom to markers * Prettier on Map.jsx * prettier * Prettier --' * Remove pagination everywhere on get device request * Don't send to_update property to room update route * House & Room name should be between 1 & 40 characters * Edit house: Add more validation errors in UI * Fix linting * remove front flag * Fix margin problems with room names * Run tests in a RAM db * Fix codecov.yml * Fix Maps: markerArray should not be a global variable * Eslint should check .jsx files * Update README * Change Maps markerArray lifecycle Co-authored-by: atrovato <1839717+atrovato@users.noreply.github.com> Co-authored-by: Vincent KULAK <vkulak62@gmail.com>
- Loading branch information
1 parent
cabc83a
commit f74b837
Showing
35 changed files
with
271 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
front/src/actions/dashboard/edit-boxes/editDevicesInRoom.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
front/src/actions/dashboard/edit-boxes/editTemperatureInRoom.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 18 additions & 29 deletions
47
front/src/components/boxs/device-in-room/EditDeviceInRoom.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,27 @@ | ||
import { Component } from 'preact'; | ||
import { connect } from 'unistore/preact'; | ||
import actions from '../../../actions/dashboard/edit-boxes/editDevicesInRoom'; | ||
import BaseEditBox from '../baseEditBox'; | ||
|
||
const updateBoxRoom = (updateBoxRoomFunc, x, y) => e => { | ||
updateBoxRoomFunc(x, y, e.target.value); | ||
}; | ||
import BaseEditBox from '../baseEditBox'; | ||
import RoomSelector from '../../house/RoomSelector'; | ||
|
||
const EditDevicesInRoom = ({ children, ...props }) => ( | ||
<BaseEditBox {...props} titleKey="dashboard.boxTitle.devices-in-room"> | ||
<div class="form-group"> | ||
<label>Select the room you want to display here:</label> | ||
<select onChange={updateBoxRoom(props.updateBoxRoom, props.x, props.y)} class="form-control"> | ||
<option value="">-------</option> | ||
{props.rooms && | ||
props.rooms.map(room => ( | ||
<option selected={room.selector === props.box.room} value={room.selector}> | ||
{room.name} | ||
</option> | ||
))} | ||
</select> | ||
</div> | ||
</BaseEditBox> | ||
); | ||
import actions from '../../../actions/dashboard/edit-boxes/editDevicesInRoom'; | ||
|
||
@connect('rooms', actions) | ||
class EditDeviceInRoomComponent extends Component { | ||
componentDidMount() { | ||
this.props.getRooms(); | ||
} | ||
@connect('', actions) | ||
class EditDeviceInRoom extends Component { | ||
updateBoxRoom = room => { | ||
this.props.updateBoxRoom(this.props.x, this.props.y, room.selector); | ||
}; | ||
|
||
render(props, {}) { | ||
return <EditDevicesInRoom {...props} />; | ||
render(props) { | ||
return ( | ||
<BaseEditBox {...props} titleKey="dashboard.boxTitle.devices-in-room"> | ||
<div class="form-group"> | ||
<label>Select the room you want to display here:</label> | ||
<RoomSelector selectedRoom={props.box.room} updateRoomSelection={this.updateBoxRoom} /> | ||
</div> | ||
</BaseEditBox> | ||
); | ||
} | ||
} | ||
|
||
export default EditDeviceInRoomComponent; | ||
export default EditDeviceInRoom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.