Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(monday): add create board action #1869

Open
wants to merge 1 commit into
base: AUT-964
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 70 additions & 0 deletions packages/backend/src/apps/monday/actions/create-board/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import defineAction from '../../../../helpers/define-action.js';

export default defineAction({
name: 'Create board',
key: 'createBoard',
description: 'Creates a new board.',
arguments: [
{
label: 'Board Name',
key: 'boardName',
type: 'string',
required: true,
description: 'Title for the board.',
variables: true,
},
{
label: 'Board Kind',
key: 'boardKind',
type: 'dropdown',
required: true,
description: '',
variables: true,
options: [
{
label: 'Main',
value: 'public',
},
{
label: 'Private',
value: 'private',
},
{
label: 'Shareable',
value: 'share',
},
],
},
{
label: 'Template ID',
key: 'templateId',
type: 'string',
required: false,
description:
"When you switch on developer mode, you'll spot the template IDs in your template store. Additionally, you have the option to utilize the Board ID from any board you've saved as a template.",
variables: true,
},
],

async run($) {
const { boardName, boardKind, templateId } = $.step.parameters;

const body = {
query: `mutation {
create_board (board_name: "${boardName}", board_kind: ${boardKind}${
templateId ? `, template_id: ${templateId}` : ''
}) {
id
name
board_kind
}
}`,
};

const { data } = await $.http.post('/', body);

$.setActionItem({
raw: data,
});
},
});
3 changes: 3 additions & 0 deletions packages/backend/src/apps/monday/actions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import createBoard from './create-board/index.js';

export default [createBoard];
2 changes: 2 additions & 0 deletions packages/backend/src/apps/monday/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import defineApp from '../../helpers/define-app.js';
import addAuthHeader from './common/add-auth-header.js';
import auth from './auth/index.js';
import triggers from './triggers/index.js';
import actions from './actions/index.js';

export default defineApp({
name: 'Monday',
Expand All @@ -15,4 +16,5 @@ export default defineApp({
beforeRequest: [addAuthHeader],
auth,
triggers,
actions,
});
1 change: 1 addition & 0 deletions packages/docs/pages/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export default defineConfig({
collapsible: true,
collapsed: true,
items: [
{ text: 'Actions', link: '/apps/monday/actions' },
{ text: 'Triggers', link: '/apps/monday/triggers' },
{ text: 'Connection', link: '/apps/monday/connection' },
],
Expand Down
12 changes: 12 additions & 0 deletions packages/docs/pages/apps/monday/actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
favicon: /favicons/monday.svg
items:
- name: Create board
desc: Creates a new board.
---

<script setup>
import CustomListing from '../../components/CustomListing.vue'
</script>

<CustomListing />