Skip to content

Commit

Permalink
Merge pull request openWB#559 from benderl/bugfix-revert-configuratio…
Browse files Browse the repository at this point in the history
…n-mixin

Revert "include mixin in proxy components"
  • Loading branch information
benderl authored Oct 1, 2024
2 parents 277120f + 90df472 commit 2950ae5
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/backup_clouds/BackupCloudConfigMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
updateConfiguration(event, path = undefined) {
this.$emit("update:configuration", { value: event, object: path });
},
sendCommand(command, data = {}) {
sendSystemCommand(command, data = {}) {
this.$emit("sendCommand", {
command: command,
data: data,
Expand Down
16 changes: 14 additions & 2 deletions src/components/backup_clouds/OpenwbBackupCloudProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

<script>
import { defineAsyncComponent } from "vue";
import BackupCloudConfigMixin from "./BackupCloudConfigMixin.vue";
import OpenwbBackupCloudFallback from "./OpenwbBackupCloudConfigFallback.vue";
export default {
name: "OpenwbBackupCloudProxy",
mixins: [BackupCloudConfigMixin],
props: {
backupCloud: { type: Object, required: true },
},
emits: ["update:configuration", "sendCommand"],
computed: {
myComponent() {
console.debug(`loading backup cloud: ${this.backupCloud.type}`);
Expand All @@ -28,5 +30,15 @@ export default {
});
},
},
methods: {
// event pass through
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
// event pass through
sendCommand(event) {
this.$emit("sendCommand", event);
},
},
};
</script>
2 changes: 1 addition & 1 deletion src/components/backup_clouds/onedrive/backup_cloud.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
title="4. Token abrufen und speichern"
button-text="Autorisierungs-Token abrufen"
subtype="success"
@button-clicked="sendCommand('retrieveMSALTokens', {})"
@button-clicked="sendSystemCommand('retrieveMSALTokens', {})"
>
<template #help>
Zugangstoken wird abgerufen und gespeichert, damit das Backup
Expand Down
11 changes: 9 additions & 2 deletions src/components/charge_points/OpenwbChargePointProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@

<script>
import { defineAsyncComponent } from "vue";
import ChargePointConfigMixin from "./ChargePointConfigMixin.vue";
import OpenwbChargePointConfigFallback from "./OpenwbChargePointConfigFallback.vue";
import OpenwbChargePointCommandsFallback from "./OpenwbChargePointCommandsFallback.vue";
export default {
name: "OpenwbChargePointProxy",
mixins: [ChargePointConfigMixin],
props: {
chargePoint: { required: true, type: Object },
},
emits: ["update:configuration"],
computed: {
myChargePointSettingsComponent() {
console.debug(
Expand All @@ -47,5 +49,10 @@ export default {
});
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>
19 changes: 17 additions & 2 deletions src/components/devices/OpenwbConfigProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
:is="myComponent"
:device="device"
:component="component"
:configuration="
component ? component.configuration : device.configuration
"
:device-id="device.id"
:device-type="device.type"
:component-id="component ? component.id : undefined"
:component-type="component ? component.type : undefined"
@update:configuration="updateConfiguration($event)"
/>
</template>

<script>
import { defineAsyncComponent } from "vue";
import ComponentConfigMixin from "./DeviceConfigMixin.vue";
import OpenwbDeviceConfigFallback from "./OpenwbDeviceConfigFallback.vue";
import OpenwbComponentConfigFallback from "./OpenwbComponentConfigFallback.vue";
export default {
name: "OpenwbConfigProxy",
mixins: [ComponentConfigMixin],
props: {
device: { type: Object, required: true },
component: { type: Object, required: false, default: undefined },
},
emits: ["update:configuration"],
computed: {
myComponent() {
console.debug(
Expand All @@ -40,5 +50,10 @@ export default {
}
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>
11 changes: 9 additions & 2 deletions src/components/display_themes/OpenwbDisplayThemeProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
library.add(fasPeopleGroup, fasCertificate);
import { defineAsyncComponent } from "vue";
import DisplayThemeConfigMixin from "./DisplayThemeConfigMixin.vue";
import OpenwbDisplayThemeFallback from "./OpenwbDisplayThemeFallback.vue";
export default {
name: "OpenwbDisplayThemeProxy",
components: {
FontAwesomeIcon,
},
mixins: [DisplayThemeConfigMixin],
props: {
displayTheme: { type: Object, required: true },
},
emits: ["update:configuration"],
computed: {
myComponent() {
console.debug(`loading display theme: ${this.displayTheme.type}`);
Expand All @@ -61,5 +63,10 @@ export default {
});
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

<script>
import { defineAsyncComponent } from "vue";
import ElectricityTariffConfigMixin from "./ElectricityTariffConfigMixin.vue";
import OpenwbElectricityTariffFallback from "./OpenwbElectricityTariffConfigFallback.vue";
export default {
name: "OpenwbElectricityTariffProxy",
mixins: [ElectricityTariffConfigMixin],
props: {
electricityTariff: { type: Object, required: true },
},
emits: ["update:configuration"],
computed: {
myComponent() {
console.debug(
Expand All @@ -31,5 +33,10 @@ export default {
});
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
:is="myComponent"
:ripple-control-receiver="rippleControlReceiver"
@update:configuration="updateConfiguration($event)"
@send-command="sendCommand($event)"
/>
</template>

<script>
import { defineAsyncComponent } from "vue";
import RippleControlReceiverConfigMixin from "./RippleControlReceiverConfigMixin.vue";
import OpenwbRippleControlReceiverFallback from "./OpenwbRippleControlReceiverConfigFallback.vue";
export default {
name: "OpenwbRippleControlReceiverProxy",
mixins: [RippleControlReceiverConfigMixin],
props: {
rippleControlReceiver: { type: Object, required: true },
},
emits: ["update:configuration", "sendCommand"],
computed: {
myComponent() {
console.debug(
Expand All @@ -31,5 +34,15 @@ export default {
});
},
},
methods: {
// event pass through
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
// event pass through
sendCommand(event) {
this.$emit("sendCommand", event);
},
},
};
</script>
12 changes: 10 additions & 2 deletions src/components/vehicles/OpenwbVehicleProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@

<script>
import { defineAsyncComponent } from "vue";
import VehicleConfigMixin from "./VehicleConfigMixin.vue";
import OpenwbVehicleFallback from "./OpenwbVehicleConfigFallback.vue";
export default {
name: "OpenwbVehicleProxy",
mixins: [VehicleConfigMixin],
props: {
vehicleId: { type: Number, required: true },
vehicle: { type: Object, required: true },
},
emits: ["update:configuration"],
computed: {
myComponent() {
console.debug(`loading vehicle: ${this.vehicle.type}`);
Expand All @@ -27,5 +30,10 @@ export default {
});
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>
11 changes: 9 additions & 2 deletions src/components/web_themes/OpenwbWebThemeProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
library.add(fasPeopleGroup, fasCertificate);
import { defineAsyncComponent } from "vue";
import WebThemeConfigMixin from "./WebThemeConfigMixin.vue";
import OpenwbWebThemeFallback from "./OpenwbWebThemeFallback.vue";
export default {
name: "OpenwbWebThemeProxy",
components: {
FontAwesomeIcon,
},
mixins: [WebThemeConfigMixin],
props: {
webTheme: { type: Object, required: true },
},
emits: ["update:configuration"],
computed: {
myComponent() {
console.debug(`loading web theme: ${this.webTheme.name}`);
Expand All @@ -60,5 +62,10 @@ export default {
});
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>

0 comments on commit 2950ae5

Please sign in to comment.