Improved label, updating navigateTo default prams when action type is changed to navigateTo in JS actions (#5532)
* Updating navigateTo default prams when action type is changed to navigateTo * Gave default value to url, made the query params defaault to empty object rather than the empty curly braces with single quotes
This commit is contained in:
parent
2dba1558e6
commit
06de06c11f
|
|
@ -350,14 +350,18 @@ const fieldConfigs: FieldConfigs = {
|
||||||
setter: (option: TreeDropdownOption) => {
|
setter: (option: TreeDropdownOption) => {
|
||||||
const type: ActionType = option.type || option.value;
|
const type: ActionType = option.type || option.value;
|
||||||
let value = option.value;
|
let value = option.value;
|
||||||
|
let defaultParams = "";
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ActionType.integration:
|
case ActionType.integration:
|
||||||
value = `${value}.run`;
|
value = `${value}.run`;
|
||||||
break;
|
break;
|
||||||
|
case ActionType.navigateTo:
|
||||||
|
defaultParams = `'#', {}`;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return value === "none" ? "" : `{{${value}()}}`;
|
return value === "none" ? "" : `{{${value}(${defaultParams})}}`;
|
||||||
},
|
},
|
||||||
view: ViewTypes.SELECTOR_VIEW,
|
view: ViewTypes.SELECTOR_VIEW,
|
||||||
},
|
},
|
||||||
|
|
@ -456,6 +460,9 @@ const fieldConfigs: FieldConfigs = {
|
||||||
return textGetter(value, 1);
|
return textGetter(value, 1);
|
||||||
},
|
},
|
||||||
setter: (value: any, currentValue: string) => {
|
setter: (value: any, currentValue: string) => {
|
||||||
|
if (value === "") {
|
||||||
|
value = undefined;
|
||||||
|
}
|
||||||
return textSetter(value, currentValue, 1);
|
return textSetter(value, currentValue, 1);
|
||||||
},
|
},
|
||||||
view: ViewTypes.TEXT_VIEW,
|
view: ViewTypes.TEXT_VIEW,
|
||||||
|
|
@ -621,7 +628,7 @@ function renderField(props: {
|
||||||
if (fieldType === FieldType.NAVIGATION_TARGET_FIELD) {
|
if (fieldType === FieldType.NAVIGATION_TARGET_FIELD) {
|
||||||
label = "Target";
|
label = "Target";
|
||||||
options = NAVIGATION_TARGET_FIELD_OPTIONS;
|
options = NAVIGATION_TARGET_FIELD_OPTIONS;
|
||||||
defaultText = "Navigation target";
|
defaultText = NAVIGATION_TARGET_FIELD_OPTIONS[0].label;
|
||||||
}
|
}
|
||||||
viewElement = (view as (props: SelectorViewProps) => JSX.Element)({
|
viewElement = (view as (props: SelectorViewProps) => JSX.Element)({
|
||||||
options: options,
|
options: options,
|
||||||
|
|
@ -667,7 +674,7 @@ function renderField(props: {
|
||||||
if (fieldType === FieldType.ALERT_TEXT_FIELD) {
|
if (fieldType === FieldType.ALERT_TEXT_FIELD) {
|
||||||
fieldLabel = "Message";
|
fieldLabel = "Message";
|
||||||
} else if (fieldType === FieldType.URL_FIELD) {
|
} else if (fieldType === FieldType.URL_FIELD) {
|
||||||
fieldLabel = "Page Name";
|
fieldLabel = "Page Name or URL";
|
||||||
} else if (fieldType === FieldType.KEY_TEXT_FIELD) {
|
} else if (fieldType === FieldType.KEY_TEXT_FIELD) {
|
||||||
fieldLabel = "Key";
|
fieldLabel = "Key";
|
||||||
} else if (fieldType === FieldType.VALUE_TEXT_FIELD) {
|
} else if (fieldType === FieldType.VALUE_TEXT_FIELD) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user