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

Distribution export -- item columns are no longer in alphbetical order. Fix it. #4593

Closed
2 tasks
cielf opened this issue Aug 11, 2024 · 5 comments · Fixed by #4617
Closed
2 tasks

Distribution export -- item columns are no longer in alphbetical order. Fix it. #4593

cielf opened this issue Aug 11, 2024 · 5 comments · Fixed by #4617
Assignees

Comments

@cielf
Copy link
Collaborator

cielf commented Aug 11, 2024

Summary

The items columns in the distribution export should be in lower-case alphabetical order.

Why?

Findability and stability.

Details

To recreate, sign in as org_admin1@example.com. Choose Distributions, then click "Export Distributions". If you look at the entire set of columns for the items, you will see that some of them are not in alphabetical order (they're probably in added-to-the-database order).
The columns relating to items should be in lower-case alphabetical order.

Criteria for completion

  • Item-related Columns are in lower-case alphabetical order in the distribution export
  • automated tests to confirm this.
@cielf cielf added Help Wanted Groomed + open to all! Difficulty—Beginner labels Aug 11, 2024
@auliafaizahr
Copy link
Contributor

I'd like to give this issue a try if no one has taken it yet.

@github-actions github-actions bot removed the Help Wanted Groomed + open to all! label Aug 14, 2024
@cielf
Copy link
Collaborator Author

cielf commented Aug 14, 2024

It's yours!

@auliafaizahr
Copy link
Contributor

so I just found that the item columns are not in alphabetical order since it shows in index page it was ordered by 'issued_at'

https://github.com/rubyforgood/human-essentials/blob/d648cb3fad29456633a927226bd1f0453e4e405c/app/controllers/distributions_controller.rb#L44C4-L48C75

@distributions = current_organization
                     .distributions
                     .includes(:partner, :storage_location, line_items: [:item])
                     .order('issued_at DESC')
                     .apply_filters(filter_params, helpers.selected_range)

image

my question is, should we also order the items by partner name alphabetically on the index page, or should we keep the current ordering by 'issued_at' there, and only apply alphabetical ordering for the CSV export?

Looking forward to your thoughts! Thank you!

@cielf
Copy link
Collaborator Author

cielf commented Aug 15, 2024

The rows in the distribution index are sorted by issued at, in reverse chronological order, and that's correct.

We want to reorder the columns for the items in the export, not the rows. I.e., the columns which correspond to items should appear in lower case alphabetical from left to right.

Hope that helps!

@auliafaizahr
Copy link
Contributor

Oh, I got it, so it need to reorder columns for the items like Adult Briefs (Medium/Large), Adult Briefs (Small/Medium), Adult Briefs (XXL), Adult Briefs (XXXL), Adult Briefs (XS/Small) etc alphabetically from left to right, sorry for the misunderstanding earlier 😅 I'll try my best on resolving this accordingly, thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants