mirror of
https://github.com/plankanban/planka.git
synced 2025-12-25 09:15:00 +03:00
Make columns itself scrollable, fix action creation when moving card, little refactoring
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { currentModalSelector } from '../selectors';
|
||||
import ModalTypes from '../constants/ModalTypes';
|
||||
import App from '../components/App';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const currentModal = currentModalSelector(state);
|
||||
|
||||
return {
|
||||
isUsersModalOpened: currentModal === ModalTypes.USERS,
|
||||
isUserSettingsModalOpened: currentModal === ModalTypes.USER_SETTINGS,
|
||||
isAddProjectModalOpened: currentModal === ModalTypes.ADD_PROJECT,
|
||||
currentModal,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
14
client/src/containers/FixedWrapperContainer.js
Normal file
14
client/src/containers/FixedWrapperContainer.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { pathSelector } from '../selectors';
|
||||
import FixedWrapper from '../components/FixedWrapper';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { projectId } = pathSelector(state);
|
||||
|
||||
return {
|
||||
projectId,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(FixedWrapper);
|
||||
@@ -1,16 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { pathSelector } from '../selectors';
|
||||
import ProjectWrapper from '../components/ProjectWrapper';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { cardId, boardId, projectId } = pathSelector(state);
|
||||
|
||||
return {
|
||||
isProjectNotFound: projectId === null,
|
||||
isBoardNotFound: boardId === null,
|
||||
isCardNotFound: cardId === null,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(ProjectWrapper);
|
||||
@@ -1,18 +1,16 @@
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { currentUserSelector, pathSelector, projectsForCurrentUserSelector } from '../selectors';
|
||||
import { currentUserSelector, projectsForCurrentUserSelector } from '../selectors';
|
||||
import { openAddProjectModal } from '../actions/entry';
|
||||
import Projects from '../components/Projects';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { projectId } = pathSelector(state);
|
||||
const { isAdmin } = currentUserSelector(state);
|
||||
const projects = projectsForCurrentUserSelector(state);
|
||||
|
||||
return {
|
||||
items: projects,
|
||||
currentId: projectId,
|
||||
isEditable: isAdmin,
|
||||
};
|
||||
};
|
||||
|
||||
16
client/src/containers/StaticWrapperContainer.js
Normal file
16
client/src/containers/StaticWrapperContainer.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { pathSelector } from '../selectors';
|
||||
import StaticWrapper from '../components/StaticWrapper';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { cardId, boardId, projectId } = pathSelector(state);
|
||||
|
||||
return {
|
||||
cardId,
|
||||
boardId,
|
||||
projectId,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(StaticWrapper);
|
||||
Reference in New Issue
Block a user