Skip to content

Commit 5252922

Browse files
committed
Issue #2897929 by bojanz: Move Stores to admin/commerce/config
1 parent 298da3c commit 5252922

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed

modules/price/commerce_price.links.menu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ entity.commerce_currency.collection:
33
route_name: entity.commerce_currency.collection
44
parent: 'commerce.store_configuration'
55
description: 'Manage your currencies.'
6+
weight: -20
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
entity.commerce_store.collection:
22
title: 'Stores'
33
route_name: 'entity.commerce_store.collection'
4-
parent: 'commerce.admin_commerce'
4+
parent: 'commerce.store_configuration'
55
description: 'Manage your stores.'
6+
weight: -10
67

78
entity.commerce_store_type.collection:
89
title: 'Store types'
910
route_name: 'entity.commerce_store_type.collection'
1011
parent: 'commerce.store_configuration'
1112
description: 'Manage fields, form and display settings for your stores.'
13+
weight: -5

modules/store/commerce_store.post_update.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,35 @@ function commerce_store_post_update_1() {
3636

3737
return $message;
3838
}
39+
40+
/**
41+
* Revert the Stores view.
42+
*/
43+
function commerce_store_post_update_2() {
44+
/** @var \Drupal\commerce\Config\ConfigUpdaterInterface $config_updater */
45+
$config_updater = \Drupal::service('commerce.config_updater');
46+
47+
$views = [
48+
'views.view.commerce_stores',
49+
];
50+
$result = $config_updater->revert($views, FALSE);
51+
52+
$success_results = $result->getSucceeded();
53+
$failure_results = $result->getFailed();
54+
$message = '';
55+
if ($success_results) {
56+
$message = t('Succeeded:') . '<br>';
57+
foreach ($success_results as $success_message) {
58+
$message .= $success_message . '<br>';
59+
}
60+
$message .= '<br>';
61+
}
62+
if ($failure_results) {
63+
$message .= t('Failed:') . '<br>';
64+
foreach ($failure_results as $failure_message) {
65+
$message .= $failure_message . '<br>';
66+
}
67+
}
68+
69+
return $message;
70+
}

modules/store/config/install/views.view.commerce_stores.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ display:
422422
position: 1
423423
display_options:
424424
display_extenders: { }
425-
path: admin/commerce/stores
425+
path: admin/commerce/config/stores
426426
cache_metadata:
427427
contexts:
428428
- 'languages:language_content'

modules/store/src/Entity/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
* "add-form" = "/store/add/{commerce_store_type}",
6464
* "edit-form" = "/store/{commerce_store}/edit",
6565
* "delete-form" = "/store/{commerce_store}/delete",
66-
* "delete-multiple-form" = "/admin/commerce/stores/delete",
67-
* "collection" = "/admin/commerce/stores",
66+
* "delete-multiple-form" = "/admin/commerce/config/stores/delete",
67+
* "collection" = "/admin/commerce/config/stores",
6868
* },
6969
* bundle_entity_type = "commerce_store_type",
7070
* field_ui_base_route = "entity.commerce_store_type.edit_form",

modules/store/tests/src/FunctionalJavascript/StoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function getAdministratorPermissions() {
3535
* Tests creating a store.
3636
*/
3737
public function testCreateStore() {
38-
$this->drupalGet('admin/commerce/stores');
38+
$this->drupalGet('admin/commerce/config/stores');
3939
$this->getSession()->getPage()->clickLink('Add store');
4040

4141
// Check the integrity of the form.

0 commit comments

Comments
 (0)