-
Notifications
You must be signed in to change notification settings - Fork 56
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
Display title of current organization in confirmation dialog #2404
Conversation
…ting delete event type
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.
Nice work! I think your solution is very clever, but I don't think we need to be that clever. Could we try to simplify the solution?
deleteMessage: m<{ eventType: string }>( | ||
'Are you sure you want to delete the "{eventType}" event type for the whole organization?' | ||
currentDefaultOrgMsg: m('the current organization'), | ||
deleteMessage: m<{ eventType: string; orgTitle: string }>( |
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.
Changing a message like this (adding properties) is risky, because there might be translations that don't include the property. I think we should give the message a new name.
@@ -250,6 +253,7 @@ const EventTypeAutocomplete: FC<EventTypeAutocompleteProps> = ({ | |||
}, | |||
warningText: messages.type.deleteMessage({ | |||
eventType: option.title, | |||
orgTitle: orgTitle ? orgTitle : currentDefaultOrgMsg, |
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.
Under no normal circumstances should orgTitle
be undefined
on this page. If it is, it should be temporary (while loading) and I'm thinking we can fallback to an empty string or something. That way, we don't need to have two separate messages.
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.
The preview build works as expected and the code looks good as well. Nice work! 💯
Description
This PR displays the name of the current organization in the confirmation dialog on selecting delete event type from an event.
Screenshots
Changes
Notes to reviewer
Not at all sure this is a good solution, even if it seems to work as intended on my end. If not, I would be happy for a hint about the right direction.
Related issues
Resolves #2400