Issue #2058499 by mtift, BarisW: Added Combine Configuration Management menu items into one main menu item.

8.0.x
webchick 2013-09-24 23:34:48 +02:00
parent 6f40891913
commit b72614febb
10 changed files with 49 additions and 31 deletions

View File

@ -486,10 +486,10 @@ function drupal_install_config_directories() {
// to the drupal core repo.
switch ($config_type) {
case CONFIG_ACTIVE_DIRECTORY:
$text = 'This directory contains the active configuration for your Drupal site. To move this configuration between environments, contents from this directory should be placed in the staging directory on the target server. To make this configuration active, see admin/config/development/sync on the target server.';
$text = 'This directory contains the active configuration for your Drupal site. To move this configuration between environments, contents from this directory should be placed in the staging directory on the target server. To make this configuration active, see admin/config/development/configuration/sync on the target server.';
break;
case CONFIG_STAGING_DIRECTORY:
$text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, see admin/config/development/sync.';
$text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, see admin/config/development/configuration/sync.';
break;
}
$text .= ' For information about deploying configuration between servers, see http://drupal.org/documentation/administer/config';

View File

@ -4,4 +4,4 @@ description: 'Allows administrators to manage configuration changes.'
package: Core
version: VERSION
core: 8.x
configure: admin/config/development/sync
configure: admin/config/development/configuration/sync

View File

@ -18,7 +18,7 @@ function config_help($path, $arg) {
)) . '</p>';
return $output;
case 'admin/config/development/sync':
case 'admin/config/development/configuration/sync':
$output = '';
$output .= '<p>' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '</p>';
return $output;
@ -61,27 +61,38 @@ function config_file_download($uri) {
* Implements hook_menu().
*/
function config_menu() {
$items['admin/config/development/sync'] = array(
'title' => 'Synchronize configuration',
$items['admin/config/development/configuration'] = array(
'title' => 'Configuration management',
'description' => 'Import, export, or synchronize your site configuration.',
'route_name' => 'config_management',
);
$items['admin/config/development/configuration/sync'] = array(
'title' => 'Synchronize',
'description' => 'Synchronize configuration changes.',
'route_name' => 'config.sync',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 0,
);
$items['admin/config/development/export'] = array(
'title' => 'Configuration export',
$items['admin/config/development/configuration/export'] = array(
'title' => 'Export',
'description' => 'Export your site configuration',
'route_name' => 'config.export',
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
$items['admin/config/development/import'] = array(
'title' => 'Configuration import',
$items['admin/config/development/configuration/import'] = array(
'title' => 'Import',
'description' => 'Import configuration for your site',
'route_name' => 'config.import',
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
$items['admin/config/development/sync/diff/%'] = array(
$items['admin/config/development/configuration/sync/diff/%'] = array(
'title' => 'Configuration file diff',
'description' => 'Diff between active and staged configuration.',
'route_name' => 'config.diff',
);
$items['admin/config/development/sync/import'] = array(
$items['admin/config/development/configuration/sync/import'] = array(
'title' => 'Import',
'type' => MENU_DEFAULT_LOCAL_TASK,
);

View File

@ -1,33 +1,40 @@
config.diff:
path: '/admin/config/development/sync/diff/{config_file}'
path: '/admin/config/development/configuration/sync/diff/{config_file}'
defaults:
_content: '\Drupal\config\Controller\ConfigController::diff'
requirements:
_permission: 'synchronize configuration'
config.export_download:
path: '/admin/config/development/export-download'
config_management:
path: '/admin/config/development/configuration'
defaults:
_form: '\Drupal\config\Form\ConfigSync'
requirements:
_permission: 'synchronize configuration'
config_export_download:
path: '/admin/config/development/configuration/export-download'
defaults:
_controller: '\Drupal\config\Controller\ConfigController::downloadExport'
requirements:
_permission: 'export configuration'
config.export:
path: '/admin/config/development/export'
path: '/admin/config/development/configuration/export'
defaults:
_form: '\Drupal\config\Form\ConfigExportForm'
requirements:
_permission: 'export configuration'
config.import:
path: '/admin/config/development/import'
path: '/admin/config/development/configuration/import'
defaults:
_form: '\Drupal\config\Form\ConfigImportForm'
requirements:
_permission: 'import configuration'
config.sync:
path: '/admin/config/development/sync'
path: '/admin/config/development/configuration/sync'
defaults:
_form: '\Drupal\config\Form\ConfigSync'
requirements:

View File

@ -123,7 +123,7 @@ class ConfigController implements ContainerInjectionInterface {
),
),
'#title' => "Back to 'Synchronize configuration' page.",
'#href' => 'admin/config/development/sync',
'#href' => 'admin/config/development/configuration/sync',
);
return $build;

View File

@ -39,7 +39,7 @@ class ConfigExportForm extends FormBase {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$form_state['redirect'] = 'admin/config/development/export-download';
$form_state['redirect'] = 'admin/config/development/configuration/export-download';
}
}

View File

@ -96,7 +96,7 @@ class ConfigImportForm extends FormBase {
}
$archiver->extractList($files, config_get_config_directory(CONFIG_STAGING_DIRECTORY));
drupal_set_message($this->t('Your configuration files were successfully uploaded, ready for import.'));
$form_state['redirect'] = 'admin/config/development/sync';
$form_state['redirect'] = 'admin/config/development/configuration/sync';
}
catch (\Exception $e) {
form_set_error('import_tarball', $this->t('Could not extract the contents of the tar file. The error message is <em>@message</em>', array('@message' => $e->getMessage())));

View File

@ -44,11 +44,11 @@ class ConfigExportUITest extends WebTestBase {
*/
function testExport() {
// Verify the export page with export submit button is available.
$this->drupalGet('admin/config/development/export');
$this->drupalGet('admin/config/development/configuration/export');
$this->assertFieldById('edit-submit', t('Export'));
// Submit the export form and verify response.
$this->drupalPostForm('admin/config/development/export', array(), t('Export'));
$this->drupalPostForm('admin/config/development/configuration/export', array(), t('Export'));
$this->assertResponse(200, 'User can access the download callback.');
// Get the archived binary file provided to user for download.

View File

@ -41,7 +41,7 @@ class ConfigImportUITest extends WebTestBase {
$storage = $this->container->get('config.storage');
$staging = $this->container->get('config.storage.staging');
$this->drupalGet('admin/config/development/sync');
$this->drupalGet('admin/config/development/configuration/sync');
$this->assertText('There are no configuration changes.');
$this->assertNoFieldById('edit-submit', t('Import all'));
@ -65,7 +65,7 @@ class ConfigImportUITest extends WebTestBase {
$this->assertIdentical($staging->exists($dynamic_name), TRUE, $dynamic_name . ' found.');
// Verify that both appear as ready to import.
$this->drupalGet('admin/config/development/sync');
$this->drupalGet('admin/config/development/configuration/sync');
$this->assertText($name);
$this->assertText($dynamic_name);
$this->assertFieldById('edit-submit', t('Import all'));
@ -98,7 +98,7 @@ class ConfigImportUITest extends WebTestBase {
$this->prepareSiteNameUpdate($new_site_name);
// Verify that there are configuration differences to import.
$this->drupalGet('admin/config/development/sync');
$this->drupalGet('admin/config/development/configuration/sync');
$this->assertNoText(t('There are no configuration changes.'));
// Acquire a fake-lock on the import mechanism.
@ -140,7 +140,7 @@ class ConfigImportUITest extends WebTestBase {
$staging->write($config_name, $staging_data);
// Load the diff UI and verify that the diff reflects the change.
$this->drupalGet('admin/config/development/sync/diff/' . $config_name);
$this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
$this->assertTitle(format_string('View changes of @config_name | Drupal', array('@config_name' => $config_name)));
// Reset data back to original, and remove a key
@ -149,7 +149,7 @@ class ConfigImportUITest extends WebTestBase {
$staging->write($config_name, $staging_data);
// Load the diff UI and verify that the diff reflects a removed key.
$this->drupalGet('admin/config/development/sync/diff/' . $config_name);
$this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
// Reset data back to original and add a key
$staging_data = $original_data;
@ -157,7 +157,7 @@ class ConfigImportUITest extends WebTestBase {
$staging->write($config_name, $staging_data);
// Load the diff UI and verify that the diff reflects an added key.
$this->drupalGet('admin/config/development/sync/diff/' . $config_name);
$this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
}
function prepareSiteNameUpdate($new_site_name) {

View File

@ -36,13 +36,13 @@ class ConfigImportUploadTest extends WebTestBase {
*/
function testImport() {
// Verify access to the config upload form.
$this->drupalGet('admin/config/development/import');
$this->drupalGet('admin/config/development/configuration/import');
$this->assertResponse(200);
// Attempt to upload a non-tar file.
$text_file = current($this->drupalGetTestFiles('text'));
$edit = array('files[import_tarball]' => drupal_realpath($text_file->uri));
$this->drupalPostForm('admin/config/development/import', $edit, t('Upload'));
$this->drupalPostForm('admin/config/development/configuration/import', $edit, t('Upload'));
$this->assertText(t('Could not extract the contents of the tar file'));
}