Skip to content

Commit c5969a4

Browse files
committed
wip
1 parent 32b1d60 commit c5969a4

File tree

5 files changed

+170
-1
lines changed

5 files changed

+170
-1
lines changed

components/add_to_calendar_pro/actions/create-event/create-event.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export default {
9595
addToCalendarPro,
9696
"landingPageTemplateId",
9797
],
98+
optional: true,
9899
},
99100
},
100101
async run({ $ }) {
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-create-landing-page-template",
5+
name: "Create Landing Page Template",
6+
description: "Create a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#add-a-landing-page-template)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
name: {
12+
type: "string",
13+
label: "Name",
14+
description: "The name of the landing page template",
15+
},
16+
title: {
17+
type: "string",
18+
label: "Title",
19+
description: "The title of the landing page template",
20+
optional: true,
21+
},
22+
intro: {
23+
type: "string",
24+
label: "Intro",
25+
description: "The intro of the landing page template",
26+
optional: true,
27+
},
28+
legal: {
29+
type: "string",
30+
label: "Legal",
31+
description: "The legal footer text; allows for HTML",
32+
optional: true,
33+
},
34+
highlightColor: {
35+
type: "string",
36+
label: "Highlight Color",
37+
description: "Hex code; used for buttons and decorative elements",
38+
optional: true,
39+
},
40+
backgroundColor1: {
41+
type: "string",
42+
label: "Background Color 1",
43+
description: "Hex code; used for the background of the template",
44+
optional: true,
45+
},
46+
backgroundColor2: {
47+
type: "string",
48+
label: "Background Color 2",
49+
description: "Hex code; used for the background of the template",
50+
optional: true,
51+
},
52+
background: {
53+
type: "string",
54+
label: "Background",
55+
description: "Background of the template",
56+
options: [
57+
"solid",
58+
"gradient",
59+
"image",
60+
"preset",
61+
],
62+
optional: true,
63+
},
64+
gradientDirection: {
65+
type: "string",
66+
label: "Gradient Direction",
67+
description: "The direction of the gradient. Only used if `background` is `gradient`.",
68+
options: [
69+
"linear-t",
70+
"linear-tr",
71+
"linear-r",
72+
"linear-br",
73+
"radial",
74+
],
75+
optional: true,
76+
},
77+
imageRepeat: {
78+
type: "boolean",
79+
label: "Image Repeat",
80+
description: "Whether to show the background image fullscreen or repeat it",
81+
optional: true,
82+
},
83+
metaTitleOverride: {
84+
type: "string",
85+
label: "Meta Title Override",
86+
description: "Text that overrides the auto-generated meta title",
87+
optional: true,
88+
},
89+
metaDescriptionOverride: {
90+
type: "string",
91+
label: "Meta Description Override",
92+
description: "Text that overrides the auto-generated meta description",
93+
optional: true,
94+
},
95+
},
96+
async run({ $ }) {
97+
const response = await this.addToCalendarPro.createLandingPageTemplate({
98+
$,
99+
data: {
100+
name: this.name,
101+
title: this.title,
102+
intro: this.intro,
103+
legal: this.legal,
104+
highlight_color: this.highlightColor,
105+
background_color_1: this.backgroundColor1,
106+
background_color_2: this.backgroundColor2,
107+
background: this.background,
108+
gradient_direction: this.gradientDirection,
109+
image_repeat: this.imageRepeat,
110+
meta_title_override: this.metaTitleOverride,
111+
meta_description_override: this.metaDescriptionOverride,
112+
},
113+
});
114+
$.export("$summary", "Successfully created landing page template.");
115+
return response;
116+
},
117+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-delete-landing-page-template",
5+
name: "Delete Landing Page Template",
6+
description: "Delete a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#delete-a-landing-page-template)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
landingPageTemplateId: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"landingPageTemplateId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.addToCalendarPro.deleteLandingPageTemplate({
20+
$,
21+
landingPageTemplateId: this.landingPageTemplateId,
22+
});
23+
$.export("$summary", "Successfully deleted landing page template.");
24+
return response;
25+
},
26+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-get-landing-page-template",
5+
name: "Get Landing Page Template",
6+
description: "Get a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#get-one-landing-page-template)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
landingPageTemplateId: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"landingPageTemplateId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.addToCalendarPro.getLandingPageTemplate({
20+
$,
21+
landingPageTemplateId: this.landingPageTemplateId,
22+
});
23+
$.export("$summary", "Successfully retrieved landing page template.");
24+
return response;
25+
},
26+
};

components/add_to_calendar_pro/add_to_calendar_pro.app.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default {
3333
type: "string",
3434
label: "Landing Page Template ID",
3535
description: "The ID of a landing page template",
36-
optional: true,
3736
async options() {
3837
const templates = await this.listLandingPageTemplates();
3938
return templates?.map((template) => ({

0 commit comments

Comments
 (0)