Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02c26cfb4d | ||
|
|
ef096499a2 | ||
|
|
a007e1d065 | ||
|
|
c181731870 | ||
|
|
54c57a08c3 | ||
|
|
65abd7c9ab | ||
|
|
5fc811d2ef | ||
|
|
5afd4af897 | ||
|
|
ac0a3d9ae7 | ||
|
|
b0d23373c0 | ||
|
|
5381d45e50 | ||
|
|
a43af8eac5 | ||
|
|
409a7cde6b | ||
|
|
f62cba9bcd | ||
|
|
9495234066 | ||
|
|
5dcbad7b5a | ||
|
|
064b37050c | ||
|
|
bf8b8474ec | ||
|
|
37a9c9bb42 | ||
|
|
00fccbaa3d | ||
|
|
b3323308c1 | ||
|
|
9108dc5b3e |
@@ -9,7 +9,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ALPINE_VERSION: 3.15
|
ALPINE_VERSION: 3.16
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-docker-base-image:
|
build-and-push-docker-base-image:
|
||||||
|
|||||||
@@ -3,3 +3,10 @@ docker-compose.override.yml
|
|||||||
|
|
||||||
.idea
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# Prevent another lockfile than package-lock.json (npm) from being created
|
||||||
|
# If some case you are using pnpm or yarn, don't forget to generate npm lockfile
|
||||||
|
# before commiting your code by running:
|
||||||
|
# `npm i --package-lock-only`
|
||||||
|
pnpm-lock.yaml
|
||||||
|
yarn.lock
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ RUN npm install npm@latest --global \
|
|||||||
&& npm install
|
&& npm install
|
||||||
|
|
||||||
COPY client .
|
COPY client .
|
||||||
RUN npm run build
|
RUN DISABLE_ESLINT_PLUGIN=true npm run build
|
||||||
|
|
||||||
FROM ghcr.io/plankanban/planka:base-latest
|
FROM ghcr.io/plankanban/planka:base-latest
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
|
|
||||||
ARG ALPINE_VERSION=3.15
|
ARG ALPINE_VERSION=3.16
|
||||||
ARG VIPS_VERSION=8.12.2
|
ARG VIPS_VERSION=8.13.3
|
||||||
|
|
||||||
RUN apk -U upgrade \
|
RUN apk -U upgrade \
|
||||||
&& apk add \
|
&& apk add \
|
||||||
|
|||||||
@@ -21,7 +21,12 @@ A Trello-like kanban board built with React and Redux.
|
|||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|
||||||
### Docker Compose
|
There are 2 types of installation:
|
||||||
|
1. [Dockerized](#1-docker-compose)
|
||||||
|
2. [Without Docker](#2-without-docker)
|
||||||
|
|
||||||
|
|
||||||
|
### 1. Docker Compose
|
||||||
|
|
||||||
[](https://hub.docker.com/r/meltyshev/planka)
|
[](https://hub.docker.com/r/meltyshev/planka)
|
||||||
|
|
||||||
@@ -44,9 +49,146 @@ docker-compose up -d
|
|||||||
|
|
||||||
Demo user: demo@demo.demo demo
|
Demo user: demo@demo.demo demo
|
||||||
|
|
||||||
|
### 2. Without Docker
|
||||||
|
|
||||||
|
Installing without Docker is a bit more complicated, here's what you need to do:
|
||||||
|
|
||||||
|
1. Clone this repository into a directory of your choice. (e.g. `/var/www/planka`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p /var/www/planka
|
||||||
|
cd /var/www/planka
|
||||||
|
git clone https://github.com/plankanban/planka.git .
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install dependencies for client and build it.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd client
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: You can use `yarn` or `pnpm` instead of `npm`.
|
||||||
|
|
||||||
|
3. Copy the `build` directory to the `server/public` directory.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp -r build ../server/public
|
||||||
|
cp build/index.html ../server/views/index.ejs
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Install dependencies for server.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ../server
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Configure environment variables.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.sample .env
|
||||||
|
|
||||||
|
# Edit .env file (You could use nano, vim, etc.)
|
||||||
|
nano .env
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: Before continuing, make sure you have your selected database created and running.
|
||||||
|
|
||||||
|
6. Copy start script from the root directory to the `server` directory.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp ../docker-start.sh start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
7. Start the server.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: You can use `pm2` or `systemd` to run the server in the background.
|
||||||
|
|
||||||
|
## Additional information
|
||||||
|
|
||||||
|
### Nginx configuration
|
||||||
|
|
||||||
|
Here is an example of Nginx configuration for Planka, make sure to replace `<domain>` with your domain name, and make sure to configure the SSL.
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
upstream planka {
|
||||||
|
server localhost:1337;
|
||||||
|
keepalive 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
server_name <domain>;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/planka-access.log;
|
||||||
|
error_log /var/log/nginx/planka-error.log error;
|
||||||
|
|
||||||
|
# SSL Configuration - Replace the example <domain> with your domain
|
||||||
|
ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
|
||||||
|
ssl_session_cache shared:SSL:10m;
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
|
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
|
||||||
|
ssl_prefer_server_ciphers on;
|
||||||
|
|
||||||
|
client_max_body_size 120M;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
add_header Access-Control-Max-Age 3600;
|
||||||
|
add_header Access-Control-Expose-Headers Content-Length;
|
||||||
|
add_header Access-Control-Allow-Headers Range;
|
||||||
|
|
||||||
|
# Make sure to allow socket.io connections
|
||||||
|
location ~* \.io {
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
client_max_body_size 50M;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||||
|
proxy_buffers 256 16k;
|
||||||
|
proxy_buffer_size 16k;
|
||||||
|
client_body_timeout 60;
|
||||||
|
send_timeout 300;
|
||||||
|
lingering_timeout 5;
|
||||||
|
proxy_connect_timeout 1d;
|
||||||
|
proxy_send_timeout 1d;
|
||||||
|
proxy_read_timeout 1d;
|
||||||
|
proxy_pass http://planka;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
client_max_body_size 50M;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||||
|
proxy_buffers 256 16k;
|
||||||
|
proxy_buffer_size 16k;
|
||||||
|
proxy_read_timeout 600s;
|
||||||
|
proxy_cache_revalidate on;
|
||||||
|
proxy_cache_min_uses 2;
|
||||||
|
proxy_cache_use_stale timeout;
|
||||||
|
proxy_cache_lock on;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_pass http://planka;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
|
|
||||||
Planka currently allows you to expose the applciation's logfile directory to the host machine via a shared volume. This feature is not enabled by default.
|
Planka currently allows you to expose the application's logfile directory to the host machine via a shared volume. This feature is not enabled by default.
|
||||||
|
|
||||||
To expose the logfile director to the host machine, add the item `./logs/:/app/logs/` under `services.planka.volumes`.
|
To expose the logfile director to the host machine, add the item `./logs/:/app/logs/` under `services.planka.volumes`.
|
||||||
|
|
||||||
|
|||||||
Generated
+11360
-14565
File diff suppressed because it is too large
Load Diff
+32
-42
@@ -34,15 +34,13 @@
|
|||||||
},
|
},
|
||||||
"requireConfigFile": false
|
"requireConfigFile": false
|
||||||
},
|
},
|
||||||
"plugins": [
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"airbnb",
|
"airbnb",
|
||||||
"airbnb/hooks",
|
"airbnb/hooks",
|
||||||
"plugin:prettier/recommended"
|
"../package.json"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"no-unused-vars": "warn",
|
||||||
"import/no-extraneous-dependencies": [
|
"import/no-extraneous-dependencies": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
@@ -51,76 +49,68 @@
|
|||||||
"**/*.test.js"
|
"**/*.test.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"prettier/prettier": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"printWidth": 100,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "all"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@juggle/resize-observer": "^3.4.0",
|
"@juggle/resize-observer": "^3.4.0",
|
||||||
"classnames": "^2.3.1",
|
"classnames": "^2.3.2",
|
||||||
"connected-react-router": "^6.9.3",
|
"date-fns": "^2.29.3",
|
||||||
"date-fns": "^2.29.1",
|
|
||||||
"dequal": "^2.0.3",
|
"dequal": "^2.0.3",
|
||||||
"history": "^4.10.1",
|
"easymde": "^2.18.0",
|
||||||
"i18next": "^21.8.14",
|
"history": "^5.3.0",
|
||||||
"i18next-browser-languagedetector": "^6.1.4",
|
"i18next": "^22.0.6",
|
||||||
|
"i18next-browser-languagedetector": "^7.0.1",
|
||||||
"initials": "^3.1.2",
|
"initials": "^3.1.2",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"node-sass": "^7.0.1",
|
"node-sass": "^8.0.0",
|
||||||
"photoswipe": "^5.3.0",
|
"photoswipe": "^5.3.3",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^17.0.2",
|
"react": "^18.2.0",
|
||||||
"react-beautiful-dnd": "^13.1.0",
|
"react-beautiful-dnd": "^13.1.1",
|
||||||
"react-datepicker": "^4.8.0",
|
"react-datepicker": "^4.8.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^18.2.0",
|
||||||
"react-dropzone": "^14.2.2",
|
"react-dropzone": "^14.2.3",
|
||||||
"react-i18next": "^11.18.1",
|
"react-i18next": "^12.0.0",
|
||||||
"react-input-mask": "^2.0.4",
|
"react-input-mask": "^2.0.4",
|
||||||
"react-markdown": "^8.0.3",
|
"react-markdown": "^8.0.3",
|
||||||
"react-photoswipe-gallery": "^2.2.1",
|
"react-photoswipe-gallery": "^2.2.2",
|
||||||
"react-redux": "^7.2.8",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^5.3.1",
|
"react-router": "^6.4.3",
|
||||||
|
"react-router-dom": "^6.4.3",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"react-textarea-autosize": "^8.3.4",
|
"react-simplemde-editor": "^5.2.0",
|
||||||
|
"react-textarea-autosize": "^8.4.0",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
|
"redux-first-history": "^5.1.1",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-orm": "^0.16.2",
|
"redux-orm": "^0.16.2",
|
||||||
"redux-saga": "^1.1.3",
|
"redux-saga": "^1.2.1",
|
||||||
"remark-breaks": "^3.0.2",
|
"remark-breaks": "^3.0.2",
|
||||||
"remark-gfm": "^3.0.1",
|
"remark-gfm": "^3.0.1",
|
||||||
"reselect": "^4.1.6",
|
"reselect": "^4.1.7",
|
||||||
"sails.io.js": "^1.2.1",
|
"sails.io.js": "^1.2.1",
|
||||||
"semantic-ui-react": "^2.1.3",
|
"semantic-ui-react": "^2.1.3",
|
||||||
"socket.io-client": "^2.3.1",
|
"socket.io-client": "^2.5.0",
|
||||||
"validator": "^13.7.0",
|
"validator": "^13.7.0",
|
||||||
"whatwg-fetch": "^3.6.2",
|
"whatwg-fetch": "^3.6.2",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
|
"@testing-library/react": "^13.4.0",
|
||||||
|
"@testing-library/user-event": "^13.5.0",
|
||||||
"babel-preset-airbnb": "^5.0.0",
|
"babel-preset-airbnb": "^5.0.0",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.7",
|
||||||
"enzyme": "^3.11.0",
|
"eslint": "^8.28.0",
|
||||||
"eslint": "^8.20.0",
|
|
||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.6.1",
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react": "^7.30.1",
|
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest-enzyme": "^7.1.2",
|
|
||||||
"prettier": "2.7.1",
|
|
||||||
"react-app-rewired": "^2.2.1",
|
"react-app-rewired": "^2.2.1",
|
||||||
"react-test-renderer": "^17.0.2"
|
"react-test-renderer": "^18.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const BoardActions = React.memo(
|
|||||||
filterUsers,
|
filterUsers,
|
||||||
filterLabels,
|
filterLabels,
|
||||||
allUsers,
|
allUsers,
|
||||||
|
canEdit,
|
||||||
canEditMemberships,
|
canEditMemberships,
|
||||||
onMembershipCreate,
|
onMembershipCreate,
|
||||||
onMembershipUpdate,
|
onMembershipUpdate,
|
||||||
@@ -27,32 +28,35 @@ const BoardActions = React.memo(
|
|||||||
onLabelDelete,
|
onLabelDelete,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.actions}>
|
<div className={styles.wrapper}>
|
||||||
<div className={styles.action}>
|
<div className={styles.actions}>
|
||||||
<Memberships
|
<div className={styles.action}>
|
||||||
items={memberships}
|
<Memberships
|
||||||
allUsers={allUsers}
|
items={memberships}
|
||||||
permissionsSelectStep={BoardMembershipPermissionsSelectStep}
|
allUsers={allUsers}
|
||||||
canEdit={canEditMemberships}
|
permissionsSelectStep={BoardMembershipPermissionsSelectStep}
|
||||||
onCreate={onMembershipCreate}
|
canEdit={canEditMemberships}
|
||||||
onUpdate={onMembershipUpdate}
|
onCreate={onMembershipCreate}
|
||||||
onDelete={onMembershipDelete}
|
onUpdate={onMembershipUpdate}
|
||||||
/>
|
onDelete={onMembershipDelete}
|
||||||
</div>
|
/>
|
||||||
<div className={styles.action}>
|
</div>
|
||||||
<Filters
|
<div className={styles.action}>
|
||||||
users={filterUsers}
|
<Filters
|
||||||
labels={filterLabels}
|
users={filterUsers}
|
||||||
allBoardMemberships={memberships}
|
labels={filterLabels}
|
||||||
allLabels={labels}
|
allBoardMemberships={memberships}
|
||||||
onUserAdd={onUserToFilterAdd}
|
allLabels={labels}
|
||||||
onUserRemove={onUserFromFilterRemove}
|
canEdit={canEdit}
|
||||||
onLabelAdd={onLabelToFilterAdd}
|
onUserAdd={onUserToFilterAdd}
|
||||||
onLabelRemove={onLabelFromFilterRemove}
|
onUserRemove={onUserFromFilterRemove}
|
||||||
onLabelCreate={onLabelCreate}
|
onLabelAdd={onLabelToFilterAdd}
|
||||||
onLabelUpdate={onLabelUpdate}
|
onLabelRemove={onLabelFromFilterRemove}
|
||||||
onLabelDelete={onLabelDelete}
|
onLabelCreate={onLabelCreate}
|
||||||
/>
|
onLabelUpdate={onLabelUpdate}
|
||||||
|
onLabelDelete={onLabelDelete}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -67,6 +71,7 @@ BoardActions.propTypes = {
|
|||||||
filterLabels: PropTypes.array.isRequired,
|
filterLabels: PropTypes.array.isRequired,
|
||||||
allUsers: PropTypes.array.isRequired,
|
allUsers: PropTypes.array.isRequired,
|
||||||
/* eslint-enable react/forbid-prop-types */
|
/* eslint-enable react/forbid-prop-types */
|
||||||
|
canEdit: PropTypes.bool.isRequired,
|
||||||
canEditMemberships: PropTypes.bool.isRequired,
|
canEditMemberships: PropTypes.bool.isRequired,
|
||||||
onMembershipCreate: PropTypes.func.isRequired,
|
onMembershipCreate: PropTypes.func.isRequired,
|
||||||
onMembershipUpdate: PropTypes.func.isRequired,
|
onMembershipUpdate: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
:global(#app) {
|
:global(#app) {
|
||||||
.action {
|
.action {
|
||||||
|
flex: 0 0 auto;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,4 +9,15 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
margin: 20px 20px;
|
margin: 20px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
scrollbar-width: none;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const Filters = React.memo(
|
|||||||
labels,
|
labels,
|
||||||
allBoardMemberships,
|
allBoardMemberships,
|
||||||
allLabels,
|
allLabels,
|
||||||
|
canEdit,
|
||||||
onUserAdd,
|
onUserAdd,
|
||||||
onUserRemove,
|
onUserRemove,
|
||||||
onLabelAdd,
|
onLabelAdd,
|
||||||
@@ -74,6 +75,7 @@ const Filters = React.memo(
|
|||||||
title={t('common.filterByLabels', {
|
title={t('common.filterByLabels', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
|
canEdit={canEdit}
|
||||||
onSelect={onLabelAdd}
|
onSelect={onLabelAdd}
|
||||||
onDeselect={onLabelRemove}
|
onDeselect={onLabelRemove}
|
||||||
onCreate={onLabelCreate}
|
onCreate={onLabelCreate}
|
||||||
@@ -108,6 +110,7 @@ Filters.propTypes = {
|
|||||||
allBoardMemberships: PropTypes.array.isRequired,
|
allBoardMemberships: PropTypes.array.isRequired,
|
||||||
allLabels: PropTypes.array.isRequired,
|
allLabels: PropTypes.array.isRequired,
|
||||||
/* eslint-enable react/forbid-prop-types */
|
/* eslint-enable react/forbid-prop-types */
|
||||||
|
canEdit: PropTypes.bool.isRequired,
|
||||||
onUserAdd: PropTypes.func.isRequired,
|
onUserAdd: PropTypes.func.isRequired,
|
||||||
onUserRemove: PropTypes.func.isRequired,
|
onUserRemove: PropTypes.func.isRequired,
|
||||||
onLabelAdd: PropTypes.func.isRequired,
|
onLabelAdd: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 2000;
|
z-index: 2001;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
padding: 6px 32px 6px 128px;
|
padding: 6px 32px 6px 128px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
z-index: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.extension {
|
.extension {
|
||||||
@@ -95,7 +94,6 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
width: 112px;
|
width: 112px;
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumbnailLabel {
|
.thumbnailLabel {
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
import React, { useCallback, useImperativeHandle, useMemo, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import TextareaAutosize from 'react-textarea-autosize';
|
import { Button, Form } from 'semantic-ui-react';
|
||||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
import SimpleMDE from 'react-simplemde-editor';
|
||||||
|
|
||||||
import { useClosableForm, useField } from '../../hooks';
|
|
||||||
|
|
||||||
import styles from './DescriptionEdit.module.scss';
|
import styles from './DescriptionEdit.module.scss';
|
||||||
|
|
||||||
const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [value, handleFieldChange, setValue] = useField(null);
|
const [value, setValue] = useState(null);
|
||||||
|
|
||||||
const field = useRef(null);
|
|
||||||
|
|
||||||
const open = useCallback(() => {
|
const open = useCallback(() => {
|
||||||
setIsOpened(true);
|
setIsOpened(true);
|
||||||
@@ -55,20 +51,37 @@ const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate },
|
|||||||
[close],
|
[close],
|
||||||
);
|
);
|
||||||
|
|
||||||
const [handleFieldBlur, handleControlMouseOver, handleControlMouseOut] = useClosableForm(
|
|
||||||
close,
|
|
||||||
isOpened,
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleSubmit = useCallback(() => {
|
const handleSubmit = useCallback(() => {
|
||||||
close();
|
close();
|
||||||
}, [close]);
|
}, [close]);
|
||||||
|
|
||||||
useEffect(() => {
|
const mdEditorOptions = useMemo(
|
||||||
if (isOpened) {
|
() => ({
|
||||||
field.current.ref.current.focus();
|
autofocus: true,
|
||||||
}
|
spellChecker: false,
|
||||||
}, [isOpened]);
|
status: false,
|
||||||
|
toolbar: [
|
||||||
|
'bold',
|
||||||
|
'italic',
|
||||||
|
'heading',
|
||||||
|
'strikethrough',
|
||||||
|
'|',
|
||||||
|
'quote',
|
||||||
|
'unordered-list',
|
||||||
|
'ordered-list',
|
||||||
|
'table',
|
||||||
|
'|',
|
||||||
|
'link',
|
||||||
|
'image',
|
||||||
|
'|',
|
||||||
|
'undo',
|
||||||
|
'redo',
|
||||||
|
'|',
|
||||||
|
'guide',
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
if (!isOpened) {
|
if (!isOpened) {
|
||||||
return React.cloneElement(children, {
|
return React.cloneElement(children, {
|
||||||
@@ -78,26 +91,17 @@ const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate },
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form onSubmit={handleSubmit}>
|
<Form onSubmit={handleSubmit}>
|
||||||
<TextArea
|
<SimpleMDE
|
||||||
ref={field}
|
|
||||||
as={TextareaAutosize}
|
|
||||||
value={value}
|
value={value}
|
||||||
|
options={mdEditorOptions}
|
||||||
placeholder={t('common.enterDescription')}
|
placeholder={t('common.enterDescription')}
|
||||||
minRows={3}
|
|
||||||
spellCheck={false}
|
|
||||||
className={styles.field}
|
className={styles.field}
|
||||||
onKeyDown={handleFieldKeyDown}
|
onKeyDown={handleFieldKeyDown}
|
||||||
onChange={handleFieldChange}
|
onChange={setValue}
|
||||||
onBlur={handleFieldBlur}
|
|
||||||
/>
|
/>
|
||||||
<div className={styles.controls}>
|
<div className={styles.controls}>
|
||||||
{/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */}
|
{/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */}
|
||||||
<Button
|
<Button positive content={t('action.save')} />
|
||||||
positive
|
|
||||||
content={t('action.save')}
|
|
||||||
onMouseOver={handleControlMouseOver}
|
|
||||||
onMouseOut={handleControlMouseOut}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,15 +6,12 @@
|
|||||||
|
|
||||||
.field {
|
.field {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid rgba(9, 30, 66, 0.13);
|
|
||||||
border-radius: 3px;
|
|
||||||
color: #17394d;
|
color: #17394d;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 8px 12px;
|
|
||||||
resize: none;
|
resize: none;
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
.wrapper {
|
.wrapper {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active, &:hover {
|
&:active,
|
||||||
|
&:hover {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: rgba(255, 255, 255, 0.9);
|
color: rgba(255, 255, 255, 0.9);
|
||||||
}
|
}
|
||||||
@@ -42,7 +43,6 @@
|
|||||||
height: 50px;
|
height: 50px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification {
|
.notification {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import truncate from 'lodash/truncate';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation, Trans } from 'react-i18next';
|
import { useTranslation, Trans } from 'react-i18next';
|
||||||
@@ -47,23 +48,26 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
|||||||
{activity.data.toList.name}
|
{activity.data.toList.name}
|
||||||
</Trans>
|
</Trans>
|
||||||
);
|
);
|
||||||
case ActivityTypes.COMMENT_CARD:
|
case ActivityTypes.COMMENT_CARD: {
|
||||||
|
const commentText = truncate(activity.data.text);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="common.userLeftNewCommentToCard"
|
i18nKey="common.userLeftNewCommentToCard"
|
||||||
values={{
|
values={{
|
||||||
user: activity.user.name,
|
user: activity.user.name,
|
||||||
comment: activity.data.text,
|
comment: commentText,
|
||||||
card: card.name,
|
card: card.name,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{activity.user.name}
|
{activity.user.name}
|
||||||
{` left a new comment «${activity.data.text}» to `}
|
{` left a new comment «${commentText}» to `}
|
||||||
<Link to={Paths.CARDS.replace(':id', card.id)} onClick={onClose}>
|
<Link to={Paths.CARDS.replace(':id', card.id)} onClick={onClose}>
|
||||||
{card.name}
|
{card.name}
|
||||||
</Link>
|
</Link>
|
||||||
</Trans>
|
</Trans>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,9 +84,10 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
|||||||
})}
|
})}
|
||||||
</Popup.Header>
|
</Popup.Header>
|
||||||
<Popup.Content>
|
<Popup.Content>
|
||||||
{items.length > 0
|
{items.length > 0 ? (
|
||||||
? items.map((item) => (
|
<div className={styles.wrapper}>
|
||||||
<div key={item.id} className={styles.wrapper}>
|
{items.map((item) => (
|
||||||
|
<div key={item.id} className={styles.item}>
|
||||||
{item.card && item.activity ? (
|
{item.card && item.activity ? (
|
||||||
<>
|
<>
|
||||||
<User
|
<User
|
||||||
@@ -90,20 +95,23 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
|||||||
avatarUrl={item.activity.user.avatarUrl}
|
avatarUrl={item.activity.user.avatarUrl}
|
||||||
size="large"
|
size="large"
|
||||||
/>
|
/>
|
||||||
<span className={styles.content}>{renderItemContent(item)}</span>
|
<span className={styles.itemContent}>{renderItemContent(item)}</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className={styles.deletedContent}>{t('common.cardOrActionAreDeleted')}</div>
|
<div className={styles.itemDeleted}>{t('common.cardOrActionAreDeleted')}</div>
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
icon="close"
|
icon="trash alternate outline"
|
||||||
className={styles.button}
|
className={styles.itemButton}
|
||||||
onClick={() => handleDelete(item.id)}
|
onClick={() => handleDelete(item.id)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))
|
))}
|
||||||
: t('common.noUnreadNotifications')}
|
</div>
|
||||||
|
) : (
|
||||||
|
t('common.noUnreadNotifications')
|
||||||
|
)}
|
||||||
</Popup.Content>
|
</Popup.Content>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
:global(#app) {
|
:global(#app) {
|
||||||
.button {
|
.item {
|
||||||
|
padding: 12px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f0f0f0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemButton {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
float: right;
|
float: right;
|
||||||
@@ -7,7 +15,7 @@
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: auto;
|
min-height: auto;
|
||||||
padding: 5px 0;
|
padding: 0;
|
||||||
transition: background 0.3s ease;
|
transition: background 0.3s ease;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
||||||
@@ -16,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.itemContent {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
min-height: 36px;
|
min-height: 36px;
|
||||||
@@ -27,7 +35,7 @@
|
|||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deletedContent {
|
.itemDeleted {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
@@ -38,10 +46,21 @@
|
|||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
margin: 0 -12px;
|
margin: 0 -12px;
|
||||||
padding: 12px;
|
max-height: 60vh;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
|
||||||
&:hover {
|
&::-webkit-scrollbar {
|
||||||
background: #f0f0f0;
|
width: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,45 +8,51 @@ import { Button } from 'semantic-ui-react';
|
|||||||
import styles from './Item.module.scss';
|
import styles from './Item.module.scss';
|
||||||
import globalStyles from '../../styles.module.scss';
|
import globalStyles from '../../styles.module.scss';
|
||||||
|
|
||||||
const Item = React.memo(({ name, color, isPersisted, isActive, onSelect, onDeselect, onEdit }) => {
|
const Item = React.memo(
|
||||||
const handleToggleClick = useCallback(() => {
|
({ name, color, isPersisted, isActive, canEdit, onSelect, onDeselect, onEdit }) => {
|
||||||
if (isActive) {
|
const handleToggleClick = useCallback(() => {
|
||||||
onDeselect();
|
if (isActive) {
|
||||||
} else {
|
onDeselect();
|
||||||
onSelect();
|
} else {
|
||||||
}
|
onSelect();
|
||||||
}, [isActive, onSelect, onDeselect]);
|
}
|
||||||
|
}, [isActive, onSelect, onDeselect]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<Button
|
<Button
|
||||||
fluid
|
fluid
|
||||||
content={name}
|
content={name}
|
||||||
active={isActive}
|
active={isActive}
|
||||||
disabled={!isPersisted}
|
disabled={!isPersisted}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
styles.labelButton,
|
styles.labelButton,
|
||||||
isActive && styles.labelButtonActive,
|
isActive && styles.labelButtonActive,
|
||||||
globalStyles[`background${upperFirst(camelCase(color))}`],
|
globalStyles[`background${upperFirst(camelCase(color))}`],
|
||||||
|
)}
|
||||||
|
onClick={handleToggleClick}
|
||||||
|
/>
|
||||||
|
{canEdit && (
|
||||||
|
<Button
|
||||||
|
icon="pencil"
|
||||||
|
size="small"
|
||||||
|
floated="right"
|
||||||
|
disabled={!isPersisted}
|
||||||
|
className={styles.editButton}
|
||||||
|
onClick={onEdit}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
onClick={handleToggleClick}
|
</div>
|
||||||
/>
|
);
|
||||||
<Button
|
},
|
||||||
icon="pencil"
|
);
|
||||||
size="small"
|
|
||||||
disabled={!isPersisted}
|
|
||||||
className={styles.editButton}
|
|
||||||
onClick={onEdit}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
Item.propTypes = {
|
Item.propTypes = {
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
color: PropTypes.string.isRequired,
|
color: PropTypes.string.isRequired,
|
||||||
isPersisted: PropTypes.bool.isRequired,
|
isPersisted: PropTypes.bool.isRequired,
|
||||||
isActive: PropTypes.bool.isRequired,
|
isActive: PropTypes.bool.isRequired,
|
||||||
|
canEdit: PropTypes.bool.isRequired,
|
||||||
onSelect: PropTypes.func.isRequired,
|
onSelect: PropTypes.func.isRequired,
|
||||||
onDeselect: PropTypes.func.isRequired,
|
onDeselect: PropTypes.func.isRequired,
|
||||||
onEdit: PropTypes.func.isRequired,
|
onEdit: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin: 0;
|
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|
||||||
@@ -18,6 +17,7 @@
|
|||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
margin-right: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 8px 32px 8px 10px;
|
padding: 8px 32px 8px 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -18,7 +18,18 @@ const StepTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const LabelsStep = React.memo(
|
const LabelsStep = React.memo(
|
||||||
({ items, currentIds, title, onSelect, onDeselect, onCreate, onUpdate, onDelete, onBack }) => {
|
({
|
||||||
|
items,
|
||||||
|
currentIds,
|
||||||
|
title,
|
||||||
|
canEdit,
|
||||||
|
onSelect,
|
||||||
|
onDeselect,
|
||||||
|
onCreate,
|
||||||
|
onUpdate,
|
||||||
|
onDelete,
|
||||||
|
onBack,
|
||||||
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [step, openStep, handleBack] = useSteps();
|
const [step, openStep, handleBack] = useSteps();
|
||||||
const [search, handleSearchChange] = useField('');
|
const [search, handleSearchChange] = useField('');
|
||||||
@@ -140,6 +151,7 @@ const LabelsStep = React.memo(
|
|||||||
color={item.color}
|
color={item.color}
|
||||||
isPersisted={item.isPersisted}
|
isPersisted={item.isPersisted}
|
||||||
isActive={currentIds.includes(item.id)}
|
isActive={currentIds.includes(item.id)}
|
||||||
|
canEdit={canEdit}
|
||||||
onSelect={() => handleSelect(item.id)}
|
onSelect={() => handleSelect(item.id)}
|
||||||
onDeselect={() => handleDeselect(item.id)}
|
onDeselect={() => handleDeselect(item.id)}
|
||||||
onEdit={() => handleEdit(item.id)}
|
onEdit={() => handleEdit(item.id)}
|
||||||
@@ -147,12 +159,14 @@ const LabelsStep = React.memo(
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button
|
{canEdit && (
|
||||||
fluid
|
<Button
|
||||||
content={t('action.createNewLabel')}
|
fluid
|
||||||
className={styles.addButton}
|
content={t('action.createNewLabel')}
|
||||||
onClick={handleAddClick}
|
className={styles.addButton}
|
||||||
/>
|
onClick={handleAddClick}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Popup.Content>
|
</Popup.Content>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -165,6 +179,7 @@ LabelsStep.propTypes = {
|
|||||||
currentIds: PropTypes.array.isRequired,
|
currentIds: PropTypes.array.isRequired,
|
||||||
/* eslint-enable react/forbid-prop-types */
|
/* eslint-enable react/forbid-prop-types */
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
|
canEdit: PropTypes.bool,
|
||||||
onSelect: PropTypes.func.isRequired,
|
onSelect: PropTypes.func.isRequired,
|
||||||
onDeselect: PropTypes.func.isRequired,
|
onDeselect: PropTypes.func.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
@@ -175,6 +190,7 @@ LabelsStep.propTypes = {
|
|||||||
|
|
||||||
LabelsStep.defaultProps = {
|
LabelsStep.defaultProps = {
|
||||||
title: 'common.labels',
|
title: 'common.labels',
|
||||||
|
canEdit: true,
|
||||||
onBack: undefined,
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { Route, Switch } from 'react-router-dom';
|
import { Route, Routes } from 'react-router-dom';
|
||||||
import { ConnectedRouter } from 'connected-react-router';
|
import { HistoryRouter as Router } from 'redux-first-history/rr6';
|
||||||
|
|
||||||
import Paths from '../constants/Paths';
|
import Paths from '../constants/Paths';
|
||||||
import LoginContainer from '../containers/LoginContainer';
|
import LoginContainer from '../containers/LoginContainer';
|
||||||
@@ -11,6 +11,7 @@ import NotFound from './NotFound';
|
|||||||
|
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
import 'react-datepicker/dist/react-datepicker.css';
|
||||||
import 'photoswipe/dist/photoswipe.css';
|
import 'photoswipe/dist/photoswipe.css';
|
||||||
|
import 'easymde/dist/easymde.min.css';
|
||||||
import '../lib/custom-ui/styles.css';
|
import '../lib/custom-ui/styles.css';
|
||||||
|
|
||||||
import '../styles.module.scss';
|
import '../styles.module.scss';
|
||||||
@@ -18,16 +19,16 @@ import '../styles.module.scss';
|
|||||||
function Root({ store, history }) {
|
function Root({ store, history }) {
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConnectedRouter history={history}>
|
<Router history={history}>
|
||||||
<Switch>
|
<Routes>
|
||||||
<Route exact path={Paths.LOGIN} component={LoginContainer} />
|
<Route path={Paths.LOGIN} element={<LoginContainer />} />
|
||||||
<Route exact path={Paths.ROOT} component={CoreWrapperContainer} />
|
<Route path={Paths.ROOT} element={<CoreWrapperContainer />} />
|
||||||
<Route exact path={Paths.PROJECTS} component={CoreWrapperContainer} />
|
<Route path={Paths.PROJECTS} element={<CoreWrapperContainer />} />
|
||||||
<Route exact path={Paths.BOARDS} component={CoreWrapperContainer} />
|
<Route path={Paths.BOARDS} element={<CoreWrapperContainer />} />
|
||||||
<Route exact path={Paths.CARDS} component={CoreWrapperContainer} />
|
<Route path={Paths.CARDS} element={<CoreWrapperContainer />} />
|
||||||
<Route path="*" component={NotFound} />
|
<Route path="*" element={<NotFound />} />
|
||||||
</Switch>
|
</Routes>
|
||||||
</ConnectedRouter>
|
</Router>
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
|
|||||||
|
|
||||||
import selectors from '../selectors';
|
import selectors from '../selectors';
|
||||||
import entryActions from '../entry-actions';
|
import entryActions from '../entry-actions';
|
||||||
|
import { BoardMembershipRoles } from '../constants/Enums';
|
||||||
import BoardActions from '../components/BoardActions';
|
import BoardActions from '../components/BoardActions';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
@@ -12,6 +13,7 @@ const mapStateToProps = (state) => {
|
|||||||
const labels = selectors.selectLabelsForCurrentBoard(state);
|
const labels = selectors.selectLabelsForCurrentBoard(state);
|
||||||
const filterUsers = selectors.selectFilterUsersForCurrentBoard(state);
|
const filterUsers = selectors.selectFilterUsersForCurrentBoard(state);
|
||||||
const filterLabels = selectors.selectFilterLabelsForCurrentBoard(state);
|
const filterLabels = selectors.selectFilterLabelsForCurrentBoard(state);
|
||||||
|
const currentUserMembership = selectors.selectCurrentUserMembershipForCurrentBoard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
memberships,
|
memberships,
|
||||||
@@ -19,6 +21,7 @@ const mapStateToProps = (state) => {
|
|||||||
filterUsers,
|
filterUsers,
|
||||||
filterLabels,
|
filterLabels,
|
||||||
allUsers,
|
allUsers,
|
||||||
|
canEdit: !!currentUserMembership && currentUserMembership.role === BoardMembershipRoles.EDITOR,
|
||||||
canEditMemberships: isCurrentUserManager,
|
canEditMemberships: isCurrentUserManager,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { push } from 'connected-react-router';
|
import { push } from 'redux-first-history';
|
||||||
import omit from 'lodash/omit';
|
import omit from 'lodash/omit';
|
||||||
|
|
||||||
import selectors from '../selectors';
|
import selectors from '../selectors';
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
import { createBrowserHistory } from 'history';
|
|
||||||
|
|
||||||
export default createBrowserHistory();
|
|
||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom/client';
|
||||||
|
|
||||||
import store from './store';
|
import store, { history } from './store';
|
||||||
import history from './history';
|
|
||||||
import Root from './components/Root';
|
import Root from './components/Root';
|
||||||
|
|
||||||
import './i18n';
|
import './i18n';
|
||||||
|
|
||||||
ReactDOM.render(React.createElement(Root, { store, history }), document.getElementById('root'));
|
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||||
|
root.render(React.createElement(Root, { store, history }));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { LOCATION_CHANGE } from 'connected-react-router';
|
import { LOCATION_CHANGE } from 'redux-first-history';
|
||||||
|
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
import ModalTypes from '../constants/ModalTypes';
|
import ModalTypes from '../constants/ModalTypes';
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { connectRouter } from 'connected-react-router';
|
import { routerReducer } from '../redux-history-context';
|
||||||
|
|
||||||
import history from '../history';
|
export default routerReducer;
|
||||||
|
|
||||||
export default connectRouter(history);
|
|
||||||
|
|||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
import { createBrowserHistory } from 'history';
|
||||||
|
import { createReduxHistoryContext } from 'redux-first-history';
|
||||||
|
|
||||||
|
export const { createReduxHistory, routerMiddleware, routerReducer } = createReduxHistoryContext({
|
||||||
|
history: createBrowserHistory(),
|
||||||
|
});
|
||||||
@@ -23,9 +23,9 @@ export function* fetchBoardByCurrentPath() {
|
|||||||
|
|
||||||
if (pathsMatch) {
|
if (pathsMatch) {
|
||||||
let boardId;
|
let boardId;
|
||||||
if (pathsMatch.path === Paths.BOARDS) {
|
if (pathsMatch.pattern.path === Paths.BOARDS) {
|
||||||
boardId = pathsMatch.params.id;
|
boardId = pathsMatch.params.id;
|
||||||
} else if (pathsMatch.path === Paths.CARDS) {
|
} else if (pathsMatch.pattern.path === Paths.CARDS) {
|
||||||
({
|
({
|
||||||
item: card,
|
item: card,
|
||||||
item: { boardId },
|
item: { boardId },
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { call, put, select, take } from 'redux-saga/effects';
|
import { call, put, select, take } from 'redux-saga/effects';
|
||||||
import { push } from 'connected-react-router';
|
import { push } from 'redux-first-history';
|
||||||
|
|
||||||
import request from '../request';
|
import request from '../request';
|
||||||
import selectors from '../../../selectors';
|
import selectors from '../../../selectors';
|
||||||
@@ -31,7 +31,7 @@ export function* handleLocationChange() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pathsMatch.path) {
|
switch (pathsMatch.pattern.path) {
|
||||||
case Paths.LOGIN:
|
case Paths.LOGIN:
|
||||||
yield call(goToRoot);
|
yield call(goToRoot);
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ export function* handleLocationChange() {
|
|||||||
let attachments;
|
let attachments;
|
||||||
let deletedNotifications;
|
let deletedNotifications;
|
||||||
|
|
||||||
switch (pathsMatch.path) {
|
switch (pathsMatch.pattern.path) {
|
||||||
case Paths.BOARDS:
|
case Paths.BOARDS:
|
||||||
case Paths.CARDS: {
|
case Paths.CARDS: {
|
||||||
const currentBoard = yield select(selectors.selectCurrentBoard);
|
const currentBoard = yield select(selectors.selectCurrentBoard);
|
||||||
@@ -85,7 +85,7 @@ export function* handleLocationChange() {
|
|||||||
} catch (error) {} // eslint-disable-line no-empty
|
} catch (error) {} // eslint-disable-line no-empty
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathsMatch.path === Paths.CARDS) {
|
if (pathsMatch.pattern.path === Paths.CARDS) {
|
||||||
const notificationIds = yield select(selectors.selectNotificationIdsForCurrentCard);
|
const notificationIds = yield select(selectors.selectNotificationIdsForCurrentCard);
|
||||||
|
|
||||||
if (notificationIds && notificationIds.length > 0) {
|
if (notificationIds && notificationIds.length > 0) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { takeEvery } from 'redux-saga/effects';
|
import { takeEvery } from 'redux-saga/effects';
|
||||||
import { LOCATION_CHANGE } from 'connected-react-router';
|
import { LOCATION_CHANGE } from 'redux-first-history';
|
||||||
|
|
||||||
import services from '../services';
|
import services from '../services';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { call, put, select } from 'redux-saga/effects';
|
import { call, put, select } from 'redux-saga/effects';
|
||||||
import { push } from 'connected-react-router';
|
import { push } from 'redux-first-history';
|
||||||
|
|
||||||
import selectors from '../../../selectors';
|
import selectors from '../../../selectors';
|
||||||
import Paths from '../../../constants/Paths';
|
import Paths from '../../../constants/Paths';
|
||||||
@@ -19,7 +19,7 @@ export function* handleLocationChange() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pathsMatch.path) {
|
switch (pathsMatch.pattern.path) {
|
||||||
case Paths.ROOT:
|
case Paths.ROOT:
|
||||||
case Paths.PROJECTS:
|
case Paths.PROJECTS:
|
||||||
case Paths.BOARDS:
|
case Paths.BOARDS:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { takeEvery } from 'redux-saga/effects';
|
import { takeEvery } from 'redux-saga/effects';
|
||||||
import { LOCATION_CHANGE } from 'connected-react-router';
|
import { LOCATION_CHANGE } from 'redux-first-history';
|
||||||
|
|
||||||
import services from '../services';
|
import services from '../services';
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const selectPath = createReduxOrmSelector(
|
|||||||
(state) => selectCurrentUserId(state),
|
(state) => selectCurrentUserId(state),
|
||||||
({ Project, Board, Card }, pathsMatch, currentUserId) => {
|
({ Project, Board, Card }, pathsMatch, currentUserId) => {
|
||||||
if (pathsMatch) {
|
if (pathsMatch) {
|
||||||
switch (pathsMatch.path) {
|
switch (pathsMatch.pattern.path) {
|
||||||
case Paths.PROJECTS: {
|
case Paths.PROJECTS: {
|
||||||
const projectModel = Project.withId(pathsMatch.params.id);
|
const projectModel = Project.withId(pathsMatch.params.id);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { configure } from 'enzyme';
|
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||||
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
// allows you to do things like:
|
||||||
|
// expect(element).toHaveTextContent(/react/i)
|
||||||
import 'jest-enzyme';
|
// learn more: https://github.com/testing-library/jest-dom
|
||||||
|
import '@testing-library/jest-dom';
|
||||||
configure({ adapter: new Adapter() });
|
|
||||||
|
|||||||
+7
-4
@@ -1,14 +1,13 @@
|
|||||||
import { applyMiddleware, legacy_createStore as createStore, compose as reduxCompose } from 'redux';
|
import { applyMiddleware, legacy_createStore as createStore, compose as reduxCompose } from 'redux';
|
||||||
import createSagaMiddleware from 'redux-saga';
|
import createSagaMiddleware from 'redux-saga';
|
||||||
import { routerMiddleware } from 'connected-react-router';
|
|
||||||
|
|
||||||
import rootReducer from './reducers';
|
import rootReducer from './reducers';
|
||||||
import rootSaga from './sagas';
|
import rootSaga from './sagas';
|
||||||
import history from './history';
|
import { createReduxHistory, routerMiddleware } from './redux-history-context';
|
||||||
|
|
||||||
const sagaMiddleware = createSagaMiddleware();
|
const sagaMiddleware = createSagaMiddleware();
|
||||||
|
|
||||||
const middlewares = [sagaMiddleware, routerMiddleware(history)];
|
const middlewares = [sagaMiddleware, routerMiddleware];
|
||||||
|
|
||||||
let compose = reduxCompose;
|
let compose = reduxCompose;
|
||||||
|
|
||||||
@@ -23,6 +22,10 @@ if (process.env.NODE_ENV !== 'production') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default createStore(rootReducer, compose(applyMiddleware(...middlewares)));
|
const store = createStore(rootReducer, compose(applyMiddleware(...middlewares)));
|
||||||
|
|
||||||
sagaMiddleware.run(rootSaga);
|
sagaMiddleware.run(rootSaga);
|
||||||
|
|
||||||
|
export default store;
|
||||||
|
|
||||||
|
export const history = createReduxHistory(store);
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ import { matchPath } from 'react-router-dom';
|
|||||||
|
|
||||||
export default (pathname, paths) => {
|
export default (pathname, paths) => {
|
||||||
for (let i = 0; i < paths.length; i += 1) {
|
for (let i = 0; i < paths.length; i += 1) {
|
||||||
const match = matchPath(pathname, {
|
const match = matchPath(
|
||||||
path: paths[i],
|
{
|
||||||
exact: true,
|
path: paths[i],
|
||||||
});
|
end: true,
|
||||||
|
},
|
||||||
|
pathname,
|
||||||
|
);
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
return match;
|
return match;
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ services:
|
|||||||
- postgres
|
- postgres
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:alpine
|
image: postgres:14-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- db-data:/var/lib/postgresql/data
|
- db-data:/var/lib/postgresql/data
|
||||||
|
|||||||
Generated
+1843
-254
File diff suppressed because it is too large
Load Diff
+26
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.8.4",
|
"version": "1.8.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://plankanban.github.io/planka",
|
"homepage": "https://plankanban.github.io/planka",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -38,9 +38,32 @@
|
|||||||
"npm run server:lint"
|
"npm run server:lint"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"prettier": {
|
||||||
|
"printWidth": 100,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"plugins": [
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"plugin:prettier/recommended"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-undef": "off",
|
||||||
|
"prettier/prettier": "error"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"concurrently": "^7.3.0",
|
"concurrently": "^7.6.0",
|
||||||
"husky": "^8.0.1",
|
"husky": "^8.0.2",
|
||||||
"lint-staged": "^13.0.3"
|
"lint-staged": "^13.0.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^8.28.0",
|
||||||
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"prettier": "^2.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return sails.helpers.cards.getMany(criteria);
|
return sails.helpers.cards.getMany(criteria, 'position');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Generated
+1051
-1155
File diff suppressed because it is too large
Load Diff
+16
-30
@@ -13,24 +13,13 @@
|
|||||||
"test": "mocha test/lifecycle.test.js test/integration/**/*.test.js test/utils/**/*.test.js"
|
"test": "mocha test/lifecycle.test.js test/integration/**/*.test.js test/utils/**/*.test.js"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"plugins": [
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"airbnb-base",
|
"airbnb-base",
|
||||||
"plugin:prettier/recommended"
|
"../package.json"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-throw-literal": "off",
|
"no-throw-literal": "off",
|
||||||
"no-undef": "off",
|
"no-undef": "off"
|
||||||
"prettier/prettier": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"printWidth": 100,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "all"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"_": true,
|
"_": true,
|
||||||
@@ -38,38 +27,35 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypt": "^5.0.1",
|
"bcrypt": "^5.1.0",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.3",
|
||||||
"dotenv-cli": "^6.0.0",
|
"dotenv-cli": "^6.0.0",
|
||||||
"filenamify": "^4.3.0",
|
"filenamify": "^4.3.0",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"knex": "^2.2.0",
|
"knex": "^2.3.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"move-file": "^2.1.0",
|
"move-file": "^2.1.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sails": "^1.5.2",
|
"sails": "^1.5.3",
|
||||||
"sails-hook-orm": "^4.0.1",
|
"sails-hook-orm": "^4.0.2",
|
||||||
"sails-hook-sockets": "^2.0.1",
|
"sails-hook-sockets": "^2.0.3",
|
||||||
"sails-postgresql-redacted": "^1.0.2-9",
|
"sails-postgresql-redacted": "^1.0.2-9",
|
||||||
"sharp": "^0.30.7",
|
"sharp": "^0.31.2",
|
||||||
"stream-to-array": "^2.3.0",
|
"stream-to-array": "^2.3.0",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^9.0.0",
|
||||||
"validator": "^13.7.0",
|
"validator": "^13.7.0",
|
||||||
"winston": "^3.8.1",
|
"winston": "^3.8.2",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.7",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.28.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"mocha": "^10.1.0",
|
||||||
"mocha": "^9.2.2",
|
"nodemon": "^2.0.20",
|
||||||
"nodemon": "^2.0.19",
|
"supertest": "^6.3.1"
|
||||||
"prettier": "2.7.1",
|
|
||||||
"supertest": "^6.2.4"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.10"
|
"node": "^12.10"
|
||||||
|
|||||||
Reference in New Issue
Block a user