1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Remove HTML widget from available widgets, code not deleted, closes #226

This commit is contained in:
Sonja Happ 2020-09-28 11:28:32 +02:00
parent 81351a1cdb
commit 34822bb256
4 changed files with 14 additions and 15 deletions

View file

@ -30,8 +30,8 @@ import EditWidgetTextSizeControl from './edit-widget-text-size-control';
import EditWidgetCheckboxControl from './edit-widget-checkbox-control';
import EditWidgetColorZonesControl from './edit-widget-color-zones-control';
import EditWidgetMinMaxControl from './edit-widget-min-max-control';
import EditWidgetHTMLContent from './edit-widget-html-content';
import EditWidgetParametersControl from './edit-widget-parameters-control';
//import EditWidgetHTMLContent from './edit-widget-html-content';
export default function CreateControls(widgetType = null, widget = null, sessionToken = null, files = null, signals, handleChange) {
// Use a list to concatenate the controls according to the widget type
@ -132,11 +132,11 @@ export default function CreateControls(widgetType = null, widget = null, session
<EditWidgetColorControl key={2} widget={widget} controlId={'customProperties.fontColor'} label={'Text color'} handleChange={e => handleChange(e)} />
);
break;
case 'HTML':
/*case 'HTML':
DialogControls.push(
<EditWidgetHTMLContent key={0} widget={widget} controlId={'customProperties.content'} placeholder='HTML Code' handleChange={e => handleChange(e)} />
);
break;
break; */
case 'Topology':
// Restrict to only xml files (MIME)
//let topologyControlFiles = files == null? [] : files.filter( file => file.type.includes('xml'));

View file

@ -172,9 +172,9 @@ class WidgetFactory {
widget.customProperties.background_color_opacity = 0.5;
widget.z = 0;
break;
case 'HTML':
/*case 'HTML':
widget.customProperties.content = '<i>Hello World</i>';
break;
break;*/
case 'Topology':
widget.width = 600;
widget.height = 400;

View file

@ -105,7 +105,7 @@ class WidgetToolbox extends React.Component {
const topologyItemMsg = thereIsTopologyWidget? 'Currently only one is supported' : '';
return (
<div className='toolbox box-header'>
<div className='section-buttons-group-left'>
<div>
@ -164,7 +164,6 @@ class WidgetToolbox extends React.Component {
<ToolboxItem name='Lamp' type='widget' icon = 'plus' />
<ToolboxItem name='Gauge' type='widget' icon = 'plus'/>
<ToolboxItem name='Topology' type='widget' disabled={thereIsTopologyWidget} title={topologyItemMsg} icon = 'plus'/>
<ToolboxItem name='HTML' type='html' icon = 'plus'/>
<OverlayTrigger key={0} placement={'bottom'} overlay={<Tooltip id={`tooltip-${"?"}`}> Drag and drop widgets onto the dashboard </Tooltip>} >
<Button disabled={true} variant="light" size="sm" key={0} >
<Icon icon="question" />
@ -186,12 +185,12 @@ class WidgetToolbox extends React.Component {
</div>
</div>
)
};
}
WidgetToolbox.propTypes = {
widgets: PropTypes.array,
grid: PropTypes.number,

View file

@ -41,9 +41,9 @@ import WidgetInput from './widgets/input';
import WidgetSlider from './widgets/slider';
import WidgetGauge from './widgets/gauge';
import WidgetBox from './widgets/box';
import WidgetHTML from './widgets/html';
import WidgetTopology from './widgets/topology';
import WidgetLine from './widgets/line';
//import WidgetHTML from './widgets/html';
import '../styles/widgets.css';
@ -211,11 +211,11 @@ class Widget extends React.Component {
widget={widget}
editing={this.props.editing}
/>
} else if (widget.type === 'HTML') {
return <WidgetHTML
widget={widget}
editing={this.props.editing}
/>
//} else if (widget.type === 'HTML') {
//return <WidgetHTML
// widget={widget}
// editing={this.props.editing}
///>
} else if (widget.type === 'Topology') {
return <WidgetTopology
widget={widget}