diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 011cf3568..9b5f86d35 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -401,6 +401,7 @@ class MealTypeSerializer(SpacedModelSerializer, WritableNestedModelSerializer): class UserPreferenceSerializer(WritableNestedModelSerializer): + user = UserSerializer(read_only=True) food_inherit_default = serializers.SerializerMethodField('get_food_inherit_defaults') plan_share = UserSerializer(many=True, allow_null=True, required=False) shopping_share = UserSerializer(many=True, allow_null=True, required=False) @@ -436,6 +437,7 @@ class UserPreferenceSerializer(WritableNestedModelSerializer): 'filter_to_supermarket', 'shopping_add_onhand', 'left_handed', 'show_step_ingredients', 'food_children_exist' ) + read_only_fields = ('user',) class StorageSerializer(SpacedModelSerializer): @@ -1438,6 +1440,7 @@ class ServerSettingsSerializer(serializers.Serializer): imprint_url = serializers.CharField() hosted = serializers.BooleanField() debug = serializers.BooleanField() + version = serializers.CharField() class Meta: fields = '__ALL__' diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 4c630c387..1d519db18 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -107,6 +107,7 @@ from cookbook.serializer import (AccessTokenSerializer, AutomationSerializer, Au UserSerializer, UserSpaceSerializer, ViewLogSerializer, ImportImageSerializer, LocalizationSerializer, ServerSettingsSerializer ) +from cookbook.version_info import TANDOOR_VERSION from cookbook.views.import_export import get_integration from recipes import settings from recipes.settings import DRF_THROTTLE_RECIPE_URL_IMPORT, FDC_API_KEY, GOOGLE_AI_API_KEY @@ -1964,6 +1965,7 @@ class ServerSettingsViewSet(viewsets.GenericViewSet): s['imprint_url'] = settings.IMPRINT_URL s['hosted'] = settings.HOSTED s['debug'] = settings.DEBUG + s['version'] = TANDOOR_VERSION return Response(ServerSettingsSerializer(s, many=False).data) diff --git a/vue3/package.json b/vue3/package.json index 82cc92ccd..0466d03bf 100644 --- a/vue3/package.json +++ b/vue3/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@types/luxon": "^3.4.2", - "@vueform/multiselect": "^2.6.8", + "@vueform/multiselect": "^2.6.11", "@vueuse/core": "^10.11.0", "luxon": "^3.4.4", "mavon-editor": "^3.0.1", diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue index 34ff7546f..de49c5b89 100644 --- a/vue3/src/apps/tandoor/Tandoor.vue +++ b/vue3/src/apps/tandoor/Tandoor.vue @@ -7,35 +7,59 @@ - V + {{useUserPreferenceStore().userSettings.user.displayName.charAt(0)}} - - - V vabene1111 - + + + {{ useUserPreferenceStore().userSettings.user.displayName.charAt(0) }} + + {{ useUserPreferenceStore().userSettings.user.displayName }} + {{ useUserPreferenceStore().activeSpace.name }} - {{$t('Settings')}} - {{$t('Database')}} - - + + + + + {{ $t('Settings') }} + + + + + + {{ $t('Database') }} + + + Spaces Space 1 Space 2 Space 3 - {{$t('Messages')}} - {{$t('Logout')}} + + + + + {{ $t('Messages') }} + + + + + + + {{ $t('Logout') }} + - {{ $t('HostedFreeVersion')}} {{$t('UpgradeNow')}} + {{ $t('HostedFreeVersion') }} + {{ $t('UpgradeNow') }} @@ -50,13 +74,24 @@ - + + + {{ useUserPreferenceStore().userSettings.user.displayName.charAt(0) }} + + {{ useUserPreferenceStore().userSettings.user.displayName }} + {{ useUserPreferenceStore().activeSpace.name }} + - + + + + Tandoor {{ useUserPreferenceStore().serverSettings.version }} + + diff --git a/vue3/src/components/inputs/ModelSelect.vue b/vue3/src/components/inputs/ModelSelect.vue index 847f3a54d..932146a10 100644 --- a/vue3/src/components/inputs/ModelSelect.vue +++ b/vue3/src/components/inputs/ModelSelect.vue @@ -1,15 +1,14 @@ - + - @@ -140,4 +143,8 @@ async function createObject(object: any, select$: Multiselect) { .multiselect-tag { background-color: #b98766 !important; } + +.z-3000 { + z-index: 3000; +} diff --git a/vue3/src/openapi/apis/ApiApi.ts b/vue3/src/openapi/apis/ApiApi.ts index 99df18422..6c6ca4409 100644 --- a/vue3/src/openapi/apis/ApiApi.ts +++ b/vue3/src/openapi/apis/ApiApi.ts @@ -1239,11 +1239,8 @@ export interface ApiShoppingListEntryDestroyRequest { } export interface ApiShoppingListEntryListRequest { - checked?: string; - id?: number; page?: number; pageSize?: number; - supermarket?: number; updatedAfter?: Date; } @@ -1620,7 +1617,7 @@ export interface ApiUserPartialUpdateRequest { export interface ApiUserPreferencePartialUpdateRequest { user: number; - patchedUserPreference?: Omit; + patchedUserPreference?: Omit; } export interface ApiUserPreferenceRetrieveRequest { @@ -9096,7 +9093,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryBulkCreateRaw(requestParameters: ApiShoppingListEntryBulkCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['shoppingListEntryBulk'] == null) { @@ -9128,7 +9125,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryBulkCreate(requestParameters: ApiShoppingListEntryBulkCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.apiShoppingListEntryBulkCreateRaw(requestParameters, initOverrides); @@ -9136,7 +9133,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryCreateRaw(requestParameters: ApiShoppingListEntryCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['shoppingListEntry'] == null) { @@ -9168,7 +9165,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryCreate(requestParameters: ApiShoppingListEntryCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.apiShoppingListEntryCreateRaw(requestParameters, initOverrides); @@ -9176,7 +9173,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryDestroyRaw(requestParameters: ApiShoppingListEntryDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['id'] == null) { @@ -9205,26 +9202,18 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryDestroy(requestParameters: ApiShoppingListEntryDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.apiShoppingListEntryDestroyRaw(requestParameters, initOverrides); } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryListRaw(requestParameters: ApiShoppingListEntryListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; - if (requestParameters['checked'] != null) { - queryParameters['checked'] = requestParameters['checked']; - } - - if (requestParameters['id'] != null) { - queryParameters['id'] = requestParameters['id']; - } - if (requestParameters['page'] != null) { queryParameters['page'] = requestParameters['page']; } @@ -9233,10 +9222,6 @@ export class ApiApi extends runtime.BaseAPI { queryParameters['page_size'] = requestParameters['pageSize']; } - if (requestParameters['supermarket'] != null) { - queryParameters['supermarket'] = requestParameters['supermarket']; - } - if (requestParameters['updatedAfter'] != null) { queryParameters['updated_after'] = (requestParameters['updatedAfter'] as any).toISOString(); } @@ -9258,7 +9243,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryList(requestParameters: ApiShoppingListEntryListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.apiShoppingListEntryListRaw(requestParameters, initOverrides); @@ -9266,7 +9251,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryPartialUpdateRaw(requestParameters: ApiShoppingListEntryPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['id'] == null) { @@ -9298,7 +9283,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryPartialUpdate(requestParameters: ApiShoppingListEntryPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.apiShoppingListEntryPartialUpdateRaw(requestParameters, initOverrides); @@ -9306,7 +9291,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryRetrieveRaw(requestParameters: ApiShoppingListEntryRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['id'] == null) { @@ -9335,7 +9320,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryRetrieve(requestParameters: ApiShoppingListEntryRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.apiShoppingListEntryRetrieveRaw(requestParameters, initOverrides); @@ -9343,7 +9328,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryUpdateRaw(requestParameters: ApiShoppingListEntryUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['id'] == null) { @@ -9382,7 +9367,7 @@ export class ApiApi extends runtime.BaseAPI { } /** - * logs request counts to redis cache total/per user/ + * individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint */ async apiShoppingListEntryUpdate(requestParameters: ApiShoppingListEntryUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.apiShoppingListEntryUpdateRaw(requestParameters, initOverrides); diff --git a/vue3/src/openapi/models/PatchedUserPreference.ts b/vue3/src/openapi/models/PatchedUserPreference.ts index b06f0a06c..f58696c4a 100644 --- a/vue3/src/openapi/models/PatchedUserPreference.ts +++ b/vue3/src/openapi/models/PatchedUserPreference.ts @@ -64,10 +64,10 @@ import { export interface PatchedUserPreference { /** * - * @type {number} + * @type {User} * @memberof PatchedUserPreference */ - user?: number; + readonly user?: User; /** * * @type {UserFileView} @@ -257,7 +257,7 @@ export function PatchedUserPreferenceFromJSONTyped(json: any, ignoreDiscriminato } return { - 'user': json['user'] == null ? undefined : json['user'], + 'user': json['user'] == null ? undefined : UserFromJSON(json['user']), 'image': json['image'] == null ? undefined : UserFileViewFromJSON(json['image']), 'theme': json['theme'] == null ? undefined : ThemeEnumFromJSON(json['theme']), 'navBgColor': json['nav_bg_color'] == null ? undefined : json['nav_bg_color'], @@ -293,14 +293,13 @@ export function PatchedUserPreferenceToJSON(json: any): PatchedUserPreference { return PatchedUserPreferenceToJSONTyped(json, false); } -export function PatchedUserPreferenceToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function PatchedUserPreferenceToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { - 'user': value['user'], 'image': UserFileViewToJSON(value['image']), 'theme': ThemeEnumToJSON(value['theme']), 'nav_bg_color': value['navBgColor'], diff --git a/vue3/src/openapi/models/ServerSettings.ts b/vue3/src/openapi/models/ServerSettings.ts index dd57bcd5f..d56c1cc3e 100644 --- a/vue3/src/openapi/models/ServerSettings.ts +++ b/vue3/src/openapi/models/ServerSettings.ts @@ -67,6 +67,12 @@ export interface ServerSettings { * @memberof ServerSettings */ debug: boolean; + /** + * + * @type {string} + * @memberof ServerSettings + */ + version: string; } /** @@ -81,6 +87,7 @@ export function instanceOfServerSettings(value: object): value is ServerSettings if (!('imprintUrl' in value) || value['imprintUrl'] === undefined) return false; if (!('hosted' in value) || value['hosted'] === undefined) return false; if (!('debug' in value) || value['debug'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; return true; } @@ -102,6 +109,7 @@ export function ServerSettingsFromJSONTyped(json: any, ignoreDiscriminator: bool 'imprintUrl': json['imprint_url'], 'hosted': json['hosted'], 'debug': json['debug'], + 'version': json['version'], }; } @@ -124,6 +132,7 @@ export function ServerSettingsToJSONTyped(value?: ServerSettings | null, ignoreD 'imprint_url': value['imprintUrl'], 'hosted': value['hosted'], 'debug': value['debug'], + 'version': value['version'], }; } diff --git a/vue3/src/openapi/models/UserPreference.ts b/vue3/src/openapi/models/UserPreference.ts index 8e505c05a..3e371ae31 100644 --- a/vue3/src/openapi/models/UserPreference.ts +++ b/vue3/src/openapi/models/UserPreference.ts @@ -64,10 +64,10 @@ import { export interface UserPreference { /** * - * @type {number} + * @type {User} * @memberof UserPreference */ - user: number; + readonly user: User; /** * * @type {UserFileView} @@ -260,7 +260,7 @@ export function UserPreferenceFromJSONTyped(json: any, ignoreDiscriminator: bool } return { - 'user': json['user'], + 'user': UserFromJSON(json['user']), 'image': json['image'] == null ? undefined : UserFileViewFromJSON(json['image']), 'theme': json['theme'] == null ? undefined : ThemeEnumFromJSON(json['theme']), 'navBgColor': json['nav_bg_color'] == null ? undefined : json['nav_bg_color'], @@ -296,14 +296,13 @@ export function UserPreferenceToJSON(json: any): UserPreference { return UserPreferenceToJSONTyped(json, false); } -export function UserPreferenceToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function UserPreferenceToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { - 'user': value['user'], 'image': UserFileViewToJSON(value['image']), 'theme': ThemeEnumToJSON(value['theme']), 'nav_bg_color': value['navBgColor'], diff --git a/vue3/src/pages/StartPage.vue b/vue3/src/pages/StartPage.vue index ba98e8d40..09371362e 100644 --- a/vue3/src/pages/StartPage.vue +++ b/vue3/src/pages/StartPage.vue @@ -1,13 +1,5 @@ - - - - - - - - diff --git a/vue3/yarn.lock b/vue3/yarn.lock index 356b5f179..aaff8a58e 100644 --- a/vue3/yarn.lock +++ b/vue3/yarn.lock @@ -550,10 +550,10 @@ resolved "https://registry.yarnpkg.com/@vue/tsconfig/-/tsconfig-0.5.1.tgz#3124ec16cc0c7e04165b88dc091e6b97782fffa9" integrity sha512-VcZK7MvpjuTPx2w6blwnwZAu5/LgBUtejFOi3pPGQFXQN5Ela03FUtd2Qtg4yWGGissVL0dr6Ro1LfOFh+PCuQ== -"@vueform/multiselect@^2.6.8": - version "2.6.8" - resolved "https://registry.yarnpkg.com/@vueform/multiselect/-/multiselect-2.6.8.tgz#a8ea77788571f7ce92c650f536a4ed3784c5cea0" - integrity sha512-vu1bkFkViuLbrtSfyWgw11ecNPK7mlBDFe5X9WdsZj3gri3PiZ3OvlfJ920Ebysf7rgiN/+mHJDY2/Y1ITnGEg== +"@vueform/multiselect@^2.6.11": + version "2.6.11" + resolved "https://registry.yarnpkg.com/@vueform/multiselect/-/multiselect-2.6.11.tgz#3585bf1989b969019cd6f8095c8a27d4d45c61e7" + integrity sha512-iG4TGfqE3baftbSGF0PhoS+xZOCnV0ChkDo9rwhJ/Qi2YlCdb6tyQCjvyug3jnzncga8+d85kx0WvG7rDYFqiA== "@vuetify/loader-shared@^2.0.3": version "2.0.3"
- {{ $t('HostedFreeVersion')}} {{$t('UpgradeNow')}} + {{ $t('HostedFreeVersion') }} + {{ $t('UpgradeNow') }}