Skip to content

Commit

Permalink
Fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
callemand authored and Corentin Allemand committed Nov 17, 2023
1 parent 395caff commit bb6be08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 47 deletions.
36 changes: 0 additions & 36 deletions front/cypress/e2e/routes/scene/Scene.cy.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,7 @@
describe('Scene view', () => {
before(() => {
cy.login();
/*
const serverUrl = Cypress.env('serverUrl');
cy.request({
method: 'GET',
url: `${serverUrl}/api/v1/room`
}).then(res => {
const device = {
name: 'One device',
external_id: 'one-device',
selector: 'one-device',
room_id: res.body[0].id,
features: [
{
name: 'Multilevel',
category: 'light',
type: 'temperature',
external_id: 'light-temperature',
selector: 'light-temperature',
read_only: false,
keep_history: true,
has_feedback: true,
min: 0,
max: 1
}
]
};
cy.createDevice(device, 'mqtt');
});
*/
});
beforeEach(() => {
cy.login();
});
after(() => {
// Delete all Bluetooth devices
//cy.deleteDevices('mqtt');
});
it('Should create new scene', () => {
cy.visit('/dashboard/scene');
cy.contains('scene.newButton')
Expand Down
3 changes: 1 addition & 2 deletions front/src/routes/scene/SceneTagFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component } from 'preact';
import cx from 'classnames';
import { Text } from 'preact-i18n';
import { MAX_LENGTH_TAG } from './constant';
import style from './style.css';

class SceneTagFilter extends Component {
constructor(props) {
Expand Down Expand Up @@ -95,7 +94,7 @@ class SceneTagFilter extends Component {
id={`tags-filter-${tag.name}`}
type="checkbox"
className="custom-control-input"
onChange={e => this.selectedTags(tag.name)}
onChange={() => this.selectedTags(tag.name)}
checked={tagsStatus[tag.name]}
/>
<label className="custom-control-label" htmlFor={`tags-filter-${tag.name}`}>
Expand Down
19 changes: 10 additions & 9 deletions front/src/routes/scene/new-scene/NewScenePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ const NewScenePage = ({ children, ...props }) => (
<Text id="newScene.invalidName" />
</div>
</div>
<div class="form-footer">
<button
onClick={props.createScene}
class="btn btn-primary btn-block"
disabled={props.createSceneStatus === RequestStatus.Getting}
>
<Text id="newScene.createSceneButton" />
</button>
</div>

<div class="form-group">
<label class="form-label">
Expand Down Expand Up @@ -85,6 +76,16 @@ const NewScenePage = ({ children, ...props }) => (
))}
</div>
</div>

<div class="form-footer">
<button
onClick={props.createScene}
className="btn btn-primary btn-block"
disabled={props.createSceneStatus === RequestStatus.Getting}
>
<Text id="newScene.createSceneButton" />
</button>
</div>
</div>
</form>
</div>
Expand Down

0 comments on commit bb6be08

Please sign in to comment.