Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Implements export view to excel button #1202

Merged
merged 3 commits into from
Sep 18, 2017
Merged

Implements export view to excel button #1202

merged 3 commits into from
Sep 18, 2017

Conversation

pablosichert
Copy link
Contributor

Downloads all selected rows as excel spreadsheet
@teosarca teosarca self-assigned this Sep 18, 2017
Copy link
Member

@teosarca teosarca left a comment

Choose a reason for hiding this comment

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

Hi @pablosichert ,

thanks for the PR. Did a quick review and requested some changes.
wdyt?

@@ -218,6 +224,9 @@ class Subheader extends Component {
} while (currentNode && currentNode.children && (currentNode.type !== 'window'));
}

// TODO: refine gridView conditional
const gridView = parseInt(windowType) === 143;
Copy link
Member

Choose a reason for hiding this comment

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

atm i would suggest to not enforce it at all. Just let it be enabled for any view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another option would be to only enable the button if selected.length > 0. Or do you want the button the be there when nothing is selected (better discoverabilty of that feature)?

{gridView && query && (
<a
className="subheader-item js-subheader-item"
href={`/rest/api/documentView/${windowType}/${query.viewId}/export/excel?selectedIds=${selected.join(',')}`}
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the URL schema from your comment - or do you refer to explicitly prepending config.API_URL? Maybe I'm overlooking something here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, got it - I need to prepend config.API_URL and strip /rest/api from the hardcoded string.

@pablosichert
Copy link
Contributor Author

Thanks for looking over the changes. Updated accordingly to your comments.

@teosarca teosarca merged commit c8a423d into master Sep 18, 2017
@teosarca teosarca deleted the dev-1197 branch September 18, 2017 16:03
@teosarca
Copy link
Member

thanks!

@pablosichert pablosichert changed the title [WIP] Implements export view to excel button Implements export view to excel button Sep 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants