fix: Incorrect initial data not allowing edit webhooks properly#31948
fix: Incorrect initial data not allowing edit webhooks properly#31948kodiakhq[bot] merged 7 commits intoRocketChat:developfrom
Conversation
🦋 Changeset detectedLatest commit: 8d08841 The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #31948 +/- ##
===========================================
- Coverage 54.62% 54.61% -0.01%
===========================================
Files 2292 2295 +3
Lines 50540 50575 +35
Branches 10320 10327 +7
===========================================
+ Hits 27608 27623 +15
- Misses 20438 20458 +20
Partials 2494 2494
Flags with carried forward coverage won't be shown. Click here to find out more. |
dougfabris
left a comment
There was a problem hiding this comment.
Nice catch, go ahead and make the fixes on the incoming as well
|
I've changed all other fields @dougfabris, I'm assuming this is optimal, let me know if you'd prefer changing only certain fields. |
|
Hey again @dougfabris, sorry for the tag, but I made a few PRs for bug fixes. Would really appreciate a review so these tickets can be solved and closed. Thanks! |
Proposed changes (including videos or screenshots)
The logic for toggle switches in
EditIncomingWebhook.tsxandEditOutgoingWebhook.tsxisn't implemented correctly right now.enabled: webhookData?.enabled || true,will always return true, hence the switch will always be in the 'on' state.Before:
2024-03-09.18-22-03.mp4
After:
2024-03-09.18-20-54.mp4
Since the intended use is to initialize the toggle switch with
truevalue (during creation) and take the actual value when it's available,??operator would logically work best here in my opinion.Issue(s)
fixes #31943
Steps to test or reproduce
Further comments
EditIncomingWebhook.tsxhas a similar issue but there the "Enabled" value is always initialized to false (which is confusing and unnecessary). That can be fixed and merged in this pull request as well if this fix is deemed correct.I've only edited the affected fields for now, but this should ideally be done in all fields.