Skip to content

Commit 20120b9

Browse files
committed
Merge branch 'MAGETWO-52835' into MAGETWO-52836
2 parents c428331 + 5fb6039 commit 20120b9

File tree

34 files changed

+1677
-1806
lines changed

34 files changed

+1677
-1806
lines changed

app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<script id="translate-form-template" type="text/x-magento-template">
1818
<form id="<%- data.id %>">
1919
<% _.each(data.items, function(item, i) { %>
20-
<div class="magento_table_container">
20+
<div class="translate-table-container">
2121
<table class="table">
2222
<% _.each(item, function(value, index) { %>
2323
<tr>

app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<script id="translate-form-template" type="text/x-magento-template">
1919
<form id="<%- data.id %>">
2020
<% _.each(data.items, function(item, i) { %>
21-
<div class="magento_table_container">
21+
<div class="translate-table-container">
2222
<table cellspacing="0" class="table">
2323
<% _.each(item, function(value, index) { %>
2424
<tr>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// /**
2+
// * Copyright © 2016 Magento. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
// General rule hides group legend and shows first field label instead
7+
// in app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
8+
// This must be reset for Customer Address page
9+
.address-item-edit-content {
10+
.admin__field {
11+
legend {
12+
&.admin__field-label {
13+
opacity: 1;
14+
}
15+
}
16+
}
17+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// /**
2+
// * Copyright © 2016 Magento. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Inline translations
8+
// _____________________________________________
9+
10+
//
11+
// Variables
12+
// ---------------------------------------------
13+
14+
@translate-inline-title__z-index: @menu__z-index + 1;
15+
16+
//
17+
// Form
18+
// ---------------------------------------------
19+
20+
.translate-table-container {
21+
table {
22+
width: 100%;
23+
}
24+
25+
td {
26+
background: none;
27+
padding: @indent__xs;
28+
text-align: left;
29+
30+
&.value {
31+
.input-text {
32+
width: 100%;
33+
}
34+
}
35+
}
36+
37+
th {
38+
&.label {
39+
border: none;
40+
font-weight: @font-weight__bold;
41+
padding: @indent__xs;
42+
text-align: left;
43+
width: 150px;
44+
}
45+
}
46+
}
47+
48+
//
49+
// Special tags
50+
// ---------------------------------------------
51+
52+
.translate-inline-title {
53+
display: block;
54+
left: 0;
55+
position: absolute;
56+
top: 0;
57+
z-index: @translate-inline-title__z-index;
58+
}
59+
60+
// Script tag that placed between menu and page wrapper
61+
.translate-inline-script {
62+
.menu-wrapper ~ & {
63+
display: block;
64+
left: @menu__width;
65+
position: absolute;
66+
top: 0;
67+
z-index: @translate-inline-title__z-index;
68+
}
69+
}

lib/internal/Magento/Framework/EntityManager/MetadataPool.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,15 @@ public function getHydrator($entityType)
106106
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
107107
return $objectManager->get(HydratorPool::class)->getHydrator($entityType);
108108
}
109+
110+
/**
111+
* Check if entity type configuration was set to metadata
112+
*
113+
* @param string $entityType
114+
* @return bool
115+
*/
116+
public function hasConfiguration($entityType)
117+
{
118+
return isset($this->metadata[$entityType]);
119+
}
109120
}

lib/internal/Magento/Framework/EntityManager/Test/Unit/TypeResolverTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ class TypeResolverTest extends \PHPUnit_Framework_TestCase
1717
*/
1818
private $resolver;
1919

20+
/**
21+
* @var \Magento\Framework\EntityManager\MetadataPool|\PHPUnit_Framework_MockObject_MockObject
22+
*/
23+
private $metadataPoolMock;
24+
2025
public function setUp()
2126
{
2227
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
23-
$this->resolver = new \Magento\Framework\EntityManager\TypeResolver();
28+
$this->metadataPoolMock = $this->getMock('\Magento\Framework\EntityManager\MetadataPool', [], [], '', false);
29+
$this->resolver = new \Magento\Framework\EntityManager\TypeResolver($this->metadataPoolMock);
2430
}
2531

2632
/**
@@ -31,6 +37,13 @@ public function setUp()
3137
public function testResolve($dataObject, $interfaceName)
3238
{
3339
$customerDataObject = $this->objectManager->getObject($dataObject);
40+
$this->metadataPoolMock->expects($this->any())
41+
->method('hasConfiguration')
42+
->willReturnMap(
43+
[
44+
[$interfaceName, true]
45+
]
46+
);
3447
$this->assertEquals($interfaceName, $this->resolver->resolve($customerDataObject));
3548
}
3649

lib/internal/Magento/Framework/EntityManager/TypeResolver.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
*/
1111
class TypeResolver
1212
{
13+
/**
14+
* @var MetadataPool
15+
*/
16+
private $metadataPool;
17+
1318
/**
1419
* @var array
1520
*/
@@ -18,6 +23,15 @@ class TypeResolver
1823
\Magento\SalesRule\Model\Rule\Interceptor::class => \Magento\SalesRule\Api\Data\RuleInterface::class
1924
];
2025

26+
/**
27+
* TypeResolver constructor.
28+
* @param MetadataPool $metadataPool
29+
*/
30+
public function __construct(MetadataPool $metadataPool)
31+
{
32+
$this->metadataPool = $metadataPool;
33+
}
34+
2135
/**
2236
* @param object $type
2337
* @return string
@@ -45,6 +59,12 @@ public function resolve($type)
4559
throw new \Exception('Unable to determine data interface for ' . $className);
4660
}
4761

48-
return reset($dataInterfaces);
62+
foreach ($dataInterfaces as $dataInterface) {
63+
if ($this->metadataPool->hasConfiguration($dataInterface)) {
64+
$this->typeMapping[$className] = $dataInterface;
65+
}
66+
}
67+
68+
return $this->typeMapping[$className];
4969
}
5070
}

lib/web/css/docs/actions-toolbar.html

Lines changed: 80 additions & 89 deletions
Large diffs are not rendered by default.

lib/web/css/docs/breadcrumbs.html

Lines changed: 51 additions & 56 deletions
Large diffs are not rendered by default.

lib/web/css/docs/buttons.html

Lines changed: 135 additions & 157 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)