start of model edit dialogs

This commit is contained in:
vabene1111
2024-09-10 08:55:28 +02:00
parent 5eabf6869d
commit 1bed90b804
35 changed files with 14655 additions and 14474 deletions

View File

@@ -0,0 +1,37 @@
<template>
<v-dialog max-width="400" activator="parent" v-model="dialog">
<v-card>
<v-card-title>{{ $t('Delete') }}</v-card-title>
<v-card-text>
{{ $t('DeleteConfirmQuestion')}}
<b>{{ objectName }}</b>
</v-card-text>
<v-card-actions>
<v-btn @click="dialog=false">{{ $t('Cancel') }}</v-btn>
<v-btn @click="emit('delete'); dialog=false" color="delete" prepend-icon="$delete">
{{ $t('Delete') }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script setup lang="ts">
import {ref} from "vue";
const emit = defineEmits(['delete'])
const props = defineProps({
objectName: {type: String, default: ''}
})
const dialog = ref(false)
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,81 @@
<template>
<v-card>
<v-card-title>{{ $t(OBJ_LOCALIZATION_KEY) }}</v-card-title>
<v-card-text>
<v-form>
<v-text-field label="Token" v-model="editingObj.token" :disabled="isUpdate"></v-text-field>
<v-text-field label="Scope" v-model="editingObj.scope"></v-text-field>
<v-date-input :label="$t('Valid Until')" v-model="editingObj.scope"></v-date-input>
</v-form>
</v-card-text>
<v-card-actions>
<v-btn color="save" prepend-icon="$save">{{ isUpdate ? $t('Save') : $t('Create') }}</v-btn>
<v-btn color="delete" prepend-icon="$delete">{{ $t('Delete') }}
<delete-confirm-dialog :object-name="objectName"></delete-confirm-dialog>
</v-btn>
</v-card-actions>
</v-card>
</template>
<script setup lang="ts">
import {VDateInput} from 'vuetify/labs/VDateInput' //TODO remove once component is out of labs
import {computed, onMounted, ref} from "vue";
import {AccessToken, ApiApi} from "@/openapi";
import DeleteConfirmDialog from "@/components/dialogs/DeleteConfirmDialog.vue";
import {useI18n} from "vue-i18n";
const {t} = useI18n()
const props = defineProps({
accessToken: {type: {} as AccessToken, required: false}
})
const OBJ_LOCALIZATION_KEY = 'Access_Token'
const editingObj = ref({} as AccessToken)
const loading = ref(false)
/**
* checks if given object has ID property to determine if it needs to be updated or created
*/
const isUpdate = computed(() => {
return editingObj.value.id !== undefined
})
/**
* display name for object in headers/delete dialog/...
*/
const objectName = computed(() => {
return isUpdate ? `${t(OBJ_LOCALIZATION_KEY)} ${editingObj.value.token}` : `${t(OBJ_LOCALIZATION_KEY)} (${t('New')})`
})
onMounted(() => {
if (props.accessToken != null) {
editingObj.value = props.accessToken
}
})
/**
* saves the edited object in the database
*/
function saveObject() {
let api = new ApiApi()
if (isUpdate.value) {
} else {
}
}
/**
* test
*/
function deleteObject() {
}
</script>
<style scoped>
</style>

View File

@@ -36,7 +36,7 @@
</v-list-item>
</v-list>
<access-token-editor class="mt-2"></access-token-editor>
</v-form>
</template>
@@ -48,6 +48,7 @@ import {onMounted, ref} from "vue";
import {AccessToken, ApiApi} from "@/openapi";
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore";
import {DateTime} from "luxon";
import AccessTokenEditor from "@/components/model_editors/AccessTokenEditor.vue";
const accessTokenList = ref([] as AccessToken[])
const accessToken = ref({} as AccessToken)

View File

@@ -82,7 +82,7 @@ import {ApiApi, Group, InviteLink, UserSpace} from "@/openapi";
import {ErrorMessageType, PreparedMessage, useMessageStore} from "@/stores/MessageStore";
import {useI18n} from "vue-i18n";
import {DateTime} from "luxon";
import {VDateInput} from 'vuetify/labs/VDateInput'
import {VDateInput} from 'vuetify/labs/VDateInput' //TODO remove once component is out of labs
import {useClipboard} from "@vueuse/core"; //TODO remove once component is out of labs
const {t} = useI18n()

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "",
"AddFoodToShopping": "",
"AddToShopping": "",
@@ -55,6 +56,7 @@
"DelayFor": "",
"DelayUntil": "",
"Delete": "",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "",
"Delete_Food": "",
"Delete_Keyword": "",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "Добави",
"AddFoodToShopping": "Добавете {food} към списъка си за пазаруване",
"AddToShopping": "Добавяне към списъка за пазаруване",
@@ -52,6 +53,7 @@
"DelayFor": "Закъснение за {hours} часа",
"DelayUntil": "Забавяне до",
"Delete": "Изтрий",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Сигурни ли сте, че искате да премахнете цялата {food} от списъка за пазаруване?",
"Delete_Food": "Изтриване на храна",
"Delete_Keyword": "Изтриване на ключова дума",

View File

@@ -1,5 +1,6 @@
{
"API": "",
"Access_Token": "",
"Account": "",
"Add": "",
"AddFoodToShopping": "",
@@ -83,6 +84,7 @@
"DelayFor": "",
"DelayUntil": "",
"Delete": "",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "",
"Delete_All": "",
"Delete_Food": "",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Účet",
"Add": "Přidat",
"AddFoodToShopping": "Přidat {food} na váš nákupní seznam",
@@ -83,6 +84,7 @@
"DelayFor": "Odložit na {hours} hodin",
"DelayUntil": "Odložit do",
"Delete": "Smazat",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Jste si jistí, že chcete odstranit všechno {food} z nákupního seznamu?",
"Delete_All": "Smazat vše",
"Delete_Food": "Smazat potravinu",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Bruger",
"Add": "Tilføj",
"AddFoodToShopping": "Tilføj {food} til indkøbsliste",
@@ -75,6 +76,7 @@
"DelayFor": "Udskyd i {hours} hours",
"DelayUntil": "Udskyd indtil",
"Delete": "Slet",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Er du sikker på at du vil fjerne {food} fra indkøbsliste?",
"Delete_Food": "Slet mad",
"Delete_Keyword": "Slet nøgleord",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "Zugriffstoken",
"Account": "Konto",
"Add": "Hinzufügen",
"AddFoodToShopping": "Fügen Sie {food} zur Einkaufsliste hinzu",
@@ -85,6 +86,7 @@
"DelayFor": "Um {hours} Stunden verschieben",
"DelayUntil": "Verzögerung bis",
"Delete": "Löschen",
"DeleteConfirmQuestion": "Sind Sie sicher das Sie dieses Objekt löschen wollen?",
"DeleteShoppingConfirm": "Möchten Sie wirklich alle {food} von der Einkaufsliste entfernen?",
"Delete_All": "Alles löschen",
"Delete_Food": "Lebensmittel löschen",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Λογαριασμός",
"Add": "Προσθήκη",
"AddFoodToShopping": "Προσθήκη του φαγητού {food} στη λίστα αγορών σας",
@@ -74,6 +75,7 @@
"DelayFor": "Καθυστέρηση για {hours} ώρες",
"DelayUntil": "Καθυστέρηση μέχρι",
"Delete": "Διαγραφή",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Θέλετε σίγουρα να αφαιρέσετε τα {food} από τη λίστα αγορών;",
"Delete_Food": "Διαγραφή φαγητού",
"Delete_Keyword": "Διαγραφή λέξης-κλειδί",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "Access Token",
"Account": "Account",
"Add": "Add",
"AddFoodToShopping": "Add {food} to your shopping list",
@@ -84,6 +85,7 @@
"DelayFor": "Delay for {hours} hours",
"DelayUntil": "Delay Until",
"Delete": "Delete",
"DeleteConfirmQuestion": "Are you sure you want to delete this object?",
"DeleteShoppingConfirm": "Are you sure that you want to remove all {food} from the shopping list?",
"Delete_All": "Delete all",
"Delete_Food": "Delete Food",
@@ -252,6 +254,7 @@
"Plural": "Plural",
"Preferences": "Preferences",
"Preparation": "Preparation",
"Preview": "Preview",
"Previous_Day": "Previous Day",
"Previous_Period": "Previous Period",
"Print": "Print",
@@ -574,7 +577,6 @@
"tsp": "teaspoon [tsp] (US, volume)",
"updatedon": "Updated On",
"view_recipe": "View Recipe",
"Preview": "Preview",
"warning_duplicate_filter": "Warning: Due to technical limitations having multiple filters of the same combination (and/or/not) might yield unexpected results.",
"warning_feature_beta": "This feature is currently in a BETA (testing) state. Please expect bugs and possibly breaking changes in the future (possibly losing feature-related data) when using this feature.",
"warning_space_delete": "You can delete your space including all recipes, shopping lists, meal plans and whatever else you have created. This cannot be undone! Are you sure you want to do this ?"

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Cuenta",
"Add": "Añadir",
"AddFoodToShopping": "Añadir {food} a la lista de la compra",
@@ -84,6 +85,7 @@
"DelayFor": "Retrasar por {hours} horas",
"DelayUntil": "Retrasar hasta",
"Delete": "Borrar",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "¿Estas seguro de que quieres eliminar {food} de la lista de la compra?",
"Delete_All": "Borrar todo",
"Delete_Food": "Eliminar Ingrediente",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "Lisää",
"Add_Step": "Lisää Vaihe",
"Add_nutrition_recipe": "Lisää ravintoaine reseptiin",
@@ -33,6 +34,7 @@
"Current_Period": "Nykyinen Jakso",
"Date": "Päivämäärä",
"Delete": "Poista",
"DeleteConfirmQuestion": "",
"Delete_Food": "Poista ruoka",
"Delete_Keyword": "Poista avainsana",
"Description": "Kuvaus",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Compte",
"Add": "Ajouter",
"AddFoodToShopping": "Ajouter laliment {food} à votre liste de courses",
@@ -83,6 +84,7 @@
"DelayFor": "Retard de {hours} heures",
"DelayUntil": "Retard jusqu'à",
"Delete": "Supprimer",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Êtes-vous sûr(e) de vouloir supprimer tous les aliments {food} de votre liste de courses?",
"Delete_All": "Supprimer tout",
"Delete_Food": "Supprimer laliment",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "חשבון",
"Add": "הוספה",
"AddFoodToShopping": "הוסף {מזון} לרשימת הקניות",
@@ -84,6 +85,7 @@
"DelayFor": "השהה ל {hours} שעות",
"DelayUntil": "השהה עד",
"Delete": "מחק",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "האם אתה בטוח שברצונך להסיר את כל ה{מזון} מרשימת הקניות ?",
"Delete_All": "מחק הכל",
"Delete_Food": "מחק אוכל",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Fiók",
"Add": "Hozzáadás",
"AddFoodToShopping": "{food} hozzáadása bevásárlólistához",
@@ -73,6 +74,7 @@
"DelayFor": "Késleltetés {hours} óráig",
"DelayUntil": "",
"Delete": "Törlés",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Biztos, hogy az összes {food}-t el akarja távolítani a bevásárlólistáról?",
"Delete_Food": "Alapanyag törlése",
"Delete_Keyword": "Kulcsszó törlése",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "",
"Add_nutrition_recipe": "Ավելացնել սննդայնություն բաղադրատոմսին",
"Add_to_Book": "",
@@ -20,6 +21,7 @@
"Create_New_Shopping Category": "Ստեղծել գնումների նոր կատեգորիա",
"Date": "",
"Delete": "",
"DeleteConfirmQuestion": "",
"Delete_Food": "Ջնջել սննդամթերքը",
"Delete_Keyword": "Ջնջել բանալի բառը",
"Description": "Նկարագրություն",

View File

@@ -1,5 +1,6 @@
{
"API": "",
"Access_Token": "",
"Account": "",
"Add": "Tambahkan",
"AddFoodToShopping": "",
@@ -64,6 +65,7 @@
"DelayFor": "",
"DelayUntil": "",
"Delete": "Menghapus",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "",
"Delete_Food": "",
"Delete_Keyword": "Hapus Kata Kunci",

View File

@@ -1,5 +1,6 @@
{
"API": "",
"Access_Token": "",
"Account": "",
"Add": "",
"AddFoodToShopping": "",
@@ -83,6 +84,7 @@
"DelayFor": "",
"DelayUntil": "",
"Delete": "",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "",
"Delete_All": "",
"Delete_Food": "",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Account",
"Add": "Aggiungi",
"AddFoodToShopping": "Aggiungi {food} alla tua lista della spesa",
@@ -68,6 +69,7 @@
"DelayFor": "Ritarda per {hours} ore",
"DelayUntil": "Ritarda fino a",
"Delete": "Elimina",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Sei sicuro di voler rimuovere tutto {food} dalla lista della spesa?",
"Delete_Food": "Elimina alimento",
"Delete_Keyword": "Elimina parola chiave",

View File

@@ -1,5 +1,6 @@
{
"API": "",
"Access_Token": "",
"Account": "",
"Add": "",
"AddFoodToShopping": "",
@@ -75,6 +76,7 @@
"DelayFor": "",
"DelayUntil": "",
"Delete": "",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "",
"Delete_Food": "",
"Delete_Keyword": "Ištrinti raktažodį",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "",
"Add": "Legg til",
"AddFoodToShopping": "Legg til {food] i handlelisten din",
@@ -72,6 +73,7 @@
"DelayFor": "Utsett i {hours} timer",
"DelayUntil": "Forsink til",
"Delete": "Slett",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Er du sikker på at du fjerne alle {food} fra handlelisten?",
"Delete_Food": "Slett Matrett",
"Delete_Keyword": "Slett nøkkelord",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Account",
"Add": "Voeg toe",
"AddFoodToShopping": "Voeg {food} toe aan je boodschappenlijst",
@@ -76,6 +77,7 @@
"DelayFor": "Stel {hours} uur uit",
"DelayUntil": "Vertraag tot",
"Delete": "Verwijder",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Weet je zeker dat je {food} van de boodschappenlijst wil verwijderen?",
"Delete_Food": "Verwijder Eten",
"Delete_Keyword": "Verwijder Etiket",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Konto",
"Add": "Dodaj",
"AddFoodToShopping": "Dodaj {food} do swojej listy zakupów",
@@ -85,6 +86,7 @@
"DelayFor": "Opóźnij o {hours} godzin",
"DelayUntil": "Opóźnij do",
"Delete": "Usuń",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Czy na pewno chcesz usunąć wszystkie {food} z listy zakupów?",
"Delete_All": "Usuń wszystko",
"Delete_Food": "Usuń żywność",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "Adicionar",
"AddFoodToShopping": "Adicionar {food} à sua lista de compras",
"AddToShopping": "Adicionar á lista de compras",
@@ -56,6 +57,7 @@
"DelayFor": "Atrasar por {hours} horas",
"DelayUntil": "",
"Delete": "Apagar",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Tem a certeza que pretende remover toda {food} da sua lista de compras?",
"Delete_Food": "Eliminar comida",
"Delete_Keyword": "Eliminar Palavra Chave",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Conta",
"Add": "Adicionar",
"AddFoodToShopping": "Incluir {food} na sua lista de compras",
@@ -81,6 +82,7 @@
"DelayFor": "Demorar por {hours} horas",
"DelayUntil": "Atrasar Até",
"Delete": "Deletar",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Tem certeza que deseja remover todas {food} de sua lista de compras?",
"Delete_All": "Excluir tudo",
"Delete_Food": "Deletar Comida",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Cont",
"Add": "Adaugă",
"AddFoodToShopping": "Adăugă {food} în lista de cumpărături",
@@ -70,6 +71,7 @@
"DelayFor": "Întârziere pentru {hours} ore",
"DelayUntil": "Amână până la",
"Delete": "Șterge",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Sunteți sigur că doriți să eliminați toate {food} din lista de cumpărături?",
"Delete_Food": "Ștergere mâncare",
"Delete_Keyword": "Ștergere cuvânt cheie",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "Добавить",
"AddFoodToShopping": "Добавить {food} в ваш список покупок",
"AddToShopping": "Добавить в лист покупок",
@@ -45,6 +46,7 @@
"Date": "Дата",
"DelayFor": "Отложить на {hours} часов",
"Delete": "Удалить",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Вы уверены, что хотите удалить все {food} из вашего списка покупок?",
"Delete_Food": "Удалить элемент",
"Delete_Keyword": "Удалить ключевое слово",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "Dodaj",
"AddFoodToShopping": "Dodaj {food} v nakupovalni listek",
"AddToShopping": "Dodaj nakupovlanemu listku",
@@ -46,6 +47,7 @@
"DelayFor": "Zamakni za {hours} ur",
"DelayUntil": "Zamakni do",
"Delete": "Izbriši",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Si prepričan/a, da želiš odstraniti VSO {food} iz nakupovalnega listka?",
"Delete_Food": "Izbriši hrano",
"Delete_Keyword": "Izbriši ključno besedo",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Konto",
"Add": "Lägg till",
"AddFoodToShopping": "Lägg till {food} på din inköpslista",
@@ -85,6 +86,7 @@
"DelayFor": "Fördröjning på {hours} timmar",
"DelayUntil": "Fördröjning till",
"Delete": "Radera",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Är du säker på att du vill ta bort all {food} från inköpslistan?",
"Delete_All": "Radera alla",
"Delete_Food": "Ta bort livsmedel",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "Hesap",
"Add": "Ekle",
"AddFoodToShopping": "{food}'ı alışveriş listenize ekleyin",
@@ -84,6 +85,7 @@
"DelayFor": "{hours} saat geciktir",
"DelayUntil": "Şu Zamana Kadar Geciktir",
"Delete": "Sil",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Tüm {food} alışveriş listesinden kaldırmak istediğinizden emin misiniz?",
"Delete_All": "Tümünü sil",
"Delete_Food": "Yiyeceği Sil",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "Додати",
"AddFoodToShopping": "Додати {food} до вашого списку покупок",
"AddToShopping": "Додати до списку покупок",
@@ -60,6 +61,7 @@
"DelayFor": "Затримка на {hours} годин",
"DelayUntil": "",
"Delete": "Видалити",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "Ви впевнені, що хочете видалити {food} з вашого списку покупок?",
"Delete_Food": "Видалити Їжу",
"Delete_Keyword": "Видалити Ключове слово",

View File

@@ -1,5 +1,6 @@
{
"API": "API",
"Access_Token": "",
"Account": "账户",
"Add": "添加",
"AddFoodToShopping": "添加 {food} 到购物清单",
@@ -81,6 +82,7 @@
"DelayFor": "延迟 {hours} 小时",
"DelayUntil": "推迟到",
"Delete": "删除",
"DeleteConfirmQuestion": "",
"DeleteShoppingConfirm": "确定要移除购物清单中所有 {food} 吗?",
"Delete_All": "全部删除",
"Delete_Food": "删除食物",

View File

@@ -1,4 +1,5 @@
{
"Access_Token": "",
"Add": "",
"Add_nutrition_recipe": "為食譜添加營養資訊",
"Add_to_Plan": "加入計劃",
@@ -15,6 +16,7 @@
"Create": "",
"Date": "",
"Delete": "",
"DeleteConfirmQuestion": "",
"Download": "",
"Edit": "",
"Energy": "",