diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue
index 6bbaf328b..a998c208f 100644
--- a/vue3/src/apps/tandoor/Tandoor.vue
+++ b/vue3/src/apps/tandoor/Tandoor.vue
@@ -38,7 +38,7 @@
-
+
@@ -79,7 +79,7 @@
{{ useUserPreferenceStore().activeSpace.name }}
-
+
@@ -113,7 +113,7 @@
-
+
diff --git a/vue3/src/apps/tandoor/main.ts b/vue3/src/apps/tandoor/main.ts
index 7e2877acc..1bea1d14c 100644
--- a/vue3/src/apps/tandoor/main.ts
+++ b/vue3/src/apps/tandoor/main.ts
@@ -12,7 +12,7 @@ import { createRulesPlugin } from 'vuetify/labs/rules'
import {setupI18n} from "@/i18n";
import MealPlanPage from "@/pages/MealPlanPage.vue";
-import {TandoorPlugin} from "@/types/Plugins.ts";
+import {TANDOOR_PLUGINS, TandoorPlugin} from "@/types/Plugins.ts";
let routes = [
{path: '/', component: () => import("@/pages/StartPage.vue"), name: 'StartPage'},
@@ -56,11 +56,9 @@ let routes = [
{path: '/space-setup', component: () => import("@/pages/SpaceSetupPage.vue"), name: 'SpaceSetupPage'},
]
-const pluginModules = import.meta.glob('@/plugins/*/plugin.ts', { eager: true })
-const tandoorPlugins = [] as TandoorPlugin[]
-Object.values(pluginModules).forEach(module => {
- tandoorPlugins.push(module.plugin)
- routes = routes.concat(module.plugin.routes)
+// load plugin routes into routing table
+TANDOOR_PLUGINS.forEach(plugin => {
+ routes = routes.concat(plugin.routes)
})
const router = createRouter({
diff --git a/vue3/src/components/inputs/BaseUnitSelect.vue b/vue3/src/components/inputs/BaseUnitSelect.vue
new file mode 100644
index 000000000..1a6f575e3
--- /dev/null
+++ b/vue3/src/components/inputs/BaseUnitSelect.vue
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/components/model_editors/UnitConversionEditor.vue b/vue3/src/components/model_editors/UnitConversionEditor.vue
index bd1b70aa0..f7b408a1e 100644
--- a/vue3/src/components/model_editors/UnitConversionEditor.vue
+++ b/vue3/src/components/model_editors/UnitConversionEditor.vue
@@ -39,6 +39,11 @@
+
+
+
+
+
diff --git a/vue3/src/components/model_editors/UnitEditor.vue b/vue3/src/components/model_editors/UnitEditor.vue
index 00789498b..bd6b5a2e8 100644
--- a/vue3/src/components/model_editors/UnitEditor.vue
+++ b/vue3/src/components/model_editors/UnitEditor.vue
@@ -14,7 +14,7 @@
-
+
@@ -29,6 +29,7 @@ import {Unit} from "@/openapi";
import ModelEditorBase from "@/components/model_editors/ModelEditorBase.vue";
import {useModelEditorFunctions} from "@/composables/useModelEditorFunctions";
import {useI18n} from "vue-i18n";
+import BaseUnitSelect from "@/components/inputs/BaseUnitSelect.vue";
const {t} = useI18n()
@@ -51,27 +52,7 @@ watch([() => props.item, () => props.itemId], () => {
// object specific data (for selects/display)
-const BASE_UNITS = [
- {value: "g", title: t("g")},
- {value: "kg", title: t("kg")},
- {value: "ounce", title: t("ounce")},
- {value: "pound", title: t("pound")},
- {value: "ml", title: t("ml")},
- {value: "l", title: t("l")},
- {value: "fluid_ounce", title: t("fluid_ounce")},
- {value: "us_cup", title: t("us_cup")},
- {value: "pint", title: t("pint")},
- {value: "quart", title: t("quart")},
- {value: "gallon", title: t("gallon")},
- {value: "tbsp", title: t("tbsp")},
- {value: "tsp", title: t("tsp")},
- {value: "imperial_fluid_ounce", title: t("imperial_fluid_ounce")},
- {value: "imperial_pint", title: t("imperial_pint")},
- {value: "imperial_quart", title: t("imperial_quart")},
- {value: "imperial_gallon", title: t("imperial_gallon")},
- {value: "imperial_tbsp", title: t("imperial_tbsp")},
- {value: "imperial_tsp", title: t("imperial_tsp")},
-]
+
onMounted(() => {
initializeEditor()
diff --git a/vue3/src/composables/useNavigation.ts b/vue3/src/composables/useNavigation.ts
index 23e6d04b3..c276ffe4a 100644
--- a/vue3/src/composables/useNavigation.ts
+++ b/vue3/src/composables/useNavigation.ts
@@ -2,6 +2,8 @@ import {useI18n} from "vue-i18n";
import {VDivider, VListItem} from "vuetify/components";
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore.ts";
import {useDjangoUrls} from "@/composables/useDjangoUrls.ts";
+import {TANDOOR_PLUGINS} from "@/types/Plugins.ts";
+import {plugin} from "@/plugins/open_data_plugin/plugin.ts";
/**
* manages configuration and loading of navigation entries for tandoor main app and plugins
@@ -9,27 +11,46 @@ import {useDjangoUrls} from "@/composables/useDjangoUrls.ts";
export function useNavigation() {
const {t} = useI18n()
- let NAVIGATION_DRAWER = [
- {component: VListItem, prependIcon: '$recipes', title: 'Home', to: {name: 'StartPage', params: {}}},
- {component: VListItem, prependIcon: '$search', title: t('Search'), to: {name: 'SearchPage', params: {}}},
- {component: VListItem, prependIcon: '$mealplan', title: t('Meal_Plan'), to: {name: 'MealPlanPage', params: {}}},
- {component: VListItem, prependIcon: '$shopping', title: t('Shopping_list'), to: {name: 'ShoppingListPage', params: {}}},
- {component: VListItem, prependIcon: 'fas fa-globe', title: t('Import'), to: {name: 'RecipeImportPage', params: {}}},
- {component: VListItem, prependIcon: '$books', title: t('Books'), to: {name: 'BooksPage', params: {}}},
- {component: VListItem, prependIcon: 'fa-solid fa-folder-tree', title: t('DatabasePage'), to: {name: 'SearchPage', params: {}}},
- ]
+ function getNavigationDrawer() {
+ let navigation = [
+ {component: VListItem, prependIcon: '$recipes', title: 'Home', to: {name: 'StartPage', params: {}}},
+ {component: VListItem, prependIcon: '$search', title: t('Search'), to: {name: 'SearchPage', params: {}}},
+ {component: VListItem, prependIcon: '$mealplan', title: t('Meal_Plan'), to: {name: 'MealPlanPage', params: {}}},
+ {component: VListItem, prependIcon: '$shopping', title: t('Shopping_list'), to: {name: 'ShoppingListPage', params: {}}},
+ {component: VListItem, prependIcon: 'fas fa-globe', title: t('Import'), to: {name: 'RecipeImportPage', params: {}}},
+ {component: VListItem, prependIcon: '$books', title: t('Books'), to: {name: 'BooksPage', params: {}}},
+ {component: VListItem, prependIcon: 'fa-solid fa-folder-tree', title: t('Database'), to: {name: 'DatabasePage', params: {}}},
+ ]
- let BOTTOM_NAVIGATION = [
- {component: VListItem, prependIcon: 'fa-solid fa-sliders', title: t('Settings'), to: {name: 'SettingsPage', params: {}}},
- {component: VListItem, prependIcon: 'fas fa-globe', title: t('Import'), to: {name: 'RecipeImportPage', params: {}}},
- {component: VListItem, prependIcon: 'fa-solid fa-folder-tree', title: t('Database'), to: {name: 'DatabasePage', params: {}}},
- {component: VListItem, prependIcon: '$books', title: t('Books'), to: {name: 'BooksPage', params: {}}},
- ]
+ TANDOOR_PLUGINS.forEach(plugin => {
+ plugin.navigationDrawer.forEach(navEntry => {
+ let navEntryCopy = Object.assign({}, navEntry)
+ navEntryCopy.title = t(navEntryCopy.title)
+ navigation.push(navEntryCopy)
+ })
+ })
- let USER_NAVIGATION = [
- {component: VListItem, prependIcon: 'fa-solid fa-sliders', title: t('Settings'), to: {name: 'SettingsPage', params: {}}},
- {component: VListItem, prependIcon: 'fa-solid fa-question', title: t('Settings'), to: {name: 'HelpPage', params: {}}},
- ]
+ return navigation
+ }
+
+ function getBottomNavigation() {
+ let navigation = [
+ {component: VListItem, prependIcon: 'fa-solid fa-sliders', title: t('Settings'), to: {name: 'SettingsPage', params: {}}},
+ {component: VListItem, prependIcon: 'fas fa-globe', title: t('Import'), to: {name: 'RecipeImportPage', params: {}}},
+ {component: VListItem, prependIcon: 'fa-solid fa-folder-tree', title: t('Database'), to: {name: 'DatabasePage', params: {}}},
+ {component: VListItem, prependIcon: '$books', title: t('Books'), to: {name: 'BooksPage', params: {}}},
+ ]
+
+ TANDOOR_PLUGINS.forEach(plugin => {
+ plugin.bottomNavigation.forEach(navEntry => {
+ let navEntryCopy = Object.assign({}, navEntry)
+ navEntryCopy.title = t(navEntryCopy.title)
+ navigation.push(navEntryCopy)
+ })
+ })
+
+ return navigation
+ }
function getUserNavigation() {
let navigation = []
@@ -56,26 +77,18 @@ export function useNavigation() {
navigation.push({component: VDivider})
}
+ TANDOOR_PLUGINS.forEach(plugin => {
+ plugin.userNavigation.forEach(navEntry => {
+ let navEntryCopy = Object.assign({}, navEntry)
+ navEntryCopy.title = t(navEntryCopy.title)
+ navigation.push(navEntryCopy)
+ })
+ })
+
navigation.push({component: VListItem, prependIcon: 'fa-solid fa-arrow-right-from-bracket', title: t('Logout'), href: useDjangoUrls().getDjangoUrl('accounts/logout')})
return navigation
}
- return {NAVIGATION_DRAWER, BOTTOM_NAVIGATION, USER_NAVIGATION, getUserNavigation}
-}
-
-
-//
-
-//
-//
-//
-//
-// {{ $t('Admin') }}
-//
-//
-//
-//
-//
-// {{ $t('Logout') }}
-//
\ No newline at end of file
+ return {getNavigationDrawer, getBottomNavigation, getUserNavigation}
+}
\ No newline at end of file
diff --git a/vue3/src/i18n.ts b/vue3/src/i18n.ts
index f6687d3d7..6d6735647 100644
--- a/vue3/src/i18n.ts
+++ b/vue3/src/i18n.ts
@@ -7,6 +7,7 @@ import type {
import {createI18n} from "vue-i18n";
import en from "../../vue3/src/locales/en.json";
+import {TANDOOR_PLUGINS} from "@/types/Plugins.ts";
/**
* lazy loading of translation, resources:
@@ -31,10 +32,17 @@ export function setupI18n() {
locale: 'en',
fallbackLocale: 'en',
messages: {
- en
+ en,
},
}) as I18n
+ // async load plugin default locales
+ TANDOOR_PLUGINS.forEach(plugin => {
+ plugin.defaultLocale.then(pluginMessages => {
+ i18n.global.mergeLocaleMessage('en', pluginMessages)
+ })
+ })
+
// async load user locale into existing i18n instance
loadLocaleMessages(i18n, locale).then()
@@ -48,9 +56,10 @@ export function setupI18n() {
*/
export async function loadLocaleMessages(i18n: I18n, locale: Locale) {
// load locale messages
- const messages = await import(`./locales/${locale}.json`).then(
- (r: any) => r.default || r
- )
+ let messages = en
+ if (locale != 'en') {
+ messages = await import(`./locales/${locale}.json`).then((r: any) => r.default || r)
+ }
// remove empty strings
Object.entries(messages).forEach(([key, value]) => {
@@ -62,6 +71,25 @@ export async function loadLocaleMessages(i18n: I18n, locale: Locale) {
// set messages for locale
i18n.global.setLocaleMessage(locale, messages)
+ // async load and merge messages from plugins
+ TANDOOR_PLUGINS.forEach(plugin => {
+ let pluginLocales = getSupportedLocales(plugin.localeFiles)
+ if (pluginLocales.includes(locale)) {
+ import(`@/plugins/${plugin.basePath}/locales/${locale}.json`).then((r: any) => {
+ let pluginMessages = r.default || r
+
+ // remove empty strings
+ Object.entries(pluginMessages).forEach(([key, value]) => {
+ if (value === '') {
+ delete pluginMessages[key]
+ }
+ })
+
+ i18n.global.mergeLocaleMessage(locale, pluginMessages)
+ })
+ }
+ })
+
// switch to given locale
setLocale(i18n, locale)
}
@@ -69,10 +97,11 @@ export async function loadLocaleMessages(i18n: I18n, locale: Locale) {
/**
* loop trough translation files to determine for which locales a translation is available
* @return string[] of supported locales
+ * @param localeFiles module import of locale files to loop trough
*/
-function getSupportedLocales() {
+function getSupportedLocales(localeFiles = import.meta.glob('@/locales/*.json')) {
let supportedLocales: string[] = []
- let localeFiles = import.meta.glob('@/locales/*.json');
+
for (const path in localeFiles) {
supportedLocales.push(path.split('/').slice(-1)[0].split('.')[0]);
}
diff --git a/vue3/src/locales/en.json b/vue3/src/locales/en.json
index 0d658b7b3..682b8596e 100644
--- a/vue3/src/locales/en.json
+++ b/vue3/src/locales/en.json
@@ -71,6 +71,7 @@
"Combine_All_Steps": "Combine all steps into a single field.",
"Coming_Soon": "Coming-Soon",
"Comments_setting": "Show Comments",
+ "Comment": "Comment",
"Completed": "Completed",
"Confirm": "Confirm",
"ConnectorConfig": "Connectors",
@@ -459,6 +460,7 @@
"Size": "Size",
"Social_Authentication": "Social Authentication",
"Sort_by_new": "Sort by new",
+ "Source": "Source",
"SourceImportHelp": "Import JSON in schema.org/recipe format or html pages with json+ld recipe or microdata.",
"SourceImportSubtitle": "Import JSON or HTML manually.",
"SpaceLimitExceeded": "Your space has surpassed one of its limits, some functions might be restricted.",
diff --git a/vue3/src/openapi/.openapi-generator/FILES b/vue3/src/openapi/.openapi-generator/FILES
index d41793271..e4c8ba2c7 100644
--- a/vue3/src/openapi/.openapi-generator/FILES
+++ b/vue3/src/openapi/.openapi-generator/FILES
@@ -64,6 +64,13 @@ models/PaginatedInviteLinkList.ts
models/PaginatedKeywordList.ts
models/PaginatedMealPlanList.ts
models/PaginatedMealTypeList.ts
+models/PaginatedOpenDataCategoryList.ts
+models/PaginatedOpenDataConversionList.ts
+models/PaginatedOpenDataFoodList.ts
+models/PaginatedOpenDataPropertyList.ts
+models/PaginatedOpenDataStoreList.ts
+models/PaginatedOpenDataUnitList.ts
+models/PaginatedOpenDataVersionList.ts
models/PaginatedPropertyList.ts
models/PaginatedPropertyTypeList.ts
models/PaginatedRecipeBookEntryList.ts
diff --git a/vue3/src/openapi/apis/ApiApi.ts b/vue3/src/openapi/apis/ApiApi.ts
index fde942ac4..a181db422 100644
--- a/vue3/src/openapi/apis/ApiApi.ts
+++ b/vue3/src/openapi/apis/ApiApi.ts
@@ -60,6 +60,13 @@ import type {
PaginatedKeywordList,
PaginatedMealPlanList,
PaginatedMealTypeList,
+ PaginatedOpenDataCategoryList,
+ PaginatedOpenDataConversionList,
+ PaginatedOpenDataFoodList,
+ PaginatedOpenDataPropertyList,
+ PaginatedOpenDataStoreList,
+ PaginatedOpenDataUnitList,
+ PaginatedOpenDataVersionList,
PaginatedPropertyList,
PaginatedPropertyTypeList,
PaginatedRecipeBookEntryList,
@@ -252,6 +259,20 @@ import {
PaginatedMealPlanListToJSON,
PaginatedMealTypeListFromJSON,
PaginatedMealTypeListToJSON,
+ PaginatedOpenDataCategoryListFromJSON,
+ PaginatedOpenDataCategoryListToJSON,
+ PaginatedOpenDataConversionListFromJSON,
+ PaginatedOpenDataConversionListToJSON,
+ PaginatedOpenDataFoodListFromJSON,
+ PaginatedOpenDataFoodListToJSON,
+ PaginatedOpenDataPropertyListFromJSON,
+ PaginatedOpenDataPropertyListToJSON,
+ PaginatedOpenDataStoreListFromJSON,
+ PaginatedOpenDataStoreListToJSON,
+ PaginatedOpenDataUnitListFromJSON,
+ PaginatedOpenDataUnitListToJSON,
+ PaginatedOpenDataVersionListFromJSON,
+ PaginatedOpenDataVersionListToJSON,
PaginatedPropertyListFromJSON,
PaginatedPropertyListToJSON,
PaginatedPropertyTypeListFromJSON,
@@ -955,6 +976,11 @@ export interface ApiOpenDataCategoryDestroyRequest {
id: number;
}
+export interface ApiOpenDataCategoryListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataCategoryPartialUpdateRequest {
id: number;
patchedOpenDataCategory?: Omit;
@@ -977,6 +1003,11 @@ export interface ApiOpenDataConversionDestroyRequest {
id: number;
}
+export interface ApiOpenDataConversionListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataConversionPartialUpdateRequest {
id: number;
patchedOpenDataConversion?: Omit;
@@ -1003,6 +1034,16 @@ export interface ApiOpenDataFoodDestroyRequest {
id: number;
}
+export interface ApiOpenDataFoodFdcCreateRequest {
+ id: number;
+ openDataFood: Omit;
+}
+
+export interface ApiOpenDataFoodListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataFoodPartialUpdateRequest {
id: number;
patchedOpenDataFood?: Omit;
@@ -1025,6 +1066,11 @@ export interface ApiOpenDataPropertyDestroyRequest {
id: number;
}
+export interface ApiOpenDataPropertyListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataPropertyPartialUpdateRequest {
id: number;
patchedOpenDataProperty?: Omit;
@@ -1047,6 +1093,11 @@ export interface ApiOpenDataStoreDestroyRequest {
id: number;
}
+export interface ApiOpenDataStoreListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataStorePartialUpdateRequest {
id: number;
patchedOpenDataStore?: Omit;
@@ -1069,6 +1120,11 @@ export interface ApiOpenDataUnitDestroyRequest {
id: number;
}
+export interface ApiOpenDataUnitListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataUnitPartialUpdateRequest {
id: number;
patchedOpenDataUnit?: Omit;
@@ -1091,6 +1147,11 @@ export interface ApiOpenDataVersionDestroyRequest {
id: number;
}
+export interface ApiOpenDataVersionListRequest {
+ page?: number;
+ pageSize?: number;
+}
+
export interface ApiOpenDataVersionPartialUpdateRequest {
id: number;
patchedOpenDataVersion?: PatchedOpenDataVersion;
@@ -6324,9 +6385,17 @@ export class ApiApi extends runtime.BaseAPI {
/**
*/
- async apiOpenDataCategoryListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataCategoryListRaw(requestParameters: ApiOpenDataCategoryListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
const queryParameters: any = {};
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
@@ -6340,13 +6409,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataCategoryFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataCategoryListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataCategoryList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataCategoryListRaw(initOverrides);
+ async apiOpenDataCategoryList(requestParameters: ApiOpenDataCategoryListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataCategoryListRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -6542,9 +6611,17 @@ export class ApiApi extends runtime.BaseAPI {
/**
*/
- async apiOpenDataConversionListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataConversionListRaw(requestParameters: ApiOpenDataConversionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
const queryParameters: any = {};
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
@@ -6558,13 +6635,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataConversionFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataConversionListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataConversionList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataConversionListRaw(initOverrides);
+ async apiOpenDataConversionList(requestParameters: ApiOpenDataConversionListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataConversionListRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -6793,12 +6870,67 @@ export class ApiApi extends runtime.BaseAPI {
}
/**
+ * updates the food with all possible data from the FDC Api if properties with a fdc_id already exist they will be overridden, if existing properties don\'t have a fdc_id they won\'t be changed
*/
- async apiOpenDataFoodListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataFoodFdcCreateRaw(requestParameters: ApiOpenDataFoodFdcCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
+ if (requestParameters['id'] == null) {
+ throw new runtime.RequiredError(
+ 'id',
+ 'Required parameter "id" was null or undefined when calling apiOpenDataFoodFdcCreate().'
+ );
+ }
+
+ if (requestParameters['openDataFood'] == null) {
+ throw new runtime.RequiredError(
+ 'openDataFood',
+ 'Required parameter "openDataFood" was null or undefined when calling apiOpenDataFoodFdcCreate().'
+ );
+ }
+
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
+ headerParameters['Content-Type'] = 'application/json';
+
+ if (this.configuration && this.configuration.apiKey) {
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
+ }
+
+ const response = await this.request({
+ path: `/api/open-data-food/{id}/fdc/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
+ method: 'POST',
+ headers: headerParameters,
+ query: queryParameters,
+ body: OpenDataFoodToJSON(requestParameters['openDataFood']),
+ }, initOverrides);
+
+ return new runtime.JSONApiResponse(response, (jsonValue) => OpenDataFoodFromJSON(jsonValue));
+ }
+
+ /**
+ * updates the food with all possible data from the FDC Api if properties with a fdc_id already exist they will be overridden, if existing properties don\'t have a fdc_id they won\'t be changed
+ */
+ async apiOpenDataFoodFdcCreate(requestParameters: ApiOpenDataFoodFdcCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataFoodFdcCreateRaw(requestParameters, initOverrides);
+ return await response.value();
+ }
+
+ /**
+ */
+ async apiOpenDataFoodListRaw(requestParameters: ApiOpenDataFoodListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
+ const queryParameters: any = {};
+
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
+ const headerParameters: runtime.HTTPHeaders = {};
+
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
}
@@ -6810,13 +6942,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataFoodFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataFoodListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataFoodList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataFoodListRaw(initOverrides);
+ async apiOpenDataFoodList(requestParameters: ApiOpenDataFoodListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataFoodListRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -7012,9 +7144,17 @@ export class ApiApi extends runtime.BaseAPI {
/**
*/
- async apiOpenDataPropertyListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataPropertyListRaw(requestParameters: ApiOpenDataPropertyListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
const queryParameters: any = {};
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
@@ -7028,13 +7168,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataPropertyFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataPropertyListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataPropertyList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataPropertyListRaw(initOverrides);
+ async apiOpenDataPropertyList(requestParameters: ApiOpenDataPropertyListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataPropertyListRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -7257,9 +7397,17 @@ export class ApiApi extends runtime.BaseAPI {
/**
*/
- async apiOpenDataStoreListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataStoreListRaw(requestParameters: ApiOpenDataStoreListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
const queryParameters: any = {};
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
@@ -7273,13 +7421,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataStoreFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataStoreListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataStoreList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataStoreListRaw(initOverrides);
+ async apiOpenDataStoreList(requestParameters: ApiOpenDataStoreListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataStoreListRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -7475,9 +7623,17 @@ export class ApiApi extends runtime.BaseAPI {
/**
*/
- async apiOpenDataUnitListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataUnitListRaw(requestParameters: ApiOpenDataUnitListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
const queryParameters: any = {};
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
@@ -7491,13 +7647,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataUnitFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataUnitListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataUnitList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataUnitListRaw(initOverrides);
+ async apiOpenDataUnitList(requestParameters: ApiOpenDataUnitListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataUnitListRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -7693,9 +7849,17 @@ export class ApiApi extends runtime.BaseAPI {
/**
*/
- async apiOpenDataVersionListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> {
+ async apiOpenDataVersionListRaw(requestParameters: ApiOpenDataVersionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
const queryParameters: any = {};
+ if (requestParameters['page'] != null) {
+ queryParameters['page'] = requestParameters['page'];
+ }
+
+ if (requestParameters['pageSize'] != null) {
+ queryParameters['page_size'] = requestParameters['pageSize'];
+ }
+
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
@@ -7709,13 +7873,13 @@ export class ApiApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenDataVersionFromJSON));
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOpenDataVersionListFromJSON(jsonValue));
}
/**
*/
- async apiOpenDataVersionList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
- const response = await this.apiOpenDataVersionListRaw(initOverrides);
+ async apiOpenDataVersionList(requestParameters: ApiOpenDataVersionListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
+ const response = await this.apiOpenDataVersionListRaw(requestParameters, initOverrides);
return await response.value();
}
diff --git a/vue3/src/openapi/models/BaseUnitEnum.ts b/vue3/src/openapi/models/BaseUnitEnum.ts
index 6688a9bfc..a269ab200 100644
--- a/vue3/src/openapi/models/BaseUnitEnum.ts
+++ b/vue3/src/openapi/models/BaseUnitEnum.ts
@@ -14,43 +14,47 @@
/**
- * * `G` - g
- * * `KG` - kg
- * * `ML` - ml
- * * `L` - l
- * * `OUNCE` - ounce
- * * `POUND` - pound
- * * `FLUID_OUNCE` - fluid_ounce
- * * `TSP` - tsp
- * * `TBSP` - tbsp
- * * `CUP` - cup
- * * `PINT` - pint
- * * `QUART` - quart
- * * `GALLON` - gallon
- * * `IMPERIAL_FLUID_OUNCE` - imperial fluid ounce
- * * `IMPERIAL_PINT` - imperial pint
- * * `IMPERIAL_QUART` - imperial quart
- * * `IMPERIAL_GALLON` - imperial gallon
+ * * `g` - g
+ * * `kg` - kg
+ * * `ounce` - ounce
+ * * `pound` - pound
+ * * `ml` - ml
+ * * `l` - l
+ * * `fluid_ounce` - fluid_ounce
+ * * `pint` - pint
+ * * `quart` - quart
+ * * `gallon` - gallon
+ * * `tbsp` - tbsp
+ * * `tsp` - tsp
+ * * `us_cup` - US Cup
+ * * `imperial_fluid_ounce` - imperial fluid ounce
+ * * `imperial_pint` - imperial pint
+ * * `imperial_quart` - imperial quart
+ * * `imperial_gallon` - imperial gallon
+ * * `imperial_tbsp` - imperial tbsp
+ * * `imperial_tsp` - imperial tsp
* @export
*/
export const BaseUnitEnum = {
- G: 'G',
- Kg: 'KG',
- Ml: 'ML',
- L: 'L',
- Ounce: 'OUNCE',
- Pound: 'POUND',
- FluidOunce: 'FLUID_OUNCE',
- Tsp: 'TSP',
- Tbsp: 'TBSP',
- Cup: 'CUP',
- Pint: 'PINT',
- Quart: 'QUART',
- Gallon: 'GALLON',
- ImperialFluidOunce: 'IMPERIAL_FLUID_OUNCE',
- ImperialPint: 'IMPERIAL_PINT',
- ImperialQuart: 'IMPERIAL_QUART',
- ImperialGallon: 'IMPERIAL_GALLON'
+ G: 'g',
+ Kg: 'kg',
+ Ounce: 'ounce',
+ Pound: 'pound',
+ Ml: 'ml',
+ L: 'l',
+ FluidOunce: 'fluid_ounce',
+ Pint: 'pint',
+ Quart: 'quart',
+ Gallon: 'gallon',
+ Tbsp: 'tbsp',
+ Tsp: 'tsp',
+ UsCup: 'us_cup',
+ ImperialFluidOunce: 'imperial_fluid_ounce',
+ ImperialPint: 'imperial_pint',
+ ImperialQuart: 'imperial_quart',
+ ImperialGallon: 'imperial_gallon',
+ ImperialTbsp: 'imperial_tbsp',
+ ImperialTsp: 'imperial_tsp'
} as const;
export type BaseUnitEnum = typeof BaseUnitEnum[keyof typeof BaseUnitEnum];
diff --git a/vue3/src/openapi/models/OpenDataFood.ts b/vue3/src/openapi/models/OpenDataFood.ts
index d11a147e9..d9780f860 100644
--- a/vue3/src/openapi/models/OpenDataFood.ts
+++ b/vue3/src/openapi/models/OpenDataFood.ts
@@ -164,10 +164,10 @@ export interface OpenDataFood {
propertiesSource?: string;
/**
*
- * @type {string}
+ * @type {number}
* @memberof OpenDataFood
*/
- fdcId: string;
+ fdcId?: number;
/**
*
* @type {string}
@@ -193,7 +193,6 @@ export function instanceOfOpenDataFood(value: object): value is OpenDataFood {
if (!('storeCategory' in value) || value['storeCategory'] === undefined) return false;
if (!('properties' in value) || value['properties'] === undefined) return false;
if (!('propertiesFoodUnit' in value) || value['propertiesFoodUnit'] === undefined) return false;
- if (!('fdcId' in value) || value['fdcId'] === undefined) return false;
if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
return true;
}
@@ -222,7 +221,7 @@ export function OpenDataFoodFromJSONTyped(json: any, ignoreDiscriminator: boolea
'propertiesFoodAmount': json['properties_food_amount'] == null ? undefined : json['properties_food_amount'],
'propertiesFoodUnit': OpenDataUnitFromJSON(json['properties_food_unit']),
'propertiesSource': json['properties_source'] == null ? undefined : json['properties_source'],
- 'fdcId': json['fdc_id'],
+ 'fdcId': json['fdc_id'] == null ? undefined : json['fdc_id'],
'comment': json['comment'] == null ? undefined : json['comment'],
'createdBy': json['created_by'],
};
diff --git a/vue3/src/openapi/models/PaginatedOpenDataCategoryList.ts b/vue3/src/openapi/models/PaginatedOpenDataCategoryList.ts
new file mode 100644
index 000000000..d46919d03
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataCategoryList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataCategory } from './OpenDataCategory';
+import {
+ OpenDataCategoryFromJSON,
+ OpenDataCategoryFromJSONTyped,
+ OpenDataCategoryToJSON,
+} from './OpenDataCategory';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataCategoryList
+ */
+export interface PaginatedOpenDataCategoryList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataCategoryList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataCategoryList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataCategoryList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataCategoryList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataCategoryList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataCategoryList interface.
+ */
+export function instanceOfPaginatedOpenDataCategoryList(value: object): value is PaginatedOpenDataCategoryList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataCategoryListFromJSON(json: any): PaginatedOpenDataCategoryList {
+ return PaginatedOpenDataCategoryListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataCategoryListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataCategoryList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataCategoryFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataCategoryListToJSON(value?: PaginatedOpenDataCategoryList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataCategoryToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PaginatedOpenDataConversionList.ts b/vue3/src/openapi/models/PaginatedOpenDataConversionList.ts
new file mode 100644
index 000000000..b2b5a0875
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataConversionList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataConversion } from './OpenDataConversion';
+import {
+ OpenDataConversionFromJSON,
+ OpenDataConversionFromJSONTyped,
+ OpenDataConversionToJSON,
+} from './OpenDataConversion';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataConversionList
+ */
+export interface PaginatedOpenDataConversionList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataConversionList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataConversionList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataConversionList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataConversionList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataConversionList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataConversionList interface.
+ */
+export function instanceOfPaginatedOpenDataConversionList(value: object): value is PaginatedOpenDataConversionList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataConversionListFromJSON(json: any): PaginatedOpenDataConversionList {
+ return PaginatedOpenDataConversionListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataConversionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataConversionList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataConversionFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataConversionListToJSON(value?: PaginatedOpenDataConversionList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataConversionToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PaginatedOpenDataFoodList.ts b/vue3/src/openapi/models/PaginatedOpenDataFoodList.ts
new file mode 100644
index 000000000..9e2c544c3
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataFoodList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataFood } from './OpenDataFood';
+import {
+ OpenDataFoodFromJSON,
+ OpenDataFoodFromJSONTyped,
+ OpenDataFoodToJSON,
+} from './OpenDataFood';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataFoodList
+ */
+export interface PaginatedOpenDataFoodList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataFoodList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataFoodList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataFoodList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataFoodList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataFoodList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataFoodList interface.
+ */
+export function instanceOfPaginatedOpenDataFoodList(value: object): value is PaginatedOpenDataFoodList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataFoodListFromJSON(json: any): PaginatedOpenDataFoodList {
+ return PaginatedOpenDataFoodListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataFoodListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataFoodList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataFoodFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataFoodListToJSON(value?: PaginatedOpenDataFoodList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataFoodToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PaginatedOpenDataPropertyList.ts b/vue3/src/openapi/models/PaginatedOpenDataPropertyList.ts
new file mode 100644
index 000000000..7e0bebe08
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataPropertyList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataProperty } from './OpenDataProperty';
+import {
+ OpenDataPropertyFromJSON,
+ OpenDataPropertyFromJSONTyped,
+ OpenDataPropertyToJSON,
+} from './OpenDataProperty';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataPropertyList
+ */
+export interface PaginatedOpenDataPropertyList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataPropertyList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataPropertyList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataPropertyList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataPropertyList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataPropertyList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataPropertyList interface.
+ */
+export function instanceOfPaginatedOpenDataPropertyList(value: object): value is PaginatedOpenDataPropertyList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataPropertyListFromJSON(json: any): PaginatedOpenDataPropertyList {
+ return PaginatedOpenDataPropertyListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataPropertyListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataPropertyList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataPropertyFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataPropertyListToJSON(value?: PaginatedOpenDataPropertyList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataPropertyToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PaginatedOpenDataStoreList.ts b/vue3/src/openapi/models/PaginatedOpenDataStoreList.ts
new file mode 100644
index 000000000..9270e14c7
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataStoreList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataStore } from './OpenDataStore';
+import {
+ OpenDataStoreFromJSON,
+ OpenDataStoreFromJSONTyped,
+ OpenDataStoreToJSON,
+} from './OpenDataStore';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataStoreList
+ */
+export interface PaginatedOpenDataStoreList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataStoreList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataStoreList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataStoreList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataStoreList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataStoreList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataStoreList interface.
+ */
+export function instanceOfPaginatedOpenDataStoreList(value: object): value is PaginatedOpenDataStoreList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataStoreListFromJSON(json: any): PaginatedOpenDataStoreList {
+ return PaginatedOpenDataStoreListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataStoreListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataStoreList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataStoreFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataStoreListToJSON(value?: PaginatedOpenDataStoreList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataStoreToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PaginatedOpenDataUnitList.ts b/vue3/src/openapi/models/PaginatedOpenDataUnitList.ts
new file mode 100644
index 000000000..1426bfbfd
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataUnitList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataUnit } from './OpenDataUnit';
+import {
+ OpenDataUnitFromJSON,
+ OpenDataUnitFromJSONTyped,
+ OpenDataUnitToJSON,
+} from './OpenDataUnit';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataUnitList
+ */
+export interface PaginatedOpenDataUnitList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataUnitList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataUnitList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataUnitList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataUnitList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataUnitList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataUnitList interface.
+ */
+export function instanceOfPaginatedOpenDataUnitList(value: object): value is PaginatedOpenDataUnitList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataUnitListFromJSON(json: any): PaginatedOpenDataUnitList {
+ return PaginatedOpenDataUnitListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataUnitListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataUnitList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataUnitFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataUnitListToJSON(value?: PaginatedOpenDataUnitList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataUnitToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PaginatedOpenDataVersionList.ts b/vue3/src/openapi/models/PaginatedOpenDataVersionList.ts
new file mode 100644
index 000000000..f3f936491
--- /dev/null
+++ b/vue3/src/openapi/models/PaginatedOpenDataVersionList.ts
@@ -0,0 +1,101 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Tandoor
+ * Tandoor API Docs
+ *
+ * The version of the OpenAPI document: 0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+import { mapValues } from '../runtime';
+import type { OpenDataVersion } from './OpenDataVersion';
+import {
+ OpenDataVersionFromJSON,
+ OpenDataVersionFromJSONTyped,
+ OpenDataVersionToJSON,
+} from './OpenDataVersion';
+
+/**
+ *
+ * @export
+ * @interface PaginatedOpenDataVersionList
+ */
+export interface PaginatedOpenDataVersionList {
+ /**
+ *
+ * @type {number}
+ * @memberof PaginatedOpenDataVersionList
+ */
+ count: number;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataVersionList
+ */
+ next?: string;
+ /**
+ *
+ * @type {string}
+ * @memberof PaginatedOpenDataVersionList
+ */
+ previous?: string;
+ /**
+ *
+ * @type {Array}
+ * @memberof PaginatedOpenDataVersionList
+ */
+ results: Array;
+ /**
+ *
+ * @type {Date}
+ * @memberof PaginatedOpenDataVersionList
+ */
+ timestamp?: Date;
+}
+
+/**
+ * Check if a given object implements the PaginatedOpenDataVersionList interface.
+ */
+export function instanceOfPaginatedOpenDataVersionList(value: object): value is PaginatedOpenDataVersionList {
+ if (!('count' in value) || value['count'] === undefined) return false;
+ if (!('results' in value) || value['results'] === undefined) return false;
+ return true;
+}
+
+export function PaginatedOpenDataVersionListFromJSON(json: any): PaginatedOpenDataVersionList {
+ return PaginatedOpenDataVersionListFromJSONTyped(json, false);
+}
+
+export function PaginatedOpenDataVersionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedOpenDataVersionList {
+ if (json == null) {
+ return json;
+ }
+ return {
+
+ 'count': json['count'],
+ 'next': json['next'] == null ? undefined : json['next'],
+ 'previous': json['previous'] == null ? undefined : json['previous'],
+ 'results': ((json['results'] as Array).map(OpenDataVersionFromJSON)),
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
+ };
+}
+
+export function PaginatedOpenDataVersionListToJSON(value?: PaginatedOpenDataVersionList | null): any {
+ if (value == null) {
+ return value;
+ }
+ return {
+
+ 'count': value['count'],
+ 'next': value['next'],
+ 'previous': value['previous'],
+ 'results': ((value['results'] as Array).map(OpenDataVersionToJSON)),
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
+ };
+}
+
diff --git a/vue3/src/openapi/models/PatchedOpenDataFood.ts b/vue3/src/openapi/models/PatchedOpenDataFood.ts
index 127bf5a05..a84b70e39 100644
--- a/vue3/src/openapi/models/PatchedOpenDataFood.ts
+++ b/vue3/src/openapi/models/PatchedOpenDataFood.ts
@@ -164,10 +164,10 @@ export interface PatchedOpenDataFood {
propertiesSource?: string;
/**
*
- * @type {string}
+ * @type {number}
* @memberof PatchedOpenDataFood
*/
- fdcId?: string;
+ fdcId?: number;
/**
*
* @type {string}
diff --git a/vue3/src/openapi/models/index.ts b/vue3/src/openapi/models/index.ts
index 47002d8cd..2ad721d7f 100644
--- a/vue3/src/openapi/models/index.ts
+++ b/vue3/src/openapi/models/index.ts
@@ -62,6 +62,13 @@ export * from './PaginatedInviteLinkList';
export * from './PaginatedKeywordList';
export * from './PaginatedMealPlanList';
export * from './PaginatedMealTypeList';
+export * from './PaginatedOpenDataCategoryList';
+export * from './PaginatedOpenDataConversionList';
+export * from './PaginatedOpenDataFoodList';
+export * from './PaginatedOpenDataPropertyList';
+export * from './PaginatedOpenDataStoreList';
+export * from './PaginatedOpenDataUnitList';
+export * from './PaginatedOpenDataVersionList';
export * from './PaginatedPropertyList';
export * from './PaginatedPropertyTypeList';
export * from './PaginatedRecipeBookEntryList';
diff --git a/vue3/src/pages/DatabasePage.vue b/vue3/src/pages/DatabasePage.vue
index d52152643..99b5ce4a3 100644
--- a/vue3/src/pages/DatabasePage.vue
+++ b/vue3/src/pages/DatabasePage.vue
@@ -1,9 +1,5 @@
-
- {{ $t('Database') }}
-
-
diff --git a/vue3/src/plugins/open_data_plugin/OpenDataPage.vue b/vue3/src/plugins/open_data_plugin/OpenDataPage.vue
deleted file mode 100644
index 6223ed9e0..000000000
--- a/vue3/src/plugins/open_data_plugin/OpenDataPage.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- Welcome to the OpenData Plugin in Tandoor 2
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataCategoryEditor.vue b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataCategoryEditor.vue
new file mode 100644
index 000000000..66a5bac50
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataCategoryEditor.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataConversionEditor.vue b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataConversionEditor.vue
new file mode 100644
index 000000000..71b57c84e
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataConversionEditor.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue
index 1a211dbfa..006241471 100644
--- a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue
+++ b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue
@@ -9,24 +9,83 @@
:is-changed="editingObjChanged"
:model-class="modelClass"
:object-name="editingObjName()">
-
-
-
-
-
-
+
+
+ {{ $t('Food') }}
+ {{ $t('Properties') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('Add')}}
+
+
+
+
+
+
+
+ {editingObj.fdcId = fdcId;}">
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataUnitEditor.vue b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataUnitEditor.vue
new file mode 100644
index 000000000..25e6833ea
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataUnitEditor.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataVersionEditor.vue b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataVersionEditor.vue
new file mode 100644
index 000000000..35954183b
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataVersionEditor.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/locales/de.json b/vue3/src/plugins/open_data_plugin/locales/de.json
new file mode 100644
index 000000000..3cc101a6e
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/locales/de.json
@@ -0,0 +1,5 @@
+{
+ "OpenData": "Open Data",
+ "OpenDataHelp": "Das Tandoor Open Data Projekt soll arbeitet an einem gemeinsamen Datensatz von Lebensmitteln, Einheiten, Umrechungen und mehr um den Start in Tandoor zu erleichtern.",
+ "OpenDataVersionHelp": ""
+}
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/locales/en.json b/vue3/src/plugins/open_data_plugin/locales/en.json
new file mode 100644
index 000000000..77495b5eb
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/locales/en.json
@@ -0,0 +1,5 @@
+{
+ "OpenData": "Open Data",
+ "OpenDataHelp": "The Tandoor Open Data project aims to get you started with tandoor faster and easier by providing a vast dataset of community contributed objects ranging from foods to units, stores and conversions.",
+ "OpenDataVersionHelp": "Every Open Data Object has a Version. Versions are used to create specific variants of the Open Data Dataset. The base version contains data valid around the world and is always in english. Other versions should be in their repective languages. "
+}
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/pages/OpenDataPage.vue b/vue3/src/plugins/open_data_plugin/pages/OpenDataPage.vue
new file mode 100644
index 000000000..6b4caf5df
--- /dev/null
+++ b/vue3/src/plugins/open_data_plugin/pages/OpenDataPage.vue
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+ {{ $t('OpenDataHelp') }}
+
+
+ GitHub
+ Discord
+
+
+
+
+
+
+
+ Data
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('Help') }}
+
+
+
+
+
+ Quickstart
+
+
+ - Create and Edit data as you are used to with tandoor
+ - Many foods can be found in the FDC Database. Copy the
+ FDC ID to quickly import it in the
+ food editor. If appropriate for the food create a conversion (some foods will come with a measurement comment).
+
+ - You can only edit foods, stores and conversions you created yourself, ask on discord to get verified so you can edit everything.
+ - If unsure about something ask others for their opinion on discord. Also take a look at this collection of examples.
+
+ - Use the
comment field in each object to add notes for other people reading or contributing.
+
+
+
+
+
+
+ Versions
+
+
+
+ - Each object has a version
+ - The
base version contains data valid around the world and is always in english
+ - All objects of specific versions are in their respective language
+
+
+
+
+
+
+ Translations
+
+
+ Data for a select language is only available for translated entries.
+ To help translate head over to the Tandoor Translation Page here.
+
+
+
+
+
+
+
+ Leaderboards
+
+
+
+
+ WIP
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/plugins/open_data_plugin/plugin.ts b/vue3/src/plugins/open_data_plugin/plugin.ts
index 83f528700..1a0d223fd 100644
--- a/vue3/src/plugins/open_data_plugin/plugin.ts
+++ b/vue3/src/plugins/open_data_plugin/plugin.ts
@@ -1,17 +1,102 @@
import {TandoorPlugin} from '@/types/Plugins.ts'
import {Model, registerModel} from "@/types/Models.ts";
import {defineAsyncComponent} from "vue";
+import {VListItem} from "vuetify/components";
export const plugin: TandoorPlugin = {
name: 'Open Data Plugin',
+ basePath: 'open_data_plugin',
+ defaultLocale: import(`@/plugins/open_data_plugin/locales/en.json`),
+ localeFiles: import.meta.glob('@/plugins/open_data_plugin/locales/*.json'),
routes: [
- {path: '/open-data/', component: () => import("@/plugins/open_data_plugin/OpenDataPage.vue"), name: 'OpenDataPage'},
- ]
+ {path: '/open-data/', component: () => import("@/plugins/open_data_plugin/pages/OpenDataPage.vue"), name: 'OpenDataPage'},
+ ],
+ navigationDrawer: [],
+ bottomNavigation: [],
+ userNavigation: [
+ {component: VListItem, prependIcon: 'fa-solid fa-folder-tree', title: 'OpenData', to: {name: 'OpenDataPage', params: {}}},
+ ],
} as TandoorPlugin
// define models below
+const TOpenDataVersion = {
+ name: 'OpenDataVersion',
+ localizationKey: 'Version',
+ localizationKeyDescription: 'OpenDataVersionHelp',
+ icon: 'fa-solid fa-hashtag',
+
+ editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataVersionEditor.vue`)),
+
+ isPaginated: true,
+ isMerge: false,
+ toStringKeys: ['name'],
+
+ tableHeaders: [
+ {title: 'Name', key: 'name'},
+ {title: 'Actions', key: 'action', align: 'end'},
+ ]
+} as Model
+registerModel(TOpenDataVersion)
+
+const TOpenDataUnit = {
+ name: 'OpenDataUnit',
+ localizationKey: 'Unit',
+ localizationKeyDescription: 'UnitHelp',
+ icon: 'fa-solid fa-scale-balanced',
+
+ editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataUnitEditor.vue`)),
+
+ isPaginated: true,
+ isMerge: false,
+ toStringKeys: ['name'],
+
+ tableHeaders: [
+ {title: 'Name', key: 'name'},
+ {title: 'Actions', key: 'action', align: 'end'},
+ ]
+} as Model
+registerModel(TOpenDataUnit)
+
+const TOpenDataCategory = {
+ name: 'OpenDataCategory',
+ localizationKey: 'Category',
+ localizationKeyDescription: 'SupermarketCategoryHelp',
+ icon: 'fa-solid fa-boxes-stacked',
+
+ editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataCategoryEditor.vue`)),
+
+ isPaginated: true,
+ isMerge: false,
+ toStringKeys: ['name'],
+
+ tableHeaders: [
+ {title: 'Name', key: 'name'},
+ {title: 'Actions', key: 'action', align: 'end'},
+ ]
+} as Model
+registerModel(TOpenDataCategory)
+
+const TOpenDataProperty = {
+ name: 'OpenDataProperty',
+ localizationKey: 'Property',
+ localizationKeyDescription: 'PropertyTypeHelp',
+ icon: 'fa-solid fa-database',
+
+ editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataPropertyEditor.vue`)),
+
+ isPaginated: true,
+ isMerge: false,
+ toStringKeys: ['name'],
+
+ tableHeaders: [
+ {title: 'Name', key: 'name'},
+ {title: 'Actions', key: 'action', align: 'end'},
+ ]
+} as Model
+registerModel(TOpenDataProperty)
+
const TOpenDataFood = {
name: 'OpenDataFood',
localizationKey: 'Food',
@@ -20,13 +105,39 @@ const TOpenDataFood = {
editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue`)),
- isPaginated: false,
+ isPaginated: true,
isMerge: false,
toStringKeys: ['name'],
tableHeaders: [
{title: 'Name', key: 'name'},
+ {title: 'Category', key: 'storeCategory.name'},
{title: 'Actions', key: 'action', align: 'end'},
]
} as Model
-registerModel(TOpenDataFood)
\ No newline at end of file
+registerModel(TOpenDataFood)
+
+
+const TOpenDataConversion = {
+ name: 'OpenDataConversion',
+ localizationKey: 'UnitConversion',
+ localizationKeyDescription: 'UnitConversionHelp',
+ icon: 'fa-solid fa-exchange-alt',
+
+ editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataConversionEditor.vue`)),
+
+ isPaginated: true,
+ isMerge: false,
+ toStringKeys: ['name'],
+
+ tableHeaders: [
+ {title: 'Food', key: 'food.name'},
+ {title: 'base_amount', key: 'baseAmount'},
+ {title: 'base_unit', key: 'baseUnit.name'},
+ {title: 'converted_amount', key: 'convertedAmount'},
+ {title: 'converted_unit', key: 'convertedUnit.name'},
+ {title: 'Actions', key: 'action', align: 'end'},
+ ]
+} as Model
+registerModel(TOpenDataConversion)
+
diff --git a/vue3/src/types/Plugins.ts b/vue3/src/types/Plugins.ts
index b9abda9ef..937226053 100644
--- a/vue3/src/types/Plugins.ts
+++ b/vue3/src/types/Plugins.ts
@@ -1,7 +1,19 @@
import {RouteRecordRaw} from "vue-router";
-import {Model, registerModel} from "@/types/Models.ts";
export type TandoorPlugin = {
name: string,
+ basePath: string,
+ defaultLocale: any,
+ localeFiles: any,
routes: RouteRecordRaw[]
+
+ navigationDrawer: any[],
+ bottomNavigation: any[],
+ userNavigation: any[],
}
+
+const pluginModules = import.meta.glob('@/plugins/*/plugin.ts', { eager: true })
+export let TANDOOR_PLUGINS = [] as TandoorPlugin[]
+Object.values(pluginModules).forEach(module => {
+ TANDOOR_PLUGINS.push(module.plugin)
+})
\ No newline at end of file