Skip to content

Social: Replace text field with TinyMCE editor for post creation - refs BT#21938 #5746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions assets/vue/components/social/SocialWallPostForm.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<template>
<BaseCard plain>
<form>
<BaseInputTextWithVuelidate
<BaseTinyEditor
v-model="content"
:label="textPlaceholder"
:vuelidate-property="v$.content"
:editor-id="'content-editor'"
:required="true"
:title="textPlaceholder"
:editor-config="editorConfig"
class="mb-2"
/>

Expand Down Expand Up @@ -56,11 +58,11 @@ import BaseCard from "../basecomponents/BaseCard.vue"
import BaseButton from "../basecomponents/BaseButton.vue"
import BaseFileUpload from "../basecomponents/BaseFileUpload.vue"
import BaseCheckbox from "../basecomponents/BaseCheckbox.vue"
import BaseInputTextWithVuelidate from "../basecomponents/BaseInputTextWithVuelidate.vue"
import { useRoute } from "vue-router"
import { useSecurityStore } from "../../store/securityStore"
import socialService from "../../services/socialService"
import { useNotification } from "../../composables/notification"
import BaseTinyEditor from "../basecomponents/BaseTinyEditor.vue"

const emit = defineEmits(["post-created"])
const securityStore = useSecurityStore()
Expand Down Expand Up @@ -167,4 +169,11 @@ async function sendPost() {
showErrorNotification("There was an error creating the post")
}
}

// Editor configuration
const editorConfig = computed(() => ({
height: 300,
plugins: "link code",
toolbar: "undo redo | formatselect | bold italic | alignleft aligncenter alignright | code",
}))
</script>
Loading