Introduce Callout#358
Conversation
|
I like the design, especially the color matching border. The spacing of text and headline are well done. We should check, though, if there are elements, that have the same or a similar purpose and make sure that the design is consistent. Please make also sure, that the in this case the line breaks after max. 80 characters to ensure readability. @TheSyscall Would be nice, if you could post a screenshot of the element positioned on top of the page. |
Al2Klimov
left a comment
There was a problem hiding this comment.
Tested together with Icinga/icingaweb2#5477 (review).
|
Would love to see this feature soon, so I don't have to create an own callout widget for Icinga/icingaweb2#5430. |
jrauh01
left a comment
There was a problem hiding this comment.
Just some minor phpdocs adjustments.
lippserd
left a comment
There was a problem hiding this comment.
According #358 (comment):
Can you add a note in callout.less that this is a known limitation and max-width is not used in purpose?
setFullWidth(true) and setFormElement(true) can both be applied to the same instance with no documented combined behavior. In the LESS file, both modifiers declare width at equal specificity, so whichever declaration appears last in the stylesheet wins. Is this intentional? Shouldn't this be a mode setter which sets one class exclusively?
| 'div', | ||
| ['class' => 'callout-text'], | ||
| [ | ||
| $this->title !== null |
There was a problem hiding this comment.
An empty string title renders a <strong class="callout-title"></strong> with no visible content. Consider adding a trim() !== '' check as in https://github.com/Icinga/ipl-validator/blob/main/src/RegexMatchValidator.php#L36. Also add a test for this. You could also create a PR in ipl-stdlib which adds Str::isEmpty() for future use.
There was a problem hiding this comment.
Implemented Str::isEmpty() in Icinga/ipl-stdlib#77.
Tests don't pass because of this.
Implement a callout box element that can be used to convey important information to the user. This element is designed to be used above certain form elements, or over the whole form or page.
Co-authored-by: jrauh01 <id4jojo@gmail.com>
Co-authored-by: jrauh01 <id4jojo@gmail.com>
Change setFullwidth to setFullWidth Co-authored-by: jrauh01 <johannes.rauh@icinga.com>
Co-authored-by: jrauh01 <johannes.rauh@icinga.com>
This allows for a title with a string that evaluates to a falsy value
Co-authored-by: jrauh01 <johannes.rauh@icinga.com>
Removed Changed the default behavior to be full-width and renamed the function to change it to |



Implement a callout box element that can be used to convey important information to the user.
This element is designed to be used above certain form elements, over the whole form or page.
It seems like the use of callout could conflict with the existing
FormDescriptionandFormNotificationdecorators, at least within IW2 forms.Callouts are not meant as a direct replacement for these decorators but as a more universal ipl widget that can be used even outside of forms to convey essential information to the user.
Merging these two concepts by extending the form-notification would be a viable alternative to this PR.
Callout types:

Callout full width:

Callout with optional title:

Callout above a form element:

closes #349
requires Icinga/ipl-stdlib#77