Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac1df5201d | ||
|
|
fbe24c0fc0 | ||
|
|
79daed6afa | ||
|
|
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 |
@@ -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
|
||||
docker-compose.override.yml
|
||||
|
||||
.idea
|
||||
.vscode
|
||||
.DS_Store
|
||||
|
||||
@@ -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.
|
||||
+5
-30
@@ -10,52 +10,27 @@ RUN npm install npm@latest --global \
|
||||
COPY client .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:lts-alpine
|
||||
FROM ghcr.io/plankanban/planka:base-latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY server/.npmrc server/package.json server/package-lock.json ./
|
||||
|
||||
ARG ALPINE_VERSION=3.15
|
||||
ARG VIPS_VERSION=8.12.2
|
||||
|
||||
RUN apk -U upgrade \
|
||||
&& apk add \
|
||||
bash giflib glib lcms2 libexif \
|
||||
libgsf libjpeg-turbo libpng librsvg libwebp \
|
||||
orc pango tiff \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/community/ \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/main/ \
|
||||
--no-cache \
|
||||
&& apk add \
|
||||
build-base giflib-dev glib-dev lcms2-dev libexif-dev \
|
||||
libgsf-dev libjpeg-turbo-dev libpng-dev librsvg-dev libwebp-dev \
|
||||
orc-dev pango-dev tiff-dev \
|
||||
--virtual vips-dependencies \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/community/ \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/v${ALPINE_VERSION}/main/ \
|
||||
--no-cache \
|
||||
&& wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp \
|
||||
&& cd /tmp/vips-${VIPS_VERSION} \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install-strip \
|
||||
&& cd $OLDPWD \
|
||||
&& rm -rf /tmp/vips-${VIPS_VERSION} \
|
||||
&& npm install npm@latest --global \
|
||||
RUN npm install npm@latest --global \
|
||||
&& npm install --production \
|
||||
&& apk del vips-dependencies --purge
|
||||
|
||||
COPY docker-start.sh start.sh
|
||||
RUN chmod +x start.sh
|
||||
COPY server .
|
||||
|
||||
RUN cp .env.sample .env
|
||||
|
||||
COPY --from=client-builder /app/build public
|
||||
COPY --from=client-builder /app/build/index.html views
|
||||
|
||||
VOLUME /app/public/user-avatars
|
||||
VOLUME /app/public/project-background-images
|
||||
VOLUME /app/public/attachments
|
||||
VOLUME /app/private/attachments
|
||||
|
||||
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}
|
||||
@@ -61,7 +61,7 @@ Either use a local database or start the provided development database:
|
||||
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
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Most recent release.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please report any security issues you discovered to meltyshev@gmail.com. If the issue is confirmed, we will release a patch as soon as possible depending on complexity.
|
||||
|
||||
**Do NOT create public issues on GitHub for security vulnerabilities.**
|
||||
|
||||
Thank you for your contribution!
|
||||
Generated
+9709
-6062
File diff suppressed because it is too large
Load Diff
+26
-22
@@ -63,56 +63,60 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6",
|
||||
"connected-react-router": "^6.9.2",
|
||||
"date-fns": "^2.28.0",
|
||||
"dequal": "^2.0.2",
|
||||
"classnames": "^2.3.1",
|
||||
"connected-react-router": "^6.9.3",
|
||||
"date-fns": "^2.29.1",
|
||||
"dequal": "^2.0.3",
|
||||
"history": "^4.10.1",
|
||||
"i18next": "^21.6.16",
|
||||
"i18next": "^21.8.14",
|
||||
"i18next-browser-languagedetector": "^6.1.4",
|
||||
"initials": "^3.1.2",
|
||||
"lodash": "^4.17.20",
|
||||
"js-cookie": "^3.0.1",
|
||||
"lodash": "^4.17.21",
|
||||
"node-sass": "^7.0.1",
|
||||
"photoswipe": "^5.3.0",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^17.0.2",
|
||||
"react-beautiful-dnd": "^13.0.0",
|
||||
"react-datepicker": "^4.7.0",
|
||||
"react-beautiful-dnd": "^13.1.0",
|
||||
"react-datepicker": "^4.8.0",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dropzone": "^12.0.5",
|
||||
"react-i18next": "^11.16.6",
|
||||
"react-dropzone": "^14.2.2",
|
||||
"react-i18next": "^11.18.1",
|
||||
"react-input-mask": "^2.0.4",
|
||||
"react-markdown": "^8.0.2",
|
||||
"react-markdown": "^8.0.3",
|
||||
"react-photoswipe-gallery": "^2.2.1",
|
||||
"react-redux": "^7.2.8",
|
||||
"react-router-dom": "^5.3.1",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-textarea-autosize": "^8.3.3",
|
||||
"redux": "^4.1.2",
|
||||
"react-textarea-autosize": "^8.3.4",
|
||||
"redux": "^4.2.0",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-orm": "^0.16.2",
|
||||
"redux-saga": "^1.1.3",
|
||||
"remark-breaks": "^3.0.2",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"reselect": "^4.1.5",
|
||||
"reselect": "^4.1.6",
|
||||
"sails.io.js": "^1.2.1",
|
||||
"semantic-ui-react": "^2.1.2",
|
||||
"semantic-ui-react": "^2.1.3",
|
||||
"socket.io-client": "^2.3.1",
|
||||
"validator": "^13.7.0",
|
||||
"whatwg-fetch": "^3.5.0"
|
||||
"whatwg-fetch": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
|
||||
"babel-preset-airbnb": "^5.0.0",
|
||||
"chai": "^4.3.6",
|
||||
"enzyme": "^3.11.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint": "^8.20.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.29.4",
|
||||
"eslint-plugin-react-hooks": "^4.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"jest-enzyme": "^7.1.2",
|
||||
"prettier": "2.6.2",
|
||||
"prettier": "2.7.1",
|
||||
"react-test-renderer": "^17.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const fetchActions = (cardId) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH,
|
||||
payload: {
|
||||
@@ -24,3 +23,28 @@ fetchActions.failure = (cardId, 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';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const fetchActionsInCurrentCard = () => ({
|
||||
type: EntryActionTypes.ACTIONS_IN_CURRENT_CARD_FETCH,
|
||||
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) => ({
|
||||
type: EntryActionTypes.TASK_DELETE,
|
||||
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) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
||||
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 = () => ({
|
||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateUserPassword = (id, data) => ({
|
||||
type: EntryActionTypes.USER_PASSWORD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUserPassword = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
||||
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 = () => ({
|
||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const updateUserUsername = (id, data) => ({
|
||||
type: EntryActionTypes.USER_USERNAME_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUserUsername = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE,
|
||||
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 = () => ({
|
||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
|
||||
@@ -2,7 +2,7 @@ import http from './http';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createAccessToken = (data, headers) => http.post('/access-tokens', data, headers);
|
||||
const createAccessToken = (data) => http.post('/access-tokens', data);
|
||||
|
||||
export default {
|
||||
createAccessToken,
|
||||
|
||||
@@ -9,8 +9,8 @@ export const transformAction = (action) => ({
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getActions = (cardId, data, headers) =>
|
||||
socket.get(`/cards/${cardId}/actions`, data, headers).then((body) => ({
|
||||
const getActions = (cardId, data) =>
|
||||
socket.get(`/cards/${cardId}/actions`, data).then((body) => ({
|
||||
...body,
|
||||
items: body.items.map(transformAction),
|
||||
}));
|
||||
|
||||
@@ -10,20 +10,20 @@ export const transformAttachment = (attachment) => ({
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createAttachment = (cardId, data, requestId, headers) =>
|
||||
http.post(`/cards/${cardId}/attachments?requestId=${requestId}`, data, headers).then((body) => ({
|
||||
const createAttachment = (cardId, data, requestId) =>
|
||||
http.post(`/cards/${cardId}/attachments?requestId=${requestId}`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
}));
|
||||
|
||||
const updateAttachment = (id, data, headers) =>
|
||||
socket.patch(`/attachments/${id}`, data, headers).then((body) => ({
|
||||
const updateAttachment = (id, data) =>
|
||||
socket.patch(`/attachments/${id}`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
}));
|
||||
|
||||
const deleteAttachment = (id, headers) =>
|
||||
socket.delete(`/attachments/${id}`, undefined, headers).then((body) => ({
|
||||
const deleteAttachment = (id) =>
|
||||
socket.delete(`/attachments/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformAttachment(body.item),
|
||||
}));
|
||||
|
||||
@@ -2,11 +2,10 @@ import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createBoardMembership = (boardId, data, headers) =>
|
||||
socket.post(`/boards/${boardId}/memberships`, data, headers);
|
||||
const createBoardMembership = (boardId, data) =>
|
||||
socket.post(`/boards/${boardId}/memberships`, data);
|
||||
|
||||
const deleteBoardMembership = (id, headers) =>
|
||||
socket.delete(`/board-memberships/${id}`, undefined, headers);
|
||||
const deleteBoardMembership = (id) => socket.delete(`/board-memberships/${id}`);
|
||||
|
||||
export default {
|
||||
createBoardMembership,
|
||||
|
||||
@@ -4,11 +4,10 @@ import { transformAttachment } from './attachments';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createBoard = (projectId, data, headers) =>
|
||||
socket.post(`/projects/${projectId}/boards`, data, headers);
|
||||
const createBoard = (projectId, data) => socket.post(`/projects/${projectId}/boards`, data);
|
||||
|
||||
const getBoard = (id, headers) =>
|
||||
socket.get(`/boards/${id}`, undefined, headers).then((body) => ({
|
||||
const getBoard = (id) =>
|
||||
socket.get(`/boards/${id}`).then((body) => ({
|
||||
...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 {
|
||||
createBoard,
|
||||
|
||||
@@ -2,11 +2,9 @@ import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createCardLabel = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/labels`, data, headers);
|
||||
const createCardLabel = (cardId, data) => socket.post(`/cards/${cardId}/labels`, data);
|
||||
|
||||
const deleteCardLabel = (cardId, labelId, headers) =>
|
||||
socket.delete(`/cards/${cardId}/labels/${labelId}`, undefined, headers);
|
||||
const deleteCardLabel = (cardId, labelId) => socket.delete(`/cards/${cardId}/labels/${labelId}`);
|
||||
|
||||
export default {
|
||||
createCardLabel,
|
||||
|
||||
@@ -2,11 +2,10 @@ import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createCardMembership = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/memberships`, data, headers);
|
||||
const createCardMembership = (cardId, data) => socket.post(`/cards/${cardId}/memberships`, data);
|
||||
|
||||
const deleteCardMembership = (cardId, userId, headers) =>
|
||||
socket.delete(`/cards/${cardId}/memberships?userId=${userId}`, undefined, headers);
|
||||
const deleteCardMembership = (cardId, userId) =>
|
||||
socket.delete(`/cards/${cardId}/memberships?userId=${userId}`);
|
||||
|
||||
export default {
|
||||
createCardMembership,
|
||||
|
||||
+10
-10
@@ -35,8 +35,8 @@ export const transformCardData = (data) => ({
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getCards = (boardId, data, headers) =>
|
||||
socket.get(`/board/${boardId}/cards`, data, headers).then((body) => ({
|
||||
const getCards = (boardId, data) =>
|
||||
socket.get(`/board/${boardId}/cards`, data).then((body) => ({
|
||||
...body,
|
||||
items: body.items.map(transformCard),
|
||||
included: {
|
||||
@@ -45,26 +45,26 @@ const getCards = (boardId, data, headers) =>
|
||||
},
|
||||
}));
|
||||
|
||||
const createCard = (boardId, data, headers) =>
|
||||
socket.post(`/boards/${boardId}/cards`, transformCardData(data), headers).then((body) => ({
|
||||
const createCard = (boardId, data) =>
|
||||
socket.post(`/boards/${boardId}/cards`, transformCardData(data)).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const getCard = (id, headers) =>
|
||||
socket.get(`/cards/${id}`, undefined, headers).then((body) => ({
|
||||
const getCard = (id) =>
|
||||
socket.get(`/cards/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const updateCard = (id, data, headers) =>
|
||||
socket.patch(`/cards/${id}`, transformCardData(data), headers).then((body) => ({
|
||||
const updateCard = (id, data) =>
|
||||
socket.patch(`/cards/${id}`, transformCardData(data)).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const deleteCard = (id, headers) =>
|
||||
socket.delete(`/cards/${id}`, undefined, headers).then((body) => ({
|
||||
const deleteCard = (id) =>
|
||||
socket.delete(`/cards/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
@@ -3,20 +3,20 @@ import { transformAction } from './actions';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createCommentAction = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/comment-actions`, data, headers).then((body) => ({
|
||||
const createCommentAction = (cardId, data) =>
|
||||
socket.post(`/cards/${cardId}/comment-actions`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const updateCommentAction = (id, data, headers) =>
|
||||
socket.patch(`/comment-actions/${id}`, data, headers).then((body) => ({
|
||||
const updateCommentAction = (id, data) =>
|
||||
socket.patch(`/comment-actions/${id}`, data).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const deleteCommentAction = (id, headers) =>
|
||||
socket.delete(`/comment-actions/${id}`, undefined, headers).then((body) => ({
|
||||
const deleteCommentAction = (id) =>
|
||||
socket.delete(`/comment-actions/${id}`).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
@@ -6,7 +6,7 @@ const http = {};
|
||||
|
||||
// TODO: add all methods
|
||||
['POST'].forEach((method) => {
|
||||
http[method.toLowerCase()] = (url, data, headers) => {
|
||||
http[method.toLowerCase()] = (url, data) => {
|
||||
const formData = Object.keys(data).reduce((result, key) => {
|
||||
result.append(key, data[key]);
|
||||
|
||||
@@ -15,8 +15,8 @@ const http = {};
|
||||
|
||||
return fetch(`${Config.SERVER_BASE_URL}/api${url}`, {
|
||||
method,
|
||||
headers,
|
||||
body: formData,
|
||||
...Config.FETCH_OPTIONS,
|
||||
})
|
||||
.then((response) =>
|
||||
response.json().then((body) => ({
|
||||
|
||||
@@ -2,12 +2,11 @@ import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createLabel = (boardId, data, headers) =>
|
||||
socket.post(`/boards/${boardId}/labels`, data, headers);
|
||||
const createLabel = (boardId, data) => socket.post(`/boards/${boardId}/labels`, data);
|
||||
|
||||
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 {
|
||||
createLabel,
|
||||
|
||||
@@ -2,12 +2,11 @@ import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createList = (boardId, data, headers) =>
|
||||
socket.post(`/boards/${boardId}/lists`, data, headers);
|
||||
const createList = (boardId, data) => socket.post(`/boards/${boardId}/lists`, data);
|
||||
|
||||
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 {
|
||||
createList,
|
||||
|
||||
@@ -4,8 +4,8 @@ import { transformAction } from './actions';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getNotifications = (headers) =>
|
||||
socket.get('/notifications', undefined, headers).then((body) => ({
|
||||
const getNotifications = () =>
|
||||
socket.get('/notifications').then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
@@ -14,8 +14,8 @@ const getNotifications = (headers) =>
|
||||
},
|
||||
}));
|
||||
|
||||
const getNotification = (id, headers) =>
|
||||
socket.get(`/notifications/${id}`, undefined, headers).then((body) => ({
|
||||
const getNotification = (id) =>
|
||||
socket.get(`/notifications/${id}`).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
@@ -24,8 +24,7 @@ const getNotification = (id, headers) =>
|
||||
},
|
||||
}));
|
||||
|
||||
const updateNotifications = (ids, data, headers) =>
|
||||
socket.patch(`/notifications/${ids.join(',')}`, data, headers);
|
||||
const updateNotifications = (ids, data) => socket.patch(`/notifications/${ids.join(',')}`, data);
|
||||
|
||||
export default {
|
||||
getNotifications,
|
||||
|
||||
@@ -2,11 +2,10 @@ import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
const createProjectManager = (projectId, data, headers) =>
|
||||
socket.post(`/projects/${projectId}/managers`, data, headers);
|
||||
const createProjectManager = (projectId, data) =>
|
||||
socket.post(`/projects/${projectId}/managers`, data);
|
||||
|
||||
const deleteProjectManager = (id, headers) =>
|
||||
socket.delete(`/project-managers/${id}`, undefined, headers);
|
||||
const deleteProjectManager = (id) => socket.delete(`/project-managers/${id}`);
|
||||
|
||||
export default {
|
||||
createProjectManager,
|
||||
|
||||
@@ -3,18 +3,18 @@ import socket from './socket';
|
||||
|
||||
/* 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) =>
|
||||
http.post(`/projects/${id}/background-image`, data, headers);
|
||||
const updateProjectBackgroundImage = (id, data) =>
|
||||
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 {
|
||||
getProjects,
|
||||
|
||||
@@ -16,13 +16,12 @@ const { socket } = io;
|
||||
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
||||
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||
socket[method.toLowerCase()] = (url, data, headers) =>
|
||||
socket[method.toLowerCase()] = (url, data) =>
|
||||
new Promise((resolve, reject) => {
|
||||
socket.request(
|
||||
{
|
||||
method,
|
||||
data,
|
||||
headers,
|
||||
url: `/api${url}`,
|
||||
},
|
||||
(_, { body, error }) => {
|
||||
|
||||
@@ -2,11 +2,11 @@ import socket from './socket';
|
||||
|
||||
/* 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 {
|
||||
createTask,
|
||||
|
||||
+10
-12
@@ -3,27 +3,25 @@ import socket from './socket';
|
||||
|
||||
/* 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) =>
|
||||
socket.patch(`/users/${id}/password`, data, headers);
|
||||
const updateUserPassword = (id, data) => socket.patch(`/users/${id}/password`, data);
|
||||
|
||||
const updateUserUsername = (id, data, headers) =>
|
||||
socket.patch(`/users/${id}/username`, data, headers);
|
||||
const updateUserUsername = (id, data) => socket.patch(`/users/${id}/username`, data);
|
||||
|
||||
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 {
|
||||
getUsers,
|
||||
|
||||
@@ -15,7 +15,7 @@ const DEFAULT_DATA = {
|
||||
const ListAdd = React.memo(({ onCreate, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||
const [selectNameFieldState, selectNameField] = useToggle();
|
||||
const [focusNameFieldState, focusNameField] = useToggle();
|
||||
|
||||
const nameField = useRef(null);
|
||||
|
||||
@@ -44,16 +44,16 @@ const ListAdd = React.memo(({ onCreate, onClose }) => {
|
||||
onCreate(cleanData);
|
||||
|
||||
setData(DEFAULT_DATA);
|
||||
selectNameField();
|
||||
}, [onCreate, data, setData, selectNameField]);
|
||||
focusNameField();
|
||||
}, [onCreate, data, setData, focusNameField]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.select();
|
||||
nameField.current.focus();
|
||||
}, []);
|
||||
|
||||
useDidUpdate(() => {
|
||||
nameField.current.select();
|
||||
}, [selectNameFieldState]);
|
||||
nameField.current.focus();
|
||||
}, [focusNameFieldState]);
|
||||
|
||||
return (
|
||||
<Form className={styles.wrapper} onSubmit={handleSubmit}>
|
||||
|
||||
@@ -35,7 +35,7 @@ const AddStep = React.memo(({ onCreate, onClose }) => {
|
||||
}, [onCreate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.select();
|
||||
nameField.current.focus();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
|
||||
.cover {
|
||||
border-radius: 3px 3px 0 0;
|
||||
margin-bottom: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@@ -114,6 +115,7 @@
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
cursor: auto;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.select();
|
||||
field.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
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 CommentAdd from './CommentAdd';
|
||||
@@ -14,15 +14,22 @@ const Actions = React.memo(
|
||||
items,
|
||||
isFetching,
|
||||
isAllFetched,
|
||||
isDetailsVisible,
|
||||
isDetailsFetching,
|
||||
canEdit,
|
||||
canEditAllComments,
|
||||
onFetch,
|
||||
onDetailsToggle,
|
||||
onCommentCreate,
|
||||
onCommentUpdate,
|
||||
onCommentDelete,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleToggleDetailsClick = useCallback(() => {
|
||||
onDetailsToggle(!isDetailsVisible);
|
||||
}, [isDetailsVisible, onDetailsToggle]);
|
||||
|
||||
const handleCommentUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onCommentUpdate(id, data);
|
||||
@@ -38,54 +45,51 @@ const Actions = React.memo(
|
||||
);
|
||||
|
||||
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 className={styles.contentModule}>
|
||||
<div className={styles.moduleWrapper}>
|
||||
<Icon name="list ul" className={styles.moduleIcon} />
|
||||
<div className={styles.moduleHeader}>
|
||||
{t('common.actions')}
|
||||
<Button
|
||||
content={isDetailsVisible ? t('action.hideDetails') : t('action.showDetails')}
|
||||
className={styles.toggleButton}
|
||||
onClick={handleToggleDetailsClick}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.contentModule}>
|
||||
<div className={styles.moduleWrapper}>
|
||||
<Icon name="list ul" className={styles.moduleIcon} />
|
||||
<div className={styles.moduleHeader}>{t('common.actions')}</div>
|
||||
<div className={styles.wrapper}>
|
||||
<Comment.Group>
|
||||
{items.map((item) =>
|
||||
item.type === ActionTypes.COMMENT_CARD ? (
|
||||
<Item.Comment
|
||||
key={item.id}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
isPersisted={item.isPersisted}
|
||||
user={item.user}
|
||||
canEdit={(item.user.isCurrent && canEdit) || canEditAllComments}
|
||||
onUpdate={(data) => handleCommentUpdate(item.id, data)}
|
||||
onDelete={() => handleCommentDelete(item.id)}
|
||||
/>
|
||||
) : (
|
||||
<Item
|
||||
key={item.id}
|
||||
type={item.type}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
user={item.user}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
</Comment.Group>
|
||||
</div>
|
||||
{isFetching ? (
|
||||
<Loader active inverted inline="centered" size="small" className={styles.loader} />
|
||||
) : (
|
||||
!isAllFetched && <Visibility fireOnMount onOnScreen={onFetch} />
|
||||
)}
|
||||
{canEdit && <CommentAdd onCreate={onCommentCreate} />}
|
||||
<div className={styles.wrapper}>
|
||||
<Comment.Group>
|
||||
{items.map((item) =>
|
||||
item.type === ActionTypes.COMMENT_CARD ? (
|
||||
<Item.Comment
|
||||
key={item.id}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
isPersisted={item.isPersisted}
|
||||
user={item.user}
|
||||
canEdit={(item.user.isCurrent && canEdit) || canEditAllComments}
|
||||
onUpdate={(data) => handleCommentUpdate(item.id, data)}
|
||||
onDelete={() => handleCommentDelete(item.id)}
|
||||
/>
|
||||
) : (
|
||||
<Item
|
||||
key={item.id}
|
||||
type={item.type}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
user={item.user}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
</Comment.Group>
|
||||
</div>
|
||||
{isFetching || isDetailsFetching ? (
|
||||
<Loader active inverted inline="centered" size="small" className={styles.loader} />
|
||||
) : (
|
||||
!isAllFetched && <Visibility fireOnMount onOnScreen={onFetch} />
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -94,9 +98,12 @@ Actions.propTypes = {
|
||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
isFetching: PropTypes.bool.isRequired,
|
||||
isAllFetched: PropTypes.bool.isRequired,
|
||||
isDetailsVisible: PropTypes.bool.isRequired,
|
||||
isDetailsFetching: PropTypes.bool.isRequired,
|
||||
canEdit: PropTypes.bool.isRequired,
|
||||
canEditAllComments: PropTypes.bool.isRequired,
|
||||
onFetch: PropTypes.func.isRequired,
|
||||
onDetailsToggle: PropTypes.func.isRequired,
|
||||
onCommentCreate: PropTypes.func.isRequired,
|
||||
onCommentUpdate: PropTypes.func.isRequired,
|
||||
onCommentDelete: PropTypes.func.isRequired,
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
}
|
||||
|
||||
.moduleHeader {
|
||||
align-items: center;
|
||||
color: #17394d;
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
line-height: 20px;
|
||||
height: 36px;
|
||||
justify-content: space-between;
|
||||
margin: 0 0 4px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.moduleIcon {
|
||||
@@ -33,6 +35,24 @@
|
||||
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 {
|
||||
margin-left: -40px;
|
||||
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 { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
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';
|
||||
|
||||
@@ -14,10 +15,16 @@ const DEFAULT_DATA = {
|
||||
|
||||
const CommentAdd = React.memo(({ onCreate }) => {
|
||||
const [t] = useTranslation();
|
||||
const [isOpened, setIsOpened] = useState(false);
|
||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||
const [selectTextFieldState, selectTextField] = useToggle();
|
||||
|
||||
const textField = useRef(null);
|
||||
|
||||
const close = useCallback(() => {
|
||||
setIsOpened(false);
|
||||
}, []);
|
||||
|
||||
const submit = useCallback(() => {
|
||||
const cleanData = {
|
||||
...data,
|
||||
@@ -32,7 +39,12 @@ const CommentAdd = React.memo(({ onCreate }) => {
|
||||
onCreate(cleanData);
|
||||
|
||||
setData(DEFAULT_DATA);
|
||||
}, [onCreate, data, setData]);
|
||||
selectTextField();
|
||||
}, [onCreate, data, setData, selectTextField]);
|
||||
|
||||
const handleFieldFocus = useCallback(() => {
|
||||
setIsOpened(true);
|
||||
}, []);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
@@ -43,10 +55,16 @@ const CommentAdd = React.memo(({ onCreate }) => {
|
||||
[submit],
|
||||
);
|
||||
|
||||
const [handleFieldBlur, handleControlMouseOver, handleControlMouseOut] = useClosableForm(close);
|
||||
|
||||
const handleSubmit = useCallback(() => {
|
||||
submit();
|
||||
}, [submit]);
|
||||
|
||||
useDidUpdate(() => {
|
||||
textField.current.ref.current.focus();
|
||||
}, [selectTextFieldState]);
|
||||
|
||||
return (
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<TextArea
|
||||
@@ -55,15 +73,24 @@ const CommentAdd = React.memo(({ onCreate }) => {
|
||||
name="text"
|
||||
value={data.text}
|
||||
placeholder={t('common.writeComment')}
|
||||
minRows={3}
|
||||
minRows={isOpened ? 3 : 1}
|
||||
spellCheck={false}
|
||||
className={styles.field}
|
||||
onFocus={handleFieldFocus}
|
||||
onKeyDown={handleFieldKeyDown}
|
||||
onChange={handleFieldChange}
|
||||
onBlur={handleFieldBlur}
|
||||
/>
|
||||
<div className={styles.controls}>
|
||||
<Button positive content={t('action.addComment')} disabled={!data.text} />
|
||||
</div>
|
||||
{isOpened && (
|
||||
<div className={styles.controls}>
|
||||
<Button
|
||||
positive
|
||||
content={t('action.addComment')}
|
||||
onMouseOver={handleControlMouseOver}
|
||||
onMouseOut={handleControlMouseOut}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
textField.current.ref.current.select();
|
||||
textField.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ const ItemComment = React.memo(
|
||||
</div>
|
||||
<CommentEdit ref={commentEdit} defaultData={data} onUpdate={onUpdate}>
|
||||
<>
|
||||
<Markdown linkTarget="_blank" className={styles.text}>
|
||||
{data.text}
|
||||
</Markdown>
|
||||
<div className={styles.text}>
|
||||
<Markdown linkTarget="_blank">{data.text}</Markdown>
|
||||
</div>
|
||||
{canEdit && (
|
||||
<Comment.Actions>
|
||||
<Comment.Action
|
||||
|
||||
@@ -34,13 +34,6 @@
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 8px 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: pre-line;
|
||||
word-break: break-word;
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
|
||||
@@ -37,7 +37,7 @@ const TextFileAddModal = React.memo(({ content, onCreate, onClose }) => {
|
||||
}, [content, onCreate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.select();
|
||||
nameField.current.focus();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Gallery, Item as GalleryItem } from 'react-photoswipe-gallery';
|
||||
import { Button } from 'semantic-ui-react';
|
||||
import { useToggle } from '../../../lib/hooks';
|
||||
|
||||
@@ -8,81 +10,152 @@ import Item from './Item';
|
||||
|
||||
import styles from './Attachments.module.scss';
|
||||
|
||||
const Attachments = React.memo(({ items, onUpdate, onDelete, onCoverUpdate }) => {
|
||||
const [t] = useTranslation();
|
||||
const [isOpened, toggleOpened] = useToggle();
|
||||
const INITIALLY_VISIBLE = 4;
|
||||
|
||||
const handleToggleClick = useCallback(() => {
|
||||
toggleOpened();
|
||||
}, [toggleOpened]);
|
||||
const Attachments = React.memo(
|
||||
({ items, onUpdate, onDelete, onCoverUpdate, onGalleryOpen, onGalleryClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [isAllVisible, toggleAllVisible] = useToggle();
|
||||
|
||||
const handleCoverSelect = useCallback(
|
||||
(id) => {
|
||||
onCoverUpdate(id);
|
||||
},
|
||||
[onCoverUpdate],
|
||||
);
|
||||
const handleCoverSelect = useCallback(
|
||||
(id) => {
|
||||
onCoverUpdate(id);
|
||||
},
|
||||
[onCoverUpdate],
|
||||
);
|
||||
|
||||
const handleCoverDeselect = useCallback(() => {
|
||||
onCoverUpdate(null);
|
||||
}, [onCoverUpdate]);
|
||||
const handleCoverDeselect = useCallback(() => {
|
||||
onCoverUpdate(null);
|
||||
}, [onCoverUpdate]);
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onUpdate(id, data);
|
||||
},
|
||||
[onUpdate],
|
||||
);
|
||||
const handleUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onUpdate(id, data);
|
||||
},
|
||||
[onUpdate],
|
||||
);
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
);
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
);
|
||||
|
||||
const visibleItems = isOpened ? items : items.slice(0, 4);
|
||||
const handleBeforeGalleryOpen = useCallback(
|
||||
(gallery) => {
|
||||
onGalleryOpen();
|
||||
|
||||
return (
|
||||
<>
|
||||
{visibleItems.map((item) => (
|
||||
<Item
|
||||
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 (
|
||||
<GalleryItem
|
||||
{...props} // eslint-disable-line react/jsx-props-no-spreading
|
||||
key={item.id}
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
coverUrl={item.coverUrl}
|
||||
createdAt={item.createdAt}
|
||||
isCover={item.isCover}
|
||||
isPersisted={item.isPersisted}
|
||||
onCoverSelect={() => handleCoverSelect(item.id)}
|
||||
onCoverDeselect={handleCoverDeselect}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
/>
|
||||
))}
|
||||
{items.length > 4 && (
|
||||
<Button
|
||||
fluid
|
||||
content={
|
||||
isOpened
|
||||
? t('action.showFewerAttachments')
|
||||
: t('action.showAllAttachments', {
|
||||
hidden: items.length - visibleItems.length,
|
||||
})
|
||||
original={item.url}
|
||||
caption={item.name}
|
||||
>
|
||||
{({ ref, open }) =>
|
||||
isVisible ? (
|
||||
<Item
|
||||
ref={ref}
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
coverUrl={item.coverUrl}
|
||||
createdAt={item.createdAt}
|
||||
isCover={item.isCover}
|
||||
isPersisted={item.isPersisted}
|
||||
onClick={item.image || isPdf ? open : undefined}
|
||||
onCoverSelect={() => handleCoverSelect(item.id)}
|
||||
onCoverDeselect={handleCoverDeselect}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
/>
|
||||
) : (
|
||||
<span ref={ref} />
|
||||
)
|
||||
}
|
||||
className={styles.toggleButton}
|
||||
onClick={handleToggleClick}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
});
|
||||
</GalleryItem>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Gallery
|
||||
withCaption
|
||||
withDownloadButton
|
||||
options={{
|
||||
showHideAnimationType: 'none',
|
||||
closeTitle: '',
|
||||
zoomTitle: '',
|
||||
arrowPrevTitle: '',
|
||||
arrowNextTitle: '',
|
||||
errorMsg: '',
|
||||
}}
|
||||
onBeforeOpen={handleBeforeGalleryOpen}
|
||||
>
|
||||
{galleryItemsNode}
|
||||
</Gallery>
|
||||
{items.length > INITIALLY_VISIBLE && (
|
||||
<Button
|
||||
fluid
|
||||
content={
|
||||
isAllVisible
|
||||
? t('action.showFewerAttachments')
|
||||
: t('action.showAllAttachments', {
|
||||
hidden: items.length - INITIALLY_VISIBLE,
|
||||
})
|
||||
}
|
||||
className={styles.toggleButton}
|
||||
onClick={handleToggleAllVisibleClick}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Attachments.propTypes = {
|
||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onDelete: PropTypes.func.isRequired,
|
||||
onCoverUpdate: PropTypes.func.isRequired,
|
||||
onGalleryOpen: PropTypes.func.isRequired,
|
||||
onGalleryClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default Attachments;
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
: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 {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
|
||||
@@ -8,24 +8,32 @@ import EditPopup from './EditPopup';
|
||||
|
||||
import styles from './Item.module.scss';
|
||||
|
||||
const Item = React.memo(
|
||||
({
|
||||
name,
|
||||
url,
|
||||
coverUrl,
|
||||
createdAt,
|
||||
isCover,
|
||||
isPersisted,
|
||||
onCoverSelect,
|
||||
onCoverDeselect,
|
||||
onUpdate,
|
||||
onDelete,
|
||||
}) => {
|
||||
const Item = React.forwardRef(
|
||||
(
|
||||
{
|
||||
name,
|
||||
url,
|
||||
coverUrl,
|
||||
createdAt,
|
||||
isCover,
|
||||
isPersisted,
|
||||
onCoverSelect,
|
||||
onCoverDeselect,
|
||||
onClick,
|
||||
onUpdate,
|
||||
onDelete,
|
||||
},
|
||||
ref,
|
||||
) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
window.open(url, '_blank');
|
||||
}, [url]);
|
||||
if (onClick) {
|
||||
onClick();
|
||||
} else {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}, [url, onClick]);
|
||||
|
||||
const handleToggleCoverClick = useCallback(
|
||||
(event) => {
|
||||
@@ -54,7 +62,7 @@ const Item = React.memo(
|
||||
return (
|
||||
/* eslint-disable jsx-a11y/click-events-have-key-events,
|
||||
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,
|
||||
jsx-a11y/no-static-element-interactions */}
|
||||
<div
|
||||
@@ -133,6 +141,7 @@ Item.propTypes = {
|
||||
createdAt: PropTypes.instanceOf(Date),
|
||||
isCover: PropTypes.bool.isRequired,
|
||||
isPersisted: PropTypes.bool.isRequired,
|
||||
onClick: PropTypes.func,
|
||||
onCoverSelect: PropTypes.func.isRequired,
|
||||
onCoverDeselect: PropTypes.func.isRequired,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
@@ -143,6 +152,7 @@ Item.defaultProps = {
|
||||
url: undefined,
|
||||
coverUrl: 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 classNames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -34,6 +34,8 @@ const CardModal = React.memo(
|
||||
isSubscribed,
|
||||
isActionsFetching,
|
||||
isAllActionsFetched,
|
||||
isActionsDetailsVisible,
|
||||
isActionsDetailsFetching,
|
||||
listId,
|
||||
boardId,
|
||||
projectId,
|
||||
@@ -61,11 +63,13 @@ const CardModal = React.memo(
|
||||
onLabelDelete,
|
||||
onTaskCreate,
|
||||
onTaskUpdate,
|
||||
onTaskMove,
|
||||
onTaskDelete,
|
||||
onAttachmentCreate,
|
||||
onAttachmentUpdate,
|
||||
onAttachmentDelete,
|
||||
onActionsFetch,
|
||||
onActionsDetailsToggle,
|
||||
onCommentActionCreate,
|
||||
onCommentActionUpdate,
|
||||
onCommentActionDelete,
|
||||
@@ -73,6 +77,8 @@ const CardModal = React.memo(
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const isGalleryOpened = useRef(false);
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
onUpdate({
|
||||
@@ -124,6 +130,22 @@ const CardModal = React.memo(
|
||||
});
|
||||
}, [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 labelIds = labels.map((label) => label.id);
|
||||
|
||||
@@ -313,6 +335,7 @@ const CardModal = React.memo(
|
||||
canEdit={canEdit}
|
||||
onCreate={onTaskCreate}
|
||||
onUpdate={onTaskUpdate}
|
||||
onMove={onTaskMove}
|
||||
onDelete={onTaskDelete}
|
||||
/>
|
||||
</div>
|
||||
@@ -328,6 +351,8 @@ const CardModal = React.memo(
|
||||
onUpdate={onAttachmentUpdate}
|
||||
onDelete={onAttachmentDelete}
|
||||
onCoverUpdate={handleCoverUpdate}
|
||||
onGalleryOpen={handleGalleryOpen}
|
||||
onGalleryClose={handleGalleryClose}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -336,9 +361,12 @@ const CardModal = React.memo(
|
||||
items={actions}
|
||||
isFetching={isActionsFetching}
|
||||
isAllFetched={isAllActionsFetched}
|
||||
isDetailsVisible={isActionsDetailsVisible}
|
||||
isDetailsFetching={isActionsDetailsFetching}
|
||||
canEdit={canEdit}
|
||||
canEditAllComments={canEditAllCommentActions}
|
||||
onFetch={onActionsFetch}
|
||||
onDetailsToggle={onActionsDetailsToggle}
|
||||
onCommentCreate={onCommentActionCreate}
|
||||
onCommentUpdate={onCommentActionUpdate}
|
||||
onCommentDelete={onCommentActionDelete}
|
||||
@@ -445,7 +473,7 @@ const CardModal = React.memo(
|
||||
);
|
||||
|
||||
return (
|
||||
<Modal open closeIcon size="small" centered={false} onClose={onClose}>
|
||||
<Modal open closeIcon centered={false} onClose={handleClose} className={styles.wrapper}>
|
||||
{canEdit ? (
|
||||
<AttachmentAddZone onCreate={onAttachmentCreate}>{contentNode}</AttachmentAddZone>
|
||||
) : (
|
||||
@@ -464,6 +492,8 @@ CardModal.propTypes = {
|
||||
isSubscribed: PropTypes.bool.isRequired,
|
||||
isActionsFetching: PropTypes.bool.isRequired,
|
||||
isAllActionsFetched: PropTypes.bool.isRequired,
|
||||
isActionsDetailsVisible: PropTypes.bool.isRequired,
|
||||
isActionsDetailsFetching: PropTypes.bool.isRequired,
|
||||
listId: PropTypes.string.isRequired,
|
||||
boardId: PropTypes.string.isRequired,
|
||||
projectId: PropTypes.string.isRequired,
|
||||
@@ -493,11 +523,13 @@ CardModal.propTypes = {
|
||||
onLabelDelete: PropTypes.func.isRequired,
|
||||
onTaskCreate: PropTypes.func.isRequired,
|
||||
onTaskUpdate: PropTypes.func.isRequired,
|
||||
onTaskMove: PropTypes.func.isRequired,
|
||||
onTaskDelete: PropTypes.func.isRequired,
|
||||
onAttachmentCreate: PropTypes.func.isRequired,
|
||||
onAttachmentUpdate: PropTypes.func.isRequired,
|
||||
onAttachmentDelete: PropTypes.func.isRequired,
|
||||
onActionsFetch: PropTypes.func.isRequired,
|
||||
onActionsDetailsToggle: PropTypes.func.isRequired,
|
||||
onCommentActionCreate: PropTypes.func.isRequired,
|
||||
onCommentActionUpdate: PropTypes.func.isRequired,
|
||||
onCommentActionDelete: PropTypes.func.isRequired,
|
||||
|
||||
@@ -115,23 +115,13 @@
|
||||
border: none;
|
||||
color: #17394d;
|
||||
cursor: pointer;
|
||||
line-height: 1.5;
|
||||
font-size: 15px;
|
||||
margin-bottom: 8px;
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
overflow-wrap: break-word;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
|
||||
p {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
@@ -203,4 +193,14 @@
|
||||
margin: 0 8px 4px 0;
|
||||
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(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.select();
|
||||
field.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
||||
const [t] = useTranslation();
|
||||
const [isOpened, setIsOpened] = useState(false);
|
||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||
const [selectNameFieldState, selectNameField] = useToggle();
|
||||
const [focusNameFieldState, focusNameField] = useToggle();
|
||||
|
||||
const nameField = useRef(null);
|
||||
|
||||
@@ -43,8 +43,8 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
||||
onCreate(cleanData);
|
||||
|
||||
setData(DEFAULT_DATA);
|
||||
selectNameField();
|
||||
}, [onCreate, data, setData, selectNameField]);
|
||||
focusNameField();
|
||||
}, [onCreate, data, setData, focusNameField]);
|
||||
|
||||
useImperativeHandle(
|
||||
ref,
|
||||
@@ -81,13 +81,13 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
nameField.current.ref.current.select();
|
||||
nameField.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
useDidUpdate(() => {
|
||||
nameField.current.ref.current.select();
|
||||
}, [selectNameFieldState]);
|
||||
nameField.current.ref.current.focus();
|
||||
}, [focusNameFieldState]);
|
||||
|
||||
if (!isOpened) {
|
||||
return React.cloneElement(children, {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import React, { useCallback, useRef } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { Draggable } from 'react-beautiful-dnd';
|
||||
import { Button, Checkbox, Icon } from 'semantic-ui-react';
|
||||
|
||||
import NameEdit from './NameEdit';
|
||||
@@ -8,72 +10,85 @@ import ActionsPopup from './ActionsPopup';
|
||||
|
||||
import styles from './Item.module.scss';
|
||||
|
||||
const Item = React.memo(({ name, isCompleted, isPersisted, canEdit, onUpdate, onDelete }) => {
|
||||
const nameEdit = useRef(null);
|
||||
const Item = React.memo(
|
||||
({ id, index, name, isCompleted, isPersisted, canEdit, onUpdate, onDelete }) => {
|
||||
const nameEdit = useRef(null);
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
if (isPersisted && canEdit) {
|
||||
nameEdit.current.open();
|
||||
}
|
||||
}, [isPersisted, canEdit]);
|
||||
const handleClick = useCallback(() => {
|
||||
if (isPersisted && canEdit) {
|
||||
nameEdit.current.open();
|
||||
}
|
||||
}, [isPersisted, canEdit]);
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
});
|
||||
},
|
||||
[onUpdate],
|
||||
);
|
||||
|
||||
const handleToggleChange = useCallback(() => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
isCompleted: !isCompleted,
|
||||
});
|
||||
},
|
||||
[onUpdate],
|
||||
);
|
||||
}, [isCompleted, onUpdate]);
|
||||
|
||||
const handleToggleChange = useCallback(() => {
|
||||
onUpdate({
|
||||
isCompleted: !isCompleted,
|
||||
});
|
||||
}, [isCompleted, onUpdate]);
|
||||
const handleNameEdit = useCallback(() => {
|
||||
nameEdit.current.open();
|
||||
}, []);
|
||||
|
||||
const handleNameEdit = useCallback(() => {
|
||||
nameEdit.current.open();
|
||||
}, []);
|
||||
return (
|
||||
<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}>
|
||||
<Checkbox
|
||||
checked={isCompleted}
|
||||
disabled={!isPersisted || !canEdit}
|
||||
className={styles.checkbox}
|
||||
onChange={handleToggleChange}
|
||||
/>
|
||||
</span>
|
||||
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
||||
<div className={classNames(canEdit && styles.contentHoverable)}>
|
||||
{/* eslint-disable jsx-a11y/click-events-have-key-events,
|
||||
jsx-a11y/no-static-element-interactions */}
|
||||
<span
|
||||
className={classNames(styles.text, canEdit && styles.textEditable)}
|
||||
onClick={handleClick}
|
||||
>
|
||||
{/* eslint-enable jsx-a11y/click-events-have-key-events,
|
||||
jsx-a11y/no-static-element-interactions */}
|
||||
<span className={classNames(styles.task, isCompleted && styles.taskCompleted)}>
|
||||
{name}
|
||||
</span>
|
||||
</span>
|
||||
{isPersisted && canEdit && (
|
||||
<ActionsPopup onNameEdit={handleNameEdit} onDelete={onDelete}>
|
||||
<Button className={classNames(styles.button, styles.target)}>
|
||||
<Icon fitted name="pencil" size="small" />
|
||||
</Button>
|
||||
</ActionsPopup>
|
||||
)}
|
||||
</div>
|
||||
</NameEdit>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<span className={styles.checkboxWrapper}>
|
||||
<Checkbox
|
||||
checked={isCompleted}
|
||||
disabled={!isPersisted || !canEdit}
|
||||
className={styles.checkbox}
|
||||
onChange={handleToggleChange}
|
||||
/>
|
||||
</span>
|
||||
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
||||
<div className={classNames(canEdit && styles.contentHoverable)}>
|
||||
{/* eslint-disable jsx-a11y/click-events-have-key-events,
|
||||
jsx-a11y/no-static-element-interactions */}
|
||||
<span
|
||||
className={classNames(styles.text, canEdit && styles.textEditable)}
|
||||
onClick={handleClick}
|
||||
>
|
||||
{/* eslint-enable jsx-a11y/click-events-have-key-events,
|
||||
jsx-a11y/no-static-element-interactions */}
|
||||
<span className={classNames(styles.task, isCompleted && styles.taskCompleted)}>
|
||||
{name}
|
||||
</span>
|
||||
</span>
|
||||
{isPersisted && canEdit && (
|
||||
<ActionsPopup onNameEdit={handleNameEdit} onDelete={onDelete}>
|
||||
<Button className={classNames(styles.button, styles.target)}>
|
||||
<Icon fitted name="pencil" size="small" />
|
||||
</Button>
|
||||
</ActionsPopup>
|
||||
)}
|
||||
</div>
|
||||
</NameEdit>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
return isDragging ? ReactDOM.createPortal(contentNode, document.body) : contentNode;
|
||||
}}
|
||||
</Draggable>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Item.propTypes = {
|
||||
id: PropTypes.string.isRequired,
|
||||
index: PropTypes.number.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
isCompleted: PropTypes.bool.isRequired,
|
||||
isPersisted: PropTypes.bool.isRequired,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
vertical-align: top;
|
||||
z-index: 2000;
|
||||
line-height: 1;
|
||||
height: 32px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.contentHoverable:hover {
|
||||
@@ -69,10 +69,10 @@
|
||||
|
||||
.wrapper {
|
||||
border-radius: 3px;
|
||||
cursor: auto;
|
||||
margin-left: -40px;
|
||||
min-height: 32px;
|
||||
position: relative;
|
||||
transition: all 0.14s ease-in;
|
||||
width: calc(100% + 40px);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
field.current.ref.current.select();
|
||||
field.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
|
||||
@@ -1,16 +1,34 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
||||
import { Progress } from 'semantic-ui-react';
|
||||
import { closePopup } from '../../../lib/popup';
|
||||
|
||||
import DroppableTypes from '../../../constants/DroppableTypes';
|
||||
import Item from './Item';
|
||||
import Add from './Add';
|
||||
|
||||
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 handleDragStart = useCallback(() => {
|
||||
closePopup();
|
||||
}, []);
|
||||
|
||||
const handleDragEnd = useCallback(
|
||||
({ draggableId, source, destination }) => {
|
||||
if (!destination || source.index === destination.index) {
|
||||
return;
|
||||
}
|
||||
|
||||
onMove(draggableId, destination.index);
|
||||
},
|
||||
[onMove],
|
||||
);
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onUpdate(id, data);
|
||||
@@ -39,26 +57,38 @@ const Tasks = React.memo(({ items, canEdit, onCreate, onUpdate, onDelete }) => {
|
||||
className={styles.progress}
|
||||
/>
|
||||
)}
|
||||
{items.map((item) => (
|
||||
<Item
|
||||
key={item.id}
|
||||
name={item.name}
|
||||
isCompleted={item.isCompleted}
|
||||
isPersisted={item.isPersisted}
|
||||
canEdit={canEdit}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
/>
|
||||
))}
|
||||
{canEdit && (
|
||||
<Add onCreate={onCreate}>
|
||||
<button type="button" className={styles.taskButton}>
|
||||
<span className={styles.taskButtonText}>
|
||||
{items.length > 0 ? t('action.addAnotherTask') : t('action.addTask')}
|
||||
</span>
|
||||
</button>
|
||||
</Add>
|
||||
)}
|
||||
<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
|
||||
key={item.id}
|
||||
id={item.id}
|
||||
index={index}
|
||||
name={item.name}
|
||||
isCompleted={item.isCompleted}
|
||||
isPersisted={item.isPersisted}
|
||||
canEdit={canEdit}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
/>
|
||||
))}
|
||||
{placeholder}
|
||||
{canEdit && (
|
||||
<Add onCreate={onCreate}>
|
||||
<button type="button" className={styles.taskButton}>
|
||||
<span className={styles.taskButtonText}>
|
||||
{items.length > 0 ? t('action.addAnotherTask') : t('action.addTask')}
|
||||
</span>
|
||||
</button>
|
||||
</Add>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Droppable>
|
||||
</DragDropContext>
|
||||
</>
|
||||
);
|
||||
});
|
||||
@@ -68,6 +98,7 @@ Tasks.propTypes = {
|
||||
canEdit: PropTypes.bool.isRequired,
|
||||
onCreate: PropTypes.func.isRequired,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onMove: PropTypes.func.isRequired,
|
||||
onDelete: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-weight: 400;
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -17,7 +17,7 @@ const DEFAULT_DATA = {
|
||||
const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||
const [selectNameFieldState, selectNameField] = useToggle();
|
||||
const [focusNameFieldState, focusNameField] = useToggle();
|
||||
|
||||
const nameField = useRef(null);
|
||||
|
||||
@@ -35,8 +35,8 @@ const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
||||
onCreate(cleanData);
|
||||
|
||||
setData(DEFAULT_DATA);
|
||||
selectNameField();
|
||||
}, [onCreate, data, setData, selectNameField]);
|
||||
focusNameField();
|
||||
}, [onCreate, data, setData, focusNameField]);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
@@ -65,13 +65,13 @@ const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpened) {
|
||||
nameField.current.ref.current.select();
|
||||
nameField.current.ref.current.focus();
|
||||
}
|
||||
}, [isOpened]);
|
||||
|
||||
useDidUpdate(() => {
|
||||
nameField.current.ref.current.select();
|
||||
}, [selectNameFieldState]);
|
||||
nameField.current.ref.current.focus();
|
||||
}, [focusNameFieldState]);
|
||||
|
||||
return (
|
||||
<Form
|
||||
|
||||
@@ -83,7 +83,7 @@ const Login = React.memo(
|
||||
}, [onAuthenticate, data]);
|
||||
|
||||
useEffect(() => {
|
||||
emailOrUsernameField.current.select();
|
||||
emailOrUsernameField.current.focus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -33,7 +33,7 @@ const ProjectAddModal = React.memo(({ defaultData, isSubmitting, onCreate, onClo
|
||||
}, [onCreate, data]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.select();
|
||||
nameField.current.focus();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -10,6 +10,7 @@ import CoreWrapperContainer from '../containers/CoreWrapperContainer';
|
||||
import NotFound from './NotFound';
|
||||
|
||||
import 'react-datepicker/dist/react-datepicker.css';
|
||||
import 'photoswipe/dist/photoswipe.css';
|
||||
import '../lib/custom-ui/styles.css';
|
||||
|
||||
import '../styles.module.scss';
|
||||
|
||||
@@ -32,7 +32,7 @@ const createData = (timer) => {
|
||||
const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [data, handleFieldChange, setData] = useForm(() => createData(defaultValue));
|
||||
const [isEditing, toggleEdit] = useToggle();
|
||||
const [isEditing, toggleEditing] = useToggle();
|
||||
|
||||
const hoursField = useRef(null);
|
||||
const minutesField = useRef(null);
|
||||
@@ -55,10 +55,10 @@ const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) =
|
||||
onClose();
|
||||
}, [defaultValue, onUpdate, onClose]);
|
||||
|
||||
const handleToggleEditClick = useCallback(() => {
|
||||
const handleToggleEditingClick = useCallback(() => {
|
||||
setData(createData(defaultValue));
|
||||
toggleEdit();
|
||||
}, [defaultValue, setData, toggleEdit]);
|
||||
toggleEditing();
|
||||
}, [defaultValue, setData, toggleEditing]);
|
||||
|
||||
const handleSubmit = useCallback(() => {
|
||||
const parts = {
|
||||
@@ -149,7 +149,7 @@ const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) =
|
||||
type="button"
|
||||
icon={isEditing ? 'close' : 'edit'}
|
||||
className={styles.iconButton}
|
||||
onClick={handleToggleEditClick}
|
||||
onClick={handleToggleEditingClick}
|
||||
/>
|
||||
</div>
|
||||
{isEditing && <Button positive content={t('action.save')} />}
|
||||
|
||||
@@ -88,7 +88,7 @@ const UserAddStep = React.memo(
|
||||
}, [onCreate, data]);
|
||||
|
||||
useEffect(() => {
|
||||
emailField.current.select();
|
||||
emailField.current.focus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { withPopup } from '../lib/popup';
|
||||
|
||||
import UserEmailEditStep from './UserEmailEditStep';
|
||||
|
||||
export default withPopup(UserEmailEditStep);
|
||||
+42
-24
@@ -1,15 +1,15 @@
|
||||
import omit from 'lodash/omit';
|
||||
import isEmail from 'validator/lib/isEmail';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Message } from 'semantic-ui-react';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../../lib/hooks';
|
||||
import { withPopup } from '../../../lib/popup';
|
||||
import { Input, Popup } from '../../../lib/custom-ui';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||
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) => {
|
||||
if (!error) {
|
||||
@@ -35,8 +35,18 @@ const createMessage = (error) => {
|
||||
}
|
||||
};
|
||||
|
||||
const EmailEditStep = React.memo(
|
||||
({ defaultData, email, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
||||
const UserEmailEditStep = React.memo(
|
||||
({
|
||||
defaultData,
|
||||
email,
|
||||
isSubmitting,
|
||||
error,
|
||||
usePasswordConfirmation,
|
||||
onUpdate,
|
||||
onMessageDismiss,
|
||||
onBack,
|
||||
onClose,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
@@ -68,16 +78,16 @@ const EmailEditStep = React.memo(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cleanData.currentPassword) {
|
||||
if (usePasswordConfirmation && !cleanData.currentPassword) {
|
||||
currentPasswordField.current.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
onUpdate(cleanData);
|
||||
}, [email, onUpdate, onClose, data]);
|
||||
onUpdate(usePasswordConfirmation ? cleanData : omit(cleanData, 'currentPassword'));
|
||||
}, [email, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
emailField.current.select();
|
||||
emailField.current.focus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -110,7 +120,7 @@ const EmailEditStep = React.memo(
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editEmail', {
|
||||
context: 'title',
|
||||
})}
|
||||
@@ -138,15 +148,19 @@ const EmailEditStep = React.memo(
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={currentPasswordField}
|
||||
name="currentPassword"
|
||||
value={data.currentPassword}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
{usePasswordConfirmation && (
|
||||
<>
|
||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={currentPasswordField}
|
||||
name="currentPassword"
|
||||
value={data.currentPassword}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Button
|
||||
positive
|
||||
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
|
||||
email: PropTypes.string.isRequired,
|
||||
isSubmitting: PropTypes.bool.isRequired,
|
||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||
usePasswordConfirmation: PropTypes.bool,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onMessageDismiss: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
EmailEditStep.defaultProps = {
|
||||
UserEmailEditStep.defaultProps = {
|
||||
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 { 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 [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
|
||||
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);
|
||||
+41
-24
@@ -1,14 +1,14 @@
|
||||
import omit from 'lodash/omit';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Message } from 'semantic-ui-react';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../../lib/hooks';
|
||||
import { withPopup } from '../../../lib/popup';
|
||||
import { Input, Popup } from '../../../lib/custom-ui';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||
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) => {
|
||||
if (!error) {
|
||||
@@ -29,8 +29,17 @@ const createMessage = (error) => {
|
||||
}
|
||||
};
|
||||
|
||||
const PasswordEditStep = React.memo(
|
||||
({ defaultData, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
||||
const UserPasswordEditStep = React.memo(
|
||||
({
|
||||
defaultData,
|
||||
isSubmitting,
|
||||
error,
|
||||
usePasswordConfirmation,
|
||||
onUpdate,
|
||||
onMessageDismiss,
|
||||
onBack,
|
||||
onClose,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
@@ -52,16 +61,16 @@ const PasswordEditStep = React.memo(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.currentPassword) {
|
||||
if (usePasswordConfirmation && !data.currentPassword) {
|
||||
currentPasswordField.current.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
onUpdate(data);
|
||||
}, [onUpdate, data]);
|
||||
onUpdate(usePasswordConfirmation ? data : omit(data, 'currentPassword'));
|
||||
}, [usePasswordConfirmation, onUpdate, data]);
|
||||
|
||||
useEffect(() => {
|
||||
passwordField.current.select();
|
||||
passwordField.current.focus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -84,7 +93,7 @@ const PasswordEditStep = React.memo(
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editPassword', {
|
||||
context: 'title',
|
||||
})}
|
||||
@@ -111,15 +120,19 @@ const PasswordEditStep = React.memo(
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={currentPasswordField}
|
||||
name="currentPassword"
|
||||
value={data.currentPassword}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
{usePasswordConfirmation && (
|
||||
<>
|
||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={currentPasswordField}
|
||||
name="currentPassword"
|
||||
value={data.currentPassword}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Button
|
||||
positive
|
||||
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
|
||||
isSubmitting: PropTypes.bool.isRequired,
|
||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||
usePasswordConfirmation: PropTypes.bool,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onMessageDismiss: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
PasswordEditStep.defaultProps = {
|
||||
UserPasswordEditStep.defaultProps = {
|
||||
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 PropTypes from 'prop-types';
|
||||
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 UsernameEditPopup from './UsernameEditPopup';
|
||||
import EmailEditPopup from './EmailEditPopup';
|
||||
import PasswordEditPopup from './PasswordEditPopup';
|
||||
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';
|
||||
|
||||
@@ -20,12 +21,14 @@ const AccountPane = React.memo(
|
||||
avatarUrl,
|
||||
phone,
|
||||
organization,
|
||||
language,
|
||||
isAvatarUpdating,
|
||||
usernameUpdateForm,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
onUpdate,
|
||||
onAvatarUpdate,
|
||||
onLanguageUpdate,
|
||||
onUsernameUpdate,
|
||||
onUsernameUpdateMessageDismiss,
|
||||
onEmailUpdate,
|
||||
@@ -41,6 +44,13 @@ const AccountPane = React.memo(
|
||||
});
|
||||
}, [onUpdate]);
|
||||
|
||||
const handleLanguageChange = useCallback(
|
||||
(_, { value }) => {
|
||||
onLanguageUpdate(value === 'auto' ? null : value); // FIXME: hack
|
||||
},
|
||||
[onLanguageUpdate],
|
||||
);
|
||||
|
||||
return (
|
||||
<Tab.Pane attached={false} className={styles.wrapper}>
|
||||
<AvatarEditPopup
|
||||
@@ -52,7 +62,7 @@ const AccountPane = React.memo(
|
||||
</AvatarEditPopup>
|
||||
<br />
|
||||
<br />
|
||||
<InformationEdit
|
||||
<UserInformationEdit
|
||||
defaultData={{
|
||||
name,
|
||||
phone,
|
||||
@@ -60,6 +70,32 @@ const AccountPane = React.memo(
|
||||
}}
|
||||
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>
|
||||
<Header as="h4">
|
||||
{t('common.authentication', {
|
||||
@@ -68,7 +104,8 @@ const AccountPane = React.memo(
|
||||
</Header>
|
||||
</Divider>
|
||||
<div className={styles.action}>
|
||||
<UsernameEditPopup
|
||||
<UserUsernameEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={usernameUpdateForm.data}
|
||||
username={username}
|
||||
isSubmitting={usernameUpdateForm.isSubmitting}
|
||||
@@ -81,10 +118,11 @@ const AccountPane = React.memo(
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UsernameEditPopup>
|
||||
</UserUsernameEditPopup>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<EmailEditPopup
|
||||
<UserEmailEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={emailUpdateForm.data}
|
||||
email={email}
|
||||
isSubmitting={emailUpdateForm.isSubmitting}
|
||||
@@ -97,10 +135,11 @@ const AccountPane = React.memo(
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</EmailEditPopup>
|
||||
</UserEmailEditPopup>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<PasswordEditPopup
|
||||
<UserPasswordEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={passwordUpdateForm.data}
|
||||
isSubmitting={passwordUpdateForm.isSubmitting}
|
||||
error={passwordUpdateForm.error}
|
||||
@@ -112,7 +151,7 @@ const AccountPane = React.memo(
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</PasswordEditPopup>
|
||||
</UserPasswordEditPopup>
|
||||
</div>
|
||||
</Tab.Pane>
|
||||
);
|
||||
@@ -126,6 +165,7 @@ AccountPane.propTypes = {
|
||||
avatarUrl: PropTypes.string,
|
||||
phone: PropTypes.string,
|
||||
organization: PropTypes.string,
|
||||
language: PropTypes.string,
|
||||
isAvatarUpdating: PropTypes.bool.isRequired,
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
usernameUpdateForm: PropTypes.object.isRequired,
|
||||
@@ -134,6 +174,7 @@ AccountPane.propTypes = {
|
||||
/* eslint-enable react/forbid-prop-types */
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onAvatarUpdate: PropTypes.func.isRequired,
|
||||
onLanguageUpdate: PropTypes.func.isRequired,
|
||||
onUsernameUpdate: PropTypes.func.isRequired,
|
||||
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||
onEmailUpdate: PropTypes.func.isRequired,
|
||||
@@ -147,6 +188,7 @@ AccountPane.defaultProps = {
|
||||
avatarUrl: undefined,
|
||||
phone: undefined,
|
||||
organization: undefined,
|
||||
language: undefined,
|
||||
};
|
||||
|
||||
export default AccountPane;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
:global(#app) {
|
||||
.field {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ const UserSettingsModal = React.memo(
|
||||
avatarUrl,
|
||||
phone,
|
||||
organization,
|
||||
language,
|
||||
subscribeToOwnCards,
|
||||
isAvatarUpdating,
|
||||
usernameUpdateForm,
|
||||
@@ -21,6 +22,7 @@ const UserSettingsModal = React.memo(
|
||||
passwordUpdateForm,
|
||||
onUpdate,
|
||||
onAvatarUpdate,
|
||||
onLanguageUpdate,
|
||||
onUsernameUpdate,
|
||||
onUsernameUpdateMessageDismiss,
|
||||
onEmailUpdate,
|
||||
@@ -44,12 +46,14 @@ const UserSettingsModal = React.memo(
|
||||
avatarUrl={avatarUrl}
|
||||
phone={phone}
|
||||
organization={organization}
|
||||
language={language}
|
||||
isAvatarUpdating={isAvatarUpdating}
|
||||
usernameUpdateForm={usernameUpdateForm}
|
||||
emailUpdateForm={emailUpdateForm}
|
||||
passwordUpdateForm={passwordUpdateForm}
|
||||
onUpdate={onUpdate}
|
||||
onAvatarUpdate={onAvatarUpdate}
|
||||
onLanguageUpdate={onLanguageUpdate}
|
||||
onUsernameUpdate={onUsernameUpdate}
|
||||
onUsernameUpdateMessageDismiss={onUsernameUpdateMessageDismiss}
|
||||
onEmailUpdate={onEmailUpdate}
|
||||
@@ -92,6 +96,7 @@ UserSettingsModal.propTypes = {
|
||||
avatarUrl: PropTypes.string,
|
||||
phone: PropTypes.string,
|
||||
organization: PropTypes.string,
|
||||
language: PropTypes.string,
|
||||
subscribeToOwnCards: PropTypes.bool.isRequired,
|
||||
isAvatarUpdating: PropTypes.bool.isRequired,
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
@@ -101,6 +106,7 @@ UserSettingsModal.propTypes = {
|
||||
/* eslint-enable react/forbid-prop-types */
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onAvatarUpdate: PropTypes.func.isRequired,
|
||||
onLanguageUpdate: PropTypes.func.isRequired,
|
||||
onUsernameUpdate: PropTypes.func.isRequired,
|
||||
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||
onEmailUpdate: PropTypes.func.isRequired,
|
||||
@@ -115,6 +121,7 @@ UserSettingsModal.defaultProps = {
|
||||
avatarUrl: undefined,
|
||||
phone: undefined,
|
||||
organization: undefined,
|
||||
language: undefined,
|
||||
};
|
||||
|
||||
export default UserSettingsModal;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { withPopup } from '../lib/popup';
|
||||
|
||||
import UserUsernameEditStep from './UserUsernameEditStep';
|
||||
|
||||
export default withPopup(UserUsernameEditStep);
|
||||
+44
-26
@@ -1,15 +1,15 @@
|
||||
import omit from 'lodash/omit';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Message } from 'semantic-ui-react';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../../lib/hooks';
|
||||
import { withPopup } from '../../../lib/popup';
|
||||
import { Input, Popup } from '../../../lib/custom-ui';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||
import { Input, Popup } from '../../lib/custom-ui';
|
||||
|
||||
import { useForm } from '../../../hooks';
|
||||
import { isUsername } from '../../../utils/validator';
|
||||
import { useForm } from '../../hooks';
|
||||
import { isUsername } from '../../utils/validator';
|
||||
|
||||
import styles from './UsernameEditPopup.module.scss';
|
||||
import styles from './UserUsernameEditStep.module.scss';
|
||||
|
||||
const createMessage = (error) => {
|
||||
if (!error) {
|
||||
@@ -35,8 +35,18 @@ const createMessage = (error) => {
|
||||
}
|
||||
};
|
||||
|
||||
const UsernameEditStep = React.memo(
|
||||
({ defaultData, username, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
||||
const UserUsernameEditStep = React.memo(
|
||||
({
|
||||
defaultData,
|
||||
username,
|
||||
isSubmitting,
|
||||
error,
|
||||
usePasswordConfirmation,
|
||||
onUpdate,
|
||||
onMessageDismiss,
|
||||
onBack,
|
||||
onClose,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
@@ -58,7 +68,7 @@ const UsernameEditStep = React.memo(
|
||||
username: data.username.trim() || null,
|
||||
};
|
||||
|
||||
if (cleanData.username && !isUsername(cleanData.username)) {
|
||||
if (!cleanData.username || !isUsername(cleanData.username)) {
|
||||
usernameField.current.select();
|
||||
return;
|
||||
}
|
||||
@@ -68,16 +78,16 @@ const UsernameEditStep = React.memo(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cleanData.currentPassword) {
|
||||
if (usePasswordConfirmation && !cleanData.currentPassword) {
|
||||
currentPasswordField.current.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
onUpdate(cleanData);
|
||||
}, [username, onUpdate, onClose, data]);
|
||||
onUpdate(usePasswordConfirmation ? cleanData : omit(cleanData, 'currentPassword'));
|
||||
}, [username, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
usernameField.current.select();
|
||||
usernameField.current.focus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -110,7 +120,7 @@ const UsernameEditStep = React.memo(
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editUsername', {
|
||||
context: 'title',
|
||||
})}
|
||||
@@ -138,15 +148,19 @@ const UsernameEditStep = React.memo(
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={currentPasswordField}
|
||||
name="currentPassword"
|
||||
value={data.currentPassword}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
{usePasswordConfirmation && (
|
||||
<>
|
||||
<div className={styles.text}>{t('common.currentPassword')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={currentPasswordField}
|
||||
name="currentPassword"
|
||||
value={data.currentPassword}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Button
|
||||
positive
|
||||
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
|
||||
username: PropTypes.string,
|
||||
isSubmitting: PropTypes.bool.isRequired,
|
||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||
usePasswordConfirmation: PropTypes.bool,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onMessageDismiss: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
UsernameEditStep.defaultProps = {
|
||||
UserUsernameEditStep.defaultProps = {
|
||||
username: 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,68 +6,140 @@ import { Button, Modal, Table } from 'semantic-ui-react';
|
||||
import UserAddPopupContainer from '../../containers/UserAddPopupContainer';
|
||||
import Item from './Item';
|
||||
|
||||
const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const UsersModal = React.memo(
|
||||
({
|
||||
items,
|
||||
onUpdate,
|
||||
onUsernameUpdate,
|
||||
onUsernameUpdateMessageDismiss,
|
||||
onEmailUpdate,
|
||||
onEmailUpdateMessageDismiss,
|
||||
onPasswordUpdate,
|
||||
onPasswordUpdateMessageDismiss,
|
||||
onDelete,
|
||||
onClose,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onUpdate(id, data);
|
||||
},
|
||||
[onUpdate],
|
||||
);
|
||||
const handleUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onUpdate(id, data);
|
||||
},
|
||||
[onUpdate],
|
||||
);
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
);
|
||||
const handleUsernameUpdate = useCallback(
|
||||
(id, data) => {
|
||||
onUsernameUpdate(id, data);
|
||||
},
|
||||
[onUsernameUpdate],
|
||||
);
|
||||
|
||||
return (
|
||||
<Modal open closeIcon size="large" centered={false} onClose={onClose}>
|
||||
<Modal.Header>
|
||||
{t('common.users', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Modal.Header>
|
||||
<Modal.Content>
|
||||
<Table basic="very">
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.HeaderCell width={4}>{t('common.name')}</Table.HeaderCell>
|
||||
<Table.HeaderCell width={4}>{t('common.username')}</Table.HeaderCell>
|
||||
<Table.HeaderCell width={4}>{t('common.email')}</Table.HeaderCell>
|
||||
<Table.HeaderCell>{t('common.administrator')}</Table.HeaderCell>
|
||||
<Table.HeaderCell />
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{items.map((item) => (
|
||||
<Item
|
||||
key={item.id}
|
||||
name={item.name}
|
||||
username={item.username}
|
||||
email={item.email}
|
||||
isAdmin={item.isAdmin}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
/>
|
||||
))}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</Modal.Content>
|
||||
<Modal.Actions>
|
||||
<UserAddPopupContainer>
|
||||
<Button positive content={t('action.addUser')} />
|
||||
</UserAddPopupContainer>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
);
|
||||
});
|
||||
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(
|
||||
(id) => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
);
|
||||
|
||||
return (
|
||||
<Modal open closeIcon size="large" centered={false} onClose={onClose}>
|
||||
<Modal.Header>
|
||||
{t('common.users', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Modal.Header>
|
||||
<Modal.Content>
|
||||
<Table basic="very">
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.HeaderCell width={4}>{t('common.name')}</Table.HeaderCell>
|
||||
<Table.HeaderCell width={4}>{t('common.username')}</Table.HeaderCell>
|
||||
<Table.HeaderCell width={4}>{t('common.email')}</Table.HeaderCell>
|
||||
<Table.HeaderCell>{t('common.administrator')}</Table.HeaderCell>
|
||||
<Table.HeaderCell />
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{items.map((item) => (
|
||||
<Item
|
||||
key={item.id}
|
||||
email={item.email}
|
||||
username={item.username}
|
||||
name={item.name}
|
||||
organization={item.organization}
|
||||
phone={item.phone}
|
||||
isAdmin={item.isAdmin}
|
||||
emailUpdateForm={item.emailUpdateForm}
|
||||
passwordUpdateForm={item.passwordUpdateForm}
|
||||
usernameUpdateForm={item.usernameUpdateForm}
|
||||
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)}
|
||||
/>
|
||||
))}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</Modal.Content>
|
||||
<Modal.Actions>
|
||||
<UserAddPopupContainer>
|
||||
<Button positive content={t('action.addUser')} />
|
||||
</UserAddPopupContainer>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
UsersModal.propTypes = {
|
||||
items: PropTypes.array.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,
|
||||
};
|
||||
|
||||
@@ -225,6 +225,9 @@ export default {
|
||||
ACTIONS_FETCH: 'ACTIONS_FETCH',
|
||||
ACTIONS_FETCH__SUCCESS: 'ACTIONS_FETCH__SUCCESS',
|
||||
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 */
|
||||
|
||||
|
||||
@@ -2,12 +2,24 @@ const SERVER_BASE_URL =
|
||||
process.env.REACT_APP_SERVER_BASE_URL ||
|
||||
(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 {
|
||||
SERVER_BASE_URL,
|
||||
FETCH_OPTIONS,
|
||||
ACCESS_TOKEN_KEY,
|
||||
ACCESS_TOKEN_EXPIRES,
|
||||
POSITION_GAP,
|
||||
ACTIONS_LIMIT,
|
||||
};
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
const BOARD = 'BOARD';
|
||||
const LIST = 'LIST';
|
||||
const CARD = 'CARD';
|
||||
const TASK = 'TASK';
|
||||
|
||||
export default {
|
||||
BOARD,
|
||||
LIST,
|
||||
CARD,
|
||||
TASK,
|
||||
};
|
||||
|
||||
@@ -31,11 +31,18 @@ export default {
|
||||
USER_UPDATE: `${PREFIX}/USER_UPDATE`,
|
||||
CURRENT_USER_UPDATE: `${PREFIX}/CURRENT_USER_UPDATE`,
|
||||
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`,
|
||||
USER_EMAIL_UPDATE_ERROR_CLEAR: `${PREFIX}/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`,
|
||||
USER_PASSWORD_UPDATE_ERROR_CLEAR: `${PREFIX}/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`,
|
||||
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_AVATAR_UPDATE: `${PREFIX}/CURRENT_USER_AVATAR_UPDATE`,
|
||||
USER_DELETE: `${PREFIX}/USER_DELETE`,
|
||||
@@ -132,6 +139,7 @@ export default {
|
||||
TASK_CREATE_HANDLE: `${PREFIX}/TASK_CREATE_HANDLE`,
|
||||
TASK_UPDATE: `${PREFIX}/TASK_UPDATE`,
|
||||
TASK_UPDATE_HANDLE: `${PREFIX}/TASK_UPDATE_HANDLE`,
|
||||
TASK_MOVE: `${PREFIX}/TASK_MOVE`,
|
||||
TASK_DELETE: `${PREFIX}/TASK_DELETE`,
|
||||
TASK_DELETE_HANDLE: `${PREFIX}/TASK_DELETE_HANDLE`,
|
||||
|
||||
@@ -147,6 +155,7 @@ export default {
|
||||
/* Actions */
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
@@ -32,8 +32,10 @@ import {
|
||||
fetchActionsInCurrentCard,
|
||||
fetchBoard,
|
||||
moveCurrentCard,
|
||||
moveTask,
|
||||
removeLabelFromCurrentCard,
|
||||
removeUserFromCurrentCard,
|
||||
toggleActionsDetailsInCurrentCard,
|
||||
transferCurrentCard,
|
||||
updateAttachment,
|
||||
updateCommentAction,
|
||||
@@ -59,6 +61,8 @@ const mapStateToProps = (state) => {
|
||||
timer,
|
||||
isSubscribed,
|
||||
isActionsFetching,
|
||||
isActionsDetailsVisible,
|
||||
isActionsDetailsFetching,
|
||||
isAllActionsFetched,
|
||||
boardId,
|
||||
listId,
|
||||
@@ -78,6 +82,8 @@ const mapStateToProps = (state) => {
|
||||
isSubscribed,
|
||||
isActionsFetching,
|
||||
isAllActionsFetched,
|
||||
isActionsDetailsVisible,
|
||||
isActionsDetailsFetching,
|
||||
listId,
|
||||
boardId,
|
||||
projectId,
|
||||
@@ -111,11 +117,13 @@ const mapDispatchToProps = (dispatch) =>
|
||||
onLabelDelete: deleteLabel,
|
||||
onTaskCreate: createTaskInCurrentCard,
|
||||
onTaskUpdate: updateTask,
|
||||
onTaskMove: moveTask,
|
||||
onTaskDelete: deleteTask,
|
||||
onAttachmentCreate: createAttachmentInCurrentCard,
|
||||
onAttachmentUpdate: updateAttachment,
|
||||
onAttachmentDelete: deleteAttachment,
|
||||
onActionsFetch: fetchActionsInCurrentCard,
|
||||
onActionsDetailsToggle: toggleActionsDetailsInCurrentCard,
|
||||
onCommentActionCreate: createCommentActionInCurrentCard,
|
||||
onCommentActionUpdate: updateCommentAction,
|
||||
onCommentActionDelete: deleteCommentAction,
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
updateCurrentUser,
|
||||
updateCurrentUserAvatar,
|
||||
updateCurrentUserEmail,
|
||||
updateCurrentUserLanguage,
|
||||
updateCurrentUserPassword,
|
||||
updateCurrentUserUsername,
|
||||
} from '../actions/entry';
|
||||
@@ -23,6 +24,7 @@ const mapStateToProps = (state) => {
|
||||
avatarUrl,
|
||||
phone,
|
||||
organization,
|
||||
language,
|
||||
subscribeToOwnCards,
|
||||
isAvatarUpdating,
|
||||
emailUpdateForm,
|
||||
@@ -37,6 +39,7 @@ const mapStateToProps = (state) => {
|
||||
avatarUrl,
|
||||
phone,
|
||||
organization,
|
||||
language,
|
||||
subscribeToOwnCards,
|
||||
isAvatarUpdating,
|
||||
emailUpdateForm,
|
||||
@@ -50,6 +53,7 @@ const mapDispatchToProps = (dispatch) =>
|
||||
{
|
||||
onUpdate: updateCurrentUser,
|
||||
onAvatarUpdate: updateCurrentUserAvatar,
|
||||
onLanguageUpdate: updateCurrentUserLanguage,
|
||||
onUsernameUpdate: updateCurrentUserUsername,
|
||||
onUsernameUpdateMessageDismiss: clearCurrentUserUsernameUpdateError,
|
||||
onEmailUpdate: updateCurrentUserEmail,
|
||||
|
||||
@@ -2,7 +2,17 @@ import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { usersExceptCurrentSelector } from '../selectors';
|
||||
import { closeModal, deleteUser, updateUser } from '../actions/entry';
|
||||
import {
|
||||
clearUserEmailUpdateError,
|
||||
clearUserPasswordUpdateError,
|
||||
clearUserUsernameUpdateError,
|
||||
closeModal,
|
||||
deleteUser,
|
||||
updateUser,
|
||||
updateUserEmail,
|
||||
updateUserPassword,
|
||||
updateUserUsername,
|
||||
} from '../actions/entry';
|
||||
import UsersModal from '../components/UsersModal';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
@@ -17,6 +27,12 @@ const mapDispatchToProps = (dispatch) =>
|
||||
bindActionCreators(
|
||||
{
|
||||
onUpdate: updateUser,
|
||||
onUsernameUpdate: updateUserUsername,
|
||||
onUsernameUpdateMessageDismiss: clearUserUsernameUpdateError,
|
||||
onEmailUpdate: updateUserEmail,
|
||||
onEmailUpdateMessageDismiss: clearUserEmailUpdateError,
|
||||
onPasswordUpdate: updateUserPassword,
|
||||
onPasswordUpdateMessageDismiss: clearUserPasswordUpdateError,
|
||||
onDelete: deleteUser,
|
||||
onClose: closeModal,
|
||||
},
|
||||
|
||||
+35
-16
@@ -1,11 +1,11 @@
|
||||
import i18n from 'i18next';
|
||||
import languageDetector from 'i18next-browser-languagedetector';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import formatDate from 'date-fns/format';
|
||||
import parseDate from 'date-fns/parse';
|
||||
import { registerLocale, setDefaultLocale } from 'react-datepicker';
|
||||
|
||||
import { embedLocales, languages } from './locales';
|
||||
import { embeddedLocales, languages } from './locales';
|
||||
|
||||
i18n.dateFns = {
|
||||
locales: {},
|
||||
@@ -52,13 +52,13 @@ const parseDatePostProcessor = {
|
||||
};
|
||||
|
||||
i18n
|
||||
.use(languageDetector)
|
||||
.use(LanguageDetector)
|
||||
.use(formatDatePostProcessor)
|
||||
.use(parseDatePostProcessor)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources: embedLocales,
|
||||
fallbackLng: false,
|
||||
resources: embeddedLocales,
|
||||
fallbackLng: 'en',
|
||||
supportedLngs: languages,
|
||||
load: 'languageOnly',
|
||||
interpolation: {
|
||||
@@ -74,22 +74,41 @@ i18n
|
||||
},
|
||||
},
|
||||
react: {
|
||||
useSuspense: false,
|
||||
useSuspense: true,
|
||||
},
|
||||
debug: process.env.NODE_ENV !== 'production',
|
||||
});
|
||||
|
||||
i18n.loadCoreLocale = (language) =>
|
||||
import(`./locales/${language}/core`).then((module) => {
|
||||
const locale = module.default;
|
||||
i18n.loadCoreLocale = async (language = i18n.resolvedLanguage) => {
|
||||
if (language === 'en') {
|
||||
return;
|
||||
}
|
||||
|
||||
Object.keys(locale).forEach((namespace) => {
|
||||
if (namespace === 'dateFns') {
|
||||
i18n.dateFns.addLocale(language, locale[namespace]);
|
||||
} else {
|
||||
i18n.addResourceBundle(language, namespace, locale[namespace], true, true);
|
||||
}
|
||||
});
|
||||
const { default: locale } = await import(`./locales/${language}/core`);
|
||||
|
||||
Object.keys(locale).forEach((namespace) => {
|
||||
if (namespace === 'dateFns') {
|
||||
i18n.dateFns.addLocale(language, locale[namespace]);
|
||||
} else {
|
||||
i18n.addResourceBundle(language, namespace, locale[namespace], true, true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
i18n.detectLanguage = () => {
|
||||
const {
|
||||
services: { languageDetector, languageUtils },
|
||||
} = i18n;
|
||||
|
||||
localStorage.removeItem(languageDetector.options.lookupLocalStorage);
|
||||
|
||||
const detectedLanguages = languageDetector.detect();
|
||||
|
||||
i18n.language = languageUtils.getBestMatchFromCodes(detectedLanguages);
|
||||
i18n.languages = languageUtils.toResolveHierarchy(i18n.language);
|
||||
|
||||
i18n.resolvedLanguage = undefined;
|
||||
i18n.setResolvedLanguage(i18n.language);
|
||||
};
|
||||
|
||||
export default i18n;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import gfm from 'remark-gfm';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import remarkBreaks from 'remark-breaks';
|
||||
|
||||
import './Markdown.module.scss'; // FIXME: import as styles?
|
||||
|
||||
const Markdown = React.memo(({ linkStopPropagation, ...props }) => {
|
||||
const handleLinkClick = useCallback((event) => {
|
||||
@@ -21,16 +24,21 @@ const Markdown = React.memo(({ linkStopPropagation, ...props }) => {
|
||||
[handleLinkClick],
|
||||
);
|
||||
|
||||
let renderers;
|
||||
|
||||
let components;
|
||||
if (linkStopPropagation) {
|
||||
renderers = {
|
||||
link: linkRenderer,
|
||||
components = {
|
||||
a: linkRenderer,
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
return <ReactMarkdown {...props} plugins={[gfm]} renderers={renderers} />;
|
||||
return (
|
||||
<ReactMarkdown
|
||||
{...props} // eslint-disable-line react/jsx-props-no-spreading
|
||||
components={components}
|
||||
remarkPlugins={[remarkGfm, remarkBreaks]}
|
||||
className="markdown-body"
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
Markdown.propTypes = {
|
||||
|
||||
@@ -0,0 +1,942 @@
|
||||
:global {
|
||||
.markdown-body {
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
margin: 0;
|
||||
/* color: #24292f;
|
||||
background-color: #ffffff;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||
font-size: 16px; */
|
||||
line-height: 1.5;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.markdown-body .octicon {
|
||||
display: inline-block;
|
||||
fill: currentColor;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.markdown-body h1:hover .anchor .octicon-link:before,
|
||||
.markdown-body h2:hover .anchor .octicon-link:before,
|
||||
.markdown-body h3:hover .anchor .octicon-link:before,
|
||||
.markdown-body h4:hover .anchor .octicon-link:before,
|
||||
.markdown-body h5:hover .anchor .octicon-link:before,
|
||||
.markdown-body h6:hover .anchor .octicon-link:before {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
content: ' ';
|
||||
display: inline-block;
|
||||
background-color: currentColor;
|
||||
-webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
|
||||
mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
|
||||
}
|
||||
|
||||
.markdown-body details,
|
||||
.markdown-body figcaption,
|
||||
.markdown-body figure {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.markdown-body summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
.markdown-body [hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.markdown-body a {
|
||||
background-color: transparent;
|
||||
color: #0969da;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body a:active,
|
||||
.markdown-body a:hover {
|
||||
outline-width: 0;
|
||||
}
|
||||
|
||||
.markdown-body abbr[title] {
|
||||
border-bottom: none;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
.markdown-body b,
|
||||
.markdown-body strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.markdown-body h1 {
|
||||
margin: .67em 0;
|
||||
font-weight: 600;
|
||||
padding-bottom: .3em;
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid hsla(210, 18%, 87%, 1);
|
||||
}
|
||||
|
||||
.markdown-body mark {
|
||||
background-color: #fff8c5;
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
.markdown-body small {
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.markdown-body sub,
|
||||
.markdown-body sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.markdown-body sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
.markdown-body sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
.markdown-body img {
|
||||
border-style: none;
|
||||
max-width: 100%;
|
||||
box-sizing: content-box;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.markdown-body code,
|
||||
.markdown-body kbd,
|
||||
.markdown-body pre,
|
||||
.markdown-body samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.markdown-body figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
.markdown-body hr {
|
||||
box-sizing: content-box;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
border-bottom: 1px solid hsla(210, 18%, 87%, 1);
|
||||
height: .25em;
|
||||
padding: 0;
|
||||
margin: 24px 0;
|
||||
background-color: #d0d7de;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.markdown-body input {
|
||||
font: inherit;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.markdown-body [type=button],
|
||||
.markdown-body [type=reset],
|
||||
.markdown-body [type=submit] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
.markdown-body [type=button]::-moz-focus-inner,
|
||||
.markdown-body [type=reset]::-moz-focus-inner,
|
||||
.markdown-body [type=submit]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body [type=button]:-moz-focusring,
|
||||
.markdown-body [type=reset]:-moz-focusring,
|
||||
.markdown-body [type=submit]:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
.markdown-body [type=checkbox],
|
||||
.markdown-body [type=radio] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body [type=number]::-webkit-inner-spin-button,
|
||||
.markdown-body [type=number]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.markdown-body [type=search] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.markdown-body [type=search]::-webkit-search-cancel-button,
|
||||
.markdown-body [type=search]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.markdown-body ::-webkit-input-placeholder {
|
||||
color: inherit;
|
||||
opacity: .54;
|
||||
}
|
||||
|
||||
.markdown-body ::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.markdown-body a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.markdown-body hr::before {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.markdown-body hr::after {
|
||||
display: table;
|
||||
clear: both;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.markdown-body table {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
display: block;
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.markdown-body td,
|
||||
.markdown-body th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body details summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.markdown-body details:not([open])>*:not(summary) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.markdown-body kbd {
|
||||
display: inline-block;
|
||||
padding: 3px 5px;
|
||||
font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
||||
line-height: 10px;
|
||||
color: #24292f;
|
||||
vertical-align: middle;
|
||||
background-color: #f6f8fa;
|
||||
border: solid 1px rgba(175, 184, 193, 0.2);
|
||||
border-bottom-color: rgba(175, 184, 193, 0.2);
|
||||
border-radius: 6px;
|
||||
box-shadow: inset 0 -1px 0 rgba(175, 184, 193, 0.2);
|
||||
}
|
||||
|
||||
.markdown-body h1,
|
||||
.markdown-body h2,
|
||||
.markdown-body h3,
|
||||
.markdown-body h4,
|
||||
.markdown-body h5,
|
||||
.markdown-body h6 {
|
||||
margin-top: 24px;
|
||||
margin-bottom: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.markdown-body h2 {
|
||||
font-weight: 600;
|
||||
padding-bottom: .3em;
|
||||
font-size: 1.5em;
|
||||
border-bottom: 1px solid hsla(210, 18%, 87%, 1);
|
||||
}
|
||||
|
||||
.markdown-body h3 {
|
||||
font-weight: 600;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.markdown-body h4 {
|
||||
font-weight: 600;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.markdown-body h5 {
|
||||
font-weight: 600;
|
||||
font-size: .875em;
|
||||
}
|
||||
|
||||
.markdown-body h6 {
|
||||
font-weight: 600;
|
||||
font-size: .85em;
|
||||
color: #57606a;
|
||||
}
|
||||
|
||||
.markdown-body p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.markdown-body blockquote {
|
||||
margin: 0;
|
||||
padding: 0 1em;
|
||||
color: #57606a;
|
||||
border-left: .25em solid #d0d7de;
|
||||
}
|
||||
|
||||
.markdown-body ul,
|
||||
.markdown-body ol {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
.markdown-body ol ol,
|
||||
.markdown-body ul ol {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
|
||||
.markdown-body ul ul ol,
|
||||
.markdown-body ul ol ol,
|
||||
.markdown-body ol ul ol,
|
||||
.markdown-body ol ol ol {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
|
||||
.markdown-body dd {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.markdown-body tt,
|
||||
.markdown-body code {
|
||||
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown-body pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
||||
font-size: 12px;
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
.markdown-body .octicon {
|
||||
display: inline-block;
|
||||
overflow: visible !important;
|
||||
vertical-align: text-bottom;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.markdown-body ::placeholder {
|
||||
color: #6e7781;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.markdown-body input::-webkit-outer-spin-button,
|
||||
.markdown-body input::-webkit-inner-spin-button {
|
||||
margin: 0;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c {
|
||||
color: #6e7781;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c1,
|
||||
.markdown-body .pl-s .pl-v {
|
||||
color: #0550ae;
|
||||
}
|
||||
|
||||
.markdown-body .pl-e,
|
||||
.markdown-body .pl-en {
|
||||
color: #8250df;
|
||||
}
|
||||
|
||||
.markdown-body .pl-smi,
|
||||
.markdown-body .pl-s .pl-s1 {
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ent {
|
||||
color: #116329;
|
||||
}
|
||||
|
||||
.markdown-body .pl-k {
|
||||
color: #cf222e;
|
||||
}
|
||||
|
||||
.markdown-body .pl-s,
|
||||
.markdown-body .pl-pds,
|
||||
.markdown-body .pl-s .pl-pse .pl-s1,
|
||||
.markdown-body .pl-sr,
|
||||
.markdown-body .pl-sr .pl-cce,
|
||||
.markdown-body .pl-sr .pl-sre,
|
||||
.markdown-body .pl-sr .pl-sra {
|
||||
color: #0a3069;
|
||||
}
|
||||
|
||||
.markdown-body .pl-v,
|
||||
.markdown-body .pl-smw {
|
||||
color: #953800;
|
||||
}
|
||||
|
||||
.markdown-body .pl-bu {
|
||||
color: #82071e;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ii {
|
||||
color: #f6f8fa;
|
||||
background-color: #82071e;
|
||||
}
|
||||
|
||||
.markdown-body .pl-c2 {
|
||||
color: #f6f8fa;
|
||||
background-color: #cf222e;
|
||||
}
|
||||
|
||||
.markdown-body .pl-sr .pl-cce {
|
||||
font-weight: bold;
|
||||
color: #116329;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ml {
|
||||
color: #3b2300;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mh,
|
||||
.markdown-body .pl-mh .pl-en,
|
||||
.markdown-body .pl-ms {
|
||||
font-weight: bold;
|
||||
color: #0550ae;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mi {
|
||||
font-style: italic;
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mb {
|
||||
font-weight: bold;
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
.markdown-body .pl-md {
|
||||
color: #82071e;
|
||||
background-color: #FFEBE9;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mi1 {
|
||||
color: #116329;
|
||||
background-color: #dafbe1;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mc {
|
||||
color: #953800;
|
||||
background-color: #ffd8b5;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mi2 {
|
||||
color: #eaeef2;
|
||||
background-color: #0550ae;
|
||||
}
|
||||
|
||||
.markdown-body .pl-mdr {
|
||||
font-weight: bold;
|
||||
color: #8250df;
|
||||
}
|
||||
|
||||
.markdown-body .pl-ba {
|
||||
color: #57606a;
|
||||
}
|
||||
|
||||
.markdown-body .pl-sg {
|
||||
color: #8c959f;
|
||||
}
|
||||
|
||||
.markdown-body .pl-corl {
|
||||
text-decoration: underline;
|
||||
color: #0a3069;
|
||||
}
|
||||
|
||||
.markdown-body [data-catalyst] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.markdown-body g-emoji {
|
||||
font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-size: 1em;
|
||||
font-style: normal !important;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
vertical-align: -0.075em;
|
||||
}
|
||||
|
||||
.markdown-body g-emoji img {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
.markdown-body::before {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.markdown-body::after {
|
||||
display: table;
|
||||
clear: both;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.markdown-body>*:first-child {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.markdown-body>*:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.markdown-body a:not([href]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body .absent {
|
||||
color: #cf222e;
|
||||
}
|
||||
|
||||
.markdown-body .anchor {
|
||||
float: left;
|
||||
padding-right: 4px;
|
||||
margin-left: -20px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.markdown-body .anchor:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.markdown-body p,
|
||||
.markdown-body blockquote,
|
||||
.markdown-body ul,
|
||||
.markdown-body ol,
|
||||
.markdown-body dl,
|
||||
.markdown-body table,
|
||||
.markdown-body pre,
|
||||
.markdown-body details {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.markdown-body blockquote>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body blockquote>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.markdown-body sup>a::before {
|
||||
content: "[";
|
||||
}
|
||||
|
||||
.markdown-body sup>a::after {
|
||||
content: "]";
|
||||
}
|
||||
|
||||
.markdown-body h1 .octicon-link,
|
||||
.markdown-body h2 .octicon-link,
|
||||
.markdown-body h3 .octicon-link,
|
||||
.markdown-body h4 .octicon-link,
|
||||
.markdown-body h5 .octicon-link,
|
||||
.markdown-body h6 .octicon-link {
|
||||
color: #24292f;
|
||||
vertical-align: middle;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.markdown-body h1:hover .anchor,
|
||||
.markdown-body h2:hover .anchor,
|
||||
.markdown-body h3:hover .anchor,
|
||||
.markdown-body h4:hover .anchor,
|
||||
.markdown-body h5:hover .anchor,
|
||||
.markdown-body h6:hover .anchor {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body h1:hover .anchor .octicon-link,
|
||||
.markdown-body h2:hover .anchor .octicon-link,
|
||||
.markdown-body h3:hover .anchor .octicon-link,
|
||||
.markdown-body h4:hover .anchor .octicon-link,
|
||||
.markdown-body h5:hover .anchor .octicon-link,
|
||||
.markdown-body h6:hover .anchor .octicon-link {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.markdown-body h1 tt,
|
||||
.markdown-body h1 code,
|
||||
.markdown-body h2 tt,
|
||||
.markdown-body h2 code,
|
||||
.markdown-body h3 tt,
|
||||
.markdown-body h3 code,
|
||||
.markdown-body h4 tt,
|
||||
.markdown-body h4 code,
|
||||
.markdown-body h5 tt,
|
||||
.markdown-body h5 code,
|
||||
.markdown-body h6 tt,
|
||||
.markdown-body h6 code {
|
||||
padding: 0 .2em;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.markdown-body ul.no-list,
|
||||
.markdown-body ol.no-list {
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.markdown-body ol[type="1"] {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.markdown-body ol[type=a] {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
|
||||
.markdown-body ol[type=i] {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
|
||||
.markdown-body div>ol:not([type]) {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.markdown-body ul ul,
|
||||
.markdown-body ul ol,
|
||||
.markdown-body ol ol,
|
||||
.markdown-body ol ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.markdown-body li>p {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.markdown-body li+li {
|
||||
margin-top: .25em;
|
||||
}
|
||||
|
||||
.markdown-body dl {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-body dl dt {
|
||||
padding: 0;
|
||||
margin-top: 16px;
|
||||
font-size: 1em;
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body dl dd {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.markdown-body table th {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown-body table th,
|
||||
.markdown-body table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #d0d7de;
|
||||
}
|
||||
|
||||
.markdown-body table tr {
|
||||
background-color: #ffffff;
|
||||
border-top: 1px solid hsla(210, 18%, 87%, 1);
|
||||
}
|
||||
|
||||
.markdown-body table tr:nth-child(2n) {
|
||||
background-color: #f6f8fa;
|
||||
}
|
||||
|
||||
.markdown-body table img {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.markdown-body img[align=right] {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.markdown-body img[align=left] {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.markdown-body .emoji {
|
||||
max-width: none;
|
||||
vertical-align: text-top;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.markdown-body span.frame {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markdown-body span.frame>span {
|
||||
display: block;
|
||||
float: left;
|
||||
width: auto;
|
||||
padding: 7px;
|
||||
margin: 13px 0 0;
|
||||
overflow: hidden;
|
||||
border: 1px solid #d0d7de;
|
||||
}
|
||||
|
||||
.markdown-body span.frame span img {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.markdown-body span.frame span span {
|
||||
display: block;
|
||||
padding: 5px 0 0;
|
||||
clear: both;
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
.markdown-body span.align-center {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown-body span.align-center>span {
|
||||
display: block;
|
||||
margin: 13px auto 0;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.markdown-body span.align-center span img {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.markdown-body span.align-right {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown-body span.align-right>span {
|
||||
display: block;
|
||||
margin: 13px 0 0;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.markdown-body span.align-right span img {
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.markdown-body span.float-left {
|
||||
display: block;
|
||||
float: left;
|
||||
margin-right: 13px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markdown-body span.float-left span {
|
||||
margin: 13px 0 0;
|
||||
}
|
||||
|
||||
.markdown-body span.float-right {
|
||||
display: block;
|
||||
float: right;
|
||||
margin-left: 13px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markdown-body span.float-right>span {
|
||||
display: block;
|
||||
margin: 13px auto 0;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.markdown-body code,
|
||||
.markdown-body tt {
|
||||
padding: .2em .4em;
|
||||
margin: 0;
|
||||
font-size: 85%;
|
||||
background-color: rgba(175, 184, 193, 0.2);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.markdown-body code br,
|
||||
.markdown-body tt br {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.markdown-body del code {
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.markdown-body pre code {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.markdown-body pre>code {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
word-break: normal;
|
||||
white-space: pre;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.markdown-body .highlight {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.markdown-body .highlight pre {
|
||||
margin-bottom: 0;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.markdown-body .highlight pre,
|
||||
.markdown-body pre {
|
||||
padding: 16px;
|
||||
overflow: auto;
|
||||
font-size: 85%;
|
||||
line-height: 1.45;
|
||||
background-color: #f6f8fa;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.markdown-body pre code,
|
||||
.markdown-body pre tt {
|
||||
display: inline;
|
||||
max-width: auto;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
line-height: inherit;
|
||||
word-wrap: normal;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.markdown-body .csv-data td,
|
||||
.markdown-body .csv-data th {
|
||||
padding: 5px;
|
||||
overflow: hidden;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.markdown-body .csv-data .blob-num {
|
||||
padding: 10px 8px 9px;
|
||||
text-align: right;
|
||||
background: #ffffff;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.markdown-body .csv-data tr {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body .csv-data th {
|
||||
font-weight: 600;
|
||||
background: #f6f8fa;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.markdown-body .footnotes {
|
||||
font-size: 12px;
|
||||
color: #57606a;
|
||||
border-top: 1px solid #d0d7de;
|
||||
}
|
||||
|
||||
.markdown-body .footnotes ol {
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
.markdown-body .footnotes li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.markdown-body .footnotes li:target::before {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
bottom: -8px;
|
||||
left: -24px;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
border: 2px solid #0969da;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.markdown-body .footnotes li:target {
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
.markdown-body .footnotes .data-footnote-backref g-emoji {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item label {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item.enabled label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item+.task-list-item {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item .handle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.markdown-body .task-list-item-checkbox {
|
||||
margin: 0 .2em .25em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox {
|
||||
margin: 0 -1.6em .25em .2em;
|
||||
}
|
||||
|
||||
.markdown-body ::-webkit-calendar-picker-indicator {
|
||||
filter: invert(50%);
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,10 @@ export default {
|
||||
actions: 'Akce',
|
||||
addAttachment_title: 'Přidat přílohu',
|
||||
addComment: 'Přidat komentář',
|
||||
addManager_title: 'Přidat vedoucího',
|
||||
addMember_title: 'Přidat člena',
|
||||
addUser_title: 'Přidat uživatele',
|
||||
administrator: 'Administrator',
|
||||
administrator: 'Administrátor',
|
||||
all: 'Vše',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored:
|
||||
'Všechny změny budou automaticky uloženy<br />po obnově spojení',
|
||||
@@ -32,11 +33,16 @@ export default {
|
||||
areYouSureYouWantToDeleteThisProject: 'Opravdu chcete smazat tento projekt?',
|
||||
areYouSureYouWantToDeleteThisTask: 'Opravdu chcete smazat tento úkol?',
|
||||
areYouSureYouWantToDeleteThisUser: 'Opravdu chcete smazat tohoto uživatele?',
|
||||
areYouSureYouWantToRemoveThisMemberFromProject:
|
||||
'Opravdu chcete odstranit tohoto člena z projektu?',
|
||||
areYouSureYouWantToLeaveBoard: 'Opravdu chcete opustit tuto tabuli?',
|
||||
areYouSureYouWantToLeaveProject: 'Opravdu chcete opustit projekt?',
|
||||
areYouSureYouWantToRemoveThisManagerFromProject:
|
||||
'Are you sure you want to remove this manager from the project?',
|
||||
areYouSureYouWantToRemoveThisMemberFromBoard:
|
||||
'Opravdu chcete odstranit tohoto člena z tabule?',
|
||||
attachment: 'Příloha',
|
||||
attachments: 'Přílohy',
|
||||
authentication: 'Ověření',
|
||||
background: 'Pozadí',
|
||||
board: 'Tabule',
|
||||
boardNotFound_title: 'Tabule nenalezena',
|
||||
cardActions_title: 'Akce na kartě',
|
||||
@@ -49,6 +55,7 @@ export default {
|
||||
createProject_title: 'Vytvořit projekt',
|
||||
createTextFile_title: 'Vytvořit textový soubor',
|
||||
currentPassword: 'Aktuální heslo',
|
||||
dangerZone_title: 'Nebezpečná zóna',
|
||||
date: 'Datum',
|
||||
dueDate_title: 'Termín do',
|
||||
deleteAttachment_title: 'Smazat přílohu',
|
||||
@@ -82,11 +89,15 @@ export default {
|
||||
filterByLabels_title: 'Filtruj podle štítku',
|
||||
filterByMembers_title: 'Filtruj podle člena',
|
||||
fromComputer_title: 'Z počítače',
|
||||
general: 'Obecné',
|
||||
hours: 'Hodiny',
|
||||
invalidCurrentPassword: 'Neplatné aktuální heslo',
|
||||
labels: 'Štítky',
|
||||
leaveBoard_title: 'Opustit tabuli',
|
||||
leaveProject_title: 'Opustit projekt',
|
||||
list: 'Seznam',
|
||||
listActions_title: 'Seznam akcí',
|
||||
managers: 'Vedoucí',
|
||||
members: 'Členové',
|
||||
minutes: 'Minuty',
|
||||
moveCard_title: 'Přesunout kartu',
|
||||
@@ -109,6 +120,7 @@ export default {
|
||||
'Tip: dejte Ctrl-V (Cmd-V na Mac) pro vložení přílohy ze schránky.',
|
||||
project: 'Projekt',
|
||||
projectNotFound_title: 'Projekt nenalezen',
|
||||
removeManager_title: 'Odstranit vedoucího',
|
||||
removeMember_title: 'Odstranit člena',
|
||||
seconds: 'Vteřin',
|
||||
selectBoard: 'Vybrat tabuli',
|
||||
@@ -174,6 +186,8 @@ export default {
|
||||
editTimer_title: 'Upravit časovač',
|
||||
editTitle_title: 'Upravit titulek',
|
||||
editUsername_title: 'Upravit uživatelské jméno',
|
||||
leaveBoard: 'Opustit tabuli',
|
||||
leaveProject: 'Opustit projekt',
|
||||
logOut_title: 'Odhlásit se',
|
||||
makeCover_title: 'Vytvořit obal',
|
||||
move: 'Přesunout',
|
||||
@@ -181,7 +195,9 @@ export default {
|
||||
remove: 'Odstranit',
|
||||
removeBackground: 'Odstranit pozadí',
|
||||
removeCover_title: 'Odstranit obal',
|
||||
removeFromBoard: 'Odstranit z tabule',
|
||||
removeFromProject: 'Odstranit z projektu',
|
||||
removeManager: 'Odstranit vedoucího',
|
||||
removeMember: 'Odstranit člena',
|
||||
save: 'Uložit',
|
||||
showAllAttachments: 'Zozbrazit všechny přílohy ({{hidden}} skryté)',
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import login from './login';
|
||||
|
||||
export default {
|
||||
language: 'cs',
|
||||
country: 'cz',
|
||||
name: 'Čeština',
|
||||
embeddedLocale: login,
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user