-
Notifications
You must be signed in to change notification settings - Fork 247
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
escalation policy: add user favorite support #1567
Conversation
…mponent for policydetails
@@ -7,6 +7,7 @@ const query = gql` | |||
nodes { | |||
id | |||
name | |||
isFavforite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isFavforite | |
isFavorite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed. Good catch, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I found one bit that looks missed: when creating a new EP we should set it as a favorite of the current user. See graphql2/graphqlapp/service.go:149
as an example.
Short would be to add a favorite
field to CreateEscalationPolicyInput
and update the UI to pass it as true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should write an integration test for this, but I'm OK doing that as a follow up PR. Looks great!
migrate/migrations/20210511113508-add-escalation-policies-favorite.sql
Outdated
Show resolved
Hide resolved
migrate/migrations/20210511113508-add-escalation-policies-favorite.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seeing the escalation policy favorited on creation - double check the input being passed into createPolicy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the integration test here, otherwise, there's a good chance the follow-up PR doesn't happen until something breaks.
There's already a favorites.ts
file with all the other supported ones and a helper function to make it really easy. Let me know if you need help with this, you will just need to add a call to check
similar to Schedules, but go to the /services
page instead (service create has a SearchSelect for EP).
You will also need to make a small change in support/ep.ts
to pass along the favorite
parameter, and add the same to ep.d.ts
in the types
directory. (all under cypress/
)
? `Unset as a Favorite ${typeName.toLowerCase()}` | ||
: `Set as a Favorite ${typeName.toLowerCase()}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can use _.startCase
so it says Set as Favorite Escalation Policy
instead of Set as Favorite escalationpolicy
? `Unset as a Favorite ${typeName.toLowerCase()}` | |
: `Set as a Favorite ${typeName.toLowerCase()}` | |
? `Unset as a Favorite ${_.startCase(typeName)}` | |
: `Set as a Favorite ${_.startCase(typeName)}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed, applied .toLowerCase() to account for Service, Rotation, Schedule checks
web/src/cypress/support/ep.ts
Outdated
@@ -35,6 +36,7 @@ function createEP(ep?: EPOptions): Cypress.Chainable<EP> { | |||
name: ep.name || 'SM EP ' + c.word({ length: 8 }), | |||
description: ep.description || c.sentence(), | |||
repeat: ep.repeat || c.integer({ min: 1, max: 5 }), | |||
favorite: ep.favorite, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fall back to random:
favorite: ep.favorite, | |
favorite: ep.favorite ?? c.bool(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
…into esc-policies-fav
make check
to catch common errors. Fixed any that came up.Description:
Users may now set favorites on Escalation Policies. This feature is replicated from Schedules and Services.
Which issue(s) this PR fixes:
Fixes #1085
Screenshots:
Additional Info:
High-Level overview of changes:
-minor refactor of PolicyRouter.js