Skip to content

Updates from Settings Profile - Account Challenge #18

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

Merged
merged 2 commits into from
Jul 10, 2018

Conversation

dedywahyudi
Copy link
Collaborator

@dedywahyudi dedywahyudi commented Jul 9, 2018

@birdofpreyru

Here's the updates from Topcoder Settings Profile - Account Challenge
Attached the patch file. This PR already applied the patch.

develop.patch.zip

FYI: Not include the Email Verification bus Event yet.

cc @ThomasKranitsas @cwdcwd @urwithat

@dedywahyudi dedywahyudi requested a review from birdofpreyru July 9, 2018 10:05
@@ -292,7 +292,6 @@ function onAddWebLinkDone(state, { payload, error }) {

if (error) {
logger.error('Failed to add web link', payload);
fireErrorMessage('ERROR: Failed to add web link!');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why to remove UI error message in case of error? Without it user will have no idea, whether he should wait more, or operation failed, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

https://github.com/topcoder-platform/community-app/blob/f94c9106fa3719e003256726ad1b8a9364fe9124/src/shared/reducers/page/settings.js#L87

because i added new error message keep behavior like existing code, https://monosnap.com/file/uNhRA5ZhBzOWXKwVCYXZDm7ZAiTVHp
you can confirm this add new weblink at https://www.topcoder.com/settings/profile/

fireErrorMessage will throw a global error message, that not looks good for user

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can bend existing look and behavior to follow newer TC styles, and codebase. The problem is that doing so, you ask every user of profile actions / reducers to care himself about error reporting in the pages where these actions are used. And the original approach automatically ensures error reporting.

@@ -342,7 +341,6 @@ function onLinkExternalAccountDone(state, { payload, error }) {

if (error) {
logger.error('Failed to link external account', payload);
fireErrorMessage('ERROR: Failed to link external account!');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -39,9 +43,11 @@ function create(defaultState = initState) {
return handleActions({
[a.profile.toggleTab]: (state, { payload }) => ({ ...state, currentProfileTab: payload }),
[a.tools.toggleTab]: (state, { payload }) => ({ ...state, currentToolsTab: payload }),
[a.account.toggleTab]: (state, { payload }) => ({ ...state, currentAccountTab: payload }),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm... I also missed the point at which we started include UI actions / reducers into topcoder-react-lib, but it is not correct: unlike actions / reducers related to communication with Topcoder APIs, that can, and should be effectively reused between different Topcoder apps, UI-related actions / reducers belong only to the apps that need them, thus should not be placed into topcoder-react-lib.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm.. i think so. The first committer of this file is not me. so i just follow existing code to add new function for this part and keep consistent

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, but as we have noticed it now, let's move it to the appropriate place?

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK. I'll move ui actions / reducers to community-app, and put back removed error messages

@birdofpreyru
Copy link
Collaborator

@dedywahyudi I'd say, let's move ui actions / reducers to community-app, and put back removed error messages?

@dedywahyudi
Copy link
Collaborator Author

@birdofpreyru Wait, I'll get back to you, checking with our developer.

@dedywahyudi
Copy link
Collaborator Author

@birdofpreyru please check the updated commits.

Let me know what you think.

@birdofpreyru
Copy link
Collaborator

@dedywahyudi visually, looks good to me. Have you tested the update along with community-app?

@dedywahyudi
Copy link
Collaborator Author

@birdofpreyru yes, tested and look good with community-app.

@birdofpreyru birdofpreyru merged commit ef54c53 into develop Jul 10, 2018
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