From 76e4f83693a7055ef843f4674d2c10f5e45f105e Mon Sep 17 00:00:00 2001 From: vnugent Date: Sat, 14 Oct 2023 12:57:11 -0400 Subject: passthrough file extensions & package updates --- .../Blog/components/Content/ContentEditor.vue | 28 +++++++--------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'front-end/src/views') diff --git a/front-end/src/views/Blog/components/Content/ContentEditor.vue b/front-end/src/views/Blog/components/Content/ContentEditor.vue index 845de2c..8da6b0a 100644 --- a/front-end/src/views/Blog/components/Content/ContentEditor.vue +++ b/front-end/src/views/Blog/components/Content/ContentEditor.vue @@ -3,24 +3,15 @@
-
-
-

Edit Content

-

- Add or edit content file -

-
- Publishing to: -
-
- {{ selectedChannelName }} -
+
+

Edit Content

@@ -51,8 +42,8 @@
Name: - - {{ getFileName(uploadedFile) }} + + {{ uploadedFile.name }}
@@ -64,8 +55,8 @@
-
- Name: {{ getFileName(editFile) }} +
+ Name: {{ editFile.name }}
Size: {{ getSizeinKb(editFile?.length) }} @@ -100,7 +91,7 @@ import { computed, ref } from 'vue'; import { reactiveComputed, useFileDialog } from '@vueuse/core'; import { ContentMeta } from '@vnuge/cmnext-admin'; import { useConfirm, useVuelidateWrapper, useFormToaster, useWait } from '@vnuge/vnlib.browser'; -import { defaultTo, first, isEmpty, round, truncate } from 'lodash-es'; +import { defaultTo, first, isEmpty, round } from 'lodash-es'; import { required, helpers, maxLength } from '@vuelidate/validators' import useVuelidate from '@vuelidate/core'; import { BlogState } from '../../blog-api'; @@ -118,7 +109,7 @@ const { content, channels } = props.blog; const selectedId = computed(() => content.selectedId.value); const selectedContent = computed(() => defaultTo(content.selectedItem.value, {} as ContentMeta)); const metaBuffer = reactiveComputed(() => ({ ...selectedContent.value})); -const selectedChannelName = computed(() => defaultTo(channels.selectedItem.value?.name, 'No channel selected')); +const isChannelSelected = computed(() => channels.selectedItem.value?.id?.length ?? 0 > 0); const v$ = useVuelidate({ name: { @@ -141,7 +132,6 @@ onChange(() => { const editFile = computed(() => selectedContent.value); const uploadedFile = computed(() => defaultTo(file.value, {} as File)); -const getFileName = (file : File | ContentMeta) => truncate(file.name, { length: 20 }); const getFileSize = (file : File) => { const size = round(file.size > 1024 ? file.size / 1024 : file.size, 2); return `${size} ${file.size > 1024 ? 'KB' : 'B'}`; -- cgit