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

[#55021] Free choice of columns in exports #16705

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

EinLama
Copy link
Contributor

@EinLama EinLama commented Sep 11, 2024

Attention

This is my first real PR for OpenProject. Please be extra thorough when reviewing this. I took care when assembling this PR, but I probably forgot something 😉

Ticket

https://community.openproject.org/wp/55021

What are you trying to accomplish?

In the project list, you can now select and switch the order of the ID and identifier columns.

Previously, these columns were not visible, but they were always part of the CSV and XLS export. Now, those columns are only part of the export when they have been explicitly configured in the view.

In other words: the ID and identifier columns now behave like all other columns.

Screenshots

image
image
image

CSV export sample (with id and identifier not showing in the view):

cat ~/Downloads/OpenProject_Projects_2024-09-1120240911-58047-1ur3j5.csv
Favorite,Name,Status,Public,Created on,Latest activity at,Required disk storage
"",Demo project,On track,true,09/03/2024 11:50 AM,09/03/2024 11:50 AM,0.0
"",Scrum project,On track,true,09/03/2024 11:50 AM,09/03/2024 11:50 AM,0.0
"",[dev] Empty,"",true,09/03/2024 11:50 AM,09/04/2024 10:36 AM,0.0
"",[dev] Work package sharing,"",true,09/03/2024 11:50 AM,09/03/2024 11:50 AM,0.0
"",[dev] Large,"",true,09/03/2024 11:50 AM,09/03/2024 11:50 AM,0.0
"",[dev] Large child,"",true,09/03/2024 11:50 AM,09/03/2024 11:50 AM,0.0
"",[dev] Custom fields,"",true,09/03/2024 11:50 AM,09/03/2024 11:50 AM,0.0

What approach did you choose and why?

I decided to hide the id and identifier columns by default. Since they have not been part of the default project list view until now I figured that they are not important to most users. If needed, they can now be configured to show up.

The columns were part of the export by default, but from my understanding, users visit this page more often than they export it. Hence, omitting these columns by default is the best choice. Users relying on the columns being present in an export might run into issues, though ☝🏻 We should include a notice in the release notes.

Please note that some columns are only visible for admins. I did not see a reason to hide id and identifier here, so I added them for everyone to see.

Translations for the "new columns" worked out of the box 👍🏻

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

From now on, if you want to export these columns, you must explicitly
select these in the view configuration before exporting. Your export
will always reflect the columns that you see in the web view.
@EinLama EinLama force-pushed the feature/55021-free-choice-of-columns-in-exports branch from 625fc1c to a8d365e Compare September 11, 2024 09:00
@EinLama EinLama marked this pull request as ready for review September 11, 2024 11:48
Both id and identifier are simple strings. No need no mark them as
html_safe.
@EinLama EinLama force-pushed the feature/55021-free-choice-of-columns-in-exports branch from 76de79e to 3c2a48c Compare September 11, 2024 11:55
@oliverguenther oliverguenther self-requested a review September 12, 2024 07:15
Copy link
Member

@oliverguenther oliverguenther left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@oliverguenther oliverguenther merged commit c3f2c37 into dev Sep 12, 2024
12 checks passed
@oliverguenther oliverguenther deleted the feature/55021-free-choice-of-columns-in-exports branch September 12, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants