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

Fixed the_geom configured to initial state on query form reset #1827

Merged
merged 1 commit into from
May 15, 2017
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
6 changes: 5 additions & 1 deletion web/client/reducers/__tests__/queryform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,17 @@ describe('Test the queryform reducer', () => {
};

const initialState = {
test: true
test: true,
spatialField: {
attribute: "GEOMETRY"
}
};

let state = queryform(initialState, testAction);
expect(state).toExist();

expect(state.test).toEqual(true);
expect(state.spatialField.attribute).toEqual("GEOMETRY");
});

it('Show Generated Filter', () => {
Expand Down
6 changes: 4 additions & 2 deletions web/client/reducers/queryform.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,15 @@ function queryform(state = initialState, action) {
return newState;
}
case REMOVE_SPATIAL_SELECT: {
return assign({}, state, {spatialField: assign({}, state.spatialField, initialState.spatialField)});
let spatialField = assign({}, initialState.spatialField, { attribute: state.spatialField.attribute });
return assign({}, state, {spatialField: assign({}, state.spatialField, spatialField)});
}
case SHOW_SPATIAL_DETAILS: {
return assign({}, state, {showDetailsPanel: action.show});
}
case QUERY_FORM_RESET: {
return assign({}, state, initialState);
let spatialField = assign({}, initialState.spatialField, { attribute: state.spatialField.attribute });
return assign({}, state, initialState, {spatialField});
}
case SHOW_GENERATED_FILTER: {
return assign({}, state, {showGeneratedFilter: action.data});
Expand Down