fix: enable event-type booking field url with api v2 (#19577)
Post release / release (push) Canceled after 0s

* fix: enable event-type booking field url with api v2

* fixup! fix: enable event-type booking field url with api v2

* fixup! fixup! fix: enable event-type booking field url with api v2

* fixup! fixup! fixup! fix: enable event-type booking field url with api v2
This commit is contained in:
Morgan authored and GitHub committed 2025-02-26 19:12:41 +00:00
1 parent 6b7ced262d
commit af524d9e93
11 files changed
+425 -29

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@
"@axiomhq/winston": "^1.2.0",
"@calcom/platform-constants": "*",
"@calcom/platform-enums": "*",
"@calcom/platform-libraries": "npm:@calcom/[email protected]0",
"@calcom/platform-libraries": "npm:@calcom/[email protected]6",
"@calcom/platform-libraries-0.0.2": "npm:@calcom/[email protected]",
"@calcom/platform-types": "*",
"@calcom/platform-utils": "*",
@@ -309,6 +309,23 @@ describe("Bookings Endpoints 2024-08-13", () => {
placeholder: "matrix",
disableOnPrefill: false,
},
{
name: "video-url",
type: "url",
label: "video url",
sources: [
{
id: "user",
type: "user",
label: "User",
fieldRequired: true,
},
],
editable: "user",
required: false,
placeholder: "add video url",
disableOnPrefill: false,
},
],
},
user.id
@@ -499,6 +516,7 @@ describe("Bookings Endpoints 2024-08-13", () => {
location: "https://meet.google.com/abc-def-ghi",
bookingFieldsResponses: {
"favorite-movie": "lord of the rings",
"video-url": "http://video-url.com",
},
};
return request(app.getHttpServer())
@@ -515,6 +533,7 @@ describe("Bookings Endpoints 2024-08-13", () => {
if (responseDataIsBooking(responseBody.data)) {
const data: BookingOutput_2024_08_13 = responseBody.data;
expect(data.bookingFieldsResponses["favorite-movie"]).toEqual("lord of the rings");
expect(data.bookingFieldsResponses["video-url"]).toEqual("http://video-url.com");
} else {
throw new Error(
"Invalid response data - expected booking but received array of possibily recurring bookings"
@@ -377,6 +377,15 @@ describe("Event types Endpoints", () => {
disableOnPrefill: true,
hidden: false,
},
{
type: "url",
label: "Video Url",
slug: "video-url",
required: true,
placeholder: "add video url",
disableOnPrefill: true,
hidden: false,
},
],
scheduleId: firstSchedule.id,
bookingLimitsCount: {
@@ -478,6 +487,16 @@ describe("Event types Endpoints", () => {
hidden: false,
isDefault: false,
},
{
type: "url",
label: "Video Url",
slug: "video-url",
required: true,
placeholder: "add video url",
disableOnPrefill: true,
hidden: false,
isDefault: false,
},
{ ...defaultResponseBookingFieldTitle },
{ ...defaultResponseBookingFieldNotes },
{ ...defaultResponseBookingFieldGuests },
+144 -13
View File
@@ -8494,6 +8494,48 @@
"hidden"
]
},
"UrlFieldInput_2024_06_14": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "url",
"description": "only allowed value for type is `url`"
},
"slug": {
"type": "string",
"description": "Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
"example": "some-slug"
},
"label": {
"type": "string",
"example": "Please enter your text"
},
"required": {
"type": "boolean"
},
"placeholder": {
"type": "string",
"example": "e.g., Enter url 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 `video-url` and the URL contains query parameter `&video-url=https://youtube.com/abc`the url field will be prefilled with this value and disabled."
},
"hidden": {
"type": "boolean",
"description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both."
}
},
"required": [
"type",
"slug",
"label",
"required",
"placeholder",
"hidden"
]
},
"BusinessDaysWindow_2024_06_14": {
"type": "object",
"properties": {
@@ -9132,6 +9174,9 @@
},
{
"$ref": "#/components/schemas/BooleanFieldInput_2024_06_14"
},
{
"$ref": "#/components/schemas/UrlFieldInput_2024_06_14"
}
]
}
@@ -9519,7 +9564,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "email",
"description": "only allowed value for type is `email`",
@@ -9575,7 +9621,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "name",
"description": "only allowed value for type is `name`. Used for having 1 booking field for both first name and last name.",
@@ -9864,7 +9911,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "address",
"description": "only allowed value for type is `address`"
@@ -9927,7 +9975,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "boolean",
"description": "only allowed value for type is `boolean`"
@@ -9985,7 +10034,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "checkbox",
"description": "only allowed value for type is `checkbox`"
@@ -10055,7 +10105,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "multiemail",
"description": "only allowed value for type is `multiemail`"
@@ -10118,7 +10169,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "multiselect",
"description": "only allowed value for type is `multiselect`"
@@ -10170,6 +10222,70 @@
"isDefault"
]
},
"UrlFieldOutput_2024_06_14": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"name",
"email",
"phone",
"address",
"text",
"number",
"textarea",
"select",
"multiselect",
"multiemail",
"checkbox",
"radio",
"boolean",
"url"
],
"example": "url",
"description": "only allowed value for type is `url`"
},
"slug": {
"type": "string",
"description": "Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
"example": "some-slug"
},
"label": {
"type": "string",
"example": "Please enter your text"
},
"required": {
"type": "boolean"
},
"placeholder": {
"type": "string",
"example": "e.g., Enter url 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 `video-url` and the URL contains query parameter `&video-url=https://youtube.com/abc`the url field will be prefilled with this value and disabled."
},
"hidden": {
"type": "boolean",
"description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both."
},
"isDefault": {
"type": "object",
"default": false,
"description": "This property is always false because it's not default field but custom field",
"example": false
}
},
"required": [
"type",
"slug",
"label",
"required",
"hidden",
"isDefault"
]
},
"NumberFieldOutput_2024_06_14": {
"type": "object",
"properties": {
@@ -10188,7 +10304,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "number",
"description": "only allowed value for type is `number`"
@@ -10251,7 +10368,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "phone",
"description": "only allowed value for type is `phone`"
@@ -10312,7 +10430,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "radio",
"description": "only allowed value for type is `radio`"
@@ -10382,7 +10501,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "select",
"description": "only allowed value for type is `select`"
@@ -10456,7 +10576,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "textarea",
"description": "only allowed value for type is `textarea`"
@@ -10519,7 +10640,8 @@
"multiemail",
"checkbox",
"radio",
"boolean"
"boolean",
"url"
],
"example": "text",
"description": "only allowed value for type is `text`"
@@ -10681,6 +10803,9 @@
},
{
"$ref": "#/components/schemas/BooleanFieldOutput_2024_06_14"
},
{
"$ref": "#/components/schemas/UrlFieldOutput_2024_06_14"
}
]
}
@@ -12609,6 +12734,9 @@
},
{
"$ref": "#/components/schemas/BooleanFieldInput_2024_06_14"
},
{
"$ref": "#/components/schemas/UrlFieldInput_2024_06_14"
}
]
}
@@ -13000,6 +13128,9 @@
},
{
"$ref": "#/components/schemas/BooleanFieldOutput_2024_06_14"
},
{
"$ref": "#/components/schemas/UrlFieldOutput_2024_06_14"
}
]
}