Default field sort order to database ordinal sort

And use alphabetical where appropriate

Fixes #4341
This commit is contained in:
rijkvanzanten
2021-03-03 18:36:21 -05:00
parent c3dd7023a7
commit eb4deaa955
10 changed files with 89 additions and 167 deletions

View File

@@ -313,7 +313,7 @@ export default defineComponent({
const junctionFields = computed(() => {
if (!junctionCollection.value) return [];
return fieldsStore.getFieldsForCollection(junctionCollection.value).map((field: Field) => ({
return fieldsStore.getFieldsForCollectionAlphabetical(junctionCollection.value).map((field: Field) => ({
text: field.field,
value: field.field,
disabled:

View File

@@ -346,7 +346,7 @@ export default defineComponent({
const junctionFields = computed(() => {
if (!junctionCollection.value) return [];
return fieldsStore.getFieldsForCollection(junctionCollection.value).map((field: Field) => ({
return fieldsStore.getFieldsForCollectionAlphabetical(junctionCollection.value).map((field: Field) => ({
text: field.field,
value: field.field,
disabled:

View File

@@ -248,12 +248,14 @@ export default defineComponent({
const fields = computed(() => {
if (!state.relations[0].many_collection) return [];
return fieldsStore.getFieldsForCollection(state.relations[0].many_collection).map((field: Field) => ({
text: field.field,
value: field.field,
disabled:
!field.schema || field.schema?.is_primary_key || field.type !== currentCollectionPrimaryKey.value.type,
}));
return fieldsStore
.getFieldsForCollectionAlphabetical(state.relations[0].many_collection)
.map((field: Field) => ({
text: field.field,
value: field.field,
disabled:
!field.schema || field.schema?.is_primary_key || field.type !== currentCollectionPrimaryKey.value.type,
}));
});
const collectionMany = computed({