Link to Config Item from configuration synchronize page

Created on 7 November 2023, 8 months ago
Updated 13 March 2024, 3 months ago

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.

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Configurationย  โ†’

Last updated about 2 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States kwfinken Lansing, MI

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kwfinken
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States anoopjohn Washington D. C.

    This 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.

  • I have created a patch that adds the following link to the 'View Differences' drop-down button on the /admin/config/development/configuration page:

    • "'Export this config' with a target URL of /admin/config/development/configuration/single/export/{{type}}/{{name}}

    I have omitted the 'Import this config' link because there is no option for single config selection on the import page.

  • Status changed to Needs review 6 months ago
  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Kind of change will require test coverage.

    Probably also submaintainer sign off.

  • Merge request !5953Resolve #3399927 "Link to config" โ†’ (Open) created by riyas_nr
  • I have added test coverage for the changes. The merge request is ready for review now.

  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Prashant.c Dharamshala

    Prashant.c โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Test failure.

  • Status changed to Needs review 6 months ago
  • Corrected the issue where the configuration type entity did not exist.

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Abhijith S

    Applied 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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Prashant.c Dharamshala

    1. 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.

  • Status changed to Needs review 6 months ago
    1. Fixed phpcs issue regarding unused use statement.
    2. For removed configs, single "Import this config" link leads to 'false' text in the import text area because the config doesn't exist. Added config exists check on the singe import page.
    3. Added test coverage for 'Import this config' link.
  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    MR seems to have failures. There are some backwards compatibility concerns as that path will now be broken. May need to cover that.

  • Status changed to Needs review 6 months ago
  • Refactored the code and removed 'Import this config' link for configs under Removed section.

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia guptahemant

    Hi @riyas_nr

    Did a code review and included few more suggestions.

    1. Added below parameters as optional.
      1. $sync_storage in constructor of \Drupal\config\Form\ConfigSingleImportForm
      2. $entity_type_manager in constructor of \Drupal\config\Form\ConfigSync
    2. Updated deprecation warning for both parameters.
    3. Added change records for above parameters.
  • Status changed to Needs review 6 months ago
  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Left more comments.

  • Status changed to Needs review 6 months ago
    1. Added typehints for method parameters and properties
    2. Changed method name updateImport to getStagedConfigByName()
    3. Changed access modifier of helper functions to protected
    4. Moved optional parameters to end of the constructor arguments
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    @alexpott are we good to remove subsystem review?

  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Tried 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.

Production build 0.69.0 2024