Add ability to open /new in connect sidecar (#5220) [deploy]
This commit is contained in:
parent
bb570a2d55
commit
737310f8ef
3 changed files with 14 additions and 2 deletions
|
|
@ -523,6 +523,14 @@ export default class Chat extends Component {
|
|||
.trigger('client-initiatevideocall', {
|
||||
channelId: activeChannelId,
|
||||
});
|
||||
} else if (message.startsWith('/new')) {
|
||||
this.setActiveContentState(activeChannelId, {
|
||||
type_of: 'loading-post',
|
||||
});
|
||||
this.setActiveContent({
|
||||
path: '/new',
|
||||
type_of: 'article'
|
||||
})
|
||||
} else if (message.startsWith('/github')) {
|
||||
const args = message.split('/github ')[1].trim();
|
||||
this.setActiveContentState(activeChannelId, { type_of: 'github', args });
|
||||
|
|
|
|||
|
|
@ -149,6 +149,10 @@ function manageChannel(json) {
|
|||
}
|
||||
|
||||
export default function getUnopenedChannels() {
|
||||
if (window.frameElement) {
|
||||
// We don't want this triggered within context of iframe.
|
||||
return;
|
||||
}
|
||||
render(
|
||||
<UnopenedChannelNotice
|
||||
unopenedChannels={[]}
|
||||
|
|
|
|||
|
|
@ -52,12 +52,12 @@ class Message < ApplicationRecord
|
|||
doc = Nokogiri::HTML(html)
|
||||
doc.css("a").each do |anchor|
|
||||
if article = rich_link_article(anchor)
|
||||
html += "<a href='#{article.path}'
|
||||
html += "<a href='#{article.current_state_path}'
|
||||
class='chatchannels__richlink'
|
||||
target='_blank' data-content='sidecar-article'>
|
||||
#{"<div class='chatchannels__richlinkmainimage' style='background-image:url(" + cl_path(article.main_image) + ")' data-content='sidecar-article' ></div>" if article.main_image.present?}
|
||||
<h1 data-content='sidecar-article'>#{article.title}</h1>
|
||||
<h4 data-content='sidecar-article'><img src='#{ProfileImage.new(article.cached_user).get(90)}' /> #{article.cached_user.name}・#{article.readable_publish_date}</h4>
|
||||
<h4 data-content='sidecar-article'><img src='#{ProfileImage.new(article.cached_user).get(90)}' /> #{article.cached_user.name}・#{article.readable_publish_date || 'Draft Post'}</h4>
|
||||
</a>".html_safe
|
||||
elsif tag = rich_link_tag(anchor)
|
||||
html += "<a href='/t/#{tag.name}'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue