Commit bc1025b7 authored by ZeHiro's avatar ZeHiro Committed by ZeHiro
Browse files

Put no category and unkown type just after any type/category. Fixes #418

parent 3ce340a3
......@@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import { translate as $t } from '../../helpers';
import { translate as $t, UNKNOWN_OPERATION_TYPE, NONE_CATEGORY_ID } from '../../helpers';
import { get, actions } from '../../store';
import DatePicker from '../ui/date-picker';
......@@ -202,9 +202,19 @@ class SearchComponent extends React.Component {
}
const Export = connect(state => {
// Put none category juste after any_category
let categories = get.categories(state);
let unknownCategory = categories.find(cat => cat.id === NONE_CATEGORY_ID);
categories = [unknownCategory].concat(categories.filter(cat => cat.id !== NONE_CATEGORY_ID));
// Put unknown_type juste after any_type
let types = OperationTypes;
let unknownType = types.find(type => type.name === UNKNOWN_OPERATION_TYPE);
types = [unknownType].concat(types.filter(type => type.name !== UNKNOWN_OPERATION_TYPE));
return {
categories: get.categories(state),
operationTypes: OperationTypes,
categories,
operationTypes: types,
searchFields: get.searchFields(state),
};
}, dispatch => {
......
......@@ -19,7 +19,7 @@ module.exports = {
},
category: {
none: 'None',
none: 'No category',
add: 'add a category',
column_category_color: 'COLOR',
column_category_name: 'CATEGORY NAME',
......@@ -264,7 +264,7 @@ module.exports = {
type: {
none: 'None',
unknown: 'Unknown',
unknown: 'Unknown type',
transfer: 'Transfer',
order: 'Order',
check: 'Check',
......
......@@ -19,7 +19,7 @@ module.exports = {
},
category: {
none: 'Sans',
none: 'Sans catégorie',
add: 'ajouter une catégorie',
column_category_color: 'COULEUR',
column_category_name: 'NOM',
......@@ -264,7 +264,7 @@ module.exports = {
type: {
none: 'Aucun',
unknown: 'Inconnu',
unknown: 'Type inconnu',
transfer: 'Virement',
order: 'Prélèvement',
check: 'Chèque',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment