Skip to content

Commit

Permalink
fix: Fix volume detail incorrect info
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Aug 20, 2020
1 parent c265922 commit b985c33
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
7 changes: 6 additions & 1 deletion src/pages/projects/components/Cards/Placement/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ export default class Placement extends Component {

render() {
const { module, name, namespace } = this.props
const { clusters = [] } = this.fedStore.detail
const { clusters } = this.fedStore.detail
const clusterMap = keyBy(this.clusterStore.list.data, 'name')

if (!clusters) {
return null
}

return (
<Panel title={t('Project Placement')}>
<Alert
Expand Down
15 changes: 4 additions & 11 deletions src/pages/projects/containers/Volumes/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import DetailPage from 'projects/containers/Base/Detail'

import getRoutes from './routes'

function noop() {}

@inject('rootStore')
@observer
@trigger
Expand Down Expand Up @@ -91,15 +89,10 @@ export default class VolumeDetail extends React.Component {
name: storageClassName,
})

await this.storageclasscapabilities.fetchDetail(
{
cluster,
name: storageClassName,
},
{},
{},
noop
)
await this.storageclasscapabilities.fetchDetail({
cluster,
name: storageClassName,
})
}

getOperations = () => [
Expand Down
9 changes: 7 additions & 2 deletions src/stores/storageclasscapabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ export default class StorageClassCapabilityStore extends Base {
}

@action
async fetchDetail(params, filter, options, reject) {
async fetchDetail(params) {
this.isLoading = true

const result = await request.get(this.getDetailUrl(params), {}, {}, reject)
const result = await request.get(
this.getDetailUrl(params),
{},
{},
() => {}
)
if (result) {
const detail = { ...params, ...this.mapper(result) }

Expand Down

0 comments on commit b985c33

Please sign in to comment.