-
Notifications
You must be signed in to change notification settings - Fork 150
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
Stop showing scheduled deletions on unrelated channels #3041
Stop showing scheduled deletions on unrelated channels #3041
Conversation
…sn't match and rule scheduled changes channel is null
…uled change channel is null
ui/src/utils/rules.js
Outdated
? (rule.channel && | ||
ruleChannelMatches && | ||
rule.scheduledChange.channel === null) || | ||
(!rule.channel && rule.scheduledChange.channel === null) || |
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.
This appears to work, but I'm suspicious that something subtle is off here. I was expecting rule.scheduledChange.change_type === 'delete'
to be treated specially - not to have all scheduled change types have this logic applied. For change_type
=== update
or insert
the channel should be matching if either the rule
or rule.scheduledChange
channel matches.
Could you try to make this a bit more clear? Feel free to drop the const
on scChannelMatches
and write this as if/else statements if it helps.
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 wasn't sure whether to query for the change type initially or just make the function work for all scheduled changes. I appreciate the feedback and I'll work on making it clear.
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.
This looks good, and my local testing can't find any cases that are displaying incorrectly. Thank you!
Fixes #2312: