-
Notifications
You must be signed in to change notification settings - Fork 0
ChannelForm: Show message intead of stacktrace when no channel type found #290
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
base: main
Are you sure you want to change the base?
Conversation
@sukhwinder33445 I feel like it looks kinda weird with the current implementation, as it still shows the name input, even though there's no submit button or the like. What if you moved the result check to the top of the assemble method? I think this would correlate with our philosophy of having early breakouts if required data is not provided to a method. And adding the check and early return to the top of the method would result in this representation: The displayed message is also missing a dot ( Keep in mind that I only wondered about the reasoning for this exact implementation, this isn't really a suggestion. But if you do feel like it would improve the UI, feel free to change it. Will do a proper review after your comment on this topic :) |
Our actual philosophy on this topic is not allowing access to a form at all. i.e. to disable the button that leads to it and adding a title to explain why. |
6152779
to
c7e057e
Compare
…or to hide the button but still explain why if there is no contextual hint. |
c7e057e
to
60c1a94
Compare
8f0da55
to
a69c7a4
Compare
application/forms/ChannelForm.php
Outdated
->execute(); | ||
|
||
if (! $query->hasResult()) { | ||
throw new IcingaException('No channel types available. Make sure Icinga Notifications is running.'); |
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.
Throw a ConfigurationError
instead.
@@ -112,7 +120,7 @@ public function addAction() | |||
$form->getValue('name') | |||
) | |||
); | |||
$this->redirectNow(Links::channels()); | |||
$this->redirectNow('__CLOSE__'); |
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->redirectNow('__CLOSE__'); | |
$this->switchToSingleColumnLayout(); |
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.
Moved this change to #301.
10d36d1
to
0e3e60d
Compare
0e3e60d
to
9238dc4
Compare
…channel found ChannelForm: Throw exception in case user access the form via url
9238dc4
to
9fc7837
Compare
fixes #225
Requires:
.action-link
andbutton-link
css icingaweb2#5370