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

Migration #98

Merged
merged 235 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
7c4bc29
feat: remove overridden templates
Aug 23, 2024
25bf3df
feat: remove wordPress stylesheet references
Aug 23, 2024
f0d7d03
feat: remove wordpress_template helpers
Aug 23, 2024
74cd530
feat: bring back CKAN styles
Aug 23, 2024
bf3735a
style: remove unused import
Aug 23, 2024
aa3b0ad
feat: Remove unneeded template override
bellisk Aug 26, 2024
a896eca
feat: Delete unneeded groups templates
bellisk Aug 26, 2024
7966683
feat: Only modify group templates to translate multilingual fields
bellisk Aug 26, 2024
5b173af
feat: Add labels to group field display_name
bellisk Aug 26, 2024
12ce1a9
refactor: remove customization for organization-type
Aug 26, 2024
a308231
feat: add template to override
Aug 26, 2024
342d694
feat: localize display name and description
Aug 26, 2024
6aed839
feat: Remove unneeded package templating
bellisk Aug 26, 2024
03832c9
feat: Override template from ckanext-scheming
bellisk Aug 26, 2024
bde0bc4
feat: Display localized package description
bellisk Aug 26, 2024
69e63ac
feat: Remove unneeded package templating
bellisk Aug 26, 2024
f72e9ba
feat: Remove unneeded changes to overridden core ckan template
bellisk Aug 26, 2024
9585d59
feat: Add more change fields that should be localised
bellisk Aug 26, 2024
26d1ab2
feat: Remove unneeded package templating
bellisk Aug 26, 2024
b9b86c0
feat: Remove unneeded changes to overridden core ckan template
bellisk Aug 26, 2024
10782bf
feat: Remove unneeded package templating
bellisk Aug 26, 2024
b9f4f18
style: Update ckan core template block that was overridden
bellisk Aug 26, 2024
8733a52
fix: mark as download and prevent opening in new tab
bellisk Aug 26, 2024
d4acbf2
feat: Remove unneeded package templating
bellisk Aug 26, 2024
6cad7c1
feat: Display package terms of use
bellisk Aug 26, 2024
c1010f0
feat: Display relations field in package additional info
bellisk Aug 26, 2024
b0c62dc
feat: Remove non-existent field from excluded fields
bellisk Aug 26, 2024
bf0213a
feat: Copy ckanext-scheming template for additional_info.html
bellisk Aug 26, 2024
e9585ca
feat: Display terms of use in package additional-info table
bellisk Aug 26, 2024
23b9095
tests: Update test
bellisk Aug 27, 2024
e572588
feat: Override ckanext-scheming template to remove broken block
bellisk Aug 27, 2024
0955b87
feat: Remove unneeded package templating
bellisk Aug 27, 2024
ff34892
feat: Only override necessary block from ckan core
bellisk Aug 27, 2024
6a9ddca
feat: Localise labels of facet items
bellisk Aug 27, 2024
923d98e
feat: Remove unneeded package templating
bellisk Aug 27, 2024
b06ae74
tests: Fix test for resource dates
bellisk Aug 27, 2024
d64b7d0
feat: Only override necessary block from ckan core
bellisk Aug 27, 2024
43b4864
feat: Remove unneeded package templating
bellisk Aug 27, 2024
04caca1
feat: Copy preset resource_url_upload into our own presets.json
bellisk Aug 27, 2024
582c7b6
feat: Move schema customisation into presets where possible
bellisk Aug 27, 2024
8d49ae6
feat: Remove search templates
bellisk Aug 27, 2024
4ba1ae5
feat: Remove search blueprint
bellisk Aug 27, 2024
5cbbe25
feat: Remove search javascript
bellisk Aug 27, 2024
2c1c791
feat: Remove unneeded form_snippet
bellisk Aug 27, 2024
9208884
feat: Use textarea for group and organization description
bellisk Aug 27, 2024
1f0e647
feat: Remove unneeded display_snippet
bellisk Aug 27, 2024
b0bdfbb
fix: Fix url in fluent_tags.html template
bellisk Aug 27, 2024
4f74e8b
feat: Don't localise package fields in before_dataset_show
bellisk Aug 28, 2024
b9a181b
fix: Remove the 'notes' field from datasets before view
bellisk Aug 28, 2024
24a51cd
feat: Use display_snippets that can handle multilingual dicts
bellisk Aug 28, 2024
a699e54
feat: Localise tags in display_snippet
bellisk Aug 28, 2024
6404e86
feat: Localise package description in display_snippet
bellisk Aug 28, 2024
55ab630
feat: Simplify method to make flake8 happy
bellisk Aug 28, 2024
056b88d
fix: Handle packages not having default fields
bellisk Aug 28, 2024
3d1ffd4
feat Override ckan core template blocks
bellisk Aug 28, 2024
730de0e
feat: Localise resource description
bellisk Aug 28, 2024
1d00a4c
feat: Update requirements to CKAN 2.10+ and Python 3.10
bellisk Aug 29, 2024
e694026
feat: Update path creation to Python 3.5+ method
bellisk Aug 29, 2024
f268f5b
feat: Catch OSError and raise it
bellisk Aug 29, 2024
7ed0aed
feat: Remove unneeded harvester templating
bellisk Aug 27, 2024
fb24a64
feat: Remove unneeded override of CKAN login form
bellisk Sep 2, 2024
999e2dc
feat: Restore CKAN title block
bellisk Sep 2, 2024
9c6a345
feat: Restore CKAN styles block
bellisk Sep 2, 2024
022c2b5
feat: Remove unneeded override of CKAN language selector
bellisk Sep 2, 2024
380f78b
feat: Replace and localise organisation description in snippet
bellisk Sep 2, 2024
f2f4472
chore: Clean up unused matomo config code
bellisk Sep 2, 2024
9dd09b0
feat: Update translation pot file
bellisk Sep 2, 2024
45fe14d
feat: Update translations based on pot file
bellisk Sep 2, 2024
b514096
feat: Add translations that should match those in CKAN
bellisk Sep 3, 2024
9df692f
feat: Update po and pot files after removing template
bellisk Sep 3, 2024
e01f0e8
feat: Update .mo files
bellisk Sep 3, 2024
a36957f
chore: Remove unused script
bellisk Sep 3, 2024
248bda5
docs: Add info about updating translations to README
bellisk Sep 3, 2024
13bcfad
feat: Move organization info snippet to match CKAN 2.11.0
bellisk Sep 16, 2024
08a412d
feat: Override CKAN description block
bellisk Sep 16, 2024
c86fa90
feat: Localize description in organization info snippet
bellisk Sep 16, 2024
b4e53fe
Merge pull request #99 from liip/feat/update-org-info-template-for-ck…
stefina Sep 17, 2024
c30cfc0
Merge branch 'migration'
bellisk Sep 19, 2024
f607252
feat: Update parameter for compatibility with Flask 3.0.3
bellisk Sep 23, 2024
263283a
feat: Don't use deprecated helper function
bellisk Sep 23, 2024
8af711d
feat: Update translation .mo files
bellisk Sep 23, 2024
1dcb093
feat: Override secondary_content block of resource_read.html
bellisk Sep 23, 2024
24be1f0
fix: Fix display of social media links on resource page
bellisk Sep 23, 2024
6906ea7
feat: Copy CKAN resource_history.html template to override it
bellisk Sep 23, 2024
53cf534
feat: Make resource_history template extend scheming resource_read te…
bellisk Sep 23, 2024
d8e27a9
feat: Copy CKAN package base.html template to override it
bellisk Sep 23, 2024
af75dd4
feat: Only override necessary block
bellisk Sep 23, 2024
c73f3c2
feat: Translate organization title in breadcrumbs
bellisk Sep 23, 2024
3427129
feat: Fall back to organisation name in breadcrumb
bellisk Sep 24, 2024
0970b1c
Merge pull request #103 from liip/feat/adapt-to-ckan-2.11.0
bellisk Sep 24, 2024
70a4296
feat: Update harvester to be compatible with new version
bellisk Sep 24, 2024
9c9febe
Merge pull request #105 from liip/feat/update-harvester-for-ckan-2.11
bellisk Sep 25, 2024
8235812
feat: override footer-template
Sep 24, 2024
776d837
feat: override the blocks that we need
Sep 24, 2024
169598c
feat: add translated footer-links
Sep 24, 2024
4159c84
feat: add footer translations
Sep 24, 2024
e912994
feat: move CKAN default-footer links for more clarity
Sep 24, 2024
643c0ec
fix: add p element for spacing
Sep 25, 2024
a8c1e32
Merge pull request #107 from liip/feat/footer-links
stefina Sep 25, 2024
bdc30c7
feat: copy over header-template with navigation-block to override it
stefina Sep 26, 2024
fe72186
feat: add harvester to main-navigation
stefina Sep 26, 2024
9580150
Merge pull request #108 from liip/feat/admin-navigation
stefina Sep 27, 2024
1f1f2c1
Merge pull request #109 from liip/main
stefina Sep 27, 2024
dba3d5b
fix: add translated description
stefina Oct 3, 2024
13f59a5
Merge pull request #110 from liip/fix/package-list-description
stefina Oct 4, 2024
0b25579
fix: Do not run import_stage for repeated harvest object
bellisk Oct 4, 2024
2e6f338
Merge pull request #111 from liip/fix/fix-harvester-error-for-migration
bellisk Oct 7, 2024
c3f968e
feat: Copy nums block from ckan core to override it
bellisk Oct 9, 2024
5fe62ad
feat: Remove member count from group page
bellisk Oct 9, 2024
a12e09e
feat: Copy nums block from ckan core to override it
bellisk Oct 9, 2024
7941a64
feat: Remove member count from organization page
bellisk Oct 9, 2024
bb05cdc
Merge pull request #113 from liip/feat/remove-member-counts-from-grou…
bellisk Oct 10, 2024
c58ebf9
feat: Copy ckan core search_facets block to override it
bellisk Oct 10, 2024
acc4844
feat: Translate selected search facets
bellisk Oct 10, 2024
2ef5612
Merge pull request #114 from liip/fix/translate-search-facets
bellisk Oct 10, 2024
74b9238
feat: Use lang-specific keywords facet instead of tags
bellisk Oct 10, 2024
37bfae0
feat: Use the same helper method to update all facets
bellisk Oct 10, 2024
bbc0288
fix: re-generate translation files for footer-links
stefina Oct 10, 2024
a8a7c90
Merge pull request #115 from liip/fix/fix-keyword-filtering
bellisk Oct 10, 2024
d80523f
fix: remove redundant apostrophe
stefina Oct 10, 2024
0af9b56
Merge pull request #116 from liip/fix-footer-translation
stefina Oct 10, 2024
4d7db6d
feat: Copy core ckan templates to override them
bellisk Oct 14, 2024
9e8d9d1
fix: Fix variable name to match read_base.html
bellisk Oct 14, 2024
f4e5979
feat: Copy core ckan template to override it
bellisk Oct 14, 2024
c24c6bb
fix: Set deleted user's groups and orgs to empty lists
bellisk Oct 14, 2024
10d7bc7
Merge pull request #117 from liip/fix/fix-error-when-looking-at-delet…
bellisk Oct 15, 2024
b5f713b
feat: copy over social_nav-block to override it
stefina Oct 15, 2024
7e64fb5
feat: remove twitter and facebook in favour of linkedin
stefina Oct 15, 2024
88608ba
Merge pull request #118 from liip/feature/social-links
stefina Oct 15, 2024
f31ff5f
feat: Override ckan name_validator
bellisk Oct 16, 2024
7a1eb7c
feat: Only use our name_validator for existing usernames
bellisk Oct 16, 2024
9177db5
feat: Remove unneeded lines
bellisk Oct 16, 2024
1fe9868
tests: Add tests for new validator
bellisk Oct 16, 2024
799758f
feat: Allow space in existing usernames
bellisk Oct 16, 2024
3102e75
Merge pull request #119 from liip/feat/validate-wordpress-usernames-w…
bellisk Oct 17, 2024
8f1678d
docs: Add instruction for installing msgcat
bellisk Oct 16, 2024
023a0a1
feat: Add translations from CKAN to our po files
bellisk Oct 16, 2024
594b8b6
feat: Update translations after adding name_validator
bellisk Oct 16, 2024
15cf3d6
feat: Add translation for new validator message
bellisk Oct 16, 2024
ca91f5b
Merge pull request #120 from liip/feat/update-translations
bellisk Oct 17, 2024
cd528e6
feat: add license template to override it
stefina Oct 18, 2024
fc94b62
feat: hide license block as this field is not used
stefina Oct 18, 2024
9723ea4
fix: Search in Solr text field as well as lang fields
bellisk Oct 21, 2024
e2d5d01
chore: Remove no-longer-needed code
bellisk Oct 21, 2024
9673f1f
Merge pull request #122 from liip/fix/fix-harvester-search
bellisk Oct 21, 2024
dba39b8
Merge pull request #121 from liip/feat/remove-license-text
stefina Oct 22, 2024
bf3ce03
feat: Copy entire block to override it
bellisk Oct 24, 2024
f7fe0fe
feat: Only show harvester and org nav items to logged-in users
bellisk Oct 24, 2024
6bc1812
Merge pull request #123 from liip/feat/hide-nav-items-from-logged-out…
bellisk Oct 24, 2024
ec8cbb6
feat: Copy template block from CKAN core to override it
bellisk Oct 24, 2024
35b00fa
feat: Only display data dictionary for logged-in users
bellisk Oct 24, 2024
aaa47cd
Merge pull request #124 from liip/feat/hide-data-dictionary-from-logg…
bellisk Oct 24, 2024
e22109a
chore: Remove blueprint that didn't do anything
bellisk Oct 24, 2024
a586ad4
refactor: Rename methods and vars for greater clarity
bellisk Oct 24, 2024
4f586c0
chore: Remove logic not needed for groups or orgs
bellisk Oct 24, 2024
5ab2f67
chore: Remove OgdchResourcePlugin
bellisk Oct 24, 2024
acaca8b
Merge pull request #125 from liip/chore/clean-up-resource-plugin
bellisk Oct 28, 2024
e227a7d
feat: Use datasets index as home page
bellisk Oct 24, 2024
ef551bd
tests: Remove no-longer-needed mock response
bellisk Oct 28, 2024
9d5f0c7
tests: Add test for ogdch_home url
bellisk Oct 28, 2024
e06f335
tests: Add test for homepage content
bellisk Oct 28, 2024
87b0864
tests: Search for English text, not German
bellisk Oct 28, 2024
a78f20b
tests: Remove no-longer-needed response mocking
bellisk Oct 28, 2024
2e08fe2
Merge pull request #126 from liip/feat/redirect-homepage-to-datasets
bellisk Oct 29, 2024
7cdca0d
feat: Copy header_logo block to override it
bellisk Oct 30, 2024
284a266
chore: Clean up no-longer-used helpers
bellisk Oct 30, 2024
521f187
feat: Add helper to get WordPress url
bellisk Oct 30, 2024
25879a5
chore: Remove email_exporter blueprint
bellisk Oct 30, 2024
a1ed1a2
chore: Clean up no-longer-used actions
bellisk Oct 30, 2024
4f30fc8
docs: Remove ckanext.switzerland.user_list_api_key from README
bellisk Oct 30, 2024
a096bf7
feat: Link to WordPress site from header logo
bellisk Oct 30, 2024
b4f146c
feat: Update translation .po files
bellisk Oct 30, 2024
471726d
feat: Update translation .mo files
bellisk Oct 30, 2024
fe02e89
Merge pull request #127 from liip/feat/link-header-logo-to-main-site
bellisk Oct 30, 2024
325c6c9
fix: Pass dataset_type to snippet to prevent server error
bellisk Oct 31, 2024
0bef82d
feat: Update ckanext-activity templates for CKAN 2.11
bellisk Oct 31, 2024
8b51b4e
Merge pull request #128 from liip/feat/update-activitiy-templates
bellisk Oct 31, 2024
97b5a27
fix: Return a 404 if resource is not found
bellisk Nov 1, 2024
8eee5c7
tests: Test against CKAN 2.11
bellisk Nov 4, 2024
0a5ab22
tests: Run db migrations for plugins
bellisk Nov 4, 2024
75cc18d
tests: Update fixtures to work with ckanext-harvest v1.6.0
bellisk Nov 5, 2024
a01ef02
tests: Switch order of harvester plugins
bellisk Nov 5, 2024
827e1ef
tests: Fix test user name
bellisk Nov 5, 2024
070718a
tests: Don't use fixtures to set plugins per test class
bellisk Nov 6, 2024
b7ed3d3
tests: Remove unneeded helper method
bellisk Nov 6, 2024
d39d0bf
tests: Include user when updating datasets
bellisk Nov 6, 2024
d695fb7
tests: Remove unneeded fixture
bellisk Nov 6, 2024
5cf267c
tests: Fix missing empty line
bellisk Nov 6, 2024
0635ba7
tests: Apply migrations after re-adding plugins
bellisk Nov 6, 2024
13140ad
tests: Add debug statements
bellisk Nov 6, 2024
c953c64
tests: Add debug statements
bellisk Nov 6, 2024
9e83073
tests: Use Docker path for test-core.ini locally and on github
bellisk Nov 6, 2024
29e5d10
tests: Add activity plugin
bellisk Nov 6, 2024
672b217
tests: Remove debug statements
bellisk Nov 6, 2024
b3f90fa
tests: Init db without removing/re-adding plugins
bellisk Nov 6, 2024
60ae239
tests: Use most recent versions of ckanexts
bellisk Nov 6, 2024
077f0e9
Merge pull request #129 from liip/fix/fix-resource-download-if-resour…
bellisk Nov 6, 2024
81b7b8e
Merge pull request #132 from liip/tests/test-against-latest-ckan-and-…
bellisk Nov 7, 2024
fb49d58
fix: German translation
bellisk Nov 4, 2024
6e1aa42
feat: Update German .mo file
bellisk Nov 4, 2024
64f9b23
feat: Copy CKAN template
bellisk Nov 7, 2024
fb00d22
Merge pull request #130 from liip/main
bellisk Nov 7, 2024
f93d72a
docs: Fix commands to prioritise our translations
bellisk Nov 7, 2024
76192e1
feat: Update translations
bellisk Nov 7, 2024
3382885
feat: Update .mo files
bellisk Nov 7, 2024
5b08ae6
Merge pull request #131 from liip/fix/german-translation
bellisk Nov 7, 2024
77fa970
fix: Fix cookie settings link
bellisk Nov 12, 2024
329781a
fix: Use French tp-info.ch link in French translation
bellisk Nov 12, 2024
34b90ea
Merge pull request #133 from liip/fix/fix-footer-cookie-settings-link
bellisk Nov 13, 2024
e698168
feat: Override ckan.lib.helpers.strxfrm helper
bellisk Nov 13, 2024
266caa2
feat: Adapt helper strxfrm to our needs
bellisk Nov 13, 2024
1b674de
feat: Use helper to get required lang and catch TypeError
bellisk Nov 14, 2024
0011d07
tests: Change test container user to root
bellisk Nov 14, 2024
2fa7378
fix: Fix link to terms of use on resource page
bellisk Nov 18, 2024
267327b
fix: Update translations for terms-of-use link
bellisk Nov 18, 2024
a9a3a2f
tests: Change test container user to root
bellisk Nov 14, 2024
e47e4a6
Merge pull request #134 from liip/fix/fix-adding-dataset-to-groups
bellisk Nov 18, 2024
e294865
Merge pull request #135 from liip/fix/fix-terms-of-use-url
bellisk Nov 18, 2024
06d6da8
feat: Copy block from ckan core template to override it
bellisk Nov 18, 2024
a9e56b5
feat: Don't show group member count if no value for it
bellisk Nov 18, 2024
dd44e3f
Merge pull request #136 from liip/fix/group-members-display-on-datase…
bellisk Nov 19, 2024
2d540d1
fix: Extend template from CKAN, don't just replace it
bellisk Nov 19, 2024
406c244
Merge pull request #137 from liip/fix/fix-group-list-item
bellisk Nov 20, 2024
f0ed139
feat: Handle NotFound error deleting old resource
bellisk Dec 2, 2024
fbaf9b6
feat: Log error when reordering resources fails
bellisk Dec 2, 2024
e96a8ca
fix: Record an error if finalizing job errored
bellisk Dec 2, 2024
4767e67
feat: Use fresh context to delete each resource
bellisk Dec 2, 2024
3286b94
fix: Handle KeyError when getting request language
bellisk Dec 2, 2024
3574e85
feat: Delete extra resources by id, not filename
bellisk Dec 2, 2024
b6f574b
refactor: Use method instead of duplicating logic
bellisk Dec 2, 2024
6f00e91
feat: Catch ValidationError when reordering resources
bellisk Dec 2, 2024
65f2a50
style: Remove unused import
bellisk Dec 2, 2024
41f66a3
style: Ignore complexity of some methods
bellisk Dec 2, 2024
e3e2b0d
Merge pull request #138 from liip/feat/handle-error-deleting-old-reso…
bellisk Dec 4, 2024
4970de1
Merge branch 'main' into migration
bellisk Jan 9, 2025
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: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: ["2.10"]
ckan-version: ["2.11"]
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
Expand Down Expand Up @@ -56,12 +56,12 @@ jobs:
-v "${{ github.workspace }}/solr/stopwords_en.txt":"$SOLR_CONFIG_CKAN_DIR/stopwords_en.txt" \
-v "${{ github.workspace }}/solr/stopwords_fr.txt":"$SOLR_CONFIG_CKAN_DIR/stopwords_fr.txt" \
-v "${{ github.workspace }}/solr/stopwords_it.txt":"$SOLR_CONFIG_CKAN_DIR/stopwords_it.txt" \
ckan/ckan-solr:${{ matrix.ckan-version }}
ckan/ckan-solr:${{ matrix.ckan-version }}-solr9
docker start test_solr
- name: Create ckan container
run: |
/usr/bin/docker create --name test_ckan --network ${{ job.container.network }} --network-alias ckan \
--env-file ${{ github.workspace }}/github-workflow.env \
--env-file ${{ github.workspace }}/github-workflow.env --user root \
-v "/var/run/docker.sock":"/var/run/docker.sock" \
-v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" \
-v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" \
Expand Down
70 changes: 59 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
ckanext-switzerland
===================

