From 46eecf63731034ff7b3e60a407d45fa795198eff Mon Sep 17 00:00:00 2001 From: yuyu Date: Wed, 18 Oct 2023 10:14:15 +0800 Subject: [PATCH 1/6] fix:Updating crd resource on ks-console page loses status information (#3866) Signed-off-by: yaozhenxiu <946666800@qq.com> --- src/stores/crd.resource.js | 2 +- src/utils/object.mapper.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/stores/crd.resource.js b/src/stores/crd.resource.js index 74ed0c7a9e7..ae0ae0ea5c3 100644 --- a/src/stores/crd.resource.js +++ b/src/stores/crd.resource.js @@ -38,7 +38,7 @@ export default class CRDResourceStore { } get mapper() { - return ObjectMapper.default + return ObjectMapper.customresourcedefinitionsedit } getPath({ cluster, namespace } = {}) { diff --git a/src/utils/object.mapper.js b/src/utils/object.mapper.js index 6033b8e283f..31914c54c0b 100644 --- a/src/utils/object.mapper.js +++ b/src/utils/object.mapper.js @@ -96,6 +96,23 @@ const DefaultMapper = item => ({ _originData: getOriginData(item), }) +const CRDEditMapper = item => { + return { + ...getBaseInfo(item), + namespace: get(item, 'metadata.namespace'), + spec: get(item, 'spec'), + _originData: omit(item, [ + 'metadata.uid', + 'metadata.selfLink', + 'metadata.generation', + 'metadata.ownerReferences', + 'metadata.resourceVersion', + 'metadata.creationTimestamp', + 'metadata.managedFields', + ]), + } +} + const WorkspaceMapper = item => { const overrides = get(item, 'spec.overrides', []) const template = get(item, 'spec.template', {}) @@ -1504,6 +1521,7 @@ export default { dashboards: DashboardMapper, clusterdashboards: DashboardMapper, customresourcedefinitions: CRDMapper, + customresourcedefinitionsedit: CRDEditMapper, pipelines: PipelinesMapper, networkpolicies: NetworkPoliciesMapper, namespacenetworkpolicies: NetworkPoliciesMapper, From 694bb99100c62018545719edda9f3162fd41eaaf Mon Sep 17 00:00:00 2001 From: SongJXin Date: Wed, 18 Oct 2023 10:25:17 +0800 Subject: [PATCH 2/6] fix: Appdeploy schemaform support select (#3415) appdeploy schemaform support select Co-authored-by: Liu Xin --- .../Forms/AppDeploy/AppConfig/SchemaForm/index.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Forms/AppDeploy/AppConfig/SchemaForm/index.jsx b/src/components/Forms/AppDeploy/AppConfig/SchemaForm/index.jsx index d157af551d9..ffa8e7e54a1 100644 --- a/src/components/Forms/AppDeploy/AppConfig/SchemaForm/index.jsx +++ b/src/components/Forms/AppDeploy/AppConfig/SchemaForm/index.jsx @@ -19,7 +19,7 @@ import React from 'react' import PropTypes from 'prop-types' import { map, get, set, every, has, debounce, isEmpty, isNaN } from 'lodash' -import { Form, Input, Slider, TextArea, Toggle } from '@kube-design/components' +import { Form, Input, Slider, TextArea, Toggle, Select } from '@kube-design/components' import { Text } from 'components/Base' import { NumberInput } from 'components/Inputs' @@ -89,6 +89,13 @@ export default class SchemaForm extends React.Component { ) } else if (propObj.render === 'textArea') { content =