Compare commits
74
Commits
v1.0.0-beta.0
...
v1.5.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9111bf7ba | ||
|
|
2d50211892 | ||
|
|
139971eca9 | ||
|
|
34db8947b6 | ||
|
|
82e4f73c1f | ||
|
|
560bddbe18 | ||
|
|
9c192f4b5c | ||
|
|
a148a3aae5 | ||
|
|
7c1b885d2a | ||
|
|
a3f33d0361 | ||
|
|
fe62180cda | ||
|
|
58abd0691f | ||
|
|
ad67b9ba24 | ||
|
|
ddf9a32ea9 | ||
|
|
e01a2eafba | ||
|
|
3b3bff1b6b | ||
|
|
ecc45c7a9e | ||
|
|
3497e09703 | ||
|
|
dfc52191fc | ||
|
|
6268ced4cb | ||
|
|
e7495e0067 | ||
|
|
b8c065e0c8 | ||
|
|
86e4864d1b | ||
|
|
0be598ca9e | ||
|
|
ba850801c5 | ||
|
|
c9b23652d1 | ||
|
|
8490629e4c | ||
|
|
76fcd79203 | ||
|
|
3ce1bc0419 | ||
|
|
540fbfceb5 | ||
|
|
48a56648e2 | ||
|
|
6d002c311c | ||
|
|
ede707ed24 | ||
|
|
81052e1ce6 | ||
|
|
315a9a4c3d | ||
|
|
8112bcbb84 | ||
|
|
fc69b7d6f4 | ||
|
|
027e911907 | ||
|
|
afc2a4628d | ||
|
|
b0b6587eee | ||
|
|
e29c9e6dda | ||
|
|
caf9602557 | ||
|
|
445b0fc682 | ||
|
|
2e045217ec | ||
|
|
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 |
@@ -1,12 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: # Replace with a single Open Collective username
|
|
||||||
ko_fi: meltyshev
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
||||||
liberapay: # Replace with a single Liberapay username
|
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
|
||||||
otechie: # Replace with a single Otechie username
|
|
||||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
name: Build and push Docker base image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- ./Dockerfile.base
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
ALPINE_VERSION: 3.15
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-docker-base-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
file: Dockerfile.base
|
||||||
|
build-args: ALPINE_VERSION=${{ env.ALPINE_VERSION }}
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/plankanban/planka:base-latest
|
||||||
|
ghcr.io/plankanban/planka:base-${{ env.ALPINE_VERSION }}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: Build and push Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-docker-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set version
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
id: set-version
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: return context.payload.release.tag_name.replace('v', '')
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/plankanban/planka:latest
|
||||||
|
ghcr.io/plankanban/planka:${{ steps.set-version.outputs.result }}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
node_modules
|
node_modules
|
||||||
docker-compose.override.yml
|
docker-compose.override.yml
|
||||||
|
|
||||||
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx lint-staged
|
||||||
@@ -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.
|
||||||
+16
-37
@@ -1,57 +1,36 @@
|
|||||||
FROM node AS client-builder
|
FROM node:lts AS client-builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY client .
|
COPY client/package.json client/package-lock.json ./
|
||||||
|
|
||||||
RUN npm install npm@latest --global \
|
RUN npm install npm@latest --global \
|
||||||
&& npm install \
|
&& npm install
|
||||||
&& npm run build
|
|
||||||
|
|
||||||
FROM node:alpine
|
COPY client .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM ghcr.io/plankanban/planka:base-latest
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY server .
|
COPY server/.npmrc server/package.json server/package-lock.json ./
|
||||||
COPY docker-start.sh start.sh
|
|
||||||
|
|
||||||
ARG ALPINE_VERSION=3.12
|
RUN npm install npm@latest --global \
|
||||||
ARG VIPS_VERSION=8.10.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 \
|
&& npm install --production \
|
||||||
&& apk del vips-dependencies --purge \
|
&& apk del vips-dependencies --purge
|
||||||
&& chmod +x start.sh
|
|
||||||
|
COPY docker-start.sh start.sh
|
||||||
|
COPY server .
|
||||||
|
|
||||||
|
RUN cp .env.sample .env
|
||||||
|
|
||||||
COPY --from=client-builder /app/build public
|
COPY --from=client-builder /app/build public
|
||||||
COPY --from=client-builder /app/build/index.html views
|
COPY --from=client-builder /app/build/index.html views
|
||||||
|
|
||||||
VOLUME /app/public/user-avatars
|
VOLUME /app/public/user-avatars
|
||||||
VOLUME /app/public/project-background-images
|
VOLUME /app/public/project-background-images
|
||||||
VOLUME /app/public/attachments
|
VOLUME /app/private/attachments
|
||||||
|
|
||||||
EXPOSE 1337
|
EXPOSE 1337
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
FROM node:lts-alpine
|
||||||
|
|
||||||
|
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 \
|
||||||
|
&& rm -rf /tmp/vips-${VIPS_VERSION}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Planka
|
# Planka
|
||||||
|
|
||||||
  
|
  
