From 9fc6b6dee0ec2a0e04a9ccffa0689e59ed45c280 Mon Sep 17 00:00:00 2001 From: Karthik Th Date: Sun, 24 Dec 2023 13:21:13 +0530 Subject: [PATCH] ts compile fixes --- .../handle-backend-resources.tsx | 25 +++++++++++-------- .../route.tsx | 4 +-- .../backend-services-resources.tsx | 4 +-- .../handle-backend-service.tsx | 17 ++++++++----- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx index 752dff2c7..49b0c8639 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx @@ -103,7 +103,7 @@ const HandleBackendResources = ({ }; }, {}), }), - onSubmit: async (val) => { + onSubmit: async (_) => { try { const { errors: e } = await api.createManagedResource({ mres: { @@ -113,17 +113,20 @@ const HandleBackendResources = ({ namespace: parseTargetNs(workspace), }, spec: { - mresKind: { - kind: selectedType?.resource.kind || '', - }, - msvcRef: { - apiVersion: template.apiVersion || '', - name: parseName(backendService), - kind: template.kind!, - }, - inputs: { - ...val, + resourceTemplate: { + spec: ``, + msvcRef: { + apiVersion: template.apiVersion || '', + name: parseName(backendService), + kind: template.kind!, + }, }, + // mresKind: { + // kind: selectedType?.resource.kind || '', + // }, + // inputs: { + // ...val, + // }, }, }, }); diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx index e9d348d7e..ef1bc3d43 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx @@ -120,8 +120,8 @@ const BackingResources = () => { template={ getManagedTemplate({ templates: managedTemplates, - kind: backendService.spec.msvcKind.kind || '', - apiVersion: backendService.spec.msvcKind.apiVersion, + kind: backendService.spec.serviceTemplate.kind || '', + apiVersion: backendService.spec.serviceTemplate.apiVersion, })! } setShow={setShowBackendResourceDialog} diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx index bd079f5d3..4b7a6f0d8 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx @@ -30,8 +30,8 @@ const parseItem = ( ) => { const template = getManagedTemplate({ templates, - kind: item.spec.msvcKind.kind || '', - apiVersion: item.spec.msvcKind.apiVersion, + kind: item.spec.serviceTemplate.kind || '', + apiVersion: item.spec.serviceTemplate.apiVersion, }); return { name: item?.displayName, diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx index 05cf0c34c..e5454cbb1 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx @@ -325,13 +325,18 @@ const HandleBackendService = ({ annotations: {}, }, spec: { - msvcKind: { - apiVersion: selectedService?.service.apiVersion || '', - kind: selectedService?.service.kind || '', - }, - inputs: { - ...tempVal, + serviceTemplate: { + spec: { + ...tempVal, + }, }, + // msvcKind: { + // apiVersion: selectedService?.service.apiVersion || '', + // kind: selectedService?.service.kind || '', + // }, + // inputs: { + // ...tempVal, + // }, }, }, });