Skip to content
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

Merged
merged 2 commits into from
Jan 22, 2019

Conversation

whDongRui
Copy link
Contributor

No description provided.

@whDongRui whDongRui requested a review from liiil825 January 22, 2019 05:55
@sunnywx sunnywx changed the base branch from master to feat/portal-url January 22, 2019 05:56
@whDongRui whDongRui changed the base branch from feat/portal-url to master January 22, 2019 05:57
@codecov
Copy link

codecov bot commented Jan 22, 2019

Codecov Report

Merging #692 into feat/portal-url will increase coverage by 0.39%.
The diff coverage is 20%.

Impacted file tree graph

@@                 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
Impacted Files Coverage Δ
src/components/Layout/SideNav/index.jsx 3.22% <ø> (+0.4%) ⬆️
src/components/Layout/SideNav/navMap.js 100% <ø> (ø) ⬆️
src/components/MenuLayer/index.jsx 7.69% <20%> (+7.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5dcd475...acf932e. Read the comment docs.

@whDongRui whDongRui changed the base branch from master to feat/portal-url January 22, 2019 05:58
@@ -99,6 +101,10 @@ export default class AppVersionStore extends Store {
return this.getStore('user');
}

get describeVersionName() {
return isUserPortal ? 'active_app_versions' : 'app_versions';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isUserPortal 是个 function 吧

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的。


import styles from './index.scss';

const roleToProtal = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

拼写错误,改为 rolePortal

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protal=> portal

@@ -50,6 +50,7 @@ export const getPortalFromPath = (path = location.pathname) => {
return '';
};

export const isUserPortal = () => (getPortalFromPath() || 'user') === 'user';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改为

isUserPortal=> ['', 'user'].includes(getPortalFromPath())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不用 function 可能会有问题吧,这样会在初始化时就决定了,后面切换了 url 可能不会变

@sunnywx sunnywx changed the title fix: Skip different portal fix: TopNav switch link in different portals Jan 22, 2019
@sunnywx sunnywx merged commit c37901c into openpitrix:feat/portal-url Jan 22, 2019
sunnywx added a commit that referenced this pull request Jan 22, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants