Skip to content

Commit

Permalink
fix: remove csv/xml downloads (start) [DHIS2-14482] (#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Jan 16, 2023
1 parent 59841d4 commit 2e0afa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
31 changes: 9 additions & 22 deletions src/List/DownloadObjectDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import MenuItem from 'material-ui/MenuItem';
import Checkbox from 'material-ui/Checkbox';
import camelCaseToUnderscores from 'd2-utilizr/lib/camelCaseToUnderscores';

const formats = {
json: 'JSON',
xml: 'XML',
csv: 'CSV',
};
const format = 'json';

const compressions = {
zip: 'Zip',
Expand All @@ -27,7 +23,10 @@ const styles = {
marginTop: '20px',
},
downloadCount: {
marginTop: 0,
marginTop: '8px',
},
downloadFormat: {
display: 'inline-block',
},
};

Expand All @@ -45,7 +44,6 @@ export default class DownloadObjectDialog extends Component {
super(props);

this.state = {
format: 'json',
compression: 'zip',
skipSharing: false,
};
Expand All @@ -58,7 +56,7 @@ export default class DownloadObjectDialog extends Component {
};

getDownloadUrl() {
const { format, compression, skipSharing } = this.state;
const { compression, skipSharing } = this.state;
const { queryParamFilters, pluralName } = this.props;

const compressionStr = compression !== 'none' ? `.${compression}` : '';
Expand All @@ -78,20 +76,9 @@ export default class DownloadObjectDialog extends Component {
renderForm() {
return (
<div>
<SelectField
value={this.state.format}
onChange={this.handleChange.bind(this, 'format')}
floatingLabelText={this.t('format')}
fullWidth
>
{Object.keys(formats).map(format => (
<MenuItem
value={format}
primaryText={formats[format]}
key={format}
/>
))}
</SelectField>
<span style={styles.downloadFormat}>
{this.t('download_format_json')}
</span>
<SelectField
value={this.state.compression}
onChange={this.handleChange.bind(this, 'compression')}
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/i18n_module_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,7 @@ confirm_delete_option_group=Do you want to delete this option group?
field_mask=Field mask
download=Download
download_metadata=Download metadata
format=Format
download_format_json=Download format: JSON
compression=Compression
locales=Locales
the_download_contains_$$total$$_$$modelType$$=The download contains $$total$$ $$modelType$$
Expand Down

0 comments on commit 2e0afa6

Please sign in to comment.