From 4c180a8760e72c775fc88b41c5216ee4bdfdaedf Mon Sep 17 00:00:00 2001 From: Samuel Rowe Date: Sun, 31 Jul 2022 20:22:28 +0530 Subject: [PATCH] feat(frontend): updated to labels in both short and long form for top-level service objects --- .../src/components/Modal/service/form-utils.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/services/frontend/src/components/Modal/service/form-utils.ts b/services/frontend/src/components/Modal/service/form-utils.ts index 23f4db5..3438b44 100644 --- a/services/frontend/src/components/Modal/service/form-utils.ts +++ b/services/frontend/src/components/Modal/service/form-utils.ts @@ -396,13 +396,9 @@ export const getInitialValues = (node?: IServiceNodeItem): IEditServiceForm => { return { hostPort, containerPort, protocol } as any; }), - profiles: profiles ?? [], - labels: labels - ? Object.entries(labels as any).map(([key, value]: any) => ({ - key, - value - })) - : [] + profiles: profiles ?? initialValues.profiles, + labels: + extractObjectOrArray("=", "key", "value", labels) ?? initialValues.labels }; };