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

PXP-2464 fix/homepage chart REST API #476

Merged
merged 12 commits into from
Mar 1, 2019
Merged

Conversation

qingyashu
Copy link
Contributor

This PR change homepage chart to hit REST API instead of using relayer, and also enable public option for index page.

  • To set the chart nodes, a data commons should add components.index.homepageChartNodes for required nodes and chart labels.
  • To enable public index page, by setting components.index.public.
  • For backward compatibility, we still keep relayer to avoid crash. Until we gradually change all other data common' gitops.json/${APP}.json towards using REST API, then relayer-related code could be moved.

New Features

  • Customizable public index page, by setting components.index.public: true.

Breaking Changes

  • Change relayer to REST API for homepage chart: use components.index.homepageChartNodes for required nodes and chart labels.

@qingyashu
Copy link
Contributor Author

Branch deployed in https://qingya.planx-pla.net/, now its index page is open to public.

Copy link
Collaborator

@mfshao mfshao left a comment

Choose a reason for hiding this comment

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

This looks good to me. Nice work!

@qingyashu qingyashu force-pushed the fix/homepage-chart-rest branch from fb6f717 to 9893651 Compare February 26, 2019 21:29
Copy link
Contributor

@abgeorge7 abgeorge7 left a comment

Choose a reason for hiding this comment

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

Looks pretty good! just had one comment in the code.

Also I see typeof x !== 'undefined' in the code a lot, you could shorten it to !!x if you just want to check if a value exists... it would also capture null and false

@@ -68,7 +78,7 @@ class Login extends React.Component {
<hr className='login-page__separator' />
<div className='body-typo'>{this.props.data.text}</div>
{
this.props.providers.map(
this.props.providers && this.props.providers.map(
Copy link
Contributor

Choose a reason for hiding this comment

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

is this necessary to add if you added default props?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I changed the code yesterday and forgot to commit... let me update that! thanks

import './page.less';

class IndexPageComponent extends React.Component {
constructor(props) {
super(props);
getProjectsList();
getProjectNodeCounts((res) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that this should go in componentDidMount, not the constructor.
https://reactjs.org/docs/react-component.html#constructor

@qingyashu qingyashu merged commit 4c5e421 into master Mar 1, 2019
@zflamig zflamig deleted the fix/homepage-chart-rest branch March 17, 2019 15:28
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