Fixes sorting paramethers.

This commit is contained in:
Mateus Machado Luna 2019-02-28 16:37:05 -03:00
parent 6f450d8563
commit 27dd7cf868
9 changed files with 33 additions and 17 deletions

View File

@ -30,6 +30,7 @@
formHooks['filter']['begin-left'] != undefined">
<form
id="form-filter-begin-left"
class="form-hook-region"
v-html="formHooks['filter']['begin-left'].join('')"/>
</template>
@ -152,6 +153,7 @@
formHooks['filter']['end-left'] != undefined">
<form
id="form-filter-end-left"
class="form-hook-region"
v-html="formHooks['filter']['end-left'].join('')"/>
</template>
</div>

View File

@ -44,6 +44,7 @@
formHooks['item']['begin-left'] != undefined">
<form
id="form-item-begin-left"
class="form-hook-region"
v-html="formHooks['item']['begin-left'].join('')"/>
</template>
@ -349,6 +350,7 @@
formHooks['item']['end-left'] != undefined">
<form
id="form-item-end-left"
class="form-hook-region"
v-html="formHooks['item']['end-left'].join('')"/>
</template>
@ -362,6 +364,7 @@
formHooks['item']['begin-right'] != undefined">
<form
id="form-item-begin-right"
class="form-hook-region"
v-html="formHooks['item']['begin-right'].join('')"/>
</template>
@ -438,6 +441,7 @@
formHooks['item']['end-right'] != undefined">
<form
id="form-item-end-right"
class="form-hook-region"
v-html="formHooks['item']['end-right'].join('')"/>
</template>
</div>

View File

@ -31,6 +31,7 @@
formHooks['metadatum']['begin-left'] != undefined">
<form
id="form-metadatum-begin-left"
class="form-hook-region"
v-html="formHooks['metadatum']['begin-left'].join('')"/>
</template>
@ -223,6 +224,7 @@
formHooks['metadatum']['end-left'] != undefined">
<form
id="form-metadatum-end-left"
class="form-hook-region"
v-html="formHooks['metadatum']['end-left'].join('')"/>
</template>
</div>

View File

@ -38,6 +38,7 @@
formHooks['taxonomy']['begin-left'] != undefined">
<form
id="form-taxonomy-begin-left"
class="form-hook-region"
v-html="formHooks['taxonomy']['begin-left'].join('')"/>
</template>
@ -145,6 +146,7 @@
formHooks['taxonomy']['end-left'] != undefined">
<form
id="form-taxonomy-end-left"
class="form-hook-region"
v-html="formHooks['taxonomy']['end-left'].join('')"/>
</template>

View File

@ -70,6 +70,7 @@
formHooks['term']['begin-left'] != undefined">
<form
id="form-term-begin-left"
class="form-hook-region"
v-html="formHooks['term']['begin-left'].join('')"/>
</template>
@ -139,6 +140,7 @@
formHooks['term']['end-left'] != undefined">
<form
id="form-term-end-left"
class="form-hook-region"
v-html="formHooks['term']['end-left'].join('')"/>
</template>

View File

@ -31,6 +31,7 @@
formHooks['view-item']['begin-left'] != undefined">
<div
id="view-item-begin-left"
class="form-hook-region"
v-html="formHooks['view-item']['begin-left'].join('')"/>
</template>
@ -197,6 +198,7 @@
formHooks['view-item']['end-left'] != undefined">
<div
id="view-item-end-left"
class="form-hook-region"
v-html="formHooks['view-item']['end-left'].join('')"/>
</template>
@ -210,6 +212,7 @@
formHooks['view-item']['begin-right'] != undefined">
<div
id="view-item-begin-right"
class="form-hook-region"
v-html="formHooks['view-item']['begin-right'].join('')"/>
</template>
@ -306,6 +309,7 @@
formHooks['view-item']['end-right'] != undefined">
<div
id="view-item-end-right"
class="form-hook-region"
v-html="formHooks['view-item']['end-right'].join('')"/>
</template>
</b-tab-item>

View File

@ -97,16 +97,16 @@ export default {
this.$route.query.orderby = 'author_name';
} else if (orderBy.metadata_type_object.primitive_type == 'float' || orderBy.metadata_type_object.primitive_type == 'int') {
this.$route.query.orderby = 'meta_value_num';
this.$route.query.meta_key = orderBy.id;
this.$route.query.metakey = orderBy.id;
} else if (orderBy.metadata_type_object.primitive_type == 'date') {
this.$route.query.orderby = 'meta_value';
this.$route.query.meta_key = orderBy.id;
this.$route.query.meta_type = 'DATETIME';
this.$route.query.metakey = orderBy.id;
this.$route.query.metatype = 'DATETIME';
} else if (orderBy.metadata_type_object.core) {
this.$route.query.orderby = orderBy.metadata_type_object.related_mapped_prop;
} else {
this.$route.query.orderby = 'meta_value';
this.$route.query.meta_key = orderBy.id;
this.$route.query.metakey = orderBy.id;
}
} else {

View File

@ -81,28 +81,28 @@ export const setOrderBy = ({ state, commit }, orderBy ) => {
// Primitive Types: string, date, item, term, compound, float
if (orderBy.slug == 'creation_date') {
commit('setPostQueryAttribute', { attr: 'orderby', value: 'date' } );
commit('removePostQueryAttribute', 'meta_key');
commit('removePostQueryAttribute', 'meta_type');
commit('removePostQueryAttribute', 'metakey');
commit('removePostQueryAttribute', 'metatype');
} else if (orderBy.slug == 'author_name') {
commit('setPostQueryAttribute', { attr: 'orderby', value: 'author_name' } );
commit('removePostQueryAttribute', 'meta_key');
commit('removePostQueryAttribute', 'meta_type');
commit('removePostQueryAttribute', 'metakey');
commit('removePostQueryAttribute', 'metatype');
} else if (orderBy.metadata_type_object.primitive_type == 'float' || orderBy.metadata_type_object.primitive_type == 'int') {
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value_num' } );
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('removePostQueryAttribute', 'meta_type');
commit('setPostQueryAttribute', { attr: 'metakey', value: orderBy.id } );
commit('removePostQueryAttribute', 'metatype');
} else if (orderBy.metadata_type_object.primitive_type == 'date') {
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value' } );
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('setPostQueryAttribute', { attr: 'meta_type', value: 'DATETIME' } );
commit('setPostQueryAttribute', { attr: 'metakey', value: orderBy.id } );
commit('setPostQueryAttribute', { attr: 'metatype', value: 'DATETIME' } );
} else if (orderBy.metadata_type_object.core) {
commit('setPostQueryAttribute', { attr: 'orderby', value: orderBy.metadata_type_object.related_mapped_prop } );
commit('removePostQueryAttribute', 'meta_key');
commit('removePostQueryAttribute', 'meta_type');
commit('removePostQueryAttribute', 'metakey');
commit('removePostQueryAttribute', 'metatype');
} else {
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value' } );
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('removePostQueryAttribute', 'meta_type');
commit('setPostQueryAttribute', { attr: 'metakey', value: orderBy.id } );
commit('removePostQueryAttribute', 'metatype');
}
commit('setOrderByName', orderBy.name);

View File

@ -69,7 +69,7 @@ export const getOrderByName = state => {
};
export const getMetaKey = state => {
return state.postquery.meta_key;
return state.postquery.metakey;
};
export const getFetchOnlyMeta = state => {