Skip to content

Commit 83def52

Browse files
authored
fix 2934 removed singlePage option, change default value virtualScroll (#2935)
1 parent 934ce42 commit 83def52

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

web/client/components/data/download/DownloadDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DownloadDialog extends React.Component {
4747
{name: "native", label: "Native"},
4848
{name: "EPSG:4326", label: "WGS84"}
4949
],
50-
virtualScroll: false
50+
virtualScroll: true
5151
};
5252

5353
componentDidMount() {

web/client/components/data/download/DownloadOptions.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = class extends React.Component {
4242
wfsFormats: [],
4343
formats: [],
4444
srsList: [],
45-
virtualScroll: false
45+
virtualScroll: true
4646
};
4747

4848
getSelectedFormat = () => {
@@ -82,6 +82,8 @@ module.exports = class extends React.Component {
8282
value={this.getSelectedSRS()}
8383
onChange={(sel) => this.props.onChange("selectedSrs", sel.value)}
8484
options={this.props.srsList.map(f => ({value: f.name, label: f.label || f.name}))} />
85+
86+
{/* TODO for the future remove the virtualScroll prop since is no longer used*/}
8587
{this.props.virtualScroll ? null : <Checkbox checked={this.props.downloadOptions.singlePage} onChange={() => this.props.onChange("singlePage", !this.props.downloadOptions.singlePage ) }>
8688
<Message msgId="wfsdownload.downloadonlycurrentpage" />
8789
</Checkbox>}

web/client/components/data/download/__tests__/DownloadOptions-test.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,22 @@ describe('Test for DownloadOptions component', () => {
4343
onChange: () => {}
4444
};
4545
spyOn(events, "onChange");
46-
ReactDOM.render(<DownloadOptions onChange={events.onChange} downloadOptions={{selectedFormat: "test"}} formats={[{name: "test"}]}/>, document.getElementById("container"));
46+
ReactDOM.render(<DownloadOptions onChange={events.onChange} virtualScroll={false} downloadOptions={{selectedFormat: "test"}} formats={[{name: "test"}]}/>, document.getElementById("container"));
4747
const check = document.querySelector('input[type=checkbox]');
4848
check.click();
4949
expect(events.onChange).toHaveBeenCalled();
5050

5151
});
52-
it('singlePage checkbox not to render in virtualScroll mode', () => {
53-
ReactDOM.render(<DownloadOptions virtualScroll downloadOptions={{selectedFormat: "test"}} formats={[{name: "test"}]}/>, document.getElementById("container"));
52+
it('singlePage checkbox not to render: virtualScroll=true', () => {
53+
ReactDOM.render(<DownloadOptions downloadOptions={{selectedFormat: "test"}} formats={[{name: "test"}]}/>, document.getElementById("container"));
5454
const check = document.querySelector('input[type=checkbox]');
5555
expect(check).toNotExist();
5656

5757
});
58+
it('singlePage checkbox to render: virtualScroll=false', () => {
59+
ReactDOM.render(<DownloadOptions virtualScroll={false} downloadOptions={{selectedFormat: "test"}} formats={[{name: "test"}]}/>, document.getElementById("container"));
60+
const check = document.querySelector('input[type=checkbox]');
61+
expect(check).toExist();
62+
63+
});
5864
});

0 commit comments

Comments
 (0)