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

Add sorting to my alerts #212

Merged
merged 16 commits into from
Mar 12, 2021
Merged

Add sorting to my alerts #212

merged 16 commits into from
Mar 12, 2021

Conversation

kryswisnaskas
Copy link
Collaborator

@kryswisnaskas kryswisnaskas commented Mar 4, 2021

Description of change
Adds sorting to "My Alerts"

How to test

  • pull changes
  • verify that my alerts can be sorted

Issue(s)

Checklist

  • Meets issue criteria
  • Code tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • Documentation updated

@kryswisnaskas kryswisnaskas marked this pull request as ready for review March 11, 2021 20:01
Copy link

@dcmcand dcmcand left a comment

Choose a reason for hiding this comment

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

Works well, but sorting causes a sideways shift because of the addition of the sort icon. Maybe adding a min-width to the columns would eliminate this shift? It is rather jarring for me.

};

MyAlerts.defaultProps = {
reports: [],
alertsSortConfig: { sortBy: 'startDate', direction: 'asc' },
alertsOffset: 0,
alertsPerPage: 7,

Choose a reason for hiding this comment

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

Should this default to 10?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it to 10, but right now since the pagination is not working it will be a placeholder only until we find a way to integrate the pagination with sorting (HHS#369)

@kryswisnaskas
Copy link
Collaborator Author

It is rather jarring for me.

I adjusted the width - it shouldn't jump now.

Copy link

@dcmcand dcmcand left a comment

Choose a reason for hiding this comment

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

🚀

Copy link

@rahearn rahearn left a comment

Choose a reason for hiding this comment

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

Lets just hide that pagination text

to={`/activity-reports/${id}`}
href={`/activity-reports/${id}`}
to={idLink}
href={idLink}
Copy link

Choose a reason for hiding this comment

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

Are both to and href required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed href.

} else {
to = offsetTo;
}
return `${from}-${to} of ${reportsCount}`;
Copy link

Choose a reason for hiding this comment

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

Let's hide this until pagination is active. With 11 reports the table is displaying all 11 (good, since otherwise one would be inaccessible) but this says 1-10 of 11 which is confusing

sequelize,
} from '../models';

const orderReportsBy = (sortBy, sortDir) => {
Copy link

Choose a reason for hiding this comment

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

Nice, I like pulling this out into its own function.

@kryswisnaskas kryswisnaskas merged commit 4b57ee0 into main Mar 12, 2021
@kryswisnaskas kryswisnaskas deleted the kw-add-sorting-to-my-alerts branch March 12, 2021 22:26
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.

4 participants