Skip to content

Commit 4499ab1

Browse files
committed
1 warning message, update link button
1 parent 9422c2a commit 4499ab1

File tree

4 files changed

+30
-81
lines changed

4 files changed

+30
-81
lines changed

packages/modules/web_themes/koala/source/src/components/ChargePointScheduledPlanDetails.vue

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
<q-space />
99
<q-btn icon="close" flat round dense v-close-popup />
1010
</div>
11-
<BaseMessage
12-
:show-message="isTemporaryPlan"
13-
message="Temporärer Plan. Der Plan wird nach dem Abstecken verworfen."
14-
type="warning"
15-
/>
1611
<BaseMessage
1712
:show-message="temporaryChargeModeActive"
1813
message="Temporärer Modus aktiv. Alle Planänderungen werden nach dem Abstecken verworfen."
@@ -249,23 +244,22 @@
249244
color="positive"
250245
/>
251246
</div>
252-
<div v-if="temporaryChargeModeActive" class="row q-mt-lg">
247+
<div class="row q-mt-lg">
253248
<q-btn
254249
size="sm"
255250
class="col"
256-
color="warning"
257-
:href="`/openWB/web/settings/#/VehicleConfiguration/charge_template/${chargeTemplateId ?? ''}`"
258-
><q-icon left size="xs" name="settings" /> Ladeplan
259-
Einstellungen</q-btn
251+
color="negative"
252+
@click="removeScheduledChargingPlan(plan.id)"
253+
>Plan löschen</q-btn
260254
>
261255
</div>
262-
<div class="row q-mt-md">
256+
<div v-if="temporaryChargeModeActive" class="row q-mt-md">
263257
<q-btn
264258
size="sm"
265-
class="col"
266-
color="negative"
267-
@click="removeScheduledChargingPlan(plan.id)"
268-
>Plan löschen</q-btn
259+
class="col charge-plan-link-button"
260+
:href="`/openWB/web/settings/#/VehicleConfiguration/charge_template/${chargeTemplateId ?? ''}`"
261+
><q-icon left size="xs" name="settings" /> persistente Ladeplan
262+
Einstellungen</q-btn
269263
>
270264
</div>
271265
</q-card-section>
@@ -455,15 +449,6 @@ const removeScheduledChargingPlan = (planId) => {
455449
emit('close');
456450
};
457451
458-
const PermanentScheduledChargingPlansIds = computed(() =>
459-
mqttStore
460-
.vehicleScheduledChargingPlansPermanent(props.chargePointId)
461-
.map((plan) => plan.id),
462-
);
463-
const isTemporaryPlan = computed(
464-
() => !PermanentScheduledChargingPlansIds.value.includes(props.plan.id),
465-
);
466-
467452
const temporaryChargeModeActive = computed(
468453
() => mqttStore.temporaryChargeModeAktiv ?? false,
469454
);
@@ -484,6 +469,11 @@ const chargeTemplateId = computed(
484469
font-size: 10px !important;
485470
}
486471
472+
.charge-plan-link-button {
473+
background-color: var(--q-charge-plan-link-button);
474+
color: white;
475+
}
476+
487477
.flex-grow {
488478
flex-grow: 1;
489479
}

packages/modules/web_themes/koala/source/src/components/ChargePointTimeChargingPlanDetails.vue

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
<q-space />
99
<q-btn icon="close" flat round dense v-close-popup />
1010
</div>
11-
<BaseMessage
12-
:show-message="isTemporaryPlan"
13-
message="Temporärer Plan. Der Plan wird nach dem Abstecken verworfen."
14-
type="warning"
15-
/>
1611
<BaseMessage
1712
:show-message="temporaryChargeModeActive"
1813
message="Temporärer Modus aktiv. Alle Planänderungen werden nach dem Abstecken verworfen."
@@ -182,23 +177,22 @@
182177
<div class="text-body2">kWh</div>
183178
</template>
184179
</q-input>
185-
<div v-if="temporaryChargeModeActive" class="row q-mt-lg">
180+
<div class="row q-mt-lg">
186181
<q-btn
187182
size="sm"
188183
class="col"
189-
color="warning"
190-
:href="`/openWB/web/settings/#/VehicleConfiguration/charge_template/${chargeTemplateId ?? ''}`"
191-
><q-icon left size="xs" name="settings" /> Ladeplan
192-
Einstellungen</q-btn
184+
color="negative"
185+
@click="removeTimeChargingPlan(plan.id)"
186+
>Plan löschen</q-btn
193187
>
194188
</div>
195-
<div class="row q-mt-md">
189+
<div v-if="temporaryChargeModeActive" class="row q-mt-md">
196190
<q-btn
197191
size="sm"
198-
class="col"
199-
color="negative"
200-
@click="removeTimeChargingPlan(plan.id)"
201-
>Plan löschen</q-btn
192+
class="col charge-plan-link-button"
193+
:href="`/openWB/web/settings/#/VehicleConfiguration/charge_template/${chargeTemplateId ?? ''}`"
194+
><q-icon left size="xs" name="settings" /> persistente Ladeplan
195+
Einstellungen</q-btn
202196
>
203197
</div>
204198
</q-card-section>
@@ -319,16 +313,6 @@ const acChargingEnabled = computed(
319313
() => mqttStore.chargePointChargeType(props.chargePointId).value === 'AC',
320314
);
321315
322-
const PermanentTimeChargingPlansIds = computed(() =>
323-
mqttStore
324-
.vehicleTimeChargingPlansPermanent(props.chargePointId)
325-
.map((plan) => plan.id),
326-
);
327-
328-
const isTemporaryPlan = computed(
329-
() => !PermanentTimeChargingPlansIds.value.includes(props.plan.id),
330-
);
331-
332316
const temporaryChargeModeActive = computed(
333317
() => mqttStore.temporaryChargeModeAktiv ?? false,
334318
);
@@ -355,6 +339,11 @@ const removeTimeChargingPlan = (planId: number) => {
355339
font-size: 10px !important;
356340
}
357341
342+
.charge-plan-link-button {
343+
background-color: var(--q-charge-plan-link-button);
344+
color: white;
345+
}
346+
358347
.flex-grow {
359348
flex-grow: 1;
360349
}

