Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Remove mm_config and mm_license global state from webapp (PR #6) #823

Merged
merged 9 commits into from
Feb 16, 2018

Conversation

lieut-data
Copy link
Member

Summary

This is a subset of the changes in the MM-8589-remove_mm_global_license branch, broken up into multiple PRs to facilitate easier review. See any linked PRs for other changes if you're interested.

These changes, as a whole, move towards removing our dependence on the global mm_config and mm_license objects. These changes will ultimately facilitate resolving https://mattermost.atlassian.net/browse/MM-8604, allowing us to stop hard refreshing the application whenever someone makes a configuration change.

Ticket Link

https://mattermost.atlassian.net/browse/MM-8589

Checklist

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed
  • Added or updated unit tests (required for all new features)

Related PRs

#816
#819
#820
#821
#822

Copy link
Member

@jwilander jwilander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one non-blocking comment

const sendPushNotifications = config.SendPushNotifications === 'true';

return {
...ownProps,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually don't need to include ...ownProps in this return statement, the connect function handles it. I know we do it everywhere but it was a mistake that got copied/pasted everywhere before we caught it. @stephenkiers has a a PR #798 to remove them all

I'm 0/5 if you want to go through the effort of removing them here though, I'm trying to avoid being too nitpicky because of the volume of PRs coming through

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, fascinating! I'll either rip them out as part of the PRs, or go back and fix things up later depending on the volume of feedback I receive.

Copy link
Member

@jespino jespino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some comments about improvements to do, but they could be done later.

@@ -247,5 +247,6 @@ ChannelNotificationsModal.propTypes = {
onHide: PropTypes.func.isRequired,
channel: PropTypes.object.isRequired,
channelMember: PropTypes.object.isRequired,
currentUser: PropTypes.object.isRequired
currentUser: PropTypes.object.isRequired,
sendPushNotifications: PropTypes.bool.isRequired
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move the propTypes to the static propType class attribute. Not a stopper.

@@ -55,7 +57,10 @@ describe('components/navbar/Navbar', () => {
test('should match snapshot, if not licensed', () => {
global.window.mm_license.IsLicensed = 'false';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line (and similar ones in the following tests) are no longer needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there's some remaining cleanup for higher level components that makes these global assignment still necessary -- for now. Rest assured, it's all going away soon :)

@jespino
Copy link
Member

jespino commented Feb 16, 2018

@lieut-data feel free to ask me for another review if you apply new changes and you think that changes needs review. 🙂

@hmhealey hmhealey added 4: Reviews Complete All reviewers have approved the pull request Awaiting Submitter Action Blocked on the author and removed 2: Dev Review Requires review by a core commiter labels Feb 16, 2018
@lieut-data lieut-data force-pushed the MM-8589-remove_mm_global_license_config-pr-6 branch from 63764ad to fc39403 Compare February 16, 2018 15:02
@lieut-data
Copy link
Member Author

Thanks, @jespino! I've rebased and removed the unnecessary ownProps and converged on the get(Config|License) selectors. I think we're good to go, so I'll merge as soon as the build completes.

@lieut-data lieut-data merged commit 9c692bd into master Feb 16, 2018
@lieut-data lieut-data deleted the MM-8589-remove_mm_global_license_config-pr-6 branch February 16, 2018 15:31
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Feb 17, 2018
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Mar 6, 2018
hmhealey pushed a commit that referenced this pull request Aug 28, 2020
* Migrate a few OAuth actions from webapp

* Update src/actions/integrations.js

Co-Authored-By: cometkim <[email protected]>
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
* Migrate a few OAuth actions from webapp

* Update src/actions/integrations.js

Co-Authored-By: cometkim <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Awaiting Submitter Action Blocked on the author Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
6 participants