Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions components/monday/actions/common/common-create-item.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { capitalizeWord } from "../../common/utils.mjs";
import monday from "../../monday.app.mjs";

export default {
Expand All @@ -11,7 +12,7 @@ export default {
}),
],
type: "string[]",
description: "Select columns to fill",
description: "Select which item columns to set values for.",
reloadProps: true,
},
},
Expand All @@ -20,26 +21,47 @@ export default {
if (!this.columns) {
return props;
}
const columnData = await this.monday.listColumns({
boardId: +this.boardId,
});
for (const column of this.columns) {
let description;
if (column === "status") {
description = "Value for status. [Status Index Value Map](https://view.monday.com/1073554546-ad9f20a427a16e67ded630108994c11b?r=use1)";
let description, options;
const columnOptions = columnData.find(({ id }) => id === column)?.settings_str;
if (columnOptions) {
try {
options = Object.entries(JSON.parse(columnOptions).labels).map(([
value,
label,
]) => ({
label: label !== ""
? label
: value,
value,
}));
} catch (err) {
console.log(`Error parsing options for column "${column}": ${err}`);
}
}
if (column.endsWith("status")) {
description = "A status value for the item. [See more about status values here](https://view.monday.com/1073554546-ad9f20a427a16e67ded630108994c11b?r=use1).";
} else if (column === "person") {
description = "The ID of the person/user to add to item";
description = "The ID of a person/user.";
} else if (column === "date4") {
description = "Enter date of item in YYYY-MM-DD format. Eg. `2022-09-02`";
description = "A date string in `YYYY-MM-DD` format, e.g. `2022-09-02`.";
} else {
description = `Value for column ${column}. See the [Column Type Reference](https://developer.monday.com/api-reference/docs/column-types-reference) to learn more about entering column type values.`;
description = `Value for column ${column}. See the [Column Type Reference](https://developer.monday.com/api-reference/reference/column-types-reference) to learn more about entering column type values.`;
}
props[column] = {
type: "string",
label: column,
label: capitalizeWord(column),
description,
options,
};
}
return props;
},
methods: {
capitalizeWord,
getEmailValue(value) {
let email = value;
if (typeof value === "string") {
Expand Down
4 changes: 2 additions & 2 deletions components/monday/actions/create-board/create-board.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import monday from "../../monday.app.mjs";
export default {
key: "monday-create-board",
name: "Create Board",
description: "Creates a new board. [See the documentation](https://api.developer.monday.com/docs/boards#create-a-board)",
description: "Creates a new board. [See the documentation](https://developer.monday.com/api-reference/reference/boards#create-a-board)",
type: "action",
version: "0.0.7",
version: "0.0.8",
props: {
monday,
boardName: {
Expand Down
10 changes: 5 additions & 5 deletions components/monday/actions/create-column/create-column.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Create Column",
description: "Creates a column. [See the documentation](https://developer.monday.com/api-reference/reference/columns#create-a-column)",
type: "action",
version: "0.0.8",
version: "0.0.9",
props: {
monday,
boardId: {
Expand All @@ -18,19 +18,19 @@ export default {
title: {
type: "string",
label: "Title",
description: "The new column's title.",
description: "The title of the new column.",
},
columnType: {
type: "string",
label: "Column Type",
description: "The new column's title",
description: "The type of the new column.",
options: constants.COLUMN_TYPE_OPTIONS,
reloadProps: true,
},
description: {
type: "string",
label: "Description",
description: "The column's description.",
description: "The description of the new column.",
optional: true,
},
},
Expand All @@ -39,7 +39,7 @@ export default {
const defaults = {
type: "string",
label: "Defaults",
description: "The new column's defaults. For use with column types `status` or `dropdown`. [See the documentation](https://developer.monday.com/api-reference/reference/columns#create-a-status-or-dropdown-column-with-custom-labels) for additional information.",
description: "The new column's defaults. For use with column types `status` or `dropdown`. [See the documentation](https://developer.monday.com/api-reference/reference/columns#create-a-status-or-dropdown-column-with-custom-labels) for more information.",
optional: true,
};
if (this.columnType === "status") {
Expand Down
4 changes: 2 additions & 2 deletions components/monday/actions/create-group/create-group.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import monday from "../../monday.app.mjs";
export default {
key: "monday-create-group",
name: "Create Group",
description: "Creates a new group in a specific board. [See the documentation](https://api.developer.monday.com/docs/groups-queries#create-a-group)",
description: "Creates a new group in a specific board. [See the documentation](https://developer.monday.com/api-reference/reference/groups#create-a-group)",
type: "action",
version: "0.0.8",
version: "0.0.9",
props: {
monday,
boardId: {
Expand Down
4 changes: 2 additions & 2 deletions components/monday/actions/create-item/create-item.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default {
...commonCreateItem,
key: "monday-create-item",
name: "Create Item",
description: "Creates an item. [See the documentation](https://api.developer.monday.com/docs/items-queries#create-an-item)",
description: "Creates an item. [See the documentation](https://developer.monday.com/api-reference/reference/items#create-an-item)",
type: "action",
version: "0.0.10",
version: "0.0.11",
props: {
monday,
boardId: {
Expand Down
6 changes: 3 additions & 3 deletions components/monday/actions/create-subitem/create-subitem.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
name: "Create Subitem",
description: "Creates a subitem. [See the documentation](https://developer.monday.com/api-reference/reference/subitems#create-a-subitem)",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
monday,
boardId: {
Expand All @@ -26,14 +26,14 @@ export default {
}),
],
optional: false,
description: "The parent item's unique identifier",
description: "Select a parent item or provide an item ID.",
},
itemName: {
propDefinition: [
monday,
"itemName",
],
description: "The new subitem's name",
description: "The new subitem's name.",
},
...commonCreateItem.props,
},
Expand Down
4 changes: 2 additions & 2 deletions components/monday/actions/create-update/create-update.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Create an Update",
description: "Creates a new update. [See the documentation](https://developer.monday.com/api-reference/reference/updates#create-an-update)",
type: "action",
version: "0.0.10",
version: "0.0.11",
props: {
monday,
updateBody: {
Expand All @@ -33,7 +33,7 @@ export default {
},
parentId: {
label: "Parent Update ID",
description: "The parent post identifier",
description: "Select a parent update or provide an update ID.",
propDefinition: [
monday,
"updateId",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default {
...common,
key: "monday-get-column-values",
name: "Get Column Values",
description: "Return values of a specific column or columns for a board item. [See the documentation](https://developer.monday.com/api-reference/docs/column-values-v2)",
version: "0.0.5",
description: "Return values of specific column(s) for a board item. [See the documentation](https://developer.monday.com/api-reference/reference/column-values-v2)",
version: "0.0.6",
type: "action",
props: {
...common.props,
Expand All @@ -29,7 +29,7 @@ export default {
],
type: "string[]",
label: "Columns",
description: "Return data from the specified column(s)",
description: "Select the column(s) to return data from.",
optional: true,
},
},
Expand All @@ -49,7 +49,7 @@ export default {
throw new Error(response.errors[0].message);
}

$.export("$summary", `Successfully retrieved column values for item with ID ${this.itemId}.`);
$.export("$summary", `Successfully retrieved column values for item with ID ${this.itemId}`);

return this.formatColumnValues(response.data.items);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default {
...common,
key: "monday-get-items-by-column-value",
name: "Get Items By Column Value",
description: "Searches a column for items matching a value. [See the documentation](https://developer.monday.com/api-reference/docs/items-page-by-column-values)",
version: "0.0.5",
description: "Searches a column for items matching a value. [See the documentation](https://developer.monday.com/api-reference/reference/items-page-by-column-values)",
version: "0.0.6",
type: "action",
props: {
...common.props,
Expand All @@ -22,7 +22,7 @@ export default {
value: {
type: "string",
label: "Value",
description: "The value to serach for. [See documentation](https://developer.monday.com/api-reference/docs/items-by-column-values#supported-limited-support-and-unsupported-columns) for additional information about column values.",
description: "The value to search for. [See the documentation](https://developer.monday.com/api-reference/reference/items-page-by-column-values#supported-and-unsupported-columns) for additional information about column values.",
},
},
async run({ $ }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
...common,
key: "monday-update-column-values",
name: "Update Column Values",
description: "Update multiple column values of an item. [See the documentation](https://developer.monday.com/api-reference/docs/columns#change-multiple-column-values)",
version: "0.0.5",
description: "Update multiple column values of an item. [See the documentation](https://developer.monday.com/api-reference/reference/columns#change-multiple-column-values)",
version: "0.0.6",
type: "action",
props: {
...common.props,
updateInfoBox: {

Check warning on line 15 in components/monday/actions/update-column-values/update-column-values.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop updateInfoBox must have a label. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 15 in components/monday/actions/update-column-values/update-column-values.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop updateInfoBox must have a description. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: "See the [Column types reference](https://developer.monday.com/api-reference/reference/column-types-reference) to find the proper data structures for supported column types.",
},
boardId: {

Check warning on line 20 in components/monday/actions/update-column-values/update-column-values.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop boardId must have a label. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 20 in components/monday/actions/update-column-values/update-column-values.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop boardId must have a description. See https://pipedream.com/docs/components/guidelines/#props
...common.props.boardId,
description: "The board's unique identifier. See the [Column types reference](https://developer.monday.com/api-reference/docs/column-types-reference) to find the proper data structures for supported column types.",
reloadProps: true,
},
itemId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import monday from "../../monday.app.mjs";
export default {
key: "monday-update-item-name",
name: "Update Item Name",
description: "Update an item's name. [See the documentation](https://api.developer.monday.com/docs/item-name)",
description: "Update an item's name. [See the documentation](https://developer.monday.com/api-reference/reference/columns#change-multiple-column-values)",
type: "action",
version: "0.0.9",
version: "0.0.10",
props: {
monday,
boardId: {
Expand Down
Loading
Loading