Skip to content

Commit 0b8ba5c

Browse files
authored
Notion - properties updates to Create Page from Data Source (#18452)
* updates * pnpm-lock.yaml
1 parent 34c7a1a commit 0b8ba5c

File tree

4 files changed

+30
-51
lines changed

4 files changed

+30
-51
lines changed

components/cratedb_cloud/cratedb_cloud.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/notion/actions/create-page-from-database/create-page-from-database.mjs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import NOTION_ICONS from "../../common/notion-icons.mjs";
22
import utils from "../../common/utils.mjs";
33
import notion from "../../notion.app.mjs";
44
import base from "../common/base-page-builder.mjs";
5+
import pick from "lodash-es/pick.js";
56

67
export default {
78
...base,
89
key: "notion-create-page-from-database",
910
name: "Create Page from Data Source",
1011
description: "Create a page from a data source. [See the documentation](https://developers.notion.com/reference/post-page)",
11-
version: "1.0.2",
12+
version: "1.0.3",
1213
type: "action",
1314
props: {
1415
notion,
@@ -19,13 +20,26 @@ export default {
1920
],
2021
label: "Parent Data Source ID",
2122
description: "Select a parent data source or provide a data source ID",
23+
reloadProps: true,
2224
},
2325
Name: {
2426
type: "string",
2527
label: "Name",
2628
description: "The name of the page. Use this only if the data source has a `title` property named `Name`. Otherwise, use the `Properties` prop below to set the title property.",
2729
optional: true,
2830
},
31+
propertyTypes: {
32+
propDefinition: [
33+
notion,
34+
"propertyTypes",
35+
(c) => ({
36+
parentId: c.parentDataSource,
37+
parentType: "data_source",
38+
}),
39+
],
40+
description: "Select one or more page properties. Willl override properties set in the `Properties` prop below.",
41+
reloadProps: true,
42+
},
2943
properties: {
3044
type: "object",
3145
label: "Properties",
@@ -57,6 +71,13 @@ export default {
5771
],
5872
},
5973
},
74+
async additionalProps() {
75+
const { properties } = await this.notion.retrieveDataSource(this.parentDataSource);
76+
const selectedProperties = pick(properties, this.propertyTypes);
77+
return this.buildAdditionalProps({
78+
properties: selectedProperties,
79+
});
80+
},
6081
methods: {
6182
...base.methods,
6283
/**

components/notion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/notion",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Pipedream Notion Components",
55
"main": "notion.app.mjs",
66
"keywords": [

pnpm-lock.yaml

Lines changed: 6 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)