Skip to content

Commit

Permalink
Adding status options and adjusting doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
GTFalcao committed Feb 11, 2025
1 parent 8c69d2c commit 43a3d33
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 7 deletions.
10 changes: 8 additions & 2 deletions components/monday/actions/common/common-create-item.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import constants from "../../common/constants.mjs";
import { capitalizeWord } from "../../common/utils.mjs";
import monday from "../../monday.app.mjs";

export default {
Expand All @@ -20,26 +22,30 @@ export default {
if (!this.columns) {
return props;
}
let options;
for (const column of this.columns) {
let description;
if (column === "status") {
description = "The status of the item. [See more about status values here](https://view.monday.com/1073554546-ad9f20a427a16e67ded630108994c11b?r=use1).";
options = constants.STATUS_OPTIONS;
} else if (column === "person") {
description = "The ID of a person/user.";
} else if (column === "date4") {
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
...common,
key: "monday-get-column-values",
name: "Get Column Values",
description: "Return values of specific column(s) for a board item. [See the documentation](https://developer.monday.com/api-reference/docs/column-values-v2)",
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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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)",
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: {
Expand All @@ -22,7 +22,7 @@ export default {
value: {
type: "string",
label: "Value",
description: "The value to search for. [See the 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,15 +7,15 @@ export default {
...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)",
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: {
type: "alert",
alertType: "info",
content: "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.",
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: {
...common.props.boardId,
Expand Down
164 changes: 164 additions & 0 deletions components/monday/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,172 @@ const BOARD_TYPE = {
SUB_ITEMS_BOARD: "sub_items_board",
};

const STATUS_OPTIONS = [
{
label: "Grey",
value: "5",
},
{
label: "Orange",
value: "0",
},
{
label: "Green Shadow",
value: "1",
},
{
label: "Red Shadow",
value: "2",
},
{
label: "Blue Links",
value: "3",
},
{
label: "Purple",
value: "4",
},
{
label: "Grass Green",
value: "6",
},
{
label: "Bright Blue",
value: "7",
},
{
label: "Mustered",
value: "8",
},
{
label: "Yellow",
value: "9",
},
{
label: "Soft Black",
value: "10",
},
{
label: "Dark Red",
value: "11",
},
{
label: "Dark Pink",
value: "12",
},
{
label: "Light Pink",
value: "13",
},
{
label: "Dark Purple",
value: "14",
},
{
label: "Lime Green",
value: "15",
},
{
label: "Turquoise",
value: "16",
},
{
label: "Trolley Grey",
value: "17",
},
{
label: "Brown",
value: "18",
},
{
label: "Dark Orange",
value: "19",
},
{
label: "Sunset",
value: "101",
},
{
label: "Bubble",
value: "102",
},
{
label: "Peach",
value: "103",
},
{
label: "Berry",
value: "104",
},
{
label: "Winter",
value: "105",
},
{
label: "River",
value: "106",
},
{
label: "Navy",
value: "107",
},
{
label: "Australia",
value: "108",
},
{
label: "Indigo",
value: "109",
},
{
label: "Dark Indigo",
value: "110",
},
{
label: "Pecan",
value: "151",
},
{
label: "Light Magic",
value: "152",
},
{
label: "Sky",
value: "153",
},
{
label: "Cold Blue",
value: "154",
},
{
label: "Kids",
value: "155",
},
{
label: "Purple Gray",
value: "156",
},
{
label: "Corona",
value: "157",
},
{
label: "Sail",
value: "158",
},
{
label: "Old Rose",
value: "159",
},
{
label: "Eden",
value: "160",
},
];

export default {
BOARD_KIND_OPTIONS,
COLUMN_TYPE_OPTIONS,
BOARD_TYPE,
STATUS_OPTIONS,
};
4 changes: 4 additions & 0 deletions components/monday/common/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function toNumber(value) {
: strNumber(value);
}

export function capitalizeWord(str) {
return str.slice(0, 1).toUpperCase() + str.slice(1);
}

export default {
emptyStrToUndefined,
strinfied,
Expand Down

0 comments on commit 43a3d33

Please sign in to comment.