Problem/Motivation
/admin/config/development/configuration displays a list of changed and updated config. Many times when the configuration is handled by a repository it is more appropriate to download one config change to the repository than the entire config (such as when a config change has been made on the devel instance needs to deploy to the whole stack. Individual config can be downloaded/uploaded at /admin/config/development/configuration/single/export and /admin/config/development/configuration/single/import, but there is no link from the synchronize page to these pages. It would aid this workflow to be able to link directly to the configuration item from the synchronization screen.
Proposed resolution
Change the button on /admin/config/development/configuration that says "view differences" to a drop-button with options to "View Differences", "Export this config", "Import to this config" with the items linking to the appropriate entry on the export/import page. This will require the following changes
- Change "View Differences" button to drop-button
- "View Differences" target remains as is
- "Export this config" target is /admin/config/development/configuration/single/export?config_type={{type}}&config_name={{name}}
- "Import to this config" target is /admin/config/development/configuration/single/import?config_type={{type}}&config_name={{name}}
- Modify /admin/config/development/configuration/single/export and /admin/config/development/configuration/single/import to allow parameters for content_type and content_name
Remaining tasks
User interface changes
- Change the "View Differences" button on /admin/config/development/configuration to a drop-button with the above options
- Add ability to select config to export/import based on url parameters.
Release notes snippet
Link directly from Configuration Synchronization page to individual import/export.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3399927_after-patch.mov | 7.06 MB | abhijith s |
| #3 | 3399927-link-to-config-1.patch | 4.88 KB | riyas_nr |
Issue fork drupal-3399927
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anoopjohn commentedThis would be a great feature to have. Especially with projects that are under active development / enhancements / customization, there would be a lot of time savings for its developers.
Comment #3
riyas_nr commentedI have created a patch that adds the following link to the 'View Differences' drop-down button on the /admin/config/development/configuration page:
I have omitted the 'Import this config' link because there is no option for single config selection on the import page.
Comment #4
riyas_nr commentedComment #5
smustgrave commentedKind of change will require test coverage.
Probably also submaintainer sign off.
Comment #7
riyas_nr commentedI have added test coverage for the changes. The merge request is ready for review now.
Comment #8
riyas_nr commentedComment #10
smustgrave commentedTest failure.
Comment #11
riyas_nr commentedCorrected the issue where the configuration type entity did not exist.
Comment #12
abhijith s commentedApplied MR !5953 on D11.x.
The Export this config button is working fine which is redirecting to export config page with parameters os selected config entity.
However the Import to this config link is not implemented.
Comment #13
prashant.c1. Introducing a new link labeled "Import this configuration."
2. Clicking on the link will redirect the user to "/admin/config/development/configuration/single/import/[config_type]/[config_name]."
3. The "Paste your configuration here" textarea will be automatically populated with the original configurations.
4. Press the "Import" button to initiate the import of the default configurations.
However, there are still pending tasks, including code review, code cleanup, and testing.
Comment #14
riyas_nr commentedComment #15
smustgrave commentedMR seems to have failures. There are some backwards compatibility concerns as that path will now be broken. May need to cover that.
Comment #16
riyas_nr commentedRefactored the code and removed 'Import this config' link for configs under Removed section.
Comment #17
guptahemant commentedHi @riyas_nr
Did a code review and included few more suggestions.
Comment #18
riyas_nr commented$sync_storagein constructor of\Drupal\config\Form\ConfigSingleImportForm$entity_type_managerin constructor of\Drupal\config\Form\ConfigSyncComment #19
riyas_nr commentedComment #20
smustgrave commentedLeft more comments.
Comment #21
riyas_nr commentedComment #22
smustgrave commented@alexpott are we good to remove subsystem review?
Comment #23
smustgrave commentedTried testing this one out.
On the configuration sync page I am seeing the dropdown for export/import
Export seems to work correctly
But import whenI click it I get redirected to the import form. Dropdown is empty and text area is also empty. Seems odd that the dropdown for config was empty at least.