-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes #38941 - Implement CSV exports on the hosts overview #10793
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
base: develop
Are you sure you want to change the base?
Conversation
|
If I click Manage Columns and change my columns, and then export to CSV, does the CSV contain different columns? Same question for the legacy page and the new UI. |
|
Yes. Export for both Legacy and new hosts page would show different contents as you change the managed columns. Also noticed the export file would contain all the hosts in the page. |
a55dae9 to
9e6a0c2
Compare
chris1984
left a comment
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.
Nice work Lucy, left a few comments, have not tested yet.
webpack/assets/javascripts/react_app/components/HostsIndex/index.js
Outdated
Show resolved
Hide resolved
9e6a0c2 to
e19c1ce
Compare
jeremylenz
left a comment
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.
Thanks @lfu! A few issues I found in initial testing:
- The column names do not seem to match the UI. For example, in the UI I see "OS" but in the CSV I see "Operatingsystem"
- I added the "Type" column (image mode/package mode) but this is not exported
- The order of the columns does not match the UI. (Not as big of a concern, but nice to have)
- If I have more than one page of results, the Legacy UI exports only the first page. In New UI I still get all hosts.
- If I have hosts filtered with a search, I still get all hosts.
- Can you also open a PR in foreman_rh_cloud to add those columns?
e19c1ce to
57fad24
Compare
It is by design.
|
jeremylenz
left a comment
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.
A general comment about the approach - My concern here is that
- CSV export definitions rely on pagelets
- When the legacy ERB All Hosts page goes away eventually, pagelets will also go away
- This will break CSV exports.
We already define columns in parallel for the React pages and with the legacy pagelets, but only pagelets have the CSV definitions. Might be worth thinking about, either in a followup technical debt issue or here.
Could we work on the new JS columns definitions for CSV export later when ERB is going away? @jeremylenz |
Yes, that's fine with me. Can you please open an issue to track it :) |
Exportbutton on the new hosts overview page.OrganizationandLocationto pagelet for CSV export.Related to Katello/katello#11591.
Related to theforeman/foreman_rh_cloud#1132.
To test
Before apply this patch.
Hosts - All Hosts - Legacy UI - Export - save the exported CSV file A
Hosts - All Hosts - Content Hosts - Export - save the exported CSV file B
Apply this patch.
Hosts - All Hosts - Legacy UI - Export
The exported file should be the same as the saved exported CSV file A
Hosts - All Hosts - Export
The columns in the exported file should contain the columns exported from CSV file A + CSV file B