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

Added support for export of records with MSExcel #178

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/record/ExportRecordsDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const ExportRecordsDropdown = ({ records, onExport }) => {
variant="primary"
className="action-button"
>
{/*Excel export is currently not supported by the backend, uncommenting for demonstration purposes*/}
<Dropdown.Item onClick={() => onExport(ExportType.EXCEL)}>{i18n("records.export.excel")}</Dropdown.Item>
<Dropdown.Item onClick={() => onExport(ExportType.JSON)}>{i18n("records.export.json")}</Dropdown.Item>
</DropdownButton>
Expand Down
5 changes: 4 additions & 1 deletion src/components/record/RecordsController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ class RecordsController extends React.Component {
trackPromise(
this.props.exportRecords(exportType, {
...this.state.filters,
sort: sortToParams(this.state.sort),
// Uncomment if paging is required for export
// sort: sortToParams(this.state.sort),
// page: this.state.pageNumber,
// size: BrowserStorage.get(STORAGE_TABLE_PAGE_SIZE_KEY, DEFAULT_PAGE_SIZE),
}),
"records",
);
Expand Down
2 changes: 1 addition & 1 deletion src/constants/DefaultConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const HttpHeaders = {

export const MediaType = {
FORM_URLENCODED: "application/x-www-form-urlencoded",
EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
EXCEL: "application/vnd.ms-excel",
JSON: "application/json",
};

Expand Down
Loading