Skip to content

Commit

Permalink
feat: include wfs search and refactor MultiSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch committed Nov 28, 2024
1 parent d75d3d4 commit ada52b2
Show file tree
Hide file tree
Showing 17 changed files with 918 additions and 527 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ Several global settings for the client can be configured via the [`gis-client-co
| wfsLockFeatureEnabled | Whether WFS LockFeature is enabled during feature editing or not. | false |
| documentationButtonVisible | Whether the button in the user menu to open the documentation is visible or not. | true |
| enableFallbackConfig | Whether the default application configuration should be loaded without any given application ID or not. | true |
| search.nominatimUrl | The nominatim URL to use. | 'https://nominatim.openstreetmap.org/search?' |
| search.solrBasePath | Base path to a solr instance. | '/search/query' |
| search.coreName | Solr core name. | 'search' |
| search.defaultUseViewBox | Whether the search is restricted to the current view box. | true |
| search.useNominatim | Whether to use Nominatim. | true |
| search.groupByCategory | Groups search results by 'category' text field. If disabled, the layer title will be used instead. | true |
| search.useSolrHighlighting | Enable / disable solr search result highlighting. | true |
| search.delay | Delay in milliseconds before search is triggered (debouncing). | 1000 |
Expand Down
2 changes: 1 addition & 1 deletion resources/config/gis-client-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ var clientConfig = {
}
},
search: {
nominatimUrl: 'https://nominatim.openstreetmap.org/search?',
solrBasePath: '/search/query',
coreName: 'search',
defaultUseViewBox: true,
useNominatim: true,
groupByCategory: true,
useSolrHighlighting: true,
activateLayerOnClick: true,
Expand Down
27 changes: 0 additions & 27 deletions src/components/BasicNominatimSearch/index.spec.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions src/components/BasicNominatimSearch/index.tsx

This file was deleted.

81 changes: 41 additions & 40 deletions src/components/MultiSearch/index.less
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
.search {

.multi-search {
position: relative;

span.ant-input-group-addon {
background-color: var(--secondaryColor);
.ant-space-compact {
width: 100%;

button {
border-radius: 0;

span.anticon {
color: var(--primaryColor);
&.ant-btn-variant-outlined:hover {
color: var(--secondaryColor);
}
}
}

>div {
.search-result-div {
box-shadow: var(--componentShadow);
margin-top: 2px;
top: unset;
width: 100%;

.ant-collapse {
.search-result-div {
box-shadow: var(--componentShadow);
margin-top: 2px;
top: unset;
width: 100%;

overflow-y: auto;
max-height: 80vh;
.ant-collapse {
overflow-y: auto;
max-height: 80vh;
background-color: white;

.ant-collapse-header {
line-height: unset;
border-bottom: solid 1px var(--secondaryColor);
background-color: color-mix(in srgb, var(--secondaryColor) 15%, white);
}
.ant-collapse-header {
line-height: unset;
border-bottom: solid 1px var(--secondaryColor);
background-color: color-mix(in srgb, var(--secondaryColor) 15%, white);
}

.ant-collapse-content {
max-height: 25vh;
overflow-y: auto;
.ant-collapse-content {
max-height: 25vh;
overflow-y: auto;

.ant-list-item {
justify-content: flex-start;
.ant-list-item {
justify-content: flex-start;

.result-prefix:not(:empty) {
width: 130px;
.result-prefix:not(:empty) {
width: 130px;

.ant-tag {
width: 100%;
text-align: center;
}
.ant-tag {
width: 100%;
text-align: center;
}
}

.result-text {
flex: 1;
}
.result-text {
flex: 1;
}
}
}
}
}

.no-search-result-div {
background-color: white;
position: absolute;
width: 100%;
}
.no-search-result-div {
background-color: white;
position: absolute;
width: 100%;
}
}
8 changes: 1 addition & 7 deletions src/components/MultiSearch/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ import MultiSearch from './index';

describe('<MultiSearch />', () => {

it('is defined', () => {
expect(MultiSearch).not.toBeUndefined();
});

it('can be rendered', () => {
const {
container
} = render(
<MultiSearch
useNominatim={true}
/>, {
<MultiSearch />, {
wrapper: createReduxWrapper()
}
);
Expand Down
Loading

0 comments on commit ada52b2

Please sign in to comment.