Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
UCHAT-3952-sidebar-resize- bug fix for UI getting distorted when navi…
Browse files Browse the repository at this point in the history
…gating through pinned posts.
  • Loading branch information
nykashish authored and ayusdash committed Sep 17, 2019
1 parent 158e229 commit df799ca
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ exports[`components/AdminConsole should generate the routes 1`] = `
path="/site_config/emoji"
render={[Function]}
/>
<Route
key="out_of_office"
path="/out_of_office"
render={[Function]}
/>
<Route
key="site_config/posts"
path="/site_config/posts"
Expand All @@ -142,11 +147,6 @@ exports[`components/AdminConsole should generate the routes 1`] = `
path="/authentication/email"
render={[Function]}
/>
<Route
key="authentication/password"
path="/authentication/password"
render={[Function]}
/>
<Route
key="authentication/mfa"
path="/authentication/mfa"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,19 @@ exports[`components/AdminSidebar should match snapshot 1`] = `
/>
<AdminSidebarSection
key="9"
name="out_of_office"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Out Of Office"
id="admin.sidebar.outOfOffice"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="10"
name="site_config/posts"
parentLink=""
subsection={false}
Expand All @@ -346,7 +359,7 @@ exports[`components/AdminSidebar should match snapshot 1`] = `
}
/>
<AdminSidebarSection
key="10"
key="11"
name="site_config/file_sharing_downloads"
parentLink=""
subsection={false}
Expand All @@ -359,7 +372,7 @@ exports[`components/AdminSidebar should match snapshot 1`] = `
}
/>
<AdminSidebarSection
key="11"
key="12"
name="site_config/public_links"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -905,6 +918,19 @@ exports[`components/AdminSidebar should match snapshot, not prevent the console
/>
<AdminSidebarSection
key="9"
name="out_of_office"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Out Of Office"
id="admin.sidebar.outOfOffice"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="10"
name="site_config/posts"
parentLink=""
subsection={false}
Expand All @@ -917,7 +943,7 @@ exports[`components/AdminSidebar should match snapshot, not prevent the console
}
/>
<AdminSidebarSection
key="10"
key="11"
name="site_config/file_sharing_downloads"
parentLink=""
subsection={false}
Expand All @@ -930,7 +956,7 @@ exports[`components/AdminSidebar should match snapshot, not prevent the console
}
/>
<AdminSidebarSection
key="11"
key="12"
name="site_config/public_links"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -1469,6 +1495,19 @@ exports[`components/AdminSidebar should match snapshot, not render the plugin in
/>
<AdminSidebarSection
key="9"
name="out_of_office"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Out Of Office"
id="admin.sidebar.outOfOffice"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="10"
name="site_config/posts"
parentLink=""
subsection={false}
Expand All @@ -1481,7 +1520,7 @@ exports[`components/AdminSidebar should match snapshot, not render the plugin in
}
/>
<AdminSidebarSection
key="10"
key="11"
name="site_config/file_sharing_downloads"
parentLink=""
subsection={false}
Expand All @@ -1494,7 +1533,7 @@ exports[`components/AdminSidebar should match snapshot, not render the plugin in
}
/>
<AdminSidebarSection
key="11"
key="12"
name="site_config/public_links"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -2138,6 +2177,19 @@ exports[`components/AdminSidebar should match snapshot, with license (with all f
/>
<AdminSidebarSection
key="9"
name="out_of_office"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Out Of Office"
id="admin.sidebar.outOfOffice"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="10"
name="site_config/posts"
parentLink=""
subsection={false}
Expand All @@ -2150,7 +2202,7 @@ exports[`components/AdminSidebar should match snapshot, with license (with all f
}
/>
<AdminSidebarSection
key="10"
key="11"
name="site_config/file_sharing_downloads"
parentLink=""
subsection={false}
Expand All @@ -2163,7 +2215,7 @@ exports[`components/AdminSidebar should match snapshot, with license (with all f
}
/>
<AdminSidebarSection
key="11"
key="12"
name="site_config/public_links"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -2847,6 +2899,19 @@ exports[`components/AdminSidebar should match snapshot, with license (without an
/>
<AdminSidebarSection
key="9"
name="out_of_office"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Out Of Office"
id="admin.sidebar.outOfOffice"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="10"
name="site_config/posts"
parentLink=""
subsection={false}
Expand All @@ -2859,7 +2924,7 @@ exports[`components/AdminSidebar should match snapshot, with license (without an
}
/>
<AdminSidebarSection
key="10"
key="11"
name="site_config/file_sharing_downloads"
parentLink=""
subsection={false}
Expand All @@ -2872,7 +2937,7 @@ exports[`components/AdminSidebar should match snapshot, with license (without an
}
/>
<AdminSidebarSection
key="11"
key="12"
name="site_config/public_links"
parentLink=""
subsection={false}
Expand Down
7 changes: 7 additions & 0 deletions components/channel_layout/center_channel/center_channel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
import {Route, Switch, Redirect} from 'react-router-dom';
import classNames from 'classnames';

import $ from 'jquery';

import PermalinkView from 'components/permalink_view';
import ChannelHeaderMobile from 'components/channel_header_mobile';
import ChannelIdentifierRouter from 'components/channel_layout/channel_identifier_router';
Expand All @@ -31,6 +33,11 @@ export default class CenterChannel extends React.PureComponent {
if (this.props.location.pathname !== nextProps.location.pathname && nextProps.location.pathname.includes('/pl/')) {
this.setState({returnTo: this.props.location.pathname});
}
this.leftMargin = $('#app-content').css('margin-left');
}

componentDidUpdate() {
$('#app-content').css('margin-left', this.leftMargin);
}

render() {
Expand Down
2 changes: 2 additions & 0 deletions components/channel_view/channel_view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default class ChannelView extends React.PureComponent {
if (this.props.match.url !== nextProps.match.url) {
this.createDeferredPostView();
}
this.leftMargin = $('#app-content').css('margin-left');
}

getChannelView = () => {
Expand Down Expand Up @@ -105,6 +106,7 @@ export default class ChannelView extends React.PureComponent {
this.props.actions.goToLastViewedChannel();
}
}
$('#app-content').css('margin-left', this.leftMargin);
}

render() {
Expand Down
7 changes: 7 additions & 0 deletions components/permalink_view/permalink_view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
import {FormattedMessage, intlShape} from 'react-intl';
import {Link} from 'react-router-dom';

import $ from 'jquery';

import ChannelHeader from 'components/channel_header';
import PostView from 'components/post_view';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
Expand Down Expand Up @@ -53,6 +55,11 @@ export default class PermalinkView extends React.PureComponent {
if (this.props.match.params.postid !== nextProps.match.params.postid) {
this.doPermalinkEvent(nextProps);
}
this.leftMargin = $('#app-content').css('margin-left');
}

componentDidUpdate() {
$('#app-content').css('margin-left', this.leftMargin);
}

doPermalinkEvent = async (props) => {
Expand Down

0 comments on commit df799ca

Please sign in to comment.