CKAN extension for DCAT-AP Switzerland, templates and different plugins including FTP- and S3-Harvester for [opentransportdata.swiss](https://opentransportdata.swiss).
CKAN extension for DCAT-AP Switzerland, templates and different plugins including FTP- and S3-Harvester for
[opentransportdata.swiss](https://opentransportdata.swiss).

## Requirements

- CKAN 2.8+
- CKAN 2.10+
- ckanext-fluent
- ckanext-harvest
- ckanext-scheming
Expand Down Expand Up @@ -35,15 +36,12 @@ To install ckanext-switzerland:

This extension uses the following config options (.ini file)

# the URL of the WordPress AJAX interface
ckanext.switzerland.wp_ajax_url = https://wp/wp-admin/admin-ajax.php
ckanext.switzerland.wp_ajax_url = http://wp/cms/wp-admin/admin-ajax.php
ckanext.switzerland.wp_template_url = http://wp/cms/wp-admin/admin-post.php?action=get_nav
ckanext.switzerland.wp_url = http://wp
# For linking to the associated WordPress site from the header logo
ckanext.switzerland.wp_url

# matomo config
matomo.site_id = 1
matomo.url = stats.opentransportdata.swiss
# For managing cookie consent and tracking with OneTrust and Matomo
ckanext.switzerland.cookie_law_url
ckanext.switzerland.cookie_law_id

## Development Installation

Expand Down Expand Up @@ -183,7 +181,7 @@ The harvester will receive its configuration from the Database.
This configuration will be passed to the `StorageAdapterFactory`.
This object has for sole responsibility to read the configuration, and decide which Storage Adapter to instantiate.

THe two possibilities are `S3StorageAdapter` or `FTPStorageAdapter`.
The two possibilities are `S3StorageAdapter` or `FTPStorageAdapter`.
Both classes extends the `StorageAdapterBase` class.
In this base class, designed as an abstract class (meaning all methods are there,
and the ones that have to be reimplement just throw `NotImplementedException`),
Expand All @@ -193,3 +191,53 @@ but also some common function to manage the local folder used by the harvesters
Each implementation (`S3StorageAdapter` and `FTPStorageAdapter`), are responsible to get their storage configuration,
from the storage identifier received from the harvester configuration.
Each implementation is also unit tested, see respectively `TestS3StorageAdapter` and `TestFTPStorageAdapter` classes.

# Updating the translations

The translation files for this ckanext are found in `i18n/`:
- `ckanext-switzerland.pot`: this is a template file containing all the translatable strings found in the code
- `{LANG}/LC_MESSAGES/ckanext-switzerland.po`: one translation file for each of our supported languages apart from
English (German, French and Italian)
- `{LANG}/LC_MESSAGES/ckanext-switzerland.mo`: the compiled translations in binary format

If you update the code and add or remove translatable strings, you will have to update the translations too.

The following instructions assume you are working inside a docker container based on the official [Docker Compose setup
for CKAN](https://github.com/ckan/ckan-docker/).

1. Enter the container and go to the ckanext-switzerland directory:
```shell
docker compose exec ckan bash
cd src_extensions/ckanext-switzerland/
```
2. Update the `.pot` file:
```shell
python setup.py extract_messages
```
3. *Optional* If you have copied templates from core CKAN to override them, you might want to copy the translations
from CKAN too:
```shell
apt-get install gettext
msgcat --use-first i18n/de/LC_MESSAGES/ckanext-switzerland.po ../../src/ckan/ckan/i18n/de/LC_MESSAGES/ckan.po > temp_de.po
cp temp_de.po i18n/de/LC_MESSAGES/ckanext-switzerland.po
msgcat --use-first i18n/fr/LC_MESSAGES/ckanext-switzerland.po ../../src/ckan/ckan/i18n/fr/LC_MESSAGES/ckan.po > temp_fr.po
cp temp_fr.po i18n/fr/LC_MESSAGES/ckanext-switzerland.po
msgcat --use-first i18n/it/LC_MESSAGES/ckanext-switzerland.po ../../src/ckan/ckan/i18n/it/LC_MESSAGES/ckan.po > temp_it.po
cp temp_it.po i18n/it/LC_MESSAGES/ckanext-switzerland.po
rm temp_de.po temp_fr.po temp_it.po
```
This adds a lot of translations to our `.po` files that we don't want, but they will be removed in the next step.
4. Update the `.po` files:
```shell
python setup.py update_catalog --ignore-obsolete=true --no-fuzzy-matching
```
To update one language at a time, add `-l de` (etc.) to the command.
5. Check the `.po` files and add any new translations that are needed.
6. Update the `.mo` files:
```shell
python setup.py compile_catalog
```
7. Restart the docker container:
```shell
docker compose restart ckan
```
15 changes: 0 additions & 15 deletions bin/build-combined-ckan-mo.sh

This file was deleted.

16 changes: 6 additions & 10 deletions bin/install_test_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ pip install --ignore-installed -r /__w/ckanext-switzerland/ckanext-switzerland/d
pip install -e /__w/ckanext-switzerland/ckanext-switzerland/

# Install ckanext dependencies
pip install -e git+https://github.com/ckan/ckanext-dcat.git@v1.5.1#egg=ckanext-dcat
pip install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v1.5.1/requirements.txt
pip install -e git+https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest.git@v1.0.2#egg=ckanext-harvest
pip install -r https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest/-/raw/v1.0.2/requirements.txt
pip install -e git+https://github.com/ckan/ckanext-scheming.git@release-3.0.0#egg=ckanext-scheming
pip install -e git+https://github.com/ckan/ckanext-dcat.git#egg=ckanext-dcat
pip install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/master/requirements.txt
pip install -e git+https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest.git#egg=ckanext-harvest
pip install -r https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest/-/raw/main/requirements.txt
pip install -e git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming
pip install -e git+https://github.com/ckan/ckanext-fluent.git#egg=ckanext-fluent
pip install -r https://raw.githubusercontent.com/ckan/ckanext-fluent/master/requirements.txt

# Replace default path to CKAN core config file with the one on the container
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' /__w/ckanext-switzerland/ckanext-switzerland/test.ini

# Init db and re-enable required plugins
ckan config-tool /__w/ckanext-switzerland/ckanext-switzerland/test.ini "ckan.plugins = "
ckan -c /__w/ckanext-switzerland/ckanext-switzerland/test.ini db init
ckan config-tool /__w/ckanext-switzerland/ckanext-switzerland/test.ini "ckan.plugins = ogdch ogdch_pkg ogdch_res ogdch_group ogdch_org harvest sbb_harvester timetable_harvester datastore fluent scheming_datasets scheming_groups scheming_organizations"
ckan -c /__w/ckanext-switzerland/ckanext-switzerland/test.ini db pending-migrations --apply
9 changes: 0 additions & 9 deletions ckanext/switzerland/assets/a_vue.js

This file was deleted.

7 changes: 0 additions & 7 deletions ckanext/switzerland/assets/b_vuevalidator.js

This file was deleted.

121 changes: 0 additions & 121 deletions ckanext/switzerland/assets/c_search.js

This file was deleted.

8 changes: 0 additions & 8 deletions ckanext/switzerland/assets/webassets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@ relations:
extra:
preload:
- base/main

search:
output: switzerland/search.js
contents:
- a_vue.js
- b_vuevalidator.js
- c_search.js
filters: rjsmin
Loading
Loading