From ec66b0b5765b4bb2d464e6425e36273891716a5b Mon Sep 17 00:00:00 2001 From: weryques Date: Fri, 23 Mar 2018 10:03:39 -0300 Subject: [PATCH 01/16] Delete category --- .../components/lists/categories-list.vue | 44 +++++++++---------- .../components/lists/collections-list.vue | 1 - src/admin/tainacan-admin-i18n.php | 3 ++ ...s-tainacan-rest-collections-controller.php | 8 ++-- ...class-tainacan-rest-filters-controller.php | 20 +++------ .../class-tainacan-rest-items-controller.php | 10 ++--- ...ss-tainacan-rest-taxonomies-controller.php | 18 +++----- .../class-tainacan-collections.php | 4 +- .../repositories/class-tainacan-filters.php | 4 +- .../repositories/class-tainacan-items.php | 4 +- .../class-tainacan-taxonomies.php | 4 +- src/js/store/modules/category/actions.js | 11 +++-- src/js/store/modules/category/mutations.js | 8 ++++ tests/test-api-collections.php | 8 ++-- tests/test-api-filters.php | 12 ++--- tests/test-api-items.php | 8 ++-- tests/test-api-taxonomies.php | 14 +++--- 17 files changed, 88 insertions(+), 93 deletions(-) diff --git a/src/admin/components/lists/categories-list.vue b/src/admin/components/lists/categories-list.vue index aaa42edb1..71620b137 100644 --- a/src/admin/components/lists/categories-list.vue +++ b/src/admin/components/lists/categories-list.vue @@ -93,7 +93,6 @@ \ No newline at end of file diff --git a/src/classes/field-types/textarea/Textarea.vue b/src/classes/field-types/textarea/Textarea.vue index ab1d97b16..0df6c15c3 100644 --- a/src/classes/field-types/textarea/Textarea.vue +++ b/src/classes/field-types/textarea/Textarea.vue @@ -34,9 +34,6 @@ this.inputValue = $event; this.$emit('input', this.inputValue); } - }, - created(){ - this.inputValue = this.value; } } diff --git a/src/classes/filter-types/checkbox/Checkbox.vue b/src/classes/filter-types/checkbox/Checkbox.vue index 24a8f4ae9..0189a8142 100644 --- a/src/classes/filter-types/checkbox/Checkbox.vue +++ b/src/classes/filter-types/checkbox/Checkbox.vue @@ -1,7 +1,7 @@ + + + + diff --git a/src/admin/tainacan-admin-i18n.php b/src/admin/tainacan-admin-i18n.php index d7840aeab..d6d9d2dab 100644 --- a/src/admin/tainacan-admin-i18n.php +++ b/src/admin/tainacan-admin-i18n.php @@ -122,6 +122,7 @@ return [ 'label_collection_filters' => __( 'Collection Filters', 'tainacan' ), 'label_parent_term' => __( 'Parent Term', 'tainacan' ), 'label_add_new_term' => __( 'Add New Term', 'tainacan' ), + 'label_category_terms' => __( 'Category Terms', 'tainacan' ), // Instructions. More complex sentences to guide user and placeholders 'instruction_dragndrop_fields_collection' => __( 'Drag and drop Fields here to Collection.', 'tainacan' ), @@ -134,6 +135,7 @@ return [ 'instruction_image_upload_box' => __( 'Drop an image here or click to upload.', 'tainacan' ), 'instruction_select_a_status' => __( 'Select a status:', 'tainacan' ), 'instruction_select_a_filter_type' => __( 'Select a filter type:', 'tainacan' ), + 'instruction_select_a_parent_term' => __( 'Select a parent term:', 'tainacan' ), // Info. Other feedback to user. 'info_name_is_required' => __( 'Name is required.', 'tainacan' ), From 6daccd8a3174ef94fcbb5d3989637c8a3e292253 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 26 Mar 2018 17:08:32 -0300 Subject: [PATCH 16/16] Adds basic Terms CRUD in CategoryEditionForm. Still needs improvements and fixes! --- .../edition/category-edition-form.vue | 259 +++++++++++++++--- .../components/edition/term-edition-form.vue | 105 ++++--- src/admin/components/lists/fields-list.vue | 1 - src/admin/tainacan-admin-i18n.php | 3 +- src/js/store/modules/category/actions.js | 68 ++++- src/js/store/modules/category/getters.js | 4 + src/js/store/modules/category/index.js | 1 + src/js/store/modules/category/mutations.js | 24 ++ 8 files changed, 378 insertions(+), 87 deletions(-) diff --git a/src/admin/components/edition/category-edition-form.vue b/src/admin/components/edition/category-edition-form.vue index aa36f43d1..7ba72478e 100644 --- a/src/admin/components/edition/category-edition-form.vue +++ b/src/admin/components/edition/category-edition-form.vue @@ -100,32 +100,45 @@ - + - -
+
- - {{ term.name }} + class="term-name" + :class="{'is-danger': formWithErrors == term.term_id }"> + {{ term.name }} + + + + {{ $i18n.get('info_not_saved') }} + + v-if="term.term_id == undefined"/> + v-if="term.term_id !== undefined || term.term_id !== 'new'"> +
+ + +
@@ -171,6 +195,7 @@ diff --git a/src/admin/components/edition/term-edition-form.vue b/src/admin/components/edition/term-edition-form.vue index ad775906f..eae0023ab 100644 --- a/src/admin/components/edition/term-edition-form.vue +++ b/src/admin/components/edition/term-edition-form.vue @@ -39,38 +39,6 @@ v-model="editForm.description" @focus="clearErrors('description')" /> - - -
-
+