Skip to content

Commit 177a741

Browse files
authored
Merge pull request #2621 from benderl/standard-legacy-plans
fix toggling plans
2 parents 5fb1327 + cff7c43 commit 177a741

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

packages/modules/web_themes/standard_legacy/web/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ <h3 class="mb-0">Termine Zeitladen</h3>
584584
<span class="charge-point-time-charge-name">--</span>
585585
</div>
586586
<div class="col-lg-6 text-right">
587-
<span class="charge-point-time-charge-pill charge-point-time-charge-active cursor-pointer border rounded p-1">
587+
<span class="charge-point-time-charge-pill cursor-pointer border rounded p-1">
588588
<span class="charge-point-time-charge-frequency">
589589
<i class="fas fa-calendar-alt"></i>
590590
<span class="charge-point-time-charge-frequency-value">--</span>
@@ -1000,7 +1000,7 @@ <h3 class="mb-0">Einstellungen für "Ziel"</h3>
10001000
<span class="charge-point-schedule-name">--</span>
10011001
</div>
10021002
<div class="col-lg-6 text-right">
1003-
<span class="charge-point-schedule-plan-pill charge-point-schedule-active cursor-pointer border rounded p-1">
1003+
<span class="charge-point-schedule-plan-pill cursor-pointer border rounded p-1">
10041004
<span class="charge-point-schedule-frequency">
10051005
<i class="fas fa-calendar-alt"></i>
10061006
<span class="charge-point-schedule-frequency-value">--</span>
@@ -1637,7 +1637,7 @@ <h4 class="modal-title">
16371637
const object = "chargeTemplate";
16381638
const objectPath = "time_charging.plans." + planId + ".active";
16391639
const topic = "openWB/set/chargepoint/" + chargePointIndex + "/set/charge_template";
1640-
const option = !$(this).hasClass('charge-point-time-charge-active');
1640+
const option = !$(this).hasClass('charge-point-plan-pill-active');
16411641
if (typeof window[object] !== undefined && window[object][chargePointIndex] !== undefined) {
16421642
let currentObjectState = JSON.parse(JSON.stringify(window[object][chargePointIndex]));
16431643
currentObjectState = updateObject(currentObjectState, objectPath, option);
@@ -1670,7 +1670,7 @@ <h4 class="modal-title">
16701670
const object = "chargeTemplate";
16711671
const objectPath = "chargemode.scheduled_charging.plans." + planId + ".active";
16721672
const topic = "openWB/set/chargepoint/" + chargePointIndex + "/set/charge_template";
1673-
const option = !$(this).hasClass('charge-point-schedule-active');
1673+
const option = !$(this).hasClass('charge-point-plan-pill-active');
16741674
if (typeof window[object] !== undefined && window[object][chargePointIndex] !== undefined) {
16751675
let currentObjectState = JSON.parse(JSON.stringify(window[object][chargePointIndex]));
16761676
currentObjectState = updateObject(currentObjectState, objectPath, option);

packages/modules/web_themes/standard_legacy/web/processAllMqttMsg.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,9 @@ function refreshChargeTemplate(chargePointIndex) {
303303
}
304304
schedulePlanElement.find('.charge-point-schedule-time').text(value.time);
305305
if (value.active == true) {
306-
schedulePlanElement.find('.charge-point-schedule-active').removeClass('alert-danger border-danger');
307-
schedulePlanElement.find('.charge-point-schedule-active').addClass('alert-success border-success');
306+
schedulePlanElement.find('.charge-point-schedule-plan-pill').addClass('charge-point-plan-pill-active');
308307
} else {
309-
schedulePlanElement.find('.charge-point-schedule-active').removeClass('alert-success border-success');
310-
schedulePlanElement.find('.charge-point-schedule-active').addClass('alert-danger border-danger');
308+
schedulePlanElement.find('.charge-point-schedule-plan-pill').removeClass('charge-point-plan-pill-active');
311309
}
312310
switch (value.frequency.selected) {
313311
case "once":
@@ -383,11 +381,9 @@ function refreshChargeTemplate(chargePointIndex) {
383381
timeChargePlanElement.find('.charge-point-time-charge-name').text(value.name);
384382
timeChargePlanElement.find('.charge-point-time-charge-time').text(value.time[0] + " - " + value.time[1]);
385383
if (value.active == true) {
386-
timeChargePlanElement.find('.charge-point-time-charge-active').removeClass('alert-danger border-danger');
387-
timeChargePlanElement.find('.charge-point-time-charge-active').addClass('alert-success border-success');
384+
timeChargePlanElement.find('.charge-point-time-charge-pill').addClass('charge-point-plan-pill-active');
388385
} else {
389-
timeChargePlanElement.find('.charge-point-time-charge-active').removeClass('alert-success border-success');
390-
timeChargePlanElement.find('.charge-point-time-charge-active').addClass('alert-danger border-danger');
386+
timeChargePlanElement.find('.charge-point-time-charge-pill').removeClass('charge-point-plan-pill-active');
391387
}
392388
if (value.limit.selected == "soc") {
393389
timeChargePlanElement.find('.charge-point-time-charge-limit').removeClass('hide');

packages/modules/web_themes/standard_legacy/web/style.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,20 @@ body>.container {
145145
text-decoration: line-through;
146146
}
147147

148+
.charge-point-schedule-plan-pill,
149+
.charge-point-time-charge-pill {
150+
border-color: #dc3545!important;
151+
color: #721c24;
152+
background-color: #f8d7da;
153+
}
154+
155+
.charge-point-schedule-plan-pill.charge-point-plan-pill-active,
156+
.charge-point-time-charge-pill.charge-point-plan-pill-active {
157+
border-color: #28a745!important;
158+
color: #155724;
159+
background-color: #d4edda;
160+
}
161+
148162
.text-green {
149163
color: #006515;
150164
}

0 commit comments

Comments
 (0)