|
||||||
|
|
||||||
A Trello-like kanban board built with React and Redux.
|
A Trello-like kanban board built with React and Redux.
|
||||||
|
|
||||||
@@ -8,8 +8,6 @@ A Trello-like kanban board built with React and Redux.
|
|||||||
|
|
||||||
[**Client demo**](https://plankanban.github.io/planka) (without server features).
|
[**Client demo**](https://plankanban.github.io/planka) (without server features).
|
||||||
|
|
||||||
<a href="https://ko-fi.com/meltyshev" target="_blank"><img src="https://cdn.ko-fi.com/cdn/kofi4.png?v=2" alt="Buy Me a Coffee at ko-fi.com" border="0" height="36" style="border:0px;height:36px;" /></a>
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Create projects, boards, lists, cards, labels and tasks
|
- Create projects, boards, lists, cards, labels and tasks
|
||||||
@@ -21,23 +19,8 @@ A Trello-like kanban board built with React and Redux.
|
|||||||
- User notifications
|
- User notifications
|
||||||
- Internationalization
|
- Internationalization
|
||||||
|
|
||||||
## Roadmap
|
|
||||||
|
|
||||||
### Current task
|
|
||||||
|
|
||||||
Projects should have Managers who have the ability to create/edit/delete boards. Boards should have their own Members, so members won't see all boards, just those they belong to. Planka will be released after this breaking change.
|
|
||||||
|
|
||||||
### Future tasks
|
|
||||||
|
|
||||||
- Fetch last data after reconnection
|
|
||||||
- Custom fields
|
|
||||||
- Public boards
|
|
||||||
- Automatic actions
|
|
||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|
||||||
**Please note that Planka is NOT released yet, API and database structure may be changed!**
|
|
||||||
|
|
||||||
### Docker Compose
|
### Docker Compose
|
||||||
|
|
||||||
[](https://hub.docker.com/r/meltyshev/planka)
|
[](https://hub.docker.com/r/meltyshev/planka)
|
||||||
@@ -78,7 +61,7 @@ Either use a local database or start the provided development database:
|
|||||||
docker-compose -f docker-compose-dev.yml up
|
docker-compose -f docker-compose-dev.yml up
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit `DATABASE_URL` in `.env` file if needed, then initialize the database:
|
Create `server/.env` based on `server/.env.sample` and edit `DATABASE_URL` if needed, then initialize the database:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run server:db:init
|
npm run server:db:init
|
||||||
|
|||||||
Generated
+23146
-26701
File diff suppressed because it is too large
Load Diff
+53
-40
@@ -25,7 +25,15 @@
|
|||||||
"browser": true,
|
"browser": true,
|
||||||
"jest": true
|
"jest": true
|
||||||
},
|
},
|
||||||
"parser": "babel-eslint",
|
"parser": "@babel/eslint-parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"babelOptions": {
|
||||||
|
"presets": [
|
||||||
|
"airbnb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"requireConfigFile": false
|
||||||
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
@@ -55,55 +63,60 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.3.1",
|
||||||
"connected-react-router": "^6.8.0",
|
"connected-react-router": "^6.9.3",
|
||||||
"date-fns": "^2.22.1",
|
"date-fns": "^2.29.1",
|
||||||
"dequal": "^2.0.2",
|
"dequal": "^2.0.3",
|
||||||
"history": "^4.10.1",
|
"history": "^4.10.1",
|
||||||
"i18next": "^20.3.2",
|
"i18next": "^21.8.14",
|
||||||
"i18next-browser-languagedetector": "^6.1.2",
|
"i18next-browser-languagedetector": "^6.1.4",
|
||||||
"initials": "^3.1.1",
|
"initials": "^3.1.2",
|
||||||
"lodash": "^4.17.20",
|
"js-cookie": "^3.0.1",
|
||||||
"node-sass": "^6.0.0",
|
"lodash": "^4.17.21",
|
||||||
"prop-types": "^15.7.2",
|
"node-sass": "^7.0.1",
|
||||||
"react": "^17.0.1",
|
"photoswipe": "^5.3.0",
|
||||||
"react-beautiful-dnd": "^13.0.0",
|
"prop-types": "^15.8.1",
|
||||||
"react-datepicker": "^4.1.1",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.1",
|
"react-beautiful-dnd": "^13.1.0",
|
||||||
"react-dropzone": "^11.3.1",
|
"react-datepicker": "^4.8.0",
|
||||||
"react-i18next": "^11.11.0",
|
"react-dom": "^17.0.2",
|
||||||
|
"react-dropzone": "^14.2.2",
|
||||||
|
"react-i18next": "^11.18.1",
|
||||||
"react-input-mask": "^2.0.4",
|
"react-input-mask": "^2.0.4",
|
||||||
"react-markdown": "^6.0.2",
|
"react-markdown": "^8.0.3",
|
||||||
"react-redux": "^7.2.4",
|
"react-photoswipe-gallery": "^2.2.1",
|
||||||
"react-router-dom": "^5.2.0",
|
"react-redux": "^7.2.8",
|
||||||
"react-scripts": "4.0.3",
|
"react-router-dom": "^5.3.1",
|
||||||
"react-textarea-autosize": "^8.3.3",
|
"react-scripts": "5.0.1",
|
||||||
"redux": "^4.1.0",
|
"react-textarea-autosize": "^8.3.4",
|
||||||
|
"redux": "^4.2.0",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-orm": "^0.16.2",
|
"redux-orm": "^0.16.2",
|
||||||
"redux-saga": "^1.1.3",
|
"redux-saga": "^1.1.3",
|
||||||
"remark-gfm": "^1.0.0",
|
"remark-breaks": "^3.0.2",
|
||||||
"reselect": "^4.0.0",
|
"remark-gfm": "^3.0.1",
|
||||||
|
"reselect": "^4.1.6",
|
||||||
"sails.io.js": "^1.2.1",
|
"sails.io.js": "^1.2.1",
|
||||||
"semantic-ui-react": "^2.0.3",
|
"semantic-ui-react": "^2.1.3",
|
||||||
"socket.io-client": "^2.3.1",
|
"socket.io-client": "^2.3.1",
|
||||||
"validator": "^13.6.0",
|
"validator": "^13.7.0",
|
||||||
"whatwg-fetch": "^3.5.0"
|
"whatwg-fetch": "^3.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
|
||||||
"chai": "^4.3.0",
|
"babel-preset-airbnb": "^5.0.0",
|
||||||
|
"chai": "^4.3.6",
|
||||||
"enzyme": "^3.11.0",
|
"enzyme": "^3.11.0",
|
||||||
"eslint": "^7.29.0",
|
"eslint": "^8.20.0",
|
||||||
"eslint-config-airbnb": "^18.2.1",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-import": "^2.23.4",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"eslint-plugin-react": "^7.24.0",
|
"eslint-plugin-react": "^7.30.1",
|
||||||
"eslint-plugin-react-hooks": "^4.2.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest-enzyme": "^7.1.2",
|
"jest-enzyme": "^7.1.2",
|
||||||
"prettier": "2.3.1",
|
"prettier": "2.7.1",
|
||||||
"react-test-renderer": "^17.0.1"
|
"react-test-renderer": "^17.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
// eslint-disable-next-line import/prefer-default-export
|
|
||||||
export const fetchActions = (cardId) => ({
|
export const fetchActions = (cardId) => ({
|
||||||
type: ActionTypes.ACTIONS_FETCH,
|
type: ActionTypes.ACTIONS_FETCH,
|
||||||
payload: {
|
payload: {
|
||||||
@@ -24,3 +23,28 @@ fetchActions.failure = (cardId, error) => ({
|
|||||||
error,
|
error,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const toggleActionsDetails = (cardId, isVisible) => ({
|
||||||
|
type: ActionTypes.ACTIONS_DETAILS_TOGGLE,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
isVisible,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
toggleActionsDetails.success = (cardId, actions, users) => ({
|
||||||
|
type: ActionTypes.ACTIONS_DETAILS_TOGGLE__SUCCESS,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
actions,
|
||||||
|
users,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
toggleActionsDetails.failure = (cardId, error) => ({
|
||||||
|
type: ActionTypes.ACTIONS_DETAILS_TOGGLE__FAILURE,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||||
|
|
||||||
// eslint-disable-next-line import/prefer-default-export
|
|
||||||
export const fetchActionsInCurrentCard = () => ({
|
export const fetchActionsInCurrentCard = () => ({
|
||||||
type: EntryActionTypes.ACTIONS_IN_CURRENT_CARD_FETCH,
|
type: EntryActionTypes.ACTIONS_IN_CURRENT_CARD_FETCH,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const toggleActionsDetailsInCurrentCard = (isVisible) => ({
|
||||||
|
type: EntryActionTypes.ACTIONS_DETAILS_IN_CURRENT_CARD_TOGGLE,
|
||||||
|
payload: {
|
||||||
|
isVisible,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -29,6 +29,14 @@ export const handleTaskUpdate = (task) => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const moveTask = (id, index) => ({
|
||||||
|
type: EntryActionTypes.TASK_MOVE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
index,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const deleteTask = (id) => ({
|
export const deleteTask = (id) => ({
|
||||||
type: EntryActionTypes.TASK_DELETE,
|
type: EntryActionTypes.TASK_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
|
|||||||
@@ -41,6 +41,21 @@ export const handleUserUpdate = (user) => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const updateCurrentUserLanguage = (language) => ({
|
||||||
|
type: EntryActionTypes.CURRENT_USER_LANGUAGE_UPDATE,
|
||||||
|
payload: {
|
||||||
|
language,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const updateUserEmail = (id, data) => ({
|
||||||
|
type: EntryActionTypes.USER_EMAIL_UPDATE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const updateCurrentUserEmail = (data) => ({
|
export const updateCurrentUserEmail = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
@@ -48,11 +63,26 @@ export const updateCurrentUserEmail = (data) => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const clearUserEmailUpdateError = (id) => ({
|
||||||
|
type: EntryActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const clearCurrentUserEmailUpdateError = () => ({
|
export const clearCurrentUserEmailUpdateError = () => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const updateUserPassword = (id, data) => ({
|
||||||
|
type: EntryActionTypes.USER_PASSWORD_UPDATE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const updateCurrentUserPassword = (data) => ({
|
export const updateCurrentUserPassword = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
@@ -60,11 +90,26 @@ export const updateCurrentUserPassword = (data) => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const clearUserPasswordUpdateError = (id) => ({
|
||||||
|
type: EntryActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const clearCurrentUserPasswordUpdateError = () => ({
|
export const clearCurrentUserPasswordUpdateError = () => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const updateUserUsername = (id, data) => ({
|
||||||
|
type: EntryActionTypes.USER_USERNAME_UPDATE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const updateCurrentUserUsername = (data) => ({
|
export const updateCurrentUserUsername = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
@@ -72,6 +117,13 @@ export const updateCurrentUserUsername = (data) => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const clearUserUsernameUpdateError = (id) => ({
|
||||||
|
type: EntryActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const clearCurrentUserUsernameUpdateError = () => ({
|
export const clearCurrentUserUsernameUpdateError = () => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import http from './http';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createAccessToken = (data, headers) => http.post('/access-tokens', data, headers);
|
const createAccessToken = (data) => http.post('/access-tokens', data);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createAccessToken,
|
createAccessToken,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ export const transformAction = (action) => ({
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const getActions = (cardId, data, headers) =>
|
const getActions = (cardId, data) =>
|
||||||
socket.get(`/cards/${cardId}/actions`, data, headers).then((body) => ({
|
socket.get(`/cards/${cardId}/actions`, data).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
items: body.items.map(transformAction),
|
items: body.items.map(transformAction),
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -10,20 +10,20 @@ export const transformAttachment = (attachment) => ({
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createAttachment = (cardId, data, requestId, headers) =>
|
const createAttachment = (cardId, data, requestId) =>
|
||||||
http.post(`/cards/${cardId}/attachments?requestId=${requestId}`, data, headers).then((body) => ({
|
http.post(`/cards/${cardId}/attachments?requestId=${requestId}`, data).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformAttachment(body.item),
|
item: transformAttachment(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const updateAttachment = (id, data, headers) =>
|
const updateAttachment = (id, data) =>
|
||||||
socket.patch(`/attachments/${id}`, data, headers).then((body) => ({
|
socket.patch(`/attachments/${id}`, data).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformAttachment(body.item),
|
item: transformAttachment(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const deleteAttachment = (id, headers) =>
|
const deleteAttachment = (id) =>
|
||||||
socket.delete(`/attachments/${id}`, undefined, headers).then((body) => ({
|
socket.delete(`/attachments/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformAttachment(body.item),
|
item: transformAttachment(body.item),
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createBoardMembership = (boardId, data, headers) =>
|
const createBoardMembership = (boardId, data) =>
|
||||||
socket.post(`/boards/${boardId}/memberships`, data, headers);
|
socket.post(`/boards/${boardId}/memberships`, data);
|
||||||
|
|
||||||
const deleteBoardMembership = (id, headers) =>
|
const deleteBoardMembership = (id) => socket.delete(`/board-memberships/${id}`);
|
||||||
socket.delete(`/board-memberships/${id}`, undefined, headers);
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createBoardMembership,
|
createBoardMembership,
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import { transformAttachment } from './attachments';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createBoard = (projectId, data, headers) =>
|
const createBoard = (projectId, data) => socket.post(`/projects/${projectId}/boards`, data);
|
||||||
socket.post(`/projects/${projectId}/boards`, data, headers);
|
|
||||||
|
|
||||||
const getBoard = (id, headers) =>
|
const getBoard = (id) =>
|
||||||
socket.get(`/boards/${id}`, undefined, headers).then((body) => ({
|
socket.get(`/boards/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
included: {
|
included: {
|
||||||
...body.included,
|
...body.included,
|
||||||
@@ -17,9 +16,9 @@ const getBoard = (id, headers) =>
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const updateBoard = (id, data, headers) => socket.patch(`/boards/${id}`, data, headers);
|
const updateBoard = (id, data) => socket.patch(`/boards/${id}`, data);
|
||||||
|
|
||||||
const deleteBoard = (id, headers) => socket.delete(`/boards/${id}`, undefined, headers);
|
const deleteBoard = (id) => socket.delete(`/boards/${id}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createBoard,
|
createBoard,
|
||||||
|
|||||||
@@ -2,11 +2,9 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createCardLabel = (cardId, data, headers) =>
|
const createCardLabel = (cardId, data) => socket.post(`/cards/${cardId}/labels`, data);
|
||||||
socket.post(`/cards/${cardId}/labels`, data, headers);
|
|
||||||
|
|
||||||
const deleteCardLabel = (cardId, labelId, headers) =>
|
const deleteCardLabel = (cardId, labelId) => socket.delete(`/cards/${cardId}/labels/${labelId}`);
|
||||||
socket.delete(`/cards/${cardId}/labels/${labelId}`, undefined, headers);
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createCardLabel,
|
createCardLabel,
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createCardMembership = (cardId, data, headers) =>
|
const createCardMembership = (cardId, data) => socket.post(`/cards/${cardId}/memberships`, data);
|
||||||
socket.post(`/cards/${cardId}/memberships`, data, headers);
|
|
||||||
|
|
||||||
const deleteCardMembership = (cardId, userId, headers) =>
|
const deleteCardMembership = (cardId, userId) =>
|
||||||
socket.delete(`/cards/${cardId}/memberships?userId=${userId}`, undefined, headers);
|
socket.delete(`/cards/${cardId}/memberships?userId=${userId}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createCardMembership,
|
createCardMembership,
|
||||||
|
|||||||
+10
-10
@@ -35,8 +35,8 @@ export const transformCardData = (data) => ({
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const getCards = (boardId, data, headers) =>
|
const getCards = (boardId, data) =>
|
||||||
socket.get(`/board/${boardId}/cards`, data, headers).then((body) => ({
|
socket.get(`/board/${boardId}/cards`, data).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
items: body.items.map(transformCard),
|
items: body.items.map(transformCard),
|
||||||
included: {
|
included: {
|
||||||
@@ -45,26 +45,26 @@ const getCards = (boardId, data, headers) =>
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const createCard = (boardId, data, headers) =>
|
const createCard = (boardId, data) =>
|
||||||
socket.post(`/boards/${boardId}/cards`, transformCardData(data), headers).then((body) => ({
|
socket.post(`/boards/${boardId}/cards`, transformCardData(data)).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformCard(body.item),
|
item: transformCard(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const getCard = (id, headers) =>
|
const getCard = (id) =>
|
||||||
socket.get(`/cards/${id}`, undefined, headers).then((body) => ({
|
socket.get(`/cards/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformCard(body.item),
|
item: transformCard(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const updateCard = (id, data, headers) =>
|
const updateCard = (id, data) =>
|
||||||
socket.patch(`/cards/${id}`, transformCardData(data), headers).then((body) => ({
|
socket.patch(`/cards/${id}`, transformCardData(data)).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformCard(body.item),
|
item: transformCard(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const deleteCard = (id, headers) =>
|
const deleteCard = (id) =>
|
||||||
socket.delete(`/cards/${id}`, undefined, headers).then((body) => ({
|
socket.delete(`/cards/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformCard(body.item),
|
item: transformCard(body.item),
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -3,20 +3,20 @@ import { transformAction } from './actions';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createCommentAction = (cardId, data, headers) =>
|
const createCommentAction = (cardId, data) =>
|
||||||
socket.post(`/cards/${cardId}/comment-actions`, data, headers).then((body) => ({
|
socket.post(`/cards/${cardId}/comment-actions`, data).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformAction(body.item),
|
item: transformAction(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const updateCommentAction = (id, data, headers) =>
|
const updateCommentAction = (id, data) =>
|
||||||
socket.patch(`/comment-actions/${id}`, data, headers).then((body) => ({
|
socket.patch(`/comment-actions/${id}`, data).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformAction(body.item),
|
item: transformAction(body.item),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const deleteCommentAction = (id, headers) =>
|
const deleteCommentAction = (id) =>
|
||||||
socket.delete(`/comment-actions/${id}`, undefined, headers).then((body) => ({
|
socket.delete(`/comment-actions/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformAction(body.item),
|
item: transformAction(body.item),
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const http = {};
|
|||||||
|
|
||||||
// TODO: add all methods
|
// TODO: add all methods
|
||||||
['POST'].forEach((method) => {
|
['POST'].forEach((method) => {
|
||||||
http[method.toLowerCase()] = (url, data, headers) => {
|
http[method.toLowerCase()] = (url, data) => {
|
||||||
const formData = Object.keys(data).reduce((result, key) => {
|
const formData = Object.keys(data).reduce((result, key) => {
|
||||||
result.append(key, data[key]);
|
result.append(key, data[key]);
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ const http = {};
|
|||||||
|
|
||||||
return fetch(`${Config.SERVER_BASE_URL}/api${url}`, {
|
return fetch(`${Config.SERVER_BASE_URL}/api${url}`, {
|
||||||
method,
|
method,
|
||||||
headers,
|
|
||||||
body: formData,
|
body: formData,
|
||||||
|
...Config.FETCH_OPTIONS,
|
||||||
})
|
})
|
||||||
.then((response) =>
|
.then((response) =>
|
||||||
response.json().then((body) => ({
|
response.json().then((body) => ({
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createLabel = (boardId, data, headers) =>
|
const createLabel = (boardId, data) => socket.post(`/boards/${boardId}/labels`, data);
|
||||||
socket.post(`/boards/${boardId}/labels`, data, headers);
|
|
||||||
|
|
||||||
const updateLabel = (id, data, headers) => socket.patch(`/labels/${id}`, data, headers);
|
const updateLabel = (id, data) => socket.patch(`/labels/${id}`, data);
|
||||||
|
|
||||||
const deleteLabel = (id, headers) => socket.delete(`/labels/${id}`, undefined, headers);
|
const deleteLabel = (id) => socket.delete(`/labels/${id}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createLabel,
|
createLabel,
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createList = (boardId, data, headers) =>
|
const createList = (boardId, data) => socket.post(`/boards/${boardId}/lists`, data);
|
||||||
socket.post(`/boards/${boardId}/lists`, data, headers);
|
|
||||||
|
|
||||||
const updateList = (id, data, headers) => socket.patch(`/lists/${id}`, data, headers);
|
const updateList = (id, data) => socket.patch(`/lists/${id}`, data);
|
||||||
|
|
||||||
const deleteList = (id, headers) => socket.delete(`/lists/${id}`, undefined, headers);
|
const deleteList = (id) => socket.delete(`/lists/${id}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createList,
|
createList,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { transformAction } from './actions';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const getNotifications = (headers) =>
|
const getNotifications = () =>
|
||||||
socket.get('/notifications', undefined, headers).then((body) => ({
|
socket.get('/notifications').then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
included: {
|
included: {
|
||||||
...body.included,
|
...body.included,
|
||||||
@@ -14,8 +14,8 @@ const getNotifications = (headers) =>
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const getNotification = (id, headers) =>
|
const getNotification = (id) =>
|
||||||
socket.get(`/notifications/${id}`, undefined, headers).then((body) => ({
|
socket.get(`/notifications/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
included: {
|
included: {
|
||||||
...body.included,
|
...body.included,
|
||||||
@@ -24,8 +24,7 @@ const getNotification = (id, headers) =>
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const updateNotifications = (ids, data, headers) =>
|
const updateNotifications = (ids, data) => socket.patch(`/notifications/${ids.join(',')}`, data);
|
||||||
socket.patch(`/notifications/${ids.join(',')}`, data, headers);
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getNotifications,
|
getNotifications,
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createProjectManager = (projectId, data, headers) =>
|
const createProjectManager = (projectId, data) =>
|
||||||
socket.post(`/projects/${projectId}/managers`, data, headers);
|
socket.post(`/projects/${projectId}/managers`, data);
|
||||||
|
|
||||||
const deleteProjectManager = (id, headers) =>
|
const deleteProjectManager = (id) => socket.delete(`/project-managers/${id}`);
|
||||||
socket.delete(`/project-managers/${id}`, undefined, headers);
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createProjectManager,
|
createProjectManager,
|
||||||
|
|||||||
@@ -3,18 +3,18 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const getProjects = (headers) => socket.get('/projects', undefined, headers);
|
const getProjects = () => socket.get('/projects');
|
||||||
|
|
||||||
const createProject = (data, headers) => socket.post('/projects', data, headers);
|
const createProject = (data) => socket.post('/projects', data);
|
||||||
|
|
||||||
const getProject = (id, headers) => socket.get(`/projects/${id}`, undefined, headers);
|
const getProject = (id) => socket.get(`/projects/${id}`);
|
||||||
|
|
||||||
const updateProject = (id, data, headers) => socket.patch(`/projects/${id}`, data, headers);
|
const updateProject = (id, data) => socket.patch(`/projects/${id}`, data);
|
||||||
|
|
||||||
const updateProjectBackgroundImage = (id, data, headers) =>
|
const updateProjectBackgroundImage = (id, data) =>
|
||||||
http.post(`/projects/${id}/background-image`, data, headers);
|
http.post(`/projects/${id}/background-image`, data);
|
||||||
|
|
||||||
const deleteProject = (id, headers) => socket.delete(`/projects/${id}`, undefined, headers);
|
const deleteProject = (id) => socket.delete(`/projects/${id}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getProjects,
|
getProjects,
|
||||||
|
|||||||
@@ -16,13 +16,12 @@ const { socket } = io;
|
|||||||
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
||||||
|
|
||||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||||
socket[method.toLowerCase()] = (url, data, headers) =>
|
socket[method.toLowerCase()] = (url, data) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
socket.request(
|
socket.request(
|
||||||
{
|
{
|
||||||
method,
|
method,
|
||||||
data,
|
data,
|
||||||
headers,
|
|
||||||
url: `/api${url}`,
|
url: `/api${url}`,
|
||||||
},
|
},
|
||||||
(_, { body, error }) => {
|
(_, { body, error }) => {
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createTask = (cardId, data, headers) => socket.post(`/cards/${cardId}/tasks`, data, headers);
|
const createTask = (cardId, data) => socket.post(`/cards/${cardId}/tasks`, data);
|
||||||
|
|
||||||
const updateTask = (id, data, headers) => socket.patch(`/tasks/${id}`, data, headers);
|
const updateTask = (id, data) => socket.patch(`/tasks/${id}`, data);
|
||||||
|
|
||||||
const deleteTask = (id, headers) => socket.delete(`/tasks/${id}`, undefined, headers);
|
const deleteTask = (id) => socket.delete(`/tasks/${id}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createTask,
|
createTask,
|
||||||
|
|||||||
+10
-12
@@ -3,27 +3,25 @@ import socket from './socket';
|
|||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const getUsers = (headers) => socket.get('/users', undefined, headers);
|
const getUsers = () => socket.get('/users');
|
||||||
|
|
||||||
const createUser = (data, headers) => socket.post('/users', data, headers);
|
const createUser = (data) => socket.post('/users', data);
|
||||||
|
|
||||||
const getUser = (id, headers) => socket.get(`/users/${id}`, undefined, headers);
|
const getUser = (id) => socket.get(`/users/${id}`);
|
||||||
|
|
||||||
const getCurrentUser = (headers) => socket.get('/users/me', undefined, headers);
|
const getCurrentUser = () => socket.get('/users/me');
|
||||||
|
|
||||||
const updateUser = (id, data, headers) => socket.patch(`/users/${id}`, data, headers);
|
const updateUser = (id, data) => socket.patch(`/users/${id}`, data);
|
||||||
|
|
||||||
const updateUserEmail = (id, data, headers) => socket.patch(`/users/${id}/email`, data, headers);
|
const updateUserEmail = (id, data) => socket.patch(`/users/${id}/email`, data);
|
||||||
|
|
||||||
const updateUserPassword = (id, data, headers) =>
|
const updateUserPassword = (id, data) => socket.patch(`/users/${id}/password`, data);
|
||||||
socket.patch(`/users/${id}/password`, data, headers);
|
|
||||||
|
|
||||||
const updateUserUsername = (id, data, headers) =>
|
const updateUserUsername = (id, data) => socket.patch(`/users/${id}/username`, data);
|
||||||
socket.patch(`/users/${id}/username`, data, headers);
|
|
||||||
|
|
||||||
const updateUserAvatar = (id, data, headers) => http.post(`/users/${id}/avatar`, data, headers);
|
const updateUserAvatar = (id, data) => http.post(`/users/${id}/avatar`, data);
|
||||||
|
|
||||||
const deleteUser = (id, headers) => socket.delete(`/users/${id}`, undefined, headers);
|
const deleteUser = (id) => socket.delete(`/users/${id}`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getUsers,
|
getUsers,
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import { ProjectBackgroundTypes } from '../../constants/Enums';
|
|||||||
import styles from './Background.module.scss';
|
import styles from './Background.module.scss';
|
||||||
import globalStyles from '../../styles.module.scss';
|
import globalStyles from '../../styles.module.scss';
|
||||||
|
|
||||||
const Background = ({ type, name, imageUrl }) => (
|
function Background({ type, name, imageUrl }) {
|
||||||
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
styles.wrapper,
|
styles.wrapper,
|
||||||
@@ -20,7 +21,8 @@ const Background = ({ type, name, imageUrl }) => (
|
|||||||
background: type === 'image' && `url("${imageUrl}") center / cover`,
|
background: type === 'image' && `url("${imageUrl}") center / cover`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Background.propTypes = {
|
Background.propTypes = {
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const DEFAULT_DATA = {
|
|||||||
const ListAdd = React.memo(({ onCreate, onClose }) => {
|
const ListAdd = React.memo(({ onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
const [selectNameFieldState, selectNameField] = useToggle();
|
const [focusNameFieldState, focusNameField] = useToggle();
|
||||||
|
|
||||||
const nameField = useRef(null);
|
const nameField = useRef(null);
|
||||||
|
|
||||||
@@ -44,16 +44,16 @@ const ListAdd = React.memo(({ onCreate, onClose }) => {
|
|||||||
onCreate(cleanData);
|
onCreate(cleanData);
|
||||||
|
|
||||||
setData(DEFAULT_DATA);
|
setData(DEFAULT_DATA);
|
||||||
selectNameField();
|
focusNameField();
|
||||||
}, [onCreate, data, setData, selectNameField]);
|
}, [onCreate, data, setData, focusNameField]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nameField.current.select();
|
nameField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useDidUpdate(() => {
|
useDidUpdate(() => {
|
||||||
nameField.current.select();
|
nameField.current.focus();
|
||||||
}, [selectNameFieldState]);
|
}, [focusNameFieldState]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form className={styles.wrapper} onSubmit={handleSubmit}>
|
<Form className={styles.wrapper} onSubmit={handleSubmit}>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const AddStep = React.memo(({ onCreate, onClose }) => {
|
|||||||
}, [onCreate, onClose, data]);
|
}, [onCreate, onClose, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nameField.current.select();
|
nameField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
|
|
||||||
.cover {
|
.cover {
|
||||||
border-radius: 3px 3px 0 0;
|
border-radius: 3px 3px 0 0;
|
||||||
|
margin-bottom: 2px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +115,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
|
cursor: auto;
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
field.current.ref.current.select();
|
field.current.ref.current.focus();
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -40,9 +40,7 @@ const Tasks = React.memo(({ items }) => {
|
|||||||
<span
|
<span
|
||||||
className={classNames(styles.count, isOpened ? styles.countOpened : styles.countClosed)}
|
className={classNames(styles.count, isOpened ? styles.countOpened : styles.countClosed)}
|
||||||
>
|
>
|
||||||
{completedItems.length}
|
{completedItems.length}/{items.length}
|
||||||
{'/'}
|
|
||||||
{items.length}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{isOpened && (
|
{isOpened && (
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Comment, Icon, Loader, Visibility } from 'semantic-ui-react';
|
import { Button, Comment, Icon, Loader, Visibility } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { ActionTypes } from '../../../constants/Enums';
|
import { ActionTypes } from '../../../constants/Enums';
|
||||||
import CommentAdd from './CommentAdd';
|
import CommentAdd from './CommentAdd';
|
||||||
@@ -14,15 +14,22 @@ const Actions = React.memo(
|
|||||||
items,
|
items,
|
||||||
isFetching,
|
isFetching,
|
||||||
isAllFetched,
|
isAllFetched,
|
||||||
|
isDetailsVisible,
|
||||||
|
isDetailsFetching,
|
||||||
canEdit,
|
canEdit,
|
||||||
canEditAllComments,
|
canEditAllComments,
|
||||||
onFetch,
|
onFetch,
|
||||||
|
onDetailsToggle,
|
||||||
onCommentCreate,
|
onCommentCreate,
|
||||||
onCommentUpdate,
|
onCommentUpdate,
|
||||||
onCommentDelete,
|
onCommentDelete,
|
||||||
}) => {
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
const handleToggleDetailsClick = useCallback(() => {
|
||||||
|
onDetailsToggle(!isDetailsVisible);
|
||||||
|
}, [isDetailsVisible, onDetailsToggle]);
|
||||||
|
|
||||||
const handleCommentUpdate = useCallback(
|
const handleCommentUpdate = useCallback(
|
||||||
(id, data) => {
|
(id, data) => {
|
||||||
onCommentUpdate(id, data);
|
onCommentUpdate(id, data);
|
||||||
@@ -38,20 +45,18 @@ const Actions = React.memo(
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{canEdit && (
|
|
||||||
<div className={styles.contentModule}>
|
|
||||||
<div className={styles.moduleWrapper}>
|
|
||||||
<Icon name="comment outline" className={styles.moduleIcon} />
|
|
||||||
<div className={styles.moduleHeader}>{t('common.addComment')}</div>
|
|
||||||
<CommentAdd onCreate={onCommentCreate} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className={styles.contentModule}>
|
<div className={styles.contentModule}>
|
||||||
<div className={styles.moduleWrapper}>
|
<div className={styles.moduleWrapper}>
|
||||||
<Icon name="list ul" className={styles.moduleIcon} />
|
<Icon name="list ul" className={styles.moduleIcon} />
|
||||||
<div className={styles.moduleHeader}>{t('common.actions')}</div>
|
<div className={styles.moduleHeader}>
|
||||||
|
{t('common.actions')}
|
||||||
|
<Button
|
||||||
|
content={isDetailsVisible ? t('action.hideDetails') : t('action.showDetails')}
|
||||||
|
className={styles.toggleButton}
|
||||||
|
onClick={handleToggleDetailsClick}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{canEdit && <CommentAdd onCreate={onCommentCreate} />}
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<Comment.Group>
|
<Comment.Group>
|
||||||
{items.map((item) =>
|
{items.map((item) =>
|
||||||
@@ -78,14 +83,13 @@ const Actions = React.memo(
|
|||||||
)}
|
)}
|
||||||
</Comment.Group>
|
</Comment.Group>
|
||||||
</div>
|
</div>
|
||||||
{isFetching ? (
|
{isFetching || isDetailsFetching ? (
|
||||||
<Loader active inverted inline="centered" size="small" className={styles.loader} />
|
<Loader active inverted inline="centered" size="small" className={styles.loader} />
|
||||||
) : (
|
) : (
|
||||||
!isAllFetched && <Visibility fireOnMount onOnScreen={onFetch} />
|
!isAllFetched && <Visibility fireOnMount onOnScreen={onFetch} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -94,9 +98,12 @@ Actions.propTypes = {
|
|||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
isAllFetched: PropTypes.bool.isRequired,
|
isAllFetched: PropTypes.bool.isRequired,
|
||||||
|
isDetailsVisible: PropTypes.bool.isRequired,
|
||||||
|
isDetailsFetching: PropTypes.bool.isRequired,
|
||||||
canEdit: PropTypes.bool.isRequired,
|
canEdit: PropTypes.bool.isRequired,
|
||||||
canEditAllComments: PropTypes.bool.isRequired,
|
canEditAllComments: PropTypes.bool.isRequired,
|
||||||
onFetch: PropTypes.func.isRequired,
|
onFetch: PropTypes.func.isRequired,
|
||||||
|
onDetailsToggle: PropTypes.func.isRequired,
|
||||||
onCommentCreate: PropTypes.func.isRequired,
|
onCommentCreate: PropTypes.func.isRequired,
|
||||||
onCommentUpdate: PropTypes.func.isRequired,
|
onCommentUpdate: PropTypes.func.isRequired,
|
||||||
onCommentDelete: PropTypes.func.isRequired,
|
onCommentDelete: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -8,12 +8,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.moduleHeader {
|
.moduleHeader {
|
||||||
|
align-items: center;
|
||||||
color: #17394d;
|
color: #17394d;
|
||||||
|
display: flex;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 20px;
|
height: 36px;
|
||||||
|
justify-content: space-between;
|
||||||
margin: 0 0 4px;
|
margin: 0 0 4px;
|
||||||
padding: 8px 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.moduleIcon {
|
.moduleIcon {
|
||||||
@@ -33,6 +35,24 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.toggleButton {
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
color: #6b808c;
|
||||||
|
float: right;
|
||||||
|
font-weight: normal;
|
||||||
|
margin-right: 0;
|
||||||
|
padding: 6px 11px;
|
||||||
|
text-align: left;
|
||||||
|
text-decoration: underline;
|
||||||
|
transition: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(9, 30, 66, 0.08);
|
||||||
|
color: #092d42;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
margin-left: -40px;
|
margin-left: -40px;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import React, { useCallback, useRef } from 'react';
|
import React, { useCallback, useRef, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import TextareaAutosize from 'react-textarea-autosize';
|
import TextareaAutosize from 'react-textarea-autosize';
|
||||||
import { Button, Form, TextArea } from 'semantic-ui-react';
|
import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
import { useDidUpdate, useToggle } from '../../../lib/hooks';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useClosableForm, useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './CommentAdd.module.scss';
|
import styles from './CommentAdd.module.scss';
|
||||||
|
|
||||||
@@ -14,10 +15,16 @@ const DEFAULT_DATA = {
|
|||||||
|
|
||||||
const CommentAdd = React.memo(({ onCreate }) => {
|
const CommentAdd = React.memo(({ onCreate }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
|
const [selectTextFieldState, selectTextField] = useToggle();
|
||||||
|
|
||||||
const textField = useRef(null);
|
const textField = useRef(null);
|
||||||
|
|
||||||
|
const close = useCallback(() => {
|
||||||
|
setIsOpened(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const submit = useCallback(() => {
|
const submit = useCallback(() => {
|
||||||
const cleanData = {
|
const cleanData = {
|
||||||
...data,
|
...data,
|
||||||
@@ -32,7 +39,12 @@ const CommentAdd = React.memo(({ onCreate }) => {
|
|||||||
onCreate(cleanData);
|
onCreate(cleanData);
|
||||||
|
|
||||||
setData(DEFAULT_DATA);
|
setData(DEFAULT_DATA);
|
||||||
}, [onCreate, data, setData]);
|
selectTextField();
|
||||||
|
}, [onCreate, data, setData, selectTextField]);
|
||||||
|
|
||||||
|
const handleFieldFocus = useCallback(() => {
|
||||||
|
setIsOpened(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleFieldKeyDown = useCallback(
|
const handleFieldKeyDown = useCallback(
|
||||||
(event) => {
|
(event) => {
|
||||||
@@ -43,10 +55,16 @@ const CommentAdd = React.memo(({ onCreate }) => {
|
|||||||
[submit],
|
[submit],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [handleFieldBlur, handleControlMouseOver, handleControlMouseOut] = useClosableForm(close);
|
||||||
|
|
||||||
const handleSubmit = useCallback(() => {
|
const handleSubmit = useCallback(() => {
|
||||||
submit();
|
submit();
|
||||||
}, [submit]);
|
}, [submit]);
|
||||||
|
|
||||||
|
useDidUpdate(() => {
|
||||||
|
textField.current.ref.current.focus();
|
||||||
|
}, [selectTextFieldState]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form onSubmit={handleSubmit}>
|
<Form onSubmit={handleSubmit}>
|
||||||
<TextArea
|
<TextArea
|
||||||
@@ -55,15 +73,24 @@ const CommentAdd = React.memo(({ onCreate }) => {
|
|||||||
name="text"
|
name="text"
|
||||||
value={data.text}
|
value={data.text}
|
||||||
placeholder={t('common.writeComment')}
|
placeholder={t('common.writeComment')}
|
||||||
minRows={3}
|
minRows={isOpened ? 3 : 1}
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
className={styles.field}
|
className={styles.field}
|
||||||
|
onFocus={handleFieldFocus}
|
||||||
onKeyDown={handleFieldKeyDown}
|
onKeyDown={handleFieldKeyDown}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
|
onBlur={handleFieldBlur}
|
||||||
/>
|
/>
|
||||||
|
{isOpened && (
|
||||||
<div className={styles.controls}>
|
<div className={styles.controls}>
|
||||||
<Button positive content={t('action.addComment')} disabled={!data.text} />
|
<Button
|
||||||
|
positive
|
||||||
|
content={t('action.addComment')}
|
||||||
|
onMouseOver={handleControlMouseOver}
|
||||||
|
onMouseOut={handleControlMouseOut}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
textField.current.ref.current.select();
|
textField.current.ref.current.focus();
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ const ItemComment = React.memo(
|
|||||||
</div>
|
</div>
|
||||||
<CommentEdit ref={commentEdit} defaultData={data} onUpdate={onUpdate}>
|
<CommentEdit ref={commentEdit} defaultData={data} onUpdate={onUpdate}>
|
||||||
<>
|
<>
|
||||||
<Markdown linkTarget="_blank" className={styles.text}>
|
<div className={styles.text}>
|
||||||
{data.text}
|
<Markdown linkTarget="_blank">{data.text}</Markdown>
|
||||||
</Markdown>
|
</div>
|
||||||
{canEdit && (
|
{canEdit && (
|
||||||
<Comment.Actions>
|
<Comment.Actions>
|
||||||
<Comment.Action
|
<Comment.Action
|
||||||
|
|||||||
@@ -34,13 +34,6 @@
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: pre-line;
|
|
||||||
word-break: break-word;
|
|
||||||
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const TextFileAddModal = React.memo(({ content, onCreate, onClose }) => {
|
|||||||
}, [content, onCreate, onClose, data]);
|
}, [content, onCreate, onClose, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nameField.current.select();
|
nameField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import classNames from 'classnames';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Gallery, Item as GalleryItem } from 'react-photoswipe-gallery';
|
||||||
import { Button } from 'semantic-ui-react';
|
import { Button } from 'semantic-ui-react';
|
||||||
import { useToggle } from '../../../lib/hooks';
|
import { useToggle } from '../../../lib/hooks';
|
||||||
|
|
||||||
@@ -8,13 +10,12 @@ import Item from './Item';
|
|||||||
|
|
||||||
import styles from './Attachments.module.scss';
|
import styles from './Attachments.module.scss';
|
||||||
|
|
||||||
const Attachments = React.memo(({ items, onUpdate, onDelete, onCoverUpdate }) => {
|
const INITIALLY_VISIBLE = 4;
|
||||||
const [t] = useTranslation();
|
|
||||||
const [isOpened, toggleOpened] = useToggle();
|
|
||||||
|
|
||||||
const handleToggleClick = useCallback(() => {
|
const Attachments = React.memo(
|
||||||
toggleOpened();
|
({ items, onUpdate, onDelete, onCoverUpdate, onGalleryOpen, onGalleryClose }) => {
|
||||||
}, [toggleOpened]);
|
const [t] = useTranslation();
|
||||||
|
const [isAllVisible, toggleAllVisible] = useToggle();
|
||||||
|
|
||||||
const handleCoverSelect = useCallback(
|
const handleCoverSelect = useCallback(
|
||||||
(id) => {
|
(id) => {
|
||||||
@@ -41,48 +42,120 @@ const Attachments = React.memo(({ items, onUpdate, onDelete, onCoverUpdate }) =>
|
|||||||
[onDelete],
|
[onDelete],
|
||||||
);
|
);
|
||||||
|
|
||||||
const visibleItems = isOpened ? items : items.slice(0, 4);
|
const handleBeforeGalleryOpen = useCallback(
|
||||||
|
(gallery) => {
|
||||||
|
onGalleryOpen();
|
||||||
|
|
||||||
|
gallery.on('destroy', () => {
|
||||||
|
onGalleryClose();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
[onGalleryOpen, onGalleryClose],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleToggleAllVisibleClick = useCallback(() => {
|
||||||
|
toggleAllVisible();
|
||||||
|
}, [toggleAllVisible]);
|
||||||
|
|
||||||
|
const galleryItemsNode = items.map((item, index) => {
|
||||||
|
const isPdf = item.url && item.url.endsWith('.pdf');
|
||||||
|
|
||||||
|
let props;
|
||||||
|
if (item.image) {
|
||||||
|
props = item.image;
|
||||||
|
} else {
|
||||||
|
props = {
|
||||||
|
content: isPdf ? (
|
||||||
|
// eslint-disable-next-line jsx-a11y/alt-text
|
||||||
|
<object
|
||||||
|
data={item.url}
|
||||||
|
type="application/pdf"
|
||||||
|
className={classNames(styles.content, styles.contentPdf)}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<span className={classNames(styles.content, styles.contentError)}>
|
||||||
|
{t('common.thereIsNoPreviewAvailableForThisAttachment')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const isVisible = isAllVisible || index < INITIALLY_VISIBLE;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<GalleryItem
|
||||||
{visibleItems.map((item) => (
|
{...props} // eslint-disable-line react/jsx-props-no-spreading
|
||||||
<Item
|
|
||||||
key={item.id}
|
key={item.id}
|
||||||
|
original={item.url}
|
||||||
|
caption={item.name}
|
||||||
|
>
|
||||||
|
{({ ref, open }) =>
|
||||||
|
isVisible ? (
|
||||||
|
<Item
|
||||||
|
ref={ref}
|
||||||
name={item.name}
|
name={item.name}
|
||||||
url={item.url}
|
url={item.url}
|
||||||
coverUrl={item.coverUrl}
|
coverUrl={item.coverUrl}
|
||||||
createdAt={item.createdAt}
|
createdAt={item.createdAt}
|
||||||
isCover={item.isCover}
|
isCover={item.isCover}
|
||||||
isPersisted={item.isPersisted}
|
isPersisted={item.isPersisted}
|
||||||
|
onClick={item.image || isPdf ? open : undefined}
|
||||||
onCoverSelect={() => handleCoverSelect(item.id)}
|
onCoverSelect={() => handleCoverSelect(item.id)}
|
||||||
onCoverDeselect={handleCoverDeselect}
|
onCoverDeselect={handleCoverDeselect}
|
||||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||||
onDelete={() => handleDelete(item.id)}
|
onDelete={() => handleDelete(item.id)}
|
||||||
/>
|
/>
|
||||||
))}
|
) : (
|
||||||
{items.length > 4 && (
|
<span ref={ref} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</GalleryItem>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Gallery
|
||||||
|
withCaption
|
||||||
|
withDownloadButton
|
||||||
|
options={{
|
||||||
|
showHideAnimationType: 'none',
|
||||||
|
closeTitle: '',
|
||||||
|
zoomTitle: '',
|
||||||
|
arrowPrevTitle: '',
|
||||||
|
arrowNextTitle: '',
|
||||||
|
errorMsg: '',
|
||||||
|
}}
|
||||||
|
onBeforeOpen={handleBeforeGalleryOpen}
|
||||||
|
>
|
||||||
|
{galleryItemsNode}
|
||||||
|
</Gallery>
|
||||||
|
{items.length > INITIALLY_VISIBLE && (
|
||||||
<Button
|
<Button
|
||||||
fluid
|
fluid
|
||||||
content={
|
content={
|
||||||
isOpened
|
isAllVisible
|
||||||
? t('action.showFewerAttachments')
|
? t('action.showFewerAttachments')
|
||||||
: t('action.showAllAttachments', {
|
: t('action.showAllAttachments', {
|
||||||
hidden: items.length - visibleItems.length,
|
hidden: items.length - INITIALLY_VISIBLE,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
className={styles.toggleButton}
|
className={styles.toggleButton}
|
||||||
onClick={handleToggleClick}
|
onClick={handleToggleAllVisibleClick}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
Attachments.propTypes = {
|
Attachments.propTypes = {
|
||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
onCoverUpdate: PropTypes.func.isRequired,
|
onCoverUpdate: PropTypes.func.isRequired,
|
||||||
|
onGalleryOpen: PropTypes.func.isRequired,
|
||||||
|
onGalleryClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Attachments;
|
export default Attachments;
|
||||||
|
|||||||
@@ -1,4 +1,26 @@
|
|||||||
:global(#app) {
|
:global(#app) {
|
||||||
|
.content {
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
margin: auto;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentPdf {
|
||||||
|
height: 100%;
|
||||||
|
width: 1120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentError {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
height: 20px;
|
||||||
|
width: 470px;
|
||||||
|
}
|
||||||
|
|
||||||
.toggleButton {
|
.toggleButton {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import EditPopup from './EditPopup';
|
|||||||
|
|
||||||
import styles from './Item.module.scss';
|
import styles from './Item.module.scss';
|
||||||
|
|
||||||
const Item = React.memo(
|
const Item = React.forwardRef(
|
||||||
({
|
(
|
||||||
|
{
|
||||||
name,
|
name,
|
||||||
url,
|
url,
|
||||||
coverUrl,
|
coverUrl,
|
||||||
@@ -18,14 +19,21 @@ const Item = React.memo(
|
|||||||
isPersisted,
|
isPersisted,
|
||||||
onCoverSelect,
|
onCoverSelect,
|
||||||
onCoverDeselect,
|
onCoverDeselect,
|
||||||
|
onClick,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
onDelete,
|
onDelete,
|
||||||
}) => {
|
},
|
||||||
|
ref,
|
||||||
|
) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
|
if (onClick) {
|
||||||
|
onClick();
|
||||||
|
} else {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
}, [url]);
|
}
|
||||||
|
}, [url, onClick]);
|
||||||
|
|
||||||
const handleToggleCoverClick = useCallback(
|
const handleToggleCoverClick = useCallback(
|
||||||
(event) => {
|
(event) => {
|
||||||
@@ -54,7 +62,7 @@ const Item = React.memo(
|
|||||||
return (
|
return (
|
||||||
/* eslint-disable jsx-a11y/click-events-have-key-events,
|
/* eslint-disable jsx-a11y/click-events-have-key-events,
|
||||||
jsx-a11y/no-static-element-interactions */
|
jsx-a11y/no-static-element-interactions */
|
||||||
<div className={styles.wrapper} onClick={handleClick}>
|
<div ref={ref} className={styles.wrapper} onClick={handleClick}>
|
||||||
{/* eslint-enable jsx-a11y/click-events-have-key-events,
|
{/* eslint-enable jsx-a11y/click-events-have-key-events,
|
||||||
jsx-a11y/no-static-element-interactions */}
|
jsx-a11y/no-static-element-interactions */}
|
||||||
<div
|
<div
|
||||||
@@ -133,6 +141,7 @@ Item.propTypes = {
|
|||||||
createdAt: PropTypes.instanceOf(Date),
|
createdAt: PropTypes.instanceOf(Date),
|
||||||
isCover: PropTypes.bool.isRequired,
|
isCover: PropTypes.bool.isRequired,
|
||||||
isPersisted: PropTypes.bool.isRequired,
|
isPersisted: PropTypes.bool.isRequired,
|
||||||
|
onClick: PropTypes.func,
|
||||||
onCoverSelect: PropTypes.func.isRequired,
|
onCoverSelect: PropTypes.func.isRequired,
|
||||||
onCoverDeselect: PropTypes.func.isRequired,
|
onCoverDeselect: PropTypes.func.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
@@ -143,6 +152,7 @@ Item.defaultProps = {
|
|||||||
url: undefined,
|
url: undefined,
|
||||||
coverUrl: undefined,
|
coverUrl: undefined,
|
||||||
createdAt: undefined,
|
createdAt: undefined,
|
||||||
|
onClick: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Item;
|
export default React.memo(Item);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback, useRef } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -34,6 +34,8 @@ const CardModal = React.memo(
|
|||||||
isSubscribed,
|
isSubscribed,
|
||||||
isActionsFetching,
|
isActionsFetching,
|
||||||
isAllActionsFetched,
|
isAllActionsFetched,
|
||||||
|
isActionsDetailsVisible,
|
||||||
|
isActionsDetailsFetching,
|
||||||
listId,
|
listId,
|
||||||
boardId,
|
boardId,
|
||||||
projectId,
|
projectId,
|
||||||
@@ -61,11 +63,13 @@ const CardModal = React.memo(
|
|||||||
onLabelDelete,
|
onLabelDelete,
|
||||||
onTaskCreate,
|
onTaskCreate,
|
||||||
onTaskUpdate,
|
onTaskUpdate,
|
||||||
|
onTaskMove,
|
||||||
onTaskDelete,
|
onTaskDelete,
|
||||||
onAttachmentCreate,
|
onAttachmentCreate,
|
||||||
onAttachmentUpdate,
|
onAttachmentUpdate,
|
||||||
onAttachmentDelete,
|
onAttachmentDelete,
|
||||||
onActionsFetch,
|
onActionsFetch,
|
||||||
|
onActionsDetailsToggle,
|
||||||
onCommentActionCreate,
|
onCommentActionCreate,
|
||||||
onCommentActionUpdate,
|
onCommentActionUpdate,
|
||||||
onCommentActionDelete,
|
onCommentActionDelete,
|
||||||
@@ -73,6 +77,8 @@ const CardModal = React.memo(
|
|||||||
}) => {
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
const isGalleryOpened = useRef(false);
|
||||||
|
|
||||||
const handleNameUpdate = useCallback(
|
const handleNameUpdate = useCallback(
|
||||||
(newName) => {
|
(newName) => {
|
||||||
onUpdate({
|
onUpdate({
|
||||||
@@ -124,6 +130,22 @@ const CardModal = React.memo(
|
|||||||
});
|
});
|
||||||
}, [isSubscribed, onUpdate]);
|
}, [isSubscribed, onUpdate]);
|
||||||
|
|
||||||
|
const handleGalleryOpen = useCallback(() => {
|
||||||
|
isGalleryOpened.current = true;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleGalleryClose = useCallback(() => {
|
||||||
|
isGalleryOpened.current = false;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleClose = useCallback(() => {
|
||||||
|
if (isGalleryOpened.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose();
|
||||||
|
}, [onClose]);
|
||||||
|
|
||||||
const userIds = users.map((user) => user.id);
|
const userIds = users.map((user) => user.id);
|
||||||
const labelIds = labels.map((label) => label.id);
|
const labelIds = labels.map((label) => label.id);
|
||||||
|
|
||||||
@@ -313,6 +335,7 @@ const CardModal = React.memo(
|
|||||||
canEdit={canEdit}
|
canEdit={canEdit}
|
||||||
onCreate={onTaskCreate}
|
onCreate={onTaskCreate}
|
||||||
onUpdate={onTaskUpdate}
|
onUpdate={onTaskUpdate}
|
||||||
|
onMove={onTaskMove}
|
||||||
onDelete={onTaskDelete}
|
onDelete={onTaskDelete}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -328,6 +351,8 @@ const CardModal = React.memo(
|
|||||||
onUpdate={onAttachmentUpdate}
|
onUpdate={onAttachmentUpdate}
|
||||||
onDelete={onAttachmentDelete}
|
onDelete={onAttachmentDelete}
|
||||||
onCoverUpdate={handleCoverUpdate}
|
onCoverUpdate={handleCoverUpdate}
|
||||||
|
onGalleryOpen={handleGalleryOpen}
|
||||||
|
onGalleryClose={handleGalleryClose}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -336,9 +361,12 @@ const CardModal = React.memo(
|
|||||||
items={actions}
|
items={actions}
|
||||||
isFetching={isActionsFetching}
|
isFetching={isActionsFetching}
|
||||||
isAllFetched={isAllActionsFetched}
|
isAllFetched={isAllActionsFetched}
|
||||||
|
isDetailsVisible={isActionsDetailsVisible}
|
||||||
|
isDetailsFetching={isActionsDetailsFetching}
|
||||||
canEdit={canEdit}
|
canEdit={canEdit}
|
||||||
canEditAllComments={canEditAllCommentActions}
|
canEditAllComments={canEditAllCommentActions}
|
||||||
onFetch={onActionsFetch}
|
onFetch={onActionsFetch}
|
||||||
|
onDetailsToggle={onActionsDetailsToggle}
|
||||||
onCommentCreate={onCommentActionCreate}
|
onCommentCreate={onCommentActionCreate}
|
||||||
onCommentUpdate={onCommentActionUpdate}
|
onCommentUpdate={onCommentActionUpdate}
|
||||||
onCommentDelete={onCommentActionDelete}
|
onCommentDelete={onCommentActionDelete}
|
||||||
@@ -445,7 +473,7 @@ const CardModal = React.memo(
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal open closeIcon size="small" centered={false} onClose={onClose}>
|
<Modal open closeIcon centered={false} onClose={handleClose} className={styles.wrapper}>
|
||||||
{canEdit ? (
|
{canEdit ? (
|
||||||
<AttachmentAddZone onCreate={onAttachmentCreate}>{contentNode}</AttachmentAddZone>
|
<AttachmentAddZone onCreate={onAttachmentCreate}>{contentNode}</AttachmentAddZone>
|
||||||
) : (
|
) : (
|
||||||
@@ -464,6 +492,8 @@ CardModal.propTypes = {
|
|||||||
isSubscribed: PropTypes.bool.isRequired,
|
isSubscribed: PropTypes.bool.isRequired,
|
||||||
isActionsFetching: PropTypes.bool.isRequired,
|
isActionsFetching: PropTypes.bool.isRequired,
|
||||||
isAllActionsFetched: PropTypes.bool.isRequired,
|
isAllActionsFetched: PropTypes.bool.isRequired,
|
||||||
|
isActionsDetailsVisible: PropTypes.bool.isRequired,
|
||||||
|
isActionsDetailsFetching: PropTypes.bool.isRequired,
|
||||||
listId: PropTypes.string.isRequired,
|
listId: PropTypes.string.isRequired,
|
||||||
boardId: PropTypes.string.isRequired,
|
boardId: PropTypes.string.isRequired,
|
||||||
projectId: PropTypes.string.isRequired,
|
projectId: PropTypes.string.isRequired,
|
||||||
@@ -493,11 +523,13 @@ CardModal.propTypes = {
|
|||||||
onLabelDelete: PropTypes.func.isRequired,
|
onLabelDelete: PropTypes.func.isRequired,
|
||||||
onTaskCreate: PropTypes.func.isRequired,
|
onTaskCreate: PropTypes.func.isRequired,
|
||||||
onTaskUpdate: PropTypes.func.isRequired,
|
onTaskUpdate: PropTypes.func.isRequired,
|
||||||
|
onTaskMove: PropTypes.func.isRequired,
|
||||||
onTaskDelete: PropTypes.func.isRequired,
|
onTaskDelete: PropTypes.func.isRequired,
|
||||||
onAttachmentCreate: PropTypes.func.isRequired,
|
onAttachmentCreate: PropTypes.func.isRequired,
|
||||||
onAttachmentUpdate: PropTypes.func.isRequired,
|
onAttachmentUpdate: PropTypes.func.isRequired,
|
||||||
onAttachmentDelete: PropTypes.func.isRequired,
|
onAttachmentDelete: PropTypes.func.isRequired,
|
||||||
onActionsFetch: PropTypes.func.isRequired,
|
onActionsFetch: PropTypes.func.isRequired,
|
||||||
|
onActionsDetailsToggle: PropTypes.func.isRequired,
|
||||||
onCommentActionCreate: PropTypes.func.isRequired,
|
onCommentActionCreate: PropTypes.func.isRequired,
|
||||||
onCommentActionUpdate: PropTypes.func.isRequired,
|
onCommentActionUpdate: PropTypes.func.isRequired,
|
||||||
onCommentActionDelete: PropTypes.func.isRequired,
|
onCommentActionDelete: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -115,20 +115,13 @@
|
|||||||
border: none;
|
border: none;
|
||||||
color: #17394d;
|
color: #17394d;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
line-height: 1.5;
|
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
outline: none;
|
outline: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-wrap: break-word;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
white-space: pre-line;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid {
|
.grid {
|
||||||
@@ -200,4 +193,14 @@
|
|||||||
margin: 0 8px 4px 0;
|
margin: 0 8px 4px 0;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
width: 880px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 926px) {
|
||||||
|
.wrapper {
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate },
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
field.current.ref.current.select();
|
field.current.ref.current.focus();
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
const [selectNameFieldState, selectNameField] = useToggle();
|
const [focusNameFieldState, focusNameField] = useToggle();
|
||||||
|
|
||||||
const nameField = useRef(null);
|
const nameField = useRef(null);
|
||||||
|
|
||||||
@@ -43,8 +43,8 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||||||
onCreate(cleanData);
|
onCreate(cleanData);
|
||||||
|
|
||||||
setData(DEFAULT_DATA);
|
setData(DEFAULT_DATA);
|
||||||
selectNameField();
|
focusNameField();
|
||||||
}, [onCreate, data, setData, selectNameField]);
|
}, [onCreate, data, setData, focusNameField]);
|
||||||
|
|
||||||
useImperativeHandle(
|
useImperativeHandle(
|
||||||
ref,
|
ref,
|
||||||
@@ -81,13 +81,13 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
nameField.current.ref.current.select();
|
nameField.current.ref.current.focus();
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
useDidUpdate(() => {
|
useDidUpdate(() => {
|
||||||
nameField.current.ref.current.select();
|
nameField.current.ref.current.focus();
|
||||||
}, [selectNameFieldState]);
|
}, [focusNameFieldState]);
|
||||||
|
|
||||||
if (!isOpened) {
|
if (!isOpened) {
|
||||||
return React.cloneElement(children, {
|
return React.cloneElement(children, {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import React, { useCallback, useRef } from 'react';
|
import React, { useCallback, useRef } from 'react';
|
||||||
|
import ReactDOM from 'react-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { Draggable } from 'react-beautiful-dnd';
|
||||||
import { Button, Checkbox, Icon } from 'semantic-ui-react';
|
import { Button, Checkbox, Icon } from 'semantic-ui-react';
|
||||||
|
|
||||||
import NameEdit from './NameEdit';
|
import NameEdit from './NameEdit';
|
||||||
@@ -8,7 +10,8 @@ import ActionsPopup from './ActionsPopup';
|
|||||||
|
|
||||||
import styles from './Item.module.scss';
|
import styles from './Item.module.scss';
|
||||||
|
|
||||||
const Item = React.memo(({ name, isCompleted, isPersisted, canEdit, onUpdate, onDelete }) => {
|
const Item = React.memo(
|
||||||
|
({ id, index, name, isCompleted, isPersisted, canEdit, onUpdate, onDelete }) => {
|
||||||
const nameEdit = useRef(null);
|
const nameEdit = useRef(null);
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
@@ -37,7 +40,11 @@ const Item = React.memo(({ name, isCompleted, isPersisted, canEdit, onUpdate, on
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper}>
|
<Draggable draggableId={id} index={index} isDragDisabled={!isPersisted || !canEdit}>
|
||||||
|
{({ innerRef, draggableProps, dragHandleProps }, { isDragging }) => {
|
||||||
|
const contentNode = (
|
||||||
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
|
<div {...draggableProps} {...dragHandleProps} ref={innerRef} className={styles.wrapper}>
|
||||||
<span className={styles.checkboxWrapper}>
|
<span className={styles.checkboxWrapper}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={isCompleted}
|
checked={isCompleted}
|
||||||
@@ -71,9 +78,17 @@ const Item = React.memo(({ name, isCompleted, isPersisted, canEdit, onUpdate, on
|
|||||||
</NameEdit>
|
</NameEdit>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
|
||||||
|
return isDragging ? ReactDOM.createPortal(contentNode, document.body) : contentNode;
|
||||||
|
}}
|
||||||
|
</Draggable>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
Item.propTypes = {
|
Item.propTypes = {
|
||||||
|
id: PropTypes.string.isRequired,
|
||||||
|
index: PropTypes.number.isRequired,
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
isCompleted: PropTypes.bool.isRequired,
|
isCompleted: PropTypes.bool.isRequired,
|
||||||
isPersisted: PropTypes.bool.isRequired,
|
isPersisted: PropTypes.bool.isRequired,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
z-index: 2000;
|
z-index: 2000;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
height: 32px;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentHoverable:hover {
|
.contentHoverable:hover {
|
||||||
@@ -69,10 +69,10 @@
|
|||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
cursor: auto;
|
||||||
margin-left: -40px;
|
margin-left: -40px;
|
||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: all 0.14s ease-in;
|
|
||||||
width: calc(100% + 40px);
|
width: calc(100% + 40px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
field.current.ref.current.select();
|
field.current.ref.current.focus();
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,34 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
||||||
import { Progress } from 'semantic-ui-react';
|
import { Progress } from 'semantic-ui-react';
|
||||||
|
import { closePopup } from '../../../lib/popup';
|
||||||
|
|
||||||
|
import DroppableTypes from '../../../constants/DroppableTypes';
|
||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
import Add from './Add';
|
import Add from './Add';
|
||||||
|
|
||||||
import styles from './Tasks.module.scss';
|
import styles from './Tasks.module.scss';
|
||||||
|
|
||||||
const Tasks = React.memo(({ items, canEdit, onCreate, onUpdate, onDelete }) => {
|
const Tasks = React.memo(({ items, canEdit, onCreate, onUpdate, onMove, onDelete }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
const handleDragStart = useCallback(() => {
|
||||||
|
closePopup();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleDragEnd = useCallback(
|
||||||
|
({ draggableId, source, destination }) => {
|
||||||
|
if (!destination || source.index === destination.index) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMove(draggableId, destination.index);
|
||||||
|
},
|
||||||
|
[onMove],
|
||||||
|
);
|
||||||
|
|
||||||
const handleUpdate = useCallback(
|
const handleUpdate = useCallback(
|
||||||
(id, data) => {
|
(id, data) => {
|
||||||
onUpdate(id, data);
|
onUpdate(id, data);
|
||||||
@@ -39,9 +57,16 @@ const Tasks = React.memo(({ items, canEdit, onCreate, onUpdate, onDelete }) => {
|
|||||||
className={styles.progress}
|
className={styles.progress}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{items.map((item) => (
|
<DragDropContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
|
||||||
|
<Droppable droppableId="tasks" type={DroppableTypes.TASK}>
|
||||||
|
{({ innerRef, droppableProps, placeholder }) => (
|
||||||
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
|
<div {...droppableProps} ref={innerRef}>
|
||||||
|
{items.map((item, index) => (
|
||||||
<Item
|
<Item
|
||||||
key={item.id}
|
key={item.id}
|
||||||
|
id={item.id}
|
||||||
|
index={index}
|
||||||
name={item.name}
|
name={item.name}
|
||||||
isCompleted={item.isCompleted}
|
isCompleted={item.isCompleted}
|
||||||
isPersisted={item.isPersisted}
|
isPersisted={item.isPersisted}
|
||||||
@@ -50,6 +75,7 @@ const Tasks = React.memo(({ items, canEdit, onCreate, onUpdate, onDelete }) => {
|
|||||||
onDelete={() => handleDelete(item.id)}
|
onDelete={() => handleDelete(item.id)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
{placeholder}
|
||||||
{canEdit && (
|
{canEdit && (
|
||||||
<Add onCreate={onCreate}>
|
<Add onCreate={onCreate}>
|
||||||
<button type="button" className={styles.taskButton}>
|
<button type="button" className={styles.taskButton}>
|
||||||
@@ -59,6 +85,10 @@ const Tasks = React.memo(({ items, canEdit, onCreate, onUpdate, onDelete }) => {
|
|||||||
</button>
|
</button>
|
||||||
</Add>
|
</Add>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
</DragDropContext>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -68,6 +98,7 @@ Tasks.propTypes = {
|
|||||||
canEdit: PropTypes.bool.isRequired,
|
canEdit: PropTypes.bool.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
|
onMove: PropTypes.func.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import UserSettingsModalContainer from '../containers/UserSettingsModalContainer
|
|||||||
import ProjectAddModalContainer from '../containers/ProjectAddModalContainer';
|
import ProjectAddModalContainer from '../containers/ProjectAddModalContainer';
|
||||||
import Background from './Background';
|
import Background from './Background';
|
||||||
|
|
||||||
const Core = ({ currentModal, currentProject }) => (
|
function Core({ currentModal, currentProject }) {
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
{currentProject && currentProject.background && (
|
{currentProject && currentProject.background && (
|
||||||
<Background
|
<Background
|
||||||
@@ -24,7 +25,8 @@ const Core = ({ currentModal, currentProject }) => (
|
|||||||
{currentModal === ModalTypes.USER_SETTINGS && <UserSettingsModalContainer />}
|
{currentModal === ModalTypes.USER_SETTINGS && <UserSettingsModalContainer />}
|
||||||
{currentModal === ModalTypes.PROJECT_ADD && <ProjectAddModalContainer />}
|
{currentModal === ModalTypes.PROJECT_ADD && <ProjectAddModalContainer />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Core.propTypes = {
|
Core.propTypes = {
|
||||||
currentModal: PropTypes.oneOf(Object.values(ModalTypes)),
|
currentModal: PropTypes.oneOf(Object.values(ModalTypes)),
|
||||||
|
|||||||
@@ -7,13 +7,15 @@ import BoardActionsContainer from '../../containers/BoardActionsContainer';
|
|||||||
|
|
||||||
import styles from './Fixed.module.scss';
|
import styles from './Fixed.module.scss';
|
||||||
|
|
||||||
const Fixed = ({ projectId, board }) => (
|
function Fixed({ projectId, board }) {
|
||||||
|
return (
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<HeaderContainer />
|
<HeaderContainer />
|
||||||
{projectId && <ProjectContainer />}
|
{projectId && <ProjectContainer />}
|
||||||
{board && !board.isFetching && <BoardActionsContainer />}
|
{board && !board.isFetching && <BoardActionsContainer />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Fixed.propTypes = {
|
Fixed.propTypes = {
|
||||||
projectId: PropTypes.string,
|
projectId: PropTypes.string,
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: inline-block;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
outline: none;
|
outline: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const DEFAULT_DATA = {
|
|||||||
const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
const [selectNameFieldState, selectNameField] = useToggle();
|
const [focusNameFieldState, focusNameField] = useToggle();
|
||||||
|
|
||||||
const nameField = useRef(null);
|
const nameField = useRef(null);
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
|||||||
onCreate(cleanData);
|
onCreate(cleanData);
|
||||||
|
|
||||||
setData(DEFAULT_DATA);
|
setData(DEFAULT_DATA);
|
||||||
selectNameField();
|
focusNameField();
|
||||||
}, [onCreate, data, setData, selectNameField]);
|
}, [onCreate, data, setData, focusNameField]);
|
||||||
|
|
||||||
const handleFieldKeyDown = useCallback(
|
const handleFieldKeyDown = useCallback(
|
||||||
(event) => {
|
(event) => {
|
||||||
@@ -65,13 +65,13 @@ const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
nameField.current.ref.current.select();
|
nameField.current.ref.current.focus();
|
||||||
}
|
}
|
||||||
}, [isOpened]);
|
}, [isOpened]);
|
||||||
|
|
||||||
useDidUpdate(() => {
|
useDidUpdate(() => {
|
||||||
nameField.current.ref.current.select();
|
nameField.current.ref.current.focus();
|
||||||
}, [selectNameFieldState]);
|
}, [focusNameFieldState]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ const Login = React.memo(
|
|||||||
}, [onAuthenticate, data]);
|
}, [onAuthenticate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
emailOrUsernameField.current.select();
|
emailOrUsernameField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const NotFound = () => {
|
function NotFound() {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -11,6 +11,6 @@ const NotFound = () => {
|
|||||||
})}
|
})}
|
||||||
</h1>
|
</h1>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
export default NotFound;
|
export default NotFound;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const ProjectAddModal = React.memo(({ defaultData, isSubmitting, onCreate, onClo
|
|||||||
}, [onCreate, data]);
|
}, [onCreate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nameField.current.select();
|
nameField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ import CoreWrapperContainer from '../containers/CoreWrapperContainer';
|
|||||||
import NotFound from './NotFound';
|
import NotFound from './NotFound';
|
||||||
|
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
import 'react-datepicker/dist/react-datepicker.css';
|
||||||
|
import 'photoswipe/dist/photoswipe.css';
|
||||||
import '../lib/custom-ui/styles.css';
|
import '../lib/custom-ui/styles.css';
|
||||||
|
|
||||||
import '../styles.module.scss';
|
import '../styles.module.scss';
|
||||||
|
|
||||||
const Root = ({ store, history }) => (
|
function Root({ store, history }) {
|
||||||
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConnectedRouter history={history}>
|
<ConnectedRouter history={history}>
|
||||||
<Switch>
|
<Switch>
|
||||||
@@ -27,7 +29,8 @@ const Root = ({ store, history }) => (
|
|||||||
</Switch>
|
</Switch>
|
||||||
</ConnectedRouter>
|
</ConnectedRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Root.propTypes = {
|
Root.propTypes = {
|
||||||
/* eslint-disable react/forbid-prop-types */
|
/* eslint-disable react/forbid-prop-types */
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import BoardWrapperContainer from '../../containers/BoardWrapperContainer';
|
|||||||
|
|
||||||
import styles from './Static.module.scss';
|
import styles from './Static.module.scss';
|
||||||
|
|
||||||
const Static = ({ cardId, boardId, projectId }) => {
|
function Static({ cardId, boardId, projectId }) {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
if (projectId === undefined) {
|
if (projectId === undefined) {
|
||||||
@@ -85,7 +85,7 @@ const Static = ({ cardId, boardId, projectId }) => {
|
|||||||
<BoardWrapperContainer />
|
<BoardWrapperContainer />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
Static.propTypes = {
|
Static.propTypes = {
|
||||||
cardId: PropTypes.string,
|
cardId: PropTypes.string,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const createData = (timer) => {
|
|||||||
const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(() => createData(defaultValue));
|
const [data, handleFieldChange, setData] = useForm(() => createData(defaultValue));
|
||||||
const [isEditing, toggleEdit] = useToggle();
|
const [isEditing, toggleEditing] = useToggle();
|
||||||
|
|
||||||
const hoursField = useRef(null);
|
const hoursField = useRef(null);
|
||||||
const minutesField = useRef(null);
|
const minutesField = useRef(null);
|
||||||
@@ -55,10 +55,10 @@ const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) =
|
|||||||
onClose();
|
onClose();
|
||||||
}, [defaultValue, onUpdate, onClose]);
|
}, [defaultValue, onUpdate, onClose]);
|
||||||
|
|
||||||
const handleToggleEditClick = useCallback(() => {
|
const handleToggleEditingClick = useCallback(() => {
|
||||||
setData(createData(defaultValue));
|
setData(createData(defaultValue));
|
||||||
toggleEdit();
|
toggleEditing();
|
||||||
}, [defaultValue, setData, toggleEdit]);
|
}, [defaultValue, setData, toggleEditing]);
|
||||||
|
|
||||||
const handleSubmit = useCallback(() => {
|
const handleSubmit = useCallback(() => {
|
||||||
const parts = {
|
const parts = {
|
||||||
@@ -149,7 +149,7 @@ const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) =
|
|||||||
type="button"
|
type="button"
|
||||||
icon={isEditing ? 'close' : 'edit'}
|
icon={isEditing ? 'close' : 'edit'}
|
||||||
className={styles.iconButton}
|
className={styles.iconButton}
|
||||||
onClick={handleToggleEditClick}
|
onClick={handleToggleEditingClick}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{isEditing && <Button positive content={t('action.save')} />}
|
{isEditing && <Button positive content={t('action.save')} />}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ const UserAddStep = React.memo(
|
|||||||
}, [onCreate, data]);
|
}, [onCreate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
emailField.current.select();
|
emailField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { withPopup } from '../lib/popup';
|
||||||
|
|
||||||
|
import UserEmailEditStep from './UserEmailEditStep';
|
||||||
|
|
||||||
|
export default withPopup(UserEmailEditStep);
|
||||||
+33
-15
@@ -1,15 +1,15 @@
|
|||||||
|
import omit from 'lodash/omit';
|
||||||
import isEmail from 'validator/lib/isEmail';
|
import isEmail from 'validator/lib/isEmail';
|
||||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Form, Message } from 'semantic-ui-react';
|
import { Button, Form, Message } from 'semantic-ui-react';
|
||||||
import { useDidUpdate, usePrevious, useToggle } from '../../../lib/hooks';
|
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||||
import { withPopup } from '../../../lib/popup';
|
import { Input, Popup } from '../../lib/custom-ui';
|
||||||
import { Input, Popup } from '../../../lib/custom-ui';
|
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './EmailEditPopup.module.scss';
|
import styles from './UserEmailEditStep.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
@@ -35,8 +35,18 @@ const createMessage = (error) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const EmailEditStep = React.memo(
|
const UserEmailEditStep = React.memo(
|
||||||
({ defaultData, email, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
({
|
||||||
|
defaultData,
|
||||||
|
email,
|
||||||
|
isSubmitting,
|
||||||
|
error,
|
||||||
|
usePasswordConfirmation,
|
||||||
|
onUpdate,
|
||||||
|
onMessageDismiss,
|
||||||
|
onBack,
|
||||||
|
onClose,
|
||||||
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
|
||||||
@@ -68,16 +78,16 @@ const EmailEditStep = React.memo(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cleanData.currentPassword) {
|
if (usePasswordConfirmation && !cleanData.currentPassword) {
|
||||||
currentPasswordField.current.focus();
|
currentPasswordField.current.focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdate(cleanData);
|
onUpdate(usePasswordConfirmation ? cleanData : omit(cleanData, 'currentPassword'));
|
||||||
}, [email, onUpdate, onClose, data]);
|
}, [email, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
emailField.current.select();
|
emailField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -110,7 +120,7 @@ const EmailEditStep = React.memo(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Popup.Header>
|
<Popup.Header onBack={onBack}>
|
||||||
{t('common.editEmail', {
|
{t('common.editEmail', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
@@ -138,6 +148,8 @@ const EmailEditStep = React.memo(
|
|||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
{usePasswordConfirmation && (
|
||||||
|
<>
|
||||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||||
<Input.Password
|
<Input.Password
|
||||||
fluid
|
fluid
|
||||||
@@ -147,6 +159,8 @@ const EmailEditStep = React.memo(
|
|||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
positive
|
positive
|
||||||
content={t('action.save')}
|
content={t('action.save')}
|
||||||
@@ -160,18 +174,22 @@ const EmailEditStep = React.memo(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
EmailEditStep.propTypes = {
|
UserEmailEditStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
email: PropTypes.string.isRequired,
|
email: PropTypes.string.isRequired,
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
usePasswordConfirmation: PropTypes.bool,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onMessageDismiss: PropTypes.func.isRequired,
|
onMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onBack: PropTypes.func,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EmailEditStep.defaultProps = {
|
UserEmailEditStep.defaultProps = {
|
||||||
error: undefined,
|
error: undefined,
|
||||||
|
usePasswordConfirmation: false,
|
||||||
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(EmailEditStep);
|
export default UserEmailEditStep;
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import UserEmailEditStep from './UserEmailEditStep';
|
||||||
|
|
||||||
|
export default UserEmailEditStep;
|
||||||
+5
-5
@@ -5,11 +5,11 @@ import PropTypes from 'prop-types';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Form, Input } from 'semantic-ui-react';
|
import { Button, Form, Input } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './InformationEdit.module.scss';
|
import styles from './UserInformationEdit.module.scss';
|
||||||
|
|
||||||
const InformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const [data, handleFieldChange] = useForm(() => ({
|
const [data, handleFieldChange] = useForm(() => ({
|
||||||
@@ -72,9 +72,9 @@ const InformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
InformationEdit.propTypes = {
|
UserInformationEdit.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default InformationEdit;
|
export default UserInformationEdit;
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import UserInformationEdit from './UserInformationEdit';
|
||||||
|
|
||||||
|
export default UserInformationEdit;
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Popup } from '../lib/custom-ui';
|
||||||
|
|
||||||
|
import UserInformationEdit from './UserInformationEdit';
|
||||||
|
|
||||||
|
const UserInformationEditStep = React.memo(({ defaultData, onUpdate, onBack, onClose }) => {
|
||||||
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
const handleUpdate = useCallback(
|
||||||
|
(data) => {
|
||||||
|
onUpdate(data);
|
||||||
|
onClose();
|
||||||
|
},
|
||||||
|
[onUpdate, onClose],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Popup.Header onBack={onBack}>
|
||||||
|
{t('common.editInformation', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Popup.Header>
|
||||||
|
<Popup.Content>
|
||||||
|
<UserInformationEdit defaultData={defaultData} onUpdate={handleUpdate} />
|
||||||
|
</Popup.Content>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
UserInformationEditStep.propTypes = {
|
||||||
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
onUpdate: PropTypes.func.isRequired,
|
||||||
|
onBack: PropTypes.func,
|
||||||
|
onClose: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
UserInformationEditStep.defaultProps = {
|
||||||
|
onBack: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default UserInformationEditStep;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { withPopup } from '../lib/popup';
|
||||||
|
|
||||||
|
import UserPasswordEditStep from './UserPasswordEditStep';
|
||||||
|
|
||||||
|
export default withPopup(UserPasswordEditStep);
|
||||||
+32
-15
@@ -1,14 +1,14 @@
|
|||||||
|
import omit from 'lodash/omit';
|
||||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Form, Message } from 'semantic-ui-react';
|
import { Button, Form, Message } from 'semantic-ui-react';
|
||||||
import { useDidUpdate, usePrevious, useToggle } from '../../../lib/hooks';
|
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||||
import { withPopup } from '../../../lib/popup';
|
import { Input, Popup } from '../../lib/custom-ui';
|
||||||
import { Input, Popup } from '../../../lib/custom-ui';
|
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './PasswordEditPopup.module.scss';
|
import styles from './UserPasswordEditStep.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
@@ -29,8 +29,17 @@ const createMessage = (error) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const PasswordEditStep = React.memo(
|
const UserPasswordEditStep = React.memo(
|
||||||
({ defaultData, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
({
|
||||||
|
defaultData,
|
||||||
|
isSubmitting,
|
||||||
|
error,
|
||||||
|
usePasswordConfirmation,
|
||||||
|
onUpdate,
|
||||||
|
onMessageDismiss,
|
||||||
|
onBack,
|
||||||
|
onClose,
|
||||||
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
|
||||||
@@ -52,16 +61,16 @@ const PasswordEditStep = React.memo(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.currentPassword) {
|
if (usePasswordConfirmation && !data.currentPassword) {
|
||||||
currentPasswordField.current.focus();
|
currentPasswordField.current.focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdate(data);
|
onUpdate(usePasswordConfirmation ? data : omit(data, 'currentPassword'));
|
||||||
}, [onUpdate, data]);
|
}, [usePasswordConfirmation, onUpdate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
passwordField.current.select();
|
passwordField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -84,7 +93,7 @@ const PasswordEditStep = React.memo(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Popup.Header>
|
<Popup.Header onBack={onBack}>
|
||||||
{t('common.editPassword', {
|
{t('common.editPassword', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
@@ -111,6 +120,8 @@ const PasswordEditStep = React.memo(
|
|||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
{usePasswordConfirmation && (
|
||||||
|
<>
|
||||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||||
<Input.Password
|
<Input.Password
|
||||||
fluid
|
fluid
|
||||||
@@ -120,6 +131,8 @@ const PasswordEditStep = React.memo(
|
|||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
positive
|
positive
|
||||||
content={t('action.save')}
|
content={t('action.save')}
|
||||||
@@ -133,17 +146,21 @@ const PasswordEditStep = React.memo(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
PasswordEditStep.propTypes = {
|
UserPasswordEditStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
usePasswordConfirmation: PropTypes.bool,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onMessageDismiss: PropTypes.func.isRequired,
|
onMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onBack: PropTypes.func,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
PasswordEditStep.defaultProps = {
|
UserPasswordEditStep.defaultProps = {
|
||||||
error: undefined,
|
error: undefined,
|
||||||
|
usePasswordConfirmation: false,
|
||||||
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(PasswordEditStep);
|
export default UserPasswordEditStep;
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import UserPasswordEditStep from './UserPasswordEditStep';
|
||||||
|
|
||||||
|
export default UserPasswordEditStep;
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Divider, Header, Tab } from 'semantic-ui-react';
|
import { Button, Divider, Dropdown, Header, Tab } from 'semantic-ui-react';
|
||||||
|
|
||||||
import InformationEdit from './InformationEdit';
|
import locales from '../../../locales';
|
||||||
import AvatarEditPopup from './AvatarEditPopup';
|
import AvatarEditPopup from './AvatarEditPopup';
|
||||||
import UsernameEditPopup from './UsernameEditPopup';
|
|
||||||
import EmailEditPopup from './EmailEditPopup';
|
|
||||||
import PasswordEditPopup from './PasswordEditPopup';
|
|
||||||
import User from '../../User';
|
import User from '../../User';
|
||||||
|
import UserInformationEdit from '../../UserInformationEdit';
|
||||||
|
import UserUsernameEditPopup from '../../UserUsernameEditPopup';
|
||||||
|
import UserEmailEditPopup from '../../UserEmailEditPopup';
|
||||||
|
import UserPasswordEditPopup from '../../UserPasswordEditPopup';
|
||||||
|
|
||||||
import styles from './AccountPane.module.scss';
|
import styles from './AccountPane.module.scss';
|
||||||
|
|
||||||
@@ -20,12 +21,14 @@ const AccountPane = React.memo(
|
|||||||
avatarUrl,
|
avatarUrl,
|
||||||
phone,
|
phone,
|
||||||
organization,
|
organization,
|
||||||
|
language,
|
||||||
isAvatarUpdating,
|
isAvatarUpdating,
|
||||||
usernameUpdateForm,
|
usernameUpdateForm,
|
||||||
emailUpdateForm,
|
emailUpdateForm,
|
||||||
passwordUpdateForm,
|
passwordUpdateForm,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
onAvatarUpdate,
|
onAvatarUpdate,
|
||||||
|
onLanguageUpdate,
|
||||||
onUsernameUpdate,
|
onUsernameUpdate,
|
||||||
onUsernameUpdateMessageDismiss,
|
onUsernameUpdateMessageDismiss,
|
||||||
onEmailUpdate,
|
onEmailUpdate,
|
||||||
@@ -41,6 +44,13 @@ const AccountPane = React.memo(
|
|||||||
});
|
});
|
||||||
}, [onUpdate]);
|
}, [onUpdate]);
|
||||||
|
|
||||||
|
const handleLanguageChange = useCallback(
|
||||||
|
(_, { value }) => {
|
||||||
|
onLanguageUpdate(value === 'auto' ? null : value); // FIXME: hack
|
||||||
|
},
|
||||||
|
[onLanguageUpdate],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tab.Pane attached={false} className={styles.wrapper}>
|
<Tab.Pane attached={false} className={styles.wrapper}>
|
||||||
<AvatarEditPopup
|
<AvatarEditPopup
|
||||||
@@ -52,7 +62,7 @@ const AccountPane = React.memo(
|
|||||||
</AvatarEditPopup>
|
</AvatarEditPopup>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<InformationEdit
|
<UserInformationEdit
|
||||||
defaultData={{
|
defaultData={{
|
||||||
name,
|
name,
|
||||||
phone,
|
phone,
|
||||||
@@ -60,6 +70,32 @@ const AccountPane = React.memo(
|
|||||||
}}
|
}}
|
||||||
onUpdate={onUpdate}
|
onUpdate={onUpdate}
|
||||||
/>
|
/>
|
||||||
|
<Divider horizontal section>
|
||||||
|
<Header as="h4">
|
||||||
|
{t('common.language', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Header>
|
||||||
|
</Divider>
|
||||||
|
<Dropdown
|
||||||
|
fluid
|
||||||
|
selection
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
key: 'auto',
|
||||||
|
value: 'auto',
|
||||||
|
text: t('common.detectAutomatically'),
|
||||||
|
},
|
||||||
|
...locales.map((locale) => ({
|
||||||
|
key: locale.language,
|
||||||
|
value: locale.language,
|
||||||
|
flag: locale.country,
|
||||||
|
text: locale.name,
|
||||||
|
})),
|
||||||
|
]}
|
||||||
|
value={language || 'auto'}
|
||||||
|
onChange={handleLanguageChange}
|
||||||
|
/>
|
||||||
<Divider horizontal section>
|
<Divider horizontal section>
|
||||||
<Header as="h4">
|
<Header as="h4">
|
||||||
{t('common.authentication', {
|
{t('common.authentication', {
|
||||||
@@ -68,7 +104,8 @@ const AccountPane = React.memo(
|
|||||||
</Header>
|
</Header>
|
||||||
</Divider>
|
</Divider>
|
||||||
<div className={styles.action}>
|
<div className={styles.action}>
|
||||||
<UsernameEditPopup
|
<UserUsernameEditPopup
|
||||||
|
usePasswordConfirmation
|
||||||
defaultData={usernameUpdateForm.data}
|
defaultData={usernameUpdateForm.data}
|
||||||
username={username}
|
username={username}
|
||||||
isSubmitting={usernameUpdateForm.isSubmitting}
|
isSubmitting={usernameUpdateForm.isSubmitting}
|
||||||
@@ -81,10 +118,11 @@ const AccountPane = React.memo(
|
|||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</UsernameEditPopup>
|
</UserUsernameEditPopup>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.action}>
|
<div className={styles.action}>
|
||||||
<EmailEditPopup
|
<UserEmailEditPopup
|
||||||
|
usePasswordConfirmation
|
||||||
defaultData={emailUpdateForm.data}
|
defaultData={emailUpdateForm.data}
|
||||||
email={email}
|
email={email}
|
||||||
isSubmitting={emailUpdateForm.isSubmitting}
|
isSubmitting={emailUpdateForm.isSubmitting}
|
||||||
@@ -97,10 +135,11 @@ const AccountPane = React.memo(
|
|||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</EmailEditPopup>
|
</UserEmailEditPopup>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.action}>
|
<div className={styles.action}>
|
||||||
<PasswordEditPopup
|
<UserPasswordEditPopup
|
||||||
|
usePasswordConfirmation
|
||||||
defaultData={passwordUpdateForm.data}
|
defaultData={passwordUpdateForm.data}
|
||||||
isSubmitting={passwordUpdateForm.isSubmitting}
|
isSubmitting={passwordUpdateForm.isSubmitting}
|
||||||
error={passwordUpdateForm.error}
|
error={passwordUpdateForm.error}
|
||||||
@@ -112,7 +151,7 @@ const AccountPane = React.memo(
|
|||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</PasswordEditPopup>
|
</UserPasswordEditPopup>
|
||||||
</div>
|
</div>
|
||||||
</Tab.Pane>
|
</Tab.Pane>
|
||||||
);
|
);
|
||||||
@@ -126,6 +165,7 @@ AccountPane.propTypes = {
|
|||||||
avatarUrl: PropTypes.string,
|
avatarUrl: PropTypes.string,
|
||||||
phone: PropTypes.string,
|
phone: PropTypes.string,
|
||||||
organization: PropTypes.string,
|
organization: PropTypes.string,
|
||||||
|
language: PropTypes.string,
|
||||||
isAvatarUpdating: PropTypes.bool.isRequired,
|
isAvatarUpdating: PropTypes.bool.isRequired,
|
||||||
/* eslint-disable react/forbid-prop-types */
|
/* eslint-disable react/forbid-prop-types */
|
||||||
usernameUpdateForm: PropTypes.object.isRequired,
|
usernameUpdateForm: PropTypes.object.isRequired,
|
||||||
@@ -134,6 +174,7 @@ AccountPane.propTypes = {
|
|||||||
/* eslint-enable react/forbid-prop-types */
|
/* eslint-enable react/forbid-prop-types */
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onAvatarUpdate: PropTypes.func.isRequired,
|
onAvatarUpdate: PropTypes.func.isRequired,
|
||||||
|
onLanguageUpdate: PropTypes.func.isRequired,
|
||||||
onUsernameUpdate: PropTypes.func.isRequired,
|
onUsernameUpdate: PropTypes.func.isRequired,
|
||||||
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
onEmailUpdate: PropTypes.func.isRequired,
|
onEmailUpdate: PropTypes.func.isRequired,
|
||||||
@@ -147,6 +188,7 @@ AccountPane.defaultProps = {
|
|||||||
avatarUrl: undefined,
|
avatarUrl: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
organization: undefined,
|
organization: undefined,
|
||||||
|
language: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AccountPane;
|
export default AccountPane;
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
:global(#app) {
|
|
||||||
.field {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,6 +14,7 @@ const UserSettingsModal = React.memo(
|
|||||||
avatarUrl,
|
avatarUrl,
|
||||||
phone,
|
phone,
|
||||||
organization,
|
organization,
|
||||||
|
language,
|
||||||
subscribeToOwnCards,
|
subscribeToOwnCards,
|
||||||
isAvatarUpdating,
|
isAvatarUpdating,
|
||||||
usernameUpdateForm,
|
usernameUpdateForm,
|
||||||
@@ -21,6 +22,7 @@ const UserSettingsModal = React.memo(
|
|||||||
passwordUpdateForm,
|
passwordUpdateForm,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
onAvatarUpdate,
|
onAvatarUpdate,
|
||||||
|
onLanguageUpdate,
|
||||||
onUsernameUpdate,
|
onUsernameUpdate,
|
||||||
onUsernameUpdateMessageDismiss,
|
onUsernameUpdateMessageDismiss,
|
||||||
onEmailUpdate,
|
onEmailUpdate,
|
||||||
@@ -44,12 +46,14 @@ const UserSettingsModal = React.memo(
|
|||||||
avatarUrl={avatarUrl}
|
avatarUrl={avatarUrl}
|
||||||
phone={phone}
|
phone={phone}
|
||||||
organization={organization}
|
organization={organization}
|
||||||
|
language={language}
|
||||||
isAvatarUpdating={isAvatarUpdating}
|
isAvatarUpdating={isAvatarUpdating}
|
||||||
usernameUpdateForm={usernameUpdateForm}
|
usernameUpdateForm={usernameUpdateForm}
|
||||||
emailUpdateForm={emailUpdateForm}
|
emailUpdateForm={emailUpdateForm}
|
||||||
passwordUpdateForm={passwordUpdateForm}
|
passwordUpdateForm={passwordUpdateForm}
|
||||||
onUpdate={onUpdate}
|
onUpdate={onUpdate}
|
||||||
onAvatarUpdate={onAvatarUpdate}
|
onAvatarUpdate={onAvatarUpdate}
|
||||||
|
onLanguageUpdate={onLanguageUpdate}
|
||||||
onUsernameUpdate={onUsernameUpdate}
|
onUsernameUpdate={onUsernameUpdate}
|
||||||
onUsernameUpdateMessageDismiss={onUsernameUpdateMessageDismiss}
|
onUsernameUpdateMessageDismiss={onUsernameUpdateMessageDismiss}
|
||||||
onEmailUpdate={onEmailUpdate}
|
onEmailUpdate={onEmailUpdate}
|
||||||
@@ -92,6 +96,7 @@ UserSettingsModal.propTypes = {
|
|||||||
avatarUrl: PropTypes.string,
|
avatarUrl: PropTypes.string,
|
||||||
phone: PropTypes.string,
|
phone: PropTypes.string,
|
||||||
organization: PropTypes.string,
|
organization: PropTypes.string,
|
||||||
|
language: PropTypes.string,
|
||||||
subscribeToOwnCards: PropTypes.bool.isRequired,
|
subscribeToOwnCards: PropTypes.bool.isRequired,
|
||||||
isAvatarUpdating: PropTypes.bool.isRequired,
|
isAvatarUpdating: PropTypes.bool.isRequired,
|
||||||
/* eslint-disable react/forbid-prop-types */
|
/* eslint-disable react/forbid-prop-types */
|
||||||
@@ -101,6 +106,7 @@ UserSettingsModal.propTypes = {
|
|||||||
/* eslint-enable react/forbid-prop-types */
|
/* eslint-enable react/forbid-prop-types */
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onAvatarUpdate: PropTypes.func.isRequired,
|
onAvatarUpdate: PropTypes.func.isRequired,
|
||||||
|
onLanguageUpdate: PropTypes.func.isRequired,
|
||||||
onUsernameUpdate: PropTypes.func.isRequired,
|
onUsernameUpdate: PropTypes.func.isRequired,
|
||||||
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
onEmailUpdate: PropTypes.func.isRequired,
|
onEmailUpdate: PropTypes.func.isRequired,
|
||||||
@@ -115,6 +121,7 @@ UserSettingsModal.defaultProps = {
|
|||||||
avatarUrl: undefined,
|
avatarUrl: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
organization: undefined,
|
organization: undefined,
|
||||||
|
language: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default UserSettingsModal;
|
export default UserSettingsModal;
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { withPopup } from '../lib/popup';
|
||||||
|
|
||||||
|
import UserUsernameEditStep from './UserUsernameEditStep';
|
||||||
|
|
||||||
|
export default withPopup(UserUsernameEditStep);
|
||||||
+35
-17
@@ -1,15 +1,15 @@
|
|||||||
|
import omit from 'lodash/omit';
|
||||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Form, Message } from 'semantic-ui-react';
|
import { Button, Form, Message } from 'semantic-ui-react';
|
||||||
import { useDidUpdate, usePrevious, useToggle } from '../../../lib/hooks';
|
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||||
import { withPopup } from '../../../lib/popup';
|
import { Input, Popup } from '../../lib/custom-ui';
|
||||||
import { Input, Popup } from '../../../lib/custom-ui';
|
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
import { isUsername } from '../../../utils/validator';
|
import { isUsername } from '../../utils/validator';
|
||||||
|
|
||||||
import styles from './UsernameEditPopup.module.scss';
|
import styles from './UserUsernameEditStep.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
@@ -35,8 +35,18 @@ const createMessage = (error) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const UsernameEditStep = React.memo(
|
const UserUsernameEditStep = React.memo(
|
||||||
({ defaultData, username, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
({
|
||||||
|
defaultData,
|
||||||
|
username,
|
||||||
|
isSubmitting,
|
||||||
|
error,
|
||||||
|
usePasswordConfirmation,
|
||||||
|
onUpdate,
|
||||||
|
onMessageDismiss,
|
||||||
|
onBack,
|
||||||
|
onClose,
|
||||||
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
|
||||||
@@ -58,7 +68,7 @@ const UsernameEditStep = React.memo(
|
|||||||
username: data.username.trim() || null,
|
username: data.username.trim() || null,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (cleanData.username && !isUsername(cleanData.username)) {
|
if (!cleanData.username || !isUsername(cleanData.username)) {
|
||||||
usernameField.current.select();
|
usernameField.current.select();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -68,16 +78,16 @@ const UsernameEditStep = React.memo(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cleanData.currentPassword) {
|
if (usePasswordConfirmation && !cleanData.currentPassword) {
|
||||||
currentPasswordField.current.focus();
|
currentPasswordField.current.focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdate(cleanData);
|
onUpdate(usePasswordConfirmation ? cleanData : omit(cleanData, 'currentPassword'));
|
||||||
}, [username, onUpdate, onClose, data]);
|
}, [username, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
usernameField.current.select();
|
usernameField.current.focus();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -110,7 +120,7 @@ const UsernameEditStep = React.memo(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Popup.Header>
|
<Popup.Header onBack={onBack}>
|
||||||
{t('common.editUsername', {
|
{t('common.editUsername', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
@@ -138,6 +148,8 @@ const UsernameEditStep = React.memo(
|
|||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
{usePasswordConfirmation && (
|
||||||
|
<>
|
||||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||||
<Input.Password
|
<Input.Password
|
||||||
fluid
|
fluid
|
||||||
@@ -147,6 +159,8 @@ const UsernameEditStep = React.memo(
|
|||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
positive
|
positive
|
||||||
content={t('action.save')}
|
content={t('action.save')}
|
||||||
@@ -160,19 +174,23 @@ const UsernameEditStep = React.memo(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
UsernameEditStep.propTypes = {
|
UserUsernameEditStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
username: PropTypes.string,
|
username: PropTypes.string,
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
usePasswordConfirmation: PropTypes.bool,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onMessageDismiss: PropTypes.func.isRequired,
|
onMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onBack: PropTypes.func,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
UsernameEditStep.defaultProps = {
|
UserUsernameEditStep.defaultProps = {
|
||||||
username: undefined,
|
username: undefined,
|
||||||
error: undefined,
|
error: undefined,
|
||||||
|
usePasswordConfirmation: false,
|
||||||
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(UsernameEditStep);
|
export default UserUsernameEditStep;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
:global(#app) {
|
||||||
|
.field {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
color: #444444;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import UserUsernameEditStep from './UserUsernameEditStep';
|
||||||
|
|
||||||
|
export default UserUsernameEditStep;
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import React, { useCallback } from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { Button, Radio, Table } from 'semantic-ui-react';
|
|
||||||
|
|
||||||
import DeletePopup from '../DeletePopup';
|
|
||||||
|
|
||||||
import styles from './Item.module.scss';
|
|
||||||
|
|
||||||
const Item = React.memo(({ name, username, email, isAdmin, onUpdate, onDelete }) => {
|
|
||||||
const [t] = useTranslation();
|
|
||||||
|
|
||||||
const handleIsAdminChange = useCallback(() => {
|
|
||||||
onUpdate({
|
|
||||||
isAdmin: !isAdmin,
|
|
||||||
});
|
|
||||||
}, [isAdmin, onUpdate]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Table.Row>
|
|
||||||
<Table.Cell>{name}</Table.Cell>
|
|
||||||
<Table.Cell>{username || '-'}</Table.Cell>
|
|
||||||
<Table.Cell>{email}</Table.Cell>
|
|
||||||
<Table.Cell collapsing>
|
|
||||||
<Radio toggle checked={isAdmin} onChange={handleIsAdminChange} />
|
|
||||||
</Table.Cell>
|
|
||||||
<Table.Cell collapsing>
|
|
||||||
<DeletePopup
|
|
||||||
title={t('common.deleteUser', {
|
|
||||||
context: 'title',
|
|
||||||
})}
|
|
||||||
content={t('common.areYouSureYouWantToDeleteThisUser')}
|
|
||||||
buttonContent={t('action.deleteUser')}
|
|
||||||
onConfirm={onDelete}
|
|
||||||
>
|
|
||||||
<Button content={t('action.delete')} className={styles.button} />
|
|
||||||
</DeletePopup>
|
|
||||||
</Table.Cell>
|
|
||||||
</Table.Row>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
Item.propTypes = {
|
|
||||||
name: PropTypes.string.isRequired,
|
|
||||||
username: PropTypes.string,
|
|
||||||
email: PropTypes.string.isRequired,
|
|
||||||
isAdmin: PropTypes.bool.isRequired,
|
|
||||||
onUpdate: PropTypes.func.isRequired,
|
|
||||||
onDelete: PropTypes.func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
Item.defaultProps = {
|
|
||||||
username: undefined,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Item;
|
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
import pick from 'lodash/pick';
|
||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Menu } from 'semantic-ui-react';
|
||||||
|
import { withPopup } from '../../../lib/popup';
|
||||||
|
import { Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
|
import { useSteps } from '../../../hooks';
|
||||||
|
import UserInformationEditStep from '../../UserInformationEditStep';
|
||||||
|
import UserUsernameEditStep from '../../UserUsernameEditStep';
|
||||||
|
import UserEmailEditStep from '../../UserEmailEditStep';
|
||||||
|
import UserPasswordEditStep from '../../UserPasswordEditStep';
|
||||||
|
import DeleteStep from '../../DeleteStep';
|
||||||
|
|
||||||
|
import styles from './ActionsPopup.module.scss';
|
||||||
|
|
||||||
|
const StepTypes = {
|
||||||
|
EDIT_INFORMATION: 'EDIT_INFORMATION',
|
||||||
|
EDIT_USERNAME: 'EDIT_USERNAME',
|
||||||
|
EDIT_EMAIL: 'EDIT_EMAIL',
|
||||||
|
EDIT_PASSWORD: 'EDIT_PASSWORD',
|
||||||
|
DELETE: 'DELETE',
|
||||||
|
};
|
||||||
|
|
||||||
|
const ActionsStep = React.memo(
|
||||||
|
({
|
||||||
|
user,
|
||||||
|
onUpdate,
|
||||||
|
onUsernameUpdate,
|
||||||
|
onUsernameUpdateMessageDismiss,
|
||||||
|
onEmailUpdate,
|
||||||
|
onEmailUpdateMessageDismiss,
|
||||||
|
onPasswordUpdate,
|
||||||
|
onPasswordUpdateMessageDismiss,
|
||||||
|
onDelete,
|
||||||
|
onClose,
|
||||||
|
}) => {
|
||||||
|
const [t] = useTranslation();
|
||||||
|
const [step, openStep, handleBack] = useSteps();
|
||||||
|
|
||||||
|
const handleEditInformationClick = useCallback(() => {
|
||||||
|
openStep(StepTypes.EDIT_INFORMATION);
|
||||||
|
}, [openStep]);
|
||||||
|
|
||||||
|
const handleEditUsernameClick = useCallback(() => {
|
||||||
|
openStep(StepTypes.EDIT_USERNAME);
|
||||||
|
}, [openStep]);
|
||||||
|
|
||||||
|
const handleEditEmailClick = useCallback(() => {
|
||||||
|
openStep(StepTypes.EDIT_EMAIL);
|
||||||
|
}, [openStep]);
|
||||||
|
|
||||||
|
const handleEditPasswordClick = useCallback(() => {
|
||||||
|
openStep(StepTypes.EDIT_PASSWORD);
|
||||||
|
}, [openStep]);
|
||||||
|
|
||||||
|
const handleDeleteClick = useCallback(() => {
|
||||||
|
openStep(StepTypes.DELETE);
|
||||||
|
}, [openStep]);
|
||||||
|
|
||||||
|
if (step) {
|
||||||
|
switch (step.type) {
|
||||||
|
case StepTypes.EDIT_INFORMATION:
|
||||||
|
return (
|
||||||
|
<UserInformationEditStep
|
||||||
|
defaultData={pick(user, ['name', 'phone', 'organization'])}
|
||||||
|
onUpdate={onUpdate}
|
||||||
|
onBack={handleBack}
|
||||||
|
onClose={onClose}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case StepTypes.EDIT_USERNAME:
|
||||||
|
return (
|
||||||
|
<UserUsernameEditStep
|
||||||
|
defaultData={user.usernameUpdateForm.data}
|
||||||
|
username={user.username}
|
||||||
|
isSubmitting={user.usernameUpdateForm.isSubmitting}
|
||||||
|
error={user.usernameUpdateForm.error}
|
||||||
|
onUpdate={onUsernameUpdate}
|
||||||
|
onMessageDismiss={onUsernameUpdateMessageDismiss}
|
||||||
|
onBack={handleBack}
|
||||||
|
onClose={onClose}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case StepTypes.EDIT_EMAIL:
|
||||||
|
return (
|
||||||
|
<UserEmailEditStep
|
||||||
|
defaultData={user.emailUpdateForm.data}
|
||||||
|
email={user.email}
|
||||||
|
isSubmitting={user.emailUpdateForm.isSubmitting}
|
||||||
|
error={user.emailUpdateForm.error}
|
||||||
|
onUpdate={onEmailUpdate}
|
||||||
|
onMessageDismiss={onEmailUpdateMessageDismiss}
|
||||||
|
onBack={handleBack}
|
||||||
|
onClose={onClose}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case StepTypes.EDIT_PASSWORD:
|
||||||
|
return (
|
||||||
|
<UserPasswordEditStep
|
||||||
|
defaultData={user.passwordUpdateForm.data}
|
||||||
|
isSubmitting={user.passwordUpdateForm.isSubmitting}
|
||||||
|
error={user.emailUpdateForm.error}
|
||||||
|
onUpdate={onPasswordUpdate}
|
||||||
|
onMessageDismiss={onPasswordUpdateMessageDismiss}
|
||||||
|
onBack={handleBack}
|
||||||
|
onClose={onClose}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case StepTypes.DELETE:
|
||||||
|
return (
|
||||||
|
<DeleteStep
|
||||||
|
title={t('common.deleteUser', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
content={t('common.areYouSureYouWantToDeleteThisUser')}
|
||||||
|
buttonContent={t('action.deleteUser')}
|
||||||
|
onConfirm={onDelete}
|
||||||
|
onBack={handleBack}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Popup.Header>
|
||||||
|
{t('common.userActions', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Popup.Header>
|
||||||
|
<Popup.Content>
|
||||||
|
<Menu secondary vertical className={styles.menu}>
|
||||||
|
<Menu.Item className={styles.menuItem} onClick={handleEditInformationClick}>
|
||||||
|
{t('action.editInformation', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item className={styles.menuItem} onClick={handleEditUsernameClick}>
|
||||||
|
{t('action.editUsername', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item className={styles.menuItem} onClick={handleEditEmailClick}>
|
||||||
|
{t('action.editEmail', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item className={styles.menuItem} onClick={handleEditPasswordClick}>
|
||||||
|
{t('action.editPassword', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item className={styles.menuItem} onClick={handleDeleteClick}>
|
||||||
|
{t('action.deleteUser', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
</Popup.Content>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
ActionsStep.propTypes = {
|
||||||
|
user: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
onUpdate: PropTypes.func.isRequired,
|
||||||
|
onUsernameUpdate: PropTypes.func.isRequired,
|
||||||
|
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onEmailUpdate: PropTypes.func.isRequired,
|
||||||
|
onEmailUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onPasswordUpdate: PropTypes.func.isRequired,
|
||||||
|
onPasswordUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onDelete: PropTypes.func.isRequired,
|
||||||
|
onClose: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default withPopup(ActionsStep);
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
:global(#app) {
|
||||||
|
.menu {
|
||||||
|
margin: -7px -12px -5px;
|
||||||
|
width: calc(100% + 24px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuItem {
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
+103
@@ -0,0 +1,103 @@
|
|||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { Button, Icon, Radio, Table } from 'semantic-ui-react';
|
||||||
|
|
||||||
|
import ActionsPopup from './ActionsPopup';
|
||||||
|
|
||||||
|
import styles from './Item.module.scss';
|
||||||
|
|
||||||
|
const Item = React.memo(
|
||||||
|
({
|
||||||
|
email,
|
||||||
|
username,
|
||||||
|
name,
|
||||||
|
organization,
|
||||||
|
phone,
|
||||||
|
isAdmin,
|
||||||
|
emailUpdateForm,
|
||||||
|
passwordUpdateForm,
|
||||||
|
usernameUpdateForm,
|
||||||
|
onUpdate,
|
||||||
|
onUsernameUpdate,
|
||||||
|
onUsernameUpdateMessageDismiss,
|
||||||
|
onEmailUpdate,
|
||||||
|
onEmailUpdateMessageDismiss,
|
||||||
|
onPasswordUpdate,
|
||||||
|
onPasswordUpdateMessageDismiss,
|
||||||
|
onDelete,
|
||||||
|
}) => {
|
||||||
|
const handleIsAdminChange = useCallback(() => {
|
||||||
|
onUpdate({
|
||||||
|
isAdmin: !isAdmin,
|
||||||
|
});
|
||||||
|
}, [isAdmin, onUpdate]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Table.Row>
|
||||||
|
<Table.Cell>{name}</Table.Cell>
|
||||||
|
<Table.Cell>{username || '-'}</Table.Cell>
|
||||||
|
<Table.Cell>{email}</Table.Cell>
|
||||||
|
<Table.Cell collapsing>
|
||||||
|
<Radio toggle checked={isAdmin} onChange={handleIsAdminChange} />
|
||||||
|
</Table.Cell>
|
||||||
|
<Table.Cell collapsing>
|
||||||
|
<ActionsPopup
|
||||||
|
user={{
|
||||||
|
email,
|
||||||
|
username,
|
||||||
|
name,
|
||||||
|
organization,
|
||||||
|
phone,
|
||||||
|
isAdmin,
|
||||||
|
emailUpdateForm,
|
||||||
|
passwordUpdateForm,
|
||||||
|
usernameUpdateForm,
|
||||||
|
}}
|
||||||
|
onUpdate={onUpdate}
|
||||||
|
onUsernameUpdate={onUsernameUpdate}
|
||||||
|
onUsernameUpdateMessageDismiss={onUsernameUpdateMessageDismiss}
|
||||||
|
onEmailUpdate={onEmailUpdate}
|
||||||
|
onEmailUpdateMessageDismiss={onEmailUpdateMessageDismiss}
|
||||||
|
onPasswordUpdate={onPasswordUpdate}
|
||||||
|
onPasswordUpdateMessageDismiss={onPasswordUpdateMessageDismiss}
|
||||||
|
onDelete={onDelete}
|
||||||
|
>
|
||||||
|
<Button className={styles.button}>
|
||||||
|
<Icon fitted name="pencil" />
|
||||||
|
</Button>
|
||||||
|
</ActionsPopup>
|
||||||
|
</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
Item.propTypes = {
|
||||||
|
email: PropTypes.string.isRequired,
|
||||||
|
username: PropTypes.string,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
organization: PropTypes.string,
|
||||||
|
phone: PropTypes.string,
|
||||||
|
isAdmin: PropTypes.bool.isRequired,
|
||||||
|
/* eslint-disable react/forbid-prop-types */
|
||||||
|
emailUpdateForm: PropTypes.object.isRequired,
|
||||||
|
passwordUpdateForm: PropTypes.object.isRequired,
|
||||||
|
usernameUpdateForm: PropTypes.object.isRequired,
|
||||||
|
/* eslint-enable react/forbid-prop-types */
|
||||||
|
onUpdate: PropTypes.func.isRequired,
|
||||||
|
onUsernameUpdate: PropTypes.func.isRequired,
|
||||||
|
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onEmailUpdate: PropTypes.func.isRequired,
|
||||||
|
onEmailUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onPasswordUpdate: PropTypes.func.isRequired,
|
||||||
|
onPasswordUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onDelete: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
Item.defaultProps = {
|
||||||
|
username: undefined,
|
||||||
|
organization: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Item;
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import Item from './Item';
|
||||||
|
|
||||||
|
export default Item;
|
||||||
@@ -6,7 +6,19 @@ import { Button, Modal, Table } from 'semantic-ui-react';
|
|||||||
import UserAddPopupContainer from '../../containers/UserAddPopupContainer';
|
import UserAddPopupContainer from '../../containers/UserAddPopupContainer';
|
||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
|
|
||||||
const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
const UsersModal = React.memo(
|
||||||
|
({
|
||||||
|
items,
|
||||||
|
onUpdate,
|
||||||
|
onUsernameUpdate,
|
||||||
|
onUsernameUpdateMessageDismiss,
|
||||||
|
onEmailUpdate,
|
||||||
|
onEmailUpdateMessageDismiss,
|
||||||
|
onPasswordUpdate,
|
||||||
|
onPasswordUpdateMessageDismiss,
|
||||||
|
onDelete,
|
||||||
|
onClose,
|
||||||
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const handleUpdate = useCallback(
|
const handleUpdate = useCallback(
|
||||||
@@ -16,6 +28,48 @@ const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
|||||||
[onUpdate],
|
[onUpdate],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleUsernameUpdate = useCallback(
|
||||||
|
(id, data) => {
|
||||||
|
onUsernameUpdate(id, data);
|
||||||
|
},
|
||||||
|
[onUsernameUpdate],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleUsernameUpdateMessageDismiss = useCallback(
|
||||||
|
(id) => {
|
||||||
|
onUsernameUpdateMessageDismiss(id);
|
||||||
|
},
|
||||||
|
[onUsernameUpdateMessageDismiss],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleEmailUpdate = useCallback(
|
||||||
|
(id, data) => {
|
||||||
|
onEmailUpdate(id, data);
|
||||||
|
},
|
||||||
|
[onEmailUpdate],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleEmailUpdateMessageDismiss = useCallback(
|
||||||
|
(id) => {
|
||||||
|
onEmailUpdateMessageDismiss(id);
|
||||||
|
},
|
||||||
|
[onEmailUpdateMessageDismiss],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlePasswordUpdate = useCallback(
|
||||||
|
(id, data) => {
|
||||||
|
onPasswordUpdate(id, data);
|
||||||
|
},
|
||||||
|
[onPasswordUpdate],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlePasswordUpdateMessageDismiss = useCallback(
|
||||||
|
(id) => {
|
||||||
|
onPasswordUpdateMessageDismiss(id);
|
||||||
|
},
|
||||||
|
[onPasswordUpdateMessageDismiss],
|
||||||
|
);
|
||||||
|
|
||||||
const handleDelete = useCallback(
|
const handleDelete = useCallback(
|
||||||
(id) => {
|
(id) => {
|
||||||
onDelete(id);
|
onDelete(id);
|
||||||
@@ -45,11 +99,22 @@ const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
|||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<Item
|
<Item
|
||||||
key={item.id}
|
key={item.id}
|
||||||
name={item.name}
|
|
||||||
username={item.username}
|
|
||||||
email={item.email}
|
email={item.email}
|
||||||
|
username={item.username}
|
||||||
|
name={item.name}
|
||||||
|
organization={item.organization}
|
||||||
|
phone={item.phone}
|
||||||
isAdmin={item.isAdmin}
|
isAdmin={item.isAdmin}
|
||||||
|
emailUpdateForm={item.emailUpdateForm}
|
||||||
|
passwordUpdateForm={item.passwordUpdateForm}
|
||||||
|
usernameUpdateForm={item.usernameUpdateForm}
|
||||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||||
|
onUsernameUpdate={(data) => handleUsernameUpdate(item.id, data)}
|
||||||
|
onUsernameUpdateMessageDismiss={() => handleUsernameUpdateMessageDismiss(item.id)}
|
||||||
|
onEmailUpdate={(data) => handleEmailUpdate(item.id, data)}
|
||||||
|
onEmailUpdateMessageDismiss={() => handleEmailUpdateMessageDismiss(item.id)}
|
||||||
|
onPasswordUpdate={(data) => handlePasswordUpdate(item.id, data)}
|
||||||
|
onPasswordUpdateMessageDismiss={() => handlePasswordUpdateMessageDismiss(item.id)}
|
||||||
onDelete={() => handleDelete(item.id)}
|
onDelete={() => handleDelete(item.id)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -63,11 +128,18 @@ const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
|||||||
</Modal.Actions>
|
</Modal.Actions>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
UsersModal.propTypes = {
|
UsersModal.propTypes = {
|
||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
|
onUsernameUpdate: PropTypes.func.isRequired,
|
||||||
|
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onEmailUpdate: PropTypes.func.isRequired,
|
||||||
|
onEmailUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
onPasswordUpdate: PropTypes.func.isRequired,
|
||||||
|
onPasswordUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -225,6 +225,9 @@ export default {
|
|||||||
ACTIONS_FETCH: 'ACTIONS_FETCH',
|
ACTIONS_FETCH: 'ACTIONS_FETCH',
|
||||||
ACTIONS_FETCH__SUCCESS: 'ACTIONS_FETCH__SUCCESS',
|
ACTIONS_FETCH__SUCCESS: 'ACTIONS_FETCH__SUCCESS',
|
||||||
ACTIONS_FETCH__FAILURE: 'ACTIONS_FETCH__FAILURE',
|
ACTIONS_FETCH__FAILURE: 'ACTIONS_FETCH__FAILURE',
|
||||||
|
ACTIONS_DETAILS_TOGGLE: 'ACTIONS_DETAILS_TOGGLE',
|
||||||
|
ACTIONS_DETAILS_TOGGLE__SUCCESS: 'ACTIONS_DETAILS_TOGGLE__SUCCESS',
|
||||||
|
ACTIONS_DETAILS_TOGGLE__FAILURE: 'ACTIONS_DETAILS_TOGGLE__FAILURE',
|
||||||
|
|
||||||
/* Action */
|
/* Action */
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,24 @@ const SERVER_BASE_URL =
|
|||||||
process.env.REACT_APP_SERVER_BASE_URL ||
|
process.env.REACT_APP_SERVER_BASE_URL ||
|
||||||
(process.env.NODE_ENV === 'production' ? '' : 'http://localhost:1337');
|
(process.env.NODE_ENV === 'production' ? '' : 'http://localhost:1337');
|
||||||
|
|
||||||
const POSITION_GAP = 65535;
|
const FETCH_OPTIONS =
|
||||||
|
process.env.NODE_ENV === 'production'
|
||||||
|
? undefined
|
||||||
|
: {
|
||||||
|
credentials: 'include',
|
||||||
|
};
|
||||||
|
|
||||||
const ACTIONS_LIMIT = 10;
|
const ACCESS_TOKEN_KEY = 'accessToken';
|
||||||
|
const ACCESS_TOKEN_EXPIRES = 365;
|
||||||
|
|
||||||
|
const POSITION_GAP = 65535;
|
||||||
|
const ACTIONS_LIMIT = 50;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
SERVER_BASE_URL,
|
SERVER_BASE_URL,
|
||||||
|
FETCH_OPTIONS,
|
||||||
|
ACCESS_TOKEN_KEY,
|
||||||
|
ACCESS_TOKEN_EXPIRES,
|
||||||
POSITION_GAP,
|
POSITION_GAP,
|
||||||
ACTIONS_LIMIT,
|
ACTIONS_LIMIT,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
const BOARD = 'BOARD';
|
const BOARD = 'BOARD';
|
||||||
const LIST = 'LIST';
|
const LIST = 'LIST';
|
||||||
const CARD = 'CARD';
|
const CARD = 'CARD';
|
||||||
|
const TASK = 'TASK';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
BOARD,
|
BOARD,
|
||||||
LIST,
|
LIST,
|
||||||
CARD,
|
CARD,
|
||||||
|
TASK,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,11 +31,18 @@ export default {
|
|||||||
USER_UPDATE: `${PREFIX}/USER_UPDATE`,
|
USER_UPDATE: `${PREFIX}/USER_UPDATE`,
|
||||||
CURRENT_USER_UPDATE: `${PREFIX}/CURRENT_USER_UPDATE`,
|
CURRENT_USER_UPDATE: `${PREFIX}/CURRENT_USER_UPDATE`,
|
||||||
USER_UPDATE_HANDLE: `${PREFIX}/USER_UPDATE_HANDLE`,
|
USER_UPDATE_HANDLE: `${PREFIX}/USER_UPDATE_HANDLE`,
|
||||||
|
CURRENT_USER_LANGUAGE_UPDATE: `${PREFIX}/CURRENT_USER_LANGUAGE_UPDATE`,
|
||||||
|
USER_EMAIL_UPDATE: `${PREFIX}/USER_EMAIL_UPDATE`,
|
||||||
CURRENT_USER_EMAIL_UPDATE: `${PREFIX}/CURRENT_USER_EMAIL_UPDATE`,
|
CURRENT_USER_EMAIL_UPDATE: `${PREFIX}/CURRENT_USER_EMAIL_UPDATE`,
|
||||||
|
USER_EMAIL_UPDATE_ERROR_CLEAR: `${PREFIX}/USER_EMAIL_UPDATE_ERROR_CLEAR`,
|
||||||
CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR: `${PREFIX}/CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR`,
|
CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR: `${PREFIX}/CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR`,
|
||||||
|
USER_PASSWORD_UPDATE: `${PREFIX}/USER_PASSWORD_UPDATE`,
|
||||||
CURRENT_USER_PASSWORD_UPDATE: `${PREFIX}/CURRENT_USER_PASSWORD_UPDATE`,
|
CURRENT_USER_PASSWORD_UPDATE: `${PREFIX}/CURRENT_USER_PASSWORD_UPDATE`,
|
||||||
|
USER_PASSWORD_UPDATE_ERROR_CLEAR: `${PREFIX}/USER_PASSWORD_UPDATE_ERROR_CLEAR`,
|
||||||
CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR: `${PREFIX}/CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR`,
|
CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR: `${PREFIX}/CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR`,
|
||||||
|
USER_USERNAME_UPDATE: `${PREFIX}/USER_USERNAME_UPDATE`,
|
||||||
CURRENT_USER_USERNAME_UPDATE: `${PREFIX}/CURRENT_USER_USERNAME_UPDATE`,
|
CURRENT_USER_USERNAME_UPDATE: `${PREFIX}/CURRENT_USER_USERNAME_UPDATE`,
|
||||||
|
USER_USERNAME_UPDATE_ERROR_CLEAR: `${PREFIX}/USER_USERNAME_UPDATE_ERROR_CLEAR`,
|
||||||
CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR: `${PREFIX}/CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR`,
|
CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR: `${PREFIX}/CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR`,
|
||||||
CURRENT_USER_AVATAR_UPDATE: `${PREFIX}/CURRENT_USER_AVATAR_UPDATE`,
|
CURRENT_USER_AVATAR_UPDATE: `${PREFIX}/CURRENT_USER_AVATAR_UPDATE`,
|
||||||
USER_DELETE: `${PREFIX}/USER_DELETE`,
|
USER_DELETE: `${PREFIX}/USER_DELETE`,
|
||||||
@@ -132,6 +139,7 @@ export default {
|
|||||||
TASK_CREATE_HANDLE: `${PREFIX}/TASK_CREATE_HANDLE`,
|
TASK_CREATE_HANDLE: `${PREFIX}/TASK_CREATE_HANDLE`,
|
||||||
TASK_UPDATE: `${PREFIX}/TASK_UPDATE`,
|
TASK_UPDATE: `${PREFIX}/TASK_UPDATE`,
|
||||||
TASK_UPDATE_HANDLE: `${PREFIX}/TASK_UPDATE_HANDLE`,
|
TASK_UPDATE_HANDLE: `${PREFIX}/TASK_UPDATE_HANDLE`,
|
||||||
|
TASK_MOVE: `${PREFIX}/TASK_MOVE`,
|
||||||
TASK_DELETE: `${PREFIX}/TASK_DELETE`,
|
TASK_DELETE: `${PREFIX}/TASK_DELETE`,
|
||||||
TASK_DELETE_HANDLE: `${PREFIX}/TASK_DELETE_HANDLE`,
|
TASK_DELETE_HANDLE: `${PREFIX}/TASK_DELETE_HANDLE`,
|
||||||
|
|
||||||
@@ -147,6 +155,7 @@ export default {
|
|||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
ACTIONS_IN_CURRENT_CARD_FETCH: `${PREFIX}/ACTIONS_IN_CURRENT_CARD_FETCH`,
|
ACTIONS_IN_CURRENT_CARD_FETCH: `${PREFIX}/ACTIONS_IN_CURRENT_CARD_FETCH`,
|
||||||
|
ACTIONS_DETAILS_IN_CURRENT_CARD_TOGGLE: `${PREFIX}/ACTIONS_DETAILS_IN_CURRENT_CARD_TOGGLE`,
|
||||||
|
|
||||||
/* Action */
|
/* Action */
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,10 @@ import {
|
|||||||
fetchActionsInCurrentCard,
|
fetchActionsInCurrentCard,
|
||||||
fetchBoard,
|
fetchBoard,
|
||||||
moveCurrentCard,
|
moveCurrentCard,
|
||||||
|
moveTask,
|
||||||
removeLabelFromCurrentCard,
|
removeLabelFromCurrentCard,
|
||||||
removeUserFromCurrentCard,
|
removeUserFromCurrentCard,
|
||||||
|
toggleActionsDetailsInCurrentCard,
|
||||||
transferCurrentCard,
|
transferCurrentCard,
|
||||||
updateAttachment,
|
updateAttachment,
|
||||||
updateCommentAction,
|
updateCommentAction,
|
||||||
@@ -59,6 +61,8 @@ const mapStateToProps = (state) => {
|
|||||||
timer,
|
timer,
|
||||||
isSubscribed,
|
isSubscribed,
|
||||||
isActionsFetching,
|
isActionsFetching,
|
||||||
|
isActionsDetailsVisible,
|
||||||
|
isActionsDetailsFetching,
|
||||||
isAllActionsFetched,
|
isAllActionsFetched,
|
||||||
boardId,
|
boardId,
|
||||||
listId,
|
listId,
|
||||||
@@ -78,6 +82,8 @@ const mapStateToProps = (state) => {
|
|||||||
isSubscribed,
|
isSubscribed,
|
||||||
isActionsFetching,
|
isActionsFetching,
|
||||||
isAllActionsFetched,
|
isAllActionsFetched,
|
||||||
|
isActionsDetailsVisible,
|
||||||
|
isActionsDetailsFetching,
|
||||||
listId,
|
listId,
|
||||||
boardId,
|
boardId,
|
||||||
projectId,
|
projectId,
|
||||||
@@ -111,11 +117,13 @@ const mapDispatchToProps = (dispatch) =>
|
|||||||
onLabelDelete: deleteLabel,
|
onLabelDelete: deleteLabel,
|
||||||
onTaskCreate: createTaskInCurrentCard,
|
onTaskCreate: createTaskInCurrentCard,
|
||||||
onTaskUpdate: updateTask,
|
onTaskUpdate: updateTask,
|
||||||
|
onTaskMove: moveTask,
|
||||||
onTaskDelete: deleteTask,
|
onTaskDelete: deleteTask,
|
||||||
onAttachmentCreate: createAttachmentInCurrentCard,
|
onAttachmentCreate: createAttachmentInCurrentCard,
|
||||||
onAttachmentUpdate: updateAttachment,
|
onAttachmentUpdate: updateAttachment,
|
||||||
onAttachmentDelete: deleteAttachment,
|
onAttachmentDelete: deleteAttachment,
|
||||||
onActionsFetch: fetchActionsInCurrentCard,
|
onActionsFetch: fetchActionsInCurrentCard,
|
||||||
|
onActionsDetailsToggle: toggleActionsDetailsInCurrentCard,
|
||||||
onCommentActionCreate: createCommentActionInCurrentCard,
|
onCommentActionCreate: createCommentActionInCurrentCard,
|
||||||
onCommentActionUpdate: updateCommentAction,
|
onCommentActionUpdate: updateCommentAction,
|
||||||
onCommentActionDelete: deleteCommentAction,
|
onCommentActionDelete: deleteCommentAction,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
updateCurrentUser,
|
updateCurrentUser,
|
||||||
updateCurrentUserAvatar,
|
updateCurrentUserAvatar,
|
||||||
updateCurrentUserEmail,
|
updateCurrentUserEmail,
|
||||||
|
updateCurrentUserLanguage,
|
||||||
updateCurrentUserPassword,
|
updateCurrentUserPassword,
|
||||||
updateCurrentUserUsername,
|
updateCurrentUserUsername,
|
||||||
} from '../actions/entry';
|
} from '../actions/entry';
|
||||||
@@ -23,6 +24,7 @@ const mapStateToProps = (state) => {
|
|||||||
avatarUrl,
|
avatarUrl,
|
||||||
phone,
|
phone,
|
||||||
organization,
|
organization,
|
||||||
|
language,
|
||||||
subscribeToOwnCards,
|
subscribeToOwnCards,
|
||||||
isAvatarUpdating,
|
isAvatarUpdating,
|
||||||
emailUpdateForm,
|
emailUpdateForm,
|
||||||
@@ -37,6 +39,7 @@ const mapStateToProps = (state) => {
|
|||||||
avatarUrl,
|
avatarUrl,
|
||||||
phone,
|
phone,
|
||||||
organization,
|
organization,
|
||||||
|
language,
|
||||||
subscribeToOwnCards,
|
subscribeToOwnCards,
|
||||||
isAvatarUpdating,
|
isAvatarUpdating,
|
||||||
emailUpdateForm,
|
emailUpdateForm,
|
||||||
@@ -50,6 +53,7 @@ const mapDispatchToProps = (dispatch) =>
|
|||||||
{
|
{
|
||||||
onUpdate: updateCurrentUser,
|
onUpdate: updateCurrentUser,
|
||||||
onAvatarUpdate: updateCurrentUserAvatar,
|
onAvatarUpdate: updateCurrentUserAvatar,
|
||||||
|
onLanguageUpdate: updateCurrentUserLanguage,
|
||||||
onUsernameUpdate: updateCurrentUserUsername,
|
onUsernameUpdate: updateCurrentUserUsername,
|
||||||
onUsernameUpdateMessageDismiss: clearCurrentUserUsernameUpdateError,
|
onUsernameUpdateMessageDismiss: clearCurrentUserUsernameUpdateError,
|
||||||
onEmailUpdate: updateCurrentUserEmail,
|
onEmailUpdate: updateCurrentUserEmail,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user