Bug fixes for search and direct messages (#4986)

* PLT-5145 - Fixing search popover on mobile

* PLT-5093 - Fixing direct messages list height
Этот коммит содержится в:
Asaad Mahmood
2017-01-06 19:04:11 +05:00
коммит произвёл Harrison Healey
родитель 0c0635d766
Коммит 28d07758fc
9 изменённых файлов: 94 добавлений и 104 удалений

Просмотреть файл

@@ -168,7 +168,7 @@ export default class ChannelMembersModal extends React.Component {
return (
<div>
<Modal
dialogClassName='more-modal'
dialogClassName='more-modal more-modal--action'
show={this.state.show}
onHide={this.onHide}
onExited={this.props.onModalDismissed}

Просмотреть файл

@@ -9,7 +9,6 @@ import TeamStore from 'stores/team_store.jsx';
import Constants from 'utils/constants.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import * as ChannelUtils from 'utils/channel_utils.jsx';
import {joinChannel, searchMoreChannels} from 'actions/channel_actions.jsx';
import React from 'react';
@@ -152,14 +151,19 @@ export default class MoreChannels extends React.Component {
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
if (!ChannelUtils.showCreateOption(Constants.OPEN_CHANNEL, isAdmin, isSystemAdmin)) {
if (global.window.mm_license.IsLicensed === 'true') {
if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) {
createNewChannelButton = null;
createChannelHelpText = null;
} else if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_TEAM_ADMIN && !isAdmin) {
createNewChannelButton = null;
createChannelHelpText = null;
}
}
return (
<Modal
dialogClassName='more-modal more-public-channels'
dialogClassName='more-modal more-modal--action'
show={this.state.show}
onHide={this.handleHide}
onExited={this.handleExit}

Просмотреть файл

@@ -195,7 +195,9 @@ export default class MoreDirectChannels extends React.Component {
render() {
let teamToggle;
let memberClass = '';
if (global.window.mm_config.RestrictDirectMessage === 'any') {
memberClass = 'more-system-members';
teamToggle = (
<div className='member-select__container'>
<select
@@ -226,7 +228,7 @@ export default class MoreDirectChannels extends React.Component {
return (
<Modal
dialogClassName='more-modal more-direct-channels'
dialogClassName={'more-modal more-direct-channels ' + memberClass}
show={this.state.show}
onHide={this.handleHide}
onExited={this.handleExit}

Просмотреть файл

@@ -104,6 +104,7 @@ export default class SearchBar extends React.Component {
SearchStore.storeSearchTerm(term);
SearchStore.emitSearchTermChange(false);
this.setState({searchTerm: term});
this.refs.searchOverlay.hide();
}
handleUserBlur() {
@@ -179,11 +180,6 @@ export default class SearchBar extends React.Component {
isSearching = <span className={'fa fa-refresh fa-refresh-animate icon--refresh icon--rotate'}/>;
}
let helpClass = 'search-help-popover';
if (!this.state.searchTerm && this.state.focused) {
helpClass += ' visible';
}
const recentMentionsTooltip = (
<Tooltip id='recentMentionsTooltip'>
<FormattedMessage
@@ -197,7 +193,7 @@ export default class SearchBar extends React.Component {
<Popover
id='searchbar-help-popup'
placement='bottom'
className={helpClass}
className='search-help-popover'
>
<FormattedHTMLMessage
id='search_bar.usage'
@@ -290,12 +286,12 @@ export default class SearchBar extends React.Component {
>
<span className='fa fa-search sidebar__search-icon'/>
<OverlayTrigger
ref='searchOverlay'
delayShow={Constants.OVERLAY_TIME_DELAY_SMALL}
placement='bottom'
overlay={searchPopover}
trigger='focus'
trigger='click'
rootClose={true}
className={helpClass}
>
<SuggestionBox
ref='search'

Просмотреть файл

@@ -180,8 +180,10 @@ export default class SearchableChannelList extends React.Component {
ref='channelList'
className='more-modal__list'
>
<div>
{listContent}
</div>
</div>
<div className='filter-controls'>
{previousButton}
{nextButton}

Просмотреть файл

@@ -24,6 +24,10 @@
min-height: 8em;
}
.suggestion-list {
bottom: -149px;
}
.suggestion-list__content {
max-height: 150px;
}
@@ -460,24 +464,10 @@
float: right;
margin-top: 5px;
}
.more-modal__list {
max-height: calc(100vh - 270px);
}
}
}
.more-modal {
.more-modal__list {
height: 100vh;
max-height: calc(100vh - 340px);
}
&.more-direct-channels {
.more-modal__list {
max-height: calc(100vh - 325px);
}
}
.user-list {
margin-top: 10px;
@@ -492,7 +482,6 @@
}
.filter-row {
@include clearfix;
margin: 5px 0 10px;
width: 300px;
}
@@ -557,7 +546,11 @@
.more-modal__list {
display: flex;
flex-direction: column;
> div {
min-height: 100%;
overflow: auto;
}
.popover & {
font-size: .95em;
@@ -602,6 +595,7 @@
.more-modal__actions {
flex-grow: 0;
flex-shrink: 0;
margin: 5px 0 10px;
padding-left: 20px;
}
@@ -624,8 +618,7 @@
.more-modal__row {
border-bottom: 1px solid $light-gray;
display: flex;
min-height: 70px;
padding: 8px 15px;
padding: 10px 15px;
}
p {
@@ -646,16 +639,15 @@
.filtered-user-list {
display: flex;
flex-direction: column;
height: calc(90vh - 120px);
width: 100%;
.filter-row {
flex-grow: 0;
flex-shrink: 0;
> div {
flex: 1;
}
.user-list {
flex-grow: 1;
flex-shrink: 1;
.more-modal__list {
flex-grow: 500;
}
.filter-button {
@@ -665,9 +657,6 @@
}
.filter-controls {
@include clearfix;
flex-grow: 0;
flex-shrink: 0;
padding: 1em 1.5em 0;
.filter-control__next {
@@ -680,9 +669,3 @@
padding-left: 0;
}
}
.channel-switch-modal {
.modal-body {
overflow: visible;
}
}

Просмотреть файл

@@ -94,10 +94,13 @@
.search-help-popover {
font-size: em(13px);
margin-top: 17px !important;
max-width: 300px;
width: 100%;
&:not(.autocomplete) {
margin-top: 17px !important;
}
&.autocomplete {
display: block;

Просмотреть файл

@@ -427,8 +427,14 @@
}
.search-help-popover {
left: 0 !important;
margin-left: 10px;
max-width: calc(100% - 20px);
max-width: calc(100% - 80px);
.focused & {
left: 45px !important;
margin-top: 50px;
}
}
.modal-direct-channels,
@@ -1214,6 +1220,16 @@
}
@media screen and (max-width: 640px) {
.filtered-user-list {
height: calc(100vh - 80px);
}
.more-modal--action {
.filtered-user-list {
height: calc(100vh - 110px);
}
}
.app__body {
.modal {
.more-modal {
@@ -1221,10 +1237,6 @@
max-height: calc(100vh - 62px);
padding-bottom: 5px;
}
.more-modal__list {
max-height: calc(100vh - 230px);
}
}
}
@@ -1385,15 +1397,14 @@
@media screen and (max-width: 550px) {
.app__body {
.more-modal {
&.more-system-members {
.filter-row {
min-height: 80px;
width: 100%;
}
}
&.more-direct-channels {
.filter-row {
padding-bottom: 50px;
}
.member-show {
display: none;
}
@@ -1451,16 +1462,6 @@
.app__body {
.modal {
&.more-channel__modal {
.more-modal__list {
max-height: calc(100vh - 250px);
}
.modal-body {
padding-bottom: 35px;
}
}
.settings-modal {
&.display--content {
.modal-body {

Просмотреть файл

@@ -252,7 +252,6 @@
.filter-row {
margin: 10px 0;
overflow: hidden;
}
}
@@ -469,13 +468,13 @@
}
.cluster-status {
width: 24px;
height: 24px;
width: 24px;
}
.config-hash {
width: 130px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 130px;
}