refactor: v2 and booker atom booking fields (#17168)

* handle storing disableOnPrefill

* feat: allow overriding properties of default name and email fields

* feat: allow overriding properties of default name and email fields

* feat: output booking fields

* fix: event type test

* refactor: booker atom booking fields handling

* tests

* fix: boolean booking field

* update platform libraries

* fix: unit tests
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2024-10-21 13:45:30 +03:00
1 parent b7792d0d0a
commit 4e90b65884
16 files changed
+1155 -1292

No files matched your search

+172 -10
View File
@@ -5977,6 +5977,10 @@
},
"placeholder": {
"type": "string"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `phone` and the URL contains query parameter `&phone=1234567890`, the phone field will be prefilled with this value and disabled."
}
},
"required": [
@@ -6010,6 +6014,10 @@
"placeholder": {
"type": "string",
"example": "e.g., 1234 Main St"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `address` and the URL contains query parameter `&address=1234 Main St, London`, the address field will be prefilled with this value and disabled."
}
},
"required": [
@@ -6043,6 +6051,10 @@
"placeholder": {
"type": "string",
"example": "e.g., Enter text here"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `who-referred-you` and the URL contains query parameter `&who-referred-you=bob`, the text field will be prefilled with this value and disabled."
}
},
"required": [
@@ -6076,6 +6088,10 @@
"placeholder": {
"type": "string",
"example": "e.g., 100"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `calories-per-day` and the URL contains query parameter `&calories-per-day=3000`, the number field will be prefilled with this value and disabled."
}
},
"required": [
@@ -6109,6 +6125,10 @@
"placeholder": {
"type": "string",
"example": "e.g., Detailed description here..."
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `dear-diary` and the URL contains query parameter `&dear-diary=Today I shipped a feature`, the text area will be prefilled with this value and disabled."
}
},
"required": [
@@ -6152,6 +6172,10 @@
"items": {
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `language` and options of this select field are ['english', 'italian'] and the URL contains query parameter `&language=italian`, the 'italian' will be selected and the select field will be disabled."
}
},
"required": [
@@ -6192,6 +6216,10 @@
"items": {
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `consultants` and the URL contains query parameter `&consultants=en&language=it`, the 'en' and 'it' will be selected and the select field will be disabled."
}
},
"required": [
@@ -6225,6 +6253,10 @@
"placeholder": {
"type": "string",
"example": "e.g., [email protected]"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `consultants` and the URL contains query parameter `&[email protected]&[email protected]`, the these emails will be added and none more can be added."
}
},
"required": [
@@ -6264,6 +6296,10 @@
"items": {
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `notify-me` and the URL contains query parameter `&notify-me=true`, the checkbox will be selected and the checkbox field will be disabled."
}
},
"required": [
@@ -6303,6 +6339,10 @@
"items": {
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `language` and options of this select field are ['english', 'italian'] and the URL contains query parameter `&language=italian`, the 'italian' radio buttom will be selected and the select field will be disabled."
}
},
"required": [
@@ -6332,6 +6372,9 @@
},
"required": {
"type": "boolean"
},
"disableOnPrefill": {
"type": "boolean"
}
},
"required": [
@@ -6875,6 +6918,37 @@
"EmailDefaultFieldOutput_2024_06_14": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
"number",
"textarea",
"select",
"multiselect",
"multiemail",
"checkbox",
"radio",
"boolean"
],
"example": "email",
"description": "only allowed value for type is `email`",
"default": "email"
},
"label": {
"type": "string"
},
"placeholder": {
"type": "string"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&[email protected]`, the email field will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": true,
@@ -6885,24 +6959,51 @@
"type": "string",
"default": "email"
},
"type": {
"type": "string",
"default": "email"
},
"required": {
"type": "boolean"
}
},
"required": [
"type",
"isDefault",
"slug",
"type",
"required"
]
},
"NameDefaultFieldOutput_2024_06_14": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
"number",
"textarea",
"select",
"multiselect",
"multiemail",
"checkbox",
"radio",
"boolean"
],
"example": "name",
"description": "only allowed value for type is `name`",
"default": "name"
},
"label": {
"type": "string"
},
"placeholder": {
"type": "string"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&name=bob`, the name field will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": true,
@@ -6913,18 +7014,14 @@
"type": "string",
"default": "name"
},
"type": {
"type": "string",
"default": "name"
},
"required": {
"type": "boolean"
}
},
"required": [
"type",
"isDefault",
"slug",
"type",
"required"
]
},
@@ -7074,6 +7171,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7105,6 +7204,10 @@
"type": "string",
"example": "e.g., 1234 Main St"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `address` and the URL contains query parameter `&address=1234 Main St, London`, the address field will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7126,6 +7229,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7153,6 +7258,9 @@
"required": {
"type": "boolean"
},
"disableOnPrefill": {
"type": "boolean"
},
"isDefault": {
"type": "object",
"default": false,
@@ -7174,6 +7282,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7211,6 +7321,10 @@
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `notify-me` and the URL contains query parameter `&notify-me=true`, the checkbox will be selected and the checkbox field will be disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7233,6 +7347,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7264,6 +7380,10 @@
"type": "string",
"example": "e.g., [email protected]"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `consultants` and the URL contains query parameter `&[email protected]&[email protected]`, the these emails will be added and none more can be added."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7285,6 +7405,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7322,6 +7444,10 @@
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `consultants` and the URL contains query parameter `&consultants=en&language=it`, the 'en' and 'it' will be selected and the select field will be disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7344,6 +7470,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7375,6 +7503,10 @@
"type": "string",
"example": "e.g., 100"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `calories-per-day` and the URL contains query parameter `&calories-per-day=3000`, the number field will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7396,6 +7528,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7425,6 +7559,10 @@
"placeholder": {
"type": "string"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `phone` and the URL contains query parameter `&phone=1234567890`, the phone field will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7446,6 +7584,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7483,6 +7623,10 @@
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `language` and options of this select field are ['english', 'italian'] and the URL contains query parameter `&language=italian`, the 'italian' radio buttom will be selected and the select field will be disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7505,6 +7649,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7546,6 +7692,10 @@
"type": "string"
}
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `language` and options of this select field are ['english', 'italian'] and the URL contains query parameter `&language=italian`, the 'italian' will be selected and the select field will be disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7568,6 +7718,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7599,6 +7751,10 @@
"type": "string",
"example": "e.g., Detailed description here..."
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `dear-diary` and the URL contains query parameter `&dear-diary=Today I shipped a feature`, the text area will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": false,
@@ -7620,6 +7776,8 @@
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
@@ -7651,6 +7809,10 @@
"type": "string",
"example": "e.g., Enter text here"
},
"disableOnPrefill": {
"type": "boolean",
"description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if the slug is `who-referred-you` and the URL contains query parameter `&who-referred-you=bob`, the text field will be prefilled with this value and disabled."
},
"isDefault": {
"type": "object",
"default": false,