Skip to content

Commit 438395f

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

File tree

4 files changed

+64
-10
lines changed

4 files changed

+64
-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: 47 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,14 @@ ul.broken-files {
354358

355359
> span.header {
356360
color: @text-color;
361+
362+
.header-id {
363+
display: block;
364+
white-space: nowrap;
365+
overflow: hidden;
366+
text-overflow: ellipsis;
367+
max-width: 100%;
368+
}
357369
}
358370
}
359371
}
@@ -450,7 +462,8 @@ td > a > .state-badges {
450462
.tiles > div {
451463
color: @text-color-on-icinga-blue;
452464
width: 12em;
453-
display: inline-block;
465+
display: flex;
466+
flex-direction: column;
454467
float: left;
455468
vertical-align: top;
456469
margin-right: 0.2em;
@@ -464,11 +477,8 @@ td > a > .state-badges {
464477
}
465478

466479
.state-badges {
467-
position: absolute;
468-
bottom: 0;
469-
right: 0;
480+
text-align: end;
470481
margin: 0.5em;
471-
text-align: center;
472482
font-size: 0.5em;
473483
}
474484

@@ -483,13 +493,14 @@ td > a > .state-badges {
483493

484494
> a,
485495
.missing-node-msg {
486-
display: block;
487496
text-decoration: none;
488497
font-size: 0.7em;
489498
text-align: center;
490-
padding: 1em 1em 0;
499+
padding: 0 1em;
491500
font-weight: bold;
492501
word-wrap: break-word;
502+
.text-ellipsis();
503+
.line-clamp(2);
493504
}
494505

495506
.missing-node-msg {
@@ -639,6 +650,7 @@ td > a > .state-badges {
639650
color: @icinga-blue;
640651
margin: 0;
641652
font-size: 1.2em;
653+
max-width: 10em;
642654
text-decoration: none;
643655
padding-left: 2em;
644656
line-height: 2.5em;
@@ -742,6 +754,22 @@ td > a > .state-badges {
742754
text-decoration: underline;
743755
}
744756

757+
.text {
758+
display: block;
759+
.text-ellipsis();
760+
}
761+
762+
.breadcrumb li a {
763+
.process-title {
764+
margin-top: -2.5em;
765+
margin-left: 1.2em;
766+
}
767+
768+
.text {
769+
.line-clamp(1);
770+
}
771+
}
772+
745773
#layout.twocols, #layout.layout-minimal, div.compact {
746774
.breadcrumb {
747775
font-size: 0.833em;
@@ -750,6 +778,18 @@ td > a > .state-badges {
750778

751779
/** END of breadcrumb **/
752780

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

754794
ul.error, ul.warning {
755795
padding: 0;

0 commit comments

Comments
 (0)