From c92c19d9b2bca8dc7d0114f23e983b37dd6eef2f Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 24 Aug 2024 09:59:48 +0200 Subject: [PATCH] basic working file selector --- vue3/src/components/inputs/UserFileField.vue | 65 ++++++++++++++----- .../src/components/settings/SpaceSettings.vue | 4 +- vue3/src/locales/en.json | 1 + 3 files changed, 52 insertions(+), 18 deletions(-) diff --git a/vue3/src/components/inputs/UserFileField.vue b/vue3/src/components/inputs/UserFileField.vue index e247a99c4..ddf7cefef 100644 --- a/vue3/src/components/inputs/UserFileField.vue +++ b/vue3/src/components/inputs/UserFileField.vue @@ -2,11 +2,20 @@ - - - - {{ $t('select_file') }} - {{ model.name }} +
+
+ + + + +
+
+ + {{ $t('select_file') }} + {{ model.name }}
+
+ +
@@ -17,9 +26,9 @@ {{ $t('Files') }} - Preview - New - Browse + {{ $t('Preview') }} + {{ $t('New') }} + {{ $t('Search') }} @@ -34,7 +43,7 @@ {{ DateTime.fromJSDate(model.createdAt).toLocaleString(DateTime.DATETIME_SHORT) }} - + {{ $t('Download') }} @@ -52,16 +61,35 @@ - {{ $t('Save') }} + + + + {{ $t('Save') }} + {{ $t('Close') }} + - - - - + + + + + + + + + + + + {{ $t('Close') }} + +
@@ -80,7 +108,8 @@ import {useI18n} from "vue-i18n"; const emit = defineEmits(['update:modelValue', 'create']) const props = defineProps({ - model: {type: {} as UserFile, default: null} + model: {type: {} as UserFile, default: null}, + label: {type: String, default: ''}, }) const model = defineModel() @@ -91,9 +120,13 @@ const tab = ref(0) const newUserFile = ref({} as UserFile) const userFiles = ref([] as UserFile[]) +const tableSearch = ref('') const tableHeaders = ref([ - {title: 'ID', value: 'id'}, + {title: t('Quick actions'), key: 'actions'}, + {title: t('Preview'), key: 'preview'}, {title: t('Name'), value: 'name'}, + {title: t('created_on'), key: 'createdAt', value: item => DateTime.fromJSDate(item.createdAt).toLocaleString(DateTime.DATETIME_MED)}, + {title: t('created_by'), value: 'createdBy.displayName',}, ]) onMounted(() => { diff --git a/vue3/src/components/settings/SpaceSettings.vue b/vue3/src/components/settings/SpaceSettings.vue index f9c98aa8f..21c5b370e 100644 --- a/vue3/src/components/settings/SpaceSettings.vue +++ b/vue3/src/components/settings/SpaceSettings.vue @@ -29,8 +29,8 @@ - - + + diff --git a/vue3/src/locales/en.json b/vue3/src/locales/en.json index cc278ac50..7e153f83d 100644 --- a/vue3/src/locales/en.json +++ b/vue3/src/locales/en.json @@ -574,6 +574,7 @@ "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 ?"