Skip to content

Commit ec53c8a

Browse files
raviks789nilmerg
authored andcommitted
Handle long item names
1 parent af4b98f commit ec53c8a

File tree

4 files changed

+62
-10
lines changed

4 files changed

+62
-10
lines changed

library/Businessprocess/Renderer/Breadcrumb.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Icinga\Module\Businessprocess\Web\Url;
88
use ipl\Html\BaseHtmlElement;
99
use ipl\Html\Html;
10+
use ipl\Html\HtmlElement;
1011
use ipl\Web\Widget\Icon;
1112

1213
class Breadcrumb extends BaseHtmlElement
@@ -42,7 +43,11 @@ public static function create(Renderer $renderer)
4243
)
4344
));
4445
$breadcrumb->add(Html::tag('li')->add(
45-
Html::tag('a', ['href' => $bpUrl], $bp->getTitle())
46+
Html::tag(
47+
'a',
48+
['href' => $bpUrl],
49+
HtmlElement::create('span', ['class' => 'text', 'title' => $bp->getTitle()], $bp->getTitle())
50+
)
4651
));
4752
$path = $renderer->getCurrentPath();
4853

library/Businessprocess/Renderer/TileRenderer/NodeTile.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Icinga\Web\Url;
1212
use ipl\Html\BaseHtmlElement;
1313
use ipl\Html\Html;
14+
use ipl\Html\HtmlElement;
1415
use ipl\Web\Widget\Icon;
1516
use ipl\Web\Widget\StateBall;
1617

@@ -87,6 +88,14 @@ public function render()
8788
if (! $node instanceof ImportedNode || $node->getBpConfig()->hasNode($node->getName())) {
8889
$link = $this->getMainNodeLink();
8990
if ($renderer->isBreadcrumb()) {
91+
$link->setContent(
92+
HtmlElement::create(
93+
'span',
94+
['class' => ['text', 'process-title'], 'title' => $link->getContent()],
95+
$link->getContent()
96+
)
97+
);
98+
9099
$state = strtolower($node->getStateName());
91100
if ($node->isHandled()) {
92101
$state = $state . ' handled';

library/Businessprocess/Web/Component/BpDashboardTile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function __construct(BpConfig $bp, $title, $description, $icon, $url, $ur
2222
'div',
2323
['class' => 'bp-link', 'data-base-target' => '_main'],
2424
(new Link(new Icon($icon), Url::fromPath($url, $urlParams ?: []), $attributes))
25-
->add(Html::tag('span', ['class' => 'header'], $title))
26-
->add($description)
25+
->add(Html::tag('span', ['class' => ['header', 'text']], $title))
26+
->add(Html::tag('span', ['class' => 'text', 'title' => $description], $description))
2727
));
2828

2929
$tiles = Html::tag('div', ['class' => 'bp-root-tiles']);

public/css/module.less

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ ul.broken-files {
344344
}
345345

346346
.bp-link {
347+
.text {
348+
.line-clamp(2);
349+
}
350+
347351
> a {
348352
text-decoration: none;
349353
color: @gray;
@@ -354,6 +358,12 @@ ul.broken-files {
354358

355359
> span.header {
356360
color: @text-color;
361+
362+
.header-id {
363+
display: block;
364+
max-width: 100%;
365+
.text-ellipsis();
366+
}
357367
}
358368
}
359369
}
@@ -450,7 +460,8 @@ td > a > .state-badges {
450460
.tiles > div {
451461
color: @text-color-on-icinga-blue;
452462
width: 12em;
453-
display: inline-block;
463+
display: flex;
464+
flex-direction: column;
454465
float: left;
455466
vertical-align: top;
456467
margin-right: 0.2em;
@@ -464,11 +475,8 @@ td > a > .state-badges {
464475
}
465476

466477
.state-badges {
467-
position: absolute;
468-
bottom: 0;
469-
right: 0;
478+
text-align: end;
470479
margin: 0.5em;
471-
text-align: center;
472480
font-size: 0.5em;
473481
}
474482

@@ -483,13 +491,14 @@ td > a > .state-badges {
483491

484492
> a,
485493
.missing-node-msg {
486-
display: block;
487494
text-decoration: none;
488495
font-size: 0.7em;
489496
text-align: center;
490-
padding: 1em 1em 0;
497+
padding: 0 1em;
491498
font-weight: bold;
492499
word-wrap: break-word;
500+
.text-ellipsis-multiline();
501+
.line-clamp(2);
493502
}
494503

495504
.missing-node-msg {
@@ -639,6 +648,7 @@ td > a > .state-badges {
639648
color: @icinga-blue;
640649
margin: 0;
641650
font-size: 1.2em;
651+
max-width: 10em;
642652
text-decoration: none;
643653
padding-left: 2em;
644654
line-height: 2.5em;
@@ -742,6 +752,22 @@ td > a > .state-badges {
742752
text-decoration: underline;
743753
}
744754

755+
.text {
756+
display: block;
757+
.text-ellipsis-multiline();
758+
}
759+
760+
.breadcrumb li a {
761+
.process-title {
762+
margin-top: -2.5em;
763+
margin-left: 1.2em;
764+
}
765+
766+
.text {
767+
.line-clamp(1);
768+
}
769+
}
770+
745771
#layout.twocols, #layout.layout-minimal, div.compact {
746772
.breadcrumb {
747773
font-size: 0.833em;
@@ -750,6 +776,18 @@ td > a > .state-badges {
750776

751777
/** END of breadcrumb **/
752778

779+
.tiles .process-node {
780+
justify-content: space-between;
781+
}
782+
783+
.tiles .monitored-node {
784+
padding-bottom: 1.5em;
785+
786+
> a {
787+
margin-top: auto;
788+
margin-bottom: auto;
789+
}
790+
}
753791

754792
ul.error, ul.warning {
755793
padding: 0;

0 commit comments

Comments
 (0)