From c36eaa3d33d8f4dc24a8799a2fc0ad9e0bd97c7a Mon Sep 17 00:00:00 2001 From: dongrui Date: Mon, 29 Oct 2018 12:00:16 +0800 Subject: [PATCH 1/2] fix: Add repo validate fix: Create user remove default role fix: The vxnet list is incomplete --- src/components/Base/Modal/index.scss | 2 +- src/config/translation.js | 3 ++ src/locales/zh/translation.json | 1 + src/pages/Admin/Repos/Add/index.jsx | 17 ++++--- src/pages/Admin/Users/index.jsx | 6 +-- src/pages/Home/index.jsx | 3 +- src/scss/index.scss | 7 --- src/stores/app/deploy.js | 5 ++- src/stores/repo/create.js | 52 +++++++++++++++++++--- src/stores/user/index.js | 6 +-- test/pages/Home.test.js | 3 +- test/pages/__snapshots__/Home.test.js.snap | 19 ++++---- 12 files changed, 83 insertions(+), 41 deletions(-) diff --git a/src/components/Base/Modal/index.scss b/src/components/Base/Modal/index.scss index fe949acf..b30f259b 100644 --- a/src/components/Base/Modal/index.scss +++ b/src/components/Base/Modal/index.scss @@ -54,7 +54,7 @@ height: 32px; border-radius: 2px; background-color: $N0; - box-shadow: 0 1px 2px 0 rgba(109, 53, 195, 0.15); + // box-shadow: 0 1px 2px 0 rgba(109, 53, 195, 0.15); } & > textarea{ box-sizing: border-box; diff --git a/src/config/translation.js b/src/config/translation.js index f0b18041..e2f7c62b 100644 --- a/src/config/translation.js +++ b/src/config/translation.js @@ -50,6 +50,9 @@ const tsObj = { 'Runtime Selector missing value': '环境选择器缺失值', 'Invalid s3 url, should be like s3://s3.pek3a.qingstor.com/op-repo': '无效的s3网址,应该是这样: s3://s3.pek3a.qingstor.com/op-repo', + 'Verify that the information requested is incomplete!': '验证要求输入的信息不完整!', + 'Access key verification successfully': '访问密钥验证成功', + 'Access key verification fail': '访问密钥验证失败', 'Create repo successfully': '创建仓库成功', 'Modify repo successfully': '修改仓库成功', 'Delete repo successfully.': '删除仓库成功', diff --git a/src/locales/zh/translation.json b/src/locales/zh/translation.json index 39bc81dc..3fd5efd4 100644 --- a/src/locales/zh/translation.json +++ b/src/locales/zh/translation.json @@ -211,6 +211,7 @@ "Search Repo": "搜索仓库", "Trigger indexer": "触发索引器", "Runtime Selectors": "环境选择器", + "URL": "网址", "Event Id": "事件ID", "successful": "已成功", "Successful": "已成功", diff --git a/src/pages/Admin/Repos/Add/index.jsx b/src/pages/Admin/Repos/Add/index.jsx index e0b43eaf..805cd348 100644 --- a/src/pages/Admin/Repos/Add/index.jsx +++ b/src/pages/Admin/Repos/Add/index.jsx @@ -37,11 +37,14 @@ export default class RepoAdd extends Component { } } - componentDidUpdate() { - if (get(this.store, 'repoCreated.repo_id') && !this.store.isLoading) { - history.back(); + handleSubmit = async e => { + const { repoCreateStore } = this.props; + const result = await repoCreateStore.handleSubmit(e); + + if (!(result && result.err)) { + setTimeout(() => history.back(), 1000); } - } + }; renderForm() { const { t } = this.props; @@ -61,7 +64,7 @@ export default class RepoAdd extends Component { } = this.store; return ( -
+
- + { if (!this.url || !this.accessKey || !this.secretKey) { - return this.info(ts('Verify that the information requested is incomplete!')); + return this.info(ts('Information to be verified is incomplete!')); } // format s3 url