mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +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) {
|
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);
|
let notification = new GlobalNotificationModel(response.notification, 'success', 10000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
},
|
},
|
||||||
|
|
||||||
onPollingSuccess(pieceId) {
|
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);
|
EditionListActions.toggleEditionList(pieceId);
|
||||||
|
|
||||||
let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000);
|
let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000);
|
||||||
|
@ -86,7 +86,8 @@ let Edition = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleDeleteSuccess(response) {
|
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.refreshEditionList(this.props.edition.parent);
|
||||||
EditionListActions.closeAllEditionLists();
|
EditionListActions.closeAllEditionLists();
|
||||||
|
@ -79,12 +79,14 @@ let Piece = React.createClass({
|
|||||||
|
|
||||||
handleEditionCreationSuccess() {
|
handleEditionCreationSuccess() {
|
||||||
PieceActions.updateProperty({key: 'num_editions', value: 0});
|
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();
|
this.toggleCreateEditionsDialog();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDeleteSuccess(response) {
|
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
|
// since we're deleting a piece, we just need to close
|
||||||
// all editions dialogs and not reload them
|
// 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
|
// 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.
|
// 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
|
// 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);
|
let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
|
@ -76,7 +76,8 @@ let PieceListBulkModal = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleSuccess() {
|
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()
|
this.fetchSelectedPieceEditionList()
|
||||||
.forEach((pieceId) => {
|
.forEach((pieceId) => {
|
||||||
|
@ -34,7 +34,8 @@ let PieceList = React.createClass({
|
|||||||
let page = this.getQuery().page || 1;
|
let page = this.getQuery().page || 1;
|
||||||
PieceListStore.listen(this.onChange);
|
PieceListStore.listen(this.onChange);
|
||||||
if (this.state.pieceList.length === 0){
|
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());
|
.then(PieceListActions.fetchPieceRequestActions());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -59,9 +60,9 @@ let PieceList = React.createClass({
|
|||||||
// the site should go to the top
|
// the site should go to the top
|
||||||
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
||||||
|
|
||||||
return () => PieceListActions.fetchPieceList(page, this.state.pageSize,
|
return () => PieceListActions.fetchPieceList(page, this.state.pageSize, this.state.search,
|
||||||
this.state.search, this.state.orderBy,
|
this.state.orderBy, this.state.orderAsc,
|
||||||
this.state.orderAsc);
|
this.state.filterBy);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPagination() {
|
getPagination() {
|
||||||
@ -79,13 +80,14 @@ let PieceList = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
searchFor(searchTerm) {
|
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});
|
this.transitionTo(this.getPathname(), {page: 1});
|
||||||
},
|
},
|
||||||
|
|
||||||
accordionChangeOrder(orderBy, orderAsc) {
|
accordionChangeOrder(orderBy, orderAsc) {
|
||||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize,
|
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||||
this.state.search, orderBy, orderAsc);
|
orderBy, orderAsc, this.state.filterBy);
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -101,7 +101,8 @@ let RegisterPiece = React.createClass( {
|
|||||||
this.state.pageSize,
|
this.state.pageSize,
|
||||||
this.state.searchTerm,
|
this.state.searchTerm,
|
||||||
this.state.orderBy,
|
this.state.orderBy,
|
||||||
this.state.orderAsc
|
this.state.orderAsc,
|
||||||
|
this.state.filterBy
|
||||||
);
|
);
|
||||||
|
|
||||||
this.transitionTo('piece', {pieceId: response.piece.id});
|
this.transitionTo('piece', {pieceId: response.piece.id});
|
||||||
|
Loading…
Reference in New Issue
Block a user