Skip to content

Commit

Permalink
fix: Fix workspace create error
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed May 19, 2020
1 parent fb078c3 commit 4320f89
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/actions/resource.delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default {
Modal.close(modal)
Notify.success({ content: `${t('Deleted Successfully')}!` })
store.setSelectRowKeys([])
success && success()
},
resource: selectNames.join(', '),
modal: DeleteModal,
Expand Down
9 changes: 7 additions & 2 deletions src/pages/access/containers/Workspaces/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export default class Workspaces extends React.Component {
text: t('Edit'),
action: 'edit',
show: this.showAction,
onClick: item => trigger('resource.baseinfo.edit', { detail: item }),
onClick: item =>
trigger('resource.baseinfo.edit', {
detail: item,
success: routing.query,
}),
},
{
key: 'delete',
Expand Down Expand Up @@ -117,9 +121,10 @@ export default class Workspaces extends React.Component {
}

showCreate = () => {
const { module } = this.props
const { module, getData } = this.props
return this.props.trigger('workspace.create', {
module,
success: getData,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export default class ProjectSelect extends Component {
]
}

valueRenderer = option => `${t('Project')}: ${option.label}`

render() {
const { namespace = '', store, onChange, onFetch } = this.props

Expand All @@ -47,6 +49,7 @@ export default class ProjectSelect extends Component {
total={store.list.total}
currentLength={store.list.data.length}
isLoading={store.list.isLoading}
valueRenderer={this.valueRenderer}
onFetch={onFetch}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class BaseInfo extends React.Component {
</div>
<Form data={formTemplate} ref={formRef}>
<Form.Item label={t('Available Clusters')}>
<ClusterSelect name="clusters" />
<ClusterSelect name="clusters" defaultValue={[]} />
</Form.Item>
</Form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export default class ClusterSelect extends Component {
)
}

valueRenderer = option => `${t('Cluster')}: ${option.label}`

render() {
const { cluster = this.hostCluster } = this.props

Expand All @@ -75,6 +77,7 @@ export default class ClusterSelect extends Component {
value={cluster}
onChange={this.handleChange}
options={this.clusters}
valueRenderer={this.valueRenderer}
page={this.workspaceStore.clusters.page}
total={this.workspaceStore.clusters.total}
currentLength={this.workspaceStore.clusters.data.length}
Expand Down

0 comments on commit 4320f89

Please sign in to comment.