Skip to content

Commit

Permalink
fix: svn type cant be changed after created
Browse files Browse the repository at this point in the history
  • Loading branch information
ymh1028 committed Feb 5, 2020
1 parent 599e131 commit 9984e20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/Forms/CICDs/RepoSelect/SVNForm/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ export default class SvnForm extends React.Component {

render() {
const { formData, credentials } = this.props.store
const { formRef } = this.props
const { formRef, enableTypeChange } = this.props

return (
<div className={styles.card}>
<Form data={formData} ref={formRef}>
<Form.Item label={t('type')}>
<Select
name="svn_source.type"
disabled={enableTypeChange === false}
onChange={this.handleTypeChange}
options={[
{ label: t('single Svn'), value: 'single_svn' },
Expand Down
3 changes: 2 additions & 1 deletion src/components/Forms/CICDs/RepoSelect/subForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default class RepoSelectForm extends React.Component {
}

renderForm() {
const { project_id } = this.props
const { project_id, enableTypeChange } = this.props
if (this.source_type === 'github') {
return (
<GithubForm
Expand All @@ -212,6 +212,7 @@ export default class RepoSelectForm extends React.Component {
handleSubmit={this.handleSubmit}
project_id={project_id}
showCredential={this.showCreateCredential}
enableTypeChange={enableTypeChange}
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/devops.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const updatePipelineParams = data => {
const { multi_branch_pipeline, pipeline, type, ...rest } = data
if (multi_branch_pipeline) {
rest && Object.assign(data.multi_branch_pipeline, rest)
data.type = 'multi_branch_pipeline'
data.type = 'multi-branch-pipeline'
deleteUnenableAttrs(data.multi_branch_pipeline)
} else {
if (data.pipeline) {
Expand Down

0 comments on commit 9984e20

Please sign in to comment.