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 &&
|
||||||
data.displayFormat === POST_BODY_FORMAT_OPTIONS[0].value
|
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];
|
const body = data.actionConfiguration.body[0];
|
||||||
action = {
|
action = {
|
||||||
...data,
|
...data,
|
||||||
|
|
@ -36,7 +36,7 @@ export const transformRestAction = (data: any): any => {
|
||||||
data.displayFormat &&
|
data.displayFormat &&
|
||||||
data.displayFormat === POST_BODY_FORMAT_OPTIONS[1].value
|
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];
|
const body = data.actionConfiguration.body[1];
|
||||||
if (typeof data.actionConfiguration.body === "object") {
|
if (typeof data.actionConfiguration.body === "object") {
|
||||||
action = {
|
action = {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ abstract class BaseWidget<
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
static getMetaPropertiesMap(): Record<string, string> {
|
static getMetaPropertiesMap(): Record<string, any> {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class CheckboxWidget extends BaseWidget<CheckboxWidgetProps, WidgetState> {
|
||||||
|
|
||||||
static getMetaPropertiesMap(): Record<string, any> {
|
static getMetaPropertiesMap(): Record<string, any> {
|
||||||
return {
|
return {
|
||||||
isChecked: false,
|
isChecked: undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
||||||
static getMetaPropertiesMap(): Record<string, any> {
|
static getMetaPropertiesMap(): Record<string, any> {
|
||||||
return {
|
return {
|
||||||
selectedOptionValue: undefined,
|
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) => {
|
updateCenter = (lat: number, lng: number) => {
|
||||||
this.updateWidgetMetaProperty("center", { lat, lng });
|
this.updateWidgetMetaProperty("center", { lat, lng });
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class RadioGroupWidget extends BaseWidget<RadioGroupWidgetProps, WidgetState> {
|
||||||
|
|
||||||
static getMetaPropertiesMap(): Record<string, any> {
|
static getMetaPropertiesMap(): Record<string, any> {
|
||||||
return {
|
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) => {
|
onValueChange = (text: string) => {
|
||||||
this.updateWidgetMetaProperty("text", text);
|
this.updateWidgetMetaProperty("text", text);
|
||||||
if (this.props.onTextChange) {
|
if (this.props.onTextChange) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user