Skip to content

Commit

Permalink
fix: Version suspend operate id error (#927)
Browse files Browse the repository at this point in the history
* fix: App detail page add provider info  query
  • Loading branch information
dongrui authored Mar 15, 2019
1 parent 597ddec commit 8f49993
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/locales/zh/app-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
"specification and application development": "规范和应用程序开发",
"Suspend app": "下架应用",
"Recover app": "重新上架应用",
"Suspend successfully": "下架操作成功",
"Recover successfully": "上架操作成功",
"Suspend version": "下架版本",
"Recover version": "上架版本",
"suspend-app-note-desc": "应用下架后,用户无法从商店中购买到此应用,你确定要下架该应用吗?",
Expand Down
5 changes: 3 additions & 2 deletions src/pages/AppDetail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default class AppDetail extends Component {
rootStore,
appStore,
appVersionStore,
vendorStore,
match,
isCreate
} = this.props;
Expand All @@ -69,8 +70,8 @@ export default class AppDetail extends Component {
await appStore.fetch(appId);
await appVersionStore.fetchTypeVersions(appId);

// todo
// await vendorStore.fetch(appDetail.vendor_id);
const { appDetail } = appStore;
await vendorStore.fetch(appDetail.isv);

await appStore.fetchActiveApps({ status: 'active' });

Expand Down
22 changes: 16 additions & 6 deletions src/pages/Dashboard/Apps/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ export default class AppDetail extends Component {
await versionSuspend(versionIds, operateType[0]);
};

openSuspendDialog = (versionId, type) => {
const { appStore, appVersionStore } = this.props;
appVersionStore.versionId = versionId;

appStore.showModal(type);
};

renderAppHandleMenu = appDetail => {
const { appStore, match, t } = this.props;
const { appId } = match.params;
Expand All @@ -136,11 +143,8 @@ export default class AppDetail extends Component {
};

renderVersionHandleMenu = item => {
const {
appStore, appVersionStore, match, t
} = this.props;
const { match, t } = this.props;
const { appId } = match.params;
appVersionStore.versionId = item.version_id;

return (
<div className="operate-menu">
Expand All @@ -153,12 +157,18 @@ export default class AppDetail extends Component {
<Icon name="stateful-set" type="dark" /> {t('Deploy Instance')}
</Link>
{item.status === 'active' && (
<span onClick={() => appStore.showModal('suspend-version')}>
<span
onClick={() => this.openSuspendDialog(item.version_id, 'suspend-version')
}
>
<Icon name="sort-descending" type="dark" /> {t('Suspend version')}
</span>
)}
{item.status === 'suspended' && (
<span onClick={() => appStore.showModal('recover-version')}>
<span
onClick={() => this.openSuspendDialog(item.version_id, 'recover-version')
}
>
<Icon name="sort-ascending" type="dark" /> {t('Recover version')}
</span>
)}
Expand Down

0 comments on commit 8f49993

Please sign in to comment.