goToPreviousEntity = () => { const { router, previousEntity } = this.props; this.props.dispatch( navigation.actions.updateEntity( router, previousEntity.pk.toString(), ) ); }
export function moveToNextTranslation( dispatch: Function, router: Object, entity: number, nextEntity: number, pluralForm: number, locale: Locale, ): Function { if (pluralForm !== -1 && pluralForm < locale.cldrPlurals.length - 1) { dispatch(select(pluralForm + 1)); } else if (nextEntity !== entity) { dispatch(navActions.updateEntity(router, nextEntity.toString())); } }
return async dispatch => { const results = await updateStatusOnServer(change, translation, resource); if (results.translation && change === 'approve' && nextEntity && nextEntity.pk !== entity) { // The change did work, we want to move on to the next Entity. dispatch(navActions.updateEntity(router, nextEntity.pk.toString())); } else { dispatch(get(entity, locale, pluralForm)); } if (results.stats) { dispatch(statsActions.update(results.stats)); } dispatch(listActions.updateEntityTranslation(entity, pluralForm, results.translation)); }
selectStatus = (status: ?string) => { this.props.dispatch(navActions.updateStatus(this.props.router, status)); }
updateSearchParams = debounce(() => { this.props.dispatch(navActions.updateSearch(this.props.router, this.state.search)); }, 500)