Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-aranda committed May 26, 2021
2 parents 5f3f7c8 + c0975bf commit 6dc4bae
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion love/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"file-saver": "^2.0.1",
"howler": "^2.1.3",
"html2canvas": "^1.0.0-rc.5",
"lodash": "^4.17.19",
"lodash": "^4.17.21",
"lodash.throttle": "^4.1.1",
"lodash.debounce": "^4.0.8",
"luxon": "^1.23.0",
Expand Down
25 changes: 19 additions & 6 deletions love/src/components/CommandPanel/CommandPanel.container.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import { requestSALCommand } from '../../redux/actions/ws';
import { addGroup, removeGroup, requestSALCommand } from '../../redux/actions/ws';
import { getPermCmdExec, getScriptQueueState } from '../../redux/selectors';
import CommandPanel from './CommandPanel';

Expand All @@ -20,6 +20,12 @@ export const schema = {
isPrivate: true,
default: false,
},
scriptQueueIndex: {
type: 'number',
description: 'Salindex of the ScriptQueue to listen events',
isPrivate: false,
default: 1,
},
},
};

Expand All @@ -28,20 +34,27 @@ const CommandPanelContainer = ({ ...props }) => {
};

const mapDispatchToProps = (dispatch, ownProps) => {
const subscriptions = [`event-ScriptQueueState-${ownProps.scriptQueueIndex}-stream`];
return {
subscriptions,
subscribeToStreams: () => {
subscriptions.forEach((stream) => dispatch(addGroup(stream)));
},
unsubscribeToStreams: () => {
subscriptions.forEach((stream) => dispatch(removeGroup(stream)));
},
requestSALCommand: (component, salindex, cmd) => {
return;
dispatch(requestSALCommand({ ...cmd, component, salindex }));
},
};
};

const mapStateToProps = (state) => {
const mapStateToProps = (state, ownProps) => {
const commandExecutePermission = getPermCmdExec(state);
const queueState = getScriptQueueState(state, 1);
const queueState = getScriptQueueState(state, ownProps.scriptQueueIndex);
return {
commandExecutePermission: commandExecutePermission,
queueState: queueState,
commandExecutePermission,
queueState,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ export default class StopAllTSCButton extends Component {
}

render() {
const isAvailable = this.props.commandExecutePermission && this.props.queueState.state !== 'Running';
return (
<div className={styles.buttonWrapper}>
<button
className={styles.button}
disabled={!this.props.commandExecutePermission}
title={
isAvailable
? 'ATCS stop_all() implementation'
: "Command is not allowed while queue is running either you don't have command execution permissions"
}
disabled={!isAvailable}
onClick={(e) => this.callTSCStopAll()}
>
<svg className={styles.svg} viewBox="0 0 108.5 130">
Expand Down
14 changes: 0 additions & 14 deletions love/src/components/ScriptQueue/ScriptQueue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,6 @@ export default class ScriptQueue extends Component {
};

componentDidUpdate = (prevProps, _prevState) => {
if (this.props.current !== prevProps.current) {
if (this.props.current === 'None') {
this.setState((state) => ({
currentScriptDetailState: { ...state.currentScriptDetailState, height: 0 },
}));
} else {
this.setState((state) => ({
currentScriptDetailState: {
...state.currentScriptDetailState,
height: state.currentScriptDetailState.initialHeight,
},
}));
}
}
if (this.state.currentScriptDetailState !== _prevState.currentScriptDetailState) {
if (this.state.currentScriptDetailState.height < this.state.currentScriptDetailState.initialHeight) {
this.setState({ resetButton: <span>Show details &#9660;</span> });
Expand Down
12 changes: 9 additions & 3 deletions love/src/components/TCSCommands/TCSCommands.container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export const schema = {
isPrivate: true,
default: false,
},
scriptQueueIndex: {
type: 'number',
description: 'Salindex of the ScriptQueue to listen events',
isPrivate: false,
default: 1,
},
},
};

Expand All @@ -42,7 +48,7 @@ const TCSCommandsContainer = ({
};

const mapDispatchToProps = (dispatch, ownProps) => {
const subscriptions = [`event-ScriptQueueState-1-stream`];
const subscriptions = [`event-ScriptQueueState-${ownProps.scriptQueueIndex}-stream`];
return {
subscriptions,
subscribeToStreams: () => {
Expand All @@ -61,8 +67,8 @@ const mapStateToProps = (state) => {
const commandExecutePermission = getPermCmdExec(state);
const queueState = getScriptQueueState(state, 1);
return {
commandExecutePermission: commandExecutePermission,
queueState: queueState,
commandExecutePermission,
queueState,
};
};

Expand Down
25 changes: 15 additions & 10 deletions love/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6813,9 +6813,9 @@ hoopy@^0.1.4:
integrity sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==

hosted-git-info@^2.1.4:
version "2.8.8"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488"
integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==
version "2.8.9"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==

howler@^2.1.3:
version "2.2.1"
Expand Down Expand Up @@ -8605,6 +8605,11 @@ lodash._reinterpolate@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=

lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
Expand Down Expand Up @@ -8655,10 +8660,10 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=

"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.5:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

log-symbols@^1.0.2:
version "1.0.2"
Expand Down Expand Up @@ -13582,9 +13587,9 @@ url-loader@4.1.1:
schema-utils "^3.0.0"

url-parse@^1.4.3, url-parse@^1.4.4:
version "1.4.7"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278"
integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==
version "1.5.1"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b"
integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"
Expand Down

0 comments on commit 6dc4bae

Please sign in to comment.