Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request mattermost#1041 from mattermost/plt-603
Browse files Browse the repository at this point in the history
RC3 - PLT-603 Fix webhook name not overriding in RHS and update webhook help text.
  • Loading branch information
crspeller committed Oct 14, 2015
2 parents 2bbe8f4 + ac0f8f6 commit 5e14ef6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
45 changes: 38 additions & 7 deletions web/react/components/rhs_root_post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,51 @@ export default class RhsRootPost extends React.Component {
);
}

let userProfile = <UserProfile userId={post.user_id} />;
let botIndicator;

if (post.props && post.props.from_webhook) {
if (post.props.override_username && global.window.config.EnablePostUsernameOverride === 'true') {
userProfile = (
<UserProfile
userId={post.user_id}
overwriteName={post.props.override_username}
disablePopover={true}
/>
);
}

botIndicator = <li className='post-header-col post-header__name bot-indicator'>{'BOT'}</li>;
}

let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp;
if (post.props && post.props.from_webhook && global.window.config.EnablePostIconOverride === 'true') {
if (post.props.override_icon_url) {
src = post.props.override_icon_url;
}
}

const profilePic = (
<div className='post-profile-img__container'>
<img
className='post-profile-img'
src={src}
height='36'
width='36'
/>
</div>
);

return (
<div className={'post post--root ' + currentUserCss}>
<div className='post-right-channel__name'>{channelName}</div>
<div className='post-profile-img__container'>
<img
className='post-profile-img'
src={'/api/v1/users/' + post.user_id + '/image?time=' + timestamp}
height='36'
width='36'
/>
{profilePic}
</div>
<div className='post__content'>
<ul className='post-header'>
<li className='post-header-col'><strong><UserProfile userId={post.user_id} /></strong></li>
<li className='post-header-col'><strong>{userProfile}</strong></li>
{botIndicator}
<li className='post-header-col'>
<time className='post-profile-time'>
{utils.displayCommentDateTime(post.create_at)}
Expand Down
3 changes: 2 additions & 1 deletion web/react/components/user_settings/manage_incoming_hooks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export default class ManageIncomingHooks extends React.Component {

return (
<div key='addIncomingHook'>
{'For developers building integrations this page lets you create webhook URLs for channels and private groups. Please see http://mattermost.org/webhooks to learn about creating webhooks, view samples, and to let the community know about integrations you have built. The URLs created below can be used by outside applications to create posts in any channels or private groups you have access to. The specified channel will be used as the default.'}
{'Create webhook URLs for use in external integrations. Please see '}<a href='http://mattermost.org/webhooks'>{'http://mattermost.org/webhooks'}</a> {' to learn more.'}
<br/>
<br/>
<label className='control-label'>{'Add a new incoming webhook'}</label>
<div className='padding-top'>
Expand Down

0 comments on commit 5e14ef6

Please sign in to comment.