From 8f499935b767df16ab22a5de0734849c35b7d97c Mon Sep 17 00:00:00 2001 From: dongrui Date: Fri, 15 Mar 2019 12:05:47 +0800 Subject: [PATCH] fix: Version suspend operate id error (#927) * fix: App detail page add provider info query --- src/locales/zh/app-version.json | 2 ++ src/pages/AppDetail/index.jsx | 5 +++-- src/pages/Dashboard/Apps/Detail/index.jsx | 22 ++++++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/locales/zh/app-version.json b/src/locales/zh/app-version.json index 4bbdcc7c..aba83934 100644 --- a/src/locales/zh/app-version.json +++ b/src/locales/zh/app-version.json @@ -81,6 +81,8 @@ "specification and application development": "规范和应用程序开发", "Suspend app": "下架应用", "Recover app": "重新上架应用", + "Suspend successfully": "下架操作成功", + "Recover successfully": "上架操作成功", "Suspend version": "下架版本", "Recover version": "上架版本", "suspend-app-note-desc": "应用下架后,用户无法从商店中购买到此应用,你确定要下架该应用吗?", diff --git a/src/pages/AppDetail/index.jsx b/src/pages/AppDetail/index.jsx index f834c4e8..e8a852ae 100644 --- a/src/pages/AppDetail/index.jsx +++ b/src/pages/AppDetail/index.jsx @@ -57,6 +57,7 @@ export default class AppDetail extends Component { rootStore, appStore, appVersionStore, + vendorStore, match, isCreate } = this.props; @@ -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' }); diff --git a/src/pages/Dashboard/Apps/Detail/index.jsx b/src/pages/Dashboard/Apps/Detail/index.jsx index 208644e3..830630b8 100644 --- a/src/pages/Dashboard/Apps/Detail/index.jsx +++ b/src/pages/Dashboard/Apps/Detail/index.jsx @@ -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; @@ -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 (
@@ -153,12 +157,18 @@ export default class AppDetail extends Component { {t('Deploy Instance')} {item.status === 'active' && ( - appStore.showModal('suspend-version')}> + this.openSuspendDialog(item.version_id, 'suspend-version') + } + > {t('Suspend version')} )} {item.status === 'suspended' && ( - appStore.showModal('recover-version')}> + this.openSuspendDialog(item.version_id, 'recover-version') + } + > {t('Recover version')} )}