Example #1
0
    goToPreviousEntity = () => {
        const { router, previousEntity } = this.props;

        this.props.dispatch(
            navigation.actions.updateEntity(
                router,
                previousEntity.pk.toString(),
            )
        );
    }
Example #2
0
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()));
    }
}
Example #3
0
    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));
    }
Example #4
0
 selectStatus = (status: ?string) => {
     this.props.dispatch(navActions.updateStatus(this.props.router, status));
 }
Example #5
0
 updateSearchParams = debounce(() => {
     this.props.dispatch(navActions.updateSearch(this.props.router, this.state.search));
 }, 500)