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.
jrauh01
left a comment
There was a problem hiding this comment.
Consider adding unit tests. Otherwise this looks good now.
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.
Removed Changed the default behavior to be full-width and renamed the function to change it to |
lippserd
left a comment
There was a problem hiding this comment.
Looks good. I will approve once you have cleaned up your commits.
lippserd
left a comment
There was a problem hiding this comment.
Looks good. I will approve once you have cleaned up your commits.
Wait a moment :). Please don’t use Str::isEmpty() in this PR. We can do this later. Else, this PR would require an stdlib release and a composer.json raise.
929fc7c to
109f841
Compare
Reverted the use of |
Introduces a Callout widget that renders an information box with a bordered, tinted background and icon determined by its CalloutType (Info, Success, Warning, Error). Supports an optional title and a fit-content sizing mode. Includes LESS variables for theming, and unit tests.
commits were cleaned up and the requested change applied
For event rules of generic sources a simple `SearchEditor` without enrichment, validation and suggestions is created. resolve #450 require Icinga/ipl-web#384 require Icinga/ipl-web#358



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