Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Improve group email settings UI #13083
FEATURE: Improve group email settings UI #13083
Changes from all commits
5827a5d
9cd0d84
b16199e
cd79a79
fcc986c
0f3b35f
67f9069
630751e
785380d
433a838
cb6ac05
7a18f4e
e4305b7
da9051e
f5c4f42
8998fda
95def36
0396a19
2abf99a
bb2b4c1
26819fc
3201f8c
e18cab5
8e14aa0
cfffcef
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Same comment about using a buffered proxy can be applied to this component too. Simply use a buffered proxy to hold the "dirty" state of the object and commit the changes to the object after the request to the server succeeded (or replace object entirely with server's response and reset the buffer).
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.
Are you talking about this with the buffered proxy? Seems like we only use it in one place, and I am not sure what the benefit is over using just a simple object to shadow these properties?
discourse/app/assets/javascripts/discourse/app/controllers/reorder-categories.js
Lines 17 to 22 in da9051e
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 use it in many places via
bufferedProperty
. One recent place I used is in thecreate-invite
modal where the use case is similar.The biggest benefit I find is that you can achieve more with less code, but I guess there are other benefits such as the initial object never being "dirty" - in most cases it will be an exact copy of what is on the server and that you do not have to copy the value of the properties and keep them up-to-date when they are updated in the original object.
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 am not sure if this will come back to bite me...I think if all the acceptance tests pass it should be OK
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.
Well they ran okay! As a little more context I wanted to test a bad response here:
https://github.com/discourse/discourse/pull/13083/files#diff-785a91ce827d2667a7e90342377d3f89c3e8c6715f8f75a5efc9894f41fb479dR201-R206
But if I just did that the actual error was thrown and stopped the tests, even though the popup shows the message :/