Fix showing initial InfluxDB integration form.

Closes #254.
This commit is contained in:
Orne Brocaar 2023-07-31 10:51:23 +01:00
parent 651fcfce43
commit dac4f15f40

View File

@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { Form, Input, Button, Select } from "antd";
@ -16,6 +16,10 @@ interface IProps {
function InfluxDbIntegrationForm(props: IProps) {
const [selectedVersion, setSelectedVersion] = useState<InfluxDbVersion>(InfluxDbVersion.INFLUXDB_1);
useEffect(() => {
setSelectedVersion(props.initialValues.getVersion());
}, [props]);
const onFinish = (values: InfluxDbIntegration.AsObject) => {
const v = Object.assign(props.initialValues.toObject(), values);
let i = new InfluxDbIntegration();