Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
#926 new type of link + new endpoint for creating view
Browse files Browse the repository at this point in the history
  • Loading branch information
damianprzygodzki committed Jun 22, 2017
1 parent ef71ff8 commit ae66ab5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/actions/BoardActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import axios from 'axios';

export function createView(boardId) {
return axios.post(
config.API_URL +
'/board/' + boardId +
'/newCardsView'
);
}

export function getView(boardId, viewId, firstRow) {
return axios.get(
config.API_URL +
Expand Down
4 changes: 2 additions & 2 deletions src/components/board/Sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Card from './Card';
import Loader from '../app/Loader';
import update from 'immutability-helper';

import {getView} from '../../actions/BoardActions';
import {getView, createView} from '../../actions/BoardActions';

class Sidenav extends Component {
constructor(props) {
Expand All @@ -26,7 +26,7 @@ class Sidenav extends Component {
})
);
}else{
getView(boardId).then(res => {
createView(boardId).then(res => {
setViewId(res.data.viewId);
getView(boardId, res.data.viewId, 0).then(res =>
this.setState({
Expand Down
7 changes: 5 additions & 2 deletions src/components/header/MenuOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ class MenuOverlay extends Component {
});
}

handleRedirect = (elementId, isNew) => {
handleRedirect = (elementId, isNew, entity) => {
this.handleClickOutside();

this.props.dispatch(
push('/window/' + elementId + (isNew ? '/new' : ''))
push(
'/' + (entity ? entity : 'window') + '/' +
elementId + (isNew ? '/new' : '')
)
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/header/MenuOverlayItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ class MenuOverlayItem extends Component {

if(type === 'newRecord'){
handleNewRedirect(elementId);
} else if (type === 'window') {
this.handleClick(elementId)
} else if (type === 'window' || type === 'board') {
this.handleClick(elementId, type)
} else if (type === 'group') {
handleClickOnFolder(e, nodeId)
} else if (type === 'report' || type === 'process') {
openModal(elementId + '', 'process', caption)
}
}

handleClick = (elementId) => {
handleClick = (elementId, entity) => {
const {handleRedirect} = this.props;
handleRedirect(elementId);
handleRedirect(elementId, null, entity);
this.renderBreadcrumb(elementId)
}

Expand Down

0 comments on commit ae66ab5

Please sign in to comment.