From 6427482655b31fdeda43e649c344fcca7e87a5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bult=C3=A9?= Date: Thu, 4 Apr 2024 10:50:54 +0200 Subject: [PATCH 1/4] Update changelog for #1826 (#1872) * Update changelog for #1826 * Add theme extension reference * More clear --------- Co-authored-by: Thibaud Dauce --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24183df490..51e1aa8171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -863,7 +863,6 @@ Search refactor [#2680](https://github.com/opendatateam/udata/pull/2680) - Harvest sources are now filterable through the harvest source create/edit admin form [#1812](https://github.com/opendatateam/udata/pull/1812) - Harvest sources can now enable or disable some optional backend features [#1875](https://github.com/opendatateam/udata/pull/1875) -- Static assets are now compatible with long-term caching (ie. their hash is present in the filename) [#1826](https://github.com/opendatateam/udata/pull/1826) - Post UIs have been reworked: publication date, publish/unpublish action, save and continue editing, dynamic sidebar, alignments fixes... [#1857](https://github.com/opendatateam/udata/pull/1857) ### Minor changes @@ -879,6 +878,7 @@ Search refactor [#2680](https://github.com/opendatateam/udata/pull/2680) ### Breaking changes +- Static assets are now compatible with long-term caching (ie. their hash is present in the filename). :warning: On your development environment you need to run `inv assets-build` to generate an initial `manifest.json`, both in `udata` and in your theme extension if it uses manifest. See [#1826](https://github.com/opendatateam/udata/pull/1826) for full details. - Theme are now responsible for adding their CSS markup on template (no more assumptions on `theme.css` and `admin.css`). Most of the time, overriding `raw.html` and `admin.html` should be sufficient - The discussions API `posted_by` attribute is now an embedded user instead of an user ID to avoid extra API calls [#1839](https://github.com/opendatateam/udata/pull/1839) From 76a8e5eb2cb1317935bd81df9a185d9b4e4cf545 Mon Sep 17 00:00:00 2001 From: Thibaud Dauce Date: Thu, 4 Apr 2024 12:48:20 +0200 Subject: [PATCH 2/4] Migrate schema endpoint to the full version (#2989) * Migrate schema endpoint to the full version * Do not allow non assignable schemas in model * Fix swagger not working * Fix schema on frontend and simplify fetching correct schema in backend * Update changelog * Use camel case for models instead of dot * Update changelog --- CHANGELOG.md | 1 + js/components/dataset/resource/form.vue | 4 +- udata/core/dataset/api.py | 2 +- udata/core/dataset/api_fields.py | 27 +++- udata/core/dataset/factories.py | 144 +++++++++++++++++++--- udata/core/dataset/models.py | 32 ++--- udata/tests/api/test_datasets_api.py | 12 +- udata/tests/dataset/test_dataset_model.py | 28 +++-- udata/tests/schemas.json | 35 ++++++ 9 files changed, 224 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e1aa8171..e474ece87d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current (in progress) +- Replace schemas API with a simple proxy to the `schemas.json` file [#2989](https://github.com/opendatateam/udata/pull/2989) - Topic: add filters in API [#3007](https://github.com/opendatateam/udata/pull/3007) - Move constants outside `models.py` files to `constants.py` [#3001](https://github.com/opendatateam/udata/pull/3001) - Move `db` and Mongo fields classes outside `udata.models` [#3005](https://github.com/opendatateam/udata/pull/3005) diff --git a/js/components/dataset/resource/form.vue b/js/components/dataset/resource/form.vue index c288e7726b..c31d209f1b 100644 --- a/js/components/dataset/resource/form.vue +++ b/js/components/dataset/resource/form.vue @@ -249,14 +249,14 @@ export default { }, schema_field() { if (this.hasSchemas) { - const values = [{id: '', label: ''}].concat(schemas.data); + const values = [{name: '', title: ''}].concat(schemas.data); return [{ id: 'schema.name', label: (this.resource.schema && this.resource.schema.url) ? this._('Schema (Url already set)') : this._('Schema'), widget: 'select-input', values, map: function(item) { - return {value: item.id, text: item.label}; + return {value: item.name, text: item.title}; } }]; } diff --git a/udata/core/dataset/api.py b/udata/core/dataset/api.py index d54e90f4b7..cc529debb3 100644 --- a/udata/core/dataset/api.py +++ b/udata/core/dataset/api.py @@ -734,7 +734,7 @@ def get(self): '''List all available schemas''' try: # This method call is cached as it makes HTTP requests - return ResourceSchema.objects() + return ResourceSchema.assignable_schemas() except SchemasCacheUnavailableException: abort(503, description='No schemas in cache and endpoint unavailable') except SchemasCatalogNotFoundException: diff --git a/udata/core/dataset/api_fields.py b/udata/core/dataset/api_fields.py index 0aab05335b..09690b7ef6 100644 --- a/udata/core/dataset/api_fields.py +++ b/udata/core/dataset/api_fields.py @@ -279,9 +279,28 @@ 'label': fields.String(description='The resource type display name') }) - +# follow the specification of https://schema.data.gouv.fr/schemas/schemas.json catalog_schema_fields = api.model('CatalogSchema', { - 'id': fields.String(description='The schema identifier'), - 'label': fields.String(description='The schema display name'), - 'versions': fields.List(fields.String, description='The available versions of the schema'), + 'name': fields.String(), + 'title': fields.String(), + 'description': fields.String(), + 'schema_url': fields.String(description="Often the link to the latest version"), + 'schema_type': fields.String(enum=['tableschema', 'datapackage', 'jsonschema', 'other']), + 'contact': fields.String(), + 'examples': fields.List(fields.Nested(api.model('CatalogSchemaExample', { + 'title': fields.String(), + 'path': fields.String(), + }))), + 'labels': fields.List(fields.String()), + 'consolidation_dataset_id': fields.String(), + 'versions': fields.List(fields.Nested(api.model('CatalogSchemaVersion', { + 'version_name': fields.String(), + 'schema_url': fields.String(), + }))), + 'external_doc': fields.String(), + 'external_tool': fields.String(description="Link to tools to create a file with this schema"), + 'homepage': fields.String(), + 'datapackage_title': fields.String(description="Only present if the schema is inside a datapackage"), + 'datapackage_name': fields.String(description="Only present if the schema is inside a datapackage"), + 'datapackage_description': fields.String(description="Only present if the schema is inside a datapackage"), }) diff --git a/udata/core/dataset/factories.py b/udata/core/dataset/factories.py index a7bfdea5c0..2d00b7fe27 100644 --- a/udata/core/dataset/factories.py +++ b/udata/core/dataset/factories.py @@ -81,25 +81,137 @@ def get_mock_data(): return json.load(open(join(ROOT_DIR, 'tests', 'schemas.json'))) @staticmethod - def get_expected_v1_result_from_mock_data(): - return [ + def get_all_schemas_from_mock_data(with_datapackage_info = True): + ''' + with_datapackage_info is here to allow testing with or without marshalling (marshalling add None for inexistant datapackage_* fields) + ''' + schemas = ResourceSchemaMockData.get_expected_assignable_schemas_from_mock_data(with_datapackage_info) + + datapackage = { + "name": "etalab/schema-irve", + "title": "Infrastructures de recharges pour v\u00e9hicules \u00e9lectriques (IRVE)", + "description": "data package contenant 2 sch\u00e9mas : IRVE statique et IRVE dynamique", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/latest/datapackage.json", + "schema_type": "datapackage", + "contact": "contact@transport.beta.gouv.fr", + "examples": [], + "labels": [ + "Socle Commun des Donn\u00e9es Locales", + "transport.data.gouv.fr" + ], + "consolidation_dataset_id": "5448d3e0c751df01f85d0572", + "versions": [ + { + "version_name": "2.2.0", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.2.0/datapackage.json" + }, + { + "version_name": "2.2.1", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.2.1/datapackage.json" + }, + { + "version_name": "2.3.0", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.3.0/datapackage.json" + }, + { + "version_name": "2.3.1", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.3.1/datapackage.json" + } + ], + "external_doc": "https://doc.transport.data.gouv.fr/producteurs/infrastructures-de-recharge-de-vehicules-electriques-irve", + "external_tool": None, + "homepage": "https://github.com/etalab/schema-irve.git", + } + + if with_datapackage_info: + datapackage["datapackage_title"] = None + datapackage["datapackage_name"] = None + datapackage["datapackage_description"] = None + + return [datapackage] + schemas + + @staticmethod + def get_expected_assignable_schemas_from_mock_data(with_datapackage_info = True): + ''' + with_datapackage_info is here to allow testing with or without marshalling (marshalling add None for inexistant datapackage_* fields) + ''' + schemas = [ { - "id": "etalab/schema-irve-statique", - "label": "IRVE statique", + "name": "etalab/schema-irve-statique", + "title": "IRVE statique", + "description": "Sp\u00e9cification du fichier d'\u00e9change relatif aux donn\u00e9es concernant la localisation g\u00e9ographique et les caract\u00e9ristiques techniques des stations et des points de recharge pour v\u00e9hicules \u00e9lectriques", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/latest/schema-statique.json", + "schema_type": "tableschema", + "contact": "contact@transport.beta.gouv.fr", + "examples": [ + { + "title": "Exemple de fichier IRVE valide", + "path": "https://github.com/etalab/schema-irve/raw/v2.2.1/exemple-valide.csv" + } + ], + "labels": [ + "Socle Commun des Donn\u00e9es Locales", + "transport.data.gouv.fr" + ], + "consolidation_dataset_id": "5448d3e0c751df01f85d0572", "versions": [ - "2.2.0", - "2.2.1" - ] + { + "version_name": "2.2.0", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/2.2.0/schema-statique.json" + }, + { + "version_name": "2.2.1", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/2.2.1/schema-statique.json" + } + ], + "external_doc": "https://doc.transport.data.gouv.fr/producteurs/infrastructures-de-recharge-de-vehicules-electriques-irve", + "external_tool": None, + "homepage": "https://github.com/etalab/schema-irve.git", + "datapackage_title": "Infrastructures de recharges pour v\u00e9hicules \u00e9lectriques (IRVE)", + "datapackage_name": "etalab/schema-irve", + "datapackage_description": "data package contenant 2 sch\u00e9mas : IRVE statique et IRVE dynamique" }, { - "id": "139bercy/format-commande-publique", - "label": "Données essentielles des marchés publics français", + "name": "139bercy/format-commande-publique", + "title": "Donn\u00e9es essentielles des march\u00e9s publics fran\u00e7ais", + "description": "Donn\u00e9es des attributions de march\u00e9s publics et de contrats de concessions sup\u00e9rieures \u00e0 40 000 euros.", + "schema_url": "https://schema.data.gouv.fr/schemas/139bercy/format-commande-publique/latest/marches.json", + "schema_type": "jsonschema", + "contact": "schema@data.gouv.fr", + "examples": [], + "labels": [], + "consolidation_dataset_id": None, "versions": [ - "1.3.0", - "1.4.0", - "1.5.0", - "2.0.0", - "2.0.1" - ] + { + "version_name": "1.3.0", + "schema_url": "https://schema.data.gouv.fr/schemas/139bercy/format-commande-publique/1.3.0/sch\u00e9mas/json/contrats-concessions.json" + }, + { + "version_name": "1.4.0", + "schema_url": "https://schema.data.gouv.fr/schemas/139bercy/format-commande-publique/1.4.0/marches.json" + }, + { + "version_name": "1.5.0", + "schema_url": "https://schema.data.gouv.fr/schemas/139bercy/format-commande-publique/1.5.0/marches.json" + }, + { + "version_name": "2.0.0", + "schema_url": "https://schema.data.gouv.fr/schemas/139bercy/format-commande-publique/2.0.0/marches.json" + }, + { + "version_name": "2.0.1", + "schema_url": "https://schema.data.gouv.fr/schemas/139bercy/format-commande-publique/2.0.1/marches.json" + } + ], + "external_doc": None, + "external_tool": None, + "homepage": "https://github.com/139bercy/format-commande-publique", } - ] \ No newline at end of file + ] + + if with_datapackage_info: + schemas[1]["datapackage_title"] = None + schemas[1]["datapackage_name"] = None + schemas[1]["datapackage_description"] = None + + return schemas \ No newline at end of file diff --git a/udata/core/dataset/models.py b/udata/core/dataset/models.py index 7827f38011..912344501b 100644 --- a/udata/core/dataset/models.py +++ b/udata/core/dataset/models.py @@ -32,6 +32,8 @@ __all__ = ('License', 'Resource', 'Schema', 'Dataset', 'Checksum', 'CommunityResource', 'ResourceSchema') +NON_ASSIGNABLE_SCHEMA_TYPES = ['datapackage'] + log = logging.getLogger(__name__) @@ -120,12 +122,13 @@ def clean(self, **kwargs): # some schemas in the catalog. If there is no catalog # or no schema in the catalog we do not check the validity # of the name and version - catalog_schemas = ResourceSchema.all() + catalog_schemas = ResourceSchema.assignable_schemas() if not catalog_schemas: return # We know this schema so we can do some checks - existing_schema = ResourceSchema.get_schema_by_name(self.name) + existing_schema = next((schema for schema in catalog_schemas if schema['name'] == self.name), None) + if not existing_schema: message = _('Schema name "{schema}" is not an allowed value. Allowed values: {values}').format( schema=self.name, @@ -921,23 +924,6 @@ def from_community(self): return True class ResourceSchema(object): - @staticmethod - @cache.memoize(timeout=SCHEMA_CACHE_DURATION) - def objects(): - ''' - This rewrite is used in API returns. - It could be possible in the future to change the API with a breaking change to return - the full schema information from the catalog. - ''' - schemas = ResourceSchema.all() - return [ - { - 'id': s['name'], - 'label': s['title'], - 'versions': [d['version_name'] for d in s['versions']], - } for s in schemas - ] - @staticmethod @cache.memoize(timeout=SCHEMA_CACHE_DURATION) def all(): @@ -971,11 +957,9 @@ def all(): raise SchemasCacheUnavailableException('No content in cache for schema catalog') return schemas - - def get_schema_by_name(name: str): - for schema in ResourceSchema.all(): - if schema['name'] == name: - return schema + + def assignable_schemas(): + return [s for s in ResourceSchema.all() if s.get('schema_type') not in NON_ASSIGNABLE_SCHEMA_TYPES] def get_existing_schema_info_by_url(url: str) -> Optional[Tuple[str, Optional[str]]]: ''' diff --git a/udata/tests/api/test_datasets_api.py b/udata/tests/api/test_datasets_api.py index ded955eb9c..d31821ca81 100644 --- a/udata/tests/api/test_datasets_api.py +++ b/udata/tests/api/test_datasets_api.py @@ -769,6 +769,12 @@ def test_dataset_new_resource_with_schema(self, rmock): self.assert400(response) assert response.json['errors']['resources'][0]['schema']['name'] == [_('Schema name "{schema}" is not an allowed value. Allowed values: {values}').format(schema='unknown-schema', values='etalab/schema-irve-statique, 139bercy/format-commande-publique')] + resource_data['schema'] = {'name': 'etalab/schema-irve'} + data['resources'].append(resource_data) + response = self.put(url_for('api.dataset', dataset=dataset), data) + self.assert400(response) + assert response.json['errors']['resources'][0]['schema']['name'] == [_('Schema name "{schema}" is not an allowed value. Allowed values: {values}').format(schema='etalab/schema-irve', values='etalab/schema-irve-statique, 139bercy/format-commande-publique')] + resource_data['schema'] = {'name': 'etalab/schema-irve-statique', 'version': '42.0.0'} data['resources'].append(resource_data) response = self.put(url_for('api.dataset', dataset=dataset), data) @@ -1779,7 +1785,7 @@ def test_dataset_schemas_api_list(self, api, rmock, app): response = api.get(url_for('api.schemas')) assert200(response) - assert response.json == ResourceSchemaMockData.get_expected_v1_result_from_mock_data() + assert response.json == ResourceSchemaMockData.get_expected_assignable_schemas_from_mock_data() @pytest.mark.options(SCHEMA_CATALOG_URL=None) def test_dataset_schemas_api_list_no_catalog_url(self, api): @@ -1810,7 +1816,7 @@ def test_dataset_schemas_api_list_error_w_cache(self, api, rmock, mocker): rmock.get('https://example.com/schemas', json=ResourceSchemaMockData.get_mock_data()) response = api.get(url_for('api.schemas')) assert200(response) - assert response.json == ResourceSchemaMockData.get_expected_v1_result_from_mock_data() + assert response.json == ResourceSchemaMockData.get_expected_assignable_schemas_from_mock_data() assert cache_mock_set.called # Endpoint becomes unavailable @@ -1819,7 +1825,7 @@ def test_dataset_schemas_api_list_error_w_cache(self, api, rmock, mocker): # Long term cache is used response = api.get(url_for('api.schemas')) assert200(response) - assert response.json == ResourceSchemaMockData.get_expected_v1_result_from_mock_data() + assert response.json == ResourceSchemaMockData.get_expected_assignable_schemas_from_mock_data() @pytest.mark.usefixtures('clean_db') diff --git a/udata/tests/dataset/test_dataset_model.py b/udata/tests/dataset/test_dataset_model.py index 02eaa41bc1..1d351e6734 100644 --- a/udata/tests/dataset/test_dataset_model.py +++ b/udata/tests/dataset/test_dataset_model.py @@ -526,13 +526,13 @@ class ResourceSchemaTest: def test_resource_schema_objects_404_endpoint(self, rmock): rmock.get('https://example.com/notfound', status_code=404) with pytest.raises(SchemasCatalogNotFoundException): - ResourceSchema.objects() + ResourceSchema.all() @pytest.mark.options(SCHEMA_CATALOG_URL='https://example.com/schemas') def test_resource_schema_objects_timeout_no_cache(self, client, rmock): rmock.get('https://example.com/schemas', exc=requests.exceptions.ConnectTimeout) with pytest.raises(SchemasCacheUnavailableException): - ResourceSchema.objects() + ResourceSchema.all() @pytest.mark.options(SCHEMA_CATALOG_URL='https://example.com/schemas') def test_resource_schema_objects(self, app, rmock): @@ -556,21 +556,27 @@ def test_resource_schema_objects(self, app, rmock): ] }) - assert ResourceSchema.objects() == [ + assert ResourceSchema.all() == [ { - "id": "etalab/schema-irve", - "label": "Schéma IRVE", + "name": "etalab/schema-irve", + "title": "Schéma IRVE", "versions": [ - "1.0.0", - "1.0.1", - "1.0.2" + { + "version_name": "1.0.0" + }, + { + "version_name": "1.0.1" + }, + { + "version_name": "1.0.2" + } ] } ] @pytest.mark.options(SCHEMA_CATALOG_URL=None) def test_resource_schema_objects_no_catalog_url(self): - assert ResourceSchema.objects() == [] + assert ResourceSchema.all() == [] @pytest.mark.options(SCHEMA_CATALOG_URL='https://example.com/schemas') def test_resource_schema_objects_w_cache(self, rmock, mocker): @@ -578,12 +584,12 @@ def test_resource_schema_objects_w_cache(self, rmock, mocker): # fill cache rmock.get('https://example.com/schemas', json=ResourceSchemaMockData.get_mock_data()) - ResourceSchema.objects() + ResourceSchema.all() assert cache_mock_set.called mocker.patch.object(cache, 'get', return_value=ResourceSchemaMockData.get_mock_data()['schemas']) rmock.get('https://example.com/schemas', status_code=500) - assert ResourceSchemaMockData.get_expected_v1_result_from_mock_data() == ResourceSchema.objects() + assert ResourceSchemaMockData.get_all_schemas_from_mock_data(with_datapackage_info=False) == ResourceSchema.all() assert rmock.call_count == 2 @pytest.mark.options(SCHEMA_CATALOG_URL='https://example.com/schemas') diff --git a/udata/tests/schemas.json b/udata/tests/schemas.json index 6940a7fef6..a0a451bd64 100644 --- a/udata/tests/schemas.json +++ b/udata/tests/schemas.json @@ -2,6 +2,41 @@ "$schema": "https://opendataschema.frama.io/catalog/schema-catalog.json", "version": 1, "schemas": [ + { + "name": "etalab/schema-irve", + "title": "Infrastructures de recharges pour v\u00e9hicules \u00e9lectriques (IRVE)", + "description": "data package contenant 2 sch\u00e9mas : IRVE statique et IRVE dynamique", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/latest/datapackage.json", + "schema_type": "datapackage", + "contact": "contact@transport.beta.gouv.fr", + "examples": [], + "labels": [ + "Socle Commun des Donn\u00e9es Locales", + "transport.data.gouv.fr" + ], + "consolidation_dataset_id": "5448d3e0c751df01f85d0572", + "versions": [ + { + "version_name": "2.2.0", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.2.0/datapackage.json" + }, + { + "version_name": "2.2.1", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.2.1/datapackage.json" + }, + { + "version_name": "2.3.0", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.3.0/datapackage.json" + }, + { + "version_name": "2.3.1", + "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve/2.3.1/datapackage.json" + } + ], + "external_doc": "https://doc.transport.data.gouv.fr/producteurs/infrastructures-de-recharge-de-vehicules-electriques-irve", + "external_tool": null, + "homepage": "https://github.com/etalab/schema-irve.git" + }, { "name": "etalab/schema-irve-statique", "title": "IRVE statique", From 72e7d002fff3c5626373bf5586f98d09cbf7db52 Mon Sep 17 00:00:00 2001 From: Nicolas KEMPF Date: Fri, 5 Apr 2024 10:06:31 +0200 Subject: [PATCH 3/4] refac: remove DATASET_MAX_RESOURCES_UNCOLLAPSED configuration (#2673) DATASET_MAX_RESOURCES_UNCOLLAPSED configuration is no longer used in udata. BREAKING CHANGE: DATASET_MAX_RESOURCES_UNCOLLAPSED config is removed Co-authored-by: Thibaud Dauce --- CHANGELOG.md | 1 + docs/adapting-settings.md | 8 -------- js/config.js | 6 ------ udata/settings.py | 5 ----- udata/templates/macros/metadata.html | 1 - 5 files changed, 1 insertion(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e474ece87d..29d9e82dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current (in progress) +- :warning: **breaking change** `DATASET_MAX_RESOURCES_UNCOLLAPSED` config is removed. - Replace schemas API with a simple proxy to the `schemas.json` file [#2989](https://github.com/opendatateam/udata/pull/2989) - Topic: add filters in API [#3007](https://github.com/opendatateam/udata/pull/3007) - Move constants outside `models.py` files to `constants.py` [#3001](https://github.com/opendatateam/udata/pull/3001) diff --git a/docs/adapting-settings.md b/docs/adapting-settings.md index 63b2530ef5..2aedcfbd82 100644 --- a/docs/adapting-settings.md +++ b/docs/adapting-settings.md @@ -549,14 +549,6 @@ Whether or not discussions should be enabled on posts The default page size for post listing -## Datasets configuration - -### DATASET_MAX_RESOURCES_UNCOLLAPSED - -**default** `6` - -Max number of resources to display uncollapsed in dataset view. - ## Sentry configuration ### SENTRY_DSN diff --git a/js/config.js b/js/config.js index 5693d4152b..81841fbd05 100644 --- a/js/config.js +++ b/js/config.js @@ -149,11 +149,6 @@ export const license_groups = _jsonMeta('license-groups-options') && Object.from */ export const harvest_validation_contact_form = _meta('harvest-validation-contact-form') -/** - * Max number of resources to display uncollapsed in dataset view - */ -export const dataset_max_resources_uncollapsed = _jsonMeta('dataset-max-resources-uncollapsed'); - /** * The expected business identification format */ @@ -202,7 +197,6 @@ export default { tags, license_groups, harvest_validation_contact_form, - dataset_max_resources_uncollapsed, org_bid_format, is_search_autocomplete_enabled, search_autocomplete_debounce, diff --git a/udata/settings.py b/udata/settings.py index f30773c62d..1970e9afdd 100644 --- a/udata/settings.py +++ b/udata/settings.py @@ -383,11 +383,6 @@ class Defaults(object): # The business identification format to use for validation ORG_BID_FORMAT = 'siret' - # Dataset settings - ########################################################################### - # Max number of resources to display uncollapsed in dataset view - DATASET_MAX_RESOURCES_UNCOLLAPSED = 6 - # Preview settings ########################################################################### # Preview mode can be either `iframe` or `page` or `None` diff --git a/udata/templates/macros/metadata.html b/udata/templates/macros/metadata.html index 8617517ad5..1cae3aff25 100644 --- a/udata/templates/macros/metadata.html +++ b/udata/templates/macros/metadata.html @@ -47,7 +47,6 @@ - {% if config.ORG_BID_FORMAT %} {% endif %} From cc93405eab7e34a9766a4447e3fd2ffdd73a3b64 Mon Sep 17 00:00:00 2001 From: Thibaud Dauce Date: Mon, 8 Apr 2024 10:15:41 +0200 Subject: [PATCH 4/4] Replace docker-compose to docker compose (#3009) --- docs/development-environment.md | 2 -- docs/docker-deployment.md | 2 +- docs/getting-started.md | 6 +++--- docs/quickstart.md | 2 +- docs/testing-code.md | 6 +++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/development-environment.md b/docs/development-environment.md index 10265ecafe..bbf6abe31d 100644 --- a/docs/development-environment.md +++ b/docs/development-environment.md @@ -121,8 +121,6 @@ or [the documentation](building-documentation.md). [Python Virtual Environments - a Primer]: https://realpython.com/blog/python/python-virtual-environments-a-primer/ [dev-server]: http://localhost:7000/ -[docker-compose-install]: https://docs.docker.com/compose/install/ -[docker-compose]: https://docs.docker.com/compose/ [git]: https://git-scm.com/ [github]: https://github.com/opendatateam/udata [new issue]: https://github.com/opendatateam/udata/issues/new diff --git a/docs/docker-deployment.md b/docs/docker-deployment.md index 642dbf8abf..08a797f434 100644 --- a/docs/docker-deployment.md +++ b/docs/docker-deployment.md @@ -11,7 +11,7 @@ Head directly to [the dedicated repository][docker-repository] for an up to date [Docker Compose][] makes it easy to spawn [system dependencies](system-dependencies.md) out of the box by running the following command: ```shell -docker-compose up +docker compose up ``` [Docker]: https://www.docker.com/ diff --git a/docs/getting-started.md b/docs/getting-started.md index 720763dd31..df55fbf5ee 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -14,7 +14,7 @@ We’ll use the following repositories: udata requires several libraries to be installed to work. You can see them on the udata documentation link below. -We’ll use [docker-compose](https://docs.docker.com/compose/) to manage external services so you don’t have to install native mongodb and redis. +We’ll use [docker compose](https://docs.docker.com/compose/) to manage external services so you don’t have to install native mongodb and redis. # Setup udata @@ -50,11 +50,11 @@ In this new directory, clone udata : git clone git@github.com:opendatateam/udata.git ``` -You can start your local development environment with docker-compose. +You can start your local development environment with docker compose. ```bash cd udata -docker-compose up +docker compose up ``` !!! warning diff --git a/docs/quickstart.md b/docs/quickstart.md index 5e9066e8d5..53f0390aee 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -1,7 +1,7 @@ The prefered way to test udata is to use the [docker images][] to easily have an up and ready udata instance. Pre-configured udata with needed middlewares are given as examples. -You will need to install [docker]() and [docker-compose][] before getting started. +You will need to install [docker][] and [docker-compose][] before getting started. ``` git clone https://github.com/opendatateam/docker-udata diff --git a/docs/testing-code.md b/docs/testing-code.md index 83ec94a686..f157063f56 100644 --- a/docs/testing-code.md +++ b/docs/testing-code.md @@ -8,16 +8,16 @@ unit tests for the frontend and integration tests. If you need to use an alternative Mongo instance during tests, you can provide the alternate urls in you `udata.cfg` with `MONGODB_HOST_TEST`. -**E.g.**: To make use of the tmpfs based middleware provided by docker-compose, use: +**E.g.**: To make use of the tmpfs based middleware provided by docker compose, use: ```python MONGODB_HOST_TEST = 'mongodb://localhost:27018/udata' ``` -And then start docker-compose with the extra file: +And then start docker compose with the extra file: ```shell -$ docker-compose -f docker-compose.yml -f docker-compose.test.yml up +$ docker compose -f docker-compose.yml -f docker-compose.test.yml up ``` This will start a MongoDB extra service, tmpfs based and your tests will