Merge branch 'fix/propertypane-errorhandler' into 'release'
Fix Property pane errors Fix propertypane invalid control error See merge request theappsmith/internal-tools-client!332
This commit is contained in:
commit
bfa282298a
|
|
@ -62,7 +62,7 @@ const StyledSingleDropDown = styled(SingleDropDown)`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledControlGroup = styled(ControlGroup)<{ hasLabel: boolean }>`
|
const StyledControlGroup = styled(ControlGroup)<{ haslabel: string }>`
|
||||||
&&& > {
|
&&& > {
|
||||||
label {
|
label {
|
||||||
${labelStyle}
|
${labelStyle}
|
||||||
|
|
@ -74,7 +74,7 @@ const StyledControlGroup = styled(ControlGroup)<{ hasLabel: boolean }>`
|
||||||
}
|
}
|
||||||
span {
|
span {
|
||||||
max-width: ${props =>
|
max-width: ${props =>
|
||||||
props.hasLabel ? `calc(70% - ${WIDGET_PADDING}px)` : "100%"};
|
props.haslabel === "true" ? `calc(70% - ${WIDGET_PADDING}px)` : "100%"};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
@ -204,7 +204,10 @@ class DropDownComponent extends React.Component<DropDownComponentProps> {
|
||||||
: [];
|
: [];
|
||||||
return (
|
return (
|
||||||
<DropdownContainer>
|
<DropdownContainer>
|
||||||
<StyledControlGroup fill hasLabel={!!this.props.label}>
|
<StyledControlGroup
|
||||||
|
fill
|
||||||
|
haslabel={!!this.props.label ? "true" : "false"}
|
||||||
|
>
|
||||||
{this.props.label && (
|
{this.props.label && (
|
||||||
<Label
|
<Label
|
||||||
className={
|
className={
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,14 @@ const PropertyControl = (props: Props) => {
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
const isConvertible = CONVERTIBLE_CONTROLS.indexOf(config.controlType) > -1;
|
const isConvertible = CONVERTIBLE_CONTROLS.indexOf(config.controlType) > -1;
|
||||||
|
const className = propertyConfig.label
|
||||||
|
.split(" ")
|
||||||
|
.join("")
|
||||||
|
.toLowerCase();
|
||||||
return (
|
return (
|
||||||
<ControlWrapper
|
<ControlWrapper
|
||||||
key={config.key}
|
className={`t--property-control-${className}`}
|
||||||
|
key={config.id}
|
||||||
orientation={
|
orientation={
|
||||||
config.controlType === "SWITCH" && !isDynamic
|
config.controlType === "SWITCH" && !isDynamic
|
||||||
? "HORIZONTAL"
|
? "HORIZONTAL"
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ class PropertyPane extends Component<
|
||||||
try {
|
try {
|
||||||
return (
|
return (
|
||||||
<PropertyControl
|
<PropertyControl
|
||||||
|
key={propertyControlOrSection.id}
|
||||||
propertyConfig={propertyControlOrSection}
|
propertyConfig={propertyControlOrSection}
|
||||||
widgetProperties={widgetProperties}
|
widgetProperties={widgetProperties}
|
||||||
onPropertyChange={this.onPropertyChange}
|
onPropertyChange={this.onPropertyChange}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ControlType } from "constants/PropertyControlConstants";
|
import { ControlType } from "constants/PropertyControlConstants";
|
||||||
import React from "react";
|
import React, { Fragment } from "react";
|
||||||
import {
|
import {
|
||||||
ControlBuilder,
|
ControlBuilder,
|
||||||
ControlProps,
|
ControlProps,
|
||||||
|
|
@ -32,25 +32,15 @@ class PropertyControlFactory {
|
||||||
key: controlData.id,
|
key: controlData.id,
|
||||||
};
|
};
|
||||||
const control = controlBuilder.buildPropertyControl(controlProps);
|
const control = controlBuilder.buildPropertyControl(controlProps);
|
||||||
const className = controlProps.label
|
return control;
|
||||||
.split(" ")
|
|
||||||
.join("")
|
|
||||||
.toLowerCase();
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={controlProps.id}
|
|
||||||
className={`t--property-control-${className}`}
|
|
||||||
>
|
|
||||||
{control}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
const ex: ControlCreationException = {
|
const ex: ControlCreationException = {
|
||||||
message:
|
message:
|
||||||
"Control Builder not registered for control type " +
|
"Control Builder not registered for control type " +
|
||||||
controlData.controlType,
|
controlData.controlType,
|
||||||
};
|
};
|
||||||
throw ex;
|
console.log(ex.message);
|
||||||
|
return <Fragment />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user