diff --git a/vue3/src/apps/tandoor/main.ts b/vue3/src/apps/tandoor/main.ts
index 22b803bbc..071225a88 100644
--- a/vue3/src/apps/tandoor/main.ts
+++ b/vue3/src/apps/tandoor/main.ts
@@ -27,11 +27,13 @@ import ApiSettings from "@/components/settings/ApiSettings.vue";
import ModelListPage from "@/pages/ModelListPage.vue";
import ModelEditPage from "@/pages/ModelEditPage.vue";
import RecipeImportPage from "@/pages/RecipeImportPage.vue";
+import IngredientEditorPage from "@/pages/IngredientEditorPage.vue";
const routes = [
{path: '/', component: StartPage, name: 'view_home'},
{path: '/test', component: TestPage, name: 'view_test'},
- {path: '/settings', component: SettingsPage, name: 'view_settings', redirect: '/settings/account',
+ {
+ path: '/settings', component: SettingsPage, name: 'view_settings', redirect: '/settings/account',
children: [
{path: 'account', component: AccountSettings, name: 'view_settings_account'},
{path: 'cosmetic', component: CosmeticSettings, name: 'view_settings_cosmetic'},
@@ -41,7 +43,8 @@ const routes = [
{path: 'space-members', component: SpaceMemberSettings, name: 'view_settings_space_member'},
{path: 'user-space', component: UserSpaceSettings, name: 'view_settings_user_space'},
{path: 'api', component: ApiSettings, name: 'view_settings_api'},
- ]},
+ ]
+ },
//{path: '/settings/:page', component: SettingsPage, name: 'view_settings_page', props: true},
{path: '/search', component: SearchPage, name: 'view_search'},
{path: '/shopping', component: ShoppingListPage, name: 'view_shopping'},
@@ -51,9 +54,10 @@ const routes = [
{path: '/recipe/:id', component: RecipeViewPage, name: 'view_recipe', props: true},
{path: '/recipe/edit/:recipe_id', component: RecipeEditPage, name: 'edit_recipe', props: true},
- {path: '/list/:model?', component: ModelListPage, props: true, name: 'ModelListPage'},
- {path: '/edit/:model/:id?', component: ModelEditPage, props: true, name: 'ModelEditPage'},
+ {path: '/list/:model?', component: ModelListPage, props: true, name: 'ModelListPage'},
+ {path: '/edit/:model/:id?', component: ModelEditPage, props: true, name: 'ModelEditPage'},
+ {path: '/ingredient-editor', component: IngredientEditorPage, name: 'IngredientEditorPage'},
]
const router = createRouter({
diff --git a/vue3/src/components/inputs/ModelSelect.vue b/vue3/src/components/inputs/ModelSelect.vue
index 9228c8e5c..ca9de58dd 100644
--- a/vue3/src/components/inputs/ModelSelect.vue
+++ b/vue3/src/components/inputs/ModelSelect.vue
@@ -1,13 +1,14 @@
-
+
, required: true},
- id: {type: String, required: false, default: Math.floor(Math.random()*10000).toString()},
+ id: {type: String, required: false, default: Math.floor(Math.random() * 10000).toString()},
limit: {type: Number, default: 25},
@@ -71,6 +72,7 @@ const props = defineProps({
label: {type: String, default: ''},
hint: {type: String, default: ''},
+ density: {type: String as PropType<''|'compact'|'comfortable'>, default: ''},
searchOnLoad: {type: Boolean, default: false},
})
@@ -79,7 +81,7 @@ const props = defineProps({
* check if model has a non-standard value attribute defined, if not use "id" as the value attribute
*/
const itemValue = computed(() => {
- if(modelClass.value.model.itemValue){
+ if (modelClass.value.model.itemValue) {
return modelClass.value.model.itemValue
}
return 'id'
@@ -89,7 +91,7 @@ const itemValue = computed(() => {
* check if model has a non-standard label attribute defined, if not use "name" as the value attribute
*/
const itemLabel = computed(() => {
- if(modelClass.value.model.itemLabel){
+ if (modelClass.value.model.itemLabel) {
return modelClass.value.model.itemLabel
}
return 'name'
@@ -135,7 +137,7 @@ function search(query: string) {
* @param select$ reference to multiselect instance
*/
async function createObject(object: any, select$: Multiselect) {
- return await modelClass.value.create({name: object[itemLabel.value]}).then((createdObj : any) => {
+ return await modelClass.value.create({name: object[itemLabel.value]}).then((createdObj: any) => {
useMessageStore().addMessage(MessageType.SUCCESS, 'Created', 5000, createdObj)
emit('create', object)
return createdObj
@@ -148,17 +150,29 @@ async function createObject(object: any, select$: Multiselect) {
-
\ No newline at end of file
diff --git a/vue3/src/pages/ModelListPage.vue b/vue3/src/pages/ModelListPage.vue
index fc2174f2d..84e8bfccc 100644
--- a/vue3/src/pages/ModelListPage.vue
+++ b/vue3/src/pages/ModelListPage.vue
@@ -51,10 +51,16 @@
{{ $t('Edit') }}
-
+
{{ $t('Merge') }}
+
+ {{ $t('Ingredient Editor') }}
+
+
+ {{ $t('Ingredient Editor') }}
+
@@ -105,12 +111,6 @@ const itemsPerPageOptions = [
{value: 50, title: '50'},
]
-const tableHeaders: VDataTableProps['headers'] = [
- {title: t('Name'), key: 'name'},
- {title: t('Category'), key: 'supermarketCategory.name'},
- {title: t('Actions'), key: 'action', align: 'end'},
-]
-
const tablePage = ref(1)
const tablePageInitialized = ref(false) // TODO workaround until vuetify bug is fixed
@@ -175,6 +175,10 @@ function loadItems({page, itemsPerPage, search, sortBy, groupBy}) {
})
}
+/**
+ * change models and reset page/scroll
+ * @param m
+ */
function changeModel(m: Model) {
tablePage.value = 1
router.push({name: 'ModelListPage', params: {model: m.name.toLowerCase()}})
diff --git a/vue3/src/pages/TestPage.vue b/vue3/src/pages/TestPage.vue
index ca30c5bf6..b6461e399 100644
--- a/vue3/src/pages/TestPage.vue
+++ b/vue3/src/pages/TestPage.vue
@@ -12,6 +12,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+