Commit dd286cd3 authored by Petar Gnjidic's avatar Petar Gnjidic

Issue #2508984: Move the stores ui

parent d7ad6514
entity.commerce_store.collection:
title: 'Store information'
title: 'Stores'
route_name: 'entity.commerce_store.collection'
parent: 'commerce.configuration'
parent: 'commerce.admin_commerce'
description: 'Configure your store settings.'
entity.commerce_store_type.collection:
title: 'Store types'
route_name: 'entity.commerce_store_type.collection'
parent: 'commerce.configuration'
description: 'Manage your store types.'
entity.commerce_store.add_page:
path: '/admin/commerce/config/store/add'
path: '/admin/commerce/stores/add'
defaults:
_title: 'Add a new store'
_bundle_type: commerce_store_type
......@@ -8,7 +8,7 @@ entity.commerce_store.add_page:
_permission: 'administer stores'
entity.commerce_store.add_form:
path: '/admin/commerce/config/store/add/{commerce_store_type}'
path: '/admin/commerce/stores/add/{commerce_store_type}'
defaults:
_controller: '\Drupal\commerce\Controller\AddController::addForm'
_title_callback: '\Drupal\commerce\Controller\AddController::addFormTitle'
......@@ -21,7 +21,7 @@ entity.commerce_store.add_form:
_permission: 'administer stores'
entity.commerce_store.collection:
path: '/admin/commerce/config/store'
path: '/admin/commerce/stores'
defaults:
_entity_list: 'commerce_store'
_title: 'Store information'
......@@ -29,7 +29,7 @@ entity.commerce_store.collection:
_permission: 'administer stores'
entity.commerce_store.edit_form:
path: '/admin/commerce/config/store/{commerce_store}/edit'
path: '/admin/commerce/stores/{commerce_store}/edit'
defaults:
_entity_form: commerce_store.edit
_title: 'Edit a store'
......@@ -37,7 +37,7 @@ entity.commerce_store.edit_form:
_entity_access: 'commerce_store.edit'
entity.commerce_store.delete_form:
path: '/admin/commerce/config/store/{commerce_store}/delete'
path: '/admin/commerce/stores/{commerce_store}/delete'
defaults:
_entity_form: commerce_store.delete
_title: 'Delete a store'
......@@ -45,7 +45,7 @@ entity.commerce_store.delete_form:
_entity_access: 'commerce_store.delete'
entity.commerce_store_type.add_form:
path: '/admin/commerce/config/store/types/add'
path: '/admin/commerce/config/store-types/add'
defaults:
_entity_form: 'commerce_store_type.add'
_title: 'Add a new store type'
......@@ -53,7 +53,7 @@ entity.commerce_store_type.add_form:
_permission: 'administer store types'
entity.commerce_store_type.collection:
path: '/admin/commerce/config/store/types'
path: '/admin/commerce/config/store-types'
defaults:
_entity_list: 'commerce_store_type'
_title: 'Store types'
......@@ -61,7 +61,7 @@ entity.commerce_store_type.collection:
_permission: 'administer store types'
entity.commerce_store_type.edit_form:
path: '/admin/commerce/config/store/types/{commerce_store_type}/edit'
path: '/admin/commerce/config/store-types/{commerce_store_type}/edit'
defaults:
_entity_form: 'commerce_store_type.edit'
_title: 'Edit a store type'
......@@ -69,7 +69,7 @@ entity.commerce_store_type.edit_form:
_entity_access: 'commerce_store_type.edit'
entity.commerce_store_type.delete_form:
path: '/admin/commerce/config/store/types/{commerce_store_type}/delete'
path: '/admin/commerce/config/store-types/{commerce_store_type}/delete'
defaults:
_entity_form: 'commerce_store_type.delete'
_title: 'Delete a store type'
......
......@@ -465,7 +465,7 @@ display:
position: 1
display_options:
display_extenders: { }
path: admin/commerce/config/store
path: admin/commerce/stores
cache_metadata:
contexts:
- 'languages:language_content'
......
......@@ -45,10 +45,10 @@ use Drupal\user\UserInterface;
* "uuid" = "uuid"
* },
* links = {
* "canonical" = "/admin/commerce/config/store/{commerce_store}",
* "edit-form" = "/admin/commerce/config/store/{commerce_store}/edit",
* "delete-form" = "/admin/commerce/config/store/{commerce_store}/delete",
* "collection" = "/admin/commerce/config/store",
* "canonical" = "/admin/commerce/stores/{commerce_store}",
* "edit-form" = "/admin/commerce/stores/{commerce_store}/edit",
* "delete-form" = "/admin/commerce/stores/{commerce_store}/delete",
* "collection" = "/admin/commerce/stores",
* },
* bundle_entity_type = "commerce_store_type",
* field_ui_base_route = "entity.commerce_store_type.edit_form",
......
......@@ -41,9 +41,9 @@ use Drupal\Core\Entity\EntityStorageException;
* "description",
* },
* links = {
* "edit-form" = "/admin/commerce/config/store/types/{commerce_store_type}/edit",
* "delete-form" = "/admin/commerce/config/store/types/{commerce_store_type}/delete",
* "collection" = "/admin/commerce/config/store/types",
* "edit-form" = "/admin/commerce/config/store-types/{commerce_store_type}/edit",
* "delete-form" = "/admin/commerce/config/store-types/{commerce_store_type}/delete",
* "collection" = "/admin/commerce/config/store-types",
* }
* )
*/
......
......@@ -54,7 +54,7 @@ class StoreTest extends StoreTestBase {
$this->assertTrue($storeExist, 'The new store has been created in the database.');
// Create a store through the form.
$this->drupalGet('admin/commerce/config/store');
$this->drupalGet('admin/commerce/stores');
$this->clickLink('Add a new store');
$this->clickLink($this->type->label());
$edit = [
......@@ -77,7 +77,7 @@ class StoreTest extends StoreTestBase {
]
);
$this->drupalGet('admin/commerce/config/store');
$this->drupalGet('admin/commerce/stores');
$this->clickLink(t('Edit'));
// Only change the name.
$edit = [
......
......@@ -20,7 +20,7 @@ class StoreTypeTest extends StoreTestBase {
* Tests if the default Store Type was created.
*/
public function testDefaultStoreType() {
$this->drupalGet('admin/commerce/config/store/types');
$this->drupalGet('admin/commerce/config/store-types');
$storeTypes = StoreType::loadMultiple();
$this->assertTrue(isset($storeTypes['online']), 'Store Type Web is available');
......@@ -37,7 +37,7 @@ class StoreTypeTest extends StoreTestBase {
$tableSelector = 'table tbody tr';
// The store shows one default store type.
$this->drupalGet('admin/commerce/config/store/types');
$this->drupalGet('admin/commerce/config/store-types');
$storeTypes = $this->cssSelect($tableSelector);
$this->assertEqual(count($storeTypes), 1, 'Stores types are correctly listed');
......@@ -48,7 +48,7 @@ class StoreTypeTest extends StoreTestBase {
]
);
$this->drupalGet('admin/commerce/config/store/types');
$this->drupalGet('admin/commerce/config/store-types');
$storeTypes = $this->cssSelect($tableSelector);
$this->assertEqual(count($storeTypes), 2, 'Stores types are correctly listed');
}
......@@ -74,7 +74,7 @@ class StoreTypeTest extends StoreTestBase {
'id' => 'foo',
'label' => 'Label of foo',
];
$this->drupalPostForm('admin/commerce/config/store/types/add', $edit, t('Save'));
$this->drupalPostForm('admin/commerce/config/store-types/add', $edit, t('Save'));
$typeExists = (bool) StoreType::load($edit['id']);
$this->assertTrue($typeExists, 'The new store type has been created in the database.');
}
......@@ -94,7 +94,7 @@ class StoreTypeTest extends StoreTestBase {
$edit = [
'label' => $this->randomMachineName(8),
];
$this->drupalPostForm('admin/commerce/config/store/types/online/edit', $edit, 'Save');
$this->drupalPostForm('admin/commerce/config/store-types/online/edit', $edit, 'Save');
$storeTypeChanged = StoreType::load($storeType->id());
$this->assertEqual($storeType->label(), $storeTypeChanged->label(), 'The label of the store type has been changed.');
}
......@@ -118,7 +118,7 @@ class StoreTypeTest extends StoreTestBase {
]);
// Try to delete the store type.
$this->drupalGet('admin/commerce/config/store/types/' . $type->id() . '/delete');
$this->drupalGet('admin/commerce/config/store-types/' . $type->id() . '/delete');
$this->assertRaw(
t('%type is used by 1 store on your site. You can not remove this store type until you have removed all of the %type stores.', ['%type' => $type->label()]),
'The store type will not be deleted until all stores of that type are deleted'
......@@ -127,7 +127,7 @@ class StoreTypeTest extends StoreTestBase {
// Deleting the store type when its not being referenced by a store.
$store->delete();
$this->drupalGet('admin/commerce/config/store/types/' . $type->id() . '/delete');
$this->drupalGet('admin/commerce/config/store-types/' . $type->id() . '/delete');
$this->assertRaw(
t('Are you sure you want to delete the store type %type?', ['%type' => $type->label()]),
'The store type is available for deletion'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment