From 887d205b1fbb3188331a324ba59b7ec187a2d772 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 27 Oct 2015 10:32:13 -0400 Subject: Renamed Channel.Description to Channel.Header on the client --- web/react/components/access_history_modal.jsx | 5 +++-- web/react/components/channel_header.jsx | 22 +++++++++---------- web/react/components/edit_channel_modal.jsx | 31 +++++++++++++-------------- web/react/components/more_channels.jsx | 3 ++- web/react/components/navbar.jsx | 20 ++++++++--------- web/react/components/new_channel_flow.jsx | 10 ++++----- web/react/components/new_channel_modal.jsx | 12 +++++------ web/react/components/post_list.jsx | 12 +++++------ web/react/utils/client.jsx | 8 +++---- web/sass-files/sass/partials/_modal.scss | 2 +- 10 files changed, 63 insertions(+), 62 deletions(-) (limited to 'web') diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx index c8af2553d..f0a31ce90 100644 --- a/web/react/components/access_history_modal.jsx +++ b/web/react/components/access_history_modal.jsx @@ -90,8 +90,9 @@ export default class AccessHistoryModal extends React.Component { case '/channels/update': currentAuditDesc = 'Updated the ' + channelName + ' channel/group name'; break; - case '/channels/update_desc': - currentAuditDesc = 'Updated the ' + channelName + ' channel/group description'; + case '/channels/update_desc': // support the old path + case '/channels/update_header': + currentAuditDesc = 'Updated the ' + channelName + ' channel/group header'; break; default: let userIdField = []; 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()} > ); @@ -144,7 +144,7 @@ export default class ChannelHeader extends React.Component { if (isDirect) { dropdownContents.push(
  • - Set Channel Description... + Set Channel Header...
  • ); @@ -216,7 +216,7 @@ export default class ChannelHeader extends React.Component { dropdownContents.push(
  • - Set {channelTerm} Description... + Set {channelTerm} Header...
  • ); @@ -336,12 +336,12 @@ export default class ChannelHeader extends React.Component { trigger={['hover', 'focus']} placement='bottom' overlay={popoverContent} - ref='descriptionOverlay' + ref='headerOverlay' >
    diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx index d63a1db30..6f3826f75 100644 --- a/web/react/components/edit_channel_modal.jsx +++ b/web/react/components/edit_channel_modal.jsx @@ -14,7 +14,7 @@ export default class EditChannelModal extends React.Component { this.onShow = this.onShow.bind(this); this.state = { - description: '', + header: '', title: '', channelId: '', serverError: '' @@ -28,32 +28,32 @@ export default class EditChannelModal extends React.Component { return; } - data.channel_description = this.state.description.trim(); + data.channel_header = this.state.header.trim(); - Client.updateChannelDesc(data, - function handleUpdateSuccess() { + Client.updateChannelHeader(data, + () => { this.setState({serverError: ''}); AsyncClient.getChannel(this.state.channelId); $(ReactDOM.findDOMNode(this.refs.modal)).modal('hide'); - }.bind(this), - function handleUpdateError(err) { - if (err.message === 'Invalid channel_description parameter') { - this.setState({serverError: 'This description is too long, please enter a shorter one'}); + }, + (err) => { + if (err.message === 'Invalid channel_header parameter') { + this.setState({serverError: 'This channel header is too long, please enter a shorter one'}); } else { this.setState({serverError: err.message}); } - }.bind(this) + } ); } handleUserInput(e) { - this.setState({description: e.target.value}); + this.setState({header: e.target.value}); } handleClose() { - this.setState({description: '', serverError: ''}); + this.setState({header: '', serverError: ''}); } onShow(e) { const button = e.relatedTarget; - this.setState({description: $(button).attr('data-desc'), title: $(button).attr('data-title'), channelId: $(button).attr('data-channelid'), serverError: ''}); + this.setState({header: $(button).attr('data-header'), title: $(button).attr('data-title'), channelId: $(button).attr('data-channelid'), serverError: ''}); } componentDidMount() { $(ReactDOM.findDOMNode(this.refs.modal)).on('show.bs.modal', this.onShow); @@ -73,7 +73,7 @@ export default class EditChannelModal extends React.Component { className='modal-title' ref='title' > - Edit Description + Edit Header ); if (this.state.title) { @@ -82,7 +82,7 @@ export default class EditChannelModal extends React.Component { className='modal-title' ref='title' > - Edit Description for {this.state.title} + Edit Header for {this.state.title} ); } @@ -113,9 +113,8 @@ export default class EditChannelModal extends React.Component {