packages/modules/web_themes/koala/source/src/css/quasar.variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ $battery-fill: #ba712833;
4949
$battery-fill-flow-diagram: #c6a583;
5050
$charge-point-stroke: #5c93d1;
5151
$charge-point-fill: #5c93d14d;
52+
$charge-plan-link-button: #6b757d;
5253
// Light theme (default)
5354
:root {
5455
--q-primary: #{$primary};
@@ -78,6 +79,7 @@ $charge-point-fill: #5c93d14d;
7879
--q-battery-fill-flow-diagram: #{$battery-fill-flow-diagram};
7980
--q-charge-point-stroke: #{$charge-point-stroke};
8081
--q-charge-point-fill: #{$charge-point-fill};
82+
--q-charge-plan-link-button: #{$charge-plan-link-button};
8183

8284
// Main background
8385
background-color: var(--q-background-1);

packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,21 +1944,6 @@ export const useMqttStore = defineStore('mqtt', () => {
19441944
});
19451945
};
19461946

1947-
/**
1948-
* Get permanent time charging plan/s identified by the charge point id
1949-
* @param chargePointId charge point id
1950-
* @returns TimeChargingPlan[]
1951-
*/
1952-
const vehicleTimeChargingPlansPermanent = (chargePointId: number) => {
1953-
const templateId =
1954-
chargePointConnectedVehicleChargeTemplate(chargePointId).value?.id;
1955-
const plans = getValue.value(
1956-
`openWB/vehicle/template/charge_template/${templateId}`,
1957-
'time_charging.plans',
1958-
) as TimeChargingPlan[] | undefined;
1959-
return Array.isArray(plans) ? plans : [];
1960-
};
1961-
19621947
/**
19631948
* Get or set the limit selected mode for the time charging plan identified by the time charging plan id
19641949
* @param chargePointId charge point id
@@ -2707,21 +2692,6 @@ export const useMqttStore = defineStore('mqtt', () => {
27072692
}
27082693
}
27092694

2710-
/**
2711-
* Get permanent scheduled charging plan/s identified by the charge point id
2712-
* @param chargePointId charge point id
2713-
* @returns ScheduledChargingPlan[]
2714-
*/
2715-
const vehicleScheduledChargingPlansPermanent = (chargePointId: number) => {
2716-
const templateId =
2717-
chargePointConnectedVehicleChargeTemplate(chargePointId).value?.id;
2718-
const plans = getValue.value(
2719-
`openWB/vehicle/template/charge_template/${templateId}`,
2720-
'chargemode.scheduled_charging.plans',
2721-
) as ScheduledChargingPlan[] | undefined;
2722-
return Array.isArray(plans) ? plans : [];
2723-
};
2724-
27252695
function removeScheduledChargingPlanForChargePoint(
27262696
chargePointId: number,
27272697
planId: number,
@@ -3735,12 +3705,10 @@ export const useMqttStore = defineStore('mqtt', () => {
37353705
vehicleTimeChargingPlanName,
37363706
addTimeChargingPlanForChargePoint,
37373707
removeTimeChargingPlanForChargePoint,
3738-
vehicleScheduledChargingPlansPermanent,
37393708
vehicleTimeChargingPlanActive,
37403709
vehicleTimeChargingPlanStartTime,
37413710
vehicleTimeChargingPlanEndTime,
37423711
vehicleTimeChargingPlanCurrent,
3743-
vehicleTimeChargingPlansPermanent,
37443712
vehicleTimeChargingPlanLimitSelected,
37453713
vehicleTimeChargingPlanSocLimit,
37463714
vehicleTimeChargingPlanEnergyAmount,

0 commit comments

Comments
 (0)