Skip to content

Commit 22e6d05

Browse files
committed
fix(ui): Make scenario table responsive in campaign edition, place dataset under the title
1 parent 0fddac4 commit 22e6d05

File tree

2 files changed

+42
-37
lines changed

2 files changed

+42
-37
lines changed

chutney/ui/src/app/modules/campaign/components/create-campaign/campaign-edition.component.html

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -139,27 +139,21 @@ <h4 id="myCampaignLabel">
139139
<!-- Left side -->
140140
<div class="col-md-6">
141141
<table class="table table-striped table-hover">
142-
<thead class="w-100">
143-
<th class="w-100 d-flex justify-content-between">
144-
<div>
145-
{{ 'campaigns.edition.scenarios.title' | translate }}
146-
</div>
147-
<div class="text-center dataset-header">
148-
@if (datasets.length > 0) {
149-
Dataset
150-
}
151-
</div>
142+
<thead>
143+
<th colspan="2">
144+
{{ 'campaigns.edition.scenarios.title' | translate }}
152145
</th>
146+
<th></th>
153147
</thead>
154148
<tbody dragula="DRAGGABLE" [(dragulaModel)]="scenariosToAdd">
155149
@for (scenario of scenariosToAdd; track scenario) {
156-
<tr class="cursor w-100">
157-
<td class="w-100">
158-
<div class="w-100 d-flex justify-content-between align-items-center flex-wrap">
159-
<div class="d-flex flex-row">
160-
<div class="text-nowrap me-4">{{scenario?.scenarioId.id}}</div>
161-
<div class="scenario-title-cell w-100 me-2">{{scenario?.scenarioId.title}}</div>
162-
</div>
150+
<tr class="cursor">
151+
<td>
152+
<div class="text-nowrap">{{scenario?.scenarioId.id}}</div>
153+
</td>
154+
<td class="d-flex flex-column">
155+
<div class="d-flex flex-columns mb-2">
156+
<div class="scenario-title-cell">{{scenario?.scenarioId.title}}</div>
163157
<div class="p-0">
164158
@if (jiraMap.has(scenario.id)) {
165159
<span
@@ -179,24 +173,24 @@ <h4 id="myCampaignLabel">
179173
</a>
180174
}
181175
</div>
182-
<div class="p-0 me-2">
183-
@if (datasets.length > 0) {
184-
<ng-multiselect-dropdown
185-
[settings]="dropdownDatasetSettings"
186-
class="dataset-combo"
187-
[placeholder]="'campaigns.edition.selectDatasetScenario' | translate"
188-
[data]="datasets"
189-
[ngModel]="scenario.dataset === null ? [] : [scenario.dataset]"
190-
[ngModelOptions]="{standalone: true}"
191-
(onSelect)="selectDatasetScenario($event, scenario)"
192-
(onDeSelect)="deselectDatasetScenario(scenario)">
193-
</ng-multiselect-dropdown>
194-
}
195-
</div>
176+
</div>
177+
<div class="pe-5">
178+
@if (datasets.length > 0) {
179+
<ng-multiselect-dropdown
180+
[settings]="dropdownDatasetSettings"
181+
class="dataset-combo w-100"
182+
[placeholder]="'campaigns.edition.selectDatasetScenario' | translate"
183+
[data]="datasets"
184+
[ngModel]="scenario.dataset === null ? [] : [scenario.dataset]"
185+
[ngModelOptions]="{standalone: true}"
186+
(onSelect)="selectDatasetScenario($event, scenario)"
187+
(onDeSelect)="deselectDatasetScenario(scenario)">
188+
</ng-multiselect-dropdown>
189+
}
196190
</div>
197191
</td>
198-
<td>
199-
<button type="button" class="btn btn-outline-primary btn-sm "
192+
<td class="p-0">
193+
<button type="button" class="btn btn-outline-primary btn-sm me-2"
200194
(click)="removeScenario(scenario)">
201195
<span class="fa fa-arrow-circle-right"></span>
202196
</button>

chutney/ui/src/app/modules/campaign/components/create-campaign/campaign-edition.component.scss

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ span.search-field {
3434
}
3535

3636

37-
.dataset-header {
38-
margin-right: 100px;
39-
}
40-
4137
fieldset {
4238
width: 100%;
4339
}
@@ -104,3 +100,18 @@ fieldset legend {
104100
min-width:200px;
105101
display: inline-block;
106102
}
103+
104+
::ng-deep ng-multiselect-dropdown .multiselect-dropdown .dropdown-btn {
105+
.selected-item-container {
106+
width: 95%;
107+
108+
.selected-item {
109+
min-width: fit-content;
110+
111+
span {
112+
word-break: break-all;
113+
padding-right: 10px;
114+
}
115+
}
116+
}
117+
}

0 commit comments

Comments
 (0)