Skip to content
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

fix: only allow plain text messages in timeline #670

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useToast } from "@/hooks/useToast"
import { Flex, IconButton, Link, Text } from "@radix-ui/themes"
import { Flex, IconButton, Link } from "@radix-ui/themes"
import { BiLink, BiRightArrowAlt } from "react-icons/bi"
import { FiExternalLink } from "react-icons/fi"

Expand Down Expand Up @@ -34,7 +34,7 @@ export const DoctypeLinkRenderer = ({ doctype, docname }: { doctype: string, doc
className="border-2 bg-gray-2 dark:bg-gray-4 rounded-md border-gray-4 dark:border-gray-6 shadow-sm">
<Flex align='center' gap='2'>
<BiRightArrowAlt />
<Link size='2' underline="always" target="_blank" href={route}>Linked with {doctype}: {docname}</Link>
<Link size='2' underline="always" target="_blank" href={route}>{doctype}: {docname}</Link>
</Flex>

<Flex align='center' gap='2'>
Expand Down
26 changes: 19 additions & 7 deletions raven/public/js/timeline_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,14 @@ $(document).on('app_ready', function () {
<p class="flex">
<label class="attachment-radio">
<input type="radio" name="${radioGroupName}"
data-file-name="${attachment.name}" ${
checked ? 'checked' : ''
}>
data-file-name="${attachment.name}" ${checked ? 'checked' : ''
}>
</input>
<span class="ellipsis">${attachment.file_name}</span>
</label>
&nbsp;
<a href="${
attachment.file_url
}" target="_blank" class="btn-linkF">
<a href="${attachment.file_url
}" target="_blank" class="btn-linkF">
${frappe.utils.icon('link-url')}
</a>
</p>`);
Expand Down Expand Up @@ -194,7 +192,7 @@ $(document).on('app_ready', function () {
{
fieldname: 'message',
label: 'Message',
fieldtype: 'Text Editor',
fieldtype: 'Long Text',
// reqd: 1,
},
{ fieldtype: 'Section Break' },
Expand Down Expand Up @@ -280,6 +278,20 @@ $(document).on('app_ready', function () {
doctype: 'Raven Message',
channel_id: channel,
text: message,
json: {
"content": [
{
"content": [
{
"text": message,
"type": "text"
}
],
"type": "paragraph"
}
],
"type": "doc"
},
message_type: get_type(res?.message?.file_url),
file: res?.message?.file_url || '',
link_doctype: frm.doctype,
Expand Down
Loading