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

users: add user favorite support #1864

Merged
merged 38 commits into from
Oct 12, 2021
Merged

users: add user favorite support #1864

merged 38 commits into from
Oct 12, 2021

Conversation

pnengchu
Copy link
Contributor

  • Identified the issue which this PR solves.
  • Read the CONTRIBUTING document.
  • Code builds clean without any errors or warnings.
  • Added appropriate tests for any new functionality.
  • All new and existing tests passed.
  • Added comments in the code, where necessary.
  • Ran make check to catch common errors. Fixed any that came up.

Description:
End Users may now set favorites on other users for a custom experience. This feature is replicated from Escalation Policies and similar functionalities that involve setting user favorites from the UI.

Which issue(s) this PR fixes:
Fixes #1086

Screenshots:
Screen Shot 2021-08-17 at 2 35 07 PM
Screen Shot 2021-08-17 at 2 34 53 PM

pnengchu and others added 22 commits July 15, 2021 10:32
@spencerpauly spencerpauly self-requested a review August 17, 2021 20:05
spencerpauly
spencerpauly previously approved these changes Aug 19, 2021
@@ -244,8 +245,17 @@ export default function UserDetails(props) {
icon: <EditIcon />,
handleOnClick: () => setShowEdit(true),
},
<QuerySetFavoriteButton
Copy link
Contributor

Choose a reason for hiding this comment

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

Could optionally also do something like:

        secondaryActions={[
          <QuerySetFavoriteButton
            key='secondary-action-favorite'
            userID={props.userID}
          />,
        ].concat(
          isAdmin
            ? [
                {
                  label: 'Delete',
                  icon: <Delete />,
                  handleOnClick: () => setShowUserDeleteDialog(true),
                },
                {
                  label: 'Edit',
                  icon: <EditIcon />,
                  handleOnClick: () => setShowEdit(true),
                },
              ]
            : [],
        )}

but looking at both pieces of code I like yours more. Yours is explicit that one chunk of buttons are shown if you're an admin and a completely separate chunk (that may or may not overlap the first chunk) is shown if not an admin.

migrate/migrations/20210817132557-add-user-favorite.sql Outdated Show resolved Hide resolved
web/src/cypress/support/util.ts Outdated Show resolved Hide resolved
spencerpauly
spencerpauly previously approved these changes Aug 23, 2021
spencerpauly
spencerpauly previously approved these changes Aug 25, 2021
user/search.go Outdated Show resolved Hide resolved
user/store.go Show resolved Hide resolved
user/store.go Show resolved Hide resolved
@stale
Copy link

stale bot commented Oct 3, 2021

This pull request has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale This is inactive label Oct 3, 2021
@stale stale bot removed the stale This is inactive label Oct 6, 2021
mastercactapus
mastercactapus previously approved these changes Oct 6, 2021
@pnengchu pnengchu merged commit b8450e3 into master Oct 12, 2021
@pnengchu pnengchu deleted the favorite-users branch October 12, 2021 15:09
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.

Add Favorites button to Users
4 participants