From: mtmail Date: Wed, 27 Oct 2021 16:33:10 +0000 (+0200) Subject: new config option -Reverse_Only- (#166) X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/0aa28e47e87fc78e152de7f1750e97ccf260c595?ds=sidebyside;hp=c17ad0ef44aa8e1c091d8d1ab729a5ce6c61e222 new config option -Reverse_Only- (#166) --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5833130..a8c25ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,10 @@ jobs: run: yarn build - name: Testing - run: | - yarn test - API_ON_SAME_PORT=1 yarn test + run: yarn test + + - name: Testing API_ON_SAME_PORT + run: API_ON_SAME_PORT=1 yarn test + + - name: Testing REVERSE_ONLY + run: REVERSE_ONLY=1 yarn test diff --git a/dist/config.defaults.js b/dist/config.defaults.js index ccbddfc..1ab8bd9 100644 --- a/dist/config.defaults.js +++ b/dist/config.defaults.js @@ -12,6 +12,9 @@ let Nominatim_Config = { // Additional query parameters for Nominatim API. Nominatim_API_Endpoint_Params: {}, + // If database has no search index, then hide search page + Reverse_Only: false, + // relative path or full URL Images_Base_Url: 'mapicons/', diff --git a/dist/search.html b/dist/search.html index 99aa904..5e19ab7 100644 --- a/dist/search.html +++ b/dist/search.html @@ -14,6 +14,12 @@ + + diff --git a/src/components/DetailsOneRow.svelte b/src/components/DetailsOneRow.svelte index 1d63d75..ccc38cf 100644 --- a/src/components/DetailsOneRow.svelte +++ b/src/components/DetailsOneRow.svelte @@ -10,7 +10,7 @@ export let bMarkUnusedLines = false; $: bAddressLineUsed = addressLine.isaddress; - + $: reverse_only = Nominatim_Config.Reverse_Only; @@ -29,9 +29,9 @@ {#if addressLine.osm_id} details - {:else if addressLine.type.match(/^country/)} + {:else if !reverse_only && addressLine.type.match(/^country/)} search by name - {:else if addressLine.type === 'postcode'} + {:else if !reverse_only && addressLine.type === 'postcode'} search by name {/if} diff --git a/src/components/Error.svelte b/src/components/Error.svelte index 9267963..e8702b9 100644 --- a/src/components/Error.svelte +++ b/src/components/Error.svelte @@ -14,6 +14,6 @@
{error_message} - +
{/if} diff --git a/src/components/Header.svelte b/src/components/Header.svelte index a93d6c5..0fbead9 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -8,6 +8,7 @@ $: view = $page.tab; $: page_title = Nominatim_Config.Page_Title; + $: reverse_only = Nominatim_Config.Reverse_Only; let map_lat; let map_lon; @@ -67,7 +68,7 @@