Fix radio widget default value and Post api save error
This commit is contained in:
parent
dcf320e4e6
commit
2f5a3104f1
|
|
@ -21,7 +21,7 @@ export const transformRestAction = (data: any): any => {
|
|||
data.displayFormat &&
|
||||
data.displayFormat === POST_BODY_FORMAT_OPTIONS[0].value
|
||||
) {
|
||||
if (data.actionConfiguration.body[0]) {
|
||||
if (data.actionConfiguration.body && data.actionConfiguration.body[0]) {
|
||||
const body = data.actionConfiguration.body[0];
|
||||
action = {
|
||||
...data,
|
||||
|
|
@ -36,7 +36,7 @@ export const transformRestAction = (data: any): any => {
|
|||
data.displayFormat &&
|
||||
data.displayFormat === POST_BODY_FORMAT_OPTIONS[1].value
|
||||
) {
|
||||
if (data.actionConfiguration.body[1]) {
|
||||
if (data.actionConfiguration.body && data.actionConfiguration.body[1]) {
|
||||
const body = data.actionConfiguration.body[1];
|
||||
if (typeof data.actionConfiguration.body === "object") {
|
||||
action = {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ abstract class BaseWidget<
|
|||
return {};
|
||||
}
|
||||
|
||||
static getMetaPropertiesMap(): Record<string, string> {
|
||||
static getMetaPropertiesMap(): Record<string, any> {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class CheckboxWidget extends BaseWidget<CheckboxWidgetProps, WidgetState> {
|
|||
|
||||
static getMetaPropertiesMap(): Record<string, any> {
|
||||
return {
|
||||
isChecked: false,
|
||||
isChecked: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
|||
static getMetaPropertiesMap(): Record<string, any> {
|
||||
return {
|
||||
selectedOptionValue: undefined,
|
||||
selectedOptionValueArr: [],
|
||||
selectedOptionValueArr: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,13 @@ class MapWidget extends BaseWidget<MapWidgetProps, WidgetState> {
|
|||
};
|
||||
}
|
||||
|
||||
static getMetaPropertiesMap(): Record<string, undefined> {
|
||||
return {
|
||||
center: undefined,
|
||||
markers: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
updateCenter = (lat: number, lng: number) => {
|
||||
this.updateWidgetMetaProperty("center", { lat, lng });
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class RadioGroupWidget extends BaseWidget<RadioGroupWidgetProps, WidgetState> {
|
|||
|
||||
static getMetaPropertiesMap(): Record<string, any> {
|
||||
return {
|
||||
selectedOptionValue: "",
|
||||
selectedOptionValue: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,22 +45,6 @@ class RichTextEditorWidget extends BaseWidget<
|
|||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
super.componentDidMount();
|
||||
if (this.props.defaultText) {
|
||||
this.updateWidgetMetaProperty("text", this.props.defaultText);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: RichTextEditorWidgetProps) {
|
||||
super.componentDidUpdate(prevProps);
|
||||
if (this.props.defaultText) {
|
||||
if (this.props.defaultText !== prevProps.defaultText) {
|
||||
this.updateWidgetMetaProperty("text", this.props.defaultText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onValueChange = (text: string) => {
|
||||
this.updateWidgetMetaProperty("text", text);
|
||||
if (this.props.onTextChange) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user