Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
caf8790f28 | ||
|
|
81436b373d | ||
|
|
cc1e886a31 | ||
|
|
f0e9fe7904 | ||
|
|
5fcea5d651 | ||
|
|
a963d85a66 | ||
|
|
04b42decef | ||
|
|
c065566c15 | ||
|
|
3779bdb053 | ||
|
|
4124ab17d2 | ||
|
|
0e3bc92a61 | ||
|
|
b8d7e713b9 | ||
|
|
017eee8302 | ||
|
|
1b28892cf5 | ||
|
|
013ea1b869 | ||
|
|
4975fa2eeb | ||
|
|
3e28ad87c7 | ||
|
|
2d6666d693 | ||
|
|
4cbd2f85c7 | ||
|
|
fae9de4e1c | ||
|
|
89c1ed71e1 | ||
|
|
1725f3cb8a | ||
|
|
f7be49e402 | ||
|
|
c8d732d936 | ||
|
|
5a32b6327c | ||
|
|
8488105810 | ||
|
|
57ebfa51d8 | ||
|
|
40170fdf90 | ||
|
|
1629f62d09 | ||
|
|
fff0552081 |
@@ -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
|
||||
|
||||
@@ -15,13 +15,13 @@ type: application
|
||||
# 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.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.27
|
||||
version: 0.2.1
|
||||
|
||||
# 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
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "1.17.0"
|
||||
appVersion: "1.19.0"
|
||||
|
||||
dependencies:
|
||||
- alias: postgresql
|
||||
|
||||
@@ -14,11 +14,15 @@ If you want to fully uninstall this chart including the data, follow [these step
|
||||
|
||||
## Usage
|
||||
|
||||
If you just want to spin up an instance using help, please see [these docs](https://docs.planka.cloud/docs/installation/kubernetes/helm_chart/). If you want to make changes to the chart locally, and deploy them, see the below section.
|
||||
|
||||
## Local Building and Using the Chart
|
||||
|
||||
The basic usage of the chart can be found below:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Chris-Greaves/planka-helm-chart.git
|
||||
cd planka-helm-chart
|
||||
git clone https://github.com/plankanban/planka.git
|
||||
cd planka/charts/planka
|
||||
helm dependency build
|
||||
export SECRETKEY=$(openssl rand -hex 64)
|
||||
helm install planka . --set secretkey=$SECRETKEY \
|
||||
|
||||
@@ -64,8 +64,16 @@ spec:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
env:
|
||||
{{- if not .Values.postgresql.enabled }}
|
||||
{{- if .Values.existingDburlSecret }}
|
||||
- name: DATABASE_URL
|
||||
value: {{ required "If the included postgresql deployment is disabled you need to define a Database URL in 'dburl'" .Values.dburl }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.existingDburlSecret }}
|
||||
key: uri
|
||||
{{- else }}
|
||||
- name: DATABASE_URL
|
||||
value: {{ required "If the included postgresql deployment is disabled you need to provide an existing secret in .Values.existingDburlSecret or define a Database URL in 'dburl'" .Values.dburl }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
@@ -82,17 +90,37 @@ spec:
|
||||
value: http://localhost:3000
|
||||
{{- end }}
|
||||
- name: SECRET_KEY
|
||||
{{- if .Values.existingSecretkeySecret }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.existingSecretkeySecret }}
|
||||
key: key
|
||||
{{- else }}
|
||||
value: {{ required "A secret key needs to be generated using 'openssl rand -hex 64' and assigned to secretkey." .Values.secretkey }}
|
||||
{{- end }}
|
||||
- name: TRUST_PROXY
|
||||
value: "0"
|
||||
- name: DEFAULT_ADMIN_EMAIL
|
||||
value: {{ .Values.admin_email }}
|
||||
- name: DEFAULT_ADMIN_PASSWORD
|
||||
value: {{ .Values.admin_password }}
|
||||
- name: DEFAULT_ADMIN_NAME
|
||||
value: {{ .Values.admin_name }}
|
||||
{{- if .Values.existingAdminCredsSecret }}
|
||||
- name: DEFAULT_ADMIN_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.existingAdminCredsSecret }}
|
||||
key: username
|
||||
- name: DEFAULT_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.existingAdminCredsSecret }}
|
||||
key: password
|
||||
{{- else }}
|
||||
- name: DEFAULT_ADMIN_USERNAME
|
||||
value: {{ .Values.admin_username }}
|
||||
- name: DEFAULT_ADMIN_PASSWORD
|
||||
value: {{ .Values.admin_password }}
|
||||
{{- end }}
|
||||
{{ range $k, $v := .Values.env }}
|
||||
- name: {{ $k | quote }}
|
||||
value: {{ $v | quote }}
|
||||
|
||||
@@ -17,6 +17,16 @@ fullnameOverride: ""
|
||||
# Generate a secret using openssl rand -base64 45
|
||||
secretkey: ""
|
||||
|
||||
## @param existingSecretkeySecret Name of an existing secret containing the session key string
|
||||
## NOTE: Must contain key `key`
|
||||
## NOTE: When it's set, the secretkey parameter is ignored
|
||||
existingSecretkeySecret: ""
|
||||
|
||||
## @param existingAdminCredsSecret Name of an existing secret containing the admin username and password
|
||||
## NOTE: Must contain keys `username` and `password`
|
||||
## NOTE: When it's set, the `admin_username` and `admin_password` parameters are ignored
|
||||
existingAdminCredsSecret: ""
|
||||
|
||||
# Base url for Planka. Will override `ingress.hosts[0].host`
|
||||
# Defaults to `http://localhost:3000` if ingress is disabled.
|
||||
baseUrl: ""
|
||||
@@ -105,9 +115,15 @@ postgresql:
|
||||
serviceBindings:
|
||||
enabled: true
|
||||
|
||||
## Set this if you disable the built-in postgresql deployment
|
||||
## Set this or existingDburlSecret if you disable the built-in postgresql deployment
|
||||
dburl:
|
||||
|
||||
## @param existingDburlSecret Name of an existing secret containing a DBurl connection string
|
||||
## NOTE: Must contain key `uri`
|
||||
## NOTE: When it's set, the `dburl` parameter is ignored
|
||||
##
|
||||
existingDburlSecret: ""
|
||||
|
||||
## PVC-based data storage configuration
|
||||
persistence:
|
||||
enabled: false
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
REACT_APP_VERSION=1.17.0
|
||||
REACT_APP_VERSION=1.19.0
|
||||
|
||||
Generated
+9447
-3574
File diff suppressed because it is too large
Load Diff
+20
-20
@@ -60,64 +60,64 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@juggle/resize-observer": "^3.4.0",
|
||||
"classnames": "^2.3.2",
|
||||
"classnames": "^2.5.1",
|
||||
"date-fns": "^2.30.0",
|
||||
"dequal": "^2.0.3",
|
||||
"easymde": "^2.18.0",
|
||||
"history": "^5.3.0",
|
||||
"i18next": "^23.7.6",
|
||||
"i18next-browser-languagedetector": "^7.2.0",
|
||||
"i18next": "^23.11.5",
|
||||
"i18next-browser-languagedetector": "^8.0.0",
|
||||
"initials": "^3.1.2",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"linkify-react": "^4.1.3",
|
||||
"linkifyjs": "^4.1.3",
|
||||
"lodash": "^4.17.21",
|
||||
"nanoid": "^5.0.3",
|
||||
"nanoid": "^5.0.7",
|
||||
"node-sass": "^9.0.0",
|
||||
"photoswipe": "^5.4.2",
|
||||
"photoswipe": "^5.4.4",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-app-rewired": "^2.2.1",
|
||||
"react-beautiful-dnd": "^13.1.1",
|
||||
"react-datepicker": "^4.21.0",
|
||||
"react-datepicker": "^4.25.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-dropzone": "^14.2.3",
|
||||
"react-i18next": "^13.5.0",
|
||||
"react-i18next": "^14.1.2",
|
||||
"react-input-mask": "^2.0.4",
|
||||
"react-markdown": "^8.0.7",
|
||||
"react-photoswipe-gallery": "^2.2.7",
|
||||
"react-redux": "^8.1.3",
|
||||
"react-router-dom": "^6.19.0",
|
||||
"react-router-dom": "^6.23.1",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-simplemde-editor": "^5.2.0",
|
||||
"react-textarea-autosize": "^8.5.3",
|
||||
"redux": "^4.2.1",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-orm": "^0.16.2",
|
||||
"redux-saga": "^1.2.3",
|
||||
"redux-saga": "^1.3.0",
|
||||
"remark-breaks": "^4.0.0",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"reselect": "^4.1.8",
|
||||
"sails.io.js": "^1.2.1",
|
||||
"semantic-ui-react": "^2.1.4",
|
||||
"semantic-ui-react": "^2.1.5",
|
||||
"socket.io-client": "^2.5.0",
|
||||
"validator": "^13.11.0",
|
||||
"whatwg-fetch": "^3.6.19",
|
||||
"validator": "^13.12.0",
|
||||
"whatwg-fetch": "^3.6.20",
|
||||
"zxcvbn": "^4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^6.1.4",
|
||||
"@testing-library/react": "^14.1.0",
|
||||
"@testing-library/user-event": "^14.5.1",
|
||||
"@testing-library/jest-dom": "^6.4.5",
|
||||
"@testing-library/react": "^15.0.7",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"babel-preset-airbnb": "^5.0.0",
|
||||
"chai": "^4.3.10",
|
||||
"eslint": "^8.53.0",
|
||||
"chai": "^4.4.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react": "^7.34.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"react-test-renderer": "^18.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ io.sails.environment = process.env.NODE_ENV;
|
||||
|
||||
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
|
||||
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||
|
||||
+2337
File diff suppressed because it is too large
Load Diff
+4
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||
|
||||
import { useClosableForm, useField } from '../../hooks';
|
||||
import { focusEnd } from '../../utils/element-helpers';
|
||||
|
||||
import styles from './NameEdit.module.scss';
|
||||
|
||||
@@ -79,7 +80,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.focus();
|
||||
focusEnd(field.current.ref.current);
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||
|
||||
import { useForm } from '../../../hooks';
|
||||
import { focusEnd } from '../../../utils/element-helpers';
|
||||
|
||||
import styles from './CommentEdit.module.scss';
|
||||
|
||||
@@ -70,7 +71,7 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
textField.current.ref.current.focus();
|
||||
focusEnd(textField.current.ref.current);
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate },
|
||||
|
||||
const mdEditorOptions = useMemo(
|
||||
() => ({
|
||||
autoDownloadFontAwesome: false,
|
||||
autofocus: true,
|
||||
spellChecker: false,
|
||||
status: false,
|
||||
|
||||
@@ -5,6 +5,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||
|
||||
import { useField } from '../../../hooks';
|
||||
import { focusEnd } from '../../../utils/element-helpers';
|
||||
|
||||
import styles from './NameEdit.module.scss';
|
||||
|
||||
@@ -65,7 +66,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.focus();
|
||||
focusEnd(field.current.ref.current);
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import TextareaAutosize from 'react-textarea-autosize';
|
||||
import { TextArea } from 'semantic-ui-react';
|
||||
|
||||
import { useField } from '../../hooks';
|
||||
import { focusEnd } from '../../utils/element-helpers';
|
||||
|
||||
import styles from './NameEdit.module.scss';
|
||||
|
||||
@@ -71,7 +72,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.select();
|
||||
focusEnd(field.current.ref.current);
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button } from 'semantic-ui-react';
|
||||
import { Popup } from '../../lib/custom-ui';
|
||||
|
||||
import { useSteps } from '../../hooks';
|
||||
import User from '../User';
|
||||
@@ -19,6 +20,7 @@ const ActionsStep = React.memo(
|
||||
({
|
||||
membership,
|
||||
permissionsSelectStep,
|
||||
title,
|
||||
leaveButtonContent,
|
||||
leaveConfirmationTitle,
|
||||
leaveConfirmationContent,
|
||||
@@ -31,6 +33,7 @@ const ActionsStep = React.memo(
|
||||
canLeave,
|
||||
onUpdate,
|
||||
onDelete,
|
||||
onBack,
|
||||
onClose,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
@@ -53,6 +56,11 @@ const ActionsStep = React.memo(
|
||||
[onUpdate],
|
||||
);
|
||||
|
||||
const handleDeleteConfirm = useCallback(() => {
|
||||
onDelete();
|
||||
onClose();
|
||||
}, [onDelete, onClose]);
|
||||
|
||||
if (step) {
|
||||
switch (step.type) {
|
||||
case StepTypes.EDIT_PERMISSIONS: {
|
||||
@@ -81,7 +89,7 @@ const ActionsStep = React.memo(
|
||||
? leaveConfirmationButtonContent
|
||||
: deleteConfirmationButtonContent
|
||||
}
|
||||
onConfirm={onDelete}
|
||||
onConfirm={handleDeleteConfirm}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
);
|
||||
@@ -89,7 +97,7 @@ const ActionsStep = React.memo(
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
const contentNode = (
|
||||
<>
|
||||
<span className={styles.user}>
|
||||
<User name={membership.user.name} avatarUrl={membership.user.avatarUrl} size="large" />
|
||||
@@ -125,12 +133,26 @@ const ActionsStep = React.memo(
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
return onBack ? (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t(title, {
|
||||
context: 'title',
|
||||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>{contentNode}</Popup.Content>
|
||||
</>
|
||||
) : (
|
||||
contentNode
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
ActionsStep.propTypes = {
|
||||
membership: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
permissionsSelectStep: PropTypes.elementType,
|
||||
title: PropTypes.string,
|
||||
leaveButtonContent: PropTypes.string,
|
||||
leaveConfirmationTitle: PropTypes.string,
|
||||
leaveConfirmationContent: PropTypes.string,
|
||||
@@ -143,11 +165,13 @@ ActionsStep.propTypes = {
|
||||
canLeave: PropTypes.bool.isRequired,
|
||||
onUpdate: PropTypes.func,
|
||||
onDelete: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
ActionsStep.defaultProps = {
|
||||
permissionsSelectStep: undefined,
|
||||
title: 'common.memberActions',
|
||||
leaveButtonContent: 'action.leaveBoard',
|
||||
leaveConfirmationTitle: 'common.leaveBoard',
|
||||
leaveConfirmationContent: 'common.areYouSureYouWantToLeaveBoard',
|
||||
@@ -157,6 +181,7 @@ ActionsStep.defaultProps = {
|
||||
deleteConfirmationContent: 'common.areYouSureYouWantToRemoveThisMemberFromBoard',
|
||||
deleteConfirmationButtonContent: 'action.removeMember',
|
||||
onUpdate: undefined,
|
||||
onBack: undefined,
|
||||
};
|
||||
|
||||
export default ActionsStep;
|
||||
|
||||
@@ -5,10 +5,10 @@ import { usePopup } from '../../lib/popup';
|
||||
|
||||
import AddStep from './AddStep';
|
||||
import ActionsStep from './ActionsStep';
|
||||
import MembershipsStep from './MembershipsStep';
|
||||
import User from '../User';
|
||||
|
||||
import styles from './Memberships.module.scss';
|
||||
import MembershipsStep from './MembershipsStep';
|
||||
|
||||
const MAX_MEMBERS = 6;
|
||||
|
||||
@@ -17,7 +17,9 @@ const Memberships = React.memo(
|
||||
items,
|
||||
allUsers,
|
||||
permissionsSelectStep,
|
||||
title,
|
||||
addTitle,
|
||||
actionsTitle,
|
||||
leaveButtonContent,
|
||||
leaveConfirmationTitle,
|
||||
leaveConfirmationContent,
|
||||
@@ -73,6 +75,8 @@ const Memberships = React.memo(
|
||||
<MembershipsPopup
|
||||
items={items}
|
||||
permissionsSelectStep={permissionsSelectStep}
|
||||
title={title}
|
||||
actionsTitle={actionsTitle}
|
||||
leaveButtonContent={leaveButtonContent}
|
||||
leaveConfirmationTitle={leaveConfirmationTitle}
|
||||
leaveConfirmationContent={leaveConfirmationContent}
|
||||
@@ -87,7 +91,7 @@ const Memberships = React.memo(
|
||||
onDelete={onDelete}
|
||||
>
|
||||
<Button icon className={styles.addUser}>
|
||||
+ {remainMembersCount < 99 ? remainMembersCount : 99}
|
||||
+{remainMembersCount < 99 ? remainMembersCount : 99}
|
||||
</Button>
|
||||
</MembershipsPopup>
|
||||
)}
|
||||
@@ -113,7 +117,9 @@ Memberships.propTypes = {
|
||||
allUsers: PropTypes.array.isRequired,
|
||||
/* eslint-enable react/forbid-prop-types */
|
||||
permissionsSelectStep: PropTypes.elementType,
|
||||
title: PropTypes.string,
|
||||
addTitle: PropTypes.string,
|
||||
actionsTitle: PropTypes.string,
|
||||
leaveButtonContent: PropTypes.string,
|
||||
leaveConfirmationTitle: PropTypes.string,
|
||||
leaveConfirmationContent: PropTypes.string,
|
||||
@@ -131,7 +137,9 @@ Memberships.propTypes = {
|
||||
|
||||
Memberships.defaultProps = {
|
||||
permissionsSelectStep: undefined,
|
||||
title: undefined,
|
||||
addTitle: undefined,
|
||||
actionsTitle: undefined,
|
||||
leaveButtonContent: undefined,
|
||||
leaveConfirmationTitle: undefined,
|
||||
leaveConfirmationContent: undefined,
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import BoardMembershipsStep from '../BoardMembershipsStep/BoardMembershipsStep';
|
||||
import { useSteps } from '../../hooks';
|
||||
import ActionsStep from './ActionsStep';
|
||||
import { Popup } from '../../lib/custom-ui';
|
||||
import BoardMembershipsStep from '../BoardMembershipsStep';
|
||||
|
||||
const StepTypes = {
|
||||
EDIT: 'EDIT',
|
||||
};
|
||||
|
||||
const MembershipsStep = React.memo(
|
||||
({
|
||||
items,
|
||||
permissionsSelectStep,
|
||||
title,
|
||||
actionsTitle,
|
||||
leaveButtonContent,
|
||||
leaveConfirmationTitle,
|
||||
leaveConfirmationContent,
|
||||
@@ -24,49 +29,54 @@ const MembershipsStep = React.memo(
|
||||
onDelete,
|
||||
onClose,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
const [step, openStep, handleBack] = useSteps();
|
||||
|
||||
const [editingItem, setEditingItem] = useState();
|
||||
|
||||
const handleUserClick = useCallback(
|
||||
(id) => {
|
||||
setEditingItem(items.find((item) => item.user.id === id));
|
||||
const handleUserSelect = useCallback(
|
||||
(userId) => {
|
||||
openStep(StepTypes.EDIT, {
|
||||
userId,
|
||||
});
|
||||
},
|
||||
[setEditingItem, items],
|
||||
[openStep],
|
||||
);
|
||||
|
||||
if (editingItem) {
|
||||
return (
|
||||
<>
|
||||
<Popup.Header onBack={() => setEditingItem(null)}>{t('common.memberInfo')}</Popup.Header>
|
||||
<Popup.Content>
|
||||
<ActionsStep
|
||||
membership={editingItem}
|
||||
permissionsSelectStep={permissionsSelectStep}
|
||||
leaveButtonContent={leaveButtonContent}
|
||||
leaveConfirmationTitle={leaveConfirmationTitle}
|
||||
leaveConfirmationContent={leaveConfirmationContent}
|
||||
leaveConfirmationButtonContent={leaveConfirmationButtonContent}
|
||||
deleteButtonContent={deleteButtonContent}
|
||||
deleteConfirmationTitle={deleteConfirmationTitle}
|
||||
deleteConfirmationContent={deleteConfirmationContent}
|
||||
deleteConfirmationButtonContent={deleteConfirmationButtonContent}
|
||||
canEdit={canEdit}
|
||||
canLeave={canLeave}
|
||||
onUpdate={onUpdate}
|
||||
onDelete={onDelete}
|
||||
onClose={onClose}
|
||||
/>
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
if (step && step.type === StepTypes.EDIT) {
|
||||
const currentItem = items.find((item) => item.userId === step.params.userId);
|
||||
|
||||
if (currentItem) {
|
||||
return (
|
||||
<ActionsStep
|
||||
membership={currentItem}
|
||||
permissionsSelectStep={permissionsSelectStep}
|
||||
title={actionsTitle}
|
||||
leaveButtonContent={leaveButtonContent}
|
||||
leaveConfirmationTitle={leaveConfirmationTitle}
|
||||
leaveConfirmationContent={leaveConfirmationContent}
|
||||
leaveConfirmationButtonContent={leaveConfirmationButtonContent}
|
||||
deleteButtonContent={deleteButtonContent}
|
||||
deleteConfirmationTitle={deleteConfirmationTitle}
|
||||
deleteConfirmationContent={deleteConfirmationContent}
|
||||
deleteConfirmationButtonContent={deleteConfirmationButtonContent}
|
||||
canEdit={canEdit}
|
||||
canLeave={canLeave}
|
||||
onUpdate={(data) => onUpdate(currentItem.id, data)}
|
||||
onDelete={() => onDelete(currentItem.id)}
|
||||
onBack={handleBack}
|
||||
onClose={onClose}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
openStep(null);
|
||||
}
|
||||
|
||||
return (
|
||||
// FIXME: hack
|
||||
<BoardMembershipsStep
|
||||
items={items}
|
||||
currentUserIds={[]}
|
||||
onUserSelect={handleUserClick}
|
||||
title={title}
|
||||
onUserSelect={handleUserSelect}
|
||||
onUserDeselect={() => {}}
|
||||
/>
|
||||
);
|
||||
@@ -76,6 +86,8 @@ const MembershipsStep = React.memo(
|
||||
MembershipsStep.propTypes = {
|
||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
permissionsSelectStep: PropTypes.elementType,
|
||||
title: PropTypes.string,
|
||||
actionsTitle: PropTypes.string,
|
||||
leaveButtonContent: PropTypes.string,
|
||||
leaveConfirmationTitle: PropTypes.string,
|
||||
leaveConfirmationContent: PropTypes.string,
|
||||
@@ -93,14 +105,16 @@ MembershipsStep.propTypes = {
|
||||
|
||||
MembershipsStep.defaultProps = {
|
||||
permissionsSelectStep: undefined,
|
||||
leaveButtonContent: 'action.leaveBoard',
|
||||
leaveConfirmationTitle: 'common.leaveBoard',
|
||||
leaveConfirmationContent: 'common.areYouSureYouWantToLeaveBoard',
|
||||
leaveConfirmationButtonContent: 'action.leaveBoard',
|
||||
deleteButtonContent: 'action.removeFromBoard',
|
||||
deleteConfirmationTitle: 'common.removeMember',
|
||||
deleteConfirmationContent: 'common.areYouSureYouWantToRemoveThisMemberFromBoard',
|
||||
deleteConfirmationButtonContent: 'action.removeMember',
|
||||
title: undefined,
|
||||
actionsTitle: undefined,
|
||||
leaveButtonContent: undefined,
|
||||
leaveConfirmationTitle: undefined,
|
||||
leaveConfirmationContent: undefined,
|
||||
leaveConfirmationButtonContent: undefined,
|
||||
deleteButtonContent: undefined,
|
||||
deleteConfirmationTitle: undefined,
|
||||
deleteConfirmationContent: undefined,
|
||||
deleteConfirmationButtonContent: undefined,
|
||||
onUpdate: undefined,
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,9 @@ const ManagersPane = React.memo(({ items, allUsers, onCreate, onDelete }) => {
|
||||
<Memberships
|
||||
items={items}
|
||||
allUsers={allUsers}
|
||||
title="common.managers"
|
||||
addTitle="common.addManager"
|
||||
actionsTitle="common.managerActions"
|
||||
leaveButtonContent="action.leaveProject"
|
||||
leaveConfirmationTitle="common.leaveProject"
|
||||
leaveConfirmationContent="common.areYouSureYouWantToLeaveProject"
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'react-datepicker/dist/react-datepicker.css';
|
||||
import 'photoswipe/dist/photoswipe.css';
|
||||
import 'easymde/dist/easymde.min.css';
|
||||
import '../lib/custom-ui/styles.css';
|
||||
import '../assets/css/font-awesome.css';
|
||||
import '../styles.module.scss';
|
||||
|
||||
function Root({ store, history }) {
|
||||
|
||||
@@ -6,6 +6,7 @@ const BASE_PATH = BASE_URL.replace(/^.*\/\/[^/]*(.*)[^?#]*.*$/, '$1');
|
||||
const SERVER_BASE_URL =
|
||||
process.env.REACT_APP_SERVER_BASE_URL ||
|
||||
(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');
|
||||
|
||||
@@ -20,6 +21,7 @@ export default {
|
||||
VERSION,
|
||||
BASE_PATH,
|
||||
SERVER_BASE_URL,
|
||||
SERVER_BASE_PATH,
|
||||
SERVER_HOST_NAME,
|
||||
ACCESS_TOKEN_KEY,
|
||||
ACCESS_TOKEN_VERSION_KEY,
|
||||
|
||||
@@ -6,12 +6,13 @@ import entryActions from '../entry-actions';
|
||||
import Projects from '../components/Projects';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { allowAllToCreateProjects } = selectors.selectConfig(state);
|
||||
const { isAdmin } = selectors.selectCurrentUser(state);
|
||||
const projects = selectors.selectProjectsForCurrentUser(state);
|
||||
|
||||
return {
|
||||
items: projects,
|
||||
canAdd: isAdmin,
|
||||
canAdd: allowAllToCreateProjects || isAdmin,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
import dateFns from 'date-fns/locale/bg';
|
||||
|
||||
export default {
|
||||
dateFns,
|
||||
|
||||
format: {
|
||||
date: 'd.MM.yyyy',
|
||||
time: 'p',
|
||||
dateTime: '$t(format:date) $t(format:time)',
|
||||
longDate: 'd. MMM',
|
||||
longDateTime: "d. MMMM 'в' p",
|
||||
fullDate: 'd. MMM. y',
|
||||
fullDateTime: "d. MMMM. y 'в' p",
|
||||
},
|
||||
|
||||
translation: {
|
||||
common: {
|
||||
aboutPlanka: 'За Planka',
|
||||
account: 'Акаунт',
|
||||
actions: 'Действия',
|
||||
addAttachment_title: 'Добавяне на прикачен файл',
|
||||
addComment: 'Добавяне на коментар',
|
||||
addManager_title: 'Добавяне на мениджър',
|
||||
addMember_title: 'Добавяне на член',
|
||||
addUser_title: 'Добавяне на потребител',
|
||||
administrator: 'Администратор',
|
||||
all: 'Всички',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored:
|
||||
'Всички промени ще бъдат автоматично запазени<br />след възстановяване на връзката.',
|
||||
areYouSureYouWantToDeleteThisAttachment:
|
||||
'Сигурни ли сте, че искате да изтриете този прикачен файл?',
|
||||
areYouSureYouWantToDeleteThisBoard: 'Сигурни ли сте, че искате да изтриете това табло?',
|
||||
areYouSureYouWantToDeleteThisCard: 'Сигурни ли сте, че искате да изтриете тази карта?',
|
||||
areYouSureYouWantToDeleteThisComment: 'Сигурни ли сте, че искате да изтриете този коментар?',
|
||||
areYouSureYouWantToDeleteThisLabel: 'Сигурни ли сте, че искате да изтриете този етикет?',
|
||||
areYouSureYouWantToDeleteThisList: 'Сигурни ли сте, че искате да изтриете този списък?',
|
||||
areYouSureYouWantToDeleteThisProject: 'Сигурни ли сте, че искате да изтриете този проект?',
|
||||
areYouSureYouWantToDeleteThisTask: 'Сигурни ли сте, че искате да изтриете тази задача?',
|
||||
areYouSureYouWantToDeleteThisUser: 'Сигурни ли сте, че искате да изтриете този потребител?',
|
||||
areYouSureYouWantToLeaveBoard: 'Сигурни ли сте, че искате да напуснете таблото?',
|
||||
areYouSureYouWantToLeaveProject: 'Сигурни ли сте, че искате да напуснете проекта?',
|
||||
areYouSureYouWantToRemoveThisManagerFromProject:
|
||||
'Сигурни ли сте, че искате да премахнете този мениджър от проекта?',
|
||||
areYouSureYouWantToRemoveThisMemberFromBoard:
|
||||
'Сигурни ли сте, че искате да премахнете този член от таблото?',
|
||||
attachment: 'Прикачен файл',
|
||||
attachments: 'Прикачени файлове',
|
||||
authentication: 'Удостоверяване',
|
||||
background: 'Фон',
|
||||
board: 'Табло',
|
||||
boardNotFound_title: 'Таблото не е намерено',
|
||||
canComment: 'може да коментира',
|
||||
canEditContentOfBoard: 'може да редактира съдържание на таблото',
|
||||
canOnlyViewBoard: 'може само да преглежда таблото',
|
||||
cardActions_title: 'Действия с карта',
|
||||
cardNotFound_title: 'Картата не може да бъде открита',
|
||||
cardOrActionAreDeleted: 'Картата или действието са изтрити.',
|
||||
color: 'Цвят',
|
||||
copy_inline: 'копирай',
|
||||
createBoard_title: 'Създаване на табло',
|
||||
createLabel_title: 'Създаване на етикет',
|
||||
createNewOneOrSelectExistingOne: 'Създайте нов или изберете<br/>съществуващ.',
|
||||
createProject_title: 'Създаване на проект',
|
||||
createTextFile_title: 'Създаване на текстов файл',
|
||||
currentPassword: 'Текуща парола',
|
||||
dangerZone_title: 'Опасна зона',
|
||||
date: 'Дата',
|
||||
dueDate: 'Дата на падежа',
|
||||
dueDate_title: 'Краен срок',
|
||||
deleteAttachment_title: 'Изтриване на прикачен файл',
|
||||
deleteBoard_title: 'Изтриване на табло',
|
||||
deleteCard_title: 'Изтриване на карта',
|
||||
deleteComment_title: 'Изтриване на коментар',
|
||||
deleteLabel_title: 'Изтриване на етикета',
|
||||
deleteList_title: 'Изтриване на списък',
|
||||
deleteProject_title: 'Изтриване на проект',
|
||||
deleteTask_title: 'Изтриване на задача',
|
||||
deleteUser_title: 'Изтриване на потребител',
|
||||
description: 'Описание',
|
||||
detectAutomatically: 'Aвтоматично откриване',
|
||||
dropFileToUpload: 'Пуснете файл за качване',
|
||||
editor: 'Редактор',
|
||||
editAttachment_title: 'Редактирай прикачения файл',
|
||||
editAvatar_title: 'Редактиране на аватар',
|
||||
editBoard_title: 'Редактиране на табло',
|
||||
editDueDate_title: 'Редактиране на дата на падеж',
|
||||
editEmail_title: 'Редактиране на имейл',
|
||||
editInformation_title: 'Редактиране на информация',
|
||||
editLabel_title: 'Редактиране на табло',
|
||||
editPassword_title: 'Редактиране на парола',
|
||||
editPermissions_title: 'Редактиране на права',
|
||||
editStopwatch_title: 'Редактиране на Хронометър',
|
||||
editUsername_title: 'Редактиране на потребителско име',
|
||||
email: 'Имейл',
|
||||
emailAlreadyInUse: 'Имейлът вече се използва',
|
||||
enterCardTitle: 'Въведете заглавие на картата... [Ctrl+Enter] за автоматично отваряне.',
|
||||
enterDescription: 'Въведете описание...',
|
||||
enterFilename: 'Въведете име на файла',
|
||||
enterListTitle: 'Въведете заглавие на списък...',
|
||||
enterProjectTitle: 'Въведете заглавие на проекта',
|
||||
enterTaskDescription: 'Въведете описание на задачата...',
|
||||
filterByLabels_title: 'Филтриране по етикети',
|
||||
filterByMembers_title: 'Филтриране по членове',
|
||||
fromComputer_title: 'От компютър',
|
||||
fromTrello: 'От Trello',
|
||||
general: 'Общ',
|
||||
hours: 'Часове',
|
||||
importBoard_title: 'Импортиране на табло',
|
||||
invalidCurrentPassword: 'Невалидна текуща парола',
|
||||
labels: 'Етикети',
|
||||
language: 'Език',
|
||||
leaveBoard_title: 'Напуснете таблото',
|
||||
leaveProject_title: 'Напуснете проекта',
|
||||
list: 'Списък',
|
||||
listActions_title: 'Списък с действия',
|
||||
managers: 'Мениджъри',
|
||||
managerActions_title: 'Действия с мениджъри',
|
||||
members: 'Членове',
|
||||
memberActions_title: 'Действия с членове',
|
||||
minutes: 'Минути',
|
||||
moveCard_title: 'Преместване на карта',
|
||||
name: 'Име',
|
||||
newestFirst: 'Първо най-новите',
|
||||
newEmail: 'Нов имейл',
|
||||
newPassword: 'Нова парола',
|
||||
newUsername: 'Ново потребителско име',
|
||||
noConnectionToServer: 'Няма връзка със сървъра',
|
||||
noBoards: 'Няма табла',
|
||||
noLists: 'Няма списъци',
|
||||
noProjects: 'Няма проекти',
|
||||
notifications: 'Уведомления',
|
||||
noUnreadNotifications: 'Няма непрочетени известия.',
|
||||
oldestFirst: 'Първо най-старите',
|
||||
openBoard_title: 'Отворете табло',
|
||||
optional_inline: 'по желание',
|
||||
organization: 'Организация',
|
||||
phone: 'Телефон',
|
||||
preferences: 'Предпочитания',
|
||||
pressPasteShortcutToAddAttachmentFromClipboard:
|
||||
'Съвет: натиснете Ctrl-V (Cmd-V на Mac), за да добавите прикачен файл от клипборда',
|
||||
project: 'Проект',
|
||||
projectNotFound_title: 'Проектът не е намерен',
|
||||
removeManager_title: 'Премахване на мениджър',
|
||||
removeMember_title: 'Премахване на член',
|
||||
searchLabels: 'Търсене на етикети...',
|
||||
searchMembers: 'Търсене на членове...',
|
||||
searchUsers: 'Търсене на потребители...',
|
||||
searchCards: 'Търсене на карти...',
|
||||
seconds: 'секунди',
|
||||
selectBoard: 'Изберете табло',
|
||||
selectList: 'Изберете списък',
|
||||
selectPermissions_title: 'Изберете правата',
|
||||
selectProject: 'Изберете проект',
|
||||
settings: 'Настройки',
|
||||
sortList_title: 'Сортиране на списък',
|
||||
stopwatch: 'Хронометър',
|
||||
subscribeToMyOwnCardsByDefault: 'Абонирайте се за собствените си карти по подразбиране',
|
||||
taskActions_title: 'Действия със задачи',
|
||||
tasks: 'Задачи',
|
||||
thereIsNoPreviewAvailableForThisAttachment: 'Няма наличен преглед за този прикачен файл.',
|
||||
time: 'Време',
|
||||
title: 'Заглавие',
|
||||
userActions_title: 'Потребителски действия',
|
||||
userAddedThisCardToList: '<0>{{user}}</0><1> добави тази карта в {{list}}</1>',
|
||||
userLeftNewCommentToCard: '{{user}} остави нов коментар «{{comment}}» в <2>{{card}}</2>',
|
||||
userMovedCardFromListToList:
|
||||
'{{user}} премести <2>{{card}}</2> от {{fromList}} към {{toList}}',
|
||||
userMovedThisCardFromListToList:
|
||||
'<0>{{user}}</0><1> премести тази карта от {{fromList}} към {{toList}}</1>',
|
||||
username: 'Потребителско име',
|
||||
usernameAlreadyInUse: 'Потребителското име вече се използва',
|
||||
users: 'Потребители',
|
||||
version: 'Версия',
|
||||
viewer: 'Зрител',
|
||||
writeComment: 'Напишете коментар...',
|
||||
},
|
||||
|
||||
action: {
|
||||
addAnotherCard: 'Добавяне на друга карта',
|
||||
addAnotherList: 'Добавяне на друг списък',
|
||||
addAnotherTask: 'Добавяне на друга задача',
|
||||
addCard: 'Добавяне на карта',
|
||||
addCard_title: 'Добавяне на карта',
|
||||
addComment: 'Добавяне на коментар',
|
||||
addList: 'Добавяне на списък',
|
||||
addMember: 'Добавяне на член',
|
||||
addMoreDetailedDescription: 'Добавяне на по-подробно описание',
|
||||
addTask: 'Добавяне на задача',
|
||||
addToCard: 'Добавяне към карта',
|
||||
addUser: 'Добавяне на потребител',
|
||||
createBoard: 'Създаване на табло',
|
||||
createFile: 'Създаване на файл',
|
||||
createLabel: 'Създаване на етикет',
|
||||
createNewLabel: 'Създаване на нов етикет',
|
||||
createProject: 'Създаване на проект',
|
||||
delete: 'Изтриване',
|
||||
deleteAttachment: 'Изтриване на прикачения файл',
|
||||
deleteAvatar: 'Изтриване на аватар',
|
||||
deleteBoard: 'Изтриване на табло',
|
||||
deleteCard: 'Изтриване на карта',
|
||||
deleteCard_title: 'Изтриване на карта',
|
||||
deleteComment: 'Изтриване на коментара',
|
||||
deleteImage: 'Изтриване на изображение',
|
||||
deleteLabel: 'Изтриване на етикета',
|
||||
deleteList: 'Изтриване на списък',
|
||||
deleteList_title: 'Изтриване на списък',
|
||||
deleteProject: 'Изтриване на проект',
|
||||
deleteProject_title: 'Изтриване на проект',
|
||||
deleteTask: 'Изтриване на задача',
|
||||
deleteTask_title: 'Изтриване на задача',
|
||||
deleteUser: 'Изтриване на потребител',
|
||||
duplicate: 'Направи дубликат',
|
||||
duplicateCard_title: 'Дублирана карта',
|
||||
edit: 'Редактиране',
|
||||
editDueDate_title: 'Редактиране на краен срок',
|
||||
editDescription_title: 'Редактиране на описание',
|
||||
editEmail_title: 'Редактиране на имейл',
|
||||
editInformation_title: 'Редактиране на информация',
|
||||
editPassword_title: 'Редактиране на парола',
|
||||
editPermissions: 'Разрешения за редактиране',
|
||||
editStopwatch_title: 'Редактиране на хронометър',
|
||||
editTitle_title: 'Редактиране на заглавието',
|
||||
editUsername_title: 'Редактиране на потребителско име',
|
||||
hideDetails: 'Скриване на детайлите',
|
||||
import: 'Импортиране',
|
||||
leaveBoard: 'Напускане на дъската',
|
||||
leaveProject: 'Напускане на проекта',
|
||||
logOut_title: 'Излезте',
|
||||
makeCover_title: 'Създаване на корица',
|
||||
move: 'Преместване',
|
||||
moveCard_title: 'Преместване на карта',
|
||||
remove: 'Премахване',
|
||||
removeBackground: 'Премахване на фона',
|
||||
removeCover_title: 'Премахване на корицата',
|
||||
removeFromBoard: 'Премахване от борда',
|
||||
removeFromProject: 'Премахване от проекта',
|
||||
removeManager: 'Премахване на мениджър',
|
||||
removeMember: 'Премахване на член',
|
||||
save: 'Запазване',
|
||||
showAllAttachments: 'Показване на всички прикачени файлове ({{hidden}} скрити)',
|
||||
showDetails: 'Показване на подробности',
|
||||
showFewerAttachments: 'Показване на по-малко прикачени файлове',
|
||||
sortList_title: 'Списък за сортиране',
|
||||
start: 'Старт',
|
||||
stop: 'Стоп',
|
||||
subscribe: 'Абонирайте се',
|
||||
unsubscribe: 'Отписване',
|
||||
uploadNewAvatar: 'Качване на нов аватар',
|
||||
uploadNewImage: 'Качване на ново изображение',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import login from './login';
|
||||
|
||||
export default {
|
||||
language: 'bg',
|
||||
country: 'bg',
|
||||
name: 'Български',
|
||||
embeddedLocale: login,
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
export default {
|
||||
translation: {
|
||||
common: {
|
||||
emailOrUsername: 'Имейл или потребителско име',
|
||||
invalidEmailOrUsername: 'Невалиден имейл или потребителско име',
|
||||
invalidPassword: 'Невалидна парола',
|
||||
logInToPlanka: 'Влезте в Planka',
|
||||
noInternetConnection: 'Няма интернет връзка',
|
||||
pageNotFound_title: 'Страницата не е намерена',
|
||||
password: 'Парола',
|
||||
projectManagement: 'Управление на проекти',
|
||||
serverConnectionFailed: 'Неуспешна връзка със сървъра',
|
||||
unknownError: 'Неизвестна грешка, опитайте отново по-късно',
|
||||
useSingleSignOn: 'Използване на single sign-on',
|
||||
},
|
||||
|
||||
action: {
|
||||
logIn: 'Вход',
|
||||
logInWithSSO: 'Вход чрез SSO',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -64,7 +64,8 @@ export default {
|
||||
currentPassword: 'Aktuální heslo',
|
||||
dangerZone_title: 'Nebezpečná zóna',
|
||||
date: 'Datum',
|
||||
dueDate_title: 'Termín do',
|
||||
dueDate: 'Termín',
|
||||
dueDate_title: 'Termín',
|
||||
deleteAttachment_title: 'Smazat přílohu',
|
||||
deleteBoard_title: 'Smazat tabuli',
|
||||
deleteCard_title: 'Smazat kartu',
|
||||
@@ -81,7 +82,7 @@ export default {
|
||||
editAttachment_title: 'Upravit přílohu',
|
||||
editAvatar_title: 'Upravit avatar',
|
||||
editBoard_title: 'Upravit tabuli',
|
||||
editDueDate_title: 'Upravit Termín do',
|
||||
editDueDate_title: 'Upravit termín',
|
||||
editEmail_title: 'Upravit e-mail',
|
||||
editInformation_title: 'Upravit informace',
|
||||
editLabel_title: 'Upravit štítek',
|
||||
@@ -116,6 +117,7 @@ export default {
|
||||
minutes: 'Minuty',
|
||||
moveCard_title: 'Přesunout kartu',
|
||||
name: 'Jméno',
|
||||
newestFirst: 'Nejnovější',
|
||||
newEmail: 'Nový e-mail',
|
||||
newPassword: 'Nové heslo',
|
||||
newUsername: 'Nové uživatelské jméno',
|
||||
@@ -125,6 +127,7 @@ export default {
|
||||
noProjects: 'Žádné projekty',
|
||||
notifications: 'Oznámení',
|
||||
noUnreadNotifications: 'Žádné nepřečtené oznámení',
|
||||
oldestFirst: 'Nejstarší',
|
||||
openBoard_title: 'Otevřít tabuli',
|
||||
optional_inline: 'volitelné',
|
||||
organization: 'Společnost',
|
||||
@@ -139,12 +142,14 @@ export default {
|
||||
searchLabels: 'Hledat štítky...',
|
||||
searchMembers: 'Hledat členy...',
|
||||
searchUsers: 'Hledat uživatele...',
|
||||
searchCards: 'Hledat karty...',
|
||||
seconds: 'Vteřin',
|
||||
selectBoard: 'Vybrat tabuli',
|
||||
selectList: 'Vybrat seznam',
|
||||
selectPermissions_title: 'Vybrat oprávnění',
|
||||
selectProject: 'Vybrat projekt',
|
||||
settings: 'Nastavení',
|
||||
sortList_title: 'Řadit podle',
|
||||
stopwatch: 'Časovač',
|
||||
subscribeToMyOwnCardsByDefault: 'Ve výchozím nastavení odebírat vlastní karty',
|
||||
taskActions_title: 'Akce na úkolu',
|
||||
@@ -203,7 +208,7 @@ export default {
|
||||
duplicate: 'Duplikovat',
|
||||
duplicateCard_title: 'Duplikovat kartu',
|
||||
edit: 'Upravit',
|
||||
editDueDate_title: 'Upravit termín do',
|
||||
editDueDate_title: 'Upravit termín',
|
||||
editDescription_title: 'Upravit popis',
|
||||
editEmail_title: 'Upravit e-mail',
|
||||
editInformation_title: 'Upravit informace',
|
||||
@@ -231,6 +236,7 @@ export default {
|
||||
showAllAttachments: 'Zozbrazit všechny přílohy ({{hidden}} skryté)',
|
||||
showDetails: 'Zobrazit detaily',
|
||||
showFewerAttachments: 'Zobrazit méně příloh',
|
||||
sortList_title: 'Řadit podle',
|
||||
start: 'Start',
|
||||
stop: 'Stop',
|
||||
subscribe: 'Odebírat',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
export default {
|
||||
translation: {
|
||||
common: {
|
||||
emailOrUsername: 'Email nebo uživatelské jméno',
|
||||
invalidEmailOrUsername: 'Nesprávný email nebo uživatelské jméno',
|
||||
emailOrUsername: 'E-mail nebo uživatelské jméno',
|
||||
invalidEmailOrUsername: 'Nesprávný e-mail nebo uživatelské jméno',
|
||||
invalidPassword: 'Nesprávné heslo',
|
||||
logInToPlanka: 'Přihlásit se do Planka',
|
||||
noInternetConnection: 'Bez připojení k internetu',
|
||||
|
||||
@@ -109,8 +109,9 @@ export default {
|
||||
list: 'List',
|
||||
listActions_title: 'List Actions',
|
||||
managers: 'Managers',
|
||||
memberInfo: 'Member Info',
|
||||
managerActions_title: 'Manager Actions',
|
||||
members: 'Members',
|
||||
memberActions_title: 'Member Actions',
|
||||
minutes: 'Minutes',
|
||||
moveCard_title: 'Move Card',
|
||||
name: 'Name',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import bg from './bg';
|
||||
import cs from './cs';
|
||||
import da from './da';
|
||||
import de from './de';
|
||||
@@ -22,6 +23,7 @@ import uz from './uz';
|
||||
import zh from './zh';
|
||||
|
||||
const locales = [
|
||||
bg,
|
||||
cs,
|
||||
da,
|
||||
de,
|
||||
|
||||
@@ -59,6 +59,7 @@ export default {
|
||||
currentPassword: 'Password corrente',
|
||||
dangerZone_title: 'Zona pericolosa',
|
||||
date: 'Data',
|
||||
dueDate: 'Data di scadenza',
|
||||
dueDate_title: 'Data di scadenza',
|
||||
deleteAttachment_title: 'Elimina Allegato',
|
||||
deleteBoard_title: 'Elimina Bacheca',
|
||||
@@ -111,6 +112,7 @@ export default {
|
||||
minutes: 'Minuti',
|
||||
moveCard_title: 'Sposta card',
|
||||
name: 'Nome',
|
||||
newestFirst: 'Dal più recente',
|
||||
newEmail: 'Nuova e-mail',
|
||||
newPassword: 'Nuova password',
|
||||
newUsername: 'Nuovo username',
|
||||
@@ -120,6 +122,7 @@ export default {
|
||||
noProjects: 'No progetti',
|
||||
notifications: 'Notifiche',
|
||||
noUnreadNotifications: 'Nessuna notifica non letta.',
|
||||
oldestFirst: 'Dal meno recente',
|
||||
openBoard_title: 'Bacheca aperta',
|
||||
optional_inline: 'opzionale',
|
||||
organization: 'Organizazzione',
|
||||
@@ -134,12 +137,14 @@ export default {
|
||||
searchLabels: 'Cerca etichette...',
|
||||
searchMembers: 'Cerca membri...',
|
||||
searchUsers: 'Cerca utenti...',
|
||||
searchCards: 'Cerca cards...',
|
||||
seconds: 'Secondi',
|
||||
selectBoard: 'Seleziona bacheca',
|
||||
selectList: 'Seleziona lista',
|
||||
selectPermissions_title: 'Seleziona Permessi',
|
||||
selectProject: 'Seleziona progetto',
|
||||
settings: 'Impostazioni',
|
||||
sortList_title: 'Ordina',
|
||||
stopwatch: 'Timer',
|
||||
subscribeToMyOwnCardsByDefault: 'Abbonati alle mie card per impostazione predefinita',
|
||||
taskActions_title: 'Task Azioni',
|
||||
@@ -227,6 +232,7 @@ export default {
|
||||
showAllAttachments: 'Mostra tutti gli allegati ({{hidden}} hidden)',
|
||||
showDetails: 'Mostra dettagli',
|
||||
showFewerAttachments: 'Mostra meno allegati',
|
||||
sortList_title: 'Ordina',
|
||||
start: 'Inizio',
|
||||
stop: 'Ferma',
|
||||
subscribe: 'Iscriviti',
|
||||
|
||||
@@ -111,7 +111,6 @@ export default {
|
||||
list: 'Lista',
|
||||
listActions_title: 'Ações da Lista',
|
||||
managers: 'Gerentes',
|
||||
memberInfo: 'Informações do Membro',
|
||||
members: 'Membros',
|
||||
minutes: 'Minutos',
|
||||
moveCard_title: 'Mover Cartão',
|
||||
|
||||
@@ -142,6 +142,7 @@ export default {
|
||||
searchLabels: 'Поиск меток...',
|
||||
searchMembers: 'Поиск участников...',
|
||||
searchUsers: 'Поиск пользователей...',
|
||||
searchCards: 'Поиск карточек...',
|
||||
seconds: 'Секунды',
|
||||
selectBoard: 'Выберите доску',
|
||||
selectList: 'Выберите список',
|
||||
@@ -232,6 +233,7 @@ export default {
|
||||
showAllAttachments: 'Показать все вложения ({{hidden}} скрыто)',
|
||||
showDetails: 'Показать подробности',
|
||||
showFewerAttachments: 'Показать меньше вложений',
|
||||
sortList_title: 'Сортировать список',
|
||||
start: 'Начать',
|
||||
stop: 'Остановить',
|
||||
subscribe: 'Подписаться',
|
||||
|
||||
@@ -101,7 +101,9 @@ export default class extends BaseModel {
|
||||
}
|
||||
let doRegularSearch = true;
|
||||
if (re) {
|
||||
cardModels = cardModels.filter((cardModel) => re.test(cardModel.name));
|
||||
cardModels = cardModels.filter(
|
||||
(cardModel) => re.test(cardModel.name) || re.test(cardModel?.description),
|
||||
);
|
||||
doRegularSearch = false;
|
||||
} else if (filterText.startsWith('!') && posSpace > 0) {
|
||||
const creatorUserId = User.findUsersFromText(
|
||||
@@ -116,7 +118,9 @@ export default class extends BaseModel {
|
||||
if (doRegularSearch) {
|
||||
const lowerCasedFilter = filterText.toLocaleLowerCase();
|
||||
cardModels = cardModels.filter(
|
||||
(cardModel) => cardModel.name.toLocaleLowerCase().indexOf(lowerCasedFilter) >= 0,
|
||||
(cardModel) =>
|
||||
cardModel.name.toLocaleLowerCase().indexOf(lowerCasedFilter) >= 0 ||
|
||||
cardModel.description?.toLocaleLowerCase().indexOf(lowerCasedFilter) >= 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
+15
-4
@@ -1,7 +1,6 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
|
||||
server:
|
||||
build:
|
||||
context: ./server
|
||||
@@ -13,6 +12,7 @@ services:
|
||||
- NODE_ENV=development
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/planka_db
|
||||
- SECRET_KEY=notsecretkey
|
||||
|
||||
# - TRUST_PROXY=0
|
||||
# - TOKEN_EXPIRES_IN=365 # In days
|
||||
|
||||
@@ -23,6 +23,9 @@ services:
|
||||
|
||||
# Configure knex to accept SSL certificates
|
||||
# - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
|
||||
|
||||
# - ALLOW_ALL_TO_CREATE_PROJECTS=true
|
||||
|
||||
# - OIDC_ISSUER=
|
||||
# - OIDC_CLIENT_ID=
|
||||
# - OIDC_CLIENT_SECRET=
|
||||
@@ -39,14 +42,23 @@ services:
|
||||
# Email Notifications (https://nodemailer.com/smtp/)
|
||||
# - SMTP_HOST=
|
||||
# - SMTP_PORT=587
|
||||
# - SMTP_NAME=
|
||||
# - SMTP_SECURE=true
|
||||
# - SMTP_USER=
|
||||
# - SMTP_PASSWORD=
|
||||
# - 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_CHANNEL_ID=
|
||||
|
||||
working_dir: /app
|
||||
command: ["sh", "-c", "npm run start"]
|
||||
depends_on:
|
||||
@@ -75,11 +87,11 @@ services:
|
||||
dockerfile: ../config/development/Dockerfile.server
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/planka_db
|
||||
|
||||
# - DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted
|
||||
# - DEFAULT_ADMIN_PASSWORD=demo
|
||||
# - DEFAULT_ADMIN_NAME=Demo Demo
|
||||
# - DEFAULT_ADMIN_USERNAME=demo
|
||||
|
||||
working_dir: /app
|
||||
command: ["sh", "-c", "npm run db:init"]
|
||||
volumes:
|
||||
@@ -116,6 +128,5 @@ services:
|
||||
- server
|
||||
- client
|
||||
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
|
||||
@@ -31,6 +31,8 @@ services:
|
||||
# - DEFAULT_ADMIN_NAME=Demo Demo
|
||||
# - DEFAULT_ADMIN_USERNAME=demo
|
||||
|
||||
# - ALLOW_ALL_TO_CREATE_PROJECTS=true
|
||||
|
||||
# - OIDC_ISSUER=
|
||||
# - OIDC_CLIENT_ID=
|
||||
# - OIDC_CLIENT_SECRET=
|
||||
@@ -47,11 +49,21 @@ services:
|
||||
# Email Notifications (https://nodemailer.com/smtp/)
|
||||
# - SMTP_HOST=
|
||||
# - SMTP_PORT=587
|
||||
# - SMTP_NAME=
|
||||
# - SMTP_SECURE=true
|
||||
# - SMTP_USER=
|
||||
# - SMTP_PASSWORD=
|
||||
# - 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_CHANNEL_ID=
|
||||
depends_on:
|
||||
|
||||
Generated
+262
-2267
File diff suppressed because it is too large
Load Diff
+8
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "planka",
|
||||
"version": "1.17.0",
|
||||
"version": "1.19.0",
|
||||
"private": true,
|
||||
"homepage": "https://plankanban.github.io/planka",
|
||||
"repository": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"docker:build:base": "docker build -t ghcr.io/plankanban/planka:base-local -f Dockerfile.base .",
|
||||
"postinstall": "(cd server && npm i && cd ../client && npm i)",
|
||||
"lint": "npm run server:lint && npm run client:lint",
|
||||
"prepare": "husky install",
|
||||
"prepare": "husky",
|
||||
"server:console": "npm run console --prefix server",
|
||||
"server:db:init": "npm run db:init --prefix server",
|
||||
"server:db:migrate": "npm run db:migrate --prefix server",
|
||||
@@ -57,13 +57,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"concurrently": "^8.2.2",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.1.0"
|
||||
"husky": "^9.0.1",
|
||||
"lint-staged": "^15.2.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"prettier": "^3.1.0"
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"prettier": "^3.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ SECRET_KEY=notsecretkey
|
||||
# DEFAULT_ADMIN_NAME=Demo Demo
|
||||
# DEFAULT_ADMIN_USERNAME=demo
|
||||
|
||||
# ALLOW_ALL_TO_CREATE_PROJECTS=true
|
||||
|
||||
# OIDC_ISSUER=
|
||||
# OIDC_CLIENT_ID=
|
||||
# OIDC_CLIENT_SECRET=
|
||||
@@ -43,6 +45,14 @@ SECRET_KEY=notsecretkey
|
||||
# SMTP_PASSWORD=
|
||||
# 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_CHANNEL_ID=
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ module.exports = {
|
||||
async fn(inputs, exits) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { card } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -83,6 +83,9 @@ module.exports = {
|
||||
const fileData = await sails.helpers.attachments.processUploadedFile(file);
|
||||
|
||||
const attachment = await sails.helpers.attachments.createOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
values: {
|
||||
...fileData,
|
||||
card,
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
||||
|
||||
let { attachment } = path;
|
||||
const { card, board } = path;
|
||||
const { card, list, board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: board.id,
|
||||
@@ -49,9 +49,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
attachment = await sails.helpers.attachments.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: attachment,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
||||
|
||||
let { attachment } = path;
|
||||
const { board } = path;
|
||||
const { card, list, board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: board.id,
|
||||
@@ -56,8 +56,12 @@ module.exports = {
|
||||
|
||||
attachment = await sails.helpers.attachments.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: attachment,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -48,14 +48,11 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board } = await sails.helpers.boards
|
||||
const { board, project } = await sails.helpers.boards
|
||||
.getProjectPath(inputs.boardId)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
||||
currentUser.id,
|
||||
board.projectId,
|
||||
);
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
if (!isProjectManager) {
|
||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||
@@ -71,11 +68,13 @@ module.exports = {
|
||||
|
||||
const boardMembership = await sails.helpers.boardMemberships.createOne
|
||||
.with({
|
||||
project,
|
||||
values: {
|
||||
...values,
|
||||
board,
|
||||
user,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('userAlreadyBoardMember', () => Errors.USER_ALREADY_BOARD_MEMBER);
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.BOARD_MEMBERSHIP_NOT_FOUND);
|
||||
|
||||
let { boardMembership } = path;
|
||||
const { project } = path;
|
||||
const { board, project } = path;
|
||||
|
||||
if (boardMembership.userId !== currentUser.id) {
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
||||
@@ -42,7 +42,9 @@ module.exports = {
|
||||
|
||||
boardMembership = await sails.helpers.boardMemberships.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
record: boardMembership,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.BOARD_MEMBERSHIP_NOT_FOUND);
|
||||
|
||||
let { boardMembership } = path;
|
||||
const { project } = path;
|
||||
const { board, project } = path;
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
@@ -47,7 +47,10 @@ module.exports = {
|
||||
|
||||
boardMembership = await sails.helpers.boardMemberships.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
board,
|
||||
record: boardMembership,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ module.exports = {
|
||||
project,
|
||||
},
|
||||
import: boardImport,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
requestId: inputs.requestId,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
@@ -22,25 +22,27 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { board } = await sails.helpers.boards
|
||||
const path = await sails.helpers.boards
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||
|
||||
let { board } = path;
|
||||
const { project } = path;
|
||||
|
||||
if (!board) {
|
||||
throw Errors.BOARD_NOT_FOUND;
|
||||
}
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
||||
currentUser.id,
|
||||
board.projectId,
|
||||
);
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
if (!isProjectManager) {
|
||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
board = await sails.helpers.boards.deleteOne.with({
|
||||
project,
|
||||
record: board,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -29,18 +29,18 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { board } = await sails.helpers.boards
|
||||
const path = await sails.helpers.boards
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||
|
||||
let { board } = path;
|
||||
const { project } = path;
|
||||
|
||||
if (!board) {
|
||||
throw Errors.BOARD_NOT_FOUND;
|
||||
}
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
||||
currentUser.id,
|
||||
board.projectId,
|
||||
);
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
if (!isProjectManager) {
|
||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||
@@ -50,7 +50,9 @@ module.exports = {
|
||||
|
||||
board = await sails.helpers.boards.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
record: board,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { card } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -64,7 +64,7 @@ module.exports = {
|
||||
|
||||
const label = await Label.findOne({
|
||||
id: inputs.labelId,
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
});
|
||||
|
||||
if (!label) {
|
||||
@@ -73,10 +73,14 @@ module.exports = {
|
||||
|
||||
const cardLabel = await sails.helpers.cardLabels.createOne
|
||||
.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
values: {
|
||||
card,
|
||||
label,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('labelAlreadyInCard', () => Errors.LABEL_ALREADY_IN_CARD);
|
||||
|
||||
@@ -39,7 +39,7 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
@@ -66,8 +66,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
cardLabel = await sails.helpers.cardLabels.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: cardLabel,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { card } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ module.exports = {
|
||||
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) {
|
||||
throw Errors.USER_NOT_FOUND;
|
||||
@@ -70,10 +70,14 @@ module.exports = {
|
||||
|
||||
const cardMembership = await sails.helpers.cardMemberships.createOne
|
||||
.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
values: {
|
||||
card,
|
||||
userId: inputs.userId,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('userAlreadyCardMember', () => Errors.USER_ALREADY_CARD_MEMBER);
|
||||
|
||||
@@ -39,7 +39,7 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
@@ -66,8 +66,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
cardMembership = await sails.helpers.cardMemberships.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: cardMembership,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board, list } = await sails.helpers.lists
|
||||
const { list, board, project } = await sails.helpers.lists
|
||||
.getProjectPath(inputs.listId)
|
||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||
|
||||
@@ -99,6 +99,7 @@ module.exports = {
|
||||
|
||||
const card = await sails.helpers.cards.createOne
|
||||
.with({
|
||||
project,
|
||||
board,
|
||||
values: {
|
||||
...values,
|
||||
|
||||
@@ -28,12 +28,15 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { card } = await sails.helpers.cards
|
||||
const path = await sails.helpers.cards
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
let { card } = path;
|
||||
const { list, board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -46,8 +49,11 @@ module.exports = {
|
||||
}
|
||||
|
||||
card = await sails.helpers.cards.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
record: card,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { card, list, board } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -60,6 +60,7 @@ module.exports = {
|
||||
cardLabels,
|
||||
tasks,
|
||||
} = await sails.helpers.cards.duplicateOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
record: card,
|
||||
|
||||
@@ -118,7 +118,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
let { card } = path;
|
||||
const { list, board } = path;
|
||||
const { list, board, project } = path;
|
||||
|
||||
let boardMembership = await BoardMembership.findOne({
|
||||
boardId: board.id,
|
||||
@@ -133,9 +133,11 @@ module.exports = {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
let nextProject;
|
||||
let nextBoard;
|
||||
|
||||
if (!_.isUndefined(inputs.boardId)) {
|
||||
({ board: nextBoard } = await sails.helpers.boards
|
||||
({ board: nextBoard, project: nextProject } = await sails.helpers.boards
|
||||
.getProjectPath(inputs.boardId)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND));
|
||||
|
||||
@@ -177,15 +179,17 @@ module.exports = {
|
||||
|
||||
card = await sails.helpers.cards.updateOne
|
||||
.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
record: card,
|
||||
values: {
|
||||
...values,
|
||||
project: nextProject,
|
||||
board: nextBoard,
|
||||
list: nextList,
|
||||
},
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('positionMustBeInValues', () => Errors.POSITION_MUST_BE_PRESENT)
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board, card } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
@@ -55,7 +55,9 @@ module.exports = {
|
||||
};
|
||||
|
||||
const action = await sails.helpers.actions.createOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
values: {
|
||||
...values,
|
||||
card,
|
||||
|
||||
@@ -36,7 +36,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
|
||||
|
||||
let { action } = path;
|
||||
const { board, project } = path;
|
||||
const { card, list, board, project } = path;
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
@@ -60,8 +60,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
action = await sails.helpers.actions.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: action,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
|
||||
|
||||
let { action } = path;
|
||||
const { board, project } = path;
|
||||
const { card, list, board, project } = path;
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
@@ -69,8 +69,12 @@ module.exports = {
|
||||
|
||||
action = await sails.helpers.actions.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: action,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board } = await sails.helpers.boards
|
||||
const { board, project } = await sails.helpers.boards
|
||||
.getProjectPath(inputs.boardId)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||
|
||||
@@ -62,10 +62,12 @@ module.exports = {
|
||||
const values = _.pick(inputs, ['position', 'name', 'color']);
|
||||
|
||||
const label = await sails.helpers.labels.createOne.with({
|
||||
project,
|
||||
values: {
|
||||
...values,
|
||||
board,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -28,12 +28,15 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { label } = await sails.helpers.labels
|
||||
const path = await sails.helpers.labels
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.LABEL_NOT_FOUND);
|
||||
|
||||
let { label } = path;
|
||||
const { board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: label.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -46,7 +49,10 @@ module.exports = {
|
||||
}
|
||||
|
||||
label = await sails.helpers.labels.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
record: label,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -40,12 +40,15 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { label } = await sails.helpers.labels
|
||||
const path = await sails.helpers.labels
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.LABEL_NOT_FOUND);
|
||||
|
||||
let { label } = path;
|
||||
const { board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: label.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -61,7 +64,10 @@ module.exports = {
|
||||
|
||||
label = await sails.helpers.labels.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
board,
|
||||
record: label,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board } = await sails.helpers.boards
|
||||
const { board, project } = await sails.helpers.boards
|
||||
.getProjectPath(inputs.boardId)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||
|
||||
@@ -56,10 +56,12 @@ module.exports = {
|
||||
const values = _.pick(inputs, ['position', 'name']);
|
||||
|
||||
const list = await sails.helpers.lists.createOne.with({
|
||||
project,
|
||||
values: {
|
||||
...values,
|
||||
board,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -28,12 +28,15 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { list } = await sails.helpers.lists
|
||||
const path = await sails.helpers.lists
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||
|
||||
let { list } = path;
|
||||
const { board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: list.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -46,7 +49,10 @@ module.exports = {
|
||||
}
|
||||
|
||||
list = await sails.helpers.lists.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
record: list,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { list } = await sails.helpers.lists
|
||||
const { list, board, project } = await sails.helpers.lists
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: list.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -50,8 +50,11 @@ module.exports = {
|
||||
}
|
||||
|
||||
const cards = await sails.helpers.lists.sortOne.with({
|
||||
project,
|
||||
board,
|
||||
record: list,
|
||||
type: inputs.type,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -35,12 +35,15 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { list } = await sails.helpers.lists
|
||||
const path = await sails.helpers.lists
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
|
||||
|
||||
let { list } = path;
|
||||
const { board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: list.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -56,7 +59,10 @@ module.exports = {
|
||||
|
||||
list = await sails.helpers.lists.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
board,
|
||||
record: list,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = {
|
||||
const notifications = await sails.helpers.notifications.updateMany.with({
|
||||
values,
|
||||
recordsOrIds: inputs.ids.split(','),
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ module.exports = {
|
||||
project,
|
||||
user,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('userAlreadyProjectManager', () => Errors.USER_ALREADY_PROJECT_MANAGER);
|
||||
|
||||
@@ -40,6 +40,7 @@ module.exports = {
|
||||
// TODO: check if the last one
|
||||
projectManager = await sails.helpers.projectManagers.deleteOne.with({
|
||||
record: projectManager,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
const Errors = {
|
||||
NOT_ENOUGH_RIGHTS: {
|
||||
notEnoughRights: 'Not enough rights',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
inputs: {
|
||||
name: {
|
||||
@@ -6,14 +12,24 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
|
||||
exits: {
|
||||
notEnoughRights: {
|
||||
responseType: 'forbidden',
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
if (!currentUser.isAdmin && !sails.config.custom.allowAllToCreateProjects) {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
const values = _.pick(inputs, ['name']);
|
||||
|
||||
const { project, projectManager } = await sails.helpers.projects.createOne.with({
|
||||
values,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ module.exports = {
|
||||
|
||||
project = await sails.helpers.projects.deleteOne.with({
|
||||
record: project,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ module.exports = {
|
||||
values: {
|
||||
backgroundImage: fileData,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ module.exports = {
|
||||
project = await sails.helpers.projects.updateOne.with({
|
||||
values,
|
||||
record: project,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ module.exports = {
|
||||
return {
|
||||
item: {
|
||||
oidc,
|
||||
allowAllToCreateProjects: sails.config.custom.allowAllToCreateProjects,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -39,12 +39,12 @@ module.exports = {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { card } = await sails.helpers.cards
|
||||
const { card, list, board, project } = await sails.helpers.cards
|
||||
.getProjectPath(inputs.cardId)
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: card.boardId,
|
||||
boardId: board.id,
|
||||
userId: currentUser.id,
|
||||
});
|
||||
|
||||
@@ -59,10 +59,14 @@ module.exports = {
|
||||
const values = _.pick(inputs, ['position', 'name', 'isCompleted']);
|
||||
|
||||
const task = await sails.helpers.tasks.createOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
values: {
|
||||
...values,
|
||||
card,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.TASK_NOT_FOUND);
|
||||
|
||||
let { task } = path;
|
||||
const { board } = path;
|
||||
const { card, list, board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: board.id,
|
||||
@@ -49,8 +49,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
task = await sails.helpers.tasks.deleteOne.with({
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: task,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ module.exports = {
|
||||
.intercept('pathNotFound', () => Errors.TASK_NOT_FOUND);
|
||||
|
||||
let { task } = path;
|
||||
const { board } = path;
|
||||
const { card, list, board, project } = path;
|
||||
|
||||
const boardMembership = await BoardMembership.findOne({
|
||||
boardId: board.id,
|
||||
@@ -62,8 +62,12 @@ module.exports = {
|
||||
|
||||
task = await sails.helpers.tasks.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
board,
|
||||
list,
|
||||
card,
|
||||
record: task,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -71,6 +71,8 @@ module.exports = {
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
if (sails.config.custom.oidcEnforced) {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
@@ -89,6 +91,7 @@ module.exports = {
|
||||
const user = await sails.helpers.users.createOne
|
||||
.with({
|
||||
values,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE)
|
||||
|
||||
@@ -26,6 +26,8 @@ module.exports = {
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let user = await sails.helpers.users.getOne(inputs.id);
|
||||
|
||||
if (!user) {
|
||||
@@ -38,6 +40,7 @@ module.exports = {
|
||||
|
||||
user = await sails.helpers.users.deleteOne.with({
|
||||
record: user,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ module.exports = {
|
||||
values: {
|
||||
avatar: fileData,
|
||||
},
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ module.exports = {
|
||||
.with({
|
||||
values,
|
||||
record: user,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE);
|
||||
|
||||
@@ -80,7 +80,7 @@ module.exports = {
|
||||
user = await sails.helpers.users.updateOne.with({
|
||||
values,
|
||||
record: user,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ module.exports = {
|
||||
.with({
|
||||
values,
|
||||
record: user,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('usernameAlreadyInUse', () => Errors.USERNAME_ALREADY_IN_USE);
|
||||
|
||||
@@ -95,7 +95,7 @@ module.exports = {
|
||||
user = await sails.helpers.users.updateOne.with({
|
||||
values,
|
||||
record: user,
|
||||
user: currentUser,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
||||
@@ -14,21 +14,21 @@ const valuesValidator = (value) => {
|
||||
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}>`;
|
||||
|
||||
let markdown;
|
||||
switch (action.type) {
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
default:
|
||||
@@ -45,10 +45,18 @@ module.exports = {
|
||||
custom: valuesValidator,
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -72,6 +80,24 @@ module.exports = {
|
||||
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(
|
||||
action.cardId,
|
||||
action.userId,
|
||||
@@ -84,17 +110,15 @@ module.exports = {
|
||||
userId,
|
||||
action,
|
||||
},
|
||||
user: values.user,
|
||||
project: inputs.project,
|
||||
board: inputs.board,
|
||||
list: inputs.list,
|
||||
card: values.card,
|
||||
actorUser: values.user,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
if (sails.config.custom.slackBotToken) {
|
||||
buildAndSendSlackMessage(values.user, values.card, action);
|
||||
}
|
||||
|
||||
return action;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,10 +4,26 @@ module.exports = {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
card: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
actorUser: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -25,6 +41,20 @@ module.exports = {
|
||||
},
|
||||
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;
|
||||
|
||||
@@ -8,10 +8,26 @@ module.exports = {
|
||||
type: 'json',
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
card: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
actorUser: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -31,6 +47,20 @@ module.exports = {
|
||||
},
|
||||
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;
|
||||
|
||||
@@ -21,6 +21,18 @@ module.exports = {
|
||||
custom: valuesValidator,
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
requestId: {
|
||||
type: 'string',
|
||||
isNotEmptyString: true,
|
||||
@@ -49,12 +61,30 @@ module.exports = {
|
||||
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) {
|
||||
await sails.helpers.cards.updateOne.with({
|
||||
record: values.card,
|
||||
values: {
|
||||
coverAttachmentId: attachment.id,
|
||||
},
|
||||
project: inputs.project,
|
||||
board: inputs.board,
|
||||
list: inputs.list,
|
||||
actorUser: values.creatorUser,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,26 @@ module.exports = {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
card: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
actorUser: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -27,6 +39,10 @@ module.exports = {
|
||||
values: {
|
||||
coverAttachmentId: null,
|
||||
},
|
||||
project: inputs.project,
|
||||
board: inputs.board,
|
||||
list: inputs.list,
|
||||
actorUser: inputs.actorUser,
|
||||
request: inputs.request,
|
||||
});
|
||||
}
|
||||
@@ -48,6 +64,20 @@ module.exports = {
|
||||
},
|
||||
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;
|
||||
|
||||
@@ -8,10 +8,26 @@ module.exports = {
|
||||
type: 'json',
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
card: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
actorUser: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -31,6 +47,20 @@ module.exports = {
|
||||
},
|
||||
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;
|
||||
|
||||
@@ -21,6 +21,14 @@ module.exports = {
|
||||
custom: valuesValidator,
|
||||
required: true,
|
||||
},
|
||||
project: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
actorUser: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -67,6 +75,19 @@ module.exports = {
|
||||
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;
|
||||
},
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user