-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add cloud env setting page and notification server page #682
Conversation
Codecov Report
@@ Coverage Diff @@
## master #682 +/- ##
======================================
Coverage 26.2% 26.2%
======================================
Files 102 102
Lines 1557 1557
Branches 355 355
======================================
Hits 408 408
Misses 1121 1121
Partials 28 28
Continue to review full report at Codecov.
|
@@ -47,11 +47,10 @@ export const getNavs = { | |||
title: 'Users' | |||
}, | |||
{ | |||
link: '#', | |||
link: '/dashboard/cloud-environment', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not set link as /dashboard/settings
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
暂时只完成了云环境页面,先让这里跳转到
/dashboard/settings
表示云环境页面不太合适
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以类似 /dashboard/settings/:term
, term 代表不同的子项,云环境为 /:dash/settings/cloud-env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我试过,现在这样弄会导致一级导航选不中,需要改造 SideNav
组件
}, | ||
{ | ||
name: 'Cloud environment', | ||
link: '/dashboard/cloud-environment', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe link is complex
export default class CloudEnvironment extends Component { | ||
async componentDidMount() { | ||
const { cloudEnvironmentStore } = this.props; | ||
cloudEnvironmentStore.fetchAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing await
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
<div | ||
key={item.id} | ||
className={classnames(styles.item, { | ||
[styles.disabled]: !checked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too verbose. Why not
[styles.disabled]: item.status !== 'active'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面也用了 checked
判断,复用下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好吧...
cloudEnvironmentStore.fetchAll(); | ||
} | ||
|
||
renderItem = item => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can destruct item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/routes/index.js
Outdated
@@ -71,6 +71,8 @@ const routes = { | |||
|
|||
'/:dash/account/:type?': Dash.Account, | |||
|
|||
'/:dash/cloud-environment': [Dash.CloudEnvironment, { acl: r.admin }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give a short and simple path
src/stores/RootStore.js
Outdated
@@ -184,5 +186,7 @@ export default class RootStore extends Store { | |||
|
|||
// Vendor | |||
this.register('vendor', Vendor); | |||
|
|||
this.register('cloudEnvironment', CloudEnvironment); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloud env is the same as runtime provider
fetchAll = async () => { | ||
const result = mockData; | ||
this.environment = _.get(result, 'environment_set', []); | ||
const totalCount = _.get(result, 'total_count', 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totalCount
is also observable
import { observable, action } from 'mobx'; | ||
import _ from 'lodash'; | ||
|
||
import mockData from './mock-data'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove mock data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -0,0 +1,39 @@ | |||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need create this file, you can use config/runtimes.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
bc1c3d9
to
150a3b3
Compare
'dashboard' | ||
]; | ||
const changeKey = { | ||
'cloud-env': 'setting', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看下面新加的两个链接中都包含“setting”,感觉这行cloud-env的转换和上面的可以去掉。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我试试看
"Connect success": "连接成功!", | ||
"Connect failed": "连接失败 :(", | ||
"User authentication": "用户身份验证", | ||
"CLOUD-ENVIRONMENT-DESCRIBE": "平台的用户可以将以下开启的云环境对接到平台中来,做为实例或测试实例运行的环境。", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
像这样的以大写字母作为key的翻译最好把英文也顺便加上来,最后查看具体页面的代码很难知道这里的英文没有翻译。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@import '~scss/vars'; | ||
|
||
.title { | ||
@include title-font($font-size: 12px); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
页面title在Layout组件传过去了,这里应该是非title样式,应该引用@include normal-font;
title-font是字体加粗的颜色深一点的$N500,normal-font是页面上一般显示描述的字体,字体颜色为$N300.note-font为灰色字体且颜色为$N75的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
solve #596