Repository: modoboa/modoboa-contacts (language: python)

Issue:
Filtering by category does not work
The filter does not work as expected.


Discussion / hints:

Fix patch:
diff --git a/frontend/src/components/ContactList.vue b/frontend/src/components/ContactList.vue
index 2b7c382..222ca88 100644
--- a/frontend/src/components/ContactList.vue
+++ b/frontend/src/components/ContactList.vue
@@ -84,7 +84,7 @@ export default {
         ])
     },
     created () {
-        this.getContacts(this.$route.params)
+        this.getContacts(undefined, this.$route.params.category)
         api.getDefaultAddressBook().then(response => {
             this.addressBook = response.data
         })
@@ -121,7 +121,7 @@ export default {
     },
     watch: {
         '$route' (to, from) {
-            this.getContacts(this.$route.params)
+            this.getContacts(undefined, this.$route.params.category)
         }
     }
 }
diff --git a/frontend/src/components/PhoneNumberField.vue b/frontend/src/components/PhoneNumberField.vue
index 01f0d09..74d4b85 100644
--- a/frontend/src/components/PhoneNumberField.vue
+++ b/frontend/src/components/PhoneNumberField.vue
@@ -30,7 +30,7 @@ export default {
     },
     data: function () {
         return {
-            types: ['cellular', 'fax', 'home', 'main', 'pager', 'work', 'other']
+            types: ['cell', 'fax', 'home', 'main', 'pager', 'work', 'other']
         }
     },
     computed: {
diff --git a/modoboa_contacts/constants.py b/modoboa_contacts/constants.py
index 6ed984d..4cfc37f 100644
--- a/modoboa_contacts/constants.py
+++ b/modoboa_contacts/constants.py
@@ -13,7 +13,7 @@
     ("work", ugettext_lazy("Work")),
     ("other", ugettext_lazy("Other")),
     ("main", ugettext_lazy("Main")),
-    ("cellular", ugettext_lazy("Cellular")),
+    ("cell", ugettext_lazy("Cellular")),
     ("fax", ugettext_lazy("Fax")),
     ("pager", ugettext_lazy("Pager"))
 )


Test patch:
diff --git a/frontend/tests/unit/PhoneNumberField.spec.js b/frontend/tests/unit/PhoneNumberField.spec.js
index 7a910f9..f26b132 100644
--- a/frontend/tests/unit/PhoneNumberField.spec.js
+++ b/frontend/tests/unit/PhoneNumberField.spec.js
@@ -16,7 +16,7 @@ describe('PhoneNumberField.vue', () => {
         const Ctor = Vue.extend(PhoneNumberField)
         const vm = new Ctor({
             propsData: {
-                index: 0, errors: {}, phone: { number: '0123456789', type: 'cellular' }
+                index: 0, errors: {}, phone: { number: '0123456789', type: 'cell' }
             }
         }).$mount()
         expect(vm.$el).to.be.ok // eslint-disable-line no-unused-expressions