-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Remove mm_config and mm_license global state from webapp (PR #6) #823
Remove mm_config and mm_license global state from webapp (PR #6) #823
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
@lieut-data feel free to ask me for another review if you apply new changes and you think that changes needs review. 🙂 |
63764ad
to
fc39403
Compare
Thanks, @jespino! I've rebased and removed the unnecessary |
* Migrate a few OAuth actions from webapp * Update src/actions/integrations.js Co-Authored-By: cometkim <[email protected]>
* Migrate a few OAuth actions from webapp * Update src/actions/integrations.js Co-Authored-By: cometkim <[email protected]>
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
andmm_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
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passedRelated PRs
#816
#819
#820
#821
#822