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

Feature/favorite max notification TM-1618 #819

Merged
merged 15 commits into from
Jun 9, 2020

Conversation

scott062
Copy link

@scott062 scott062 commented Mar 31, 2020

  • Add system message for max favorites of 250 (for either ap or pv - so 500 total)
  • Add test for 507 http error code response
  • Conditional toast error notification based on 507 res

Depends on: MetaPhase-Consulting/State-TalentMAP-API#367

@scott062
Copy link
Author

Note: deleted duplicate branch that I had unnecessarily branched off of Elizabeth's pagination PR

@@ -51,6 +51,7 @@ export const DELETE_FAVORITE_SUCCESS = (pos, onToggle) => RemoveSuccess({ pos, o
export const DELETE_FAVORITE_ERROR = () => "We're experiencing an error attempting to remove this position from your Favorites. Please try again.";
export const ADD_FAVORITE_SUCCESS = pos => FavoriteSuccess({ pos });
export const ADD_FAVORITE_ERROR = () => "We're experiencing an error attempting to add this position to your Favorites. Please try again.";
export const ADD_FAVORITE_LIMIT_ERROR = 'You have reached the favorites limit of 250. Please remove a favorite and try again.';

Choose a reason for hiding this comment

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

Can we have the API own and send back the limit number? Then the front-end doesn't need to be a source of truth and would reduce any back and forth changes should we decide to change the limit.

@elizabeth-jimenez
Copy link

elizabeth-jimenez commented Mar 31, 2020

Discussed in Slack, just putting here for consistency: Custom Toast notification for AP vs PV.

Ex: You have reached favorites limit of 250 for Open Positions. Please remove an Open Positions favorite and try again.

Comment on lines 233 to 241
if (remove) {
message = SystemMessages.DELETE_FAVORITE_ERROR();
} else if (response.status === 507 && isPV) {
message = SystemMessages.ADD_FAVORITE_LIMIT_ERROR_PV(limit);
} else if (response.status === 507) {
message = SystemMessages.ADD_FAVORITE_LIMIT_ERROR_AP(limit);
} else {
message = SystemMessages.ADD_FAVORITE_ERROR();
}
Copy link

Choose a reason for hiding this comment

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

👍

src/actions/userProfile.js Outdated Show resolved Hide resolved
@mjoyce91 mjoyce91 added the WIP Work in progress label Apr 3, 2020
@scott062 scott062 requested a review from mjoyce91 May 27, 2020 16:05
@scott062 scott062 removed the WIP Work in progress label May 27, 2020
@mjoyce91 mjoyce91 merged commit 4c1d6f5 into dev Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants