reworked MergeMixin to handle non-trees

This commit is contained in:
smilerz
2021-09-06 10:20:43 -05:00
parent f12558951a
commit 7053a857c2
13 changed files with 230 additions and 43 deletions

View File

@@ -176,7 +176,7 @@ export default {
this.left_page = 0
this.right += 1
this.left += 1
this.$emit('reset')
// this.$emit('reset') doublecheck if this is necessary
},
infiniteHandler: function($state, col) {
let params = {

View File

@@ -122,5 +122,6 @@
"Description": "Description",
"Recipe": "Recipe",
"tree_root": "Root of Tree",
"Icon": "Icon"
"Icon": "Icon",
"Unit": "Unit"
}

View File

@@ -136,7 +136,31 @@ export class Models {
}
},
}
static UNIT = {}
static UNIT = {
'name': i18n.t('Unit'), // *OPTIONAL: parameters will be built model -> model_type -> default
'apiName': 'Unit',
'create': {
// if not defined partialUpdate will use the same parameters, prepending 'id'
'params': [['name', 'description']],
'form': {
'name': {
'form_field': true,
'type': 'text',
'field': 'name',
'label': i18n.t('Name'),
'placeholder': ''
},
'description': {
'form_field': true,
'type': 'text',
'field': 'description',
'label': i18n.t('Description'),
'placeholder': ''
}
}
},
'move': false
}
static RECIPE = {}
static SHOPPING_LIST = {}
static RECIPE_BOOK = {