Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36e4bef21b | ||
|
|
486e663a3d | ||
|
|
536064fdfe | ||
|
|
f03bb5a78f | ||
|
|
8bf85e2eb6 | ||
|
|
e3d1d36857 | ||
|
|
4371e16c8d | ||
|
|
ec7b4d7b24 | ||
|
|
7974c9dc5d | ||
|
|
e2a8f5b483 | ||
|
|
5049034ae3 | ||
|
|
16a822cc7d | ||
|
|
6f219e5368 | ||
|
|
e239d85901 | ||
|
|
f539e7b76d | ||
|
|
0c92623109 | ||
|
|
95ea1e97d3 | ||
|
|
6f99d99683 | ||
|
|
afdcd11da6 | ||
|
|
a628f116a7 | ||
|
|
6b158f0f1d | ||
|
|
f59981db79 | ||
|
|
96fa39e830 | ||
|
|
2efc20cc02 | ||
|
|
31d314736a | ||
|
|
729e5dac5e | ||
|
|
07e58ffe0c | ||
|
|
32aae89c6e | ||
|
|
1a5c0f53f8 | ||
|
|
b63f0742ba | ||
|
|
b39119ace4 | ||
|
|
d6cb1f6683 | ||
|
|
0f0ae5f483 | ||
|
|
f45b5c704f | ||
|
|
f123254ea3 | ||
|
|
f6dbba2ba9 | ||
|
|
0fb60eb886 | ||
|
|
fb42ed460e | ||
|
|
141fc74dbb | ||
|
|
65aba551c3 | ||
|
|
a3d1a8a09a | ||
|
|
cf21bef9ee | ||
|
|
def1134566 | ||
|
|
a3855f8080 | ||
|
|
f718464940 | ||
|
|
83ad2f45e6 | ||
|
|
3d6f9cc0e5 | ||
|
|
2b318fdc7a | ||
|
|
73c3bf3728 | ||
|
|
179ad3610f | ||
|
|
0eb14c34ef | ||
|
|
3cdb614b57 | ||
|
|
a3adddac6f | ||
|
|
9f6a852da3 | ||
|
|
0cf0e84ded | ||
|
|
de1f7c7564 | ||
|
|
de7d080910 | ||
|
|
771c443694 | ||
|
|
c28fada7ee | ||
|
|
437ac523bc | ||
|
|
6584d1cb5d | ||
|
|
e47697b0c5 | ||
|
|
cc1358b477 | ||
|
|
ab020fc324 | ||
|
|
08aef7c052 | ||
|
|
767d39586c | ||
|
|
089668ed10 | ||
|
|
8fc6bb2e3e | ||
|
|
c6ee7d54bb | ||
|
|
2d92ade8dc | ||
|
|
c4e3c3d4c8 | ||
|
|
d22580cec0 | ||
|
|
99d9ab4a9e | ||
|
|
ab83d7c9ab | ||
|
|
ff95a12578 | ||
|
|
196121bd38 | ||
|
|
313f7ab7c7 | ||
|
|
38f68c1b82 | ||
|
|
99807c2a49 | ||
|
|
2f7a244807 | ||
|
|
fb9ceb5db7 | ||
|
|
efd4de4000 | ||
|
|
746e2fe790 | ||
|
|
c5b44598f9 | ||
|
|
35f9631326 | ||
|
|
ca6efd5b71 | ||
|
|
6a7ad7a24b | ||
|
|
0519df4e4d | ||
|
|
deec1a06a2 | ||
|
|
f4c8bc6ab9 | ||
|
|
cbc942e306 | ||
|
|
712567ac57 | ||
|
|
a9f2948672 | ||
|
|
844b3ab8f1 | ||
|
|
246eb17249 | ||
|
|
e1364925ed | ||
|
|
5481ccb91f | ||
|
|
73bd7aab89 | ||
|
|
63807c7db6 | ||
|
|
ce39b584ca | ||
|
|
3e85371da9 | ||
|
|
3dffed90c6 | ||
|
|
f743f4ea8b | ||
|
|
87a3cf751a | ||
|
|
be8a806102 | ||
|
|
88314e826d | ||
|
|
9b4e3931a9 | ||
|
|
c6ecf126d0 | ||
|
|
af00e3e191 | ||
|
|
ec222a5e32 | ||
|
|
bfd21ec05a | ||
|
|
d1b74f9d11 | ||
|
|
4da29f2d8e | ||
|
|
de7a8cd8d4 | ||
|
|
b93c5aa070 | ||
|
|
5083e7ad57 | ||
|
|
9c7c96a780 | ||
|
|
f0e7fb8fd1 | ||
|
|
dc0f71624b | ||
|
|
622f56c77c | ||
|
|
8b1ca9e52b | ||
|
|
b4fd32fd17 | ||
|
|
00c7f514ae | ||
|
|
a11f6260c0 | ||
|
|
b7f37f0f96 | ||
|
|
27939cbd5e | ||
|
|
4a5980cd82 | ||
|
|
c6bbd038e2 | ||
|
|
3896e0688e | ||
|
|
859c09d05e | ||
|
|
17d2781d33 | ||
|
|
f96c3e83de | ||
|
|
671bfc5efa | ||
|
|
0e9ae2a715 | ||
|
|
97856411a9 | ||
|
|
e07b0bc5b1 | ||
|
|
2566ff376e | ||
|
|
e564729598 | ||
|
|
1f38c6073c | ||
|
|
d770470371 | ||
|
|
5b9cad42fd | ||
|
|
dea090051c | ||
|
|
1d047c8e55 | ||
|
|
dab8159864 | ||
|
|
e8139b29d5 | ||
|
|
4911816734 | ||
|
|
b9d4024957 | ||
|
|
dc09246d8a | ||
|
|
3b050fe5b8 | ||
|
|
a09a53ed12 | ||
|
|
51013b6a32 | ||
|
|
64acf0ac56 | ||
|
|
0eef38da66 | ||
|
|
ded98d412b | ||
|
|
18f0cc59dd | ||
|
|
530e4c26ee | ||
|
|
0ff5a23b6d | ||
|
|
d24c9a7968 | ||
|
|
6eb431f721 | ||
|
|
7bd12cd8b8 | ||
|
|
562d855d46 | ||
|
|
517a508cce | ||
|
|
c7ffc0652a | ||
|
|
5ffef61fe7 |
@@ -0,0 +1,10 @@
|
||||
*/node_modules
|
||||
*/.gitignore
|
||||
*/README.md
|
||||
|
||||
**/.DS_Store
|
||||
**/.gitkeep
|
||||
|
||||
server/public/*
|
||||
server/views/*
|
||||
client/build
|
||||
@@ -0,0 +1 @@
|
||||
client/src/lib/custom-ui/styles.css linguist-vendored
|
||||
@@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
docker-compose.override.yml
|
||||
|
||||
.vscode
|
||||
.DS_Store
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at contact@plankanban.org. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,49 @@
|
||||
# Contributing to Planka
|
||||
|
||||
First off, thanks for taking the time to contribute!
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project and everyone participating in it is governed by the [Planka Code of Conduct](https://github.com/plankanban/planka/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
||||
|
||||
## How Can I Contribute?
|
||||
|
||||
### Reporting Bugs
|
||||
|
||||
Feel free to create a bug report as a new issue on GitHub. Before creating, please check if there is already existing one. When creating a bug report, please include as many details as possible.
|
||||
|
||||
### Suggesting Enhancements
|
||||
|
||||
Feel free to create an enhancement suggestion as a new issue on GitHub. Before creating, please check if there is already existing one. When creating an enhancement suggestion, please include as many details as possible.
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Before submitting a pull request please discuss with the core team by creating or commenting in an issue on GitHub – we'd also love to hear from you in the discussions. This way we can ensure that an approach is agreed on before code is written. This will result in a much higher liklihood of your code being accepted.
|
||||
|
||||
If you’re looking for ways to get started, here's a list of ways to help us improve Planka:
|
||||
|
||||
- [Translation](https://github.com/plankanban/planka/issues/66) into other languages
|
||||
- Issues with [`good first issue`](https://github.com/plankanban/planka/labels/good%20first%20issue) label
|
||||
- Performance improvements, both on client and server
|
||||
- Developer happiness and documentation
|
||||
- Bugs and other issues listed on GitHub
|
||||
|
||||
## Styleguides
|
||||
|
||||
### Git Commit Messages
|
||||
|
||||
Commit messages should follow the [commit message convention](https://conventionalcommits.org), so changelogs could be generated automatically by that.
|
||||
|
||||
Additional rules:
|
||||
|
||||
- Separate subject from body with a blank line
|
||||
- Limit the subject line to 70 characters
|
||||
- Capitalize the subject line
|
||||
- Do not end the subject line with a period
|
||||
- Use the imperative mood in the subject line
|
||||
- Use the body to explain what and why vs. how
|
||||
- Each commit should be a single, stable change
|
||||
|
||||
### JavaScript
|
||||
|
||||
All JavaScript code should follow this [JavaScript style guide](https://github.com/airbnb/javascript). The pre-commit hook will help you find linting errors before committing.
|
||||
@@ -0,0 +1,64 @@
|
||||
FROM node:lts AS client-builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY client/package.json client/package-lock.json ./
|
||||
|
||||
RUN npm install npm@latest --global \
|
||||
&& npm install
|
||||
|
||||
COPY client .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:lts-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY server/.npmrc server/package.json server/package-lock.json ./
|
||||
|
||||
ARG ALPINE_VERSION=3.15
|
||||
ARG VIPS_VERSION=8.12.2
|
||||
|
||||
RUN apk -U upgrade \
|
||||
&& apk add \
|
||||
bash giflib glib lcms2 libexif \
|
||||
libgsf libjpeg-turbo libpng librsvg libwebp \
|
||||
orc pango tiff \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/community/ \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/main/ \
|
||||
--no-cache \
|
||||
&& apk add \
|
||||
build-base giflib-dev glib-dev lcms2-dev libexif-dev \
|
||||
libgsf-dev libjpeg-turbo-dev libpng-dev librsvg-dev libwebp-dev \
|
||||
orc-dev pango-dev tiff-dev \
|
||||
--virtual vips-dependencies \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/community/ \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/main/ \
|
||||
--no-cache \
|
||||
&& wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp \
|
||||
&& cd /tmp/vips-${VIPS_VERSION} \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install-strip \
|
||||
&& cd $OLDPWD \
|
||||
&& rm -rf /tmp/vips-${VIPS_VERSION} \
|
||||
&& npm install npm@latest --global \
|
||||
&& npm install --production \
|
||||
&& apk del vips-dependencies --purge
|
||||
|
||||
COPY docker-start.sh start.sh
|
||||
COPY server .
|
||||
|
||||
RUN chmod +x start.sh \
|
||||
&& cp .env.sample .env
|
||||
|
||||
COPY --from=client-builder /app/build public
|
||||
COPY --from=client-builder /app/build/index.html views
|
||||
|
||||
VOLUME /app/public/user-avatars
|
||||
VOLUME /app/public/project-background-images
|
||||
VOLUME /app/private/attachments
|
||||
|
||||
EXPOSE 1337
|
||||
|
||||
CMD ["./start.sh"]
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Maksim Eltyshev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,86 @@
|
||||
# Planka
|
||||
|
||||
  
|
||||
|
||||
A Trello-like kanban board built with React and Redux.
|
||||
|
||||

|
||||
|
||||
[**Client demo**](https://plankanban.github.io/planka) (without server features).
|
||||
|
||||
## Features
|
||||
|
||||
- Create projects, boards, lists, cards, labels and tasks
|
||||
- Add card members, track time, set a due date, add attachments, write comments
|
||||
- Markdown support in a card description and comment
|
||||
- Filter by members and labels
|
||||
- Customize project background
|
||||
- Real-time updates
|
||||
- User notifications
|
||||
- Internationalization
|
||||
|
||||
## Deploy
|
||||
|
||||
### Docker Compose
|
||||
|
||||
[](https://hub.docker.com/r/meltyshev/planka)
|
||||
|
||||
- Make sure you have [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) installed and operational.
|
||||
- Create `docker-compose.yml` based on [the example](https://raw.githubusercontent.com/plankanban/planka/master/docker-compose.yml). This is the ONLY file you will need. You can create this file on your own machine by copy and pasting the content.
|
||||
- Edit `BASE_URL` to match your domain name or IP address.
|
||||
- Edit `SECRET_KEY` with random value. You can generate it by `openssl rand -hex 64`.
|
||||
|
||||
Download the docker-compose.yml:
|
||||
|
||||
```
|
||||
curl -L https://raw.githubusercontent.com/plankanban/planka/master/docker-compose.yml -o docker-compose.yml
|
||||
```
|
||||
|
||||
Pull images and start services:
|
||||
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Demo user: demo@demo.demo demo
|
||||
|
||||
## Development
|
||||
|
||||
Clone the repository and install dependencies:
|
||||
|
||||
```
|
||||
git clone https://github.com/plankanban/planka.git
|
||||
|
||||
cd planka
|
||||
npm install
|
||||
```
|
||||
|
||||
Either use a local database or start the provided development database:
|
||||
|
||||
```
|
||||
docker-compose -f docker-compose-dev.yml up
|
||||
```
|
||||
|
||||
Create `server/.env` based on `server/.env.sample` and edit `DATABASE_URL` if needed, then initialize the database:
|
||||
|
||||
```
|
||||
npm run server:db:init
|
||||
```
|
||||
|
||||
Start the development server:
|
||||
|
||||
```
|
||||
npm start
|
||||
```
|
||||
|
||||
Demo user: demo@demo.demo demo
|
||||
|
||||
## Tech stack
|
||||
|
||||
- React, Redux, Redux-Saga, Redux-ORM, Semantic UI React, react-beautiful-dnd
|
||||
- Sails.js, Knex.js
|
||||
- PostgreSQL
|
||||
|
||||
## License
|
||||
|
||||
Planka is [MIT licensed](https://github.com/plankanban/planka/blob/master/LICENSE).
|
||||
@@ -1,80 +0,0 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/planka/static/css/main.859cd79e.css",
|
||||
"main.js": "/planka/static/js/main.5081d4cc.js",
|
||||
"static/js/801.9773e58e.chunk.js": "/planka/static/js/801.9773e58e.chunk.js",
|
||||
"static/js/467.d02e66c6.chunk.js": "/planka/static/js/467.d02e66c6.chunk.js",
|
||||
"static/js/514.592fb053.chunk.js": "/planka/static/js/514.592fb053.chunk.js",
|
||||
"static/js/294.e0243dff.chunk.js": "/planka/static/js/294.e0243dff.chunk.js",
|
||||
"static/js/394.5692e060.chunk.js": "/planka/static/js/394.5692e060.chunk.js",
|
||||
"static/js/117.2c68642f.chunk.js": "/planka/static/js/117.2c68642f.chunk.js",
|
||||
"static/js/181.24dbd8ba.chunk.js": "/planka/static/js/181.24dbd8ba.chunk.js",
|
||||
"static/js/902.1af73487.chunk.js": "/planka/static/js/902.1af73487.chunk.js",
|
||||
"static/js/875.4756cbe5.chunk.js": "/planka/static/js/875.4756cbe5.chunk.js",
|
||||
"static/js/694.e5cf50a6.chunk.js": "/planka/static/js/694.e5cf50a6.chunk.js",
|
||||
"static/js/632.9315886b.chunk.js": "/planka/static/js/632.9315886b.chunk.js",
|
||||
"static/js/812.77d21c8d.chunk.js": "/planka/static/js/812.77d21c8d.chunk.js",
|
||||
"static/js/215.bb7d98af.chunk.js": "/planka/static/js/215.bb7d98af.chunk.js",
|
||||
"static/js/683.e8a7c172.chunk.js": "/planka/static/js/683.e8a7c172.chunk.js",
|
||||
"static/media/big-picture.jpg": "/planka/static/media/big-picture.b78130bf7100f3416c1c.jpg",
|
||||
"static/media/cover.jpg": "/planka/static/media/cover.a3c21cab987867165c62.jpg",
|
||||
"static/media/simple-picture.jpg": "/planka/static/media/simple-picture.0442003259f074c6cc5d.jpg",
|
||||
"static/media/brand-icons.svg": "/planka/static/media/brand-icons.6729d29753e000c17489.svg",
|
||||
"static/media/simple-pdf.pdf": "/planka/static/media/simple-pdf.2b466d228796d7c86d15.pdf",
|
||||
"static/media/fontawesome-webfont.svg?v=4.7.0": "/planka/static/media/fontawesome-webfont.c1e38fd9e0e74ba58f7a.svg",
|
||||
"static/media/icons.svg": "/planka/static/media/icons.62d9dae4e0040e81c980.svg",
|
||||
"static/media/original.jpg": "/planka/static/media/original.fd3fb2a1d11429b0ec28.jpg",
|
||||
"static/media/high-picture.jpg": "/planka/static/media/high-picture.28d94c085a2a9ac5ccf3.jpg",
|
||||
"static/media/fontawesome-webfont.eot": "/planka/static/media/fontawesome-webfont.8b43027f47b20503057d.eot",
|
||||
"static/media/fontawesome-webfont.ttf?v=4.7.0": "/planka/static/media/fontawesome-webfont.1e59d2330b4c6deb84b3.ttf",
|
||||
"static/media/outline-icons.svg": "/planka/static/media/outline-icons.9c4845b4b41ef40a22fa.svg",
|
||||
"static/media/icons.eot": "/planka/static/media/icons.a01e3f2d6c83dc3aee17.eot",
|
||||
"static/media/icons.ttf": "/planka/static/media/icons.c656b8caa454ed19b9a2.ttf",
|
||||
"static/media/cover-256.jpg": "/planka/static/media/cover-256.4acd3319c6762c5d1b4b.jpg",
|
||||
"static/media/brand-icons.eot": "/planka/static/media/brand-icons.d68fa3e67dbb653a13ce.eot",
|
||||
"static/media/brand-icons.ttf": "/planka/static/media/brand-icons.65a2fb6d9aaa164b41a0.ttf",
|
||||
"static/media/fontawesome-webfont.woff?v=4.7.0": "/planka/static/media/fontawesome-webfont.f691f37e57f04c152e23.woff",
|
||||
"static/media/cover-336.jpg": "/planka/static/media/cover-336.d1a186776f06837a4ec3.jpg",
|
||||
"static/media/fontawesome-webfont.woff2?v=4.7.0": "/planka/static/media/fontawesome-webfont.20fd1704ea223900efa9.woff2",
|
||||
"static/media/brand-icons.woff": "/planka/static/media/brand-icons.cac87dc00c87a5d74711.woff",
|
||||
"static/media/brand-icons.woff2": "/planka/static/media/brand-icons.278156e41e0ad908cf7f.woff2",
|
||||
"static/media/marked.cjs": "/planka/static/media/marked.2244abd198e53bc0b3d6.cjs",
|
||||
"static/media/icons.woff": "/planka/static/media/icons.425399f81e4ce7cbd967.woff",
|
||||
"static/media/Nunitoga-Medium.woff2": "/planka/static/media/Nunitoga-Medium.bae369ea6c0c9ad31db6.woff2",
|
||||
"static/media/Nunitoga-BoldItalic.woff2": "/planka/static/media/Nunitoga-BoldItalic.06ec745f47d8c9431b42.woff2",
|
||||
"static/media/Nunitoga-MediumItalic.woff2": "/planka/static/media/Nunitoga-MediumItalic.5ce0915188332f04e46d.woff2",
|
||||
"static/media/Nunitoga-LightItalic.woff2": "/planka/static/media/Nunitoga-LightItalic.f1b251d4faa9826b3ea2.woff2",
|
||||
"static/media/Nunitoga-Bold.woff2": "/planka/static/media/Nunitoga-Bold.46fd9a43c89bf2b6a1fe.woff2",
|
||||
"static/media/Nunitoga-Light.woff2": "/planka/static/media/Nunitoga-Light.e9d89c979b64722f34ec.woff2",
|
||||
"static/media/icons.woff2": "/planka/static/media/icons.38c6d8bab26db77d8c80.woff2",
|
||||
"static/media/outline-icons.eot": "/planka/static/media/outline-icons.752905fa5edf21fc52a1.eot",
|
||||
"static/media/outline-icons.ttf": "/planka/static/media/outline-icons.5367103510b27b784827.ttf",
|
||||
"static/media/flags.png": "/planka/static/media/flags.99f63ae7a743f21ab308.png",
|
||||
"static/media/logo.png": "/planka/static/media/logo.f8c2b962d0f2bd7f46cb.png",
|
||||
"static/media/outline-icons.woff": "/planka/static/media/outline-icons.ddae9b1ba9b0b42f5880.woff",
|
||||
"static/media/outline-icons.woff2": "/planka/static/media/outline-icons.687a4990ea22bb1a49d4.woff2",
|
||||
"index.html": "/planka/index.html",
|
||||
"static/media/plus-icon.svg": "/planka/static/media/plus-icon.e46c682424b8c98c4f7bd0f367a260c2.svg",
|
||||
"static/media/plus-math-icon.svg": "/planka/static/media/plus-math-icon.cfa58840e75860dcf79a0b21a1cca781.svg",
|
||||
"main.859cd79e.css.map": "/planka/static/css/main.859cd79e.css.map",
|
||||
"main.5081d4cc.js.map": "/planka/static/js/main.5081d4cc.js.map",
|
||||
"801.9773e58e.chunk.js.map": "/planka/static/js/801.9773e58e.chunk.js.map",
|
||||
"467.d02e66c6.chunk.js.map": "/planka/static/js/467.d02e66c6.chunk.js.map",
|
||||
"514.592fb053.chunk.js.map": "/planka/static/js/514.592fb053.chunk.js.map",
|
||||
"294.e0243dff.chunk.js.map": "/planka/static/js/294.e0243dff.chunk.js.map",
|
||||
"394.5692e060.chunk.js.map": "/planka/static/js/394.5692e060.chunk.js.map",
|
||||
"117.2c68642f.chunk.js.map": "/planka/static/js/117.2c68642f.chunk.js.map",
|
||||
"181.24dbd8ba.chunk.js.map": "/planka/static/js/181.24dbd8ba.chunk.js.map",
|
||||
"902.1af73487.chunk.js.map": "/planka/static/js/902.1af73487.chunk.js.map",
|
||||
"875.4756cbe5.chunk.js.map": "/planka/static/js/875.4756cbe5.chunk.js.map",
|
||||
"694.e5cf50a6.chunk.js.map": "/planka/static/js/694.e5cf50a6.chunk.js.map",
|
||||
"632.9315886b.chunk.js.map": "/planka/static/js/632.9315886b.chunk.js.map",
|
||||
"812.77d21c8d.chunk.js.map": "/planka/static/js/812.77d21c8d.chunk.js.map",
|
||||
"215.bb7d98af.chunk.js.map": "/planka/static/js/215.bb7d98af.chunk.js.map",
|
||||
"683.e8a7c172.chunk.js.map": "/planka/static/js/683.e8a7c172.chunk.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.859cd79e.css",
|
||||
"static/js/main.5081d4cc.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -0,0 +1 @@
|
||||
# Planka client
|
||||
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"name": "planka-client",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "react-scripts build",
|
||||
"eject": "react-scripts eject",
|
||||
"lint": "eslint --ext js,jsx src",
|
||||
"start": "react-scripts start",
|
||||
"test": "react-scripts test"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"jest": true
|
||||
},
|
||||
"parser": "@babel/eslint-parser",
|
||||
"parserOptions": {
|
||||
"babelOptions": {
|
||||
"presets": [
|
||||
"airbnb"
|
||||
]
|
||||
},
|
||||
"requireConfigFile": false
|
||||
},
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"extends": [
|
||||
"airbnb",
|
||||
"airbnb/hooks",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"import/no-extraneous-dependencies": [
|
||||
"error",
|
||||
{
|
||||
"devDependencies": [
|
||||
"src/setupTests.js",
|
||||
"**/*.test.js"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prettier/prettier": [
|
||||
"error",
|
||||
{
|
||||
"printWidth": 100,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6",
|
||||
"connected-react-router": "^6.9.2",
|
||||
"date-fns": "^2.28.0",
|
||||
"dequal": "^2.0.2",
|
||||
"history": "^4.10.1",
|
||||
"i18next": "^21.6.16",
|
||||
"i18next-browser-languagedetector": "^6.1.4",
|
||||
"initials": "^3.1.2",
|
||||
"js-cookie": "^3.0.1",
|
||||
"lodash": "^4.17.20",
|
||||
"node-sass": "^7.0.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^17.0.2",
|
||||
"react-beautiful-dnd": "^13.0.0",
|
||||
"react-datepicker": "^4.7.0",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dropzone": "^12.0.5",
|
||||
"react-i18next": "^11.16.6",
|
||||
"react-input-mask": "^2.0.4",
|
||||
"react-markdown": "^8.0.2",
|
||||
"react-redux": "^7.2.8",
|
||||
"react-router-dom": "^5.3.1",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-textarea-autosize": "^8.3.3",
|
||||
"redux": "^4.1.2",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-orm": "^0.16.2",
|
||||
"redux-saga": "^1.1.3",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"reselect": "^4.1.5",
|
||||
"sails.io.js": "^1.2.1",
|
||||
"semantic-ui-react": "^2.1.2",
|
||||
"socket.io-client": "^2.3.1",
|
||||
"validator": "^13.7.0",
|
||||
"whatwg-fetch": "^3.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
|
||||
"babel-preset-airbnb": "^5.0.0",
|
||||
"chai": "^4.3.6",
|
||||
"enzyme": "^3.11.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.29.4",
|
||||
"eslint-plugin-react-hooks": "^4.4.0",
|
||||
"jest-enzyme": "^7.1.2",
|
||||
"prettier": "2.6.2",
|
||||
"react-test-renderer": "^17.0.2"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Planka is an open source project management software"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="logo192.png" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>Planka</title>
|
||||
</head>
|
||||
<body id="app">
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
@@ -0,0 +1,22 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const handleActionCreate = (action) => ({
|
||||
type: ActionTypes.ACTION_CREATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleActionUpdate = (action) => ({
|
||||
type: ActionTypes.ACTION_UPDATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleActionDelete = (action) => ({
|
||||
type: ActionTypes.ACTION_DELETE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const fetchActions = (cardId) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH,
|
||||
payload: {
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
fetchActions.success = (cardId, actions, users) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH__SUCCESS,
|
||||
payload: {
|
||||
cardId,
|
||||
actions,
|
||||
users,
|
||||
},
|
||||
});
|
||||
|
||||
fetchActions.failure = (cardId, error) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH__FAILURE,
|
||||
payload: {
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createAttachment = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
createAttachment.success = (localId, attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
createAttachment.failure = (localId, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentCreate = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachment = (id, data) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateAttachment.success = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
updateAttachment.failure = (id, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentUpdate = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachment = (id) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteAttachment.success = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE__SUCCESS,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
deleteAttachment.failure = (id, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentDelete = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,97 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createBoardMembership = (boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
createBoardMembership.success = (localId, boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
createBoardMembership.failure = (localId, error) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipCreate = (
|
||||
boardMembership,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
handleBoardMembershipCreate.fetchProject = (id, currentUserId, currentBoardId) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE__PROJECT_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
currentUserId,
|
||||
currentBoardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardMembership = (id) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoardMembership.success = (boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE__SUCCESS,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoardMembership.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipDelete = (boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,135 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createBoard = (board) => ({
|
||||
type: ActionTypes.BOARD_CREATE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
createBoard.success = (localId, board, boardMemberships) => ({
|
||||
type: ActionTypes.BOARD_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
board,
|
||||
boardMemberships,
|
||||
},
|
||||
});
|
||||
|
||||
createBoard.failure = (localId, error) => ({
|
||||
type: ActionTypes.BOARD_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardCreate = (board) => ({
|
||||
type: ActionTypes.BOARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoard = (id) => ({
|
||||
type: ActionTypes.BOARD_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
fetchBoard.success = (
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.BOARD_FETCH__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
fetchBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_FETCH__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoard = (id, data) => ({
|
||||
type: ActionTypes.BOARD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateBoard.success = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
updateBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardUpdate = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoard = (id) => ({
|
||||
type: ActionTypes.BOARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoard.success = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardDelete = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createCard = (card) => ({
|
||||
type: ActionTypes.CARD_CREATE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
createCard.success = (localId, card) => ({
|
||||
type: ActionTypes.CARD_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
createCard.failure = (localId, error) => ({
|
||||
type: ActionTypes.CARD_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardCreate = (card) => ({
|
||||
type: ActionTypes.CARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCard = (id, data) => ({
|
||||
type: ActionTypes.CARD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateCard.success = (card) => ({
|
||||
type: ActionTypes.CARD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
updateCard.failure = (id, error) => ({
|
||||
type: ActionTypes.CARD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardUpdate = (card) => ({
|
||||
type: ActionTypes.CARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCard = (id) => ({
|
||||
type: ActionTypes.CARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteCard.success = (card) => ({
|
||||
type: ActionTypes.CARD_DELETE__SUCCESS,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
deleteCard.failure = (id, error) => ({
|
||||
type: ActionTypes.CARD_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardDelete = (card) => ({
|
||||
type: ActionTypes.CARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,69 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createCommentAction = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
createCommentAction.success = (localId, action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
createCommentAction.failure = (localId, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCommentAction = (id, data) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateCommentAction.success = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
updateCommentAction.failure = (id, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentAction = (id) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteCommentAction.success = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE__SUCCESS,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
deleteCommentAction.failure = (id, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const initializeCore = (
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
) => ({
|
||||
type: ActionTypes.CORE_INITIALIZE,
|
||||
payload: {
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const handleActionCreate = (action) => ({
|
||||
type: EntryActionTypes.ACTION_CREATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleActionUpdate = (action) => ({
|
||||
type: EntryActionTypes.ACTION_UPDATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleActionDelete = (action) => ({
|
||||
type: EntryActionTypes.ACTION_DELETE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const fetchActionsInCurrentCard = () => ({
|
||||
type: EntryActionTypes.ACTIONS_IN_CURRENT_CARD_FETCH,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,45 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createAttachmentInCurrentCard = (data) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_IN_CURRENT_CARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentCreate = (attachment, requestId) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_CREATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
requestId,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachment = (id, data) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentUpdate = (attachment) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachment = (id) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentDelete = (attachment) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_DELETE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createMembershipInCurrentBoard = (data) => ({
|
||||
type: EntryActionTypes.MEMBERSHIP_IN_CURRENT_BOARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipCreate = (boardMembership) => ({
|
||||
type: EntryActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardMembership = (id) => ({
|
||||
type: EntryActionTypes.BOARD_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipDelete = (boardMembership) => ({
|
||||
type: EntryActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createBoardInCurrentProject = (data) => ({
|
||||
type: EntryActionTypes.BOARD_IN_CURRENT_PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardCreate = (board) => ({
|
||||
type: EntryActionTypes.BOARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoard = (id) => ({
|
||||
type: EntryActionTypes.BOARD_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoard = (id, data) => ({
|
||||
type: EntryActionTypes.BOARD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardUpdate = (board) => ({
|
||||
type: EntryActionTypes.BOARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveBoard = (id, index) => ({
|
||||
type: EntryActionTypes.BOARD_MOVE,
|
||||
payload: {
|
||||
id,
|
||||
index,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoard = (id) => ({
|
||||
type: EntryActionTypes.BOARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardDelete = (board) => ({
|
||||
type: EntryActionTypes.BOARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,93 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createCard = (listId, data) => ({
|
||||
type: EntryActionTypes.CARD_CREATE,
|
||||
payload: {
|
||||
listId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardCreate = (card) => ({
|
||||
type: EntryActionTypes.CARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCard = (id, data) => ({
|
||||
type: EntryActionTypes.CARD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentCard = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_CARD_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardUpdate = (card) => ({
|
||||
type: EntryActionTypes.CARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveCard = (id, listId, index = 0) => ({
|
||||
type: EntryActionTypes.CARD_MOVE,
|
||||
payload: {
|
||||
id,
|
||||
listId,
|
||||
index,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveCurrentCard = (listId, index = 0) => ({
|
||||
type: EntryActionTypes.CURRENT_CARD_MOVE,
|
||||
payload: {
|
||||
listId,
|
||||
index,
|
||||
},
|
||||
});
|
||||
|
||||
export const transferCard = (id, boardId, listId, index = 0) => ({
|
||||
type: EntryActionTypes.CARD_TRANSFER,
|
||||
payload: {
|
||||
id,
|
||||
boardId,
|
||||
listId,
|
||||
index,
|
||||
},
|
||||
});
|
||||
|
||||
export const transferCurrentCard = (boardId, listId, index = 0) => ({
|
||||
type: EntryActionTypes.CURRENT_CARD_TRANSFER,
|
||||
payload: {
|
||||
boardId,
|
||||
listId,
|
||||
index,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCard = (id) => ({
|
||||
type: EntryActionTypes.CARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCurrentCard = () => ({
|
||||
type: EntryActionTypes.CURRENT_CARD_DELETE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleCardDelete = (card) => ({
|
||||
type: EntryActionTypes.CARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createCommentActionInCurrentCard = (data) => ({
|
||||
type: EntryActionTypes.COMMENT_ACTION_IN_CURRENT_CARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCommentAction = (id, data) => ({
|
||||
type: EntryActionTypes.COMMENT_ACTION_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentAction = (id) => ({
|
||||
type: EntryActionTypes.COMMENT_ACTION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const initializeCore = () => ({
|
||||
type: EntryActionTypes.CORE_INITIALIZE,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
export * from './socket';
|
||||
export * from './login';
|
||||
export * from './core';
|
||||
export * from './modal';
|
||||
export * from './user';
|
||||
export * from './project';
|
||||
export * from './project-manager';
|
||||
export * from './board';
|
||||
export * from './board-membership';
|
||||
export * from './label';
|
||||
export * from './list';
|
||||
export * from './card';
|
||||
export * from './task';
|
||||
export * from './attachment';
|
||||
export * from './actions';
|
||||
export * from './action';
|
||||
export * from './comment-action';
|
||||
export * from './notification';
|
||||
@@ -0,0 +1,102 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createLabelInCurrentBoard = (data) => ({
|
||||
type: EntryActionTypes.LABEL_IN_CURRENT_BOARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelCreate = (label) => ({
|
||||
type: EntryActionTypes.LABEL_CREATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabel = (id, data) => ({
|
||||
type: EntryActionTypes.LABEL_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelUpdate = (label) => ({
|
||||
type: EntryActionTypes.LABEL_UPDATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
type: EntryActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelDelete = (label) => ({
|
||||
type: EntryActionTypes.LABEL_DELETE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.LABEL_TO_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToCurrentCard = (id) => ({
|
||||
type: EntryActionTypes.LABEL_TO_CURRENT_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
||||
type: EntryActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCurrentCard = (id) => ({
|
||||
type: EntryActionTypes.LABEL_FROM_CURRENT_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
||||
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToFilterInCurrentBoard = (id) => ({
|
||||
type: EntryActionTypes.LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromFilterInCurrentBoard = (id) => ({
|
||||
type: EntryActionTypes.LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createListInCurrentBoard = (data) => ({
|
||||
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListCreate = (list) => ({
|
||||
type: EntryActionTypes.LIST_CREATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateList = (id, data) => ({
|
||||
type: EntryActionTypes.LIST_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListUpdate = (list) => ({
|
||||
type: EntryActionTypes.LIST_UPDATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveList = (id, index) => ({
|
||||
type: EntryActionTypes.LIST_MOVE,
|
||||
payload: {
|
||||
id,
|
||||
index,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteList = (id) => ({
|
||||
type: EntryActionTypes.LIST_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListDelete = (list) => ({
|
||||
type: EntryActionTypes.LIST_DELETE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const authenticate = (data) => ({
|
||||
type: EntryActionTypes.AUTHENTICATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearAuthenticateError = () => ({
|
||||
type: EntryActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const logout = () => ({
|
||||
type: EntryActionTypes.LOGOUT,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
import ModalTypes from '../../constants/ModalTypes';
|
||||
|
||||
export const openUsersModal = () => ({
|
||||
type: EntryActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type: ModalTypes.USERS,
|
||||
},
|
||||
});
|
||||
|
||||
export const openUserSettingsModal = () => ({
|
||||
type: EntryActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type: ModalTypes.USER_SETTINGS,
|
||||
},
|
||||
});
|
||||
|
||||
export const openProjectAddModal = () => ({
|
||||
type: EntryActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type: ModalTypes.PROJECT_ADD,
|
||||
},
|
||||
});
|
||||
|
||||
export const openProjectSettingsModal = () => ({
|
||||
type: EntryActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type: ModalTypes.PROJECT_SETTINGS,
|
||||
},
|
||||
});
|
||||
|
||||
export const closeModal = () => ({
|
||||
type: EntryActionTypes.MODAL_CLOSE,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const handleNotificationCreate = (notification) => ({
|
||||
type: EntryActionTypes.NOTIFICATION_CREATE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotification = (id) => ({
|
||||
type: EntryActionTypes.NOTIFICATION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleNotificationDelete = (notification) => ({
|
||||
type: EntryActionTypes.NOTIFICATION_DELETE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createManagerInCurrentProject = (data) => ({
|
||||
type: EntryActionTypes.MANAGER_IN_CURRENT_PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerCreate = (projectManager) => ({
|
||||
type: EntryActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectManager = (id) => ({
|
||||
type: EntryActionTypes.PROJECT_MANAGER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerDelete = (projectManager) => ({
|
||||
type: EntryActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createProject = (data) => ({
|
||||
type: EntryActionTypes.PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectCreate = (project) => ({
|
||||
type: EntryActionTypes.PROJECT_CREATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentProject = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectUpdate = (project) => ({
|
||||
type: EntryActionTypes.PROJECT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentProjectBackgroundImage = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_BACKGROUND_IMAGE_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCurrentProject = () => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_DELETE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleProjectDelete = (project) => ({
|
||||
type: EntryActionTypes.PROJECT_DELETE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const handleSocketDisconnect = () => ({
|
||||
type: EntryActionTypes.SOCKET_DISCONNECT_HANDLE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleSocketReconnect = () => ({
|
||||
type: EntryActionTypes.SOCKET_RECONNECT_HANDLE,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createTaskInCurrentCard = (data) => ({
|
||||
type: EntryActionTypes.TASK_IN_CURRENT_CARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskCreate = (task) => ({
|
||||
type: EntryActionTypes.TASK_CREATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTask = (id, data) => ({
|
||||
type: EntryActionTypes.TASK_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskUpdate = (task) => ({
|
||||
type: EntryActionTypes.TASK_UPDATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTask = (id) => ({
|
||||
type: EntryActionTypes.TASK_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskDelete = (task) => ({
|
||||
type: EntryActionTypes.TASK_DELETE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,157 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createUser = (data) => ({
|
||||
type: EntryActionTypes.USER_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserCreate = (user) => ({
|
||||
type: EntryActionTypes.USER_CREATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserCreateError = () => ({
|
||||
type: EntryActionTypes.USER_CREATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateUser = (id, data) => ({
|
||||
type: EntryActionTypes.USER_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUser = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserUpdate = (user) => ({
|
||||
type: EntryActionTypes.USER_UPDATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUserEmail = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearCurrentUserEmailUpdateError = () => ({
|
||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateCurrentUserPassword = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearCurrentUserPasswordUpdateError = () => ({
|
||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateCurrentUserUsername = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearCurrentUserUsernameUpdateError = () => ({
|
||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateCurrentUserAvatar = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_AVATAR_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUser = (id) => ({
|
||||
type: EntryActionTypes.USER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserDelete = (user) => ({
|
||||
type: EntryActionTypes.USER_DELETE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.USER_TO_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToCurrentCard = (id) => ({
|
||||
type: EntryActionTypes.USER_TO_CURRENT_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserToCardAdd = (cardMembership) => ({
|
||||
type: EntryActionTypes.USER_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.USER_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromCurrentCard = (id) => ({
|
||||
type: EntryActionTypes.USER_FROM_CURRENT_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserFromCardRemove = (cardMembership) => ({
|
||||
type: EntryActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToFilterInCurrentBoard = (id) => ({
|
||||
type: EntryActionTypes.USER_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromFilterInCurrentBoard = (id) => ({
|
||||
type: EntryActionTypes.USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
export * from './router';
|
||||
export * from './socket';
|
||||
export * from './login';
|
||||
export * from './core';
|
||||
export * from './modal';
|
||||
export * from './user';
|
||||
export * from './project';
|
||||
export * from './project-manager';
|
||||
export * from './board';
|
||||
export * from './board-membership';
|
||||
export * from './label';
|
||||
export * from './list';
|
||||
export * from './card';
|
||||
export * from './task';
|
||||
export * from './attachment';
|
||||
export * from './actions';
|
||||
export * from './action';
|
||||
export * from './comment-action';
|
||||
export * from './notification';
|
||||
@@ -0,0 +1,168 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createLabel = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
createLabel.success = (localId, label) => ({
|
||||
type: ActionTypes.LABEL_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
createLabel.failure = (localId, error) => ({
|
||||
type: ActionTypes.LABEL_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelCreate = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabel = (id, data) => ({
|
||||
type: ActionTypes.LABEL_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateLabel.success = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
updateLabel.failure = (id, error) => ({
|
||||
type: ActionTypes.LABEL_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelUpdate = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
type: ActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteLabel.success = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE__SUCCESS,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
deleteLabel.failure = (id, error) => ({
|
||||
type: ActionTypes.LABEL_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelDelete = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToCard = (id, cardId) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
addLabelToCard.success = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD__SUCCESS,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
addLabelToCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCard = (id, cardId) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
removeLabelFromCard.success = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE__SUCCESS,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
removeLabelFromCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.LABEL_TO_BOARD_FILTER_ADD,
|
||||
payload: {
|
||||
id,
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.LABEL_FROM_BOARD_FILTER_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createList = (list) => ({
|
||||
type: ActionTypes.LIST_CREATE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
createList.success = (localId, list) => ({
|
||||
type: ActionTypes.LIST_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
createList.failure = (localId, error) => ({
|
||||
type: ActionTypes.LIST_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListCreate = (list) => ({
|
||||
type: ActionTypes.LIST_CREATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateList = (id, data) => ({
|
||||
type: ActionTypes.LIST_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateList.success = (list) => ({
|
||||
type: ActionTypes.LIST_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
updateList.failure = (id, error) => ({
|
||||
type: ActionTypes.LIST_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListUpdate = (list) => ({
|
||||
type: ActionTypes.LIST_UPDATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteList = (id) => ({
|
||||
type: ActionTypes.LIST_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteList.success = (list) => ({
|
||||
type: ActionTypes.LIST_DELETE__SUCCESS,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
deleteList.failure = (id, error) => ({
|
||||
type: ActionTypes.LIST_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListDelete = (list) => ({
|
||||
type: ActionTypes.LIST_DELETE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const authenticate = (data) => ({
|
||||
type: ActionTypes.AUTHENTICATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
authenticate.success = (accessToken) => ({
|
||||
type: ActionTypes.AUTHENTICATE__SUCCESS,
|
||||
payload: {
|
||||
accessToken,
|
||||
},
|
||||
});
|
||||
|
||||
authenticate.failure = (error) => ({
|
||||
type: ActionTypes.AUTHENTICATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearAuthenticateError = () => ({
|
||||
type: ActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const logout = () => ({
|
||||
type: ActionTypes.LOGOUT,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const openModal = (type) => ({
|
||||
type: ActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
|
||||
export const closeModal = () => ({
|
||||
type: ActionTypes.MODAL_CLOSE,
|
||||
payload: {},
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const handleNotificationCreate = (notification, users, cards, actions) => ({
|
||||
type: ActionTypes.NOTIFICATION_CREATE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
users,
|
||||
cards,
|
||||
actions,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotification = (id) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteNotification.success = (notification) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE__SUCCESS,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
|
||||
deleteNotification.failure = (id, error) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleNotificationDelete = (notification) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,101 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createProjectManager = (projectManager) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
|
||||
createProjectManager.success = (localId, projectManager) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
|
||||
createProjectManager.failure = (localId, error) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerCreate = (
|
||||
projectManager,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
handleProjectManagerCreate.fetchProject = (id, currentUserId, currentBoardId) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE__PROJECT_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
currentUserId,
|
||||
currentBoardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectManager = (id, isCurrentUser, isCurrentProject) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
isCurrentUser,
|
||||
isCurrentProject,
|
||||
},
|
||||
});
|
||||
|
||||
deleteProjectManager.success = (projectManager) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE__SUCCESS,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
|
||||
deleteProjectManager.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerDelete = (projectManager, isCurrentUser, isCurrentProject) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
isCurrentUser,
|
||||
isCurrentProject,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,115 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createProject = (data) => ({
|
||||
type: ActionTypes.PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
createProject.success = (project, projectManagers) => ({
|
||||
type: ActionTypes.PROJECT_CREATE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
projectManagers,
|
||||
},
|
||||
});
|
||||
|
||||
createProject.failure = (error) => ({
|
||||
type: ActionTypes.PROJECT_CREATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectCreate = (project, users, projectManagers, boards, boardMemberships) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProject = (id, data) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateProject.success = (project) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
updateProject.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectUpdate = (project) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectBackgroundImage = (id) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
updateProjectBackgroundImage.success = (project) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
updateProjectBackgroundImage.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProject = (id) => ({
|
||||
type: ActionTypes.PROJECT_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteProject.success = (project) => ({
|
||||
type: ActionTypes.PROJECT_DELETE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
deleteProject.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectDelete = (project) => ({
|
||||
type: ActionTypes.PROJECT_DELETE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const handleLocationChange = (
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
notifications,
|
||||
) => ({
|
||||
type: ActionTypes.LOCATION_CHANGE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
|
||||
handleLocationChange.fetchBoard = (id) => ({
|
||||
type: ActionTypes.LOCATION_CHANGE_HANDLE__BOARD_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const handleSocketDisconnect = () => ({
|
||||
type: ActionTypes.SOCKET_DISCONNECT_HANDLE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleSocketReconnect = (
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
) => ({
|
||||
type: ActionTypes.SOCKET_RECONNECT_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
|
||||
handleSocketReconnect.fetchCore = (currentUserId, currentBoardId) => ({
|
||||
type: ActionTypes.SOCKET_RECONNECT_HANDLE__CORE_FETCH,
|
||||
payload: {
|
||||
currentUserId,
|
||||
currentBoardId,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createTask = (task) => ({
|
||||
type: ActionTypes.TASK_CREATE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
createTask.success = (localId, task) => ({
|
||||
type: ActionTypes.TASK_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
createTask.failure = (localId, error) => ({
|
||||
type: ActionTypes.TASK_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskCreate = (task) => ({
|
||||
type: ActionTypes.TASK_CREATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTask = (id, data) => ({
|
||||
type: ActionTypes.TASK_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateTask.success = (task) => ({
|
||||
type: ActionTypes.TASK_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
updateTask.failure = (id, error) => ({
|
||||
type: ActionTypes.TASK_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskUpdate = (task) => ({
|
||||
type: ActionTypes.TASK_UPDATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTask = (id) => ({
|
||||
type: ActionTypes.TASK_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteTask.success = (task) => ({
|
||||
type: ActionTypes.TASK_DELETE__SUCCESS,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
deleteTask.failure = (id, error) => ({
|
||||
type: ActionTypes.TASK_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskDelete = (task) => ({
|
||||
type: ActionTypes.TASK_DELETE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,286 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createUser = (data) => ({
|
||||
type: ActionTypes.USER_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
createUser.success = (user) => ({
|
||||
type: ActionTypes.USER_CREATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
createUser.failure = (error) => ({
|
||||
type: ActionTypes.USER_CREATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserCreate = (user) => ({
|
||||
type: ActionTypes.USER_CREATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserCreateError = () => ({
|
||||
type: ActionTypes.USER_CREATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateUser = (id, data) => ({
|
||||
type: ActionTypes.USER_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUser.success = (user) => ({
|
||||
type: ActionTypes.USER_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUser.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserUpdate = (user, users, isCurrent) => ({
|
||||
type: ActionTypes.USER_UPDATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
users,
|
||||
isCurrent,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserEmail = (id, data) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserEmail.success = (user) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserEmail.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserEmailUpdateError = (id) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserPassword = (id, data) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserPassword.success = (user) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserPassword.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserPasswordUpdateError = (id) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserUsername = (id, data) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserUsername.success = (user) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserUsername.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserUsernameUpdateError = (id) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserAvatar = (id) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserAvatar.success = (user) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserAvatar.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUser = (id) => ({
|
||||
type: ActionTypes.USER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteUser.success = (user) => ({
|
||||
type: ActionTypes.USER_DELETE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
deleteUser.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserDelete = (user) => ({
|
||||
type: ActionTypes.USER_DELETE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToCard = (id, cardId, isCurrent) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
isCurrent,
|
||||
},
|
||||
});
|
||||
|
||||
addUserToCard.success = (cardMembership) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD__SUCCESS,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
addUserToCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserToCardAdd = (cardMembership) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromCard = (id, cardId) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
removeUserFromCard.success = (cardMembership) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE__SUCCESS,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
removeUserFromCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserFromCardRemove = (cardMembership) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.USER_TO_BOARD_FILTER_ADD,
|
||||
payload: {
|
||||
id,
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.USER_FROM_BOARD_FILTER_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import http from './http';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createAccessToken = (data) => http.post('/access-tokens', data);
|
||||
|
||||
export default {
|
||||
createAccessToken,
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Transformers */
|
||||
|
||||
export const transformAction = (action) => ({
|
||||
...action,
|
||||
createdAt: new Date(action.createdAt),
|
||||
});
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getActions = (cardId, data) =>
|
||||
socket.get(`/cards/${cardId}/actions`, data).then((body) => ({
|
||||
...body,
|
||||
items: body.items.map(transformAction),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleActionCreate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
});
|
||||
};
|
||||
|
||||
const makeHandleActionUpdate = makeHandleActionCreate;
|
||||
|
||||
const makeHandleActionDelete = makeHandleActionCreate;
|
||||
|
||||
export default {
|
||||
getActions,
|
||||
makeHandleActionCreate,
|
||||
makeHandleActionUpdate,
|
||||
makeHandleActionDelete,
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
import http from './http';
|
||||
import socket from './socket';
|
||||
|
||||
/* Transformers */
|
||||
|
||||
export const transformAttachment = (attachment) => ({
|
||||
...attachment,
|
||||
createdAt: new Date(attachment.createdAt),
|
||||
});
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createAttachment = (cardId, data, requestId) =>
|
||||
http.post(`/cards/${cardId}/attachments?requestId=${requestId}`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
}));
|
||||
|
||||
const updateAttachment = (id, data) =>
|
||||
socket.patch(`/attachments/${id}`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
}));
|
||||
|
||||
const deleteAttachment = (id) =>
|
||||
socket.delete(`/attachments/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleAttachmentCreate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
});
|
||||
};
|
||||
|
||||
const makeHandleAttachmentUpdate = makeHandleAttachmentCreate;
|
||||
|
||||
const makeHandleAttachmentDelete = makeHandleAttachmentCreate;
|
||||
|
||||
export default {
|
||||
createAttachment,
|
||||
updateAttachment,
|
||||
deleteAttachment,
|
||||
makeHandleAttachmentCreate,
|
||||
makeHandleAttachmentUpdate,
|
||||
makeHandleAttachmentDelete,
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createBoardMembership = (boardId, data) =>
|
||||
socket.post(`/boards/${boardId}/memberships`, data);
|
||||
|
||||
const deleteBoardMembership = (id) => socket.delete(`/board-memberships/${id}`);
|
||||
|
||||
export default {
|
||||
createBoardMembership,
|
||||
deleteBoardMembership,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
import socket from './socket';
|
||||
import { transformCard } from './cards';
|
||||
import { transformAttachment } from './attachments';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createBoard = (projectId, data) => socket.post(`/projects/${projectId}/boards`, data);
|
||||
|
||||
const getBoard = (id) =>
|
||||
socket.get(`/boards/${id}`).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
attachments: body.included.attachments.map(transformAttachment),
|
||||
},
|
||||
}));
|
||||
|
||||
const updateBoard = (id, data) => socket.patch(`/boards/${id}`, data);
|
||||
|
||||
const deleteBoard = (id) => socket.delete(`/boards/${id}`);
|
||||
|
||||
export default {
|
||||
createBoard,
|
||||
getBoard,
|
||||
updateBoard,
|
||||
deleteBoard,
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createCardLabel = (cardId, data) => socket.post(`/cards/${cardId}/labels`, data);
|
||||
|
||||
const deleteCardLabel = (cardId, labelId) => socket.delete(`/cards/${cardId}/labels/${labelId}`);
|
||||
|
||||
export default {
|
||||
createCardLabel,
|
||||
deleteCardLabel,
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createCardMembership = (cardId, data) => socket.post(`/cards/${cardId}/memberships`, data);
|
||||
|
||||
const deleteCardMembership = (cardId, userId) =>
|
||||
socket.delete(`/cards/${cardId}/memberships?userId=${userId}`);
|
||||
|
||||
export default {
|
||||
createCardMembership,
|
||||
deleteCardMembership,
|
||||
};
|
||||
@@ -0,0 +1,99 @@
|
||||
import socket from './socket';
|
||||
import { transformAttachment } from './attachments';
|
||||
|
||||
/* Transformers */
|
||||
|
||||
export const transformCard = (card) => ({
|
||||
...card,
|
||||
...(card.dueDate && {
|
||||
dueDate: new Date(card.dueDate),
|
||||
}),
|
||||
...(card.timer && {
|
||||
timer: {
|
||||
...card.timer,
|
||||
...(card.timer.startedAt && {
|
||||
startedAt: new Date(card.timer.startedAt),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
export const transformCardData = (data) => ({
|
||||
...data,
|
||||
...(data.dueDate && {
|
||||
dueDate: data.dueDate.toISOString(),
|
||||
}),
|
||||
...(data.timer && {
|
||||
timer: {
|
||||
...data.timer,
|
||||
...(data.timer.startedAt && {
|
||||
startedAt: data.timer.startedAt.toISOString(),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getCards = (boardId, data) =>
|
||||
socket.get(`/board/${boardId}/cards`, data).then((body) => ({
|
||||
...body,
|
||||
items: body.items.map(transformCard),
|
||||
included: {
|
||||
...body.included,
|
||||
attachments: body.included.attachments.map(transformAttachment),
|
||||
},
|
||||
}));
|
||||
|
||||
const createCard = (boardId, data) =>
|
||||
socket.post(`/boards/${boardId}/cards`, transformCardData(data)).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const getCard = (id) =>
|
||||
socket.get(`/cards/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const updateCard = (id, data) =>
|
||||
socket.patch(`/cards/${id}`, transformCardData(data)).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const deleteCard = (id) =>
|
||||
socket.delete(`/cards/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleCardCreate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
});
|
||||
};
|
||||
|
||||
const makeHandleCardUpdate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
});
|
||||
};
|
||||
|
||||
const makeHandleCardDelete = makeHandleCardUpdate;
|
||||
|
||||
export default {
|
||||
getCards,
|
||||
createCard,
|
||||
getCard,
|
||||
updateCard,
|
||||
deleteCard,
|
||||
makeHandleCardCreate,
|
||||
makeHandleCardUpdate,
|
||||
makeHandleCardDelete,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
import socket from './socket';
|
||||
import { transformAction } from './actions';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createCommentAction = (cardId, data) =>
|
||||
socket.post(`/cards/${cardId}/comment-actions`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const updateCommentAction = (id, data) =>
|
||||
socket.patch(`/comment-actions/${id}`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const deleteCommentAction = (id) =>
|
||||
socket.delete(`/comment-actions/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
export default {
|
||||
createCommentAction,
|
||||
updateCommentAction,
|
||||
deleteCommentAction,
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
import { fetch } from 'whatwg-fetch';
|
||||
|
||||
import Config from '../constants/Config';
|
||||
|
||||
const http = {};
|
||||
|
||||
// TODO: add all methods
|
||||
['POST'].forEach((method) => {
|
||||
http[method.toLowerCase()] = (url, data) => {
|
||||
const formData = Object.keys(data).reduce((result, key) => {
|
||||
result.append(key, data[key]);
|
||||
|
||||
return result;
|
||||
}, new FormData());
|
||||
|
||||
return fetch(`${Config.SERVER_BASE_URL}/api${url}`, {
|
||||
method,
|
||||
body: formData,
|
||||
...Config.FETCH_OPTIONS,
|
||||
})
|
||||
.then((response) =>
|
||||
response.json().then((body) => ({
|
||||
body,
|
||||
isError: response.status !== 200,
|
||||
})),
|
||||
)
|
||||
.then(({ body, isError }) => {
|
||||
if (isError) {
|
||||
throw body;
|
||||
}
|
||||
|
||||
return body;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
export default http;
|
||||
@@ -0,0 +1,39 @@
|
||||
import http from './http';
|
||||
import socket from './socket';
|
||||
import accessTokens from './access-tokens';
|
||||
import users from './users';
|
||||
import projects from './projects';
|
||||
import projectManagers from './project-managers';
|
||||
import boards from './boards';
|
||||
import boardMemberships from './board-memberships';
|
||||
import labels from './labels';
|
||||
import lists from './lists';
|
||||
import cards from './cards';
|
||||
import cardMemberships from './card-memberships';
|
||||
import cardLabels from './card-labels';
|
||||
import tasks from './tasks';
|
||||
import attachments from './attachments';
|
||||
import actions from './actions';
|
||||
import commentActions from './comment-actions';
|
||||
import notifications from './notifications';
|
||||
|
||||
export { http, socket };
|
||||
|
||||
export default {
|
||||
...accessTokens,
|
||||
...users,
|
||||
...projects,
|
||||
...projectManagers,
|
||||
...boards,
|
||||
...boardMemberships,
|
||||
...labels,
|
||||
...lists,
|
||||
...cards,
|
||||
...cardMemberships,
|
||||
...cardLabels,
|
||||
...tasks,
|
||||
...attachments,
|
||||
...actions,
|
||||
...commentActions,
|
||||
...notifications,
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createLabel = (boardId, data) => socket.post(`/boards/${boardId}/labels`, data);
|
||||
|
||||
const updateLabel = (id, data) => socket.patch(`/labels/${id}`, data);
|
||||
|
||||
const deleteLabel = (id) => socket.delete(`/labels/${id}`);
|
||||
|
||||
export default {
|
||||
createLabel,
|
||||
updateLabel,
|
||||
deleteLabel,
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createList = (boardId, data) => socket.post(`/boards/${boardId}/lists`, data);
|
||||
|
||||
const updateList = (id, data) => socket.patch(`/lists/${id}`, data);
|
||||
|
||||
const deleteList = (id) => socket.delete(`/lists/${id}`);
|
||||
|
||||
export default {
|
||||
createList,
|
||||
updateList,
|
||||
deleteList,
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
import socket from './socket';
|
||||
import { transformCard } from './cards';
|
||||
import { transformAction } from './actions';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getNotifications = () =>
|
||||
socket.get('/notifications').then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
actions: body.included.actions.map(transformAction),
|
||||
},
|
||||
}));
|
||||
|
||||
const getNotification = (id) =>
|
||||
socket.get(`/notifications/${id}`).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
actions: body.included.actions.map(transformAction),
|
||||
},
|
||||
}));
|
||||
|
||||
const updateNotifications = (ids, data) => socket.patch(`/notifications/${ids.join(',')}`, data);
|
||||
|
||||
export default {
|
||||
getNotifications,
|
||||
getNotification,
|
||||
updateNotifications,
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createProjectManager = (projectId, data) =>
|
||||
socket.post(`/projects/${projectId}/managers`, data);
|
||||
|
||||
const deleteProjectManager = (id) => socket.delete(`/project-managers/${id}`);
|
||||
|
||||
export default {
|
||||
createProjectManager,
|
||||
deleteProjectManager,
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import http from './http';
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getProjects = () => socket.get('/projects');
|
||||
|
||||
const createProject = (data) => socket.post('/projects', data);
|
||||
|
||||
const getProject = (id) => socket.get(`/projects/${id}`);
|
||||
|
||||
const updateProject = (id, data) => socket.patch(`/projects/${id}`, data);
|
||||
|
||||
const updateProjectBackgroundImage = (id, data) =>
|
||||
http.post(`/projects/${id}/background-image`, data);
|
||||
|
||||
const deleteProject = (id) => socket.delete(`/projects/${id}`);
|
||||
|
||||
export default {
|
||||
getProjects,
|
||||
createProject,
|
||||
getProject,
|
||||
updateProject,
|
||||
updateProjectBackgroundImage,
|
||||
deleteProject,
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
import socketIOClient from 'socket.io-client';
|
||||
import sailsIOClient from 'sails.io.js';
|
||||
|
||||
import Config from '../constants/Config';
|
||||
|
||||
const io = sailsIOClient(socketIOClient);
|
||||
|
||||
io.sails.url = Config.SERVER_BASE_URL;
|
||||
io.sails.autoConnect = false;
|
||||
io.sails.reconnection = true;
|
||||
io.sails.useCORSRouteToGetCookie = false;
|
||||
io.sails.environment = process.env.NODE_ENV;
|
||||
|
||||
const { socket } = io;
|
||||
|
||||
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
||||
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||
socket[method.toLowerCase()] = (url, data) =>
|
||||
new Promise((resolve, reject) => {
|
||||
socket.request(
|
||||
{
|
||||
method,
|
||||
data,
|
||||
url: `/api${url}`,
|
||||
},
|
||||
(_, { body, error }) => {
|
||||
if (error) {
|
||||
reject(body);
|
||||
} else {
|
||||
resolve(body);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
export default socket;
|
||||
@@ -0,0 +1,15 @@
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createTask = (cardId, data) => socket.post(`/cards/${cardId}/tasks`, data);
|
||||
|
||||
const updateTask = (id, data) => socket.patch(`/tasks/${id}`, data);
|
||||
|
||||
const deleteTask = (id) => socket.delete(`/tasks/${id}`);
|
||||
|
||||
export default {
|
||||
createTask,
|
||||
updateTask,
|
||||
deleteTask,
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
import http from './http';
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getUsers = () => socket.get('/users');
|
||||
|
||||
const createUser = (data) => socket.post('/users', data);
|
||||
|
||||
const getUser = (id) => socket.get(`/users/${id}`);
|
||||
|
||||
const getCurrentUser = () => socket.get('/users/me');
|
||||
|
||||
const updateUser = (id, data) => socket.patch(`/users/${id}`, data);
|
||||
|
||||
const updateUserEmail = (id, data) => socket.patch(`/users/${id}/email`, data);
|
||||
|
||||
const updateUserPassword = (id, data) => socket.patch(`/users/${id}/password`, data);
|
||||
|
||||
const updateUserUsername = (id, data) => socket.patch(`/users/${id}/username`, data);
|
||||
|
||||
const updateUserAvatar = (id, data) => http.post(`/users/${id}/avatar`, data);
|
||||
|
||||
const deleteUser = (id) => socket.delete(`/users/${id}`);
|
||||
|
||||
export default {
|
||||
getUsers,
|
||||
createUser,
|
||||
getUser,
|
||||
getCurrentUser,
|
||||
updateUser,
|
||||
updateUserEmail,
|
||||
updateUserPassword,
|
||||
updateUserUsername,
|
||||
updateUserAvatar,
|
||||
deleteUser,
|
||||
};
|
||||
|
Before Width: | Height: | Size: 559 KiB After Width: | Height: | Size: 559 KiB |
|
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
@@ -0,0 +1,38 @@
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { ProjectBackgroundTypes } from '../../constants/Enums';
|
||||
|
||||
import styles from './Background.module.scss';
|
||||
import globalStyles from '../../styles.module.scss';
|
||||
|
||||
function Background({ type, name, imageUrl }) {
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
styles.wrapper,
|
||||
type === ProjectBackgroundTypes.GRADIENT &&
|
||||
globalStyles[`background${upperFirst(camelCase(name))}`],
|
||||
)}
|
||||
style={{
|
||||
background: type === 'image' && `url("${imageUrl}") center / cover`,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Background.propTypes = {
|
||||
type: PropTypes.string.isRequired,
|
||||
name: PropTypes.string,
|
||||
imageUrl: PropTypes.string,
|
||||
};
|
||||
|
||||
Background.defaultProps = {
|
||||
name: undefined,
|
||||
imageUrl: undefined,
|
||||
};
|
||||
|
||||
export default Background;
|
||||
@@ -0,0 +1,8 @@
|
||||
:global(#app) {
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import Background from './Background';
|
||||
|
||||
export default Background;
|
||||
@@ -0,0 +1,78 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import Filters from './Filters';
|
||||
import Memberships from '../Memberships';
|
||||
|
||||
import styles from './BoardActions.module.scss';
|
||||
|
||||
const BoardActions = React.memo(
|
||||
({
|
||||
memberships,
|
||||
labels,
|
||||
filterUsers,
|
||||
filterLabels,
|
||||
allUsers,
|
||||
canEditMemberships,
|
||||
onMembershipCreate,
|
||||
onMembershipDelete,
|
||||
onUserToFilterAdd,
|
||||
onUserFromFilterRemove,
|
||||
onLabelToFilterAdd,
|
||||
onLabelFromFilterRemove,
|
||||
onLabelCreate,
|
||||
onLabelUpdate,
|
||||
onLabelDelete,
|
||||
}) => {
|
||||
return (
|
||||
<div className={styles.actions}>
|
||||
<div className={styles.action}>
|
||||
<Memberships
|
||||
items={memberships}
|
||||
allUsers={allUsers}
|
||||
canEdit={canEditMemberships}
|
||||
onCreate={onMembershipCreate}
|
||||
onDelete={onMembershipDelete}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<Filters
|
||||
users={filterUsers}
|
||||
labels={filterLabels}
|
||||
allBoardMemberships={memberships}
|
||||
allLabels={labels}
|
||||
onUserAdd={onUserToFilterAdd}
|
||||
onUserRemove={onUserFromFilterRemove}
|
||||
onLabelAdd={onLabelToFilterAdd}
|
||||
onLabelRemove={onLabelFromFilterRemove}
|
||||
onLabelCreate={onLabelCreate}
|
||||
onLabelUpdate={onLabelUpdate}
|
||||
onLabelDelete={onLabelDelete}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
BoardActions.propTypes = {
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
memberships: PropTypes.array.isRequired,
|
||||
labels: PropTypes.array.isRequired,
|
||||
filterUsers: PropTypes.array.isRequired,
|
||||
filterLabels: PropTypes.array.isRequired,
|
||||
allUsers: PropTypes.array.isRequired,
|
||||
/* eslint-enable react/forbid-prop-types */
|
||||
canEditMemberships: PropTypes.bool.isRequired,
|
||||
onMembershipCreate: PropTypes.func.isRequired,
|
||||
onMembershipDelete: PropTypes.func.isRequired,
|
||||
onUserToFilterAdd: PropTypes.func.isRequired,
|
||||
onUserFromFilterRemove: PropTypes.func.isRequired,
|
||||
onLabelToFilterAdd: PropTypes.func.isRequired,
|
||||
onLabelFromFilterRemove: PropTypes.func.isRequired,
|
||||
onLabelCreate: PropTypes.func.isRequired,
|
||||
onLabelUpdate: PropTypes.func.isRequired,
|
||||
onLabelDelete: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default BoardActions;
|
||||
@@ -0,0 +1,11 @@
|
||||
:global(#app) {
|
||||
.action {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
margin: 20px 20px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import User from '../User';
|
||||
import Label from '../Label';
|
||||
import BoardMembershipsPopup from '../BoardMembershipsPopup';
|
||||
import LabelsPopup from '../LabelsPopup';
|
||||
|
||||
import styles from './Filters.module.scss';
|
||||
|
||||
const Filters = React.memo(
|
||||
({
|
||||
users,
|
||||
labels,
|
||||
allBoardMemberships,
|
||||
allLabels,
|
||||
onUserAdd,
|
||||
onUserRemove,
|
||||
onLabelAdd,
|
||||
onLabelRemove,
|
||||
onLabelCreate,
|
||||
onLabelUpdate,
|
||||
onLabelDelete,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleRemoveUserClick = useCallback(
|
||||
(id) => {
|
||||
onUserRemove(id);
|
||||
},
|
||||
[onUserRemove],
|
||||
);
|
||||
|
||||
const handleRemoveLabelClick = useCallback(
|
||||
(id) => {
|
||||
onLabelRemove(id);
|
||||
},
|
||||
[onLabelRemove],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<span className={styles.filter}>
|
||||
<BoardMembershipsPopup
|
||||
items={allBoardMemberships}
|
||||
currentUserIds={users.map((user) => user.id)}
|
||||
title={t('common.filterByMembers', {
|
||||
context: 'title',
|
||||
})}
|
||||
onUserSelect={onUserAdd}
|
||||
onUserDeselect={onUserRemove}
|
||||
>
|
||||
<button type="button" className={styles.filterButton}>
|
||||
<span className={styles.filterTitle}>{`${t('common.members')}:`}</span>
|
||||
{users.length === 0 && <span className={styles.filterLabel}>{t('common.all')}</span>}
|
||||
</button>
|
||||
</BoardMembershipsPopup>
|
||||
{users.map((user) => (
|
||||
<span key={user.id} className={styles.filterItem}>
|
||||
<User
|
||||
name={user.name}
|
||||
avatarUrl={user.avatarUrl}
|
||||
size="tiny"
|
||||
onClick={() => handleRemoveUserClick(user.id)}
|
||||
/>
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
<span className={styles.filter}>
|
||||
<LabelsPopup
|
||||
items={allLabels}
|
||||
currentIds={labels.map((label) => label.id)}
|
||||
title={t('common.filterByLabels', {
|
||||
context: 'title',
|
||||
})}
|
||||
onSelect={onLabelAdd}
|
||||
onDeselect={onLabelRemove}
|
||||
onCreate={onLabelCreate}
|
||||
onUpdate={onLabelUpdate}
|
||||
onDelete={onLabelDelete}
|
||||
>
|
||||
<button type="button" className={styles.filterButton}>
|
||||
<span className={styles.filterTitle}>{`${t('common.labels')}:`}</span>
|
||||
{labels.length === 0 && <span className={styles.filterLabel}>{t('common.all')}</span>}
|
||||
</button>
|
||||
</LabelsPopup>
|
||||
{labels.map((label) => (
|
||||
<span key={label.id} className={styles.filterItem}>
|
||||
<Label
|
||||
name={label.name}
|
||||
color={label.color}
|
||||
size="small"
|
||||
onClick={() => handleRemoveLabelClick(label.id)}
|
||||
/>
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Filters.propTypes = {
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
users: PropTypes.array.isRequired,
|
||||
labels: PropTypes.array.isRequired,
|
||||
allBoardMemberships: PropTypes.array.isRequired,
|
||||
allLabels: PropTypes.array.isRequired,
|
||||
/* eslint-enable react/forbid-prop-types */
|
||||
onUserAdd: PropTypes.func.isRequired,
|
||||
onUserRemove: PropTypes.func.isRequired,
|
||||
onLabelAdd: PropTypes.func.isRequired,
|
||||
onLabelRemove: PropTypes.func.isRequired,
|
||||
onLabelCreate: PropTypes.func.isRequired,
|
||||
onLabelUpdate: PropTypes.func.isRequired,
|
||||
onLabelDelete: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default Filters;
|
||||
@@ -0,0 +1,46 @@
|
||||
:global(#app) {
|
||||
.filter {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.filterButton {
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
outline: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.filterItem {
|
||||
display: inline-block;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
margin-right: 4px;
|
||||
max-width: 190px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.filterLabel {
|
||||
background: rgba(0, 0, 0, 0.24);
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
padding: 2px 8px;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.32);
|
||||
}
|
||||
}
|
||||
|
||||
.filterTitle {
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
padding: 2px 12px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import BoardActions from './BoardActions';
|
||||
|
||||
export default BoardActions;
|
||||
@@ -0,0 +1,178 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
||||
import { closePopup } from '../../lib/popup';
|
||||
|
||||
import DroppableTypes from '../../constants/DroppableTypes';
|
||||
import ListContainer from '../../containers/ListContainer';
|
||||
import CardModalContainer from '../../containers/CardModalContainer';
|
||||
import ListAdd from './ListAdd';
|
||||
import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-icon.svg';
|
||||
|
||||
import styles from './BoardKanban.module.scss';
|
||||
|
||||
const parseDndId = (dndId) => dndId.split(':')[1];
|
||||
|
||||
const BoardKanban = React.memo(
|
||||
({ listIds, isCardModalOpened, canEdit, onListCreate, onListMove, onCardMove }) => {
|
||||
const [t] = useTranslation();
|
||||
const [isListAddOpened, setIsListAddOpened] = useState(false);
|
||||
|
||||
const wrapper = useRef(null);
|
||||
const prevPosition = useRef(null);
|
||||
|
||||
const handleAddListClick = useCallback(() => {
|
||||
setIsListAddOpened(true);
|
||||
}, []);
|
||||
|
||||
const handleAddListClose = useCallback(() => {
|
||||
setIsListAddOpened(false);
|
||||
}, []);
|
||||
|
||||
const handleDragStart = useCallback(() => {
|
||||
closePopup();
|
||||
}, []);
|
||||
|
||||
const handleDragEnd = useCallback(
|
||||
({ draggableId, type, source, destination }) => {
|
||||
if (
|
||||
!destination ||
|
||||
(source.droppableId === destination.droppableId && source.index === destination.index)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = parseDndId(draggableId);
|
||||
|
||||
switch (type) {
|
||||
case DroppableTypes.LIST:
|
||||
onListMove(id, destination.index);
|
||||
|
||||
break;
|
||||
case DroppableTypes.CARD:
|
||||
onCardMove(id, parseDndId(destination.droppableId), destination.index);
|
||||
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
[onListMove, onCardMove],
|
||||
);
|
||||
|
||||
const handleMouseDown = useCallback(
|
||||
(event) => {
|
||||
if (event.target !== wrapper.current && !event.target.dataset.dragScroller) {
|
||||
return;
|
||||
}
|
||||
|
||||
prevPosition.current = event.clientX;
|
||||
},
|
||||
[wrapper],
|
||||
);
|
||||
|
||||
const handleWindowMouseMove = useCallback(
|
||||
(event) => {
|
||||
if (!prevPosition.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
window.scrollBy({
|
||||
left: prevPosition.current - event.clientX,
|
||||
});
|
||||
|
||||
prevPosition.current = event.clientX;
|
||||
},
|
||||
[prevPosition],
|
||||
);
|
||||
|
||||
const handleWindowMouseUp = useCallback(() => {
|
||||
prevPosition.current = null;
|
||||
}, [prevPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflowX = 'auto';
|
||||
|
||||
return () => {
|
||||
document.body.style.overflowX = null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (isListAddOpened) {
|
||||
window.scroll(document.body.scrollWidth, 0);
|
||||
}
|
||||
}, [listIds, isListAddOpened]);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('mouseup', handleWindowMouseUp);
|
||||
window.addEventListener('mousemove', handleWindowMouseMove);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('mouseup', handleWindowMouseUp);
|
||||
window.removeEventListener('mousemove', handleWindowMouseMove);
|
||||
};
|
||||
}, [handleWindowMouseUp, handleWindowMouseMove]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
|
||||
<div ref={wrapper} className={styles.wrapper} onMouseDown={handleMouseDown}>
|
||||
<div>
|
||||
<DragDropContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
|
||||
<Droppable droppableId="board" type={DroppableTypes.LIST} direction="horizontal">
|
||||
{({ innerRef, droppableProps, placeholder }) => (
|
||||
<div
|
||||
{...droppableProps} // eslint-disable-line react/jsx-props-no-spreading
|
||||
data-drag-scroller
|
||||
ref={innerRef}
|
||||
className={styles.lists}
|
||||
>
|
||||
{listIds.map((listId, index) => (
|
||||
<ListContainer key={listId} id={listId} index={index} />
|
||||
))}
|
||||
{placeholder}
|
||||
{canEdit && (
|
||||
<div data-drag-scroller className={styles.list}>
|
||||
{isListAddOpened ? (
|
||||
<ListAdd onCreate={onListCreate} onClose={handleAddListClose} />
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
className={styles.addListButton}
|
||||
onClick={handleAddListClick}
|
||||
>
|
||||
<PlusMathIcon className={styles.addListButtonIcon} />
|
||||
<span className={styles.addListButtonText}>
|
||||
{listIds.length > 0
|
||||
? t('action.addAnotherList')
|
||||
: t('action.addList')}
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Droppable>
|
||||
</DragDropContext>
|
||||
</div>
|
||||
</div>
|
||||
{isCardModalOpened && <CardModalContainer />}
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
BoardKanban.propTypes = {
|
||||
listIds: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
isCardModalOpened: PropTypes.bool.isRequired,
|
||||
canEdit: PropTypes.bool.isRequired,
|
||||
onListCreate: PropTypes.func.isRequired,
|
||||
onListMove: PropTypes.func.isRequired,
|
||||
onCardMove: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default BoardKanban;
|
||||
@@ -0,0 +1,64 @@
|
||||
:global(#app) {
|
||||
.addListButton {
|
||||
background: rgba(0, 0, 0, 0.24);
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
color: rgba(255, 255, 255, 0.72);
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
fill: rgba(255, 255, 255, 0.72);
|
||||
font-weight: normal;
|
||||
height: 42px;
|
||||
padding: 11px;
|
||||
text-align: left;
|
||||
transition: background 85ms ease-in, opacity 40ms ease-in,
|
||||
border-color 85ms ease-in;
|
||||
width: 100%;
|
||||
|
||||
&:active {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.32);
|
||||
}
|
||||
}
|
||||
|
||||
.addListButtonIcon {
|
||||
height: 20px;
|
||||
padding: 0.64px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.addListButtonText {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-right: 20px;
|
||||
width: 272px;
|
||||
}
|
||||
|
||||
.lists {
|
||||
display: inline-flex;
|
||||
height: 100%;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.panel {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.panelItem {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
margin: 0 20px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import React, { useCallback, useEffect, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Input } from 'semantic-ui-react';
|
||||
import { useDidUpdate, useToggle } from '../../lib/hooks';
|
||||
|
||||
import { useClosableForm, useForm } from '../../hooks';
|
||||
|
||||
import styles from './ListAdd.module.scss';
|
||||
|
||||
const DEFAULT_DATA = {
|
||||
name: '',
|
||||
};
|
||||
|
||||
const ListAdd = React.memo(({ onCreate, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||
const [selectNameFieldState, selectNameField] = useToggle();
|
||||
|
||||
const nameField = useRef(null);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
if (event.key === 'Escape') {
|
||||
onClose();
|
||||
}
|
||||
},
|
||||
[onClose],
|
||||
);
|
||||
|
||||
const [handleFieldBlur, handleControlMouseOver, handleControlMouseOut] = useClosableForm(onClose);
|
||||
|
||||
const handleSubmit = useCallback(() => {
|
||||
const cleanData = {
|
||||
...data,
|
||||
name: data.name.trim(),
|
||||
};
|
||||
|
||||
if (!cleanData.name) {
|
||||
nameField.current.select();
|
||||
return;
|
||||
}
|
||||
|
||||
onCreate(cleanData);
|
||||
|
||||
setData(DEFAULT_DATA);
|
||||
selectNameField();
|
||||
}, [onCreate, data, setData, selectNameField]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.select();
|
||||
}, []);
|
||||
|
||||
useDidUpdate(() => {
|
||||
nameField.current.select();
|
||||
}, [selectNameFieldState]);
|
||||
|
||||
return (
|
||||
<Form className={styles.wrapper} onSubmit={handleSubmit}>
|
||||
<Input
|
||||
ref={nameField}
|
||||
name="name"
|
||||
value={data.name}
|
||||
placeholder={t('common.enterListTitle')}
|
||||
className={styles.field}
|
||||
onKeyDown={handleFieldKeyDown}
|
||||
onChange={handleFieldChange}
|
||||
onBlur={handleFieldBlur}
|
||||
/>
|
||||
<div className={styles.controls}>
|
||||
{/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */}
|
||||
<Button
|
||||
positive
|
||||
content={t('action.addList')}
|
||||
className={styles.submitButton}
|
||||
onMouseOver={handleControlMouseOver}
|
||||
onMouseOut={handleControlMouseOut}
|
||||
/>
|
||||
</div>
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
|
||||
ListAdd.propTypes = {
|
||||
onCreate: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default ListAdd;
|
||||
@@ -0,0 +1,33 @@
|
||||
:global(#app) {
|
||||
.controls {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.field {
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 0 #ccc;
|
||||
color: #333;
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
|
||||
&:focus {
|
||||
border-color: #298fca;
|
||||
box-shadow: 0 0 2px #298fca;
|
||||
}
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
min-height: 30px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
background: #e2e4e6;
|
||||
border-radius: 3px;
|
||||
padding: 4px;
|
||||
transition: opacity 40ms ease-in;
|
||||
width: 272px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import BoardKanban from './BoardKanban';
|
||||
|
||||
export default BoardKanban;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { withPopup } from '../lib/popup';
|
||||
|
||||
import BoardMembershipsStep from './BoardMembershipsStep';
|
||||
|
||||
export default withPopup(BoardMembershipsStep);
|
||||
@@ -0,0 +1,67 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Menu } from 'semantic-ui-react';
|
||||
import { Popup } from '../../lib/custom-ui';
|
||||
|
||||
import Item from './Item';
|
||||
|
||||
import styles from './BoardMembershipsStep.module.scss';
|
||||
|
||||
const BoardMembershipsStep = React.memo(
|
||||
({ items, currentUserIds, title, onUserSelect, onUserDeselect, onBack }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUserSelect = useCallback(
|
||||
(id) => {
|
||||
onUserSelect(id);
|
||||
},
|
||||
[onUserSelect],
|
||||
);
|
||||
|
||||
const handleUserDeselect = useCallback(
|
||||
(id) => {
|
||||
onUserDeselect(id);
|
||||
},
|
||||
[onUserDeselect],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>{t(title)}</Popup.Header>
|
||||
<Popup.Content>
|
||||
<Menu secondary vertical className={styles.menu}>
|
||||
{items.map((item) => (
|
||||
<Item
|
||||
key={item.id}
|
||||
isPersisted={item.isPersisted}
|
||||
isActive={currentUserIds.includes(item.user.id)}
|
||||
user={item.user}
|
||||
onUserSelect={() => handleUserSelect(item.user.id)}
|
||||
onUserDeselect={() => handleUserDeselect(item.user.id)}
|
||||
/>
|
||||
))}
|
||||
</Menu>
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
BoardMembershipsStep.propTypes = {
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
items: PropTypes.array.isRequired,
|
||||
currentUserIds: PropTypes.array.isRequired,
|
||||
/* eslint-enable react/forbid-prop-types */
|
||||
title: PropTypes.string,
|
||||
onUserSelect: PropTypes.func.isRequired,
|
||||
onUserDeselect: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
};
|
||||
|
||||
BoardMembershipsStep.defaultProps = {
|
||||
title: 'common.members',
|
||||
onBack: undefined,
|
||||
};
|
||||
|
||||
export default BoardMembershipsStep;
|
||||
@@ -0,0 +1,6 @@
|
||||
:global(#app) {
|
||||
.menu {
|
||||
margin: -7px auto -5px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { Menu } from 'semantic-ui-react';
|
||||
|
||||
import User from '../User';
|
||||
|
||||
import styles from './Item.module.scss';
|
||||
|
||||
const Item = React.memo(({ isPersisted, isActive, user, onUserSelect, onUserDeselect }) => {
|
||||
const handleToggleClick = useCallback(() => {
|
||||
if (isActive) {
|
||||
onUserDeselect();
|
||||
} else {
|
||||
onUserSelect();
|
||||
}
|
||||
}, [isActive, onUserSelect, onUserDeselect]);
|
||||
|
||||
return (
|
||||
<Menu.Item
|
||||
active={isActive}
|
||||
disabled={!isPersisted}
|
||||
className={classNames(styles.menuItem, isActive && styles.menuItemActive)}
|
||||
onClick={handleToggleClick}
|
||||
>
|
||||
<span className={styles.user}>
|
||||
<User name={user.name} avatarUrl={user.avatarUrl} />
|
||||
</span>
|
||||
<div className={classNames(styles.menuItemText, isActive && styles.menuItemTextActive)}>
|
||||
{user.name}
|
||||
</div>
|
||||
</Menu.Item>
|
||||
);
|
||||
});
|
||||
|
||||
Item.propTypes = {
|
||||
isPersisted: PropTypes.bool.isRequired,
|
||||
isActive: PropTypes.bool.isRequired,
|
||||
user: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
onUserSelect: PropTypes.func.isRequired,
|
||||
onUserDeselect: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default Item;
|
||||
@@ -0,0 +1,42 @@
|
||||
:global(#app) {
|
||||
.menuItem {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.menuItemActive {
|
||||
background: transparent;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
.menuItemText {
|
||||
display: inline-block;
|
||||
line-height: 32px;
|
||||
width: calc(100% - 40px);
|
||||
}
|
||||
|
||||
.menuItemTextActive:before {
|
||||
bottom: 2px;
|
||||
color: #798d99;
|
||||
content: "Г";
|
||||
font-size: 18px;
|
||||
font-weight: normal;
|
||||
line-height: 36px;
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
text-align: center;
|
||||
transform: rotate(-135deg);
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
.user {
|
||||
display: inline-block;
|
||||
line-height: 32px;
|
||||
padding-right: 8px;
|
||||
width: 40px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import BoardMembershipsStep from './BoardMembershipsStep';
|
||||
|
||||
export default BoardMembershipsStep;
|
||||