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

Reliable Country Selection #145

Closed
p-a-s-c-a-l opened this issue Mar 25, 2020 · 13 comments
Closed

Reliable Country Selection #145

p-a-s-c-a-l opened this issue Mar 25, 2020 · 13 comments
Assignees
Labels
enhancement New feature or request SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless

Comments

@p-a-s-c-a-l
Copy link
Member

Coming back to country selection, there are two usability issues:

grafik

The first, more serious one is related to the recalculation of HC-LE input layers: The city selection box must contain cities only, that are guaranteed to be available (recalculated) for screening. So we have to periodically re-generate the cities taxonomy as @therter described here. I wonder, if there is a possibility to a) automate or b) simplify this process? If we could unpublish or hide some taxonomy terms, then it would still be a manual task to update the list of cities as new cities are becoming available, but it's still more efficient than doing the complete import process again and again.

The second issue is not that critical (showstopper) but it could still become frustrating for users: There are many countries without supported cities, so they shouldn't be shown at all in the countries selection box for Automated Screening: Urban Infrastructure studies.

Originally posted by @p-a-s-c-a-l in #141 (comment)

@therter
Copy link
Contributor

therter commented Mar 25, 2020

The first, more serious one is related to the recalculation of HC-LE input layers: The city selection box must contain cities only, that are guaranteed to be available (recalculated) for screening. So we have to periodically re-generate the cities taxonomy as @therter described here. I wonder, if there is a possibility to a) automate or b) simplify this process? If we could unpublish or hide some taxonomy terms, then it would still be a manual task to update the list of cities as new cities are becoming available, but it's still more efficient than doing the complete import process again and again.

This can be solved by a script that I have created. See here.
But I have seen that the structure of the city shape file that is updated by @negroscuro, when new cities become available, has changed. So I must adjust the function that publish/unpublish the cities.

But this approach does not work for the countries. Because the countries will still be shown in the country combo box, when I unpublish them via the db.

@p-a-s-c-a-l p-a-s-c-a-l added the enhancement New feature or request label Mar 25, 2020
@p-a-s-c-a-l
Copy link
Member Author

This can be solved by a script that I have created. See here.

Yes, but currently it's not automated. ATM city data is being regenerated, so the list of cities has to be updated regularly.

@p-a-s-c-a-l p-a-s-c-a-l added the SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless label Apr 21, 2020
@p-a-s-c-a-l p-a-s-c-a-l added this to the D1.4 CLARITY CSIS v2 milestone Apr 21, 2020
@p-a-s-c-a-l
Copy link
Member Author

Any updates?
Perhaps this can be combined with synchronisation? @patrickkaleta

How is synchronisation triggered? Manually or by a cron-job? In any case we could include @therter's republish.sh in the process so that the cities taxonomy is updated in DEV right before the synchronisation starts and then the updated taxonomies are synchronised to PROD. WDYT?

BTW, the scripts should be made available in this GitHub repo under /scripts.

@therter
Copy link
Contributor

therter commented Apr 22, 2020

BTW, the scripts should be made available in this GitHub repo under /scripts.

I have added the script to the repo

@patrickkaleta
Copy link
Contributor

@therter wrote:
But this approach (hiding empty countries by unpublishing them) does not work for the countries. Because the countries will still be shown in the country combo box, when I unpublish them via the db.

I believe I found a possible solution for that problem. Instead of showing the overall taxonomy list for countries in the Study country field, I can place a View inbetween, which filters out unpublished countries. The result would be that only published Countries (for which available Cities exist) would remain.

Tested it locally and it even worked fine together with the Business Rule function that handles the automated selection of cities/regions for the selected country.

The necessary View is already available in the CSIS, so if @therter can provide such a publish/unpublish script for countries, we can use this approach to get a more reliable country selection.

@patrickkaleta
Copy link
Contributor

How is synchronisation triggered? Manually or by a cron-job? In any case we could include @therter's republish.sh in the process so that the cities taxonomy is updated in DEV right before the synchronisation starts and then the updated taxonomies are synchronised to PROD. WDYT?

For now, it's set to be triggered manually by running the pull_content.sh script in the target docker environment, which runs the individual drush migrate commands in the necessary order.

If configurations have changed (field & content type settings, Views, etc.), it's necessary to first synchronize the configuration, for which in turn it might be first necessary to run a composer update (in case new modules are used), so ideally during this whole process the site is put into "maintenance mode". All that considered I'm not a big fan of having a cron-job take care of this process.
However, it would be possible to only synchronize certain content types (like countries and cities/regions) by running the individual drush migrate commands for those taxonomies. @therter's republish script could be run in DEV before this "slimmed down" version of the content synchronization more frequently than the usual content synchronization.

BTW, the scripts should be made available in this GitHub repo under /scripts.

I will put the mentioned script for the content synchronization in there as well.

@therter
Copy link
Contributor

therter commented Apr 23, 2020

The necessary View is already available in the CSIS, so if @therter can provide such a publish/unpublish script for countries, we can use this approach to get a more reliable country selection.

I have added the code for publishing/unpublishing countries to the function that publish/unpublish the cities. See here

@therter
Copy link
Contributor

therter commented Apr 23, 2020

I believe I found a possible solution for that problem. Instead of showing the overall taxonomy list for countries in the Study country field, I can place a View inbetween, which filters out unpublished countries. The result would be that only published Countries (for which available Cities exist) would remain.

@patrickkaleta I have unpublished the country 'Andorra', but it is still shown in the combobox.

Auswahl_156

3 similar comments
@therter
Copy link
Contributor

therter commented Apr 23, 2020

I believe I found a possible solution for that problem. Instead of showing the overall taxonomy list for countries in the Study country field, I can place a View inbetween, which filters out unpublished countries. The result would be that only published Countries (for which available Cities exist) would remain.

@patrickkaleta I have unpublished the country 'Andorra', but it is still shown in the combobox.

Auswahl_156

@therter
Copy link
Contributor

therter commented Apr 23, 2020

I believe I found a possible solution for that problem. Instead of showing the overall taxonomy list for countries in the Study country field, I can place a View inbetween, which filters out unpublished countries. The result would be that only published Countries (for which available Cities exist) would remain.

@patrickkaleta I have unpublished the country 'Andorra', but it is still shown in the combobox.

Auswahl_156

@therter
Copy link
Contributor

therter commented Apr 23, 2020

I believe I found a possible solution for that problem. Instead of showing the overall taxonomy list for countries in the Study country field, I can place a View inbetween, which filters out unpublished countries. The result would be that only published Countries (for which available Cities exist) would remain.

@patrickkaleta I have unpublished the country 'Andorra', but it is still shown in the combobox.

Auswahl_156

@patrickkaleta
Copy link
Contributor

I believe I found a possible solution for that problem. Instead of showing the overall taxonomy list for countries in the Study country field, I can place a View inbetween, which filters out unpublished countries. The result would be that only published Countries (for which available Cities exist) would remain.

@patrickkaleta I have unpublished the country 'Andorra', but it is still shown in the combobox.

@therter Sorry, for the misunderstanding. I prepared the necessary View but didn't switch to it until getting feedback. Now this new mechanism is active and in the Country selection box I can see roughly 30 countries.

In the "Maintenance" overviews I've added a list of the Countries, so it's possible to view & change the status of the published/unpublished countries manually.

@p-a-s-c-a-l
Copy link
Member Author

Thanks! So this can be considered as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless
Projects
None yet
Development

No branches or pull requests

3 participants