-
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
fix: TopNav switch link in different portals #692
fix: TopNav switch link in different portals #692
Conversation
Codecov Report
@@ Coverage Diff @@
## feat/portal-url #692 +/- ##
===================================================
+ Coverage 31.57% 31.97% +0.39%
===================================================
Files 103 103
Lines 1387 1373 -14
Branches 361 356 -5
===================================================
+ Hits 438 439 +1
+ Misses 918 903 -15
Partials 31 31
Continue to review full report at Codecov.
|
src/stores/app/version.js
Outdated
@@ -99,6 +101,10 @@ export default class AppVersionStore extends Store { | |||
return this.getStore('user'); | |||
} | |||
|
|||
get describeVersionName() { | |||
return isUserPortal ? 'active_app_versions' : 'app_versions'; |
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.
isUserPortal 是个 function 吧
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.
这里有问题,如果你想这么调用,可以把 isUserPortal写在 user provider里,用es6 getter
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.
好的。
src/components/MenuLayer/index.jsx
Outdated
|
||
import styles from './index.scss'; | ||
|
||
const roleToProtal = { |
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.
拼写错误,改为 rolePortal
src/components/MenuLayer/index.jsx
Outdated
const changeWord = isNormal ? t('Develop Center') : t('App Center'); | ||
const isDeveloper = user.role === 'developer'; | ||
const { isNormal, role } = user; | ||
const protal = isUserPortal() ? roleToProtal[role] || {} : roleToProtal.user; |
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.
protal=> portal
src/routes/index.js
Outdated
@@ -50,6 +50,7 @@ export const getPortalFromPath = (path = location.pathname) => { | |||
return ''; | |||
}; | |||
|
|||
export const isUserPortal = () => (getPortalFromPath() || 'user') === 'user'; |
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.
改为
isUserPortal=> ['', 'user'].includes(getPortalFromPath())
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.
这里不用 function 可能会有问题吧,这样会在初始化时就决定了,后面切换了 url 可能不会变
* Add user, dev, isv, admin portal routes * feat: Portal architecture * chore: Admin portal (#690) * chore: Developer portal (#691) * fix: TopNav switch link in different portals (#692) * feat: Add cluster, cluster detail to user portal * Refine entry file * Refine Layout comp, remove socket listen * feat: Add runtimes, runtime create page for user portal * Fix all routes links * Refactor: Cluster, runtime pages suit user and non-user portal
No description provided.