From f2781825804039b5ca68466bec7054b8d9ccce5d Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 8 Sep 2023 17:27:10 -0400 Subject: upstream theme updates and patches --- .../src/views/Blog/components/Posts/PostEdit.vue | 2 +- .../src/views/Blog/components/Posts/PostTable.vue | 8 ++++++-- front-end/src/views/Blog/form-helpers/channels.ts | 18 +++++++++--------- front-end/src/views/Blog/form-helpers/posts.ts | 21 ++++++++------------- 4 files changed, 24 insertions(+), 25 deletions(-) (limited to 'front-end/src/views/Blog') diff --git a/front-end/src/views/Blog/components/Posts/PostEdit.vue b/front-end/src/views/Blog/components/Posts/PostEdit.vue index 724a8d7..e55deee 100644 --- a/front-end/src/views/Blog/components/Posts/PostEdit.vue +++ b/front-end/src/views/Blog/components/Posts/PostEdit.vue @@ -132,7 +132,7 @@ const onDelete = async () => { const setMeAsAuthor = () => { apiCall(async () => { const { first, last } = await getProfile<{first?:string, last?:string, email:string}>(); - v$.value.author.$model = `${first} ${last}` + v$.value.author.$model = `${first ?? ''} ${last ?? ''}` }) } diff --git a/front-end/src/views/Blog/components/Posts/PostTable.vue b/front-end/src/views/Blog/components/Posts/PostTable.vue index 734d340..96c511c 100644 --- a/front-end/src/views/Blog/components/Posts/PostTable.vue +++ b/front-end/src/views/Blog/components/Posts/PostTable.vue @@ -39,10 +39,11 @@ \ No newline at end of file diff --git a/front-end/src/views/Blog/form-helpers/channels.ts b/front-end/src/views/Blog/form-helpers/channels.ts index 7b98d4e..eefb2bc 100644 --- a/front-end/src/views/Blog/form-helpers/channels.ts +++ b/front-end/src/views/Blog/form-helpers/channels.ts @@ -136,26 +136,26 @@ export const getChannelForm = (editMode?: Ref) => { ] } - const alphaNumSpace = helpers.regex(/^[a-zA-Z0-9 ]*$/); + const alphaNumSpace = helpers.regex(/^[a-zA-Z0-9\&\|\.\,\? ]*$/); const httpUrl = helpers.regex(/^(http|https):\/\/[^ "]+$/); const channelRules = { name: { required: helpers.withMessage('Channel name is required', required), - maxlength: helpers.withMessage('Channel name must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel name must be less than 64 characters', maxLength(64)), alphaNumSpace: helpers.withMessage('Channel name must be alphanumeric', alphaNumSpace), }, path: { required: helpers.withMessage('Channel path is required', required), - maxlength: helpers.withMessage('Channel path must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel path must be less than 64 characters', maxLength(64)), }, index: { required: helpers.withMessage('Channel index is required', required), - maxlength: helpers.withMessage('Channel index must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel index must be less than 64 characters', maxLength(64)), }, content: { required: helpers.withMessage('Channel content directory is required', required), - maxlength: helpers.withMessage('Channel content directory must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel content directory must be less than 64 characters', maxLength(64)), }, example: {} } @@ -168,24 +168,24 @@ export const getChannelForm = (editMode?: Ref) => { }, path: { required: helpers.withMessage('Channel feed path is required', required), - maxlength: helpers.withMessage('Channel feed path must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel feed path must be less than 64 characters', maxLength(64)), }, image: { maxlength: helpers.withMessage('Channel feed image must be less than 200 characters', maxLength(200)), }, contact: { - maxlength: helpers.withMessage('Channel feed contact must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel feed contact must be less than 64 characters', maxLength(64)), }, description: { alphaNumSpace: helpers.withMessage('Channel feed description must be alphanumeric', alphaNumSpace), - maxlength: helpers.withMessage('Channel feed description must be less than 50 characters', maxLength(200)), + maxlength: helpers.withMessage('Channel feed description must be less than 250 characters', maxLength(250)), }, maxItems: { numeric: helpers.withMessage('Channel feed max items must be a number', numeric), }, author: { alphaNumSpace: helpers.withMessage('Channel feed author must be alphanumeric', alphaNumSpace), - maxlength: helpers.withMessage('Channel feed author must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Channel feed author must be less than 64 characters', maxLength(64)), } } diff --git a/front-end/src/views/Blog/form-helpers/posts.ts b/front-end/src/views/Blog/form-helpers/posts.ts index da805e7..f4cc4f7 100644 --- a/front-end/src/views/Blog/form-helpers/posts.ts +++ b/front-end/src/views/Blog/form-helpers/posts.ts @@ -29,32 +29,28 @@ export const getPostForm = () => { type: 'text', label: 'Post Title', name: 'title', - placeholder: 'Enter the title of the post', - description: 'A simple human readable title for the post' + placeholder: 'Enter the title of the post' }, { id: 'post-author', type: 'text', label: 'Post Author', name: 'author', - placeholder: 'Enter the author of the post', - description: 'The author of the post' + placeholder: 'The author of the post', }, { id: 'post-tags', type: 'text', label: 'Post Tags', name: 'tags', - placeholder: 'Enter the tags for the post', - description: 'A comma separated list of tags for the post' + placeholder: 'Ex: tag1,tag2', }, { id: 'post-image', type: 'text', label: 'Post Image', name: 'image', - placeholder: 'Enter the image url for the post', - description: 'The full http url to the post image' + placeholder: 'Enter the full external image url', }, { id: 'post-summary', @@ -70,29 +66,28 @@ export const getPostForm = () => { label: 'Post Id', name: 'id', placeholder: '', - description: 'The id of the post, this cannot be changed', disabled: true, } ] } }); - const alphaNumSpace = helpers.regex(/^[a-zA-Z0-9 ]*$/); + const alphaNumSpace = helpers.regex(/^[a-zA-Z0-9\?\\\&\|\\/\-\.\, ]*$/); const httpUrl = helpers.regex(/^(http|https):\/\/[^ "]+$/); const rules = { title: { required: helpers.withMessage('Post title is required', required), - maxlength: helpers.withMessage('Post title must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Post title must be less than 64 characters', maxLength(64)), alphaNumSpace: helpers.withMessage('Post title must be alphanumeric', alphaNumSpace), }, summary: { required: helpers.withMessage('Post summary is required', required), - maxlength: helpers.withMessage('Post summary must be less than 50 characters', maxLength(200)), + maxlength: helpers.withMessage('Post summary must be less than 250 characters', maxLength(250)), }, author: { required: helpers.withMessage('Post author is required', required), - maxlength: helpers.withMessage('Post author must be less than 50 characters', maxLength(50)), + maxlength: helpers.withMessage('Post author must be less than 64 characters', maxLength(64)), }, tags: {}, image: { -- cgit