chat: Fix create post without a topic#4543
Conversation
1b3e092 to
5e01427
Compare
chrisbobbe
left a comment
There was a problem hiding this comment.
Thanks, @AlaaElden98! See a few small comments below.
Also, I think the commit message can be tightened up a bit:
chat: Fix create post without a topic
Why i did these changes?
-When the option 'require topics in stream messages' is checked,the user
shouldn't be able to post a message without a topic.
What changes:
* Store the setting in `RealmState`
* Populate it in `realmReducer`
* Add a selector for it in `directSelector`
* Add the setting to `ComposeBox` props and `connect` call,and use it
* Edit `realmReducer-test` to test the new changes
Fixes: #4378
-
One thing is that the "What changes" list duplicates what's already clear by looking at the code changes, so I think that can just be removed. 🙂 The changes are pretty small, straightforward, and unsurprising.
-
Let's give the summary line a bit more detail. How about something like, "ComposeBox: Prevent sending empty-topic messages if topics are mandatory."
-
Then, the summary line plus the
Fixes:line should pretty much answer the question of why the changes were made. So the "Why i did these changes?" section can disappear too, to leave us with the following:ComposeBox: Prevent sending empty-topic messages if topics are mandatory. Fixes: #4378That's shorter, and still gets the job done. 🙂
| twentyFourHourTime: false, | ||
| canCreateStreams: true, | ||
| isAdmin: false, | ||
| isTopicMandatory: false, |
There was a problem hiding this comment.
Let's add a dropCache migration in src/boot/store.js for this. Something like,
// Add `isTopicMandatory` to `state.realm`.
'27': dropCache,There was a problem hiding this comment.
That's new, I understand what this does, but when should I add a dropCache?
There was a problem hiding this comment.
And i think you mean '28': dropCache ? there is already
'27': state => ({ ...state, accounts: state.accounts.filter(a => a.email !== ''), }),
mandatory. Fixes: zulip#4378
5e01427 to
ffe3427
Compare
|
@chrisbobbe, Thanks for the review, the PR is ready for another one. |
|
This issue was resolved by #4798. Thanks @AlaaElden98 for your work on this! |
When the option 'require topics in stream messages' is checked,the user
shouldn't be able to post a message without a topic.
RealmStaterealmReducerdirectSelectorComposeBoxprops andconnectcall,and use itFixes: #4378