Bug fixes for search and direct messages (#4986)
* PLT-5145 - Fixing search popover on mobile * PLT-5093 - Fixing direct messages list height
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
0c0635d766
Коммит
28d07758fc
@@ -168,7 +168,7 @@ export default class ChannelMembersModal extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Modal
|
<Modal
|
||||||
dialogClassName='more-modal'
|
dialogClassName='more-modal more-modal--action'
|
||||||
show={this.state.show}
|
show={this.state.show}
|
||||||
onHide={this.onHide}
|
onHide={this.onHide}
|
||||||
onExited={this.props.onModalDismissed}
|
onExited={this.props.onModalDismissed}
|
||||||
@@ -210,4 +210,4 @@ ChannelMembersModal.propTypes = {
|
|||||||
onModalDismissed: React.PropTypes.func.isRequired,
|
onModalDismissed: React.PropTypes.func.isRequired,
|
||||||
showInviteModal: React.PropTypes.func.isRequired,
|
showInviteModal: React.PropTypes.func.isRequired,
|
||||||
channel: React.PropTypes.object.isRequired
|
channel: React.PropTypes.object.isRequired
|
||||||
};
|
};
|
||||||
@@ -9,7 +9,6 @@ import TeamStore from 'stores/team_store.jsx';
|
|||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.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 {joinChannel, searchMoreChannels} from 'actions/channel_actions.jsx';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@@ -152,14 +151,19 @@ export default class MoreChannels extends React.Component {
|
|||||||
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||||
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
||||||
|
|
||||||
if (!ChannelUtils.showCreateOption(Constants.OPEN_CHANNEL, isAdmin, isSystemAdmin)) {
|
if (global.window.mm_license.IsLicensed === 'true') {
|
||||||
createNewChannelButton = null;
|
if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) {
|
||||||
createChannelHelpText = null;
|
createNewChannelButton = null;
|
||||||
|
createChannelHelpText = null;
|
||||||
|
} else if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_TEAM_ADMIN && !isAdmin) {
|
||||||
|
createNewChannelButton = null;
|
||||||
|
createChannelHelpText = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
dialogClassName='more-modal more-public-channels'
|
dialogClassName='more-modal more-modal--action'
|
||||||
show={this.state.show}
|
show={this.state.show}
|
||||||
onHide={this.handleHide}
|
onHide={this.handleHide}
|
||||||
onExited={this.handleExit}
|
onExited={this.handleExit}
|
||||||
@@ -192,4 +196,4 @@ export default class MoreChannels extends React.Component {
|
|||||||
MoreChannels.propTypes = {
|
MoreChannels.propTypes = {
|
||||||
onModalDismissed: React.PropTypes.func,
|
onModalDismissed: React.PropTypes.func,
|
||||||
handleNewChannel: React.PropTypes.func
|
handleNewChannel: React.PropTypes.func
|
||||||
};
|
};
|
||||||
@@ -195,7 +195,9 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let teamToggle;
|
let teamToggle;
|
||||||
|
let memberClass = '';
|
||||||
if (global.window.mm_config.RestrictDirectMessage === 'any') {
|
if (global.window.mm_config.RestrictDirectMessage === 'any') {
|
||||||
|
memberClass = 'more-system-members';
|
||||||
teamToggle = (
|
teamToggle = (
|
||||||
<div className='member-select__container'>
|
<div className='member-select__container'>
|
||||||
<select
|
<select
|
||||||
@@ -226,7 +228,7 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
dialogClassName='more-modal more-direct-channels'
|
dialogClassName={'more-modal more-direct-channels ' + memberClass}
|
||||||
show={this.state.show}
|
show={this.state.show}
|
||||||
onHide={this.handleHide}
|
onHide={this.handleHide}
|
||||||
onExited={this.handleExit}
|
onExited={this.handleExit}
|
||||||
@@ -258,4 +260,4 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
|
|
||||||
MoreDirectChannels.propTypes = {
|
MoreDirectChannels.propTypes = {
|
||||||
onModalDismissed: React.PropTypes.func
|
onModalDismissed: React.PropTypes.func
|
||||||
};
|
};
|
||||||
@@ -104,6 +104,7 @@ export default class SearchBar extends React.Component {
|
|||||||
SearchStore.storeSearchTerm(term);
|
SearchStore.storeSearchTerm(term);
|
||||||
SearchStore.emitSearchTermChange(false);
|
SearchStore.emitSearchTermChange(false);
|
||||||
this.setState({searchTerm: term});
|
this.setState({searchTerm: term});
|
||||||
|
this.refs.searchOverlay.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleUserBlur() {
|
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'}/>;
|
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 = (
|
const recentMentionsTooltip = (
|
||||||
<Tooltip id='recentMentionsTooltip'>
|
<Tooltip id='recentMentionsTooltip'>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
@@ -197,7 +193,7 @@ export default class SearchBar extends React.Component {
|
|||||||
<Popover
|
<Popover
|
||||||
id='searchbar-help-popup'
|
id='searchbar-help-popup'
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
className={helpClass}
|
className='search-help-popover'
|
||||||
>
|
>
|
||||||
<FormattedHTMLMessage
|
<FormattedHTMLMessage
|
||||||
id='search_bar.usage'
|
id='search_bar.usage'
|
||||||
@@ -290,12 +286,12 @@ export default class SearchBar extends React.Component {
|
|||||||
>
|
>
|
||||||
<span className='fa fa-search sidebar__search-icon'/>
|
<span className='fa fa-search sidebar__search-icon'/>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
|
ref='searchOverlay'
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY_SMALL}
|
delayShow={Constants.OVERLAY_TIME_DELAY_SMALL}
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
overlay={searchPopover}
|
overlay={searchPopover}
|
||||||
trigger='focus'
|
trigger='click'
|
||||||
rootClose={true}
|
rootClose={true}
|
||||||
className={helpClass}
|
|
||||||
>
|
>
|
||||||
<SuggestionBox
|
<SuggestionBox
|
||||||
ref='search'
|
ref='search'
|
||||||
|
|||||||
@@ -180,7 +180,9 @@ export default class SearchableChannelList extends React.Component {
|
|||||||
ref='channelList'
|
ref='channelList'
|
||||||
className='more-modal__list'
|
className='more-modal__list'
|
||||||
>
|
>
|
||||||
{listContent}
|
<div>
|
||||||
|
{listContent}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='filter-controls'>
|
<div className='filter-controls'>
|
||||||
{previousButton}
|
{previousButton}
|
||||||
@@ -202,4 +204,4 @@ SearchableChannelList.propTypes = {
|
|||||||
search: React.PropTypes.func.isRequired,
|
search: React.PropTypes.func.isRequired,
|
||||||
handleJoin: React.PropTypes.func.isRequired,
|
handleJoin: React.PropTypes.func.isRequired,
|
||||||
noResultsText: React.PropTypes.object
|
noResultsText: React.PropTypes.object
|
||||||
};
|
};
|
||||||
@@ -24,6 +24,10 @@
|
|||||||
min-height: 8em;
|
min-height: 8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suggestion-list {
|
||||||
|
bottom: -149px;
|
||||||
|
}
|
||||||
|
|
||||||
.suggestion-list__content {
|
.suggestion-list__content {
|
||||||
max-height: 150px;
|
max-height: 150px;
|
||||||
}
|
}
|
||||||
@@ -460,24 +464,10 @@
|
|||||||
float: right;
|
float: right;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-modal__list {
|
|
||||||
max-height: calc(100vh - 270px);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-modal {
|
.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 {
|
.user-list {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@@ -492,7 +482,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.filter-row {
|
.filter-row {
|
||||||
@include clearfix;
|
|
||||||
margin: 5px 0 10px;
|
margin: 5px 0 10px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
@@ -557,7 +546,11 @@
|
|||||||
.more-modal__list {
|
.more-modal__list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: auto;
|
|
||||||
|
> div {
|
||||||
|
min-height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.popover & {
|
.popover & {
|
||||||
font-size: .95em;
|
font-size: .95em;
|
||||||
@@ -602,6 +595,7 @@
|
|||||||
.more-modal__actions {
|
.more-modal__actions {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
margin: 5px 0 10px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,8 +618,7 @@
|
|||||||
.more-modal__row {
|
.more-modal__row {
|
||||||
border-bottom: 1px solid $light-gray;
|
border-bottom: 1px solid $light-gray;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 70px;
|
padding: 10px 15px;
|
||||||
padding: 8px 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@@ -646,16 +639,15 @@
|
|||||||
.filtered-user-list {
|
.filtered-user-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
height: calc(90vh - 120px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.filter-row {
|
> div {
|
||||||
flex-grow: 0;
|
flex: 1;
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-list {
|
.more-modal__list {
|
||||||
flex-grow: 1;
|
flex-grow: 500;
|
||||||
flex-shrink: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-button {
|
.filter-button {
|
||||||
@@ -665,9 +657,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.filter-controls {
|
.filter-controls {
|
||||||
@include clearfix;
|
|
||||||
flex-grow: 0;
|
|
||||||
flex-shrink: 0;
|
|
||||||
padding: 1em 1.5em 0;
|
padding: 1em 1.5em 0;
|
||||||
|
|
||||||
.filter-control__next {
|
.filter-control__next {
|
||||||
@@ -679,10 +668,4 @@
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.channel-switch-modal {
|
|
||||||
.modal-body {
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -94,10 +94,13 @@
|
|||||||
|
|
||||||
.search-help-popover {
|
.search-help-popover {
|
||||||
font-size: em(13px);
|
font-size: em(13px);
|
||||||
margin-top: 17px !important;
|
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
&:not(.autocomplete) {
|
||||||
|
margin-top: 17px !important;
|
||||||
|
}
|
||||||
|
|
||||||
&.autocomplete {
|
&.autocomplete {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
|
|||||||
@@ -427,8 +427,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search-help-popover {
|
.search-help-popover {
|
||||||
|
left: 0 !important;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
max-width: calc(100% - 20px);
|
max-width: calc(100% - 80px);
|
||||||
|
|
||||||
|
.focused & {
|
||||||
|
left: 45px !important;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-direct-channels,
|
.modal-direct-channels,
|
||||||
@@ -1085,7 +1091,7 @@
|
|||||||
.post-error {
|
.post-error {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1214,6 +1220,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 640px) {
|
@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 {
|
.app__body {
|
||||||
.modal {
|
.modal {
|
||||||
.more-modal {
|
.more-modal {
|
||||||
@@ -1221,10 +1237,6 @@
|
|||||||
max-height: calc(100vh - 62px);
|
max-height: calc(100vh - 62px);
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-modal__list {
|
|
||||||
max-height: calc(100vh - 230px);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1385,15 +1397,14 @@
|
|||||||
@media screen and (max-width: 550px) {
|
@media screen and (max-width: 550px) {
|
||||||
.app__body {
|
.app__body {
|
||||||
.more-modal {
|
.more-modal {
|
||||||
.filter-row {
|
&.more-system-members {
|
||||||
width: 100%;
|
.filter-row {
|
||||||
|
min-height: 80px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.more-direct-channels {
|
&.more-direct-channels {
|
||||||
.filter-row {
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.member-show {
|
.member-show {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -1451,16 +1462,6 @@
|
|||||||
|
|
||||||
.app__body {
|
.app__body {
|
||||||
.modal {
|
.modal {
|
||||||
&.more-channel__modal {
|
|
||||||
.more-modal__list {
|
|
||||||
max-height: calc(100vh - 250px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-body {
|
|
||||||
padding-bottom: 35px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-modal {
|
.settings-modal {
|
||||||
&.display--content {
|
&.display--content {
|
||||||
.modal-body {
|
.modal-body {
|
||||||
|
|||||||
@@ -245,38 +245,37 @@
|
|||||||
|
|
||||||
.more-modal__list {
|
.more-modal__list {
|
||||||
.filtered-user-list {
|
.filtered-user-list {
|
||||||
.filter-controls {
|
.filter-controls {
|
||||||
padding-bottom: 1em;
|
padding-bottom: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-row {
|
||||||
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-row {
|
.member-list-holder {
|
||||||
margin: 10px 0;
|
background: $white;
|
||||||
overflow: hidden;
|
margin-bottom: 4em;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.member-list-holder {
|
|
||||||
background: $white;
|
|
||||||
margin-bottom: 4em;
|
|
||||||
overflow: visible;
|
|
||||||
padding: 5px 0;
|
|
||||||
|
|
||||||
.more-modal__list {
|
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
padding: 5px 0;
|
||||||
|
|
||||||
.more-modal__row {
|
.more-modal__list {
|
||||||
&:last-child {
|
overflow: visible;
|
||||||
border: none;
|
}
|
||||||
|
|
||||||
|
.more-modal__row {
|
||||||
|
&:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.member-count {
|
.member-count {
|
||||||
@include opacity(.7);
|
@include opacity(.7);
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-img {
|
.brand-img {
|
||||||
@@ -469,13 +468,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cluster-status {
|
.cluster-status {
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
height: 24px;
|
||||||
|
width: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.config-hash {
|
.config-hash {
|
||||||
width: 130px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 130px;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user