diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json
new file mode 100644
index 000000000..da18d9352
--- /dev/null
+++ b/cypress/fixtures/example.json
@@ -0,0 +1,5 @@
+{
+ "name": "Using fixtures to represent data",
+ "email": "hello@cypress.io",
+ "body": "Fixtures are a great way to mock data for responses to routes"
+}
\ No newline at end of file
diff --git a/src/admin/components/edition/category-edition-form.vue b/src/admin/components/edition/category-edition-form.vue
index 6d7422845..31ddf74a5 100644
--- a/src/admin/components/edition/category-edition-form.vue
+++ b/src/admin/components/edition/category-edition-form.vue
@@ -98,6 +98,49 @@
+
+
+
+ {{ $i18n.get('label_add_new_term') }}
+
+
+
+
+
+ {{ term.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{
this.$console.error(errors);
- this.isLoading = false;
+ this.isUpdatingSlug = false;
});
},
@@ -259,7 +313,7 @@
},
createNewCategory() {
// Puts loading on Draft Category creation
- this.isLoading = true;
+ this.isLoadingCategory = true;
// Creates draft Category
let data = {
@@ -285,7 +339,7 @@
// Pre-fill status with publish to incentivate it
this.form.status = 'publish';
- this.isLoading = false;
+ this.isLoadingCategory = false;
}
)
@@ -300,6 +354,31 @@
labelNewTerms(){
return ( this.form.allowInsert === 'yes' ) ? this.$i18n.get('label_yes') : this.$i18n.get('label_no');
},
+ addNewTerm() {
+ this.$console.log("CREATING NEW TERM");
+
+ this.sendTerm({category: this.categoryId, status: 'auto-draft'})
+ .then(() => {
+
+ })
+ .catch(() => {
+
+ });
+ },
+ editTerm(term) {
+ this.$console.log(term);
+ },
+ removeTerm(term) {
+ this.$console.log(term);
+
+ this.deleteTerm(term.id)
+ .then(() => {
+
+ })
+ .catch(() => {
+
+ });
+ }
},
created(){
@@ -307,7 +386,8 @@
this.createNewCategory();
} else if (this.$route.fullPath.split("/").pop() === "edit") {
- this.isLoading = true;
+ this.isLoadingCategory = true;
+ this.isLoadingTerms = true;
// Obtains current category ID from URL
this.pathArray = this.$route.fullPath.split("/").reverse();
@@ -323,7 +403,13 @@
this.form.status = this.category.status;
this.form.allowInsert = this.category.allow_insert;
- this.isLoading = false;
+ this.isLoadingCategory = false;
+ });
+
+ this.fetchTerms(this.categoryId)
+ .then(() => {
+ // Fill this.form data with current data.
+ this.isLoadingCategory = false;
});
}
}
diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue
index 1f6a4a2f4..28e91fc11 100644
--- a/src/admin/components/edition/collection-edition-form.vue
+++ b/src/admin/components/edition/collection-edition-form.vue
@@ -145,7 +145,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' ),