Skip to content

Commit

Permalink
[MM-16541] Remove perfect-scrollbar package (mattermost#4382)
Browse files Browse the repository at this point in the history
* Remove all usages of perfect scrollbar

* Remove perfect scrollbar from package.json
  • Loading branch information
fmunshi authored and hmhealey committed Dec 4, 2019
1 parent a7b38a1 commit 2bae672
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 87 deletions.
33 changes: 0 additions & 33 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1755,39 +1755,6 @@ Generic build of Mozilla's PDF.js library.

---

## perfect-scrollbar

This product contains 'perfect-scrollbar' by Hyunje Jun.

Minimalistic but perfect custom scrollbar plugin

* HOMEPAGE:
* https://github.com/utatti/perfect-scrollbar#readme

* LICENSE: MIT

The MIT License (MIT) Copyright (c) 2012-2017 Hyunje Jun and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

## popmotion

This product contains 'popmotion' by Matt Perry.
Expand Down
5 changes: 0 additions & 5 deletions components/access_history_modal/access_history_modal.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl';

import {isMobile} from 'utils/utils.jsx';
import AuditTable from 'components/audit_table';
import LoadingScreen from 'components/loading_screen';

Expand Down Expand Up @@ -47,9 +45,6 @@ export default class AccessHistoryModal extends React.PureComponent {

onShow = () => {
this.props.actions.getUserAudits(this.props.currentUserId, 0, 200);
if (!isMobile()) {
$('.modal-body').perfectScrollbar();
}
}

onHide = () => {
Expand Down
2 changes: 0 additions & 2 deletions components/access_history_modal/access_history_modal.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import React from 'react';
import {shallow} from 'enzyme';
import $ from 'jquery';
require('perfect-scrollbar/jquery')($);

import AccessHistoryModal from 'components/access_history_modal/access_history_modal.jsx';
import AuditTable from 'components/audit_table';
Expand Down
4 changes: 0 additions & 4 deletions components/activity_log_modal/activity_log_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import React from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl';

import {isMobile} from 'utils/utils.jsx';
import ActivityLog from 'components/activity_log_modal/components/activity_log.jsx';
import LoadingScreen from 'components/loading_screen';

Expand Down Expand Up @@ -72,9 +71,6 @@ export default class ActivityLogModal extends React.PureComponent {

onShow = () => {
this.props.actions.getSessions(this.props.currentUserId);
if (!isMobile()) {
$('.modal-body').perfectScrollbar();
}
}

onHide = () => {
Expand Down
2 changes: 0 additions & 2 deletions components/activity_log_modal/activity_log_modal.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import React from 'react';
import {shallow} from 'enzyme';
import $ from 'jquery';
require('perfect-scrollbar/jquery')($);

import {General} from 'mattermost-redux/constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react';
import {Modal} from 'react-bootstrap';
Expand Down Expand Up @@ -112,10 +111,6 @@ export default class ChannelNotificationsModal extends React.PureComponent {
}

updateSection = (section = NotificationSections.NONE) => {
if ($('.section-max').length) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
}

this.setState({activeSection: section});

if (section === NotificationSections.NONE) {
Expand Down
5 changes: 0 additions & 5 deletions components/popover_list_members/popover_list_members.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react';
import {Overlay, OverlayTrigger, Tooltip} from 'react-bootstrap';
Expand Down Expand Up @@ -49,10 +48,6 @@ export default class PopoverListMembers extends React.Component {
};
}

componentDidUpdate() {
$('.member-list__popover .popover-content .more-modal__body').perfectScrollbar();
}

static getDerivedStateFromProps(nextProps, prevState) {
if (nextProps.users !== prevState.users || nextProps.statuses !== prevState.statuses) {
return {
Expand Down
1 change: 0 additions & 1 deletion components/root/root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See LICENSE.txt for license information.

import $ from 'jquery';
require('perfect-scrollbar/jquery')($);

import PropTypes from 'prop-types';
import React from 'react';
Expand Down
3 changes: 0 additions & 3 deletions components/team_general_tab/team_general_tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export default class GeneralTab extends React.Component {
}

updateSection = (section) => {
if ($('.section-max').length) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
}
this.setState(this.setupInitialState(this.props));
this.props.updateSection(section);
}
Expand Down
14 changes: 0 additions & 14 deletions components/team_settings_modal/team_settings_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,14 @@ export default class TeamSettingsModal extends React.Component {
};
}

componentDidMount() {
if (!Utils.isMobile()) {
$('.settings-modal .settings-content').perfectScrollbar();
}
}

updateTab = (tab) => {
this.setState({
activeTab: tab,
activeSection: '',
});

if (!Utils.isMobile()) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
}
}

updateSection = (section) => {
if ($('.section-max').length) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
}

this.setState({activeSection: section});
}

Expand Down
2 changes: 0 additions & 2 deletions components/team_settings_modal/team_settings_modal.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import React from 'react';
import {shallowWithIntl} from 'tests/helpers/intl-test-helper';
import TeamSettingsModal from 'components/team_settings_modal/team_settings_modal.jsx';

require('perfect-scrollbar/jquery')($);

describe('components/team_settings_modal', () => {
test('should match snapshot', () => {
const wrapper = shallowWithIntl(<TeamSettingsModal/>);
Expand Down
4 changes: 0 additions & 4 deletions components/user_settings/modal/user_settings_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ class UserSettingsModal extends React.Component {
}

componentDidUpdate(prevProps, prevState) {
if (!Utils.isMobile()) {
$('.settings-content .minimize-settings').perfectScrollbar('update');
}

if (this.state.active_tab !== prevState.active_tab) {
$(ReactDOM.findDOMNode(this.modalBodyRef.current)).scrollTop(0);
}
Expand Down
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"marked": "github:mattermost/marked#8214e10918264fb88cec474196023949f7cb4b30",
"moment-timezone": "0.5.27",
"pdfjs-dist": "2.0.489",
"perfect-scrollbar": "0.8.1",
"popmotion": "8.7.0",
"popper.js": "1.16.0",
"prop-types": "15.7.2",
Expand Down
1 change: 0 additions & 1 deletion sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Dependencies
@import '~bootstrap/dist/css/bootstrap.css';
@import '~jasny-bootstrap/dist/css/jasny-bootstrap.css';
@import '~perfect-scrollbar/dist/css/perfect-scrollbar.css';
@import '~font-awesome/css/font-awesome.css';
@import '~bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css';

Expand Down

0 comments on commit 2bae672

Please sign in to comment.