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

Use the new config_target property in the datastore settings form #4183

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion dkan.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: DKAN
description: 'DKAN Open Data Portal'
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
dependencies:
- dkan:metastore
Expand Down
2 changes: 1 addition & 1 deletion modules/common/common.info.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Common
description: Provides common utilities, functions, and base api endpoints used by other DKAN modules.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
2 changes: 1 addition & 1 deletion modules/common/modules/dkan_alt_api/dkan_alt_api.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Alternate API'
description: 'Provides alternate routes to access data and allows varying permissions on an api when logged in or anonymous.'
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
dependencies:
- metastore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: 'Processor API Test'
type: module
description: 'Support module for testing custom processor APIs.'
package: Testing
core_version_requirement: ^10
core_version_requirement: ^10.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Data Dictionary Widget'
description: 'Provides a field widget to generate a data-dictionary form'
package: DKAN
type: module
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10.2
dependencies:
- drupal:field
- metastore
3 changes: 2 additions & 1 deletion modules/datastore/config/install/datastore.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ rows_limit: 500
purge_file: 1
purge_table: 1
triggering_properties: []
response_stream_max_age: 3600
response_stream_max_age: 3600
delete_local_resource: false
4 changes: 2 additions & 2 deletions modules/datastore/config/schema/datastore.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ datastore.settings:
rows_limit:
type: integer
purge_file:
type: integer
type: boolean
purge_table:
type: integer
type: boolean
triggering_properties:
type: sequence
sequence:
Expand Down
2 changes: 1 addition & 1 deletion modules/datastore/datastore.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Datastore
description: Provides integration with the datastore library.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
dependencies:
- dkan:common
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Datastore MySQL Import
description: Provides a MySQL Importer class.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
configure: datastore.mysql_import.settings
dependencies:
Expand Down
11 changes: 6 additions & 5 deletions modules/datastore/src/Form/ResourceSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function getFormId() {
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return ['datastore.settings', 'metastore.settings'];
// This form uses #config_target instead.
return [];
}

/**
Expand All @@ -41,17 +42,17 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['resources']['purge_table'] = [
'#type' => 'checkbox',
'#title' => $this->t('Datastore table'),
'#default_value' => $this->config('datastore.settings')->get('purge_table'),
'#config_target' => 'datastore.settings:purge_table',
];
$form['resources']['purge_file'] = [
'#type' => 'checkbox',
'#title' => $this->t('File'),
'#default_value' => $this->config('datastore.settings')->get('purge_file'),
'#config_target' => 'datastore.settings:purge_file',
];
$form['delete_local_resource'] = [
'#type' => 'checkbox',
'#title' => $this->t('Delete local resource'),
'#default_value' => $this->config('datastore.settings')->get('delete_local_resource'),
'#config_target' => 'datastore.settings:delete_local_resource',
'#description' => $this->t('Delete local copy of remote files after the datastore import is complete'),
];
$form['drop_datastore_on_post_import_error'] = [
Expand All @@ -73,7 +74,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
DataResource::DEFAULT_SOURCE_PERSPECTIVE => $this->t('Source'),
ResourceLocalizer::LOCAL_URL_PERSPECTIVE => $this->t('Local URL'),
],
'#default_value' => $this->config('metastore.settings')->get('resource_perspective_display') ?: DataResource::DEFAULT_SOURCE_PERSPECTIVE,
'#config_target' => 'metastore.settings:resource_perspective_display',
];
return parent::buildForm($form, $form_state);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/dkan_js_frontend/dkan_js_frontend.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: DKAN JS Frontend
description: Provides the routing connection between Drupal and a decoupled JavaScript frontend.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
dependencies:
- drupal:field
package: DKAN
2 changes: 1 addition & 1 deletion modules/frontend/frontend.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Front End
description: Provides the routing connection between Drupal and a decoupled frontend.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
dependencies:
- drupal:field
package: DKAN
Expand Down
2 changes: 1 addition & 1 deletion modules/harvest/harvest.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Harvest
description: Provides integration with the harvest library.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
dependencies:
- dkan:common
Expand Down
2 changes: 1 addition & 1 deletion modules/json_form_widget/json_form_widget.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: JSON Form Widget
description: Provides a widget for generating a form based on JSON Schema.
package: DKAN
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
dependencies:
- select_or_other
- select2
Expand Down
2 changes: 1 addition & 1 deletion modules/metastore/metastore.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Metastore
description: Provides integration with the metastore library and creates the "Data" content type for storing metadata.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
dependencies:
- dkan:common
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Administration
description: Provides administrative views for managing dataset content.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
dependencies:
- dkan:metastore
- drupal:breakpoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: DKAN Metastore Facets
description: Provides facet blocks for DKAN Metastore Search.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
dependencies:
- dkan:metastore_search
- facets:facets
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Search
description: Provides an endpoint to perform searches against DKAN's metadata.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
dependencies:
- dkan:metastore
- drupal:search_api
Expand Down
2 changes: 1 addition & 1 deletion modules/sample_content/sample_content.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Sample Content
description: Provides sample content for tests or standing up a demo instance.
type: module
core_version_requirement: ^10
core_version_requirement: ^10.2
package: DKAN
dependencies:
- dkan:harvest