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

feat: Profile page integrate API #401

Merged
merged 2 commits into from
Sep 27, 2018
Merged

Conversation

whDongRui
Copy link
Contributor

No description provided.

@whDongRui whDongRui requested a review from sunnywx September 26, 2018 09:32
@codecov
Copy link

codecov bot commented Sep 26, 2018

Codecov Report

Merging #401 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #401   +/-   ##
=======================================
  Coverage   18.09%   18.09%           
=======================================
  Files          86       86           
  Lines        1343     1343           
  Branches      270      270           
=======================================
  Hits          243      243           
  Misses       1050     1050           
  Partials       50       50

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 f3042aa...e01a659. Read the comment docs.

@@ -240,7 +240,7 @@ export default class Users extends Component {
onCancel={userStore.hideModal}
hideFooter
>
<form className="formContent" onSubmit={userStore.createOrModify} method="post">
<form className="formContent" onSubmit={e => userStore.createOrModify(e)} method="post">
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change for prevent page refresh。
createOrModify = async e => {
e.preventDefault();
...
}

scope: '',
refresh_token: refresh_token
});
const res = await agent.post([apiServer, 'oauth2/token'].join('/')).send({
Copy link
Contributor

Choose a reason for hiding this comment

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

agent.post(url, {...})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, define url variable

constructor(props) {
super(props);
this.state = {
currentForm: 'basic'
};
}

componentDidMount() {
Copy link
Contributor

Choose a reason for hiding this comment

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

put this logic in onEnter, or SSR will not work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If put in onEnter ,refresh page getCookie method will error .

const { userDetail, changeUser, changeUserRole } = userStore;
const { userDetail, changeUser, modifyUser } = userStore;
const emailRegexp =
"[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)[\\w](?:[\\w-]*[\\w])?";
Copy link
Contributor

Choose a reason for hiding this comment

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

regExp is too complex ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok.


return (
<div className={styles.form}>
<form className={styles.form} onSubmit={e => modifyUser(e)} method="post">
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to pass event to onSubmit

Copy link
Contributor Author

@whDongRui whDongRui Sep 27, 2018

Choose a reason for hiding this comment

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

This change for prevent page refresh when submit

@sunnywx sunnywx merged commit ab484c0 into openpitrix:master Sep 27, 2018
@sunnywx
Copy link
Contributor

sunnywx commented Sep 27, 2018

fix: #348

@whDongRui whDongRui deleted the api/profile branch January 17, 2019 06:41
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.

2 participants