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

[Enhancement] Added the ability to pass supported data types when exporting (#105) #1336

Merged
merged 2 commits into from
Dec 3, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/modal-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {createSelector} from 'reselect';
import get from 'lodash.get';
import document from 'global/document';

import {EXPORT_DATA_TYPE_OPTIONS} from 'constants/default-settings';
import ModalDialogFactory from './modals/modal-dialog';
import {exportJson, exportHtml, exportData, exportImage, exportMap} from 'utils/export-utils';
import {isValidMapInfo} from 'utils/map-info-utils';
Expand Down Expand Up @@ -375,6 +376,7 @@ export default function ModalContainerFactory(
template = (
<ExportDataModal
{...uiState.exportData}
supportedDataTypes={EXPORT_DATA_TYPE_OPTIONS}
datasets={datasets}
applyCPUFilter={this.props.visStateActions.applyCPUFilter}
onClose={this._closeModal}
Expand Down
7 changes: 6 additions & 1 deletion src/components/modals/export-data-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const ExportDataModalFactory = () => {

render() {
const {
supportedDataTypes,
datasets,
selectedDataset,
dataType,
Expand Down Expand Up @@ -125,7 +126,7 @@ const ExportDataModalFactory = () => {
</div>
</div>
<div className="selection">
{EXPORT_DATA_TYPE_OPTIONS.map(op => (
{supportedDataTypes.map(op => (
<StyledType
key={op.id}
selected={dataType === op.id}
Expand Down Expand Up @@ -182,6 +183,10 @@ const ExportDataModalFactory = () => {
}
}
ExportDataModal.propTypes = propTypes;
ExportDataModal.defaultProps = {
supportedDataTypes: EXPORT_DATA_TYPE_OPTIONS
};

return injectIntl(ExportDataModal);
};

Expand Down