Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a963d85a66 | ||
|
|
04b42decef | ||
|
|
c065566c15 | ||
|
|
3779bdb053 | ||
|
|
4124ab17d2 | ||
|
|
0e3bc92a61 | ||
|
|
b8d7e713b9 | ||
|
|
017eee8302 | ||
|
|
1b28892cf5 |
@@ -0,0 +1,53 @@
|
|||||||
|
name: "🐛 Bug Report"
|
||||||
|
description: Report a bug found while using Planka
|
||||||
|
title: "[Bug]: "
|
||||||
|
labels: ["Type: Bug", "Status: Triage"]
|
||||||
|
body:
|
||||||
|
- type: dropdown
|
||||||
|
id: issue-type
|
||||||
|
attributes:
|
||||||
|
label: Where is the problem occurring?
|
||||||
|
description: Select the part of the application where you encountered the issue.
|
||||||
|
options:
|
||||||
|
- "I encountered the problem while using the application (Frontend)"
|
||||||
|
- "I encountered the problem while interacting with the server (Backend)"
|
||||||
|
- "I'm not sure"
|
||||||
|
- type: dropdown
|
||||||
|
id: browsers
|
||||||
|
attributes:
|
||||||
|
label: What browsers are you seeing the problem on?
|
||||||
|
multiple: true
|
||||||
|
options:
|
||||||
|
- Brave
|
||||||
|
- Chrome
|
||||||
|
- Firefox
|
||||||
|
- Microsoft Edge
|
||||||
|
- Safari
|
||||||
|
- Other
|
||||||
|
- type: textarea
|
||||||
|
id: current-behavior
|
||||||
|
attributes:
|
||||||
|
label: Current behaviour
|
||||||
|
description: A description of what is currently happening, including screenshots and other useful information (**DO NOT INCLUDE PRIVATE INFORMATION**).
|
||||||
|
placeholder: Currently...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: desired-behavior
|
||||||
|
attributes:
|
||||||
|
label: Desired behaviour
|
||||||
|
description: A clear description of what you think should happen.
|
||||||
|
placeholder: In this situation, I expected ...
|
||||||
|
- type: textarea
|
||||||
|
id: reproduction
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: Clearly describe which steps or actions you have taken to arrive at the problem. If you have some experience with the code, please link to the specific pieces of code.
|
||||||
|
placeholder: I did X, then Y, before arriving at Z, when ERROR ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: other
|
||||||
|
attributes:
|
||||||
|
label: Other information
|
||||||
|
description: Any other details?
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: "✨ Feature Request"
|
||||||
|
description: Suggest a feature or enhancement to improve Planka.
|
||||||
|
labels: ["Type: Idea"]
|
||||||
|
body:
|
||||||
|
- type: dropdown
|
||||||
|
id: idea-type
|
||||||
|
attributes:
|
||||||
|
label: Is this a feature for the backend or frontend?
|
||||||
|
multiple: true
|
||||||
|
options:
|
||||||
|
- Backend
|
||||||
|
- Frontend
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: feature
|
||||||
|
attributes:
|
||||||
|
label: What would you like?
|
||||||
|
description: A clear description of the feature or enhancement wanted.
|
||||||
|
placeholder: I'd like to be able to...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: reason
|
||||||
|
attributes:
|
||||||
|
label: Why is this needed?
|
||||||
|
description: A clear description of why this would be useful to have.
|
||||||
|
placeholder: I want this because...
|
||||||
|
- type: textarea
|
||||||
|
id: other
|
||||||
|
attributes:
|
||||||
|
label: Other information
|
||||||
|
placeholder: Any other details?
|
||||||
Executable → Regular
-3
@@ -1,4 +1 @@
|
|||||||
#!/bin/sh
|
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
npx lint-staged
|
npx lint-staged
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.1.31
|
version: 0.1.34
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "1.17.4"
|
appVersion: "1.18.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- alias: postgresql
|
- alias: postgresql
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ spec:
|
|||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: .Values.existingDburlSecret
|
name: {{ .Values.existingDburlSecret }}
|
||||||
key: uri
|
key: uri
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
REACT_APP_VERSION=1.17.4
|
REACT_APP_VERSION=1.18.0
|
||||||
|
|||||||
Generated
+1037
-1649
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -65,8 +65,8 @@
|
|||||||
"dequal": "^2.0.3",
|
"dequal": "^2.0.3",
|
||||||
"easymde": "^2.18.0",
|
"easymde": "^2.18.0",
|
||||||
"history": "^5.3.0",
|
"history": "^5.3.0",
|
||||||
"i18next": "^23.11.2",
|
"i18next": "^23.11.5",
|
||||||
"i18next-browser-languagedetector": "^7.2.1",
|
"i18next-browser-languagedetector": "^8.0.0",
|
||||||
"initials": "^3.1.2",
|
"initials": "^3.1.2",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nanoid": "^5.0.7",
|
"nanoid": "^5.0.7",
|
||||||
"node-sass": "^9.0.0",
|
"node-sass": "^9.0.0",
|
||||||
"photoswipe": "^5.4.3",
|
"photoswipe": "^5.4.4",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-app-rewired": "^2.2.1",
|
"react-app-rewired": "^2.2.1",
|
||||||
@@ -83,12 +83,12 @@
|
|||||||
"react-datepicker": "^4.25.0",
|
"react-datepicker": "^4.25.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-dropzone": "^14.2.3",
|
"react-dropzone": "^14.2.3",
|
||||||
"react-i18next": "^13.5.0",
|
"react-i18next": "^14.1.2",
|
||||||
"react-input-mask": "^2.0.4",
|
"react-input-mask": "^2.0.4",
|
||||||
"react-markdown": "^8.0.7",
|
"react-markdown": "^8.0.7",
|
||||||
"react-photoswipe-gallery": "^2.2.7",
|
"react-photoswipe-gallery": "^2.2.7",
|
||||||
"react-redux": "^8.1.3",
|
"react-redux": "^8.1.3",
|
||||||
"react-router-dom": "^6.22.3",
|
"react-router-dom": "^6.23.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"react-simplemde-editor": "^5.2.0",
|
"react-simplemde-editor": "^5.2.0",
|
||||||
"react-textarea-autosize": "^8.5.3",
|
"react-textarea-autosize": "^8.5.3",
|
||||||
@@ -102,13 +102,13 @@
|
|||||||
"sails.io.js": "^1.2.1",
|
"sails.io.js": "^1.2.1",
|
||||||
"semantic-ui-react": "^2.1.5",
|
"semantic-ui-react": "^2.1.5",
|
||||||
"socket.io-client": "^2.5.0",
|
"socket.io-client": "^2.5.0",
|
||||||
"validator": "^13.11.0",
|
"validator": "^13.12.0",
|
||||||
"whatwg-fetch": "^3.6.20",
|
"whatwg-fetch": "^3.6.20",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^6.4.2",
|
"@testing-library/jest-dom": "^6.4.5",
|
||||||
"@testing-library/react": "^14.3.1",
|
"@testing-library/react": "^15.0.7",
|
||||||
"@testing-library/user-event": "^14.5.2",
|
"@testing-library/user-event": "^14.5.2",
|
||||||
"babel-preset-airbnb": "^5.0.0",
|
"babel-preset-airbnb": "^5.0.0",
|
||||||
"chai": "^4.4.1",
|
"chai": "^4.4.1",
|
||||||
@@ -116,8 +116,8 @@
|
|||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||||
"eslint-plugin-react": "^7.34.1",
|
"eslint-plugin-react": "^7.34.2",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.2",
|
||||||
"react-test-renderer": "^18.2.0"
|
"react-test-renderer": "^18.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ io.sails.environment = process.env.NODE_ENV;
|
|||||||
|
|
||||||
const { socket } = io;
|
const { socket } = io;
|
||||||
|
|
||||||
socket.path = `${Config.BASE_PATH}/socket.io`;
|
socket.path = `${Config.SERVER_BASE_PATH}/socket.io`;
|
||||||
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
||||||
|
|
||||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
|||||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useClosableForm, useField } from '../../hooks';
|
import { useClosableForm, useField } from '../../hooks';
|
||||||
|
import { focusEnd } from '../../utils/element-helpers';
|
||||||
|
|
||||||
import styles from './NameEdit.module.scss';
|
import styles from './NameEdit.module.scss';
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
field.current.ref.current.focus();
|
focusEnd(field.current.ref.current);
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
|||||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
|
import { focusEnd } from '../../../utils/element-helpers';
|
||||||
|
|
||||||
import styles from './CommentEdit.module.scss';
|
import styles from './CommentEdit.module.scss';
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
textField.current.ref.current.focus();
|
focusEnd(textField.current.ref.current);
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
|||||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useField } from '../../../hooks';
|
import { useField } from '../../../hooks';
|
||||||
|
import { focusEnd } from '../../../utils/element-helpers';
|
||||||
|
|
||||||
import styles from './NameEdit.module.scss';
|
import styles from './NameEdit.module.scss';
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
field.current.ref.current.focus();
|
focusEnd(field.current.ref.current);
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
|||||||
import { TextArea } from 'semantic-ui-react';
|
import { TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useField } from '../../hooks';
|
import { useField } from '../../hooks';
|
||||||
|
import { focusEnd } from '../../utils/element-helpers';
|
||||||
|
|
||||||
import styles from './NameEdit.module.scss';
|
import styles from './NameEdit.module.scss';
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
field.current.ref.current.select();
|
focusEnd(field.current.ref.current);
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const BASE_PATH = BASE_URL.replace(/^.*\/\/[^/]*(.*)[^?#]*.*$/, '$1');
|
|||||||
const SERVER_BASE_URL =
|
const SERVER_BASE_URL =
|
||||||
process.env.REACT_APP_SERVER_BASE_URL ||
|
process.env.REACT_APP_SERVER_BASE_URL ||
|
||||||
(process.env.NODE_ENV === 'production' ? BASE_URL : 'http://localhost:1337');
|
(process.env.NODE_ENV === 'production' ? BASE_URL : 'http://localhost:1337');
|
||||||
|
const SERVER_BASE_PATH = SERVER_BASE_URL.replace(/^.*\/\/[^/]*(.*)[^?#]*.*$/, '$1');
|
||||||
|
|
||||||
const SERVER_HOST_NAME = SERVER_BASE_URL.replace(/^(.*\/\/[^/?#]*).*$/, '$1');
|
const SERVER_HOST_NAME = SERVER_BASE_URL.replace(/^(.*\/\/[^/?#]*).*$/, '$1');
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ export default {
|
|||||||
VERSION,
|
VERSION,
|
||||||
BASE_PATH,
|
BASE_PATH,
|
||||||
SERVER_BASE_URL,
|
SERVER_BASE_URL,
|
||||||
|
SERVER_BASE_PATH,
|
||||||
SERVER_HOST_NAME,
|
SERVER_HOST_NAME,
|
||||||
ACCESS_TOKEN_KEY,
|
ACCESS_TOKEN_KEY,
|
||||||
ACCESS_TOKEN_VERSION_KEY,
|
ACCESS_TOKEN_VERSION_KEY,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// eslint-disable-next-line import/prefer-default-export
|
||||||
|
export const focusEnd = (element) => {
|
||||||
|
element.focus();
|
||||||
|
element.setSelectionRange(element.value.length + 1, element.value.length + 1);
|
||||||
|
};
|
||||||
@@ -45,6 +45,15 @@ services:
|
|||||||
# - SMTP_PASSWORD=
|
# - SMTP_PASSWORD=
|
||||||
# - SMTP_FROM="Demo Demo" <demo@demo.demo>
|
# - SMTP_FROM="Demo Demo" <demo@demo.demo>
|
||||||
|
|
||||||
|
# Optional fields: accessToken, events, excludedEvents
|
||||||
|
# - |
|
||||||
|
# WEBHOOKS=[{
|
||||||
|
# "url": "http://localhost:3001",
|
||||||
|
# "accessToken": "notaccesstoken",
|
||||||
|
# "events": ["cardCreate", "cardUpdate", "cardDelete"],
|
||||||
|
# "excludedEvents": ["notificationCreate", "notificationUpdate"]
|
||||||
|
# }]
|
||||||
|
|
||||||
# - SLACK_BOT_TOKEN=
|
# - SLACK_BOT_TOKEN=
|
||||||
# - SLACK_CHANNEL_ID=
|
# - SLACK_CHANNEL_ID=
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,15 @@ services:
|
|||||||
# - SMTP_PASSWORD=
|
# - SMTP_PASSWORD=
|
||||||
# - SMTP_FROM="Demo Demo" <demo@demo.demo>
|
# - SMTP_FROM="Demo Demo" <demo@demo.demo>
|
||||||
|
|
||||||
|
# Optional fields: accessToken, events, excludedEvents
|
||||||
|
# - |
|
||||||
|
# WEBHOOKS=[{
|
||||||
|
# "url": "http://localhost:3001",
|
||||||
|
# "accessToken": "notaccesstoken",
|
||||||
|
# "events": ["cardCreate", "cardUpdate", "cardDelete"],
|
||||||
|
# "excludedEvents": ["notificationCreate", "notificationUpdate"]
|
||||||
|
# }]
|
||||||
|
|
||||||
# - SLACK_BOT_TOKEN=
|
# - SLACK_BOT_TOKEN=
|
||||||
# - SLACK_CHANNEL_ID=
|
# - SLACK_CHANNEL_ID=
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
Generated
+80
-71
@@ -1,39 +1,30 @@
|
|||||||
{
|
{
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.17.4",
|
"version": "1.18.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.17.4",
|
"version": "1.18.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"concurrently": "^8.2.2",
|
"concurrently": "^8.2.2",
|
||||||
"husky": "^8.0.3",
|
"husky": "^9.0.1",
|
||||||
"lint-staged": "^15.2.2"
|
"lint-staged": "^15.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"prettier": "^3.2.5"
|
"prettier": "^3.3.0"
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
|
||||||
"version": "1.2.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
|
|
||||||
"integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/runtime": {
|
"node_modules/@babel/runtime": {
|
||||||
"version": "7.24.4",
|
"version": "7.24.6",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.4.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.6.tgz",
|
||||||
"integrity": "sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==",
|
"integrity": "sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"regenerator-runtime": "^0.14.0"
|
"regenerator-runtime": "^0.14.0"
|
||||||
},
|
},
|
||||||
@@ -276,11 +267,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braces": {
|
"node_modules/braces": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fill-range": "^7.0.1"
|
"fill-range": "^7.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@@ -427,11 +418,11 @@
|
|||||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
||||||
},
|
},
|
||||||
"node_modules/commander": {
|
"node_modules/commander": {
|
||||||
"version": "11.1.0",
|
"version": "12.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
|
||||||
"integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
|
"integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/concat-map": {
|
"node_modules/concat-map": {
|
||||||
@@ -495,9 +486,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz",
|
||||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
"integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ms": "2.1.2"
|
"ms": "2.1.2"
|
||||||
},
|
},
|
||||||
@@ -810,9 +801,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fill-range": {
|
"node_modules/fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"to-regex-range": "^5.0.1"
|
"to-regex-range": "^5.0.1"
|
||||||
},
|
},
|
||||||
@@ -896,6 +887,7 @@
|
|||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||||
|
"deprecated": "Glob versions prior to v9 are no longer supported",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs.realpath": "^1.0.0",
|
"fs.realpath": "^1.0.0",
|
||||||
@@ -962,14 +954,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/husky": {
|
"node_modules/husky": {
|
||||||
"version": "8.0.3",
|
"version": "9.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz",
|
||||||
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
|
"integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"husky": "lib/bin.js"
|
"husky": "bin.mjs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/typicode"
|
"url": "https://github.com/sponsors/typicode"
|
||||||
@@ -1013,6 +1005,7 @@
|
|||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
||||||
|
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"once": "^1.3.0",
|
"once": "^1.3.0",
|
||||||
@@ -1143,28 +1136,31 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lilconfig": {
|
"node_modules/lilconfig": {
|
||||||
"version": "3.0.0",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz",
|
||||||
"integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==",
|
"integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/antonk52"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lint-staged": {
|
"node_modules/lint-staged": {
|
||||||
"version": "15.2.2",
|
"version": "15.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.5.tgz",
|
||||||
"integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==",
|
"integrity": "sha512-j+DfX7W9YUvdzEZl3Rk47FhDF6xwDBV5wwsCPw6BwWZVPYJemusQmvb9bRsW23Sqsaa+vRloAWogbK4BUuU2zA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "5.3.0",
|
"chalk": "~5.3.0",
|
||||||
"commander": "11.1.0",
|
"commander": "~12.1.0",
|
||||||
"debug": "4.3.4",
|
"debug": "~4.3.4",
|
||||||
"execa": "8.0.1",
|
"execa": "~8.0.1",
|
||||||
"lilconfig": "3.0.0",
|
"lilconfig": "~3.1.1",
|
||||||
"listr2": "8.0.1",
|
"listr2": "~8.2.1",
|
||||||
"micromatch": "4.0.5",
|
"micromatch": "~4.0.7",
|
||||||
"pidtree": "0.6.0",
|
"pidtree": "~0.6.0",
|
||||||
"string-argv": "0.3.2",
|
"string-argv": "~0.3.2",
|
||||||
"yaml": "2.3.4"
|
"yaml": "~2.4.2"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"lint-staged": "bin/lint-staged.js"
|
"lint-staged": "bin/lint-staged.js"
|
||||||
@@ -1188,15 +1184,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/listr2": {
|
"node_modules/listr2": {
|
||||||
"version": "8.0.1",
|
"version": "8.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.1.tgz",
|
||||||
"integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==",
|
"integrity": "sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cli-truncate": "^4.0.0",
|
"cli-truncate": "^4.0.0",
|
||||||
"colorette": "^2.0.20",
|
"colorette": "^2.0.20",
|
||||||
"eventemitter3": "^5.0.1",
|
"eventemitter3": "^5.0.1",
|
||||||
"log-update": "^6.0.0",
|
"log-update": "^6.0.0",
|
||||||
"rfdc": "^1.3.0",
|
"rfdc": "^1.3.1",
|
||||||
"wrap-ansi": "^9.0.0"
|
"wrap-ansi": "^9.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1318,11 +1314,11 @@
|
|||||||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
|
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="
|
||||||
},
|
},
|
||||||
"node_modules/micromatch": {
|
"node_modules/micromatch": {
|
||||||
"version": "4.0.5",
|
"version": "4.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz",
|
||||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
"integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": "^3.0.2",
|
"braces": "^3.0.3",
|
||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1412,17 +1408,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/optionator": {
|
"node_modules/optionator": {
|
||||||
"version": "0.9.3",
|
"version": "0.9.4",
|
||||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||||
"integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
|
"integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aashutoshrathi/word-wrap": "^1.2.3",
|
|
||||||
"deep-is": "^0.1.3",
|
"deep-is": "^0.1.3",
|
||||||
"fast-levenshtein": "^2.0.6",
|
"fast-levenshtein": "^2.0.6",
|
||||||
"levn": "^0.4.1",
|
"levn": "^0.4.1",
|
||||||
"prelude-ls": "^1.2.1",
|
"prelude-ls": "^1.2.1",
|
||||||
"type-check": "^0.4.0"
|
"type-check": "^0.4.0",
|
||||||
|
"word-wrap": "^1.2.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
@@ -1528,9 +1524,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "3.2.5",
|
"version": "3.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz",
|
||||||
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
|
"integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin/prettier.cjs"
|
"prettier": "bin/prettier.cjs"
|
||||||
@@ -1666,6 +1662,7 @@
|
|||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||||
|
"deprecated": "Rimraf versions prior to v4 are no longer supported",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"glob": "^7.1.3"
|
"glob": "^7.1.3"
|
||||||
@@ -1967,6 +1964,15 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/word-wrap": {
|
||||||
|
"version": "1.2.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||||
|
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wrap-ansi": {
|
"node_modules/wrap-ansi": {
|
||||||
"version": "9.0.0",
|
"version": "9.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz",
|
||||||
@@ -2034,9 +2040,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/yaml": {
|
"node_modules/yaml": {
|
||||||
"version": "2.3.4",
|
"version": "2.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz",
|
||||||
"integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==",
|
"integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==",
|
||||||
|
"bin": {
|
||||||
|
"yaml": "bin.mjs"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 14"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.17.4",
|
"version": "1.18.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://plankanban.github.io/planka",
|
"homepage": "https://plankanban.github.io/planka",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"docker:build:base": "docker build -t ghcr.io/plankanban/planka:base-local -f Dockerfile.base .",
|
"docker:build:base": "docker build -t ghcr.io/plankanban/planka:base-local -f Dockerfile.base .",
|
||||||
"postinstall": "(cd server && npm i && cd ../client && npm i)",
|
"postinstall": "(cd server && npm i && cd ../client && npm i)",
|
||||||
"lint": "npm run server:lint && npm run client:lint",
|
"lint": "npm run server:lint && npm run client:lint",
|
||||||
"prepare": "husky install",
|
"prepare": "husky",
|
||||||
"server:console": "npm run console --prefix server",
|
"server:console": "npm run console --prefix server",
|
||||||
"server:db:init": "npm run db:init --prefix server",
|
"server:db:init": "npm run db:init --prefix server",
|
||||||
"server:db:migrate": "npm run db:migrate --prefix server",
|
"server:db:migrate": "npm run db:migrate --prefix server",
|
||||||
@@ -57,13 +57,13 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"concurrently": "^8.2.2",
|
"concurrently": "^8.2.2",
|
||||||
"husky": "^8.0.3",
|
"husky": "^9.0.1",
|
||||||
"lint-staged": "^15.2.2"
|
"lint-staged": "^15.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"prettier": "^3.2.5"
|
"prettier": "^3.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ SECRET_KEY=notsecretkey
|
|||||||
# SMTP_PASSWORD=
|
# SMTP_PASSWORD=
|
||||||
# SMTP_FROM="Demo Demo" <demo@demo.demo>
|
# SMTP_FROM="Demo Demo" <demo@demo.demo>
|
||||||
|
|
||||||
|
# Optional fields: accessToken, events, excludedEvents
|
||||||
|
# WEBHOOKS='[{
|
||||||
|
# "url": "http://localhost:3001",
|
||||||
|
# "accessToken": "notaccesstoken",
|
||||||
|
# "events": ["cardCreate", "cardUpdate", "cardDelete"],
|
||||||
|
# "excludedEvents": ["notificationCreate", "notificationUpdate"]
|
||||||
|
# }]'
|
||||||
|
|
||||||
# SLACK_BOT_TOKEN=
|
# SLACK_BOT_TOKEN=
|
||||||
# SLACK_CHANNEL_ID=
|
# SLACK_CHANNEL_ID=
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ module.exports = {
|
|||||||
async fn(inputs, exits) {
|
async fn(inputs, exits) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { card } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -83,6 +83,9 @@ module.exports = {
|
|||||||
const fileData = await sails.helpers.attachments.processUploadedFile(file);
|
const fileData = await sails.helpers.attachments.processUploadedFile(file);
|
||||||
|
|
||||||
const attachment = await sails.helpers.attachments.createOne.with({
|
const attachment = await sails.helpers.attachments.createOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
|
list,
|
||||||
values: {
|
values: {
|
||||||
...fileData,
|
...fileData,
|
||||||
card,
|
card,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
||||||
|
|
||||||
let { attachment } = path;
|
let { attachment } = path;
|
||||||
const { card, board } = path;
|
const { card, list, board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: board.id,
|
boardId: board.id,
|
||||||
@@ -49,9 +49,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attachment = await sails.helpers.attachments.deleteOne.with({
|
attachment = await sails.helpers.attachments.deleteOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
card,
|
card,
|
||||||
record: attachment,
|
record: attachment,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
||||||
|
|
||||||
let { attachment } = path;
|
let { attachment } = path;
|
||||||
const { board } = path;
|
const { card, list, board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: board.id,
|
boardId: board.id,
|
||||||
@@ -56,8 +56,12 @@ module.exports = {
|
|||||||
|
|
||||||
attachment = await sails.helpers.attachments.updateOne.with({
|
attachment = await sails.helpers.attachments.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: attachment,
|
record: attachment,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -48,14 +48,11 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board } = await sails.helpers.boards
|
const { board, project } = await sails.helpers.boards
|
||||||
.getProjectPath(inputs.boardId)
|
.getProjectPath(inputs.boardId)
|
||||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||||
|
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||||
currentUser.id,
|
|
||||||
board.projectId,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isProjectManager) {
|
if (!isProjectManager) {
|
||||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||||
@@ -71,11 +68,13 @@ module.exports = {
|
|||||||
|
|
||||||
const boardMembership = await sails.helpers.boardMemberships.createOne
|
const boardMembership = await sails.helpers.boardMemberships.createOne
|
||||||
.with({
|
.with({
|
||||||
|
project,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
board,
|
board,
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('userAlreadyBoardMember', () => Errors.USER_ALREADY_BOARD_MEMBER);
|
.intercept('userAlreadyBoardMember', () => Errors.USER_ALREADY_BOARD_MEMBER);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.BOARD_MEMBERSHIP_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_MEMBERSHIP_NOT_FOUND);
|
||||||
|
|
||||||
let { boardMembership } = path;
|
let { boardMembership } = path;
|
||||||
const { project } = path;
|
const { board, project } = path;
|
||||||
|
|
||||||
if (boardMembership.userId !== currentUser.id) {
|
if (boardMembership.userId !== currentUser.id) {
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
const isProjectManager = await sails.helpers.users.isProjectManager(
|
||||||
@@ -42,7 +42,9 @@ module.exports = {
|
|||||||
|
|
||||||
boardMembership = await sails.helpers.boardMemberships.deleteOne.with({
|
boardMembership = await sails.helpers.boardMemberships.deleteOne.with({
|
||||||
project,
|
project,
|
||||||
|
board,
|
||||||
record: boardMembership,
|
record: boardMembership,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.BOARD_MEMBERSHIP_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_MEMBERSHIP_NOT_FOUND);
|
||||||
|
|
||||||
let { boardMembership } = path;
|
let { boardMembership } = path;
|
||||||
const { project } = path;
|
const { board, project } = path;
|
||||||
|
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||||
|
|
||||||
@@ -47,7 +47,10 @@ module.exports = {
|
|||||||
|
|
||||||
boardMembership = await sails.helpers.boardMemberships.updateOne.with({
|
boardMembership = await sails.helpers.boardMemberships.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
|
board,
|
||||||
record: boardMembership,
|
record: boardMembership,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ module.exports = {
|
|||||||
project,
|
project,
|
||||||
},
|
},
|
||||||
import: boardImport,
|
import: boardImport,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
requestId: inputs.requestId,
|
requestId: inputs.requestId,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,25 +22,27 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { board } = await sails.helpers.boards
|
const path = await sails.helpers.boards
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||||
|
|
||||||
|
let { board } = path;
|
||||||
|
const { project } = path;
|
||||||
|
|
||||||
if (!board) {
|
if (!board) {
|
||||||
throw Errors.BOARD_NOT_FOUND;
|
throw Errors.BOARD_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||||
currentUser.id,
|
|
||||||
board.projectId,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isProjectManager) {
|
if (!isProjectManager) {
|
||||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||||
}
|
}
|
||||||
|
|
||||||
board = await sails.helpers.boards.deleteOne.with({
|
board = await sails.helpers.boards.deleteOne.with({
|
||||||
|
project,
|
||||||
record: board,
|
record: board,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -29,18 +29,18 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { board } = await sails.helpers.boards
|
const path = await sails.helpers.boards
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||||
|
|
||||||
|
let { board } = path;
|
||||||
|
const { project } = path;
|
||||||
|
|
||||||
if (!board) {
|
if (!board) {
|
||||||
throw Errors.BOARD_NOT_FOUND;
|
throw Errors.BOARD_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||||
currentUser.id,
|
|
||||||
board.projectId,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isProjectManager) {
|
if (!isProjectManager) {
|
||||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||||
@@ -50,7 +50,9 @@ module.exports = {
|
|||||||
|
|
||||||
board = await sails.helpers.boards.updateOne.with({
|
board = await sails.helpers.boards.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
record: board,
|
record: board,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { card } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ module.exports = {
|
|||||||
|
|
||||||
const label = await Label.findOne({
|
const label = await Label.findOne({
|
||||||
id: inputs.labelId,
|
id: inputs.labelId,
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!label) {
|
if (!label) {
|
||||||
@@ -73,10 +73,14 @@ module.exports = {
|
|||||||
|
|
||||||
const cardLabel = await sails.helpers.cardLabels.createOne
|
const cardLabel = await sails.helpers.cardLabels.createOne
|
||||||
.with({
|
.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
|
list,
|
||||||
values: {
|
values: {
|
||||||
card,
|
card,
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('labelAlreadyInCard', () => Errors.LABEL_ALREADY_IN_CARD);
|
.intercept('labelAlreadyInCard', () => Errors.LABEL_ALREADY_IN_CARD);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
@@ -66,8 +66,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cardLabel = await sails.helpers.cardLabels.deleteOne.with({
|
cardLabel = await sails.helpers.cardLabels.deleteOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: cardLabel,
|
record: cardLabel,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { card } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ module.exports = {
|
|||||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isBoardMember = await sails.helpers.users.isBoardMember(inputs.userId, card.boardId);
|
const isBoardMember = await sails.helpers.users.isBoardMember(inputs.userId, board.id);
|
||||||
|
|
||||||
if (!isBoardMember) {
|
if (!isBoardMember) {
|
||||||
throw Errors.USER_NOT_FOUND;
|
throw Errors.USER_NOT_FOUND;
|
||||||
@@ -70,10 +70,14 @@ module.exports = {
|
|||||||
|
|
||||||
const cardMembership = await sails.helpers.cardMemberships.createOne
|
const cardMembership = await sails.helpers.cardMemberships.createOne
|
||||||
.with({
|
.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
|
list,
|
||||||
values: {
|
values: {
|
||||||
card,
|
card,
|
||||||
userId: inputs.userId,
|
userId: inputs.userId,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('userAlreadyCardMember', () => Errors.USER_ALREADY_CARD_MEMBER);
|
.intercept('userAlreadyCardMember', () => Errors.USER_ALREADY_CARD_MEMBER);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
@@ -66,8 +66,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cardMembership = await sails.helpers.cardMemberships.deleteOne.with({
|
cardMembership = await sails.helpers.cardMemberships.deleteOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: cardMembership,
|
record: cardMembership,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board, list } = await sails.helpers.lists
|
const { list, board, project } = await sails.helpers.lists
|
||||||
.getProjectPath(inputs.listId)
|
.getProjectPath(inputs.listId)
|
||||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||||
|
|
||||||
@@ -99,6 +99,7 @@ module.exports = {
|
|||||||
|
|
||||||
const card = await sails.helpers.cards.createOne
|
const card = await sails.helpers.cards.createOne
|
||||||
.with({
|
.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
|
|||||||
@@ -28,12 +28,15 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { card } = await sails.helpers.cards
|
const path = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
|
let { card } = path;
|
||||||
|
const { list, board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -46,8 +49,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
card = await sails.helpers.cards.deleteOne.with({
|
card = await sails.helpers.cards.deleteOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
|
list,
|
||||||
record: card,
|
record: card,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,12 +35,12 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { card, list, board } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -60,6 +60,7 @@ module.exports = {
|
|||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
} = await sails.helpers.cards.duplicateOne.with({
|
} = await sails.helpers.cards.duplicateOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
list,
|
list,
|
||||||
record: card,
|
record: card,
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
let { card } = path;
|
let { card } = path;
|
||||||
const { list, board } = path;
|
const { list, board, project } = path;
|
||||||
|
|
||||||
let boardMembership = await BoardMembership.findOne({
|
let boardMembership = await BoardMembership.findOne({
|
||||||
boardId: board.id,
|
boardId: board.id,
|
||||||
@@ -133,9 +133,11 @@ module.exports = {
|
|||||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let nextProject;
|
||||||
let nextBoard;
|
let nextBoard;
|
||||||
|
|
||||||
if (!_.isUndefined(inputs.boardId)) {
|
if (!_.isUndefined(inputs.boardId)) {
|
||||||
({ board: nextBoard } = await sails.helpers.boards
|
({ board: nextBoard, project: nextProject } = await sails.helpers.boards
|
||||||
.getProjectPath(inputs.boardId)
|
.getProjectPath(inputs.boardId)
|
||||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND));
|
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND));
|
||||||
|
|
||||||
@@ -177,15 +179,17 @@ module.exports = {
|
|||||||
|
|
||||||
card = await sails.helpers.cards.updateOne
|
card = await sails.helpers.cards.updateOne
|
||||||
.with({
|
.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
list,
|
list,
|
||||||
record: card,
|
record: card,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
|
project: nextProject,
|
||||||
board: nextBoard,
|
board: nextBoard,
|
||||||
list: nextList,
|
list: nextList,
|
||||||
},
|
},
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('positionMustBeInValues', () => Errors.POSITION_MUST_BE_PRESENT)
|
.intercept('positionMustBeInValues', () => Errors.POSITION_MUST_BE_PRESENT)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board, card } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
@@ -55,7 +55,9 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const action = await sails.helpers.actions.createOne.with({
|
const action = await sails.helpers.actions.createOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
card,
|
card,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
|
||||||
|
|
||||||
let { action } = path;
|
let { action } = path;
|
||||||
const { board, project } = path;
|
const { card, list, board, project } = path;
|
||||||
|
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||||
|
|
||||||
@@ -60,8 +60,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
action = await sails.helpers.actions.deleteOne.with({
|
action = await sails.helpers.actions.deleteOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: action,
|
record: action,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
|
||||||
|
|
||||||
let { action } = path;
|
let { action } = path;
|
||||||
const { board, project } = path;
|
const { card, list, board, project } = path;
|
||||||
|
|
||||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||||
|
|
||||||
@@ -69,8 +69,12 @@ module.exports = {
|
|||||||
|
|
||||||
action = await sails.helpers.actions.updateOne.with({
|
action = await sails.helpers.actions.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: action,
|
record: action,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board } = await sails.helpers.boards
|
const { board, project } = await sails.helpers.boards
|
||||||
.getProjectPath(inputs.boardId)
|
.getProjectPath(inputs.boardId)
|
||||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||||
|
|
||||||
@@ -62,10 +62,12 @@ module.exports = {
|
|||||||
const values = _.pick(inputs, ['position', 'name', 'color']);
|
const values = _.pick(inputs, ['position', 'name', 'color']);
|
||||||
|
|
||||||
const label = await sails.helpers.labels.createOne.with({
|
const label = await sails.helpers.labels.createOne.with({
|
||||||
|
project,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,15 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { label } = await sails.helpers.labels
|
const path = await sails.helpers.labels
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.LABEL_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.LABEL_NOT_FOUND);
|
||||||
|
|
||||||
|
let { label } = path;
|
||||||
|
const { board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: label.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -46,7 +49,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
label = await sails.helpers.labels.deleteOne.with({
|
label = await sails.helpers.labels.deleteOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
record: label,
|
record: label,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,15 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { label } = await sails.helpers.labels
|
const path = await sails.helpers.labels
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.LABEL_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.LABEL_NOT_FOUND);
|
||||||
|
|
||||||
|
let { label } = path;
|
||||||
|
const { board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: label.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -61,7 +64,10 @@ module.exports = {
|
|||||||
|
|
||||||
label = await sails.helpers.labels.updateOne.with({
|
label = await sails.helpers.labels.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
|
board,
|
||||||
record: label,
|
record: label,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { board } = await sails.helpers.boards
|
const { board, project } = await sails.helpers.boards
|
||||||
.getProjectPath(inputs.boardId)
|
.getProjectPath(inputs.boardId)
|
||||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||||
|
|
||||||
@@ -56,10 +56,12 @@ module.exports = {
|
|||||||
const values = _.pick(inputs, ['position', 'name']);
|
const values = _.pick(inputs, ['position', 'name']);
|
||||||
|
|
||||||
const list = await sails.helpers.lists.createOne.with({
|
const list = await sails.helpers.lists.createOne.with({
|
||||||
|
project,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,15 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { list } = await sails.helpers.lists
|
const path = await sails.helpers.lists
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||||
|
|
||||||
|
let { list } = path;
|
||||||
|
const { board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: list.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -46,7 +49,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list = await sails.helpers.lists.deleteOne.with({
|
list = await sails.helpers.lists.deleteOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
record: list,
|
record: list,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { list } = await sails.helpers.lists
|
const { list, board, project } = await sails.helpers.lists
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: list.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -50,8 +50,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cards = await sails.helpers.lists.sortOne.with({
|
const cards = await sails.helpers.lists.sortOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
record: list,
|
record: list,
|
||||||
type: inputs.type,
|
type: inputs.type,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,12 +35,15 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let { list } = await sails.helpers.lists
|
const path = await sails.helpers.lists
|
||||||
.getProjectPath(inputs.id)
|
.getProjectPath(inputs.id)
|
||||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||||
|
|
||||||
|
let { list } = path;
|
||||||
|
const { board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: list.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -56,7 +59,10 @@ module.exports = {
|
|||||||
|
|
||||||
list = await sails.helpers.lists.updateOne.with({
|
list = await sails.helpers.lists.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
|
board,
|
||||||
record: list,
|
record: list,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ module.exports = {
|
|||||||
const notifications = await sails.helpers.notifications.updateMany.with({
|
const notifications = await sails.helpers.notifications.updateMany.with({
|
||||||
values,
|
values,
|
||||||
recordsOrIds: inputs.ids.split(','),
|
recordsOrIds: inputs.ids.split(','),
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ module.exports = {
|
|||||||
project,
|
project,
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('userAlreadyProjectManager', () => Errors.USER_ALREADY_PROJECT_MANAGER);
|
.intercept('userAlreadyProjectManager', () => Errors.USER_ALREADY_PROJECT_MANAGER);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ module.exports = {
|
|||||||
// TODO: check if the last one
|
// TODO: check if the last one
|
||||||
projectManager = await sails.helpers.projectManagers.deleteOne.with({
|
projectManager = await sails.helpers.projectManagers.deleteOne.with({
|
||||||
record: projectManager,
|
record: projectManager,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module.exports = {
|
|||||||
|
|
||||||
const { project, projectManager } = await sails.helpers.projects.createOne.with({
|
const { project, projectManager } = await sails.helpers.projects.createOne.with({
|
||||||
values,
|
values,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ module.exports = {
|
|||||||
|
|
||||||
project = await sails.helpers.projects.deleteOne.with({
|
project = await sails.helpers.projects.deleteOne.with({
|
||||||
record: project,
|
record: project,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ module.exports = {
|
|||||||
values: {
|
values: {
|
||||||
backgroundImage: fileData,
|
backgroundImage: fileData,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ module.exports = {
|
|||||||
project = await sails.helpers.projects.updateOne.with({
|
project = await sails.helpers.projects.updateOne.with({
|
||||||
values,
|
values,
|
||||||
record: project,
|
record: project,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
const { card } = await sails.helpers.cards
|
const { card, list, board, project } = await sails.helpers.cards
|
||||||
.getProjectPath(inputs.cardId)
|
.getProjectPath(inputs.cardId)
|
||||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: card.boardId,
|
boardId: board.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,10 +59,14 @@ module.exports = {
|
|||||||
const values = _.pick(inputs, ['position', 'name', 'isCompleted']);
|
const values = _.pick(inputs, ['position', 'name', 'isCompleted']);
|
||||||
|
|
||||||
const task = await sails.helpers.tasks.createOne.with({
|
const task = await sails.helpers.tasks.createOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
|
list,
|
||||||
values: {
|
values: {
|
||||||
...values,
|
...values,
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.TASK_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.TASK_NOT_FOUND);
|
||||||
|
|
||||||
let { task } = path;
|
let { task } = path;
|
||||||
const { board } = path;
|
const { card, list, board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: board.id,
|
boardId: board.id,
|
||||||
@@ -49,8 +49,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task = await sails.helpers.tasks.deleteOne.with({
|
task = await sails.helpers.tasks.deleteOne.with({
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: task,
|
record: task,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ module.exports = {
|
|||||||
.intercept('pathNotFound', () => Errors.TASK_NOT_FOUND);
|
.intercept('pathNotFound', () => Errors.TASK_NOT_FOUND);
|
||||||
|
|
||||||
let { task } = path;
|
let { task } = path;
|
||||||
const { board } = path;
|
const { card, list, board, project } = path;
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.findOne({
|
const boardMembership = await BoardMembership.findOne({
|
||||||
boardId: board.id,
|
boardId: board.id,
|
||||||
@@ -62,8 +62,12 @@ module.exports = {
|
|||||||
|
|
||||||
task = await sails.helpers.tasks.updateOne.with({
|
task = await sails.helpers.tasks.updateOne.with({
|
||||||
values,
|
values,
|
||||||
|
project,
|
||||||
board,
|
board,
|
||||||
|
list,
|
||||||
|
card,
|
||||||
record: task,
|
record: task,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
if (sails.config.custom.oidcEnforced) {
|
if (sails.config.custom.oidcEnforced) {
|
||||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||||
}
|
}
|
||||||
@@ -89,6 +91,7 @@ module.exports = {
|
|||||||
const user = await sails.helpers.users.createOne
|
const user = await sails.helpers.users.createOne
|
||||||
.with({
|
.with({
|
||||||
values,
|
values,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE)
|
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE)
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
let user = await sails.helpers.users.getOne(inputs.id);
|
let user = await sails.helpers.users.getOne(inputs.id);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
@@ -38,6 +40,7 @@ module.exports = {
|
|||||||
|
|
||||||
user = await sails.helpers.users.deleteOne.with({
|
user = await sails.helpers.users.deleteOne.with({
|
||||||
record: user,
|
record: user,
|
||||||
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ module.exports = {
|
|||||||
values: {
|
values: {
|
||||||
avatar: fileData,
|
avatar: fileData,
|
||||||
},
|
},
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ module.exports = {
|
|||||||
.with({
|
.with({
|
||||||
values,
|
values,
|
||||||
record: user,
|
record: user,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE);
|
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ module.exports = {
|
|||||||
user = await sails.helpers.users.updateOne.with({
|
user = await sails.helpers.users.updateOne.with({
|
||||||
values,
|
values,
|
||||||
record: user,
|
record: user,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ module.exports = {
|
|||||||
.with({
|
.with({
|
||||||
values,
|
values,
|
||||||
record: user,
|
record: user,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
})
|
})
|
||||||
.intercept('usernameAlreadyInUse', () => Errors.USERNAME_ALREADY_IN_USE);
|
.intercept('usernameAlreadyInUse', () => Errors.USERNAME_ALREADY_IN_USE);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ module.exports = {
|
|||||||
user = await sails.helpers.users.updateOne.with({
|
user = await sails.helpers.users.updateOne.with({
|
||||||
values,
|
values,
|
||||||
record: user,
|
record: user,
|
||||||
user: currentUser,
|
actorUser: currentUser,
|
||||||
request: this.req,
|
request: this.req,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,21 +14,21 @@ const valuesValidator = (value) => {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const buildAndSendSlackMessage = async (user, card, action) => {
|
const buildAndSendSlackMessage = async (card, action, actorUser) => {
|
||||||
const cardLink = `<${sails.config.custom.baseUrl}/cards/${card.id}|${card.name}>`;
|
const cardLink = `<${sails.config.custom.baseUrl}/cards/${card.id}|${card.name}>`;
|
||||||
|
|
||||||
let markdown;
|
let markdown;
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case Action.Types.CREATE_CARD:
|
case Action.Types.CREATE_CARD:
|
||||||
markdown = `${cardLink} was created by ${user.name} in *${action.data.list.name}*`;
|
markdown = `${cardLink} was created by ${actorUser.name} in *${action.data.list.name}*`;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Action.Types.MOVE_CARD:
|
case Action.Types.MOVE_CARD:
|
||||||
markdown = `${cardLink} was moved by ${user.name} to *${action.data.toList.name}*`;
|
markdown = `${cardLink} was moved by ${actorUser.name} to *${action.data.toList.name}*`;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Action.Types.COMMENT_CARD:
|
case Action.Types.COMMENT_CARD:
|
||||||
markdown = `*${user.name}* commented on ${cardLink}:\n>${action.data.text}`;
|
markdown = `*${actorUser.name}* commented on ${cardLink}:\n>${action.data.text}`;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -45,10 +45,18 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -72,6 +80,24 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'actionCreate',
|
||||||
|
data: {
|
||||||
|
item: action,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [values.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: values.user,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (sails.config.custom.slackBotToken) {
|
||||||
|
buildAndSendSlackMessage(values.card, action, values.user);
|
||||||
|
}
|
||||||
|
|
||||||
const subscriptionUserIds = await sails.helpers.cards.getSubscriptionUserIds(
|
const subscriptionUserIds = await sails.helpers.cards.getSubscriptionUserIds(
|
||||||
action.cardId,
|
action.cardId,
|
||||||
action.userId,
|
action.userId,
|
||||||
@@ -84,17 +110,15 @@ module.exports = {
|
|||||||
userId,
|
userId,
|
||||||
action,
|
action,
|
||||||
},
|
},
|
||||||
user: values.user,
|
project: inputs.project,
|
||||||
board: inputs.board,
|
board: inputs.board,
|
||||||
|
list: inputs.list,
|
||||||
card: values.card,
|
card: values.card,
|
||||||
|
actorUser: values.user,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (sails.config.custom.slackBotToken) {
|
|
||||||
buildAndSendSlackMessage(values.user, values.card, action);
|
|
||||||
}
|
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,10 +4,26 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -25,6 +41,20 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'actionDelete',
|
||||||
|
data: {
|
||||||
|
item: action,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
|
|||||||
@@ -8,10 +8,26 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -31,6 +47,20 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'actionUpdate',
|
||||||
|
data: {
|
||||||
|
item: action,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
|
|||||||
@@ -21,6 +21,18 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
requestId: {
|
requestId: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
isNotEmptyString: true,
|
isNotEmptyString: true,
|
||||||
@@ -49,12 +61,30 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'attachmentCreate',
|
||||||
|
data: {
|
||||||
|
item: attachment,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [values.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: values.creatorUser,
|
||||||
|
});
|
||||||
|
|
||||||
if (!values.card.coverAttachmentId && attachment.image) {
|
if (!values.card.coverAttachmentId && attachment.image) {
|
||||||
await sails.helpers.cards.updateOne.with({
|
await sails.helpers.cards.updateOne.with({
|
||||||
record: values.card,
|
record: values.card,
|
||||||
values: {
|
values: {
|
||||||
coverAttachmentId: attachment.id,
|
coverAttachmentId: attachment.id,
|
||||||
},
|
},
|
||||||
|
project: inputs.project,
|
||||||
|
board: inputs.board,
|
||||||
|
list: inputs.list,
|
||||||
|
actorUser: values.creatorUser,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,26 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
card: {
|
card: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -27,6 +39,10 @@ module.exports = {
|
|||||||
values: {
|
values: {
|
||||||
coverAttachmentId: null,
|
coverAttachmentId: null,
|
||||||
},
|
},
|
||||||
|
project: inputs.project,
|
||||||
|
board: inputs.board,
|
||||||
|
list: inputs.list,
|
||||||
|
actorUser: inputs.actorUser,
|
||||||
request: inputs.request,
|
request: inputs.request,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -48,6 +64,20 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'attachmentDelete',
|
||||||
|
data: {
|
||||||
|
item: attachment,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return attachment;
|
return attachment;
|
||||||
|
|||||||
@@ -8,10 +8,26 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -31,6 +47,20 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'attachmentUpdate',
|
||||||
|
data: {
|
||||||
|
item: attachment,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return attachment;
|
return attachment;
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -67,6 +75,19 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'boardMembershipCreate',
|
||||||
|
data: {
|
||||||
|
item: boardMembership,
|
||||||
|
included: {
|
||||||
|
users: [values.user],
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [values.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return boardMembership;
|
return boardMembership;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -73,6 +81,18 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'boardMembershipDelete',
|
||||||
|
data: {
|
||||||
|
item: boardMembership,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return boardMembership;
|
return boardMembership;
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -40,6 +52,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'boardMembershipUpdate',
|
||||||
|
data: {
|
||||||
|
item: boardMembership,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return boardMembership;
|
return boardMembership;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
custom: importValidator,
|
custom: importValidator,
|
||||||
},
|
},
|
||||||
user: {
|
actorUser: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
@@ -80,6 +80,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -90,12 +92,12 @@ module.exports = {
|
|||||||
}).fetch();
|
}).fetch();
|
||||||
|
|
||||||
if (inputs.import && inputs.import.type === Board.ImportTypes.TRELLO) {
|
if (inputs.import && inputs.import.type === Board.ImportTypes.TRELLO) {
|
||||||
await sails.helpers.boards.importFromTrello(inputs.user, board, inputs.import.board);
|
await sails.helpers.boards.importFromTrello(board, inputs.import.board, inputs.actorUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
const boardMembership = await BoardMembership.create({
|
const boardMembership = await BoardMembership.create({
|
||||||
boardId: board.id,
|
boardId: board.id,
|
||||||
userId: inputs.user.id,
|
userId: inputs.actorUser.id,
|
||||||
role: BoardMembership.Roles.EDITOR,
|
role: BoardMembership.Roles.EDITOR,
|
||||||
}).fetch();
|
}).fetch();
|
||||||
|
|
||||||
@@ -111,6 +113,17 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'boardCreate',
|
||||||
|
data: {
|
||||||
|
item: board,
|
||||||
|
included: {
|
||||||
|
projects: [values.project],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
board,
|
board,
|
||||||
boardMembership,
|
boardMembership,
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -33,6 +41,17 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'boardDelete',
|
||||||
|
data: {
|
||||||
|
item: board,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return board;
|
return board;
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ const POSITION_GAP = 65535; // TODO: move to config
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
user: {
|
|
||||||
type: 'ref',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
@@ -14,6 +10,10 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
@@ -87,7 +87,7 @@ module.exports = {
|
|||||||
trelloComments.map(async (trelloComment) => {
|
trelloComments.map(async (trelloComment) => {
|
||||||
return Action.create({
|
return Action.create({
|
||||||
cardId: plankaCard.id,
|
cardId: plankaCard.id,
|
||||||
userId: inputs.user.id,
|
userId: inputs.actorUser.id,
|
||||||
type: 'commentCard',
|
type: 'commentCard',
|
||||||
data: {
|
data: {
|
||||||
text:
|
text:
|
||||||
@@ -105,7 +105,7 @@ module.exports = {
|
|||||||
const plankaCard = await Card.create({
|
const plankaCard = await Card.create({
|
||||||
boardId: inputs.board.id,
|
boardId: inputs.board.id,
|
||||||
listId: plankaList.id,
|
listId: plankaList.id,
|
||||||
creatorUserId: inputs.user.id,
|
creatorUserId: inputs.actorUser.id,
|
||||||
position: trelloCard.pos,
|
position: trelloCard.pos,
|
||||||
name: trelloCard.name,
|
name: trelloCard.name,
|
||||||
description: trelloCard.desc || null,
|
description: trelloCard.desc || null,
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -64,6 +72,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -81,6 +91,17 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'boardUpdate',
|
||||||
|
data: {
|
||||||
|
item: board,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return board;
|
return board;
|
||||||
|
|||||||
@@ -21,6 +21,22 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -50,6 +66,21 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardLabelCreate',
|
||||||
|
data: {
|
||||||
|
item: cardLabel,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
labels: [values.label],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [values.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return cardLabel;
|
return cardLabel;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,10 +4,26 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -25,6 +41,20 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardLabelDelete',
|
||||||
|
data: {
|
||||||
|
item: cardLabel,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return cardLabel;
|
return cardLabel;
|
||||||
|
|||||||
@@ -21,6 +21,22 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -53,6 +69,20 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardMembershipCreate',
|
||||||
|
data: {
|
||||||
|
item: cardMembership,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [values.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
const cardSubscription = await CardSubscription.create({
|
const cardSubscription = await CardSubscription.create({
|
||||||
cardId: cardMembership.cardId,
|
cardId: cardMembership.cardId,
|
||||||
userId: cardMembership.userId,
|
userId: cardMembership.userId,
|
||||||
@@ -73,6 +103,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
}
|
}
|
||||||
|
|
||||||
return cardMembership;
|
return cardMembership;
|
||||||
|
|||||||
@@ -4,10 +4,26 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -26,6 +42,20 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardMembershipDelete',
|
||||||
|
data: {
|
||||||
|
item: cardMembership,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
const cardSubscription = await CardSubscription.destroyOne({
|
const cardSubscription = await CardSubscription.destroyOne({
|
||||||
cardId: cardMembership.cardId,
|
cardId: cardMembership.cardId,
|
||||||
userId: cardMembership.userId,
|
userId: cardMembership.userId,
|
||||||
@@ -39,6 +69,8 @@ module.exports = {
|
|||||||
isSubscribed: false,
|
isSubscribed: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
@@ -66,6 +70,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
|
|
||||||
const card = await Card.create({
|
const card = await Card.create({
|
||||||
@@ -85,6 +91,19 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardCreate',
|
||||||
|
data: {
|
||||||
|
item: card,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [values.list],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: values.creatorUser,
|
||||||
|
});
|
||||||
|
|
||||||
if (values.creatorUser.subscribeToOwnCards) {
|
if (values.creatorUser.subscribeToOwnCards) {
|
||||||
await CardSubscription.create({
|
await CardSubscription.create({
|
||||||
cardId: card.id,
|
cardId: card.id,
|
||||||
@@ -97,6 +116,8 @@ module.exports = {
|
|||||||
isSubscribed: true,
|
isSubscribed: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
}
|
}
|
||||||
|
|
||||||
await sails.helpers.actions.createOne.with({
|
await sails.helpers.actions.createOne.with({
|
||||||
@@ -108,7 +129,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
user: values.creatorUser,
|
user: values.creatorUser,
|
||||||
},
|
},
|
||||||
|
project: inputs.project,
|
||||||
board: inputs.board,
|
board: inputs.board,
|
||||||
|
list: values.list,
|
||||||
|
request: inputs.request,
|
||||||
});
|
});
|
||||||
|
|
||||||
return card;
|
return card;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const buildAndSendSlackMessage = async (user, card) => {
|
const buildAndSendSlackMessage = async (card, actorUser) => {
|
||||||
await sails.helpers.utils.sendSlackMessage(`*${card.name}* was deleted by ${user.name}`);
|
await sails.helpers.utils.sendSlackMessage(`*${card.name}* was deleted by ${actorUser.name}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -8,7 +8,19 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
user: {
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
@@ -30,8 +42,21 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardDelete',
|
||||||
|
data: {
|
||||||
|
item: card,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
if (sails.config.custom.slackBotToken) {
|
if (sails.config.custom.slackBotToken) {
|
||||||
buildAndSendSlackMessage(inputs.user, card);
|
buildAndSendSlackMessage(card, inputs.actorUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
@@ -62,6 +66,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
|
|
||||||
const card = await Card.create({
|
const card = await Card.create({
|
||||||
@@ -108,6 +114,19 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardCreate',
|
||||||
|
data: {
|
||||||
|
item: card,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: values.creatorUser,
|
||||||
|
});
|
||||||
|
|
||||||
if (values.creatorUser.subscribeToOwnCards) {
|
if (values.creatorUser.subscribeToOwnCards) {
|
||||||
await CardSubscription.create({
|
await CardSubscription.create({
|
||||||
cardId: card.id,
|
cardId: card.id,
|
||||||
@@ -120,6 +139,8 @@ module.exports = {
|
|||||||
isSubscribed: true,
|
isSubscribed: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
}
|
}
|
||||||
|
|
||||||
await sails.helpers.actions.createOne.with({
|
await sails.helpers.actions.createOne.with({
|
||||||
@@ -131,7 +152,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
user: values.creatorUser,
|
user: values.creatorUser,
|
||||||
},
|
},
|
||||||
|
project: inputs.project,
|
||||||
board: inputs.board,
|
board: inputs.board,
|
||||||
|
list: inputs.list,
|
||||||
|
request: inputs.request,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -7,8 +7,14 @@ const valuesValidator = (value) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isUndefined(value.board) && !_.isPlainObject(value.board)) {
|
if (!_.isUndefined(value.board)) {
|
||||||
return false;
|
if (!_.isPlainObject(value.project)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_.isPlainObject(value.board)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isUndefined(value.list) && !_.isPlainObject(value.list)) {
|
if (!_.isUndefined(value.list) && !_.isPlainObject(value.list)) {
|
||||||
@@ -29,14 +35,21 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
user: {
|
project: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
board: {
|
board: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
@@ -45,65 +58,56 @@ module.exports = {
|
|||||||
|
|
||||||
exits: {
|
exits: {
|
||||||
positionMustBeInValues: {},
|
positionMustBeInValues: {},
|
||||||
|
boardInValuesMustBelongToProject: {},
|
||||||
listMustBeInValues: {},
|
listMustBeInValues: {},
|
||||||
listInValuesMustBelongToBoard: {},
|
listInValuesMustBelongToBoard: {},
|
||||||
userMustBePresent: {},
|
|
||||||
boardMustBePresent: {},
|
|
||||||
listMustBePresent: {},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { isSubscribed, ...values } = inputs.values;
|
const { isSubscribed, ...values } = inputs.values;
|
||||||
|
|
||||||
if (values.board || values.list || !_.isUndefined(values.position)) {
|
if (values.project && values.project.id === inputs.project.id) {
|
||||||
if (!inputs.board) {
|
delete values.project;
|
||||||
throw 'boardMustBePresent';
|
}
|
||||||
|
|
||||||
|
const project = values.project || inputs.project;
|
||||||
|
|
||||||
|
if (values.board) {
|
||||||
|
if (values.board.projectId !== project.id) {
|
||||||
|
throw 'boardInValuesMustBelongToProject';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (values.board) {
|
if (values.board.id === inputs.board.id) {
|
||||||
if (values.board.id === inputs.board.id) {
|
delete values.board;
|
||||||
delete values.board;
|
} else {
|
||||||
} else {
|
values.boardId = values.board.id;
|
||||||
values.boardId = values.board.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const board = values.board || inputs.board;
|
|
||||||
|
|
||||||
if (values.list) {
|
|
||||||
if (!inputs.list) {
|
|
||||||
throw 'listMustBePresent';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.list.boardId !== board.id) {
|
|
||||||
throw 'listInValuesMustBelongToBoard';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.list.id === inputs.list.id) {
|
|
||||||
delete values.list;
|
|
||||||
} else {
|
|
||||||
values.listId = values.list.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.list) {
|
|
||||||
if (_.isUndefined(values.position)) {
|
|
||||||
throw 'positionMustBeInValues';
|
|
||||||
}
|
|
||||||
} else if (values.board) {
|
|
||||||
throw 'listMustBeInValues';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!_.isUndefined(isSubscribed) || values.board || values.list) && !inputs.user) {
|
const board = values.board || inputs.board;
|
||||||
throw 'userMustBePresent';
|
|
||||||
|
if (values.list) {
|
||||||
|
if (values.list.boardId !== board.id) {
|
||||||
|
throw 'listInValuesMustBelongToBoard';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (values.list.id === inputs.list.id) {
|
||||||
|
delete values.list;
|
||||||
|
} else {
|
||||||
|
values.listId = values.list.id;
|
||||||
|
}
|
||||||
|
} else if (values.board) {
|
||||||
|
throw 'listMustBeInValues';
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = values.list || inputs.list;
|
||||||
|
|
||||||
|
if (values.list && _.isUndefined(values.position)) {
|
||||||
|
throw 'positionMustBeInValues';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isUndefined(values.position)) {
|
if (!_.isUndefined(values.position)) {
|
||||||
const boardId = values.boardId || inputs.record.boardId;
|
const cards = await sails.helpers.lists.getCards(list.id, inputs.record.id);
|
||||||
const listId = values.listId || inputs.record.listId;
|
|
||||||
|
|
||||||
const cards = await sails.helpers.lists.getCards(listId, inputs.record.id);
|
|
||||||
|
|
||||||
const { position, repositions } = sails.helpers.utils.insertToPositionables(
|
const { position, repositions } = sails.helpers.utils.insertToPositionables(
|
||||||
values.position,
|
values.position,
|
||||||
@@ -115,17 +119,19 @@ module.exports = {
|
|||||||
repositions.forEach(async ({ id, position: nextPosition }) => {
|
repositions.forEach(async ({ id, position: nextPosition }) => {
|
||||||
await Card.update({
|
await Card.update({
|
||||||
id,
|
id,
|
||||||
listId,
|
listId: list.id,
|
||||||
}).set({
|
}).set({
|
||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
});
|
});
|
||||||
|
|
||||||
sails.sockets.broadcast(`board:${boardId}`, 'cardUpdate', {
|
sails.sockets.broadcast(`board:${board.id}`, 'cardUpdate', {
|
||||||
item: {
|
item: {
|
||||||
id,
|
id,
|
||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,10 +181,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { id } = await sails.helpers.labels.createOne.with({
|
const { id } = await sails.helpers.labels.createOne.with({
|
||||||
|
project,
|
||||||
values: {
|
values: {
|
||||||
..._.omit(label, ['id', 'boardId']),
|
..._.omit(label, ['id', 'boardId']),
|
||||||
board: values.board,
|
board: values.board,
|
||||||
},
|
},
|
||||||
|
actorUser: inputs.actorUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
@@ -209,6 +217,8 @@ module.exports = {
|
|||||||
isSubscribed: true,
|
isSubscribed: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
sails.sockets.broadcast(
|
sails.sockets.broadcast(
|
||||||
@@ -221,18 +231,34 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'cardUpdate',
|
||||||
|
data: {
|
||||||
|
item: card,
|
||||||
|
included: {
|
||||||
|
projects: [project],
|
||||||
|
boards: [board],
|
||||||
|
lists: [list],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
if (!values.board && values.list) {
|
if (!values.board && values.list) {
|
||||||
await sails.helpers.actions.createOne.with({
|
await sails.helpers.actions.createOne.with({
|
||||||
|
project,
|
||||||
|
board,
|
||||||
|
list,
|
||||||
values: {
|
values: {
|
||||||
card,
|
card,
|
||||||
user: inputs.user,
|
user: inputs.actorUser,
|
||||||
type: Action.Types.MOVE_CARD,
|
type: Action.Types.MOVE_CARD,
|
||||||
data: {
|
data: {
|
||||||
fromList: _.pick(inputs.list, ['id', 'name']),
|
fromList: _.pick(inputs.list, ['id', 'name']),
|
||||||
toList: _.pick(values.list, ['id', 'name']),
|
toList: _.pick(values.list, ['id', 'name']),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
board: inputs.board,
|
request: inputs.request,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,23 +266,26 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isUndefined(isSubscribed)) {
|
if (!_.isUndefined(isSubscribed)) {
|
||||||
const prevIsSubscribed = await sails.helpers.users.isCardSubscriber(inputs.user.id, card.id);
|
const prevIsSubscribed = await sails.helpers.users.isCardSubscriber(
|
||||||
|
inputs.actorUser.id,
|
||||||
|
card.id,
|
||||||
|
);
|
||||||
|
|
||||||
if (isSubscribed !== prevIsSubscribed) {
|
if (isSubscribed !== prevIsSubscribed) {
|
||||||
if (isSubscribed) {
|
if (isSubscribed) {
|
||||||
await CardSubscription.create({
|
await CardSubscription.create({
|
||||||
cardId: card.id,
|
cardId: card.id,
|
||||||
userId: inputs.user.id,
|
userId: inputs.actorUser.id,
|
||||||
}).tolerate('E_UNIQUE');
|
}).tolerate('E_UNIQUE');
|
||||||
} else {
|
} else {
|
||||||
await CardSubscription.destroyOne({
|
await CardSubscription.destroyOne({
|
||||||
cardId: card.id,
|
cardId: card.id,
|
||||||
userId: inputs.user.id,
|
userId: inputs.actorUser.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sails.sockets.broadcast(
|
sails.sockets.broadcast(
|
||||||
`user:${inputs.user.id}`,
|
`user:${inputs.actorUser.id}`,
|
||||||
'cardUpdate',
|
'cardUpdate',
|
||||||
{
|
{
|
||||||
item: {
|
item: {
|
||||||
@@ -266,6 +295,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -50,6 +58,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
|
|
||||||
const label = await Label.create({
|
const label = await Label.create({
|
||||||
@@ -67,6 +77,18 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'labelCreate',
|
||||||
|
data: {
|
||||||
|
item: label,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [values.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return label;
|
return label;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,18 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -25,6 +37,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'labelDelete',
|
||||||
|
data: {
|
||||||
|
item: label,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return label;
|
return label;
|
||||||
|
|||||||
@@ -21,6 +21,18 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -53,6 +65,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,6 +81,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'labelUpdate',
|
||||||
|
data: {
|
||||||
|
item: label,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return label;
|
return label;
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -50,6 +58,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
|
|
||||||
const list = await List.create({
|
const list = await List.create({
|
||||||
@@ -67,6 +77,18 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'listCreate',
|
||||||
|
data: {
|
||||||
|
item: list,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [values.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,18 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -21,6 +33,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'listDelete',
|
||||||
|
data: {
|
||||||
|
item: list,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
@@ -11,6 +11,18 @@ module.exports = {
|
|||||||
isIn: Object.values(List.SortTypes),
|
isIn: Object.values(List.SortTypes),
|
||||||
defaultsTo: List.SortTypes.NAME_ASC,
|
defaultsTo: List.SortTypes.NAME_ASC,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -65,6 +77,19 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'listSort',
|
||||||
|
data: {
|
||||||
|
item: inputs.record,
|
||||||
|
included: {
|
||||||
|
cards,
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return cards;
|
return cards;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,6 +21,18 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -53,6 +65,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,6 +81,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'listUpdate',
|
||||||
|
data: {
|
||||||
|
item: list,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ const valuesValidator = (value) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// TODO: use templates (views) to build html
|
// TODO: use templates (views) to build html
|
||||||
const buildAndSendEmail = async (user, board, card, action, notifiableUser) => {
|
const buildAndSendEmail = async (board, card, action, actorUser, notifiableUser) => {
|
||||||
let emailData;
|
let emailData;
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case Action.Types.MOVE_CARD:
|
case Action.Types.MOVE_CARD:
|
||||||
emailData = {
|
emailData = {
|
||||||
subject: `${user.name} moved ${card.name} from ${action.data.fromList.name} to ${action.data.toList.name} on ${board.name}`,
|
subject: `${actorUser.name} moved ${card.name} from ${action.data.fromList.name} to ${action.data.toList.name} on ${board.name}`,
|
||||||
html:
|
html:
|
||||||
`<p>${user.name} moved ` +
|
`<p>${actorUser.name} moved ` +
|
||||||
`<a href="${process.env.BASE_URL}/cards/${card.id}">${card.name}</a> ` +
|
`<a href="${process.env.BASE_URL}/cards/${card.id}">${card.name}</a> ` +
|
||||||
`from ${action.data.fromList.name} to ${action.data.toList.name} ` +
|
`from ${action.data.fromList.name} to ${action.data.toList.name} ` +
|
||||||
`on <a href="${process.env.BASE_URL}/boards/${board.id}">${board.name}</a></p>`,
|
`on <a href="${process.env.BASE_URL}/boards/${board.id}">${board.name}</a></p>`,
|
||||||
@@ -31,9 +31,9 @@ const buildAndSendEmail = async (user, board, card, action, notifiableUser) => {
|
|||||||
break;
|
break;
|
||||||
case Action.Types.COMMENT_CARD:
|
case Action.Types.COMMENT_CARD:
|
||||||
emailData = {
|
emailData = {
|
||||||
subject: `${user.name} left a new comment to ${card.name} on ${board.name}`,
|
subject: `${actorUser.name} left a new comment to ${card.name} on ${board.name}`,
|
||||||
html:
|
html:
|
||||||
`<p>${user.name} left a new comment to ` +
|
`<p>${actorUser.name} left a new comment to ` +
|
||||||
`<a href="${process.env.BASE_URL}/cards/${card.id}">${card.name}</a> ` +
|
`<a href="${process.env.BASE_URL}/cards/${card.id}">${card.name}</a> ` +
|
||||||
`on <a href="${process.env.BASE_URL}/boards/${board.id}">${board.name}</a></p>` +
|
`on <a href="${process.env.BASE_URL}/boards/${board.id}">${board.name}</a></p>` +
|
||||||
`<p>${action.data.text}</p>`,
|
`<p>${action.data.text}</p>`,
|
||||||
@@ -57,7 +57,7 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
user: {
|
project: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
@@ -65,10 +65,18 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
card: {
|
card: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
@@ -96,9 +104,24 @@ module.exports = {
|
|||||||
notifiableUser = await sails.helpers.users.getOne(notification.userId);
|
notifiableUser = await sails.helpers.users.getOne(notification.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildAndSendEmail(inputs.user, inputs.board, inputs.card, values.action, notifiableUser);
|
buildAndSendEmail(inputs.board, inputs.card, values.action, inputs.actorUser, notifiableUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'notificationCreate',
|
||||||
|
data: {
|
||||||
|
item: notification,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [inputs.card],
|
||||||
|
actions: [values.action],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return notification;
|
return notification;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
user: {
|
actorUser: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
@@ -23,7 +24,9 @@ module.exports = {
|
|||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { values } = inputs;
|
const { values } = inputs;
|
||||||
|
|
||||||
const criteria = {};
|
const criteria = {
|
||||||
|
userId: inputs.actorUser.id,
|
||||||
|
};
|
||||||
|
|
||||||
if (_.every(inputs.recordsOrIds, _.isPlainObject)) {
|
if (_.every(inputs.recordsOrIds, _.isPlainObject)) {
|
||||||
criteria.id = sails.helpers.utils.mapRecords(inputs.recordsOrIds);
|
criteria.id = sails.helpers.utils.mapRecords(inputs.recordsOrIds);
|
||||||
@@ -31,10 +34,6 @@ module.exports = {
|
|||||||
criteria.id = inputs.recordsOrIds;
|
criteria.id = inputs.recordsOrIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputs.user) {
|
|
||||||
criteria.userId = inputs.user.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
const notifications = await Notification.update(criteria)
|
const notifications = await Notification.update(criteria)
|
||||||
.set({ ...values })
|
.set({ ...values })
|
||||||
.fetch();
|
.fetch();
|
||||||
@@ -48,6 +47,14 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'notificationUpdate',
|
||||||
|
data: {
|
||||||
|
item: notification,
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return notifications;
|
return notifications;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -55,6 +59,18 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'projectManagerCreate',
|
||||||
|
data: {
|
||||||
|
item: projectManager,
|
||||||
|
included: {
|
||||||
|
users: [values.user],
|
||||||
|
projects: [values.project],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return projectManager;
|
return projectManager;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -27,6 +31,14 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'projectManagerDelete',
|
||||||
|
data: {
|
||||||
|
item: projectManager,
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return projectManager;
|
return projectManager;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module.exports = {
|
|||||||
type: 'json',
|
type: 'json',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
user: {
|
actorUser: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
@@ -20,7 +20,7 @@ module.exports = {
|
|||||||
|
|
||||||
const projectManager = await ProjectManager.create({
|
const projectManager = await ProjectManager.create({
|
||||||
projectId: project.id,
|
projectId: project.id,
|
||||||
userId: inputs.user.id,
|
userId: inputs.actorUser.id,
|
||||||
}).fetch();
|
}).fetch();
|
||||||
|
|
||||||
sails.sockets.broadcast(
|
sails.sockets.broadcast(
|
||||||
@@ -32,6 +32,14 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'projectCreate',
|
||||||
|
data: {
|
||||||
|
item: project,
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
project,
|
project,
|
||||||
projectManager,
|
projectManager,
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ module.exports = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -37,6 +41,14 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'projectDelete',
|
||||||
|
data: {
|
||||||
|
item: project,
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -108,6 +112,14 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'projectUpdate',
|
||||||
|
data: {
|
||||||
|
item: project,
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
|
|||||||
@@ -21,6 +21,22 @@ module.exports = {
|
|||||||
custom: valuesValidator,
|
custom: valuesValidator,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
project: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
board: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
actorUser: {
|
||||||
|
type: 'ref',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
},
|
},
|
||||||
@@ -50,6 +66,8 @@ module.exports = {
|
|||||||
position: nextPosition,
|
position: nextPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: send webhooks
|
||||||
});
|
});
|
||||||
|
|
||||||
const task = await Task.create({
|
const task = await Task.create({
|
||||||
@@ -67,6 +85,20 @@ module.exports = {
|
|||||||
inputs.request,
|
inputs.request,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sails.helpers.utils.sendWebhooks.with({
|
||||||
|
event: 'taskCreate',
|
||||||
|
data: {
|
||||||
|
item: task,
|
||||||
|
included: {
|
||||||
|
projects: [inputs.project],
|
||||||
|
boards: [inputs.board],
|
||||||
|
lists: [inputs.list],
|
||||||
|
cards: [values.card],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: inputs.actorUser,
|
||||||
|
});
|
||||||
|
|
||||||
return task;
|
return task;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user