Skip to content

Commit

Permalink
Merge pull request #670 from The-Commit-Company/only-allow-plain-text…
Browse files Browse the repository at this point in the history
…-messages-in-timeline

fix: only allow plain text messages in timeline
  • Loading branch information
nikkothari22 authored Feb 15, 2024
2 parents 4869837 + 5468d5c commit a099f95
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
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

0 comments on commit a099f95

Please sign in to comment.