mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
adjust store calls to fetch list to new interface
This commit is contained in:
parent
e3b46c69a5
commit
17b991e06b
@ -87,14 +87,16 @@ let AccordionListItem = React.createClass({
|
||||
},
|
||||
|
||||
handleSubmitPrizeSuccess(response) {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
|
||||
let notification = new GlobalNotificationModel(response.notification, 'success', 10000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
},
|
||||
|
||||
onPollingSuccess(pieceId) {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
EditionListActions.toggleEditionList(pieceId);
|
||||
|
||||
let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000);
|
||||
|
@ -86,7 +86,8 @@ let Edition = React.createClass({
|
||||
},
|
||||
|
||||
handleDeleteSuccess(response) {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
|
||||
EditionListActions.refreshEditionList(this.props.edition.parent);
|
||||
EditionListActions.closeAllEditionLists();
|
||||
|
@ -79,12 +79,14 @@ let Piece = React.createClass({
|
||||
|
||||
handleEditionCreationSuccess() {
|
||||
PieceActions.updateProperty({key: 'num_editions', value: 0});
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
this.toggleCreateEditionsDialog();
|
||||
},
|
||||
|
||||
handleDeleteSuccess(response) {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
|
||||
// since we're deleting a piece, we just need to close
|
||||
// all editions dialogs and not reload them
|
||||
@ -124,7 +126,8 @@ let Piece = React.createClass({
|
||||
// btw.: It's not sufficient to just set num_editions to numEditions, since a single accordion
|
||||
// list item also uses the firstEdition property which we can only get from the server in that case.
|
||||
// Therefore we need to at least refetch the changed piece from the server or on our case simply all
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
|
||||
let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
|
@ -76,7 +76,8 @@ let PieceListBulkModal = React.createClass({
|
||||
},
|
||||
|
||||
handleSuccess() {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||
|
||||
this.fetchSelectedPieceEditionList()
|
||||
.forEach((pieceId) => {
|
||||
|
@ -34,7 +34,8 @@ let PieceList = React.createClass({
|
||||
let page = this.getQuery().page || 1;
|
||||
PieceListStore.listen(this.onChange);
|
||||
if (this.state.pieceList.length === 0){
|
||||
PieceListActions.fetchPieceList(page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc)
|
||||
PieceListActions.fetchPieceList(page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy)
|
||||
.then(PieceListActions.fetchPieceRequestActions());
|
||||
}
|
||||
},
|
||||
@ -59,9 +60,9 @@ let PieceList = React.createClass({
|
||||
// the site should go to the top
|
||||
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
||||
|
||||
return () => PieceListActions.fetchPieceList(page, this.state.pageSize,
|
||||
this.state.search, this.state.orderBy,
|
||||
this.state.orderAsc);
|
||||
return () => PieceListActions.fetchPieceList(page, this.state.pageSize, this.state.search,
|
||||
this.state.orderBy, this.state.orderAsc,
|
||||
this.state.filterBy);
|
||||
},
|
||||
|
||||
getPagination() {
|
||||
@ -79,13 +80,14 @@ let PieceList = React.createClass({
|
||||
},
|
||||
|
||||
searchFor(searchTerm) {
|
||||
PieceListActions.fetchPieceList(1, this.state.pageSize, searchTerm, this.state.orderBy, this.state.orderAsc);
|
||||
PieceListActions.fetchPieceList(1, this.state.pageSize, searchTerm, this.state.orderBy,
|
||||
this.state.orderAsc, this.state.filterBy);
|
||||
this.transitionTo(this.getPathname(), {page: 1});
|
||||
},
|
||||
|
||||
accordionChangeOrder(orderBy, orderAsc) {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize,
|
||||
this.state.search, orderBy, orderAsc);
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||
orderBy, orderAsc, this.state.filterBy);
|
||||
},
|
||||
|
||||
render() {
|
||||
|
@ -101,7 +101,8 @@ let RegisterPiece = React.createClass( {
|
||||
this.state.pageSize,
|
||||
this.state.searchTerm,
|
||||
this.state.orderBy,
|
||||
this.state.orderAsc
|
||||
this.state.orderAsc,
|
||||
this.state.filterBy
|
||||
);
|
||||
|
||||
this.transitionTo('piece', {pieceId: response.piece.id});
|
||||
|
Loading…
Reference in New Issue
Block a user