openfairdb icon indicating copy to clipboard operation
openfairdb copied to clipboard

Add country and state to ofDB while saving

Open david-ziegler opened this issue 6 years ago • 6 comments

The frontend can not add country and state by adding new entries. It needs to be done by the backend while saving to make it equal for all frontends.

david-ziegler avatar Dec 22 '17 16:12 david-ziegler

See this one: https://github.com/kartevonmorgen/openfairdb/issues/249

wellemut avatar Jul 11 '20 17:07 wellemut

@navid-kalaei We have worked on this issue already, with the goal, that all new or modified pins get automatically added country and state, so that people can filter the entries in a list for countries, even without a map. (https://github.com/kartevonmorgen/openfairdb/issues/249#issuecomment-657516061)

But still, this is not working.

  • The country and state field is only working, if people add the pin manually by clicking on the map.
  • If they just put the adress in the adress fields, but dont click on the map, no country is saved to the ofDB.

You can easily check it, if you open an entry like https://kartevonmorgen.org/#/?entry=16bad663a9024382b10cf1fb591e540e&center=52.397,13.286&zoom=15.00 in the backend: https://openfairdb.org/entries/16bad663a9024382b10cf1fb591e540e

Can we solve this?

wellemut avatar Sep 25 '20 07:09 wellemut

@navid-kalaei We have worked on this issue already, with the goal, that all new or modified pins get automatically added country and state, so that people can filter the entries in a list for countries, even without a map. (kartevonmorgen/openfairdb#249 (comment))

But still, this is not working.

  • The country and state field is only working, if people add the pin manually by clicking on the map.

  • If they just put the adress in the adress fields, but dont click on the map, no country is saved to the ofDB.

You can easily check it, if you open an entry like https://kartevonmorgen.org/#/?entry=16bad663a9024382b10cf1fb591e540e&center=52.397,13.286&zoom=15.00 in the backend: https://openfairdb.org/entries/16bad663a9024382b10cf1fb591e540e

Can we solve this? you are absolutely right and the reason for that is the country and state get fetched as a result of the user interaction with the map. It can be solved but comes with a considerable overhead both on the time to develop and the performance of the map. Because the action of resolving the address will be moved from the interaction with the map to all edits.

if we need to update states and countries for all entries a simple application for fixing entries is:

  1. way simpler to develop
  2. fixes all of the entries at once
  3. saves performance from the front-end

I'm able to develop such a fixation in python or javascript if you wanted me to

navid-kalaei avatar Sep 25 '20 07:09 navid-kalaei

Good idea. Great that you are thinking that far.

Would that script then run every night to add countries? Or how do we solve this for the furture?

Helmut Wolman

(mailed on the move) Mobil: 0049-15734448245 Mannheim

Navid Kalaei [email protected] schrieb am Fr., 25. Sep. 2020, 09:44:

@navid-kalaei https://github.com/navid-kalaei We have worked on this issue already, with the goal, that all new or modified pins get automatically added country and state, so that people can filter the entries in a list for countries, even without a map. (kartevonmorgen/openfairdb#249 (comment) https://github.com/kartevonmorgen/openfairdb/issues/249#issuecomment-657516061 )

But still, this is not working.

The country and state field is only working, if people add the pin manually by clicking on the map.

If they just put the adress in the adress fields, but dont click on the map, no country is saved to the ofDB.

You can easily check it, if you open an entry like https://kartevonmorgen.org/#/?entry=16bad663a9024382b10cf1fb591e540e&center=52.397,13.286&zoom=15.00 in the backend: https://openfairdb.org/entries/16bad663a9024382b10cf1fb591e540e

Can we solve this? you are absolutely right and the reason for that is the country and state get fetched as a result of the user interaction with the map. It can be solved but comes with a considerable overhead both on the time to develop and the performance of the map. Because the action of resolving the address will be moved from the interaction with the map to all edits.

if we need to update states and countries for all entries a simple application for fixing entries is:

  1. way simpler to develop
  2. fixes all of the entries at once
  3. saves performance from the front-end

I'm able to develop such a fixation in python or javascript if you wanted me to

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kartevonmorgen/kartevonmorgen/issues/367#issuecomment-698777798, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSSYFT5CMI7EG3LXSKMDFLSHRC37ANCNFSM4EJM5HPQ .

wellemut avatar Sep 26 '20 15:09 wellemut

the newly added entries have the fields state and country assigned if the user interacted with the map for locating the relevant pin. (But not if the user just adds the adress) And the issue is with the entries that have been added in the past. So a once in a lifetime run for fixation of the entries that do not have the fields filled will be sufficient.

navid-kalaei avatar Sep 27 '20 11:09 navid-kalaei

@flosse

We think there should be a littel fuction in the Backend that searches for country and state while the entry is save in the ofDB.

wellemut avatar Oct 21 '20 16:10 wellemut