resolve warnings
This commit is contained in:
parent
89d0cc380b
commit
f660814897
@ -5,7 +5,6 @@ import '@blockly/block-plus-minus';
|
|||||||
|
|
||||||
import { TypedVariableModal } from '@blockly/plugin-typed-variable-modal';
|
import { TypedVariableModal } from '@blockly/plugin-typed-variable-modal';
|
||||||
import * as Blockly from 'blockly/core';
|
import * as Blockly from 'blockly/core';
|
||||||
import BlocklyComponent from '../BlocklyComponent';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import { saveAs } from 'file-saver';
|
|||||||
import { detectWhitespacesAndReturnReadableResult } from '../../../helpers/whitespace';
|
import { detectWhitespacesAndReturnReadableResult } from '../../../helpers/whitespace';
|
||||||
|
|
||||||
import Breadcrumbs from '../../Breadcrumbs';
|
import Breadcrumbs from '../../Breadcrumbs';
|
||||||
import Id from './Id';
|
|
||||||
import Textfield from './Textfield';
|
import Textfield from './Textfield';
|
||||||
import Step from './Step';
|
import Step from './Step';
|
||||||
import Dialog from '../../Dialog';
|
import Dialog from '../../Dialog';
|
||||||
|
@ -47,17 +47,17 @@ class Requirements extends Component {
|
|||||||
|
|
||||||
onChange = (hardware) => {
|
onChange = (hardware) => {
|
||||||
var hardwareArray = this.props.value;
|
var hardwareArray = this.props.value;
|
||||||
if(hardwareArray.filter(value => value === hardware).length > 0){
|
if (hardwareArray.filter(value => value === hardware).length > 0) {
|
||||||
hardwareArray = hardwareArray.filter(value => value !== hardware);
|
hardwareArray = hardwareArray.filter(value => value !== hardware);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hardwareArray.push(hardware);
|
hardwareArray.push(hardware);
|
||||||
if(this.props.error){
|
if (this.props.error) {
|
||||||
this.props.deleteError(this.props.index, 'hardware');
|
this.props.deleteError(this.props.index, 'hardware');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.props.changeContent(hardwareArray, this.props.index, 'hardware');
|
this.props.changeContent(hardwareArray, this.props.index, 'hardware');
|
||||||
if(hardwareArray.length === 0){
|
if (hardwareArray.length === 0) {
|
||||||
this.props.setError(this.props.index, 'hardware');
|
this.props.setError(this.props.index, 'hardware');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,26 +65,26 @@ class Requirements extends Component {
|
|||||||
render() {
|
render() {
|
||||||
var cols = isWidthDown('md', this.props.width) ? isWidthDown('sm', this.props.width) ? isWidthDown('xs', this.props.width) ? 2 : 3 : 4 : 6;
|
var cols = isWidthDown('md', this.props.width) ? isWidthDown('sm', this.props.width) ? isWidthDown('xs', this.props.width) ? 2 : 3 : 4 : 6;
|
||||||
return (
|
return (
|
||||||
<div style={{marginBottom: '10px', padding: '18.5px 14px', borderRadius: '25px', border: '1px solid lightgrey', width: 'calc(100% - 28px)'}}>
|
<div style={{ marginBottom: '10px', padding: '18.5px 14px', borderRadius: '25px', border: '1px solid lightgrey', width: 'calc(100% - 28px)' }}>
|
||||||
<FormLabel style={{color: 'black'}}>Hardware</FormLabel>
|
<FormLabel style={{ color: 'black' }}>Hardware</FormLabel>
|
||||||
<FormHelperText style={this.props.error ? {lineHeight: 'initial', marginTop: '5px'} : {marginTop: '5px', lineHeight: 'initial', marginBottom: '10px'}}>Beachte, dass die Reihenfolge des Auswählens maßgebend ist.</FormHelperText>
|
<FormHelperText style={this.props.error ? { lineHeight: 'initial', marginTop: '5px' } : { marginTop: '5px', lineHeight: 'initial', marginBottom: '10px' }}>Beachte, dass die Reihenfolge des Auswählens maßgebend ist.</FormHelperText>
|
||||||
{this.props.error ? <FormHelperText className={this.props.classes.errorColor}>Wähle mindestens eine Hardware-Komponente aus.</FormHelperText> : null}
|
{this.props.error ? <FormHelperText className={this.props.classes.errorColor}>Wähle mindestens eine Hardware-Komponente aus.</FormHelperText> : null}
|
||||||
<GridList cellHeight={100} cols={cols} spacing={10}>
|
<GridList cellHeight={100} cols={cols} spacing={10}>
|
||||||
{hardware.map((picture,i) => (
|
{hardware.map((picture, i) => (
|
||||||
<GridListTile key={i} onClick={() => this.onChange(picture.id)} classes={{tile: this.props.value.filter(value => value === picture.id).length > 0 ? this.props.classes.active : this.props.classes.border}}>
|
<GridListTile key={i} onClick={() => this.onChange(picture.id)} classes={{ tile: this.props.value.filter(value => value === picture.id).length > 0 ? this.props.classes.active : this.props.classes.border }}>
|
||||||
<div style={{margin: 'auto', width: 'max-content'}}>
|
<div style={{ margin: 'auto', width: 'max-content' }}>
|
||||||
<img src={`/media/hardware/${picture.src}`} alt={picture.name} height={100} />
|
<img src={`/media/hardware/${picture.src}`} alt={picture.name} height={100} />
|
||||||
</div>
|
</div>
|
||||||
<GridListTileBar
|
<GridListTileBar
|
||||||
classes={{root: this.props.classes.multiGridListTile}}
|
classes={{ root: this.props.classes.multiGridListTile }}
|
||||||
title={
|
title={
|
||||||
<div style={{overflow: 'hidden', textOverflow: 'ellipsis'}} className={this.props.classes.multiGridListTileTitle}>
|
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis' }} className={this.props.classes.multiGridListTileTitle}>
|
||||||
{picture.name}
|
{picture.name}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</GridListTile>
|
</GridListTile>
|
||||||
))}
|
))}
|
||||||
</GridList>
|
</GridList>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user