Skip to content

Commit

Permalink
fix: Fix pipeline shell command can't save (#4206)
Browse files Browse the repository at this point in the history
fix: fix pipeline shell params

Signed-off-by: yazhou <[email protected]>
  • Loading branch information
yazhouio authored Oct 18, 2023
1 parent 26f69cc commit 4067c95
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/components/Base/CodeEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ class CodeEditor extends PureComponent {
}

static defaultProps = {
value: {},
value: '',
mode: 'yaml',
options: {},
onChange() {},
}

render() {
const { className, mode, options, value, onChange } = this.props

return (
<Suspense fallback={<Loading className="ks-page-loading" />}>
<AceEditor
Expand Down
21 changes: 13 additions & 8 deletions src/pages/devops/components/Pipeline/StepModals/params.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ export default class Params extends React.Component {
formData = parseWithCredientialData(edittingData)
} else if (codeKey) {
value = (Array.isArray(data) ? data[0]?.value?.value : data.value) || ''
formData = {
[codeKey]: value,
}
} else if (Array.isArray(data)) {
formData = data.reduce((prev, arg) => {
const val = arg.value.value
Expand Down Expand Up @@ -305,14 +308,16 @@ export default class Params extends React.Component {
)
case 'code':
return (
<CodeEditor
key={option.name}
className={styles.CodeEditor}
name="script"
mode="yaml"
value={this.state.value}
onChange={this.handleCodeEditorChange(option.name)}
/>
<Form.Item {...formProps} label={null}>
<CodeEditor
key={option.name}
className={styles.CodeEditor}
name={option.name}
mode="yaml"
// value={this.state.value}
// onChange={this.handleCodeEditorChange(option.name)}
/>
</Form.Item>
)
case 'bool':
return (
Expand Down

0 comments on commit 4067c95

Please sign in to comment.