import { cloneDeep } from 'lodash'; import React from 'react'; import type { Option } from 'react-select'; import Select from 'react-select'; import { ArtifactEditor } from '../ArtifactEditor'; import { ArtifactTypePatterns } from '../../../../../artifact/ArtifactTypes'; import type { IArtifactEditorProps, IArtifactKindConfig } from '../../../../../domain'; import { StageConfigField } from '../../../stages/common'; import { SpelText } from '../../../../../widgets/spelText/SpelText'; class KubernetesArtifactEditor extends ArtifactEditor { constructor(props: IArtifactEditorProps) { super(props, props.artifact.type || 'kubernetes/configMap'); } private onReferenceChange = (reference: string) => { const clonedArtifact = cloneDeep(this.props.artifact); clonedArtifact.reference = reference; this.props.onChange(clonedArtifact); }; private onTypeChange = (option: Option) => { const clonedArtifact = cloneDeep(this.props.artifact); clonedArtifact.type = option.value; this.props.onChange(clonedArtifact); }; public render() { return ( <>