Skip to content

Commit

Permalink
fix: Fix some issues about alias, get the pipeline data and the build…
Browse files Browse the repository at this point in the history
… mirror restart

Signed-off-by: harrisonliu5 <harrisonliu_5@163.com>
  • Loading branch information
harrisonliu5 committed Aug 6, 2020
1 parent a7206bf commit 38f2c18
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/actions/imagebuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export default {
onOk: data => {
const environment = filterImageEnv(data, v => !isEmpty(v))
set(data, 'spec.config.environment', environment)

store.updateBuilder(data, detail).then(() => {
Modal.close(modal)
success && success()
Expand All @@ -85,6 +84,7 @@ export default {
detail: toJS(detail._originData),
modal: RerunModal,
cluster: detail.cluster,
namespace: detail.namespace,
store,
...props,
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/Forms/AlertingPolicy/BaseInfo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class BaseInfo extends React.Component {
</Column>
<Column>
<Form.Item label={t('Alias')} desc={t('ALIAS_DESC')}>
<Input name="policy.policy_name" />
<Input name="policy.policy_name" maxLength={63} />
</Form.Item>
</Column>
</Columns>
Expand Down
11 changes: 10 additions & 1 deletion src/components/Forms/ImageBuilder/RerunForm/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ export default class RerunForm extends React.Component {
}

render() {
const { visible, isSubmitting, onCancel, cluster, detail } = this.props
const {
visible,
isSubmitting,
onCancel,
cluster,
detail,
namespace,
} = this.props
const isB2i = get(detail, 'spec.config.isBinaryURL')

return (
Expand All @@ -115,13 +122,15 @@ export default class RerunForm extends React.Component {
formTemplate={detail}
formRef={this.content}
cluster={cluster}
namespace={namespace}
mode="edit"
/>
) : (
<S2iForm
formTemplate={detail}
formRef={this.content}
cluster={cluster}
namespace={namespace}
mode="edit"
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modals/DevOpsEdit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class DevOpsEditModal extends React.Component {
<Select name="creator" options={this.getMembersOptions()} disabled />
</Form.Item>
<Form.Item label={t('Alias')} desc={t('ALIAS_DESC')}>
<Input name="aliasName" />
<Input name="aliasName" maxLength={63} />
</Form.Item>
<Form.Item label={t('Description')} desc={t('DESCRIPTION_DESC')}>
<TextArea maxLength={256} name="description" />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/devops/components/Modals/DevOpsEdit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class DevOpsEditModal extends React.Component {
<Input name="creator" disabled />
</Form.Item>
<Form.Item label={t('Alias')} desc={t('ALIAS_DESC')}>
<Input name="aliasName" />
<Input name="aliasName" maxLength={63} />
</Form.Item>
<Form.Item label={t('Description')} desc={t('DESCRIPTION_DESC')}>
<TextArea maxLength={256} name="description" />
Expand Down
21 changes: 13 additions & 8 deletions src/pages/devops/containers/Pipelines/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,11 @@ class CICDs extends React.Component {
cluster: this.cluster,
})
.finally(() => {
this.setState({ isSubmitting: false, showCreate: false }, () => {
this.getData()
})
setTimeout(() => {
this.setState({ isSubmitting: false, showCreate: false }, () => {
this.getData()
})
}, 1000)
})

if (!result) {
Expand Down Expand Up @@ -369,11 +371,10 @@ class CICDs extends React.Component {
await this.store
.deletePipeline(name, this.devops, this.cluster)
.finally(() => {
this.setState({ isSubmitting: false })
this.setState({ isSubmitting: false, showDelete: false }, () => {
this.handleFetch()
})
})

this.setState({ showDelete: false })
this.handleFetch()
}

getStatus() {
Expand Down Expand Up @@ -507,7 +508,11 @@ class CICDs extends React.Component {
rowKey: 'name',
devops: this.devops,
cluster: this.cluster,
success: this.routing.query,
success: () => {
setTimeout(() => {
this.handleFetch()
}, 1000)
},
}),
},
],
Expand Down

0 comments on commit 38f2c18

Please sign in to comment.