From 887d205b1fbb3188331a324ba59b7ec187a2d772 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Tue, 27 Oct 2015 10:32:13 -0400
Subject: Renamed Channel.Description to Channel.Header on the client

---
 web/react/components/channel_header.jsx | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'web/react/components/channel_header.jsx')

diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index d66777cc6..39f283746 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -110,11 +110,11 @@ export default class ChannelHeader extends React.Component {
                 bSize='large'
                 placement='bottom'
                 className='description'
-                onMouseOver={() => this.refs.descriptionOverlay.show()}
-                onMouseOut={() => this.refs.descriptionOverlay.hide()}
+                onMouseOver={() => this.refs.headerOverlay.show()}
+                onMouseOut={() => this.refs.headerOverlay.hide()}
             >
                 <MessageWrapper
-                    message={channel.description}
+                    message={channel.header}
                 />
             </Popover>
         );
@@ -144,7 +144,7 @@ export default class ChannelHeader extends React.Component {
         if (isDirect) {
             dropdownContents.push(
                 <li
-                    key='edit_description_direct'
+                    key='edit_header_direct'
                     role='presentation'
                 >
                     <a
@@ -152,11 +152,11 @@ export default class ChannelHeader extends React.Component {
                         href='#'
                         data-toggle='modal'
                         data-target='#edit_channel'
-                        data-desc={channel.description}
+                        data-header={channel.header}
                         data-title={channel.display_name}
                         data-channelid={channel.id}
                     >
-                        Set Channel Description...
+                        Set Channel Header...
                     </a>
                 </li>
             );
@@ -216,7 +216,7 @@ export default class ChannelHeader extends React.Component {
 
             dropdownContents.push(
                 <li
-                    key='set_channel_description'
+                    key='set_channel_header'
                     role='presentation'
                 >
                     <a
@@ -224,11 +224,11 @@ export default class ChannelHeader extends React.Component {
                         href='#'
                         data-toggle='modal'
                         data-target='#edit_channel'
-                        data-desc={channel.description}
+                        data-header={channel.header}
                         data-title={channel.display_name}
                         data-channelid={channel.id}
                     >
-                        Set {channelTerm} Description...
+                        Set {channelTerm} Header...
                     </a>
                 </li>
             );
@@ -336,12 +336,12 @@ export default class ChannelHeader extends React.Component {
                                     trigger={['hover', 'focus']}
                                     placement='bottom'
                                     overlay={popoverContent}
-                                    ref='descriptionOverlay'
+                                    ref='headerOverlay'
                                 >
                                 <div
                                     onClick={TextFormatting.handleClick}
                                     className='description'
-                                    dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.description, {singleline: true, mentionHighlight: false})}}
+                                    dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}}
                                 />
                                 </OverlayTrigger>
                             </div>
-- 
cgit v1.2.3-1-g7c22


From 019bf6a7fed85138a6a3be6ef70fbb994be49abe Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Tue, 27 Oct 2015 12:34:21 -0400
Subject: Added ability to see/edit channel purpose in the client

---
 web/react/components/channel_header.jsx | 156 ++++++++++++++++++--------------
 1 file changed, 90 insertions(+), 66 deletions(-)

(limited to 'web/react/components/channel_header.jsx')

diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index 39f283746..101fd85e5 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -11,6 +11,7 @@ const TextFormatting = require('../utils/text_formatting.jsx');
 const Utils = require('../utils/utils.jsx');
 const MessageWrapper = require('./message_wrapper.jsx');
 const PopoverListMembers = require('./popover_list_members.jsx');
+const EditChannelPurposeModal = require('./edit_channel_purpose_modal.jsx');
 
 const AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
 const Constants = require('../utils/constants.jsx');
@@ -27,7 +28,9 @@ export default class ChannelHeader extends React.Component {
         this.handleLeave = this.handleLeave.bind(this);
         this.searchMentions = this.searchMentions.bind(this);
 
-        this.state = this.getStateFromStores();
+        const state = this.getStateFromStores();
+        state.showEditChannelPurposeModal = false;
+        this.state = state;
     }
     getStateFromStores() {
         return {
@@ -232,6 +235,20 @@ export default class ChannelHeader extends React.Component {
                     </a>
                 </li>
             );
+            dropdownContents.push(
+                <li
+                    key='set_channel_purpose'
+                    role='presentation'
+                >
+                    <a
+                        role='menuitem'
+                        href='#'
+                        onClick={() => this.setState({showEditChannelPurposeModal: true})}
+                    >
+                        Set {channelTerm} Purpose...
+                    </a>
+                </li>
+            );
             dropdownContents.push(
                 <li
                     key='notification_preferences'
@@ -307,84 +324,91 @@ export default class ChannelHeader extends React.Component {
         }
 
         return (
-            <table className='channel-header alt'>
-                <tbody>
-                    <tr>
-                        <th>
-                            <div className='channel-header__info'>
-                                <div className='dropdown'>
+            <div>
+                <table className='channel-header alt'>
+                    <tbody>
+                        <tr>
+                            <th>
+                                <div className='channel-header__info'>
+                                    <div className='dropdown'>
+                                        <a
+                                            href='#'
+                                            className='dropdown-toggle theme'
+                                            type='button'
+                                            id='channel_header_dropdown'
+                                            data-toggle='dropdown'
+                                            aria-expanded='true'
+                                        >
+                                            <strong className='heading'>{channelTitle} </strong>
+                                            <span className='glyphicon glyphicon-chevron-down header-dropdown__icon' />
+                                        </a>
+                                        <ul
+                                            className='dropdown-menu'
+                                            role='menu'
+                                            aria-labelledby='channel_header_dropdown'
+                                        >
+                                            {dropdownContents}
+                                        </ul>
+                                    </div>
+                                    <OverlayTrigger
+                                        trigger={['hover', 'focus']}
+                                        placement='bottom'
+                                        overlay={popoverContent}
+                                        ref='headerOverlay'
+                                    >
+                                    <div
+                                        onClick={TextFormatting.handleClick}
+                                        className='description'
+                                        dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}}
+                                    />
+                                    </OverlayTrigger>
+                                </div>
+                            </th>
+                            <th>
+                                <PopoverListMembers
+                                    members={this.state.users}
+                                    channelId={channel.id}
+                                />
+                            </th>
+                            <th className='search-bar__container'><NavbarSearchBox /></th>
+                            <th>
+                                <div className='dropdown channel-header__links'>
                                     <a
                                         href='#'
                                         className='dropdown-toggle theme'
                                         type='button'
-                                        id='channel_header_dropdown'
+                                        id='channel_header_right_dropdown'
                                         data-toggle='dropdown'
                                         aria-expanded='true'
                                     >
-                                        <strong className='heading'>{channelTitle} </strong>
-                                        <span className='glyphicon glyphicon-chevron-down header-dropdown__icon' />
+                                        <span dangerouslySetInnerHTML={{__html: Constants.MENU_ICON}} />
                                     </a>
                                     <ul
-                                        className='dropdown-menu'
+                                        className='dropdown-menu dropdown-menu-right'
                                         role='menu'
-                                        aria-labelledby='channel_header_dropdown'
+                                        aria-labelledby='channel_header_right_dropdown'
                                     >
-                                        {dropdownContents}
+                                        <li role='presentation'>
+                                            <a
+                                                role='menuitem'
+                                                href='#'
+                                                onClick={this.searchMentions}
+                                            >
+                                                Recent Mentions
+                                            </a>
+                                        </li>
                                     </ul>
                                 </div>
-                                <OverlayTrigger
-                                    trigger={['hover', 'focus']}
-                                    placement='bottom'
-                                    overlay={popoverContent}
-                                    ref='headerOverlay'
-                                >
-                                <div
-                                    onClick={TextFormatting.handleClick}
-                                    className='description'
-                                    dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}}
-                                />
-                                </OverlayTrigger>
-                            </div>
-                        </th>
-                        <th>
-                            <PopoverListMembers
-                                members={this.state.users}
-                                channelId={channel.id}
-                            />
-                        </th>
-                        <th className='search-bar__container'><NavbarSearchBox /></th>
-                        <th>
-                            <div className='dropdown channel-header__links'>
-                                <a
-                                    href='#'
-                                    className='dropdown-toggle theme'
-                                    type='button'
-                                    id='channel_header_right_dropdown'
-                                    data-toggle='dropdown'
-                                    aria-expanded='true'
-                                >
-                                    <span dangerouslySetInnerHTML={{__html: Constants.MENU_ICON}} />
-                                </a>
-                                <ul
-                                    className='dropdown-menu dropdown-menu-right'
-                                    role='menu'
-                                    aria-labelledby='channel_header_right_dropdown'
-                                >
-                                    <li role='presentation'>
-                                        <a
-                                            role='menuitem'
-                                            href='#'
-                                            onClick={this.searchMentions}
-                                        >
-                                            Recent Mentions
-                                        </a>
-                                    </li>
-                                </ul>
-                            </div>
-                        </th>
-                    </tr>
-                </tbody>
-            </table>
+                            </th>
+                        </tr>
+                    </tbody>
+                </table>
+                <EditChannelPurposeModal
+                    show={this.state.showEditChannelPurposeModal}
+                    onModalDismissed={() => this.setState({showEditChannelPurposeModal: false})}
+                    channel={channel}
+                />
+            </div>
         );
     }
 }
-- 
cgit v1.2.3-1-g7c22

