mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Disable run button when no item selected
This commit is contained in:
parent
9c669c611d
commit
bc71cf1ff2
3 changed files with 8 additions and 8 deletions
|
@ -178,7 +178,7 @@ class Simulation extends React.Component {
|
|||
}
|
||||
|
||||
onSimulationModelChecked(index, event) {
|
||||
const selectedSimulationModels = this.state.selectedSimulationModels;
|
||||
const selectedSimulationModels = Object.assign([], this.state.selectedSimulationModels);
|
||||
for (let key in selectedSimulationModels) {
|
||||
if (selectedSimulationModels[key] === index) {
|
||||
// update existing entry
|
||||
|
@ -249,7 +249,7 @@ class Simulation extends React.Component {
|
|||
|
||||
<div style={{ float: 'left' }}>
|
||||
<SimulatorAction
|
||||
runDisabled={false}
|
||||
runDisabled={this.state.selectedSimulationModels.length === 0}
|
||||
runAction={this.runAction}
|
||||
actions={[
|
||||
{ id: '0', title: 'Start', data: { action: 'start' } },
|
||||
|
|
|
@ -168,7 +168,7 @@ class Simulations extends Component {
|
|||
}
|
||||
|
||||
onSimulationChecked(index, event) {
|
||||
const selectedSimulations = this.state.selectedSimulations;
|
||||
const selectedSimulations = Object.assign([], this.state.selectedSimulations);
|
||||
for (let key in selectedSimulations) {
|
||||
if (selectedSimulations[key] === index) {
|
||||
// update existing entry
|
||||
|
@ -238,7 +238,7 @@ class Simulations extends Component {
|
|||
|
||||
<div style={{ float: 'left' }}>
|
||||
<SimulatorAction
|
||||
runDisabled={false}
|
||||
runDisabled={this.state.selectedSimulations.length === 0}
|
||||
runAction={this.runAction}
|
||||
actions={[
|
||||
{ id: '0', title: 'Start', data: { action: 'start' } },
|
||||
|
|
|
@ -127,7 +127,7 @@ class Simulators extends Component {
|
|||
}
|
||||
|
||||
onSimulatorChecked(index, event) {
|
||||
const selectedSimulators = this.state.selectedSimulators;
|
||||
const selectedSimulators = Object.assign([], this.state.selectedSimulators);
|
||||
for (let key in selectedSimulators) {
|
||||
if (selectedSimulators[key] === index) {
|
||||
// update existing entry
|
||||
|
@ -188,7 +188,7 @@ class Simulators extends Component {
|
|||
|
||||
<div style={{ float: 'left' }}>
|
||||
<SimulatorAction
|
||||
runDisabled={false}
|
||||
runDisabled={this.state.selectedSimulators.length === 0}
|
||||
runAction={this.runAction}
|
||||
actions={[ { id: '0', title: 'Reset', data: { action: 'reset' } }, { id: '1', title: 'Shutdown', data: { action: 'shutdown' } } ]}/>
|
||||
</div>
|
||||
|
@ -198,8 +198,8 @@ class Simulators extends Component {
|
|||
<Button onClick={() => this.setState({ importModal: true })}><Glyphicon glyph="import" /> Import</Button>
|
||||
</div>
|
||||
|
||||
<NewSimulatorDialog show={this.state.newModal} onClose={(data) => this.closeNewModal(data)} />
|
||||
<EditSimulatorDialog show={this.state.editModal} onClose={(data) => this.closeEditModal(data)} simulator={this.state.modalSimulator} />
|
||||
<NewSimulatorDialog show={this.state.newModal} onClose={data => this.closeNewModal(data)} />
|
||||
<EditSimulatorDialog show={this.state.editModal} onClose={data => this.closeEditModal(data)} simulator={this.state.modalSimulator} />
|
||||
<ImportSimulatorDialog show={this.state.importModal} onClose={data => this.closeImportModal(data)} />
|
||||
|
||||
<DeleteDialog title="simulator" name={_.get(this.state.modalSimulator, 'properties.name') || _.get(this.state.modalSimulator, 'rawProperties.name') || 'Unknown'} show={this.state.deleteModal} onClose={this.closeDeleteModal} />
|
||||
|
|
Loading…
Add table
Reference in a new issue