Compare commits

...
19 Commits
Author SHA1 Message Date
Maksim Eltyshev 90c8b4d548 chore: Update version 2022-12-15 01:39:00 +01:00
Maksim Eltyshev 4941b51fa4 fix: Prevent popup from overflowing 2022-12-15 01:38:03 +01:00
Maksim Eltyshev a858419f3c fix: Fix router synchronization with redux store 2022-12-15 01:34:48 +01:00
Maksim Eltyshev e28c06b85a fix: Fix type of omit flag 2022-11-30 03:15:02 +01:00
Maksim Eltyshev fa2d73a2c5 chore: Update version 2022-11-30 02:55:25 +01:00
Maksim Eltyshev 80706bbdd5 meta: Update link to container registry 2022-11-30 02:53:06 +01:00
Maksim Eltyshev db4e5a89f9 fix: Improve building 2022-11-30 02:50:38 +01:00
Maksim Eltyshev 0266e4bfe2 meta: Import from Trello 2022-11-28 14:07:55 +01:00
Maksim Eltyshev 02c26cfb4d ci: Update alpine version 2022-11-21 20:11:45 +01:00
Maksim Eltyshev ef096499a2 chore: Update alpine and vips version 2022-11-21 18:11:00 +01:00
Maksim Eltyshev a007e1d065 chore: Update version 2022-11-21 17:13:11 +01:00
Maksim Eltyshev c181731870 fix: Fix card repositioning
Closes #340
2022-11-21 17:07:51 +01:00
dependabot[bot] 54c57a08c3 chore(deps): Bump minimatch and recursive-readdir in /client (#338)
Bumps [minimatch](https://github.com/isaacs/minimatch) and [recursive-readdir](https://github.com/jergason/recursive-readdir). These dependencies needed to be updated together.

Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

Updates `recursive-readdir` from 2.2.2 to 2.2.3
- [Release notes](https://github.com/jergason/recursive-readdir/releases)
- [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 05:23:28 +05:00
dependabot[bot] 65abd7c9ab chore(deps): Bump socket.io-parser from 3.3.2 to 3.3.3 in /client (#326)
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/3.3.2...3.3.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 05:23:17 +05:00
dependabot[bot] 5fc811d2ef chore(deps): Bump socket.io-parser from 3.3.2 to 3.3.3 in /server (#322)
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/3.3.2...3.3.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 05:23:04 +05:00
Maksim Eltyshev 5afd4af897 ref: Little refactoring 2022-11-21 01:12:32 +01:00
Maksim Eltyshev ac0a3d9ae7 fix: Fix client build 2022-11-21 01:06:41 +01:00
Maksim Eltyshev b0d23373c0 chore: Update dependencies 2022-11-21 00:54:05 +01:00
Rafly Maulana 5381d45e50 meta: Share global eslint config, move prettier config (#339) 2022-11-21 00:22:01 +05:00
33 changed files with 14428 additions and 16141 deletions
+23 -5
View File
@@ -1,11 +1,29 @@
*/node_modules
*/.gitignore
*/README.md */README.md
*/.gitignore
*/node_modules
**/.DS_Store **/.DS_Store
**/.gitkeep
server/**/.gitkeep
server/.env
server/.editorconfig
server/.eslintignore
server/.npmrc
server/test
server/logs
server/.tmp
server/views/*
server/public/* server/public/*
server/views/* !server/public/user-avatars
server/logs server/public/user-avatars/*
!server/public/project-background-images
server/public/project-background-images/*
server/private/*
!server/private/attachments
server/private/attachments/*
client/build client/build
@@ -9,7 +9,7 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
ALPINE_VERSION: 3.15 ALPINE_VERSION: 3.16
jobs: jobs:
build-and-push-docker-base-image: build-and-push-docker-base-image:
+7
View File
@@ -3,3 +3,10 @@ docker-compose.override.yml
.idea .idea
.DS_Store .DS_Store
# Prevent another lockfile than package-lock.json (npm) from being created
# If some case you are using pnpm or yarn, don't forget to generate npm lockfile
# before commiting your code by running:
# `npm i --package-lock-only`
pnpm-lock.yaml
yarn.lock
+22 -14
View File
@@ -1,32 +1,40 @@
FROM node:lts AS client-builder FROM ghcr.io/plankanban/planka:base-latest as server-dependencies
WORKDIR /app WORKDIR /app
COPY client/package.json client/package-lock.json ./ COPY server/package.json server/package-lock.json .
RUN npm install npm@latest --global \ RUN npm install npm@latest --global \
&& npm install && npm clean-install --omit=dev
FROM node:lts AS client
WORKDIR /app
COPY client/package.json client/package-lock.json .
RUN npm install npm@latest --global \
&& npm clean-install --omit=dev
COPY client . COPY client .
RUN npm run build RUN DISABLE_ESLINT_PLUGIN=true npm run build
FROM ghcr.io/plankanban/planka:base-latest FROM ghcr.io/plankanban/planka:base-latest
RUN apk del vips-dependencies --purge
USER node
WORKDIR /app WORKDIR /app
COPY server/.npmrc server/package.json server/package-lock.json ./ COPY --chown=node:node docker-start.sh start.sh
COPY --chown=node:node server .
RUN npm install npm@latest --global \ RUN mv .env.sample .env
&& npm install --production \
&& apk del vips-dependencies --purge
COPY docker-start.sh start.sh COPY --from=server-dependencies --chown=node:node /app/node_modules node_modules
COPY server .
RUN cp .env.sample .env COPY --from=client --chown=node:node /app/build public
COPY --from=client --chown=node:node /app/build/index.html views/index.ejs
COPY --from=client-builder /app/build public
COPY --from=client-builder /app/build/index.html views/index.ejs
VOLUME /app/public/user-avatars VOLUME /app/public/user-avatars
VOLUME /app/public/project-background-images VOLUME /app/public/project-background-images
+2 -2
View File
@@ -1,7 +1,7 @@
FROM node:lts-alpine FROM node:lts-alpine
ARG ALPINE_VERSION=3.15 ARG ALPINE_VERSION=3.16
ARG VIPS_VERSION=8.12.2 ARG VIPS_VERSION=8.13.3
RUN apk -U upgrade \ RUN apk -U upgrade \
&& apk add \ && apk add \
+5 -1
View File
@@ -28,7 +28,7 @@ There are 2 types of installation:
### 1. Docker Compose ### 1. Docker Compose
[![](https://d207aa93qlcgug.cloudfront.net/1.95.5.qa/img/nav/docker-logo-loggedout.png)](https://hub.docker.com/r/meltyshev/planka) [![](https://d207aa93qlcgug.cloudfront.net/1.95.5.qa/img/nav/docker-logo-loggedout.png)](https://github.com/plankanban/planka/pkgs/container/planka)
- Make sure you have [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) installed and operational. - Make sure you have [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) installed and operational.
- Create `docker-compose.yml` based on [the example](https://raw.githubusercontent.com/plankanban/planka/master/docker-compose.yml). This is the ONLY file you will need. You can create this file on your own machine by copy and pasting the content. - Create `docker-compose.yml` based on [the example](https://raw.githubusercontent.com/plankanban/planka/master/docker-compose.yml). This is the ONLY file you will need. You can create this file on your own machine by copy and pasting the content.
@@ -259,6 +259,10 @@ Restart the fail2ban service. You can check the status of your Planka jail by ru
fail2ban-client status planka fail2ban-client status planka
``` ```
### Import from Trello
It is not yet implemented inside Planka, but for now you can use the great tool [trello2planka](https://github.com/christophenne/trello2planka) to do the import.
## Development ## Development
Clone the repository and install dependencies: Clone the repository and install dependencies:
+11220 -14587
View File
File diff suppressed because it is too large Load Diff
+29 -43
View File
@@ -34,15 +34,13 @@
}, },
"requireConfigFile": false "requireConfigFile": false
}, },
"plugins": [
"prettier"
],
"extends": [ "extends": [
"airbnb", "airbnb",
"airbnb/hooks", "airbnb/hooks",
"plugin:prettier/recommended" "../package.json"
], ],
"rules": { "rules": {
"no-unused-vars": "warn",
"import/no-extraneous-dependencies": [ "import/no-extraneous-dependencies": [
"error", "error",
{ {
@@ -51,78 +49,66 @@
"**/*.test.js" "**/*.test.js"
] ]
} }
],
"prettier/prettier": [
"error",
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all"
}
] ]
} }
}, },
"dependencies": { "dependencies": {
"@juggle/resize-observer": "^3.4.0", "@juggle/resize-observer": "^3.4.0",
"classnames": "^2.3.1", "classnames": "^2.3.2",
"connected-react-router": "^6.9.3", "date-fns": "^2.29.3",
"date-fns": "^2.29.1",
"dequal": "^2.0.3", "dequal": "^2.0.3",
"easymde": "^2.18.0", "easymde": "^2.18.0",
"history": "^4.10.1", "history": "^5.3.0",
"i18next": "^21.8.14", "i18next": "^22.0.6",
"i18next-browser-languagedetector": "^6.1.4", "i18next-browser-languagedetector": "^7.0.1",
"initials": "^3.1.2", "initials": "^3.1.2",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"node-sass": "^7.0.1", "node-sass": "^8.0.0",
"photoswipe": "^5.3.0", "photoswipe": "^5.3.3",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"react": "^17.0.2", "react": "^18.2.0",
"react-beautiful-dnd": "^13.1.0", "react-app-rewired": "^2.2.1",
"react-beautiful-dnd": "^13.1.1",
"react-datepicker": "^4.8.0", "react-datepicker": "^4.8.0",
"react-dom": "^17.0.2", "react-dom": "^18.2.0",
"react-dropzone": "^14.2.2", "react-dropzone": "^14.2.3",
"react-i18next": "^11.18.1", "react-i18next": "^12.0.0",
"react-input-mask": "^2.0.4", "react-input-mask": "^2.0.4",
"react-markdown": "^8.0.3", "react-markdown": "^8.0.3",
"react-photoswipe-gallery": "^2.2.1", "react-photoswipe-gallery": "^2.2.2",
"react-redux": "^7.2.8", "react-redux": "^8.0.5",
"react-router-dom": "^5.3.1", "react-router-dom": "^6.4.3",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"react-simplemde-editor": "^5.2.0", "react-simplemde-editor": "^5.2.0",
"react-textarea-autosize": "^8.3.4", "react-textarea-autosize": "^8.4.0",
"redux": "^4.2.0", "redux": "^4.2.0",
"redux-logger": "^3.0.6", "redux-logger": "^3.0.6",
"redux-orm": "^0.16.2", "redux-orm": "^0.16.2",
"redux-saga": "^1.1.3", "redux-saga": "^1.2.1",
"remark-breaks": "^3.0.2", "remark-breaks": "^3.0.2",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"reselect": "^4.1.6", "reselect": "^4.1.7",
"sails.io.js": "^1.2.1", "sails.io.js": "^1.2.1",
"semantic-ui-react": "^2.1.3", "semantic-ui-react": "^2.1.3",
"socket.io-client": "^2.3.1", "socket.io-client": "^2.5.0",
"validator": "^13.7.0", "validator": "^13.7.0",
"whatwg-fetch": "^3.6.2", "whatwg-fetch": "^3.6.2",
"zxcvbn": "^4.4.2" "zxcvbn": "^4.4.2"
}, },
"devDependencies": { "devDependencies": {
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"babel-preset-airbnb": "^5.0.0", "babel-preset-airbnb": "^5.0.0",
"chai": "^4.3.6", "chai": "^4.3.7",
"enzyme": "^3.11.0", "eslint": "^8.28.0",
"eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1", "eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.31.11",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"jest-enzyme": "^7.1.2", "react-test-renderer": "^18.2.0"
"prettier": "2.7.1",
"react-app-rewired": "^2.2.1",
"react-test-renderer": "^17.0.2"
} }
} }
+12 -12
View File
@@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { Route, Switch } from 'react-router-dom'; import { Route, Routes } from 'react-router-dom';
import { ConnectedRouter } from 'connected-react-router'; import { ReduxRouter } from '../lib/redux-router';
import Paths from '../constants/Paths'; import Paths from '../constants/Paths';
import LoginContainer from '../containers/LoginContainer'; import LoginContainer from '../containers/LoginContainer';
@@ -19,16 +19,16 @@ import '../styles.module.scss';
function Root({ store, history }) { function Root({ store, history }) {
return ( return (
<Provider store={store}> <Provider store={store}>
<ConnectedRouter history={history}> <ReduxRouter history={history}>
<Switch> <Routes>
<Route exact path={Paths.LOGIN} component={LoginContainer} /> <Route path={Paths.LOGIN} element={<LoginContainer />} />
<Route exact path={Paths.ROOT} component={CoreWrapperContainer} /> <Route path={Paths.ROOT} element={<CoreWrapperContainer />} />
<Route exact path={Paths.PROJECTS} component={CoreWrapperContainer} /> <Route path={Paths.PROJECTS} element={<CoreWrapperContainer />} />
<Route exact path={Paths.BOARDS} component={CoreWrapperContainer} /> <Route path={Paths.BOARDS} element={<CoreWrapperContainer />} />
<Route exact path={Paths.CARDS} component={CoreWrapperContainer} /> <Route path={Paths.CARDS} element={<CoreWrapperContainer />} />
<Route path="*" component={NotFound} /> <Route path="*" element={<NotFound />} />
</Switch> </Routes>
</ConnectedRouter> </ReduxRouter>
</Provider> </Provider>
); );
} }
+1 -1
View File
@@ -1,7 +1,7 @@
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { push } from 'connected-react-router';
import omit from 'lodash/omit'; import omit from 'lodash/omit';
import { push } from '../lib/redux-router';
import selectors from '../selectors'; import selectors from '../selectors';
import entryActions from '../entry-actions'; import entryActions from '../entry-actions';
+3 -2
View File
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom/client';
import store from './store'; import store from './store';
import history from './history'; import history from './history';
@@ -7,4 +7,5 @@ import Root from './components/Root';
import './i18n'; import './i18n';
ReactDOM.render(React.createElement(Root, { store, history }), document.getElementById('root')); const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(React.createElement(Root, { store, history }));
+3 -1
View File
@@ -80,8 +80,10 @@ export default (WrappedComponent, defaultProps) => {
popperModifiers={[ popperModifiers={[
{ {
name: 'preventOverflow', name: 'preventOverflow',
enabled: true,
options: { options: {
boundariesElement: 'window', altAxis: true,
padding: 20,
}, },
}, },
]} ]}
@@ -0,0 +1,46 @@
import React, { useLayoutEffect } from 'react';
import PropTypes from 'prop-types';
import { useDispatch, useSelector } from 'react-redux';
import { Router } from 'react-router-dom';
import { handleLocationChange } from './actions';
function ReduxRouter({ children, history, selector, basename }) {
const state = useSelector(selector);
const dispatch = useDispatch();
useLayoutEffect(() => {
const unlisten = history.listen((nextState) => {
dispatch(handleLocationChange(nextState.location, nextState.action));
});
dispatch(handleLocationChange(history.location, history.action, true));
return unlisten;
}, [history, dispatch]);
return (
<Router
basename={basename}
location={state.location}
navigationType={state.action}
navigator={history}
>
{children}
</Router>
);
}
ReduxRouter.propTypes = {
children: PropTypes.element.isRequired,
history: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
selector: PropTypes.func,
basename: PropTypes.string,
};
ReduxRouter.defaultProps = {
selector: ({ router }) => router,
basename: undefined,
};
export default ReduxRouter;
+28
View File
@@ -0,0 +1,28 @@
export const LOCATION_CHANGE_HANDLE = '@@router/LOCATION_CHANGE_HANDLE';
export const handleLocationChange = (location, action, isFirstRendering = false) => ({
type: LOCATION_CHANGE_HANDLE,
payload: {
location,
action,
isFirstRendering,
},
});
export const HISTORY_METHOD_CALL = '@@router/HISTORY_METHOD_CALL';
const createHistoryMethodCaller = (method) => {
return (...args) => ({
type: HISTORY_METHOD_CALL,
payload: {
method,
args,
},
});
};
export const push = createHistoryMethodCaller('push');
export const replace = createHistoryMethodCaller('replace');
export const go = createHistoryMethodCaller('go');
export const back = createHistoryMethodCaller('back');
export const forward = createHistoryMethodCaller('forward');
@@ -0,0 +1,18 @@
import { HISTORY_METHOD_CALL } from './actions';
const createRouterMiddleware = (history) => {
// eslint-disable-next-line consistent-return
return () => (next) => (action) => {
if (action.type !== HISTORY_METHOD_CALL) {
return next(action);
}
const {
payload: { method, args },
} = action;
history[method](...args);
};
};
export default createRouterMiddleware;
@@ -0,0 +1,28 @@
import { LOCATION_CHANGE_HANDLE } from './actions';
const createRouterReducer = (history) => {
const initialState = {
location: history.location,
action: history.action,
};
return (state = initialState, { type, payload } = {}) => {
if (type === LOCATION_CHANGE_HANDLE) {
const { location, action, isFirstRendering } = payload;
if (isFirstRendering) {
return state;
}
return {
...state,
location,
action,
};
}
return state;
};
};
export default createRouterReducer;
+12
View File
@@ -0,0 +1,12 @@
export {
LOCATION_CHANGE_HANDLE,
HISTORY_METHOD_CALL,
push,
replace,
go,
back,
forward,
} from './actions';
export { default as createRouterReducer } from './create-router-reducer';
export { default as createRouterMiddleware } from './create-router-middleware';
export { default as ReduxRouter } from './ReduxRouter';
+2 -2
View File
@@ -1,4 +1,4 @@
import { LOCATION_CHANGE } from 'connected-react-router'; import { LOCATION_CHANGE_HANDLE } from '../lib/redux-router';
import ActionTypes from '../constants/ActionTypes'; import ActionTypes from '../constants/ActionTypes';
import ModalTypes from '../constants/ModalTypes'; import ModalTypes from '../constants/ModalTypes';
@@ -12,7 +12,7 @@ const initialState = {
// eslint-disable-next-line default-param-last // eslint-disable-next-line default-param-last
export default (state = initialState, { type, payload }) => { export default (state = initialState, { type, payload }) => {
switch (type) { switch (type) {
case LOCATION_CHANGE: case LOCATION_CHANGE_HANDLE:
case ActionTypes.MODAL_CLOSE: case ActionTypes.MODAL_CLOSE:
return { return {
...state, ...state,
+2 -2
View File
@@ -1,5 +1,5 @@
import { connectRouter } from 'connected-react-router'; import { createRouterReducer } from '../lib/redux-router';
import history from '../history'; import history from '../history';
export default connectRouter(history); export default createRouterReducer(history);
+2 -2
View File
@@ -23,9 +23,9 @@ export function* fetchBoardByCurrentPath() {
if (pathsMatch) { if (pathsMatch) {
let boardId; let boardId;
if (pathsMatch.path === Paths.BOARDS) { if (pathsMatch.pattern.path === Paths.BOARDS) {
boardId = pathsMatch.params.id; boardId = pathsMatch.params.id;
} else if (pathsMatch.path === Paths.CARDS) { } else if (pathsMatch.pattern.path === Paths.CARDS) {
({ ({
item: card, item: card,
item: { boardId }, item: { boardId },
+4 -4
View File
@@ -1,5 +1,5 @@
import { call, put, select, take } from 'redux-saga/effects'; import { call, put, select, take } from 'redux-saga/effects';
import { push } from 'connected-react-router'; import { push } from '../../../lib/redux-router';
import request from '../request'; import request from '../request';
import selectors from '../../../selectors'; import selectors from '../../../selectors';
@@ -31,7 +31,7 @@ export function* handleLocationChange() {
return; return;
} }
switch (pathsMatch.path) { switch (pathsMatch.pattern.path) {
case Paths.LOGIN: case Paths.LOGIN:
yield call(goToRoot); yield call(goToRoot);
@@ -58,7 +58,7 @@ export function* handleLocationChange() {
let attachments; let attachments;
let deletedNotifications; let deletedNotifications;
switch (pathsMatch.path) { switch (pathsMatch.pattern.path) {
case Paths.BOARDS: case Paths.BOARDS:
case Paths.CARDS: { case Paths.CARDS: {
const currentBoard = yield select(selectors.selectCurrentBoard); const currentBoard = yield select(selectors.selectCurrentBoard);
@@ -85,7 +85,7 @@ export function* handleLocationChange() {
} catch (error) {} // eslint-disable-line no-empty } catch (error) {} // eslint-disable-line no-empty
} }
if (pathsMatch.path === Paths.CARDS) { if (pathsMatch.pattern.path === Paths.CARDS) {
const notificationIds = yield select(selectors.selectNotificationIdsForCurrentCard); const notificationIds = yield select(selectors.selectNotificationIdsForCurrentCard);
if (notificationIds && notificationIds.length > 0) { if (notificationIds && notificationIds.length > 0) {
+2 -2
View File
@@ -1,8 +1,8 @@
import { takeEvery } from 'redux-saga/effects'; import { takeEvery } from 'redux-saga/effects';
import { LOCATION_CHANGE } from 'connected-react-router'; import { LOCATION_CHANGE_HANDLE } from '../../../lib/redux-router';
import services from '../services'; import services from '../services';
export default function* routerWatchers() { export default function* routerWatchers() {
yield takeEvery(LOCATION_CHANGE, () => services.handleLocationChange()); yield takeEvery(LOCATION_CHANGE_HANDLE, () => services.handleLocationChange());
} }
+2 -2
View File
@@ -1,5 +1,5 @@
import { call, put, select } from 'redux-saga/effects'; import { call, put, select } from 'redux-saga/effects';
import { push } from 'connected-react-router'; import { push } from '../../../lib/redux-router';
import selectors from '../../../selectors'; import selectors from '../../../selectors';
import Paths from '../../../constants/Paths'; import Paths from '../../../constants/Paths';
@@ -19,7 +19,7 @@ export function* handleLocationChange() {
return; return;
} }
switch (pathsMatch.path) { switch (pathsMatch.pattern.path) {
case Paths.ROOT: case Paths.ROOT:
case Paths.PROJECTS: case Paths.PROJECTS:
case Paths.BOARDS: case Paths.BOARDS:
+2 -2
View File
@@ -1,8 +1,8 @@
import { takeEvery } from 'redux-saga/effects'; import { takeEvery } from 'redux-saga/effects';
import { LOCATION_CHANGE } from 'connected-react-router'; import { LOCATION_CHANGE_HANDLE } from '../../../lib/redux-router';
import services from '../services'; import services from '../services';
export default function* routerWatchers() { export default function* routerWatchers() {
yield takeEvery(LOCATION_CHANGE, () => services.handleLocationChange()); yield takeEvery(LOCATION_CHANGE_HANDLE, () => services.handleLocationChange());
} }
+1 -1
View File
@@ -22,7 +22,7 @@ export const selectPath = createReduxOrmSelector(
(state) => selectCurrentUserId(state), (state) => selectCurrentUserId(state),
({ Project, Board, Card }, pathsMatch, currentUserId) => { ({ Project, Board, Card }, pathsMatch, currentUserId) => {
if (pathsMatch) { if (pathsMatch) {
switch (pathsMatch.path) { switch (pathsMatch.pattern.path) {
case Paths.PROJECTS: { case Paths.PROJECTS: {
const projectModel = Project.withId(pathsMatch.params.id); const projectModel = Project.withId(pathsMatch.params.id);
+5 -6
View File
@@ -1,6 +1,5 @@
import { configure } from 'enzyme'; // jest-dom adds custom jest matchers for asserting on DOM nodes.
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; // allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
import 'jest-enzyme'; // learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
configure({ adapter: new Adapter() });
+2 -2
View File
@@ -1,6 +1,6 @@
import { applyMiddleware, legacy_createStore as createStore, compose as reduxCompose } from 'redux'; import { applyMiddleware, legacy_createStore as createStore, compose as reduxCompose } from 'redux';
import createSagaMiddleware from 'redux-saga'; import createSagaMiddleware from 'redux-saga';
import { routerMiddleware } from 'connected-react-router'; import { createRouterMiddleware } from './lib/redux-router';
import rootReducer from './reducers'; import rootReducer from './reducers';
import rootSaga from './sagas'; import rootSaga from './sagas';
@@ -8,7 +8,7 @@ import history from './history';
const sagaMiddleware = createSagaMiddleware(); const sagaMiddleware = createSagaMiddleware();
const middlewares = [sagaMiddleware, routerMiddleware(history)]; const middlewares = [sagaMiddleware, createRouterMiddleware(history)];
let compose = reduxCompose; let compose = reduxCompose;
+7 -4
View File
@@ -2,10 +2,13 @@ import { matchPath } from 'react-router-dom';
export default (pathname, paths) => { export default (pathname, paths) => {
for (let i = 0; i < paths.length; i += 1) { for (let i = 0; i < paths.length; i += 1) {
const match = matchPath(pathname, { const match = matchPath(
path: paths[i], {
exact: true, path: paths[i],
}); end: true,
},
pathname,
);
if (match) { if (match) {
return match; return match;
+1843 -254
View File
File diff suppressed because it is too large Load Diff
+26 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "planka", "name": "planka",
"version": "1.8.5", "version": "1.8.8",
"private": true, "private": true,
"homepage": "https://plankanban.github.io/planka", "homepage": "https://plankanban.github.io/planka",
"repository": { "repository": {
@@ -38,9 +38,32 @@
"npm run server:lint" "npm run server:lint"
] ]
}, },
"prettier": {
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all"
},
"eslintConfig": {
"plugins": [
"prettier"
],
"extends": [
"plugin:prettier/recommended"
],
"rules": {
"no-undef": "off",
"prettier/prettier": "error"
}
},
"dependencies": { "dependencies": {
"concurrently": "^7.3.0", "concurrently": "^7.6.0",
"husky": "^8.0.1", "husky": "^8.0.2",
"lint-staged": "^13.0.3" "lint-staged": "^13.0.3"
},
"devDependencies": {
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1"
} }
} }
+1 -1
View File
@@ -22,6 +22,6 @@ module.exports = {
}; };
} }
return sails.helpers.cards.getMany(criteria); return sails.helpers.cards.getMany(criteria, 'position');
}, },
}; };
+1051 -1155
View File
File diff suppressed because it is too large Load Diff
+16 -30
View File
@@ -13,24 +13,13 @@
"test": "mocha test/lifecycle.test.js test/integration/**/*.test.js test/utils/**/*.test.js" "test": "mocha test/lifecycle.test.js test/integration/**/*.test.js test/utils/**/*.test.js"
}, },
"eslintConfig": { "eslintConfig": {
"plugins": [
"prettier"
],
"extends": [ "extends": [
"airbnb-base", "airbnb-base",
"plugin:prettier/recommended" "../package.json"
], ],
"rules": { "rules": {
"no-throw-literal": "off", "no-throw-literal": "off",
"no-undef": "off", "no-undef": "off"
"prettier/prettier": [
"error",
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all"
}
]
}, },
"globals": { "globals": {
"_": true, "_": true,
@@ -38,38 +27,35 @@
} }
}, },
"dependencies": { "dependencies": {
"bcrypt": "^5.0.1", "bcrypt": "^5.1.0",
"dotenv": "^16.0.1", "dotenv": "^16.0.3",
"dotenv-cli": "^6.0.0", "dotenv-cli": "^6.0.0",
"filenamify": "^4.3.0", "filenamify": "^4.3.0",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"knex": "^2.2.0", "knex": "^2.3.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.4", "moment": "^2.29.4",
"move-file": "^2.1.0", "move-file": "^2.1.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"sails": "^1.5.2", "sails": "^1.5.3",
"sails-hook-orm": "^4.0.1", "sails-hook-orm": "^4.0.2",
"sails-hook-sockets": "^2.0.1", "sails-hook-sockets": "^2.0.3",
"sails-postgresql-redacted": "^1.0.2-9", "sails-postgresql-redacted": "^1.0.2-9",
"sharp": "^0.30.7", "sharp": "^0.31.2",
"stream-to-array": "^2.3.0", "stream-to-array": "^2.3.0",
"uuid": "^8.3.2", "uuid": "^9.0.0",
"validator": "^13.7.0", "validator": "^13.7.0",
"winston": "^3.8.1", "winston": "^3.8.2",
"zxcvbn": "^4.4.2" "zxcvbn": "^4.4.2"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.3.6", "chai": "^4.3.7",
"eslint": "^8.20.0", "eslint": "^8.28.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1", "mocha": "^10.1.0",
"mocha": "^9.2.2", "nodemon": "^2.0.20",
"nodemon": "^2.0.19", "supertest": "^6.3.1"
"prettier": "2.7.1",
"supertest": "^6.2.4"
}, },
"engines": { "engines": {
"node": "^12.10" "node": "^12.10"