|
|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
import type { IEditServiceForm, IServiceNodeItem } from "../../../types";
|
|
|
|
|
import * as yup from "yup";
|
|
|
|
|
import lodash from "lodash";
|
|
|
|
|
import { checkArray } from "../../../utils/forms";
|
|
|
|
|
|
|
|
|
|
const initialValues: IEditServiceForm = {
|
|
|
|
|
@ -153,15 +152,12 @@ export const getFinalValues = (
|
|
|
|
|
): IServiceNodeItem => {
|
|
|
|
|
const { environmentVariables, ports, volumes, labels } = values;
|
|
|
|
|
|
|
|
|
|
return lodash.mergeWith(
|
|
|
|
|
lodash.cloneDeep(previous) || {
|
|
|
|
|
key: "service",
|
|
|
|
|
return {
|
|
|
|
|
key: previous?.key ?? "service",
|
|
|
|
|
type: "SERVICE",
|
|
|
|
|
inputs: ["op_source"],
|
|
|
|
|
outputs: [],
|
|
|
|
|
config: {}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
inputs: previous?.inputs ?? ["op_source"],
|
|
|
|
|
outputs: previous?.outputs ?? [],
|
|
|
|
|
config: (previous as any)?.config ?? {},
|
|
|
|
|
canvasConfig: {
|
|
|
|
|
node_name: values.serviceName
|
|
|
|
|
},
|
|
|
|
|
@ -192,12 +188,5 @@ export const getFinalValues = (
|
|
|
|
|
(label) => `${label.key}${label.value ? `=${label.value}` : ""}`
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
(obj, src) => {
|
|
|
|
|
if (!lodash.isNil(src)) {
|
|
|
|
|
return src;
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
) as any;
|
|
|
|
|
} as any;
|
|
|
|
|
};
|
|
|
|
|
|